@primer/primitives 10.0.0-rc.d5052313 → 10.0.0-rc.dd3dde40

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 (119) hide show
  1. package/README.md +2 -2
  2. package/dist/build/PrimerStyleDictionary.js +27 -26
  3. package/dist/build/filters/isCubicBezier.d.ts +7 -0
  4. package/dist/build/filters/isCubicBezier.js +10 -0
  5. package/dist/build/formats/typescriptExportDefinition.js +2 -2
  6. package/dist/build/parsers/w3cJsonParser.js +2 -2
  7. package/dist/build/platforms/css.js +1 -0
  8. package/dist/build/schemas/borderToken.d.ts +3 -3
  9. package/dist/build/schemas/colorToken.d.ts +3 -3
  10. package/dist/build/schemas/cubicBezierToken.d.ts +18 -0
  11. package/dist/build/schemas/cubicBezierToken.js +8 -0
  12. package/dist/build/schemas/designToken.js +2 -1
  13. package/dist/build/schemas/dimensionToken.d.ts +3 -3
  14. package/dist/build/schemas/durationToken.d.ts +3 -3
  15. package/dist/build/schemas/fontFamilyToken.d.ts +3 -3
  16. package/dist/build/schemas/fontWeightToken.d.ts +3 -3
  17. package/dist/build/schemas/numberToken.d.ts +3 -3
  18. package/dist/build/schemas/shadowToken.d.ts +3 -3
  19. package/dist/build/schemas/stringToken.d.ts +3 -3
  20. package/dist/build/schemas/tokenType.d.ts +1 -1
  21. package/dist/build/schemas/typographyToken.d.ts +3 -3
  22. package/dist/build/schemas/validTokenType.d.ts +1 -1
  23. package/dist/build/schemas/validTokenType.js +1 -0
  24. package/dist/build/schemas/viewportRangeToken.d.ts +3 -3
  25. package/dist/build/transformers/cubicBezierToCss.d.ts +8 -0
  26. package/dist/build/transformers/cubicBezierToCss.js +23 -0
  27. package/dist/build/transformers/durationToCss.js +2 -2
  28. package/dist/build/transformers/index.d.ts +1 -0
  29. package/dist/build/transformers/index.js +1 -0
  30. package/dist/css/base/motion/motion.css +17 -0
  31. package/dist/css/functional/motion/motion.css +4 -3
  32. package/dist/css/functional/themes/dark-colorblind.css +42 -22
  33. package/dist/css/functional/themes/dark-dimmed.css +44 -24
  34. package/dist/css/functional/themes/dark-high-contrast.css +42 -22
  35. package/dist/css/functional/themes/dark-tritanopia.css +42 -22
  36. package/dist/css/functional/themes/dark.css +42 -22
  37. package/dist/css/functional/themes/light-colorblind.css +42 -22
  38. package/dist/css/functional/themes/light-high-contrast.css +44 -24
  39. package/dist/css/functional/themes/light-tritanopia.css +42 -22
  40. package/dist/css/functional/themes/light.css +42 -22
  41. package/dist/css/functional/typography/typography.css +43 -43
  42. package/dist/css/primitives.css +64 -46
  43. package/dist/docs/base/motion/motion.json +205 -0
  44. package/dist/docs/functional/motion/motion.json +18 -3
  45. package/dist/docs/functional/themes/dark-colorblind.json +533 -251
  46. package/dist/docs/functional/themes/dark-dimmed.json +560 -256
  47. package/dist/docs/functional/themes/dark-high-contrast.json +388 -148
  48. package/dist/docs/functional/themes/dark-tritanopia.json +535 -257
  49. package/dist/docs/functional/themes/dark.json +544 -256
  50. package/dist/docs/functional/themes/light-colorblind.json +355 -65
  51. package/dist/docs/functional/themes/light-high-contrast.json +333 -63
  52. package/dist/docs/functional/themes/light-tritanopia.json +307 -61
  53. package/dist/docs/functional/themes/light.json +336 -58
  54. package/dist/fallbacks/base/motion/motion.json +17 -0
  55. package/dist/fallbacks/functional/motion/motion.json +1 -0
  56. package/dist/figma/dimension/dimension.json +518 -518
  57. package/dist/figma/figma.json +19 -19
  58. package/dist/figma/scales/dark-dimmed.json +3536 -656
  59. package/dist/figma/scales/dark-high-constrast.json +3535 -655
  60. package/dist/figma/scales/dark.json +3371 -491
  61. package/dist/figma/scales/light-high-constrast.json +3533 -653
  62. package/dist/figma/scales/light.json +3370 -490
  63. package/dist/figma/shadows/dark-colorblind.json +285 -285
  64. package/dist/figma/shadows/dark-dimmed.json +285 -285
  65. package/dist/figma/shadows/dark-high-contrast.json +285 -285
  66. package/dist/figma/shadows/dark-tritanopia.json +285 -285
  67. package/dist/figma/shadows/dark.json +285 -285
  68. package/dist/figma/shadows/light-colorblind.json +254 -254
  69. package/dist/figma/shadows/light-high-contrast.json +254 -254
  70. package/dist/figma/shadows/light-tritanopia.json +254 -254
  71. package/dist/figma/shadows/light.json +254 -254
  72. package/dist/figma/themes/dark-colorblind.json +5177 -5048
  73. package/dist/figma/themes/dark-dimmed.json +5526 -5351
  74. package/dist/figma/themes/dark-high-contrast.json +4361 -4251
  75. package/dist/figma/themes/dark-tritanopia.json +5315 -5187
  76. package/dist/figma/themes/dark.json +5741 -5582
  77. package/dist/figma/themes/light-colorblind.json +5112 -4937
  78. package/dist/figma/themes/light-high-contrast.json +4465 -4322
  79. package/dist/figma/themes/light-tritanopia.json +5179 -5053
  80. package/dist/figma/themes/light.json +5657 -5500
  81. package/dist/figma/typography/typography.json +162 -162
  82. package/dist/internalCss/dark-colorblind.css +42 -22
  83. package/dist/internalCss/dark-dimmed.css +44 -24
  84. package/dist/internalCss/dark-high-contrast.css +42 -22
  85. package/dist/internalCss/dark-tritanopia.css +42 -22
  86. package/dist/internalCss/dark.css +42 -22
  87. package/dist/internalCss/light-colorblind.css +42 -22
  88. package/dist/internalCss/light-high-contrast.css +44 -24
  89. package/dist/internalCss/light-tritanopia.css +42 -22
  90. package/dist/internalCss/light.css +42 -22
  91. package/dist/styleLint/base/motion/motion.json +205 -0
  92. package/dist/styleLint/functional/motion/motion.json +18 -3
  93. package/dist/styleLint/functional/themes/dark-colorblind.json +533 -251
  94. package/dist/styleLint/functional/themes/dark-dimmed.json +560 -256
  95. package/dist/styleLint/functional/themes/dark-high-contrast.json +387 -147
  96. package/dist/styleLint/functional/themes/dark-tritanopia.json +535 -257
  97. package/dist/styleLint/functional/themes/dark.json +544 -256
  98. package/dist/styleLint/functional/themes/light-colorblind.json +355 -65
  99. package/dist/styleLint/functional/themes/light-high-contrast.json +333 -63
  100. package/dist/styleLint/functional/themes/light-tritanopia.json +307 -61
  101. package/dist/styleLint/functional/themes/light.json +336 -58
  102. package/package.json +20 -22
  103. package/src/tokens/base/motion/easing.json5 +26 -0
  104. package/src/tokens/base/motion/timing.json5 +50 -0
  105. package/src/tokens/functional/color/dark/app-dark.json5 +203 -88
  106. package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
  107. package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +0 -8
  108. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +39 -26
  109. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +54 -28
  110. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +36 -13
  111. package/src/tokens/functional/color/dark/patterns-dark.json5 +16 -4
  112. package/src/tokens/functional/color/dark/primitives-dark.json5 +1 -1
  113. package/src/tokens/functional/color/light/app-light.json5 +195 -85
  114. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -25
  115. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +59 -26
  116. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +62 -10
  117. package/src/tokens/functional/color/light/patterns-light.json5 +13 -1
  118. package/src/tokens/functional/motion/loading.json5 +1 -1
  119. package/src/tokens/functional/motion/patterns.json5 +9 -2
