reshaped 3.8.2 → 3.8.4-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +8 -8
- package/dist/components/Accordion/Accordion.d.ts +1 -6
- package/dist/components/Accordion/Accordion.js +0 -4
- package/dist/components/Accordion/index.d.ts +8 -1
- package/dist/components/Accordion/index.js +7 -1
- package/dist/components/Actionable/Actionable.types.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -4
- package/dist/components/Autocomplete/Autocomplete.js +1 -2
- package/dist/components/Autocomplete/index.d.ts +5 -1
- package/dist/components/Autocomplete/index.js +4 -1
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts +2 -1
- package/dist/components/Badge/Badge.js +0 -2
- package/dist/components/Badge/Badge.types.d.ts +1 -6
- package/dist/components/Badge/index.d.ts +6 -1
- package/dist/components/Badge/index.js +5 -1
- package/dist/components/Badge/tests/Badge.stories.d.ts +3 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -2
- package/dist/components/Breadcrumbs/index.d.ts +6 -1
- package/dist/components/Breadcrumbs/index.js +5 -1
- package/dist/components/Button/Button.d.ts +14 -1
- package/dist/components/Button/Button.js +0 -4
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.types.d.ts +1 -7
- package/dist/components/Button/index.d.ts +8 -1
- package/dist/components/Button/index.js +7 -1
- package/dist/components/Button/tests/Button.stories.d.ts +16 -1
- package/dist/components/Carousel/Carousel.types.d.ts +2 -1
- package/dist/components/Carousel/CarouselControl.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -8
- package/dist/components/ContextMenu/ContextMenu.js +0 -5
- package/dist/components/ContextMenu/index.d.ts +10 -1
- package/dist/components/ContextMenu/index.js +9 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -15
- package/dist/components/DropdownMenu/DropdownMenu.js +7 -14
- package/dist/components/DropdownMenu/index.d.ts +12 -1
- package/dist/components/DropdownMenu/index.js +11 -1
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +5 -5
- package/dist/components/FileUpload/FileUpload.d.ts +2 -4
- package/dist/components/FileUpload/FileUpload.js +1 -2
- package/dist/components/FileUpload/index.d.ts +5 -1
- package/dist/components/FileUpload/index.js +4 -1
- package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +1 -1
- package/dist/components/Flyout/Flyout.d.ts +1 -6
- package/dist/components/Flyout/Flyout.js +0 -4
- package/dist/components/Flyout/index.d.ts +8 -1
- package/dist/components/Flyout/index.js +7 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -8
- package/dist/components/FormControl/FormControl.js +0 -6
- package/dist/components/FormControl/index.d.ts +10 -1
- package/dist/components/FormControl/index.js +9 -1
- package/dist/components/Grid/Grid.d.ts +4 -4
- package/dist/components/Grid/Grid.js +1 -2
- package/dist/components/Grid/index.d.ts +5 -1
- package/dist/components/Grid/index.js +4 -1
- package/dist/components/Grid/tests/Grid.stories.d.ts +2 -4
- package/dist/components/MenuItem/MenuItem.d.ts +12 -1
- package/dist/components/MenuItem/MenuItem.js +0 -2
- package/dist/components/MenuItem/MenuItem.types.d.ts +1 -6
- package/dist/components/MenuItem/index.d.ts +6 -1
- package/dist/components/MenuItem/index.js +5 -1
- package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +13 -1
- package/dist/components/Modal/Modal.d.ts +3 -6
- package/dist/components/Modal/Modal.js +2 -4
- package/dist/components/Modal/index.d.ts +6 -1
- package/dist/components/Modal/index.js +5 -1
- package/dist/components/Modal/tests/Modal.stories.d.ts +2 -2
- package/dist/components/Popover/Popover.d.ts +2 -7
- package/dist/components/Popover/Popover.js +1 -4
- package/dist/components/Popover/index.d.ts +8 -1
- package/dist/components/Popover/index.js +7 -1
- package/dist/components/Popover/tests/Popover.stories.d.ts +1 -1
- package/dist/components/Resizable/Resizable.d.ts +2 -4
- package/dist/components/Resizable/Resizable.js +4 -5
- package/dist/components/Resizable/index.d.ts +7 -1
- package/dist/components/Resizable/index.js +6 -1
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +1 -8
- package/dist/components/Select/Select.js +0 -6
- package/dist/components/Select/index.d.ts +10 -1
- package/dist/components/Select/index.js +9 -1
- package/dist/components/Stepper/Stepper.d.ts +2 -4
- package/dist/components/Stepper/Stepper.js +1 -2
- package/dist/components/Stepper/index.d.ts +5 -1
- package/dist/components/Stepper/index.js +4 -1
- package/dist/components/Stepper/tests/Stepper.stories.d.ts +1 -4
- package/dist/components/Table/Table.d.ts +6 -12
- package/dist/components/Table/Table.js +5 -10
- package/dist/components/Table/index.d.ts +9 -1
- package/dist/components/Table/index.js +8 -1
- package/dist/components/Table/tests/Table.stories.d.ts +5 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -8
- package/dist/components/Tabs/Tabs.js +0 -6
- package/dist/components/Tabs/index.d.ts +10 -1
- package/dist/components/Tabs/index.js +9 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -4
- package/dist/components/TextArea/TextArea.js +0 -2
- package/dist/components/TextArea/index.d.ts +6 -1
- package/dist/components/TextArea/index.js +5 -1
- package/dist/components/TextField/TextField.d.ts +1 -4
- package/dist/components/TextField/TextField.js +0 -2
- package/dist/components/TextField/index.d.ts +6 -1
- package/dist/components/TextField/index.js +5 -1
- package/dist/components/Timeline/Timeline.d.ts +2 -4
- package/dist/components/Timeline/Timeline.js +1 -2
- package/dist/components/Timeline/index.d.ts +5 -1
- package/dist/components/Timeline/index.js +4 -1
- package/dist/components/Timeline/tests/Timeline.stories.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +4 -0
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +19 -0
- package/dist/components/View/View.d.ts +4 -4
- package/dist/components/View/View.js +1 -2
- package/dist/components/View/index.d.ts +5 -1
- package/dist/components/View/index.js +4 -1
- package/dist/components/View/tests/View.stories.d.ts +2 -4
- package/dist/components/_private/Portal/Portal.d.ts +3 -5
- package/dist/components/_private/Portal/Portal.js +1 -2
- package/dist/components/_private/Portal/index.d.ts +5 -1
- package/dist/components/_private/Portal/index.js +4 -1
- package/dist/config/postcss.js +3 -0
- package/package.json +5 -6
- package/dist/cjs/cli/theming/index.d.ts +0 -4
- package/dist/cjs/cli/theming/index.js +0 -40
- package/dist/cjs/cli/theming/reshaped.config.d.ts +0 -3
- package/dist/cjs/cli/theming/reshaped.config.js +0 -25
- package/dist/cjs/cli/theming/tailwind.d.ts +0 -2
- package/dist/cjs/cli/theming/tailwind.js +0 -83
- package/dist/cjs/config/postcss.d.ts +0 -28
- package/dist/cjs/config/postcss.js +0 -33
- package/dist/cjs/config/tailwind.d.ts +0 -2
- package/dist/cjs/config/tailwind.js +0 -86
- package/dist/cjs/constants/breakpoints.d.ts +0 -6
- package/dist/cjs/constants/breakpoints.js +0 -7
- package/dist/cjs/themes/_generator/constants.d.ts +0 -2
- package/dist/cjs/themes/_generator/constants.js +0 -11
- package/dist/cjs/themes/_generator/definitions/figma.d.ts +0 -3
- package/dist/cjs/themes/_generator/definitions/figma.js +0 -197
- package/dist/cjs/themes/_generator/definitions/reshaped.d.ts +0 -3
- package/dist/cjs/themes/_generator/definitions/reshaped.js +0 -210
- package/dist/cjs/themes/_generator/definitions/slate.d.ts +0 -3
- package/dist/cjs/themes/_generator/definitions/slate.js +0 -12
- package/dist/cjs/themes/_generator/tokens/color/color.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/color/color.transforms.js +0 -44
- package/dist/cjs/themes/_generator/tokens/color/color.types.d.ts +0 -33
- package/dist/cjs/themes/_generator/tokens/color/color.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/color/utilities/a11y.d.ts +0 -20
- package/dist/cjs/themes/_generator/tokens/color/utilities/a11y.js +0 -64
- package/dist/cjs/themes/_generator/tokens/color/utilities/convert.d.ts +0 -11
- package/dist/cjs/themes/_generator/tokens/color/utilities/convert.js +0 -33
- package/dist/cjs/themes/_generator/tokens/color/utilities/generateColors.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/color/utilities/generateColors.js +0 -152
- package/dist/cjs/themes/_generator/tokens/color/utilities/generateMetaColors.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/color/utilities/generateMetaColors.js +0 -68
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/a11y.test.d.ts +0 -1
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/a11y.test.js +0 -38
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/convert.test.d.ts +0 -1
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/convert.test.js +0 -48
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/generateColors.test.d.ts +0 -1
- package/dist/cjs/themes/_generator/tokens/color/utilities/tests/generateColors.test.js +0 -21
- package/dist/cjs/themes/_generator/tokens/css.d.ts +0 -6
- package/dist/cjs/themes/_generator/tokens/css.js +0 -52
- package/dist/cjs/themes/_generator/tokens/duration/duration.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/duration/duration.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/duration/duration.types.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/duration/duration.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/easing/easing.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/easing/easing.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/easing/easing.types.d.ts +0 -7
- package/dist/cjs/themes/_generator/tokens/easing/easing.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/font/font.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/font/font.transforms.js +0 -43
- package/dist/cjs/themes/_generator/tokens/font/font.types.d.ts +0 -11
- package/dist/cjs/themes/_generator/tokens/font/font.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.types.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.types.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/radius/radius.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/radius/radius.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/radius/radius.types.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/radius/radius.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/shadow/shadow.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/shadow/shadow.transforms.js +0 -22
- package/dist/cjs/themes/_generator/tokens/shadow/shadow.types.d.ts +0 -13
- package/dist/cjs/themes/_generator/tokens/shadow/shadow.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/transforms.d.ts +0 -13
- package/dist/cjs/themes/_generator/tokens/transforms.js +0 -30
- package/dist/cjs/themes/_generator/tokens/types.d.ts +0 -62
- package/dist/cjs/themes/_generator/tokens/types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/unit/unit.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/unit/unit.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/unit/unit.types.d.ts +0 -5
- package/dist/cjs/themes/_generator/tokens/unit/unit.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/unit/utilities/generate.d.ts +0 -5
- package/dist/cjs/themes/_generator/tokens/unit/utilities/generate.js +0 -16
- package/dist/cjs/themes/_generator/tokens/viewport/viewport.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/viewport/viewport.transforms.js +0 -27
- package/dist/cjs/themes/_generator/tokens/viewport/viewport.types.d.ts +0 -9
- package/dist/cjs/themes/_generator/tokens/viewport/viewport.types.js +0 -2
- package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.transforms.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.transforms.js +0 -11
- package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.types.d.ts +0 -4
- package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.types.js +0 -2
- package/dist/cjs/themes/_generator/transform.d.ts +0 -8
- package/dist/cjs/themes/_generator/transform.js +0 -108
- package/dist/cjs/themes/_generator/types.d.ts +0 -15
- package/dist/cjs/themes/_generator/types.js +0 -2
- package/dist/cjs/themes/_generator/utilities/mergeDefinitions.d.ts +0 -3
- package/dist/cjs/themes/_generator/utilities/mergeDefinitions.js +0 -19
- package/dist/cjs/themes/figma/media.css +0 -1
- package/dist/cjs/themes/figma/tailwind.css +0 -1
- package/dist/cjs/themes/figma/theme.css +0 -1
- package/dist/cjs/themes/fragments/twitter/tailwind.css +0 -1
- package/dist/cjs/themes/fragments/twitter/theme.css +0 -1
- package/dist/cjs/themes/index.d.ts +0 -23
- package/dist/cjs/themes/index.js +0 -21
- package/dist/cjs/themes/reshaped/media.css +0 -1
- package/dist/cjs/themes/reshaped/tailwind.css +0 -1
- package/dist/cjs/themes/reshaped/theme.css +0 -1
- package/dist/cjs/themes/slate/media.css +0 -1
- package/dist/cjs/themes/slate/tailwind.css +0 -1
- package/dist/cjs/themes/slate/theme.css +0 -1
- package/dist/cjs/types/config.d.ts +0 -20
- package/dist/cjs/types/config.js +0 -2
- package/dist/cjs/utilities/string.d.ts +0 -2
- package/dist/cjs/utilities/string.js +0 -15
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addTheme = exports.addThemeFragment = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const mergeDefinitions_1 = __importDefault(require("../../themes/_generator/utilities/mergeDefinitions"));
|
|
11
|
-
const transform_1 = __importDefault(require("../../themes/_generator/transform"));
|
|
12
|
-
const reshaped_1 = __importDefault(require("../../themes/_generator/definitions/reshaped"));
|
|
13
|
-
const tailwind_1 = require("./tailwind");
|
|
14
|
-
const transformDefinition = (name, definition, options) => {
|
|
15
|
-
const { isFragment, outputPath } = options;
|
|
16
|
-
const code = (0, transform_1.default)(name, definition, options);
|
|
17
|
-
const themeFolderPath = isFragment
|
|
18
|
-
? path_1.default.resolve(outputPath, "fragments", name)
|
|
19
|
-
: path_1.default.resolve(outputPath, name);
|
|
20
|
-
const themePath = path_1.default.resolve(themeFolderPath, "theme.css");
|
|
21
|
-
const themeMediaPath = path_1.default.resolve(themeFolderPath, "media.css");
|
|
22
|
-
const twPath = path_1.default.resolve(themeFolderPath, "tailwind.css");
|
|
23
|
-
const themeJsonPath = path_1.default.resolve(themeFolderPath, "theme.json");
|
|
24
|
-
fs_1.default.mkdirSync(themeFolderPath, { recursive: true });
|
|
25
|
-
fs_1.default.writeFileSync(themePath, code.variables);
|
|
26
|
-
fs_1.default.writeFileSync(themeJsonPath, JSON.stringify(code.theme, null, 2));
|
|
27
|
-
fs_1.default.writeFileSync(twPath, (0, tailwind_1.transformToTailwind)(code.theme));
|
|
28
|
-
if (code.media)
|
|
29
|
-
fs_1.default.writeFileSync(themeMediaPath, code.media);
|
|
30
|
-
const logOutput = `Compiled ${chalk_1.default.bold(name)} theme${isFragment ? " fragment" : ""}`;
|
|
31
|
-
console.log(chalk_1.default.green(logOutput));
|
|
32
|
-
};
|
|
33
|
-
const addThemeFragment = (name, definition, options) => {
|
|
34
|
-
transformDefinition(name, definition, { ...options, isFragment: true });
|
|
35
|
-
};
|
|
36
|
-
exports.addThemeFragment = addThemeFragment;
|
|
37
|
-
const addTheme = (name, definition, options) => {
|
|
38
|
-
transformDefinition(name, (0, mergeDefinitions_1.default)(reshaped_1.default, definition), options);
|
|
39
|
-
};
|
|
40
|
-
exports.addTheme = addTheme;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const reshaped_1 = __importDefault(require("../../themes/_generator/definitions/reshaped"));
|
|
7
|
-
const figma_1 = __importDefault(require("../../themes/_generator/definitions/figma"));
|
|
8
|
-
const slate_1 = __importDefault(require("../../themes/_generator/definitions/slate"));
|
|
9
|
-
const config = {
|
|
10
|
-
themes: {
|
|
11
|
-
reshaped: reshaped_1.default,
|
|
12
|
-
figma: figma_1.default,
|
|
13
|
-
slate: slate_1.default,
|
|
14
|
-
},
|
|
15
|
-
themeFragments: {
|
|
16
|
-
twitter: {
|
|
17
|
-
color: {
|
|
18
|
-
backgroundPrimary: { hex: "#1da1f2" },
|
|
19
|
-
backgroundPrimaryHighlighted: { hex: "#1a90da" },
|
|
20
|
-
onBackgroundPrimary: { hex: "#ffffff" },
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
exports.default = config;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.transformToTailwind = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Transform JS theme defintion to Tailwind 4 CSS definition
|
|
9
|
-
*/
|
|
10
|
-
const reshaped_1 = __importDefault(require("../../themes/_generator/definitions/reshaped"));
|
|
11
|
-
const mergeDefinitions_1 = __importDefault(require("../../themes/_generator/utilities/mergeDefinitions"));
|
|
12
|
-
const string_1 = require("../../utilities/string");
|
|
13
|
-
const transformToTailwind = (theme) => {
|
|
14
|
-
const variables = {};
|
|
15
|
-
const definition = theme
|
|
16
|
-
? (0, mergeDefinitions_1.default)(reshaped_1.default, theme)
|
|
17
|
-
: reshaped_1.default;
|
|
18
|
-
Object.keys(definition.color).forEach((tokenName) => {
|
|
19
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
20
|
-
const cssVariable = ["rs", "color", cssTokenName].join("-");
|
|
21
|
-
const configValue = `var(--${cssVariable})`;
|
|
22
|
-
if (cssTokenName.startsWith("rgb-"))
|
|
23
|
-
return;
|
|
24
|
-
if (cssTokenName.startsWith("background-")) {
|
|
25
|
-
const name = cssTokenName.replace("background-", "");
|
|
26
|
-
variables[`--background-color-${name}`] = configValue;
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (cssTokenName.startsWith("on-")) {
|
|
30
|
-
// Replacing on- separately to support on-brand
|
|
31
|
-
const name = cssTokenName.replace("on-", "").replace("background-", "");
|
|
32
|
-
variables[`--text-color-on-${name}`] = configValue;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (cssTokenName.startsWith("foreground-")) {
|
|
36
|
-
const name = cssTokenName.replace("foreground-", "");
|
|
37
|
-
variables[`--text-color-${name}`] = configValue;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (cssTokenName.startsWith("border-")) {
|
|
41
|
-
const name = cssTokenName.replace("border-", "");
|
|
42
|
-
variables[`--border-color-${name}`] = configValue;
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
variables[`--color-${cssTokenName}`] = configValue;
|
|
46
|
-
});
|
|
47
|
-
Object.keys(definition.radius).forEach((tokenName) => {
|
|
48
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
49
|
-
variables[`--radius-${tokenName}`] = `var(--rs-radius-${cssTokenName})`;
|
|
50
|
-
return;
|
|
51
|
-
});
|
|
52
|
-
Object.keys(definition.unit).forEach((tokenName) => {
|
|
53
|
-
if (tokenName.startsWith("base")) {
|
|
54
|
-
[...Array(11).keys()].forEach((i) => {
|
|
55
|
-
if (i === 0) {
|
|
56
|
-
variables[`--spacing-0`] = "0px";
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
variables[`--spacing-x${i}`] = `var(--rs-unit-x${i})`;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
Object.keys(definition.shadow).forEach((tokenName) => {
|
|
65
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
66
|
-
const cssVariable = ["rs", "shadow", cssTokenName].join("-");
|
|
67
|
-
const configValue = `var(--${cssVariable})`;
|
|
68
|
-
const name = cssTokenName.replace("shadow-", "");
|
|
69
|
-
variables[`--shadow-${name}`] = configValue;
|
|
70
|
-
return;
|
|
71
|
-
});
|
|
72
|
-
Object.entries(definition.viewport).forEach(([tokenName, tokenValue]) => {
|
|
73
|
-
if (!tokenValue.minPx)
|
|
74
|
-
return;
|
|
75
|
-
variables[`--breakpoint-${tokenName}`] = `${tokenValue.minPx}px`;
|
|
76
|
-
});
|
|
77
|
-
return `@theme inline {
|
|
78
|
-
${Object.entries(variables)
|
|
79
|
-
.map(([key, value]) => `${key}: ${value};`)
|
|
80
|
-
.join("\n")}
|
|
81
|
-
}`;
|
|
82
|
-
};
|
|
83
|
-
exports.transformToTailwind = transformToTailwind;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const config: {
|
|
2
|
-
plugins: {
|
|
3
|
-
"@csstools/postcss-global-data": {
|
|
4
|
-
files: string[];
|
|
5
|
-
};
|
|
6
|
-
"postcss-custom-media": {};
|
|
7
|
-
cssnano: {
|
|
8
|
-
preset: (string | {
|
|
9
|
-
calc: boolean;
|
|
10
|
-
})[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export declare const getConfig: (options: {
|
|
15
|
-
themeMediaCSSPath: string;
|
|
16
|
-
}) => {
|
|
17
|
-
plugins: {
|
|
18
|
-
"@csstools/postcss-global-data": {
|
|
19
|
-
files: string[];
|
|
20
|
-
};
|
|
21
|
-
"postcss-custom-media": {};
|
|
22
|
-
cssnano: {
|
|
23
|
-
preset: (string | {
|
|
24
|
-
calc: boolean;
|
|
25
|
-
})[];
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getConfig = exports.config = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const defaultThemeMediaCSSPath = path_1.default.resolve(__dirname, "../themes/reshaped/media.css");
|
|
9
|
-
// Using [plugin]: { ...options } format here because it's supported by the most frameworks
|
|
10
|
-
// - require('plugin') is not supported by Next
|
|
11
|
-
// - ['plugin', options] is not supported by Vite
|
|
12
|
-
exports.config = {
|
|
13
|
-
plugins: {
|
|
14
|
-
"@csstools/postcss-global-data": {
|
|
15
|
-
files: [defaultThemeMediaCSSPath],
|
|
16
|
-
},
|
|
17
|
-
"postcss-custom-media": {},
|
|
18
|
-
cssnano: { preset: ["default", { calc: false }] },
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
const getConfig = (options) => {
|
|
22
|
-
const { themeMediaCSSPath = defaultThemeMediaCSSPath } = options;
|
|
23
|
-
return {
|
|
24
|
-
plugins: {
|
|
25
|
-
"@csstools/postcss-global-data": {
|
|
26
|
-
files: [themeMediaCSSPath],
|
|
27
|
-
},
|
|
28
|
-
"postcss-custom-media": {},
|
|
29
|
-
cssnano: { preset: ["default", { calc: false }] },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
exports.getConfig = getConfig;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { ThemeDefinition } from "../themes/_generator/tokens/types";
|
|
2
|
-
export declare const getTheme: (theme?: ThemeDefinition) => Record<"backgroundColor" | "textColor" | "borderColor" | "colors" | "borderRadius" | "spacing" | "boxShadow" | "screens", Record<string, string>>;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTheme = void 0;
|
|
7
|
-
const reshaped_1 = __importDefault(require("../themes/_generator/definitions/reshaped"));
|
|
8
|
-
const string_1 = require("../utilities/string");
|
|
9
|
-
const mergeDefinitions_1 = __importDefault(require("../themes/_generator/utilities/mergeDefinitions"));
|
|
10
|
-
const constants_1 = require("../themes/_generator/constants");
|
|
11
|
-
const getTheme = (theme) => {
|
|
12
|
-
const config = {
|
|
13
|
-
backgroundColor: {},
|
|
14
|
-
textColor: {},
|
|
15
|
-
borderColor: {},
|
|
16
|
-
colors: {},
|
|
17
|
-
borderRadius: {},
|
|
18
|
-
spacing: {},
|
|
19
|
-
boxShadow: {},
|
|
20
|
-
screens: {},
|
|
21
|
-
};
|
|
22
|
-
const definition = theme
|
|
23
|
-
? (0, mergeDefinitions_1.default)(reshaped_1.default, theme)
|
|
24
|
-
: reshaped_1.default;
|
|
25
|
-
Object.keys(definition.color).forEach((tokenName) => {
|
|
26
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
27
|
-
const cssVariable = ["rs", "color", cssTokenName].join("-");
|
|
28
|
-
const configValue = `var(--${cssVariable})`;
|
|
29
|
-
if (tokenName.startsWith("background")) {
|
|
30
|
-
const name = cssTokenName.replace("background-", "");
|
|
31
|
-
config.backgroundColor[name] = configValue;
|
|
32
|
-
if (constants_1.bgWithDynamicForeground.includes(tokenName)) {
|
|
33
|
-
const cssVariable = ["rs", "color", "on", cssTokenName].join("-");
|
|
34
|
-
const configValue = `var(--${cssVariable})`;
|
|
35
|
-
config.textColor[`on-${name}`] = configValue;
|
|
36
|
-
}
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (tokenName.startsWith("foreground")) {
|
|
40
|
-
const name = cssTokenName.replace("foreground-", "");
|
|
41
|
-
config.textColor[name] = configValue;
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (tokenName.startsWith("border")) {
|
|
45
|
-
const name = cssTokenName.replace("border-", "");
|
|
46
|
-
config.borderColor[name] = configValue;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
config.backgroundColor[cssTokenName] = configValue;
|
|
50
|
-
config.borderColor[cssTokenName] = configValue;
|
|
51
|
-
config.textColor[cssTokenName] = configValue;
|
|
52
|
-
config.colors[cssTokenName] = configValue;
|
|
53
|
-
});
|
|
54
|
-
Object.keys(definition.radius).forEach((tokenName) => {
|
|
55
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
56
|
-
config.borderRadius[tokenName] = `var(--rs-radius-${cssTokenName})`;
|
|
57
|
-
return;
|
|
58
|
-
});
|
|
59
|
-
Object.keys(definition.unit).forEach((tokenName) => {
|
|
60
|
-
if (tokenName.startsWith("base")) {
|
|
61
|
-
[...Array(11).keys()].forEach((i) => {
|
|
62
|
-
if (i === 0) {
|
|
63
|
-
config.spacing["0"] = "0px";
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
config.spacing[`x${i}`] = `var(--rs-unit-x${i})`;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
Object.keys(definition.shadow).forEach((tokenName) => {
|
|
72
|
-
const cssTokenName = (0, string_1.camelToKebab)(tokenName);
|
|
73
|
-
const cssVariable = ["rs", "shadow", cssTokenName].join("-");
|
|
74
|
-
const configValue = `var(--${cssVariable})`;
|
|
75
|
-
const name = cssTokenName.replace("shadow-", "");
|
|
76
|
-
config.boxShadow[name] = configValue;
|
|
77
|
-
return;
|
|
78
|
-
});
|
|
79
|
-
Object.entries(definition.viewport).forEach(([tokenName, tokenValue]) => {
|
|
80
|
-
if (!tokenValue.minPx)
|
|
81
|
-
return;
|
|
82
|
-
config.screens[tokenName] = `${tokenValue.minPx}px`;
|
|
83
|
-
});
|
|
84
|
-
return config;
|
|
85
|
-
};
|
|
86
|
-
exports.getTheme = getTheme;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bgWithDynamicForeground = void 0;
|
|
4
|
-
exports.bgWithDynamicForeground = [
|
|
5
|
-
"backgroundNeutral",
|
|
6
|
-
"backgroundPrimary",
|
|
7
|
-
"backgroundCritical",
|
|
8
|
-
"backgroundWarning",
|
|
9
|
-
"backgroundPositive",
|
|
10
|
-
"brand",
|
|
11
|
-
];
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const theme = {
|
|
4
|
-
fontFamily: {
|
|
5
|
-
title: {
|
|
6
|
-
family: "Inter, BlinkMacSystemFont, -apple-system, Roboto, Helvetica, Arial, sans-serif",
|
|
7
|
-
},
|
|
8
|
-
body: {
|
|
9
|
-
family: "Inter, BlinkMacSystemFont, -apple-system, Roboto, Helvetica, Arial, sans-serif",
|
|
10
|
-
},
|
|
11
|
-
monospace: {
|
|
12
|
-
family: "SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
fontWeight: {
|
|
16
|
-
regular: { weight: 400 },
|
|
17
|
-
medium: { weight: 500 },
|
|
18
|
-
semibold: { weight: 600 },
|
|
19
|
-
bold: { weight: 700 },
|
|
20
|
-
extrabold: { weight: 800 },
|
|
21
|
-
black: { weight: 900 },
|
|
22
|
-
},
|
|
23
|
-
font: {
|
|
24
|
-
title1: {
|
|
25
|
-
fontSize: { px: 80 },
|
|
26
|
-
lineHeight: { px: 84 },
|
|
27
|
-
fontWeightToken: "semibold",
|
|
28
|
-
fontFamilyToken: "title",
|
|
29
|
-
},
|
|
30
|
-
title2: {
|
|
31
|
-
fontSize: { px: 64 },
|
|
32
|
-
lineHeight: { px: 68 },
|
|
33
|
-
fontWeightToken: "semibold",
|
|
34
|
-
fontFamilyToken: "title",
|
|
35
|
-
},
|
|
36
|
-
title3: {
|
|
37
|
-
fontSize: { px: 56 },
|
|
38
|
-
lineHeight: { px: 60 },
|
|
39
|
-
fontWeightToken: "semibold",
|
|
40
|
-
fontFamilyToken: "title",
|
|
41
|
-
},
|
|
42
|
-
title4: {
|
|
43
|
-
fontSize: { px: 40 },
|
|
44
|
-
lineHeight: { px: 44 },
|
|
45
|
-
fontWeightToken: "semibold",
|
|
46
|
-
fontFamilyToken: "title",
|
|
47
|
-
},
|
|
48
|
-
title5: {
|
|
49
|
-
fontSize: { px: 36 },
|
|
50
|
-
lineHeight: { px: 40 },
|
|
51
|
-
fontWeightToken: "semibold",
|
|
52
|
-
fontFamilyToken: "title",
|
|
53
|
-
},
|
|
54
|
-
title6: {
|
|
55
|
-
fontSize: { px: 24 },
|
|
56
|
-
lineHeight: { px: 28 },
|
|
57
|
-
fontWeightToken: "semibold",
|
|
58
|
-
fontFamilyToken: "title",
|
|
59
|
-
},
|
|
60
|
-
featured1: {
|
|
61
|
-
fontSize: { px: 22 },
|
|
62
|
-
lineHeight: { px: 28 },
|
|
63
|
-
fontFamilyToken: "body",
|
|
64
|
-
},
|
|
65
|
-
featured2: {
|
|
66
|
-
fontSize: { px: 20 },
|
|
67
|
-
lineHeight: { px: 28 },
|
|
68
|
-
fontFamilyToken: "body",
|
|
69
|
-
},
|
|
70
|
-
featured3: {
|
|
71
|
-
fontSize: { px: 18 },
|
|
72
|
-
lineHeight: { px: 24 },
|
|
73
|
-
fontFamilyToken: "body",
|
|
74
|
-
},
|
|
75
|
-
body1: {
|
|
76
|
-
fontSize: { px: 14 },
|
|
77
|
-
lineHeight: { px: 20 },
|
|
78
|
-
fontFamilyToken: "body",
|
|
79
|
-
},
|
|
80
|
-
body2: {
|
|
81
|
-
fontSize: { px: 13 },
|
|
82
|
-
lineHeight: { px: 20 },
|
|
83
|
-
fontFamilyToken: "body",
|
|
84
|
-
},
|
|
85
|
-
body3: {
|
|
86
|
-
fontSize: { px: 11 },
|
|
87
|
-
lineHeight: { px: 16 },
|
|
88
|
-
fontFamilyToken: "body",
|
|
89
|
-
},
|
|
90
|
-
caption1: {
|
|
91
|
-
fontSize: { px: 11 },
|
|
92
|
-
lineHeight: { px: 16 },
|
|
93
|
-
fontFamilyToken: "body",
|
|
94
|
-
},
|
|
95
|
-
caption2: {
|
|
96
|
-
fontSize: { px: 10 },
|
|
97
|
-
lineHeight: { px: 12 },
|
|
98
|
-
fontFamilyToken: "body",
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
unit: {
|
|
102
|
-
base: { px: 4 },
|
|
103
|
-
radiusSmall: { px: 4 },
|
|
104
|
-
radiusMedium: { px: 4 },
|
|
105
|
-
radiusLarge: { px: 4 },
|
|
106
|
-
},
|
|
107
|
-
color: {
|
|
108
|
-
foregroundNeutral: { hex: "#191919", hexDark: "#FFFFFF" },
|
|
109
|
-
foregroundNeutralFaded: { hex: "#474747", hexDark: "#B2B2B2" },
|
|
110
|
-
foregroundDisabled: { hex: "#B2B2B2", hexDark: "#656565" },
|
|
111
|
-
foregroundPrimary: { hex: "#007BE5", hexDark: "#7CC4F8" },
|
|
112
|
-
foregroundPositive: { hex: "#009951", hexDark: "#79D297" },
|
|
113
|
-
foregroundCritical: { hex: "#DC3412", hexDark: "#FCA397" },
|
|
114
|
-
foregroundWarning: { hex: "#7b6305", hexDark: "#b4920c" },
|
|
115
|
-
backgroundNeutral: { hex: "#DFE2EA", hexDark: "#444444" },
|
|
116
|
-
backgroundNeutralFaded: { hex: "#F5F5F5", hexDark: "#383838" },
|
|
117
|
-
backgroundDisabled: { hex: "#e4e4e4", hexDark: "#474747" },
|
|
118
|
-
backgroundDisabledFaded: { hex: "#F5F5F5", hexDark: "#3A3A3A" },
|
|
119
|
-
backgroundPrimary: { hex: "#0D99FF", hexDark: "#0C8CE9" },
|
|
120
|
-
backgroundPrimaryFaded: { hex: "#E5F4FF", hexDark: "#394360" },
|
|
121
|
-
backgroundPositive: { hex: "#14AE5C", hexDark: "#198F51" },
|
|
122
|
-
backgroundPositiveFaded: { hex: "#DAECDF", hexDark: "#3d5749" },
|
|
123
|
-
backgroundCritical: { hex: "#F24822", hexDark: "#E03E1A" },
|
|
124
|
-
backgroundCriticalFaded: { hex: "#FFE2E0", hexDark: "#60332A" },
|
|
125
|
-
backgroundWarning: { hex: "#facc15", hexDark: "#f1c512" },
|
|
126
|
-
backgroundWarningFaded: { hex: "#fffae9", hexDark: "#2c271f" },
|
|
127
|
-
borderNeutral: { hex: "#E6E6E6", hexDark: "#444444" },
|
|
128
|
-
borderNeutralFaded: { hex: "#E6E6E6", hexDark: "#444444" },
|
|
129
|
-
borderDisabled: { hex: "#E6E6E6", hexDark: "#3E3E3E" },
|
|
130
|
-
borderPrimary: { hex: "#007BE5", hexDark: "#7CC4F8" },
|
|
131
|
-
borderPrimaryFaded: { hex: "#BDE3FF", hexDark: "#2A4D72" },
|
|
132
|
-
borderPositive: { hex: "#009951", hexDark: "#79D297" },
|
|
133
|
-
borderPositiveFaded: { hex: "#BBDDC6", hexDark: "#086338" },
|
|
134
|
-
borderCritical: { hex: "#DC3412", hexDark: "#FCA397" },
|
|
135
|
-
borderCriticalFaded: { hex: "#FFC7C2", hexDark: "#803226" },
|
|
136
|
-
borderWarning: { hex: "#cfa90f", hexDark: "#b4920a" },
|
|
137
|
-
borderWarningFaded: { hex: "#ece2c4", hexDark: "#453c1e" },
|
|
138
|
-
backgroundPage: { hex: "#FFFFFF", hexDark: "#2C2C2C" },
|
|
139
|
-
backgroundPageFaded: { hex: "#FAFAFA", hexDark: "#1E1E1E" },
|
|
140
|
-
backgroundElevationBase: { hex: "#FFFFFF", hexDark: "#2C2C2C" },
|
|
141
|
-
backgroundElevationRaised: { hex: "#FFFFFF", hexDark: "#2C2C2C" },
|
|
142
|
-
backgroundElevationOverlay: { hex: "#FFFFFF", hexDark: "#2C2C2C" },
|
|
143
|
-
onBackgroundPrimary: { hex: "#FFFFFF" },
|
|
144
|
-
brand: { hex: "#0D99FF" },
|
|
145
|
-
black: { hex: "#000000" },
|
|
146
|
-
white: { hex: "#FFFFFF" },
|
|
147
|
-
},
|
|
148
|
-
duration: {
|
|
149
|
-
rapid: { ms: 100 },
|
|
150
|
-
fast: { ms: 200 },
|
|
151
|
-
medium: { ms: 300 },
|
|
152
|
-
slow: { ms: 400 },
|
|
153
|
-
},
|
|
154
|
-
easing: {
|
|
155
|
-
standard: { x1: 0.4, y1: 0, x2: 0.2, y2: 1 },
|
|
156
|
-
accelerate: { x1: 0.4, y1: 0, x2: 1, y2: 1 },
|
|
157
|
-
decelerate: { x1: 0, y1: 0, x2: 0.2, y2: 1 },
|
|
158
|
-
},
|
|
159
|
-
shadow: {
|
|
160
|
-
raised: [
|
|
161
|
-
{
|
|
162
|
-
offsetX: 0,
|
|
163
|
-
offsetY: 1,
|
|
164
|
-
blurRadius: 3,
|
|
165
|
-
colorToken: "black",
|
|
166
|
-
opacity: 0.15,
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
overlay: [
|
|
170
|
-
{
|
|
171
|
-
offsetX: 0,
|
|
172
|
-
offsetY: 10,
|
|
173
|
-
blurRadius: 24,
|
|
174
|
-
colorToken: "black",
|
|
175
|
-
opacity: 0.1,
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
offsetX: 0,
|
|
179
|
-
offsetY: 2,
|
|
180
|
-
blurRadius: 5,
|
|
181
|
-
colorToken: "black",
|
|
182
|
-
opacity: 0.04,
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
viewport: {
|
|
187
|
-
m: { minPx: 660 },
|
|
188
|
-
l: { minPx: 900 },
|
|
189
|
-
xl: { minPx: 1280 },
|
|
190
|
-
},
|
|
191
|
-
zIndex: {
|
|
192
|
-
relative: { level: 10 },
|
|
193
|
-
absolute: { level: 100 },
|
|
194
|
-
fixed: { level: 200 },
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
exports.default = theme;
|