@primer/primitives 11.4.1-rc.eb8ee149 → 11.5.0-rc.14eaeb12

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 (190) hide show
  1. package/DESIGN_TOKENS_GUIDE.md +185 -0
  2. package/DESIGN_TOKENS_SPEC.md +136 -8
  3. package/dist/build/formats/jsonFigma.js +8 -1
  4. package/dist/build/formats/markdownLlmGuidelines.js +349 -0
  5. package/dist/build/schemas/borderToken.d.ts +61 -5
  6. package/dist/build/schemas/borderToken.js +2 -1
  7. package/dist/build/schemas/colorToken.d.ts +639 -30
  8. package/dist/build/schemas/colorToken.js +3 -2
  9. package/dist/build/schemas/colorW3cValue.d.ts +28 -0
  10. package/dist/build/schemas/colorW3cValue.js +42 -0
  11. package/dist/build/schemas/cubicBezierToken.d.ts +1 -1
  12. package/dist/build/schemas/dimensionToken.d.ts +9 -2
  13. package/dist/build/schemas/dimensionValue.d.ts +12 -1
  14. package/dist/build/schemas/dimensionValue.js +10 -13
  15. package/dist/build/schemas/durationToken.d.ts +8 -2
  16. package/dist/build/schemas/durationValue.d.ts +11 -1
  17. package/dist/build/schemas/durationValue.js +13 -3
  18. package/dist/build/schemas/fontFamilyToken.d.ts +1 -1
  19. package/dist/build/schemas/fontWeightToken.d.ts +1 -1
  20. package/dist/build/schemas/gradientToken.d.ts +23 -2
  21. package/dist/build/schemas/gradientToken.js +2 -1
  22. package/dist/build/schemas/numberToken.d.ts +1 -1
  23. package/dist/build/schemas/shadowToken.d.ts +1751 -127
  24. package/dist/build/schemas/shadowToken.js +8 -2
  25. package/dist/build/schemas/stringToken.d.ts +1 -1
  26. package/dist/build/schemas/stringToken.js +1 -1
  27. package/dist/build/schemas/tokenType.d.ts +1 -1
  28. package/dist/build/schemas/transitionToken.d.ts +15 -3
  29. package/dist/build/schemas/typographyToken.d.ts +19 -5
  30. package/dist/build/schemas/typographyToken.js +1 -1
  31. package/dist/build/schemas/validTokenType.d.ts +1 -1
  32. package/dist/build/schemas/validTokenType.js +1 -1
  33. package/dist/build/schemas/viewportRangeToken.d.ts +1 -1
  34. package/dist/build/transformers/borderToCss.js +19 -1
  35. package/dist/build/transformers/colorAlphaToCss.js +6 -3
  36. package/dist/build/transformers/colorToHex.js +5 -2
  37. package/dist/build/transformers/colorToRgbAlpha.js +5 -2
  38. package/dist/build/transformers/colorToRgbaFloat.js +5 -0
  39. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
  40. package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
  41. package/dist/build/transformers/dimensionToRem.d.ts +2 -1
  42. package/dist/build/transformers/dimensionToRem.js +21 -22
  43. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
  44. package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
  45. package/dist/build/transformers/durationToCss.d.ts +2 -1
  46. package/dist/build/transformers/durationToCss.js +19 -12
  47. package/dist/build/transformers/gradientToCss.js +2 -1
  48. package/dist/build/transformers/shadowToCss.js +15 -1
  49. package/dist/build/transformers/utilities/normalizeColorValue.d.ts +23 -0
  50. package/dist/build/transformers/utilities/normalizeColorValue.js +74 -0
  51. package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
  52. package/dist/build/transformers/utilities/parseDimension.js +31 -0
  53. package/dist/build/types/borderTokenValue.d.ts +5 -2
  54. package/dist/build/types/dimensionTokenValue.d.ts +9 -0
  55. package/dist/build/types/shadowTokenValue.d.ts +8 -5
  56. package/dist/css/base/motion/motion.css +1 -1
  57. package/dist/css/functional/size/radius.css +1 -1
  58. package/dist/css/functional/size/size-coarse.css +1 -0
  59. package/dist/css/functional/size/size-fine.css +1 -0
  60. package/dist/css/functional/size/size.css +5 -0
  61. package/dist/css/functional/themes/dark-colorblind-high-contrast.css +42 -30
  62. package/dist/css/functional/themes/dark-colorblind.css +42 -30
  63. package/dist/css/functional/themes/dark-dimmed-high-contrast.css +42 -30
  64. package/dist/css/functional/themes/dark-dimmed.css +42 -30
  65. package/dist/css/functional/themes/dark-high-contrast.css +42 -30
  66. package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +42 -30
  67. package/dist/css/functional/themes/dark-tritanopia.css +42 -30
  68. package/dist/css/functional/themes/dark.css +42 -30
  69. package/dist/css/functional/themes/light-colorblind-high-contrast.css +42 -30
  70. package/dist/css/functional/themes/light-colorblind.css +42 -30
  71. package/dist/css/functional/themes/light-high-contrast.css +42 -30
  72. package/dist/css/functional/themes/light-tritanopia-high-contrast.css +42 -30
  73. package/dist/css/functional/themes/light-tritanopia.css +42 -30
  74. package/dist/css/functional/themes/light.css +42 -30
  75. package/dist/docs/base/motion/motion.json +96 -24
  76. package/dist/docs/base/size/size.json +76 -19
  77. package/dist/docs/base/typography/typography.json +24 -6
  78. package/dist/docs/functional/size/border.json +26 -11
  79. package/dist/docs/functional/size/breakpoints.json +24 -6
  80. package/dist/docs/functional/size/radius.json +18 -6
  81. package/dist/docs/functional/size/size-coarse.json +55 -2
  82. package/dist/docs/functional/size/size-fine.json +55 -2
  83. package/dist/docs/functional/size/size.json +195 -15
  84. package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +3921 -714
  85. package/dist/docs/functional/themes/dark-colorblind.json +3911 -712
  86. package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +3774 -547
  87. package/dist/docs/functional/themes/dark-dimmed.json +3801 -554
  88. package/dist/docs/functional/themes/dark-high-contrast.json +3926 -715
  89. package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +3936 -717
  90. package/dist/docs/functional/themes/dark-tritanopia.json +3769 -546
  91. package/dist/docs/functional/themes/dark.json +3920 -713
  92. package/dist/docs/functional/themes/light-colorblind-high-contrast.json +3780 -553
  93. package/dist/docs/functional/themes/light-colorblind.json +3767 -548
  94. package/dist/docs/functional/themes/light-high-contrast.json +3785 -554
  95. package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +3785 -554
  96. package/dist/docs/functional/themes/light-tritanopia.json +3777 -550
  97. package/dist/docs/functional/themes/light.json +3782 -551
  98. package/dist/docs/functional/typography/typography.json +8 -2
  99. package/dist/fallbacks/base/motion/motion.json +48 -12
  100. package/dist/fallbacks/functional/size/size-coarse.json +2 -1
  101. package/dist/fallbacks/functional/size/size-fine.json +2 -1
  102. package/dist/fallbacks/functional/size/size.json +5 -0
  103. package/dist/figma/dimension/dimension.json +56 -1
  104. package/dist/figma/themes/dark-colorblind.json +49 -1
  105. package/dist/figma/themes/dark-dimmed.json +51 -3
  106. package/dist/figma/themes/dark-high-contrast.json +49 -1
  107. package/dist/figma/themes/dark-tritanopia.json +49 -1
  108. package/dist/figma/themes/dark.json +49 -1
  109. package/dist/figma/themes/light-colorblind.json +53 -5
  110. package/dist/figma/themes/light-high-contrast.json +53 -5
  111. package/dist/figma/themes/light-tritanopia.json +53 -5
  112. package/dist/figma/themes/light.json +53 -5
  113. package/dist/internalCss/dark-colorblind-high-contrast.css +42 -30
  114. package/dist/internalCss/dark-colorblind.css +42 -30
  115. package/dist/internalCss/dark-dimmed-high-contrast.css +42 -30
  116. package/dist/internalCss/dark-dimmed.css +42 -30
  117. package/dist/internalCss/dark-high-contrast.css +42 -30
  118. package/dist/internalCss/dark-tritanopia-high-contrast.css +42 -30
  119. package/dist/internalCss/dark-tritanopia.css +42 -30
  120. package/dist/internalCss/dark.css +42 -30
  121. package/dist/internalCss/light-colorblind-high-contrast.css +42 -30
  122. package/dist/internalCss/light-colorblind.css +42 -30
  123. package/dist/internalCss/light-high-contrast.css +42 -30
  124. package/dist/internalCss/light-tritanopia-high-contrast.css +42 -30
  125. package/dist/internalCss/light-tritanopia.css +42 -30
  126. package/dist/internalCss/light.css +42 -30
  127. package/dist/styleLint/base/motion/motion.json +96 -24
  128. package/dist/styleLint/base/size/size.json +76 -19
  129. package/dist/styleLint/base/typography/typography.json +30 -12
  130. package/dist/styleLint/functional/size/border.json +27 -12
  131. package/dist/styleLint/functional/size/breakpoints.json +24 -6
  132. package/dist/styleLint/functional/size/radius.json +19 -7
  133. package/dist/styleLint/functional/size/size-coarse.json +60 -7
  134. package/dist/styleLint/functional/size/size-fine.json +60 -7
  135. package/dist/styleLint/functional/size/size.json +246 -66
  136. package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +4060 -733
  137. package/dist/styleLint/functional/themes/dark-colorblind.json +4050 -731
  138. package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +3914 -567
  139. package/dist/styleLint/functional/themes/dark-dimmed.json +3941 -574
  140. package/dist/styleLint/functional/themes/dark-high-contrast.json +4065 -734
  141. package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +4075 -736
  142. package/dist/styleLint/functional/themes/dark-tritanopia.json +4079 -736
  143. package/dist/styleLint/functional/themes/dark.json +4059 -732
  144. package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +4091 -744
  145. package/dist/styleLint/functional/themes/light-colorblind.json +4078 -739
  146. package/dist/styleLint/functional/themes/light-high-contrast.json +4096 -745
  147. package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +4096 -745
  148. package/dist/styleLint/functional/themes/light-tritanopia.json +4088 -741
  149. package/dist/styleLint/functional/themes/light.json +4093 -742
  150. package/dist/styleLint/functional/typography/typography.json +28 -22
  151. package/package.json +5 -4
  152. package/src/tokens/base/color/dark/dark.dimmed.json5 +405 -81
  153. package/src/tokens/base/color/dark/dark.high-contrast.json5 +405 -81
  154. package/src/tokens/base/color/dark/dark.json5 +475 -95
  155. package/src/tokens/base/color/dark/display-dark.json5 +960 -192
  156. package/src/tokens/base/color/light/display-light.json5 +960 -192
  157. package/src/tokens/base/color/light/light.high-contrast.json5 +405 -81
  158. package/src/tokens/base/color/light/light.json5 +475 -95
  159. package/src/tokens/base/motion/timing.json5 +12 -12
  160. package/src/tokens/base/size/size.json5 +194 -194
  161. package/src/tokens/base/typography/typography.json5 +6 -6
  162. package/src/tokens/component/avatar.json5 +72 -44
  163. package/src/tokens/component/button.json5 +1846 -1191
  164. package/src/tokens/component/reactionButton.json5 +20 -4
  165. package/src/tokens/functional/border/border.json5 +33 -2
  166. package/src/tokens/functional/color/bgColor.json5 +18 -2
  167. package/src/tokens/functional/color/borderColor.json5 +8 -1
  168. package/src/tokens/functional/color/control.json5 +160 -32
  169. package/src/tokens/functional/color/display.json5 +7 -0
  170. package/src/tokens/functional/color/fgColor.json5 +13 -1
  171. package/src/tokens/functional/color/syntax.json5 +24 -2
  172. package/src/tokens/functional/shadow/shadow.json5 +1254 -163
  173. package/src/tokens/functional/size/border.json5 +8 -8
  174. package/src/tokens/functional/size/breakpoints.json5 +6 -6
  175. package/src/tokens/functional/size/radius.json5 +5 -5
  176. package/src/tokens/functional/size/size-coarse.json5 +15 -0
  177. package/src/tokens/functional/size/size-fine.json5 +15 -0
  178. package/src/tokens/functional/size/size.json5 +65 -15
  179. package/src/tokens/functional/typography/typography.json5 +8 -4
  180. package/dist/build/parsers/index.d.ts +0 -1
  181. package/dist/build/parsers/index.js +0 -1
  182. package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
  183. package/dist/build/parsers/w3cJsonParser.js +0 -25
  184. package/dist/removed/testing.json5 +0 -4
  185. package/guidelines/color.llm.md +0 -16
  186. package/guidelines/guidelines.llm.md +0 -34
  187. package/guidelines/motion.llm.md +0 -41
  188. package/guidelines/spacing.llm.md +0 -20
  189. package/guidelines/typography.llm.md +0 -14
  190. package/src/tokens/removed/testing.json5 +0 -4
