@primer/primitives 11.4.0-rc.f798df25 → 11.4.1-rc.14fb4bb1

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 (215) hide show
  1. package/DESIGN_TOKENS_GUIDE.md +185 -0
  2. package/DESIGN_TOKENS_SPEC.md +565 -0
  3. package/dist/build/filters/hasLlmExtensions.d.ts +7 -0
  4. package/dist/build/filters/hasLlmExtensions.js +11 -0
  5. package/dist/build/filters/index.d.ts +1 -0
  6. package/dist/build/filters/index.js +1 -0
  7. package/dist/build/formats/index.d.ts +1 -0
  8. package/dist/build/formats/index.js +1 -0
  9. package/dist/build/formats/jsonFigma.js +8 -1
  10. package/dist/build/formats/markdownLlmGuidelines.d.ts +11 -0
  11. package/dist/build/formats/markdownLlmGuidelines.js +1168 -0
  12. package/dist/build/platforms/index.d.ts +1 -0
  13. package/dist/build/platforms/index.js +1 -0
  14. package/dist/build/platforms/llmGuidelines.d.ts +2 -0
  15. package/dist/build/platforms/llmGuidelines.js +17 -0
  16. package/dist/build/preprocessors/inheritGroupProperties.d.ts +7 -0
  17. package/dist/build/preprocessors/inheritGroupProperties.js +70 -0
  18. package/dist/build/primerStyleDictionary.js +7 -1
  19. package/dist/build/schemas/borderToken.d.ts +67 -5
  20. package/dist/build/schemas/borderToken.js +8 -1
  21. package/dist/build/schemas/colorToken.d.ts +643 -30
  22. package/dist/build/schemas/colorToken.js +5 -2
  23. package/dist/build/schemas/colorW3cValue.d.ts +28 -0
  24. package/dist/build/schemas/colorW3cValue.js +42 -0
  25. package/dist/build/schemas/cubicBezierToken.d.ts +7 -1
  26. package/dist/build/schemas/cubicBezierToken.js +10 -2
  27. package/dist/build/schemas/designToken.d.ts +1 -1
  28. package/dist/build/schemas/designToken.js +113 -21
  29. package/dist/build/schemas/dimensionToken.d.ts +15 -4
  30. package/dist/build/schemas/dimensionToken.js +6 -2
  31. package/dist/build/schemas/dimensionValue.d.ts +12 -1
  32. package/dist/build/schemas/dimensionValue.js +10 -13
  33. package/dist/build/schemas/durationToken.d.ts +14 -2
  34. package/dist/build/schemas/durationToken.js +6 -0
  35. package/dist/build/schemas/durationValue.d.ts +11 -1
  36. package/dist/build/schemas/durationValue.js +13 -3
  37. package/dist/build/schemas/fontFamilyToken.d.ts +5 -1
  38. package/dist/build/schemas/fontFamilyToken.js +2 -0
  39. package/dist/build/schemas/fontWeightToken.d.ts +5 -1
  40. package/dist/build/schemas/fontWeightToken.js +2 -0
  41. package/dist/build/schemas/gradientToken.d.ts +27 -2
  42. package/dist/build/schemas/gradientToken.js +4 -1
  43. package/dist/build/schemas/llmExtension.d.ts +9 -0
  44. package/dist/build/schemas/llmExtension.js +11 -0
  45. package/dist/build/schemas/numberToken.d.ts +5 -1
  46. package/dist/build/schemas/numberToken.js +2 -0
  47. package/dist/build/schemas/shadowToken.d.ts +1755 -127
  48. package/dist/build/schemas/shadowToken.js +10 -2
  49. package/dist/build/schemas/stringToken.d.ts +7 -1
  50. package/dist/build/schemas/stringToken.js +7 -1
  51. package/dist/build/schemas/tokenType.d.ts +1 -1
  52. package/dist/build/schemas/transitionToken.d.ts +21 -3
  53. package/dist/build/schemas/transitionToken.js +6 -0
  54. package/dist/build/schemas/typographyToken.d.ts +25 -5
  55. package/dist/build/schemas/typographyToken.js +7 -1
  56. package/dist/build/schemas/validTokenType.d.ts +6 -2
  57. package/dist/build/schemas/validTokenType.js +72 -18
  58. package/dist/build/schemas/viewportRangeToken.d.ts +7 -1
  59. package/dist/build/schemas/viewportRangeToken.js +6 -0
  60. package/dist/build/transformers/borderToCss.js +19 -1
  61. package/dist/build/transformers/colorAlphaToCss.js +6 -3
  62. package/dist/build/transformers/colorToHex.js +5 -2
  63. package/dist/build/transformers/colorToRgbAlpha.js +5 -2
  64. package/dist/build/transformers/colorToRgbaFloat.js +5 -0
  65. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
  66. package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
  67. package/dist/build/transformers/dimensionToRem.d.ts +2 -1
  68. package/dist/build/transformers/dimensionToRem.js +21 -22
  69. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
  70. package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
  71. package/dist/build/transformers/durationToCss.d.ts +2 -1
  72. package/dist/build/transformers/durationToCss.js +18 -11
  73. package/dist/build/transformers/gradientToCss.js +2 -1
  74. package/dist/build/transformers/shadowToCss.js +15 -1
  75. package/dist/build/transformers/utilities/normalizeColorValue.d.ts +23 -0
  76. package/dist/build/transformers/utilities/normalizeColorValue.js +74 -0
  77. package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
  78. package/dist/build/transformers/utilities/parseDimension.js +31 -0
  79. package/dist/build/types/borderTokenValue.d.ts +5 -2
  80. package/dist/build/types/dimensionTokenValue.d.ts +9 -0
  81. package/dist/build/types/shadowTokenValue.d.ts +8 -5
  82. package/dist/css/base/motion/motion.css +5 -4
  83. package/dist/css/functional/size/border.css +9 -14
  84. package/dist/css/functional/size/radius.css +7 -0
  85. package/dist/css/functional/size/size-coarse.css +3 -3
  86. package/dist/css/functional/size/size-fine.css +3 -3
  87. package/dist/css/functional/size/viewport.css +1 -1
  88. package/dist/css/functional/themes/dark-colorblind-high-contrast.css +204 -200
  89. package/dist/css/functional/themes/dark-colorblind.css +204 -200
  90. package/dist/css/functional/themes/dark-dimmed-high-contrast.css +204 -200
  91. package/dist/css/functional/themes/dark-dimmed.css +204 -200
  92. package/dist/css/functional/themes/dark-high-contrast.css +204 -200
  93. package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +204 -200
  94. package/dist/css/functional/themes/dark-tritanopia.css +204 -200
  95. package/dist/css/functional/themes/dark.css +204 -200
  96. package/dist/css/functional/themes/light-colorblind-high-contrast.css +204 -200
  97. package/dist/css/functional/themes/light-colorblind.css +204 -200
  98. package/dist/css/functional/themes/light-high-contrast.css +204 -200
  99. package/dist/css/functional/themes/light-tritanopia-high-contrast.css +204 -200
  100. package/dist/css/functional/themes/light-tritanopia.css +204 -200
  101. package/dist/css/functional/themes/light.css +204 -200
  102. package/dist/css/functional/typography/typography.css +4 -4
  103. package/dist/css/primitives.css +5 -0
  104. package/dist/docs/base/motion/motion.json +181 -32
  105. package/dist/docs/base/size/size.json +76 -19
  106. package/dist/docs/base/typography/typography.json +24 -6
  107. package/dist/docs/functional/size/border.json +66 -186
  108. package/dist/docs/functional/size/breakpoints.json +24 -6
  109. package/dist/docs/functional/size/radius.json +221 -0
  110. package/dist/docs/functional/size/size-coarse.json +45 -3
  111. package/dist/docs/functional/size/size-fine.json +45 -3
  112. package/dist/docs/functional/size/size.json +60 -15
  113. package/dist/docs/functional/size/viewport.json +2 -2
  114. package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +3563 -436
  115. package/dist/docs/functional/themes/dark-colorblind.json +3563 -436
  116. package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +3563 -436
  117. package/dist/docs/functional/themes/dark-dimmed.json +3601 -474
  118. package/dist/docs/functional/themes/dark-high-contrast.json +3563 -436
  119. package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +3563 -436
  120. package/dist/docs/functional/themes/dark-tritanopia.json +3563 -436
  121. package/dist/docs/functional/themes/dark.json +3563 -436
  122. package/dist/docs/functional/themes/light-colorblind-high-contrast.json +3569 -442
  123. package/dist/docs/functional/themes/light-colorblind.json +3566 -439
  124. package/dist/docs/functional/themes/light-high-contrast.json +3569 -442
  125. package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +3569 -442
  126. package/dist/docs/functional/themes/light-tritanopia.json +3566 -439
  127. package/dist/docs/functional/themes/light.json +3566 -439
  128. package/dist/docs/functional/typography/typography.json +180 -10
  129. package/dist/fallbacks/base/motion/motion.json +49 -12
  130. package/dist/fallbacks/functional/size/border.json +0 -5
  131. package/dist/fallbacks/functional/size/radius.json +7 -0
  132. package/dist/fallbacks/functional/size/viewport.json +1 -1
  133. package/dist/figma/dimension/dimension.json +30 -20
  134. package/dist/figma/themes/dark-colorblind.json +85 -0
  135. package/dist/figma/themes/dark-dimmed.json +134 -49
  136. package/dist/figma/themes/dark-high-contrast.json +85 -0
  137. package/dist/figma/themes/dark-tritanopia.json +85 -0
  138. package/dist/figma/themes/dark.json +85 -0
  139. package/dist/figma/themes/light-colorblind.json +89 -4
  140. package/dist/figma/themes/light-high-contrast.json +89 -4
  141. package/dist/figma/themes/light-tritanopia.json +89 -4
  142. package/dist/figma/themes/light.json +89 -4
  143. package/dist/figma/typography/typography.json +44 -40
  144. package/dist/internalCss/dark-colorblind-high-contrast.css +218 -228
  145. package/dist/internalCss/dark-colorblind.css +218 -228
  146. package/dist/internalCss/dark-dimmed-high-contrast.css +218 -228
  147. package/dist/internalCss/dark-dimmed.css +218 -228
  148. package/dist/internalCss/dark-high-contrast.css +218 -228
  149. package/dist/internalCss/dark-tritanopia-high-contrast.css +218 -228
  150. package/dist/internalCss/dark-tritanopia.css +218 -228
  151. package/dist/internalCss/dark.css +218 -228
  152. package/dist/internalCss/light-colorblind-high-contrast.css +218 -228
  153. package/dist/internalCss/light-colorblind.css +218 -228
  154. package/dist/internalCss/light-high-contrast.css +218 -228
  155. package/dist/internalCss/light-tritanopia-high-contrast.css +218 -228
  156. package/dist/internalCss/light-tritanopia.css +218 -228
  157. package/dist/internalCss/light.css +218 -228
  158. package/dist/styleLint/base/motion/motion.json +181 -32
  159. package/dist/styleLint/base/size/size.json +76 -19
  160. package/dist/styleLint/base/typography/typography.json +30 -12
  161. package/dist/styleLint/functional/size/border.json +61 -181
  162. package/dist/styleLint/functional/size/breakpoints.json +24 -6
  163. package/dist/styleLint/functional/size/radius.json +221 -0
  164. package/dist/styleLint/functional/size/size-coarse.json +45 -3
  165. package/dist/styleLint/functional/size/size-fine.json +45 -3
  166. package/dist/styleLint/functional/size/size.json +111 -66
  167. package/dist/styleLint/functional/size/viewport.json +2 -2
  168. package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +3603 -368
  169. package/dist/styleLint/functional/themes/dark-colorblind.json +3603 -368
  170. package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +3603 -368
  171. package/dist/styleLint/functional/themes/dark-dimmed.json +3641 -406
  172. package/dist/styleLint/functional/themes/dark-high-contrast.json +3603 -368
  173. package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +3603 -368
  174. package/dist/styleLint/functional/themes/dark-tritanopia.json +3603 -368
  175. package/dist/styleLint/functional/themes/dark.json +3603 -368
  176. package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +3609 -374
  177. package/dist/styleLint/functional/themes/light-colorblind.json +3606 -371
  178. package/dist/styleLint/functional/themes/light-high-contrast.json +3609 -374
  179. package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +3609 -374
  180. package/dist/styleLint/functional/themes/light-tritanopia.json +3606 -371
  181. package/dist/styleLint/functional/themes/light.json +3606 -371
  182. package/dist/styleLint/functional/typography/typography.json +196 -26
  183. package/package.json +9 -5
  184. package/src/tokens/base/motion/easing.json5 +39 -4
  185. package/src/tokens/base/motion/timing.json5 +12 -12
  186. package/src/tokens/base/size/size.json5 +194 -194
  187. package/src/tokens/base/typography/typography.json5 +6 -6
  188. package/src/tokens/component/avatar.json5 +72 -44
  189. package/src/tokens/component/button.json5 +1545 -1193
  190. package/src/tokens/functional/border/border.json5 +29 -1
  191. package/src/tokens/functional/color/bgColor.json5 +165 -0
  192. package/src/tokens/functional/color/borderColor.json5 +146 -0
  193. package/src/tokens/functional/color/control.json5 +24 -0
  194. package/src/tokens/functional/color/data-vis.json5 +7 -0
  195. package/src/tokens/functional/color/display.json5 +7 -0
  196. package/src/tokens/functional/color/fgColor.json5 +101 -1
  197. package/src/tokens/functional/color/focus.json5 +5 -0
  198. package/src/tokens/functional/color/selection.json5 +5 -0
  199. package/src/tokens/functional/color/syntax.json5 +14 -0
  200. package/src/tokens/functional/shadow/shadow.json5 +1264 -163
  201. package/src/tokens/functional/size/border.json5 +25 -77
  202. package/src/tokens/functional/size/breakpoints.json5 +6 -6
  203. package/src/tokens/functional/size/radius.json5 +90 -0
  204. package/src/tokens/functional/size/size-coarse.json5 +24 -3
  205. package/src/tokens/functional/size/size-fine.json5 +45 -24
  206. package/src/tokens/functional/size/size.json5 +50 -15
  207. package/src/tokens/functional/size/viewport.json5 +1 -1
  208. package/src/tokens/functional/typography/font-stack.json5 +60 -0
  209. package/src/tokens/functional/typography/typography.json5 +71 -44
  210. package/dist/build/parsers/index.d.ts +0 -1
  211. package/dist/build/parsers/index.js +0 -1
  212. package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
  213. package/dist/build/parsers/w3cJsonParser.js +0 -25
  214. package/dist/removed/testing.json5 +0 -4
  215. package/src/tokens/removed/testing.json5 +0 -4
