Skip to content

Commit

Permalink
feat: add exports for experimental components (#464)
Browse files Browse the repository at this point in the history
* feat: add exports for experimental components

* chore: rollback manual rc version

* feat(experimental): add color palette and global styles to export

* chore: put codemods back

---------

Co-authored-by: Lena Rashkovan <lena.rashkovan@free-now.com>
  • Loading branch information
martimalek and Lena Rashkovan authored Sep 16, 2024
1 parent a6afc67 commit c71ddf3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
"main": "lib/cjs/index.js",
"typings": "lib/types/index.d.ts",
"module": "lib/esm/index.js",
"exports": {
".": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/esm/index.js"
},
"./experimental": {
"import": "./lib/esm/experimental/index.js",
"require": "./lib/cjs/experimental/index.js",
"default": "./lib/esm/experimental/index.js"
}
},
"typesVersions": {
"*": {
"experimental": [
"lib/types/experimental/index.d.ts"
]
}
},
"bin": {
"run_v2_migration": "./scripts/run_v2_migration.sh"
},
Expand Down
2 changes: 2 additions & 0 deletions src/essentials/experimental/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './theme';
export { createGlobalStyle, ColorPalette } from './Colors';
6 changes: 3 additions & 3 deletions src/essentials/experimental/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DefaultTheme } from 'styled-components';
import { Spaces, Breakpoints, MediaQueries } from '../index';
import { Breakpoints, MediaQueries } from '../index';

const ExperimentalSpaces = [
'0', // 0
Expand All @@ -24,7 +24,7 @@ interface ExperimentalFontWeights {
bold: number;
}

export interface ExperimentalTheme extends DefaultTheme {
interface ExperimentalTheme extends DefaultTheme {
lineHeights: string[];
fontWeights: ExperimentalFontWeights;
chips: any;
Expand Down Expand Up @@ -109,4 +109,4 @@ function fontStack(fonts: string[]): string {
return fonts.map(font => (font.includes(' ') ? `"${font}"` : font)).join(', ');
}

export { theme };
export { theme, ExperimentalTheme };
2 changes: 2 additions & 0 deletions src/experimental/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '../components/experimental';
export * from '../essentials/experimental';
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './components';
export * from './essentials';
export * as experimental from './experimental';
export * from './hooks';
export * from './icons';
export * from './utils';

0 comments on commit c71ddf3

Please sign in to comment.