reshaped 3.8.3 → 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.
Files changed (232) hide show
  1. package/dist/bundle.css +1 -1
  2. package/dist/bundle.js +8 -8
  3. package/dist/components/Accordion/Accordion.d.ts +1 -6
  4. package/dist/components/Accordion/Accordion.js +0 -4
  5. package/dist/components/Accordion/index.d.ts +8 -1
  6. package/dist/components/Accordion/index.js +7 -1
  7. package/dist/components/Actionable/Actionable.types.d.ts +1 -1
  8. package/dist/components/Autocomplete/Autocomplete.d.ts +2 -4
  9. package/dist/components/Autocomplete/Autocomplete.js +1 -2
  10. package/dist/components/Autocomplete/index.d.ts +5 -1
  11. package/dist/components/Autocomplete/index.js +4 -1
  12. package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +1 -1
  13. package/dist/components/Badge/Badge.d.ts +2 -1
  14. package/dist/components/Badge/Badge.js +0 -2
  15. package/dist/components/Badge/Badge.types.d.ts +1 -6
  16. package/dist/components/Badge/index.d.ts +6 -1
  17. package/dist/components/Badge/index.js +5 -1
  18. package/dist/components/Badge/tests/Badge.stories.d.ts +3 -1
  19. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -4
  20. package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -2
  21. package/dist/components/Breadcrumbs/index.d.ts +6 -1
  22. package/dist/components/Breadcrumbs/index.js +5 -1
  23. package/dist/components/Button/Button.d.ts +14 -1
  24. package/dist/components/Button/Button.js +0 -4
  25. package/dist/components/Button/Button.module.css +1 -1
  26. package/dist/components/Button/Button.types.d.ts +1 -7
  27. package/dist/components/Button/index.d.ts +8 -1
  28. package/dist/components/Button/index.js +7 -1
  29. package/dist/components/Button/tests/Button.stories.d.ts +16 -1
  30. package/dist/components/Carousel/Carousel.types.d.ts +2 -1
  31. package/dist/components/Carousel/CarouselControl.d.ts +2 -1
  32. package/dist/components/ContextMenu/ContextMenu.d.ts +1 -8
  33. package/dist/components/ContextMenu/ContextMenu.js +0 -5
  34. package/dist/components/ContextMenu/index.d.ts +10 -1
  35. package/dist/components/ContextMenu/index.js +9 -1
  36. package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -15
  37. package/dist/components/DropdownMenu/DropdownMenu.js +7 -14
  38. package/dist/components/DropdownMenu/index.d.ts +12 -1
  39. package/dist/components/DropdownMenu/index.js +11 -1
  40. package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +5 -5
  41. package/dist/components/FileUpload/FileUpload.d.ts +2 -4
  42. package/dist/components/FileUpload/FileUpload.js +1 -2
  43. package/dist/components/FileUpload/index.d.ts +5 -1
  44. package/dist/components/FileUpload/index.js +4 -1
  45. package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +1 -1
  46. package/dist/components/Flyout/Flyout.d.ts +1 -6
  47. package/dist/components/Flyout/Flyout.js +0 -4
  48. package/dist/components/Flyout/index.d.ts +8 -1
  49. package/dist/components/Flyout/index.js +7 -1
  50. package/dist/components/FormControl/FormControl.d.ts +1 -8
  51. package/dist/components/FormControl/FormControl.js +0 -6
  52. package/dist/components/FormControl/index.d.ts +10 -1
  53. package/dist/components/FormControl/index.js +9 -1
  54. package/dist/components/Grid/Grid.d.ts +4 -4
  55. package/dist/components/Grid/Grid.js +1 -2
  56. package/dist/components/Grid/index.d.ts +5 -1
  57. package/dist/components/Grid/index.js +4 -1
  58. package/dist/components/Grid/tests/Grid.stories.d.ts +2 -4
  59. package/dist/components/MenuItem/MenuItem.d.ts +12 -1
  60. package/dist/components/MenuItem/MenuItem.js +0 -2
  61. package/dist/components/MenuItem/MenuItem.types.d.ts +1 -6
  62. package/dist/components/MenuItem/index.d.ts +6 -1
  63. package/dist/components/MenuItem/index.js +5 -1
  64. package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +13 -1
  65. package/dist/components/Modal/Modal.d.ts +3 -6
  66. package/dist/components/Modal/Modal.js +2 -4
  67. package/dist/components/Modal/index.d.ts +6 -1
  68. package/dist/components/Modal/index.js +5 -1
  69. package/dist/components/Modal/tests/Modal.stories.d.ts +2 -2
  70. package/dist/components/Popover/Popover.d.ts +2 -7
  71. package/dist/components/Popover/Popover.js +1 -4
  72. package/dist/components/Popover/index.d.ts +8 -1
  73. package/dist/components/Popover/index.js +7 -1
  74. package/dist/components/Popover/tests/Popover.stories.d.ts +1 -1
  75. package/dist/components/Resizable/Resizable.d.ts +2 -4
  76. package/dist/components/Resizable/Resizable.js +4 -5
  77. package/dist/components/Resizable/index.d.ts +7 -1
  78. package/dist/components/Resizable/index.js +6 -1
  79. package/dist/components/Resizable/tests/Resizable.stories.d.ts +2 -2
  80. package/dist/components/Select/Select.d.ts +1 -8
  81. package/dist/components/Select/Select.js +0 -6
  82. package/dist/components/Select/index.d.ts +10 -1
  83. package/dist/components/Select/index.js +9 -1
  84. package/dist/components/Stepper/Stepper.d.ts +2 -4
  85. package/dist/components/Stepper/Stepper.js +1 -2
  86. package/dist/components/Stepper/index.d.ts +5 -1
  87. package/dist/components/Stepper/index.js +4 -1
  88. package/dist/components/Stepper/tests/Stepper.stories.d.ts +1 -4
  89. package/dist/components/Table/Table.d.ts +6 -12
  90. package/dist/components/Table/Table.js +5 -10
  91. package/dist/components/Table/index.d.ts +9 -1
  92. package/dist/components/Table/index.js +8 -1
  93. package/dist/components/Table/tests/Table.stories.d.ts +5 -5
  94. package/dist/components/Tabs/Tabs.d.ts +1 -8
  95. package/dist/components/Tabs/Tabs.js +0 -6
  96. package/dist/components/Tabs/index.d.ts +10 -1
  97. package/dist/components/Tabs/index.js +9 -1
  98. package/dist/components/TextArea/TextArea.d.ts +1 -4
  99. package/dist/components/TextArea/TextArea.js +0 -2
  100. package/dist/components/TextArea/index.d.ts +6 -1
  101. package/dist/components/TextArea/index.js +5 -1
  102. package/dist/components/TextField/TextField.d.ts +1 -4
  103. package/dist/components/TextField/TextField.js +0 -2
  104. package/dist/components/TextField/index.d.ts +6 -1
  105. package/dist/components/TextField/index.js +5 -1
  106. package/dist/components/Timeline/Timeline.d.ts +2 -4
  107. package/dist/components/Timeline/Timeline.js +1 -2
  108. package/dist/components/Timeline/index.d.ts +5 -1
  109. package/dist/components/Timeline/index.js +4 -1
  110. package/dist/components/Timeline/tests/Timeline.stories.d.ts +1 -1
  111. package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +4 -0
  112. package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +15 -0
  113. package/dist/components/View/View.d.ts +4 -4
  114. package/dist/components/View/View.js +1 -2
  115. package/dist/components/View/index.d.ts +5 -1
  116. package/dist/components/View/index.js +4 -1
  117. package/dist/components/View/tests/View.stories.d.ts +2 -4
  118. package/dist/components/_private/Portal/Portal.d.ts +3 -5
  119. package/dist/components/_private/Portal/Portal.js +1 -2
  120. package/dist/components/_private/Portal/index.d.ts +5 -1
  121. package/dist/components/_private/Portal/index.js +4 -1
  122. package/dist/config/postcss.js +3 -0
  123. package/package.json +5 -6
  124. package/dist/cjs/cli/theming/index.d.ts +0 -4
  125. package/dist/cjs/cli/theming/index.js +0 -40
  126. package/dist/cjs/cli/theming/reshaped.config.d.ts +0 -3
  127. package/dist/cjs/cli/theming/reshaped.config.js +0 -25
  128. package/dist/cjs/cli/theming/tailwind.d.ts +0 -2
  129. package/dist/cjs/cli/theming/tailwind.js +0 -83
  130. package/dist/cjs/config/postcss.d.ts +0 -28
  131. package/dist/cjs/config/postcss.js +0 -33
  132. package/dist/cjs/config/tailwind.d.ts +0 -2
  133. package/dist/cjs/config/tailwind.js +0 -86
  134. package/dist/cjs/constants/breakpoints.d.ts +0 -6
  135. package/dist/cjs/constants/breakpoints.js +0 -7
  136. package/dist/cjs/themes/_generator/constants.d.ts +0 -2
  137. package/dist/cjs/themes/_generator/constants.js +0 -11
  138. package/dist/cjs/themes/_generator/definitions/figma.d.ts +0 -3
  139. package/dist/cjs/themes/_generator/definitions/figma.js +0 -197
  140. package/dist/cjs/themes/_generator/definitions/reshaped.d.ts +0 -3
  141. package/dist/cjs/themes/_generator/definitions/reshaped.js +0 -210
  142. package/dist/cjs/themes/_generator/definitions/slate.d.ts +0 -3
  143. package/dist/cjs/themes/_generator/definitions/slate.js +0 -12
  144. package/dist/cjs/themes/_generator/tokens/color/color.transforms.d.ts +0 -4
  145. package/dist/cjs/themes/_generator/tokens/color/color.transforms.js +0 -44
  146. package/dist/cjs/themes/_generator/tokens/color/color.types.d.ts +0 -33
  147. package/dist/cjs/themes/_generator/tokens/color/color.types.js +0 -2
  148. package/dist/cjs/themes/_generator/tokens/color/utilities/a11y.d.ts +0 -20
  149. package/dist/cjs/themes/_generator/tokens/color/utilities/a11y.js +0 -64
  150. package/dist/cjs/themes/_generator/tokens/color/utilities/convert.d.ts +0 -11
  151. package/dist/cjs/themes/_generator/tokens/color/utilities/convert.js +0 -33
  152. package/dist/cjs/themes/_generator/tokens/color/utilities/generateColors.d.ts +0 -4
  153. package/dist/cjs/themes/_generator/tokens/color/utilities/generateColors.js +0 -152
  154. package/dist/cjs/themes/_generator/tokens/color/utilities/generateMetaColors.d.ts +0 -4
  155. package/dist/cjs/themes/_generator/tokens/color/utilities/generateMetaColors.js +0 -68
  156. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/a11y.test.d.ts +0 -1
  157. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/a11y.test.js +0 -38
  158. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/convert.test.d.ts +0 -1
  159. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/convert.test.js +0 -48
  160. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/generateColors.test.d.ts +0 -1
  161. package/dist/cjs/themes/_generator/tokens/color/utilities/tests/generateColors.test.js +0 -21
  162. package/dist/cjs/themes/_generator/tokens/css.d.ts +0 -6
  163. package/dist/cjs/themes/_generator/tokens/css.js +0 -52
  164. package/dist/cjs/themes/_generator/tokens/duration/duration.transforms.d.ts +0 -4
  165. package/dist/cjs/themes/_generator/tokens/duration/duration.transforms.js +0 -11
  166. package/dist/cjs/themes/_generator/tokens/duration/duration.types.d.ts +0 -4
  167. package/dist/cjs/themes/_generator/tokens/duration/duration.types.js +0 -2
  168. package/dist/cjs/themes/_generator/tokens/easing/easing.transforms.d.ts +0 -4
  169. package/dist/cjs/themes/_generator/tokens/easing/easing.transforms.js +0 -11
  170. package/dist/cjs/themes/_generator/tokens/easing/easing.types.d.ts +0 -7
  171. package/dist/cjs/themes/_generator/tokens/easing/easing.types.js +0 -2
  172. package/dist/cjs/themes/_generator/tokens/font/font.transforms.d.ts +0 -4
  173. package/dist/cjs/themes/_generator/tokens/font/font.transforms.js +0 -43
  174. package/dist/cjs/themes/_generator/tokens/font/font.types.d.ts +0 -11
  175. package/dist/cjs/themes/_generator/tokens/font/font.types.js +0 -2
  176. package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.transforms.d.ts +0 -4
  177. package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.transforms.js +0 -11
  178. package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.types.d.ts +0 -4
  179. package/dist/cjs/themes/_generator/tokens/fontFamily/fontFamily.types.js +0 -2
  180. package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.transforms.d.ts +0 -4
  181. package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.transforms.js +0 -11
  182. package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.types.d.ts +0 -4
  183. package/dist/cjs/themes/_generator/tokens/fontWeight/fontWeight.types.js +0 -2
  184. package/dist/cjs/themes/_generator/tokens/radius/radius.transforms.d.ts +0 -4
  185. package/dist/cjs/themes/_generator/tokens/radius/radius.transforms.js +0 -11
  186. package/dist/cjs/themes/_generator/tokens/radius/radius.types.d.ts +0 -4
  187. package/dist/cjs/themes/_generator/tokens/radius/radius.types.js +0 -2
  188. package/dist/cjs/themes/_generator/tokens/shadow/shadow.transforms.d.ts +0 -4
  189. package/dist/cjs/themes/_generator/tokens/shadow/shadow.transforms.js +0 -22
  190. package/dist/cjs/themes/_generator/tokens/shadow/shadow.types.d.ts +0 -13
  191. package/dist/cjs/themes/_generator/tokens/shadow/shadow.types.js +0 -2
  192. package/dist/cjs/themes/_generator/tokens/transforms.d.ts +0 -13
  193. package/dist/cjs/themes/_generator/tokens/transforms.js +0 -30
  194. package/dist/cjs/themes/_generator/tokens/types.d.ts +0 -62
  195. package/dist/cjs/themes/_generator/tokens/types.js +0 -2
  196. package/dist/cjs/themes/_generator/tokens/unit/unit.transforms.d.ts +0 -4
  197. package/dist/cjs/themes/_generator/tokens/unit/unit.transforms.js +0 -11
  198. package/dist/cjs/themes/_generator/tokens/unit/unit.types.d.ts +0 -5
  199. package/dist/cjs/themes/_generator/tokens/unit/unit.types.js +0 -2
  200. package/dist/cjs/themes/_generator/tokens/unit/utilities/generate.d.ts +0 -5
  201. package/dist/cjs/themes/_generator/tokens/unit/utilities/generate.js +0 -16
  202. package/dist/cjs/themes/_generator/tokens/viewport/viewport.transforms.d.ts +0 -4
  203. package/dist/cjs/themes/_generator/tokens/viewport/viewport.transforms.js +0 -27
  204. package/dist/cjs/themes/_generator/tokens/viewport/viewport.types.d.ts +0 -9
  205. package/dist/cjs/themes/_generator/tokens/viewport/viewport.types.js +0 -2
  206. package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.transforms.d.ts +0 -4
  207. package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.transforms.js +0 -11
  208. package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.types.d.ts +0 -4
  209. package/dist/cjs/themes/_generator/tokens/zIndex/zIndex.types.js +0 -2
  210. package/dist/cjs/themes/_generator/transform.d.ts +0 -8
  211. package/dist/cjs/themes/_generator/transform.js +0 -108
  212. package/dist/cjs/themes/_generator/types.d.ts +0 -15
  213. package/dist/cjs/themes/_generator/types.js +0 -2
  214. package/dist/cjs/themes/_generator/utilities/mergeDefinitions.d.ts +0 -3
  215. package/dist/cjs/themes/_generator/utilities/mergeDefinitions.js +0 -19
  216. package/dist/cjs/themes/figma/media.css +0 -1
  217. package/dist/cjs/themes/figma/tailwind.css +0 -1
  218. package/dist/cjs/themes/figma/theme.css +0 -1
  219. package/dist/cjs/themes/fragments/twitter/tailwind.css +0 -1
  220. package/dist/cjs/themes/fragments/twitter/theme.css +0 -1
  221. package/dist/cjs/themes/index.d.ts +0 -23
  222. package/dist/cjs/themes/index.js +0 -21
  223. package/dist/cjs/themes/reshaped/media.css +0 -1
  224. package/dist/cjs/themes/reshaped/tailwind.css +0 -1
  225. package/dist/cjs/themes/reshaped/theme.css +0 -1
  226. package/dist/cjs/themes/slate/media.css +0 -1
  227. package/dist/cjs/themes/slate/tailwind.css +0 -1
  228. package/dist/cjs/themes/slate/theme.css +0 -1
  229. package/dist/cjs/types/config.d.ts +0 -20
  230. package/dist/cjs/types/config.js +0 -2
  231. package/dist/cjs/utilities/string.d.ts +0 -2
  232. package/dist/cjs/utilities/string.js +0 -15
@@ -1,3 +0,0 @@
1
- import type { ReshapedConfig } from "../../types/config";
2
- declare const config: ReshapedConfig;
3
- export default config;
@@ -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,2 +0,0 @@
1
- import type { GeneratedThemeDefinition } from "../../themes/_generator/tokens/types";
2
- export declare const transformToTailwind: (theme?: GeneratedThemeDefinition) => string;
@@ -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,6 +0,0 @@
1
- declare const _default: {
2
- m: number;
3
- l: number;
4
- xl: number;
5
- };
6
- export default _default;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- m: 660,
5
- l: 900,
6
- xl: 1280,
7
- };
@@ -1,2 +0,0 @@
1
- import type { Name } from "./tokens/color/color.types";
2
- export declare const bgWithDynamicForeground: Name[];
@@ -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,3 +0,0 @@
1
- import type { ThemeDefinition } from "../tokens/types";
2
- declare const theme: Partial<ThemeDefinition>;
3
- export default theme;
@@ -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;
@@ -1,3 +0,0 @@
1
- import type { ThemeDefinition } from "../tokens/types";
2
- declare const theme: ThemeDefinition;
3
- export default theme;