@@ -1,3 +1,4 @@
1
+ export { llmGuidelines } from './llmGuidelines.js';
1
2
  export { css } from './css.js';
2
3
  export { deprecatedJson } from './deprecatedJson.js';
3
4
  export { docJson } from './docJson.js';
@@ -1,3 +1,4 @@
1
+ export { llmGuidelines } from './llmGuidelines.js';
1
2
  export { css } from './css.js';
2
3
  export { deprecatedJson } from './deprecatedJson.js';
3
4
  export { docJson } from './docJson.js';
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/platformInitializer.js';
2
+ export declare const llmGuidelines: PlatformInitializer;
@@ -0,0 +1,17 @@
1
+ import { hasLlmExtensions } from '../filters/index.js';
2
+ export const llmGuidelines = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ preprocessors: ['inheritGroupProperties'],
6
+ transforms: ['name/pathToKebabCase'],
7
+ files: [
8
+ {
9
+ destination: outputFile,
10
+ format: 'json/llm-guidelines',
11
+ filter: hasLlmExtensions,
12
+ options: {
13
+ outputReferences: false,
14
+ },
15
+ },
16
+ ],
17
+ });
@@ -0,0 +1,7 @@
1
+ import type { Preprocessor } from 'style-dictionary/types';
2
+ /**
3
+ * Preprocessor that inherits group-level $description and $extensions to child tokens.
4
+ * This enables W3C Design Tokens group properties to be available on individual tokens
5
+ * during formatting.
6
+ */
7
+ export declare const inheritGroupProperties: Preprocessor;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Recursively walks tokens and inherits group-level properties to child tokens.
3
+ * Group properties ($description, $extensions at group level) are merged into child tokens
4
+ * that don't have their own values for those properties.
5
+ *
6
+ * Per W3C Design Tokens spec: https://www.designtokens.org/tr/drafts/format/#group-properties
7
+ */
8
+ function inheritProperties(tokens, inheritedProps = {}) {
9
+ var _a;
10
+ const result = {};
11
+ // Extract group-level properties from current level
12
+ const currentGroupProps = {};
13
+ if (typeof tokens.$description === 'string') {
14
+ currentGroupProps.$description = tokens.$description;
15
+ }
16
+ if (tokens.$extensions && typeof tokens.$extensions === 'object') {
17
+ currentGroupProps.$extensions = tokens.$extensions;
18
+ }
19
+ // Merge inherited with current (current takes precedence)
20
+ const mergedProps = Object.assign(Object.assign({}, inheritedProps), currentGroupProps);
21
+ // Merge $extensions deeply
22
+ if (inheritedProps.$extensions || currentGroupProps.$extensions) {
23
+ mergedProps.$extensions = Object.assign(Object.assign({}, inheritedProps.$extensions), currentGroupProps.$extensions);
24
+ }
25
+ for (const [key, value] of Object.entries(tokens)) {
26
+ // Skip group-level properties (they're inherited, not copied)
27
+ if (key === '$description' || key === '$extensions') {
28
+ continue;
29
+ }
30
+ if (typeof value !== 'object' || value === null) {
31
+ result[key] = value;
32
+ continue;
33
+ }
34
+ const tokenValue = value;
35
+ // Check if this is a design token (has $value or value)
36
+ if ('$value' in tokenValue || 'value' in tokenValue) {
37
+ // It's a token - merge inherited properties
38
+ const token = tokenValue;
39
+ // Only inherit $description if token doesn't have its own
40
+ const inheritedDescription = !token.$description && mergedProps.$description ? mergedProps.$description : undefined;
41
+ // Merge $extensions (token-level takes precedence over inherited)
42
+ let mergedExtensions = token.$extensions;
43
+ if (mergedProps.$extensions) {
44
+ const inheritedLlm = mergedProps.$extensions['org.primer.llm'];
45
+ const tokenLlm = (_a = token.$extensions) === null || _a === void 0 ? void 0 : _a['org.primer.llm'];
46
+ if (inheritedLlm && !tokenLlm) {
47
+ // Token has no LLM extension, inherit from group
48
+ mergedExtensions = Object.assign(Object.assign({}, token.$extensions), { 'org.primer.llm': inheritedLlm });
49
+ }
50
+ }
51
+ result[key] = Object.assign(Object.assign(Object.assign({}, token), (inheritedDescription ? { $description: inheritedDescription } : {})), (mergedExtensions ? { $extensions: mergedExtensions } : {}));
52
+ }
53
+ else {
54
+ // It's a nested group - recurse with merged properties
55
+ result[key] = inheritProperties(tokenValue, mergedProps);
56
+ }
57
+ }
58
+ return result;
59
+ }
60
+ /**
61
+ * Preprocessor that inherits group-level $description and $extensions to child tokens.
62
+ * This enables W3C Design Tokens group properties to be available on individual tokens
63
+ * during formatting.
64
+ */
65
+ export const inheritGroupProperties = {
66
+ name: 'inheritGroupProperties',
67
+ preprocessor: (dictionary) => {
68
+ return inheritProperties(dictionary);
69
+ },
70
+ };
@@ -1,7 +1,8 @@
1
1
  import StyleDictionary from 'style-dictionary';