@@ -3,17 +3,17 @@
3
3
  thin: {
4
4
  $value: 'inset 0 0 0 {borderWidth.thin}',
5
5
  $description: 'Thin shadow used instead of a border to prevent layout shift',
6
- $type: 'string',
6
+ $type: 'custom-string',
7
7
  },
8
8
  thick: {
9
9
  $value: 'inset 0 0 0 {borderWidth.thick}',
10
10
  $description: 'Thick shadow (2px) used instead of a border for emphasis without layout shift',
11
- $type: 'string',
11
+ $type: 'custom-string',
12
12
  },
13
13
  thicker: {
14
14
  $value: 'inset 0 0 0 {borderWidth.thicker}',
15
15
  $description: 'Thickest shadow (4px) used for high emphasis borders without layout shift. Use sparingly for maximum visual impact',
16
- $type: 'string',
16
+ $type: 'custom-string',
17
17
  },
18
18
  },
19
19
  borderWidth: {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  },
31
31
  thin: {
32
- $value: '1px',
32
+ $value: {value: 1, unit: 'px'},
33
33
  $description: 'Standard 1px border width. Use for most borders, dividers, and outlines throughout the interface',
34
34
  $type: 'dimension',
35
35
  $extensions: {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  },
42
42
  thick: {
43
- $value: '2px',
43
+ $value: {value: 2, unit: 'px'},
44
44
  $description: 'Thick 2px border for emphasis. Use for focus indicators, selected states, or to emphasize important boundaries',
45
45
  $type: 'dimension',
46
46
  $extensions: {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  },
57
57
  thicker: {
58
- $value: '4px',
58
+ $value: {value: 4, unit: 'px'},
59
59
  $description: 'Extra thick 4px border for maximum emphasis. Use sparingly for high-contrast focus indicators or critical visual separators',
60
60
  $type: 'dimension',
61
61
  $extensions: {
@@ -69,7 +69,7 @@
69
69
  outline: {
70
70
  focus: {
71
71
  offset: {
72
- $value: '-2px',
72
+ $value: {value: -2, unit: 'px'},
73
73
  $description: 'Focus outline offset (-2px). Negative value creates an inset outline for keyboard focus indicators, ensuring the focus ring stays within the element bounds',
74
74
  $type: 'dimension',
75
75
  $extensions: {
@@ -80,7 +80,7 @@
80
80
  },
81
81
  },
82
82
  width: {
83
- $value: '2px',
83
+ $value: {value: 2, unit: 'px'},
84
84
  $description: 'Focus outline width (2px). Standard width for keyboard focus indicators to meet WCAG 2.4.7 accessibility requirements',
85
85
  $type: 'dimension',
86
86
  $extensions: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "breakpoint": {
3
3
  "xsmall": {
4
- "$value": "320px",
4
+ "$value": {"value": 320, "unit": "px"},
5
5
  "$type": "dimension",
6
6
  "$extensions": {
7
7
  "org.primer.figma": {
@@ -11,7 +11,7 @@
11
11
  }
12
12
  },
13
13
  "small": {
14
- "$value": "544px",
14
+ "$value": {"value": 544, "unit": "px"},
15
15
  "$type": "dimension",
16
16
  "$extensions": {
17
17
  "org.primer.figma": {
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "medium": {
24
- "$value": "768px",
24
+ "$value": {"value": 768, "unit": "px"},
25
25
  "$type": "dimension",
26
26
  "$extensions": {
27
27
  "org.primer.figma": {
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "large": {
34
- "$value": "1012px",
34
+ "$value": {"value": 1012, "unit": "px"},
35
35
  "$type": "dimension",
36
36
  "$extensions": {
37
37
  "org.primer.figma": {
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "xlarge": {
44
- "$value": "1280px",
44
+ "$value": {"value": 1280, "unit": "px"},
45
45
  "$type": "dimension",
46
46
  "$extensions": {
47
47
  "org.primer.figma": {
@@ -51,7 +51,7 @@
51
51
  }
52
52
  },
53
53
  "xxlarge": {
54
- "$value": "1400px",
54
+ "$value": {"value": 1400, "unit": "px"},
55
55
  "$type": "dimension",
56
56
  "$extensions": {
57
57
  "org.primer.figma": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  borderRadius: {
3
3
  small: {
4
- $value: '3px',
4
+ $value: {value: 3, unit: 'px'},
5
5
  $description: 'Small border radius (3px). Use for small variants of components or small UI elements like badges, tags, or anything below 16px in height',
6
6
  $type: 'dimension',
7
7
  $extensions: {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  },
21
21
  medium: {
22
- $value: '6px',
22
+ $value: {value: 6, unit: 'px'},
23
23
  $description: 'Medium border radius (6px). The default choice for most buttons, cards, and containers',
24
24
  $type: 'dimension',
25
25
  $extensions: {
@@ -37,8 +37,8 @@
37
37
  },
38
38
  },
39
39
  large: {
40
- $value: '12px',
41
- $description: 'Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired. Always use this for buttons.',
40
+ $value: {value: 12, unit: 'px'},
41
+ $description: 'Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired.',
42
42
  $type: 'dimension',
43
43
  $extensions: {
44
44
  'org.primer.figma': {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  },
57
57
  full: {
58
- $value: '9999px',
58
+ $value: {value: 9999, unit: 'px'},
59
59
  $type: 'dimension',
60
60
  $description: 'Use this border radius for pill shaped elements',
61
61
  $extensions: {
@@ -44,6 +44,21 @@
44
44
  }
45
45
  }
46
46
  }
47
+ },
48
+ "large": {
49
+ "gap": {
50
+ "auto": {
51
+ "$value": "{base.size.12}",
52
+ "$type": "dimension",
53
+ "$description": "Gap between stacked controls in large density layouts for touch devices",
54
+ "$extensions": {
55
+ "org.primer.llm": {
56
+ "usage": ["touch-control-spacing", "mobile-form-gap", "stacked-buttons"],
57
+ "rules": "Use for spacing between interactive controls on touch devices in large layouts. Provides adequate touch separation. Do NOT use for desktop/mouse interfaces."
58
+ }
59
+ }
60
+ }
61
+ }
47
62
  }
48
63
  }
49
64
  }
@@ -45,5 +45,20 @@
45
45
  },
46
46
  },
47
47
  },
48
+ large: {
49
+ gap: {
50
+ auto: {
51
+ $value: '{base.size.8}',
52
+ $type: 'dimension',
53
+ $description: 'Gap between stacked controls in large density layouts for mouse interfaces',
54
+ $extensions: {
55
+ 'org.primer.llm': {
56
+ usage: ['desktop-control-spacing', 'form-gap', 'stacked-buttons'],
57
+ rules: 'Use for spacing between interactive controls on desktop in large layouts. Do NOT use for mobile/touch interfaces.',
58
+ },
59
+ },
60
+ },
61
+ },
62
+ },
48
63
  },
49
64
  }
@@ -51,7 +51,7 @@
51
51
  }
52
52
  },
53
53
  "paddingBlock": {
54
- "$value": "2px",
54
+ "$value": {"value": 2, "unit": "px"},
55
55
  "$type": "dimension",
56
56
  "$extensions": {
57
57
  "org.primer.figma": {
@@ -154,6 +154,16 @@
154
154
  "scopes": ["gap"]
155
155
  }
156
156
  }
157
+ },
158
+ "spacious": {
159
+ "$value": "{base.size.16}",
160
+ "$type": "dimension",
161
+ "$extensions": {
162
+ "org.primer.figma": {
163
+ "collection": "pattern/size",
164
+ "scopes": ["gap"]
165
+ }
166
+ }
157
167
  }
158
168
  },
159
169
  "gap": {
@@ -189,7 +199,7 @@
189
199
  }
190
200
  },
191
201
  "paddingBlock": {
192
- "$value": "6px",
202
+ "$value": {"value": 6, "unit": "px"},
193
203
  "$type": "dimension",
194
204
  "$extensions": {
195
205
  "org.primer.figma": {
@@ -263,7 +273,7 @@
263
273
  }
264
274
  },
265
275
  "paddingBlock": {
266
- "$value": "10px",
276
+ "$value": {"value": 10, "unit": "px"},
267
277
  "$type": "dimension",
268
278
  "$extensions": {
269
279
  "org.primer.figma": {
@@ -273,6 +283,16 @@
273
283
  }
274
284
  },
275
285
  "paddingInline": {
286
+ "condensed": {
287
+ "$value": "{base.size.8}",
288
+ "$type": "dimension",
289
+ "$extensions": {
290
+ "org.primer.figma": {
291
+ "collection": "pattern/size",
292
+ "scopes": ["gap"]
293
+ }
294
+ }
295
+ },
276
296
  "normal": {
277
297
  "$value": "{base.size.12}",
278
298
  "$type": "dimension",
@@ -327,7 +347,7 @@
327
347
  }
328
348
  },
329
349
  "paddingBlock": {
330
- "$value": "14px",
350
+ "$value": {"value": 14, "unit": "px"},
331
351
  "$type": "dimension",
332
352
  "$extensions": {
333
353
  "org.primer.figma": {
@@ -337,6 +357,16 @@
337
357
  }
338
358
  },
339
359
  "paddingInline": {
360
+ "condensed": {
361
+ "$value": "{base.size.8}",
362
+ "$type": "dimension",
363
+ "$extensions": {
364
+ "org.primer.figma": {
365
+ "collection": "pattern/size",
366
+ "scopes": ["gap"]
367
+ }
368
+ }
369
+ },
340
370
  "normal": {
341
371
  "$value": "{base.size.12}",
342
372
  "$type": "dimension",
@@ -380,7 +410,7 @@
380
410
  },
381
411
  "strokeWidth": {
382
412
  "default": {
383
- "$value": "2px",
413
+ "$value": {"value": 2, "unit": "px"},
384
414
  "$type": "dimension"
385
415
  }
386
416
  },
@@ -524,6 +554,16 @@
524
554
  },
525
555
  "small": {
526
556
  "gap": {
557
+ "auto": {
558
+ "$value": "{base.size.8}",
559
+ "$type": "dimension",
560
+ "$extensions": {
561
+ "org.primer.figma": {
562
+ "collection": "pattern/size",
563
+ "scopes": ["gap"]
564
+ }
565
+ }
566
+ },
527
567
  "condensed": {
528
568
  "$value": "{base.size.8}",
529
569
  "$type": "dimension",
@@ -548,6 +588,16 @@
548
588
  },
549
589
  "medium": {
550
590
  "gap": {
591
+ "auto": {
592
+ "$value": "{base.size.8}",
593
+ "$type": "dimension",
594
+ "$extensions": {
595
+ "org.primer.figma": {
596
+ "collection": "pattern/size",
597
+ "scopes": ["gap"]
598
+ }
599
+ }
600
+ },
551
601
  "condensed": {
552
602
  "$value": "{base.size.8}",
553
603
  "$type": "dimension",
@@ -615,7 +665,7 @@
615
665
  },
616
666
  "width": {
617
667
  "xsmall": {
618
- "$value": "192px",
668
+ "$value": {"value": 192, "unit": "px"},
619
669
  "$type": "dimension",
620
670
  "$extensions": {
621
671
  "org.primer.figma": {
@@ -625,7 +675,7 @@
625
675
  }
626
676
  },
627
677
  "small": {
628
- "$value": "320px",
678
+ "$value": {"value": 320, "unit": "px"},
629
679
  "$type": "dimension",
630
680
  "$extensions": {
631
681
  "org.primer.figma": {
@@ -635,7 +685,7 @@
635
685
  }
636
686
  },
637
687
  "medium": {
638
- "$value": "480px",
688
+ "$value": {"value": 480, "unit": "px"},
639
689
  "$type": "dimension",
640
690
  "$extensions": {
641
691
  "org.primer.figma": {
@@ -645,7 +695,7 @@
645
695
  }
646
696
  },
647
697
  "large": {
648
- "$value": "640px",
698
+ "$value": {"value": 640, "unit": "px"},
649
699
  "$type": "dimension",
650
700
  "$extensions": {
651
701
  "org.primer.figma": {
@@ -655,7 +705,7 @@
655
705
  }
656
706
  },
657
707
  "xlarge": {
658
- "$value": "960px",
708
+ "$value": {"value": 960, "unit": "px"},
659
709
  "$type": "dimension",
660
710
  "$extensions": {
661
711
  "org.primer.figma": {
@@ -667,7 +717,7 @@
667
717
  },
668
718
  "height": {
669
719
  "small": {
670
- "$value": "256px",
720
+ "$value": {"value": 256, "unit": "px"},
671
721
  "$type": "dimension",
672
722
  "$extensions": {
673
723
  "org.primer.figma": {
@@ -677,7 +727,7 @@
677
727
  }
678
728
  },
679
729
  "medium": {
680
- "$value": "320px",
730
+ "$value": {"value": 320, "unit": "px"},
681
731
  "$type": "dimension",
682
732
  "$extensions": {
683
733
  "org.primer.figma": {
@@ -687,7 +737,7 @@
687
737
  }
688
738
  },
689
739
  "large": {
690
- "$value": "432px",
740
+ "$value": {"value": 432, "unit": "px"},
691
741
  "$type": "dimension",
692
742
  "$extensions": {
693
743
  "org.primer.figma": {
@@ -697,7 +747,7 @@
697
747
  }
698
748
  },
699
749
  "xlarge": {
700
- "$value": "600px",
750
+ "$value": {"value": 600, "unit": "px"},
701
751
  "$type": "dimension",
702
752
  "$extensions": {
703
753
  "org.primer.figma": {
@@ -762,7 +812,7 @@
762
812
  }
763
813
  },
764
814
  "offset": {
765
- "$value": "4px",
815
+ "$value": {"value": 4, "unit": "px"},
766
816
  "$type": "dimension",
767
817
  "$extensions": {
768
818
  "org.primer.figma": {
@@ -450,17 +450,18 @@
450
450
  fontFamily: '{fontStack.sansSerif}',
451
451
  },
452
452
  $type: 'typography',
453
- $description: 'Compact small font with a smaller line height of 16px. Use it for single-line scenarios, as the small sizing doesn’t pass accessibility requirements.',
453
+ $description: 'Compact small font with a smaller line height of 16px. Use it for single-line scenarios, as the small sizing doesn’t pass accessibility requirements.',
454
454
  $extensions: {
455
455
  'org.primer.llm': {
456
456
  usage: ['caption', 'label', 'badge-text', 'single-line-metadata'],
457
457
  rules: 'Use only for single-line or short text. Does NOT meet accessibility requirements for body text.',
458
458
  },
459
- }, },
459
+ },
460
+ },
460
461
  },
461
462
  codeBlock: {
462
463
  size: {
463
- $value: '13px',
464
+ $value: {value: 13, unit: 'px'},
464
465
  $type: 'dimension',
465
466
  $extensions: {
466
467
  'org.primer.figma': {
@@ -511,7 +512,10 @@
511
512
  },
512
513
  codeInline: {
513
514
  size: {
514
- $value: '0.9285em',
515
+ $value: {
516
+ value: 0.9285,
517
+ unit: 'em',
518
+ },
515
519
  $type: 'dimension',
516
520
  $extensions: {
517
521
  'org.primer.figma': {
@@ -1 +0,0 @@
1
- export { w3cJsonParser } from './w3cJsonParser.js';
@@ -1 +0,0 @@
1
- export { w3cJsonParser } from './w3cJsonParser.js';
@@ -1,6 +0,0 @@
1
- import type { Parser } from 'style-dictionary/types';
2
- /**
3
- * @description Parses a valid [json5](https://json5.org) file and replaces `$value` with `value` and `$description` with `comment` to make a w3c standard file compatible with style dictionary
4
- * @pattern supported file extensions `.json` or `.json5`
5
- */
6
- export declare const w3cJsonParser: Parser;
@@ -1,25 +0,0 @@
1
- import JSON5 from 'json5';
2
- /**
3
- * @description Parses a valid [json5](https://json5.org) file and replaces `$value` with `value` and `$description` with `comment` to make a w3c standard file compatible with style dictionary
4
- * @pattern supported file extensions `.json` or `.json5`
5
- */
6
- export const w3cJsonParser = {
7
- name: 'w3cJsonParser',
8
- pattern: /\.json5?$/,
9
- parser: ({ filePath, contents }) => {
10
- // replace $value with value so that style dictionary recognizes it
11
- try {
12
- contents = contents
13
- .replace(/["|']?\$value["|']?:/g, '"value":')
14
- // convert $description to comment
15
- .replace(/["|']?\$?description["|']?:/g, '"comment":')
16
- .replace(/["|']?\$?type["|']?:/g, '"$type":')
17
- .replace(/["|']?\$?extensions["|']?:/g, '"$extensions":');
18
- //
19
- return JSON5.parse(contents);
20
- }
21
- catch (error) {
22
- throw new Error(`Invalid json5 file "${filePath}". Error: ${error}`);
23
- }
24
- },
25
- };
@@ -1,4 +0,0 @@
1
- /* rename token to trigger actions to run on token change */
2
- {
3
- "testing": null
4
- }
@@ -1,16 +0,0 @@
1
- # Color Guidelines
2
-
3
- How to use color tokens correctly for accessible, themeable interfaces.
4
-
5
- ## Pairing Rules
6
-
7
- - MUST use `--fgColor-onEmphasis` for text on any `-emphasis` background
8
- - MUST use `--fgColor-{semantic}` for text on any `-muted` background
9
- - MUST use `--fgColor-default` for text on `--bgColor-default` or `--bgColor-muted`
10
- - NEVER pair `--fgColor-muted` with `--bgColor-muted` (insufficient contrast)
11
-
12
- ## Contrast Requirements
13
-
14
- - MUST ensure 4.5:1 contrast ratio for normal text (WCAG AA)
15
- - MUST ensure 3:1 contrast ratio for large text and UI components
16
- - SHOULD use semantic token pairings which are pre-validated for contrast
@@ -1,34 +0,0 @@
1
- # Primer Design Token Guidelines
2
-
3
- Quick reference for using Primer design tokens correctly.
4
-
5
- ## Tokens
6
-
7
- - MUST use CSS custom properties (design tokens) for all values—never raw values like `#fff` or `16px`
8
-
9
- ## Interactive Elements
10
-
11
- - MUST define all five states for interactive elements (rest, hover, focus, active/pressed, disabled)
12
- - MUST use `:focus-visible` (not `:focus`) for keyboard focus styles
13
- - NEVER remove hover or focus states for aesthetics
14
-
15
- ## Motion
16
-
17
- Use subtle motion to enhance interactivity and understanding. All interactive states (hover, focus, press) MUST have motion transitions. Keep animations under 300ms and respect `prefers-reduced-motion`.
18
-
19
- → [Full motion guidelines](motion.llm.md)
20
-
21
- ## Color
22
-
23
- - Use semantic pairings (fg/bg) and enforce contrast requirements.
24
- - See: [color guidelines](color.llm.md)
25
-
26
- ## Spacing
27
-
28
- - Use control/stack tokens for sizing, padding, and gaps.
29
- - See: [spacing guidelines](spacing.llm.md)
30
-
31
- ## Typography
32
-
33
- - Use shorthand text tokens and follow responsive guidance.
34
- - See: [typography guidelines](typography.llm.md)
@@ -1,41 +0,0 @@
1
- # Motion Guidelines
2
-
3
- Motion enhances user understanding and provides feedback. Keep it subtle and purposeful.
4
-
5
- ## Core Principles
6
-
7
- - MUST use motion for interactive state changes (hover, focus, press)
8
- - MUST keep motion subtle—users should feel it, not notice it
9
- - MUST use motion to support understanding, not distract
10
- - SHOULD keep animations under 300ms for UI interactions
11
- - NEVER use motion purely for decoration
12
- - NEVER create motion that loops indefinitely without user control
13
-
14
- ## When to Use Motion
15
-
16
- - MUST animate hover states on interactive elements (buttons, links, cards)
17
- - MUST animate focus states for keyboard navigation
18
- - MUST animate state transitions (expand/collapse, show/hide)
19
- - SHOULD animate page/view transitions
20
- - SHOULD animate loading states to indicate progress
21
- - NEVER animate static content or non-interactive elements
22
-
23
- ## Easing Selection
24
-
25
- 1. **Element entering or exiting viewport?** → `ease-out` (default)
26
- 2. **Moving or morphing on screen?** → `ease-in-out`
27
- 3. **Hover state change?** → `ease`
28
- 4. **Constant motion (loaders)?** → `linear`
29
-
30
- ## Duration Guidelines
31
-
32
- - MUST use 100-200ms for micro-interactions (hover, focus)
33
- - SHOULD use 200-300ms for state changes (expand, collapse)
34
- - SHOULD use 300-500ms for larger transitions (modals, page changes)
35
- - NEVER exceed 500ms for UI interactions
36
-
37
- ## Accessibility
38
-
39
- - MUST respect `prefers-reduced-motion` media query
40
- - MUST provide instant alternatives when motion is reduced
41
- - NEVER rely solely on motion to convey information
@@ -1,20 +0,0 @@
1
- # Spacing Guidelines
2
-
3
- How to use spacing and sizing tokens for consistent layouts.
4
-
5
- ## Control Sizing & Padding
6
-
7
- - Use the control size tokens (`--control-*-size`) for height and matching padding tokens per size.
8
- - Choose padding density via suffixes: `-condensed`, `-normal` (default), `-spacious`.
9
-
10
- ## Stack Spacing
11
-
12
- - Use stack tokens for layout gaps (`--stack-gap-*`, `--stack-padding-*`).
13
- - For control groups, use control stack tokens (e.g., `--controlStack-*-gap-*`).
14
-
15
- ## Rules
16
-
17
- - MUST use control tokens for interactive elements (buttons, inputs)
18
- - MUST use stack tokens for layout spacing
19
- - MUST match padding density to the control's purpose
20
- - SHOULD use `medium` size as the default
@@ -1,14 +0,0 @@
1
- # Typography Guidelines
2
-
3
- How to use typography tokens for readable, consistent text.
4
-
5
- ## Responsive Typography
6
-
7
- - SHOULD use `--text-title-shorthand-medium` on narrow viewports instead of `large`
8
- - SHOULD use `--text-body-shorthand-medium` instead of `large` on mobile
9
-
10
- ## Rules
11
-
12
- - MUST use shorthand tokens (they ensure proper line-height)
13
- - SHOULD use semantic heading levels (h1-h6) with corresponding title tokens
14
- - NEVER set font-size without also setting line-height
@@ -1,4 +0,0 @@
1
- /* rename token to trigger actions to run on token change */
2
- {
3
- "testing": null
4
- }