package/README.md CHANGED
@@ -138,10 +138,10 @@ In this case you can create the follwing structure. The `@` will be removed from
138
138
  bgColor: {
139
139
  accent: {
140
140
  '@': {
141
- // values for accent (default)
141
+ // values for bgColor-accent (default)
142
142
  },
143
143
  muted: {
144
- // values for accent-muted
144
+ // values for bgColor-accent-muted
145
145
  },
146
146
  },
147
147
  },
@@ -1,5 +1,5 @@
1
1
  import StyleDictionary from 'style-dictionary';
2
- import { borderToCss, colorToRgbAlpha, colorToHex, colorToHexMix, colorToRgbaFloat, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, } from './transformers/index.js';
2
+ import { borderToCss, colorToRgbAlpha, colorToHex, colorToHexMix, colorToRgbaFloat, cubicBezierToCss, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, } from './transformers/index.js';
3
3
  import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
4
4
  /**
5
5
  * @name {@link PrimerStyleDictionary}
@@ -52,28 +52,29 @@ PrimerStyleDictionary.registerFormat({
52
52
  * Transformers
53
53
  *
54
54
  */
55
- PrimerStyleDictionary.registerTransform(Object.assign({}, colorToRgbAlpha));
56
- PrimerStyleDictionary.registerTransform(Object.assign({}, colorToRgbaFloat));
57
- PrimerStyleDictionary.registerTransform(Object.assign({}, colorToHexMix));
58
- PrimerStyleDictionary.registerTransform(Object.assign({}, colorToHex));
59
- PrimerStyleDictionary.registerTransform(Object.assign({}, floatToPixel));
60
- PrimerStyleDictionary.registerTransform(Object.assign({}, floatToPixelUnitless));
61
- PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToRem));
62
- PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToRemPxArray));
63
- PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToPixelUnitless));
64
- PrimerStyleDictionary.registerTransform(Object.assign({}, durationToCss));
65
- PrimerStyleDictionary.registerTransform(Object.assign({}, figmaAttributes));
66
- PrimerStyleDictionary.registerTransform(Object.assign({}, jsonDeprecated));
67
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToCamelCase));
68
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToPascalCase));
69
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToDotNotation));
70
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToFigma));
71
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToCamelCase));
72
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToKebabCase));
73
- PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToSlashNotation));
74
- PrimerStyleDictionary.registerTransform(Object.assign({}, shadowToCss));
75
- PrimerStyleDictionary.registerTransform(Object.assign({}, borderToCss));
76
- PrimerStyleDictionary.registerTransform(Object.assign({}, typographyToCss));
77
- PrimerStyleDictionary.registerTransform(Object.assign({}, fontWeightToNumber));
78
- PrimerStyleDictionary.registerTransform(Object.assign({}, fontFamilyToCss));
79
- PrimerStyleDictionary.registerTransform(Object.assign({}, fontFamilyToFigma));
55
+ PrimerStyleDictionary.registerTransform(colorToRgbAlpha);
56
+ PrimerStyleDictionary.registerTransform(colorToRgbaFloat);
57
+ PrimerStyleDictionary.registerTransform(colorToHexMix);
58
+ PrimerStyleDictionary.registerTransform(colorToHex);
59
+ PrimerStyleDictionary.registerTransform(cubicBezierToCss);
60
+ PrimerStyleDictionary.registerTransform(floatToPixel);
61
+ PrimerStyleDictionary.registerTransform(floatToPixelUnitless);
62
+ PrimerStyleDictionary.registerTransform(dimensionToRem);
63
+ PrimerStyleDictionary.registerTransform(dimensionToRemPxArray);
64
+ PrimerStyleDictionary.registerTransform(dimensionToPixelUnitless);
65
+ PrimerStyleDictionary.registerTransform(durationToCss);
66
+ PrimerStyleDictionary.registerTransform(figmaAttributes);
67
+ PrimerStyleDictionary.registerTransform(jsonDeprecated);
68
+ PrimerStyleDictionary.registerTransform(namePathToCamelCase);
69
+ PrimerStyleDictionary.registerTransform(namePathToPascalCase);
70
+ PrimerStyleDictionary.registerTransform(namePathToDotNotation);
71
+ PrimerStyleDictionary.registerTransform(namePathToFigma);
72
+ PrimerStyleDictionary.registerTransform(namePathToCamelCase);
73
+ PrimerStyleDictionary.registerTransform(namePathToKebabCase);
74
+ PrimerStyleDictionary.registerTransform(namePathToSlashNotation);
75
+ PrimerStyleDictionary.registerTransform(shadowToCss);
76
+ PrimerStyleDictionary.registerTransform(borderToCss);
77
+ PrimerStyleDictionary.registerTransform(typographyToCss);
78
+ PrimerStyleDictionary.registerTransform(fontWeightToNumber);
79
+ PrimerStyleDictionary.registerTransform(fontFamilyToCss);
80
+ PrimerStyleDictionary.registerTransform(fontFamilyToFigma);
@@ -0,0 +1,7 @@
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
+ /**
3
+ * @description Checks if token is of $type `cubicBezier`
4
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
+ * @returns boolean
6
+ */
7
+ export declare const isCubicBezier: (token: TransformedToken) => boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @description Checks if token is of $type `cubicBezier`
3
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @returns boolean
5
+ */
6
+ export const isCubicBezier = (token) => {
7
+ var _a;
8
+ const typeValue = (_a = token.$type) !== null && _a !== void 0 ? _a : token.type;
9
+ return typeValue === 'cubicBezier';
10
+ };
@@ -37,9 +37,9 @@ const getTokenType = (tokenTypesPath) => {
37
37
  const designTokenType = readFileSync(resolvePath(tokenTypesPath), { encoding: 'utf-8' });
38
38
  return designTokenType;
39
39
  }