2
2
  import { borderToCss, colorToRgbAlpha, colorToHex, colorToRgbaFloat, cubicBezierToCss, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, gradientToCss, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, transitionToCss, } from './transformers/index.js';
3
- import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
3
+ import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, markdownLlmGuidelines, } from './formats/index.js';
4
4
  import { themeOverrides } from './preprocessors/themeOverrides.js';
5
+ import { inheritGroupProperties } from './preprocessors/inheritGroupProperties.js';
5
6
  import { colorAlphaToCss } from './transformers/colorAlphaToCss.js';
6
7
  /**
7
8
  * @name {@link PrimerStyleDictionary}
@@ -55,6 +56,10 @@ PrimerStyleDictionary.registerFormat({
55
56
  name: 'json/figma',
56
57
  format: jsonFigma,
57
58
  });
59
+ PrimerStyleDictionary.registerFormat({
60
+ name: 'json/llm-guidelines',
61
+ format: markdownLlmGuidelines,
62
+ });
58
63
  /**
59
64
  * Transformers
60
65
  *
@@ -88,3 +93,4 @@ PrimerStyleDictionary.registerTransform(fontFamilyToCss);
88
93
  PrimerStyleDictionary.registerTransform(fontFamilyToFigma);
89
94
  PrimerStyleDictionary.registerTransform(gradientToCss);
90
95
  PrimerStyleDictionary.registerPreprocessor(themeOverrides);
96
+ PrimerStyleDictionary.registerPreprocessor(inheritGroupProperties);
@@ -1,6 +1,27 @@
1
1
  import { z } from 'zod';
2
2
  export declare const borderValue: z.ZodObject<{
3
- color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
3
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
4
+ colorSpace: z.ZodEnum<{
5
+ "display-p3": "display-p3";
6
+ srgb: "srgb";
7
+ rec2020: "rec2020";
8
+ "srgb-linear": "srgb-linear";
9
+ hsl: "hsl";
10
+ hwb: "hwb";
11
+ lab: "lab";
12
+ lch: "lch";
13
+ oklab: "oklab";
14
+ oklch: "oklch";
15
+ "a98-rgb": "a98-rgb";
16
+ "prophoto-rgb": "prophoto-rgb";
17
+ xyz: "xyz";
18
+ "xyz-d50": "xyz-d50";
19
+ "xyz-d65": "xyz-d65";
20
+ }>;
21
+ components: z.ZodTuple<[z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>], null>;
22
+ alpha: z.ZodOptional<z.ZodNumber>;
23
+ hex: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strict>, z.ZodString]>;
4
25
  style: z.ZodEnum<{
5
26
  inset: "inset";
6
27
  solid: "solid";
@@ -11,13 +32,41 @@ export declare const borderValue: z.ZodObject<{
11
32
  ridge: "ridge";
12
33
  outset: "outset";
13
34
  }>;
14
- width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodString]>;
35
+ width: z.ZodUnion<readonly [z.ZodObject<{
36
+ value: z.ZodNumber;
37
+ unit: z.ZodEnum<{
38
+ em: "em";
39
+ px: "px";
40
+ rem: "rem";
41
+ }>;
42
+ }, z.core.$strict>, z.ZodString]>;
15
43
  }, z.core.$strip>;
16
44
  export declare const borderToken: z.ZodObject<{
17
45
  $description: z.ZodOptional<z.ZodString>;
18
46
  $deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
19
47
  $value: z.ZodUnion<readonly [z.ZodObject<{
20
- color: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
48
+ color: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
49
+ colorSpace: z.ZodEnum<{
50
+ "display-p3": "display-p3";
51
+ srgb: "srgb";
52
+ rec2020: "rec2020";
53
+ "srgb-linear": "srgb-linear";
54
+ hsl: "hsl";
55
+ hwb: "hwb";
56
+ lab: "lab";
57
+ lch: "lch";
58
+ oklab: "oklab";
59
+ oklch: "oklch";
60
+ "a98-rgb": "a98-rgb";
61
+ "prophoto-rgb": "prophoto-rgb";
62
+ xyz: "xyz";
63
+ "xyz-d50": "xyz-d50";
64
+ "xyz-d65": "xyz-d65";
65
+ }>;
66
+ components: z.ZodTuple<[z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>], null>;
67
+ alpha: z.ZodOptional<z.ZodNumber>;
68
+ hex: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strict>, z.ZodString]>;
21
70
  style: z.ZodEnum<{
22
71
  inset: "inset";
23
72
  solid: "solid";
@@ -28,7 +77,20 @@ export declare const borderToken: z.ZodObject<{
28
77
  ridge: "ridge";
29
78
  outset: "outset";
30
79
  }>;
31
- width: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodString]>;
80
+ width: z.ZodUnion<readonly [z.ZodObject<{
81
+ value: z.ZodNumber;
82
+ unit: z.ZodEnum<{
83
+ em: "em";
84
+ px: "px";
85
+ rem: "rem";
86
+ }>;
87
+ }, z.core.$strict>, z.ZodString]>;
32
88
  }, z.core.$strip>, z.ZodString]>;
33
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
89
+ $type: z.ZodLiteral<"number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "duration" | "dimension" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange" | "custom-string">;
90
+ $extensions: z.ZodOptional<z.ZodObject<{
91
+ 'org.primer.llm': z.ZodOptional<z.ZodObject<{
92
+ usage: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ rules: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strip>>;
34
96
  }, z.core.$strict>;
@@ -2,10 +2,12 @@ import { z } from 'zod';
2
2
  import { baseToken } from './baseToken.js';
3
3
  import { referenceValue } from './referenceValue.js';
4
4
  import { colorHexValue } from './colorHexValue.js';
5
+ import { colorW3cValue } from './colorW3cValue.js';
5
6
  import { dimensionValue } from './dimensionValue.js';
6
7
  import { tokenType } from './tokenType.js';
8
+ import { llmExtension } from './llmExtension.js';
7
9
  export const borderValue = z.object({
8
- color: z.union([colorHexValue, referenceValue]),
10
+ color: z.union([colorHexValue, colorW3cValue, referenceValue]),
9
11
  style: z.enum(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']),
10
12
  width: z.union([dimensionValue, referenceValue]),
11
13
  });
@@ -13,5 +15,10 @@ export const borderToken = baseToken
13
15
  .extend({
14
16
  $value: z.union([borderValue, referenceValue]),
15
17
  $type: tokenType('border'),
18
+ $extensions: z
19
+ .object({
20
+ 'org.primer.llm': llmExtension,
21
+ })
22
+ .optional(),
16
23
  })
17
24
  .strict();