40
- catch (e) {
40
+ catch (error) {
41
41
  // eslint-disable-next-line no-console
42
- throw new Error(`Error trying to load design token type from file "${tokenTypesPath}".`);
42
+ throw new Error(`Error trying to load design token type from file "${tokenTypesPath}". Error: ${error}`);
43
43
  }
44
44
  };
45
45
  /**
@@ -18,8 +18,8 @@ export const w3cJsonParser = {
18
18
  //
19
19
  return JSON5.parse(contents);
20
20
  }
21
- catch (e) {
22
- throw new Error(`Invalid json5 file "${filePath}".`);
21
+ catch (error) {
22
+ throw new Error(`Invalid json5 file "${filePath}". Error: ${error}`);
23
23
  }
24
24
  },
25
25
  };
@@ -23,6 +23,7 @@ export const css = (outputFile, prefix, buildPath, options) => {
23
23
  'name/pathToKebabCase',
24
24
  'color/hex',
25
25
  'color/hexMix',
26
+ 'cubicBezier/css',
26
27
  'dimension/rem',
27
28
  'duration/css',
28
29
  'shadow/css',
@@ -29,14 +29,14 @@ export declare const borderToken: z.ZodObject<z.objectUtil.extendShape<{
29
29
  color: string;
30
30
  style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
31
31
  }>, z.ZodEffects<z.ZodString, string, string>]>;
32
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
32
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
33
33
  }>, "strict", z.ZodTypeAny, {
34
34
  $value: string | {
35
35
  width: string | 0;
36
36
  color: string;
37
37
  style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
38
38
  };
39
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
39
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
40
40
  $description?: string | undefined;
41
41
  deprecated?: string | boolean | undefined;
42
42
  }, {
@@ -45,7 +45,7 @@ export declare const borderToken: z.ZodObject<z.objectUtil.extendShape<{
45
45
  color: string;
46
46
  style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
47
47
  };
48
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
48
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
49
49
  $description?: string | undefined;
50
50
  deprecated?: string | boolean | undefined;
51
51
  }>;
@@ -4,7 +4,7 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  alpha: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodAny, any, any>>>;
9
9
  mix: z.ZodOptional<z.ZodNullable<z.ZodObject<{
10
10
  color: z.ZodString;
@@ -48,7 +48,7 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
48
48
  }>>;
49
49
  }>, "strict", z.ZodTypeAny, {
50
50
  $value: string;
51
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
51
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
52
52
  alpha?: any;
53
53
  $description?: string | undefined;
54
54
  mix?: {
@@ -66,7 +66,7 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
66
66
  } | undefined;
67
67
  }, {
68
68
  $value: string;
69
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
69
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
70
70
  alpha?: any;
71
71
  $description?: string | undefined;
72
72
  mix?: {
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export declare const cubicBezierToken: z.ZodObject<z.objectUtil.extendShape<{
3
+ $description: z.ZodOptional<z.ZodString>;
4
+ deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
+ }, {
6
+ $value: z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodEffects<z.ZodString, string, string>]>;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
+ }>, "strict", z.ZodTypeAny, {
9
+ $value: string | number[];
10
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
11
+ $description?: string | undefined;
12
+ deprecated?: string | boolean | undefined;
13
+ }, {
14
+ $value: string | number[];
15
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
16
+ $description?: string | undefined;
17
+ deprecated?: string | boolean | undefined;
18
+ }>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { baseToken } from './baseToken.js';
3
+ import { referenceValue } from './referenceValue.js';
4
+ import { tokenType } from './tokenType.js';
5
+ export const cubicBezierToken = baseToken.extend({
6
+ $value: z.union([z.array(z.number()).length(4), referenceValue]),
7
+ $type: tokenType('cubicBezier'),
8
+ });
@@ -11,12 +11,14 @@ import { colorToken } from './colorToken.js';
11
11
  import { fontFamilyToken } from './fontFamilyToken.js';
12
12
  import { shadowToken } from './shadowToken.js';
13
13
  import { durationToken } from './durationToken.js';
14
+ import { cubicBezierToken } from './cubicBezierToken.js';
14
15
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15
16
  // @ts-ignore: TODO: fix this
16
17
  export const designToken = z.record(tokenName, z.lazy(() => {
17
18
  return z.union([
18
19
  z.discriminatedUnion('$type', [
19
20
  colorToken,
21
+ cubicBezierToken,
20
22
  dimensionToken,
21
23
  shadowToken,
22
24
  borderToken,
@@ -28,7 +30,6 @@ export const designToken = z.record(tokenName, z.lazy(() => {
28
30
  durationToken,
29
31
  stringToken,
30
32
  ]),
31
- // referenceToken,
32
33
  designToken,
33
34
  ]);
34
35
  }));
@@ -4,7 +4,7 @@ export declare const dimensionToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  $extensions: z.ZodOptional<z.ZodObject<{
9
9
  'org.primer.figma': z.ZodObject<{
10
10
  collection: z.ZodEffects<z.ZodString, string, string>;
@@ -29,7 +29,7 @@ export declare const dimensionToken: z.ZodObject<z.objectUtil.extendShape<{
29
29
  }>>;
30
30
  }>, "strict", z.ZodTypeAny, {
31
31
  $value: string | 0;
32
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
32
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
33
33
  $description?: string | undefined;
34
34
  deprecated?: string | boolean | undefined;
35
35
  $extensions?: {
@@ -40,7 +40,7 @@ export declare const dimensionToken: z.ZodObject<z.objectUtil.extendShape<{
40
40
  } | undefined;
41
41
  }, {
42
42
  $value: string | 0;
43
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
43
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
44
44
  $description?: string | undefined;
45
45
  deprecated?: string | boolean | undefined;
46
46
  $extensions?: {
@@ -4,15 +4,15 @@ export declare const durationToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  }>, "strict", z.ZodTypeAny, {
9
9
  $value: string;
10
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
10
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
11
11
  $description?: string | undefined;
12
12
  deprecated?: string | boolean | undefined;
13
13
  }, {
14
14
  $value: string;
15
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
15
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
16
16
  $description?: string | undefined;
17
17
  deprecated?: string | boolean | undefined;
18
18
  }>;
@@ -4,7 +4,7 @@ export declare const fontFamilyToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  $extensions: z.ZodOptional<z.ZodObject<{
9
9
  'org.primer.figma': z.ZodObject<{
10
10
  collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -29,7 +29,7 @@ export declare const fontFamilyToken: z.ZodObject<z.objectUtil.extendShape<{
29
29
  }>>;
30
30
  }>, "strict", z.ZodTypeAny, {
31
31
  $value: string;
32
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
32
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
33
33
  $description?: string | undefined;
34
34
  deprecated?: string | boolean | undefined;
35
35
  $extensions?: {
@@ -40,7 +40,7 @@ export declare const fontFamilyToken: z.ZodObject<z.objectUtil.extendShape<{
40
40
  } | undefined;
41
41
  }, {
42
42
  $value: string;
43
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
43
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
44
44
  $description?: string | undefined;
45
45
  deprecated?: string | boolean | undefined;
46
46
  $extensions?: {
@@ -3,7 +3,7 @@ export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
3
3
  $description: z.ZodOptional<z.ZodString>;
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
6
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
7
7
  $value: z.ZodUnion<[z.ZodEffects<z.ZodNumber, number, number>, z.ZodEffects<z.ZodString, string, string>]>;
8
8
  $extensions: z.ZodOptional<z.ZodObject<{
9
9
  'org.primer.figma': z.ZodObject<{
@@ -29,7 +29,7 @@ export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
29
29
  }>>;
30
30
  }>, "strict", z.ZodTypeAny, {
31
31
  $value: string | number;
32
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
32
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
33
33
  $description?: string | undefined;
34
34
  deprecated?: string | boolean | undefined;
35
35
  $extensions?: {
@@ -40,7 +40,7 @@ export declare const fontWeightToken: z.ZodObject<z.objectUtil.extendShape<{
40
40
  } | undefined;
41
41
  }, {
42
42
  $value: string | number;
43
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
43
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
44
44
  $description?: string | undefined;
45
45
  deprecated?: string | boolean | undefined;
46
46
  $extensions?: {
@@ -4,7 +4,7 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  $extensions: z.ZodOptional<z.ZodObject<{
9
9
  'org.primer.data': z.ZodOptional<z.ZodObject<{
10
10
  fontSize: z.ZodOptional<z.ZodNumber>;
@@ -42,7 +42,7 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
42
42
  }>>;
43
43
  }>, "strict", z.ZodTypeAny, {
44
44
  $value: string | number;
45
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
45
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
46
46
  $description?: string | undefined;
47
47
  deprecated?: string | boolean | undefined;
48
48
  $extensions?: {
@@ -56,7 +56,7 @@ export declare const numberToken: z.ZodObject<z.objectUtil.extendShape<{
56
56
  } | undefined;
57
57
  }, {
58
58
  $value: string | number;
59
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
59
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
60
60
  $description?: string | undefined;
61
61
  deprecated?: string | boolean | undefined;
62
62
  $extensions?: {
@@ -77,7 +77,7 @@ export declare const shadowToken: z.ZodObject<z.objectUtil.extendShape<{
77
77
  alpha?: any;
78
78
  inset?: boolean | undefined;
79
79
  }>, "many">, z.ZodEffects<z.ZodString, string, string>]>;
80
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
80
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
81
81
  $extensions: z.ZodOptional<z.ZodObject<{
82
82
  'org.primer.figma': z.ZodObject<{
83
83
  collection: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -118,7 +118,7 @@ export declare const shadowToken: z.ZodObject<z.objectUtil.extendShape<{
118
118
  alpha?: any;
119
119
  inset?: boolean | undefined;
120
120
  }[];
121
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
121
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
122
122
  $description?: string | undefined;
123
123
  deprecated?: string | boolean | undefined;
124
124
  $extensions?: {
@@ -145,7 +145,7 @@ export declare const shadowToken: z.ZodObject<z.objectUtil.extendShape<{
145
145
  alpha?: any;
146
146
  inset?: boolean | undefined;
147
147
  }[];
148
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
148
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
149
149
  $description?: string | undefined;
150
150
  deprecated?: string | boolean | undefined;
151
151
  $extensions?: {
@@ -4,15 +4,15 @@ export declare const stringToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  }>, "strict", z.ZodTypeAny, {
9
9
  $value: string;
10
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
10
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
11
11
  $description?: string | undefined;
12
12
  deprecated?: string | boolean | undefined;
13
13
  }, {
14
14
  $value: string;
15
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
15
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
16
16
  $description?: string | undefined;
17
17
  deprecated?: string | boolean | undefined;
18
18
  }>;
@@ -1,3 +1,3 @@
1
1
  import { z } from 'zod';
2
2
  import type { TokenType } from './validTokenType.js';
3
- export declare const tokenType: ($type: TokenType) => z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
3
+ export declare const tokenType: ($type: TokenType) => z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
@@ -35,7 +35,7 @@ export declare const typographyToken: z.ZodObject<z.objectUtil.extendShape<{
35
35
  fontWeight: string | number;
36
36
  lineHeight?: string | 0 | undefined;
37
37
  }>, z.ZodEffects<z.ZodString, string, string>]>;
38
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
38
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
39
39
  }>, "strict", z.ZodTypeAny, {
40
40
  $value: string | {
41
41
  fontFamily: string;
@@ -43,7 +43,7 @@ export declare const typographyToken: z.ZodObject<z.objectUtil.extendShape<{
43
43
  fontWeight: string | number;
44
44
  lineHeight?: string | 0 | undefined;
45
45
  };
46
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
46
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
47
47
  $description?: string | undefined;
48
48
  deprecated?: string | boolean | undefined;
49
49
  }, {
@@ -53,7 +53,7 @@ export declare const typographyToken: z.ZodObject<z.objectUtil.extendShape<{
53
53
  fontWeight: string | number;
54
54
  lineHeight?: string | 0 | undefined;
55
55
  };
56
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
56
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
57
57
  $description?: string | undefined;
58
58
  deprecated?: string | boolean | undefined;
59
59
  }>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- declare const validTypes: readonly ["color", "typography", "dimension", "duration", "border", "shadow", "fontFamily", "fontWeight", "number", "string", "custom-viewportRange"];
2
+ declare const validTypes: readonly ["color", "cubicBezier", "typography", "dimension", "duration", "border", "shadow", "fontFamily", "fontWeight", "number", "string", "custom-viewportRange"];
3
3
  export type TokenType = (typeof validTypes)[number];
4
4
  export declare const validateType: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodTypeAny>>;
5
5
  export {};
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { joinFriendly, schemaErrorMessage } from '../utilities/index.js';
3
3
  const validTypes = [
4
4
  'color',
5
+ 'cubicBezier',
5
6
  'typography',
6
7
  'dimension',
7
8
  'duration',
@@ -4,15 +4,15 @@ export declare const viewportRangeToken: z.ZodObject<z.objectUtil.extendShape<{
4
4
  deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
5
  }, {
6
6
  $value: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange">;
7
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
8
8
  }>, "strict", z.ZodTypeAny, {
9
9
  $value: string;
10
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
10
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
11
11
  $description?: string | undefined;
12
12
  deprecated?: string | boolean | undefined;
13
13
  }, {
14
14
  $value: string;
15
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "custom-viewportRange";
15
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
16
16
  $description?: string | undefined;
17
17
  deprecated?: string | boolean | undefined;
18
18
  }>;
@@ -0,0 +1,8 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ /**
3
+ * @description converts cubicBezeir tokens array value to a css cubic-bezier
4
+ * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
+ * @matcher matches all tokens of $type `duration`
6
+ * @transformer returns a css cubic-bezier function
7
+ */
8
+ export declare const cubicBezierToCss: Transform;
@@ -0,0 +1,23 @@
1
+ import { isCubicBezier } from '../filters/isCubicBezier.js';
2
+ /**
3
+ * @description converts cubicBezeir tokens array value to a css cubic-bezier
4
+ * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
+ * @matcher matches all tokens of $type `duration`
6
+ * @transformer returns a css cubic-bezier function
7
+ */
8
+ export const cubicBezierToCss = {
9
+ name: 'cubicBezeir/css',
10
+ type: 'value',
11
+ transitive: true,
12
+ filter: isCubicBezier,
13
+ transform: (token, _config) => {
14
+ var _a;
15
+ const value = (_a = token.$value) !== null && _a !== void 0 ? _a : token.value;
16
+ // throw value of more or less than 4 items in array
17
+ if (value.length !== 4 || value.some((item) => typeof item !== 'number')) {
18
+ throw new Error(`Invalid cubicBezier token ${token.path.join('.')}, must be an array with 4 numbers, but got this instead: ${JSON.stringify(value)}`);
19
+ }
20
+ // return value
21
+ return `cubic-bezier(${value.join(',')})`;
22
+ },
23
+ };
@@ -13,8 +13,8 @@ export const durationToCss = {
13
13
  transform: (token, _config, options) => {
14
14
  const valueProp = options.usesDtcg ? '$value' : 'value';
15
15
  // throw an error if token value is not a string or does not end with `ms`
16
- if (typeof token[valueProp] !== `string` || !token[valueProp].endsWith(`ms`)) {
17
- throw new Error(`duration token value must be a string with an "ms" unit`);
16
+ if (typeof token[valueProp] !== `string` || !(token[valueProp].endsWith(`ms`) || token[valueProp].endsWith(`s`))) {
17
+ throw new Error(`duration token value must be a string with an "ms" || "s" unit, invalid token: ${token.name} with value: ${token[valueProp]}`);
18
18
  }
19
19
  // get value
20
20
  let value = parseInt(token[valueProp].replace('ms', ''));
@@ -3,6 +3,7 @@ export { colorToHex } from './colorToHex.js';
3
3
  export { colorToHexMix } from './colorToHexMix.js';
4
4
  export { colorToRgbAlpha } from './colorToRgbAlpha.js';
5
5
  export { colorToRgbaFloat } from './colorToRgbaFloat.js';
6
+ export { cubicBezierToCss } from './cubicBezierToCss.js';
6
7
  export { floatToPixel } from './floatToPixel.js';
7
8
  export { floatToPixelUnitless } from './floatToPixel.js';
8
9
  export { dimensionToRem } from './dimensionToRem.js';
@@ -3,6 +3,7 @@ export { colorToHex } from './colorToHex.js';
3
3
  export { colorToHexMix } from './colorToHexMix.js';
4
4
  export { colorToRgbAlpha } from './colorToRgbAlpha.js';
5
5
  export { colorToRgbaFloat } from './colorToRgbaFloat.js';
6
+ export { cubicBezierToCss } from './cubicBezierToCss.js';
6
7
  export { floatToPixel } from './floatToPixel.js';
7
8
  export { floatToPixelUnitless } from './floatToPixel.js';
8
9
  export { dimensionToRem } from './dimensionToRem.js';
@@ -0,0 +1,17 @@
1
+ :root {
2
+ --base-easing-linear: cubic-bezier(0, 0, 1, 1); /* Ideal for non-movement properties, like opacity or background color. */
3
+ --base-easing-easeIn: cubic-bezier(0.7, 0.1, 0.75, 0.9); /* Ideal for movement that starts on the page and ends off the page. */
4
+ --base-easing-easeOut: cubic-bezier(0.16, 1, 0.3, 1); /* Ideal for movement that starts off the page and ends on the page. */
5
+ --base-easing-easeInOut: cubic-bezier(0.6, 0, 0.2, 1); /* Ideal for movement that starts and ends on the page. */
6
+ --base-duration-0: 0ms;
7
+ --base-duration-75: 75ms;
8
+ --base-duration-200: 200ms;
9
+ --base-duration-300: 300ms;
10
+ --base-duration-400: 400ms;
11
+ --base-duration-500: 500ms;
12
+ --base-duration-600: 600ms;
13
+ --base-duration-700: 700ms;
14
+ --base-duration-800: 800ms;
15
+ --base-duration-900: 900ms;
16
+ --base-duration-1000: 1s;
17
+ }
@@ -1,5 +1,6 @@
1
1
  :root {
2
- --motion-skeletonLoader-shimmer-duration-scale: 1s; /* The amount of times it takes the "shimmer" effect to go from the start (left) of the skeleton loader to the end (right) */
3
- --motion-spinner-duration-rotation: 1s; /* The amount of time it takes the "Spinner" loading indicator to make a full 360deg rotation */
4
- --motion-loading-delay-default: 1s; /* The amount of time to wait before showing a loading indicator or announcing a loading state to assistive technologies. */
2
+ --motion-loading-delay-default: var(--base-duration-1000); /* The amount of time to wait before showing a loading indicator or announcing a loading state to assistive technologies. */
3
+ --motion-spinner-duration-rotation: var(--base-duration-1000); /* The amount of time it takes the "Spinner" loading indicator to make a full 360deg rotation */
4
+ --motion-spinner-easing-rotation: var(--base-easing-linear); /* The easing curve for the "Spinner" loading indicator rotation */
5
+ --motion-skeletonLoader-shimmer-duration-scale: var(--base-duration-1000); /* The amount of times it takes the "shimmer" effect to go from the start (left) of the skeleton loader to the end (right) */
5
6
  }