@primer/primitives 11.4.0-rc.f798df25 → 11.4.1-rc.4e2d1de5

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 (198) 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/markdownLlmGuidelines.d.ts +11 -0
  10. package/dist/build/formats/markdownLlmGuidelines.js +1168 -0
  11. package/dist/build/platforms/index.d.ts +1 -0
  12. package/dist/build/platforms/index.js +1 -0
  13. package/dist/build/platforms/llmGuidelines.d.ts +2 -0
  14. package/dist/build/platforms/llmGuidelines.js +17 -0
  15. package/dist/build/preprocessors/inheritGroupProperties.d.ts +7 -0
  16. package/dist/build/preprocessors/inheritGroupProperties.js +70 -0
  17. package/dist/build/primerStyleDictionary.js +7 -1
  18. package/dist/build/schemas/borderToken.d.ts +22 -2
  19. package/dist/build/schemas/borderToken.js +6 -0
  20. package/dist/build/schemas/colorToken.d.ts +4 -0
  21. package/dist/build/schemas/colorToken.js +2 -0
  22. package/dist/build/schemas/cubicBezierToken.d.ts +6 -0
  23. package/dist/build/schemas/cubicBezierToken.js +10 -2
  24. package/dist/build/schemas/designToken.d.ts +1 -1
  25. package/dist/build/schemas/designToken.js +113 -21
  26. package/dist/build/schemas/dimensionToken.d.ts +14 -3
  27. package/dist/build/schemas/dimensionToken.js +6 -2
  28. package/dist/build/schemas/dimensionValue.d.ts +24 -1
  29. package/dist/build/schemas/dimensionValue.js +20 -1
  30. package/dist/build/schemas/durationToken.d.ts +13 -1
  31. package/dist/build/schemas/durationToken.js +6 -0
  32. package/dist/build/schemas/durationValue.d.ts +11 -1
  33. package/dist/build/schemas/durationValue.js +13 -3
  34. package/dist/build/schemas/fontFamilyToken.d.ts +4 -0
  35. package/dist/build/schemas/fontFamilyToken.js +2 -0
  36. package/dist/build/schemas/fontWeightToken.d.ts +4 -0
  37. package/dist/build/schemas/fontWeightToken.js +2 -0
  38. package/dist/build/schemas/gradientToken.d.ts +4 -0
  39. package/dist/build/schemas/gradientToken.js +2 -0
  40. package/dist/build/schemas/llmExtension.d.ts +9 -0
  41. package/dist/build/schemas/llmExtension.js +11 -0
  42. package/dist/build/schemas/numberToken.d.ts +4 -0
  43. package/dist/build/schemas/numberToken.js +2 -0
  44. package/dist/build/schemas/shadowToken.d.ts +676 -84
  45. package/dist/build/schemas/shadowToken.js +2 -0
  46. package/dist/build/schemas/stringToken.d.ts +6 -0
  47. package/dist/build/schemas/stringToken.js +6 -0
  48. package/dist/build/schemas/transitionToken.d.ts +20 -2
  49. package/dist/build/schemas/transitionToken.js +6 -0
  50. package/dist/build/schemas/typographyToken.d.ts +38 -4
  51. package/dist/build/schemas/typographyToken.js +6 -0
  52. package/dist/build/schemas/validTokenType.d.ts +5 -1
  53. package/dist/build/schemas/validTokenType.js +71 -17
  54. package/dist/build/schemas/viewportRangeToken.d.ts +6 -0
  55. package/dist/build/schemas/viewportRangeToken.js +6 -0
  56. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
  57. package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
  58. package/dist/build/transformers/dimensionToRem.d.ts +2 -1
  59. package/dist/build/transformers/dimensionToRem.js +21 -22
  60. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
  61. package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
  62. package/dist/build/transformers/durationToCss.d.ts +2 -1
  63. package/dist/build/transformers/durationToCss.js +18 -11
  64. package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
  65. package/dist/build/transformers/utilities/parseDimension.js +31 -0
  66. package/dist/build/types/dimensionTokenValue.d.ts +9 -0
  67. package/dist/css/base/motion/motion.css +5 -4
  68. package/dist/css/functional/size/border.css +9 -14
  69. package/dist/css/functional/size/radius.css +7 -0
  70. package/dist/css/functional/size/size-coarse.css +3 -3
  71. package/dist/css/functional/size/size-fine.css +3 -3
  72. package/dist/css/functional/size/viewport.css +1 -1
  73. package/dist/css/functional/themes/dark-colorblind-high-contrast.css +194 -190
  74. package/dist/css/functional/themes/dark-colorblind.css +194 -190
  75. package/dist/css/functional/themes/dark-dimmed-high-contrast.css +194 -190
  76. package/dist/css/functional/themes/dark-dimmed.css +194 -190
  77. package/dist/css/functional/themes/dark-high-contrast.css +194 -190
  78. package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +194 -190
  79. package/dist/css/functional/themes/dark-tritanopia.css +194 -190
  80. package/dist/css/functional/themes/dark.css +194 -190
  81. package/dist/css/functional/themes/light-colorblind-high-contrast.css +194 -190
  82. package/dist/css/functional/themes/light-colorblind.css +194 -190
  83. package/dist/css/functional/themes/light-high-contrast.css +194 -190
  84. package/dist/css/functional/themes/light-tritanopia-high-contrast.css +194 -190
  85. package/dist/css/functional/themes/light-tritanopia.css +194 -190
  86. package/dist/css/functional/themes/light.css +194 -190
  87. package/dist/css/functional/typography/typography.css +4 -4
  88. package/dist/css/primitives.css +5 -0
  89. package/dist/docs/base/motion/motion.json +181 -32
  90. package/dist/docs/base/size/size.json +76 -19
  91. package/dist/docs/base/typography/typography.json +24 -6
  92. package/dist/docs/functional/size/border.json +62 -182
  93. package/dist/docs/functional/size/breakpoints.json +24 -6
  94. package/dist/docs/functional/size/radius.json +221 -0
  95. package/dist/docs/functional/size/size-coarse.json +45 -3
  96. package/dist/docs/functional/size/size-fine.json +45 -3
  97. package/dist/docs/functional/size/size.json +60 -15
  98. package/dist/docs/functional/size/viewport.json +2 -2
  99. package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +1043 -97
  100. package/dist/docs/functional/themes/dark-colorblind.json +1043 -97
  101. package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +1043 -97
  102. package/dist/docs/functional/themes/dark-dimmed.json +1081 -135
  103. package/dist/docs/functional/themes/dark-high-contrast.json +1043 -97
  104. package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +1043 -97
  105. package/dist/docs/functional/themes/dark-tritanopia.json +1043 -97
  106. package/dist/docs/functional/themes/dark.json +1043 -97
  107. package/dist/docs/functional/themes/light-colorblind-high-contrast.json +1049 -103
  108. package/dist/docs/functional/themes/light-colorblind.json +1049 -103
  109. package/dist/docs/functional/themes/light-high-contrast.json +1049 -103
  110. package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +1049 -103
  111. package/dist/docs/functional/themes/light-tritanopia.json +1049 -103
  112. package/dist/docs/functional/themes/light.json +1049 -103
  113. package/dist/docs/functional/typography/typography.json +180 -10
  114. package/dist/fallbacks/base/motion/motion.json +49 -12
  115. package/dist/fallbacks/functional/size/border.json +0 -5
  116. package/dist/fallbacks/functional/size/radius.json +7 -0
  117. package/dist/fallbacks/functional/size/viewport.json +1 -1
  118. package/dist/figma/dimension/dimension.json +30 -20
  119. package/dist/figma/themes/dark-colorblind.json +85 -0
  120. package/dist/figma/themes/dark-dimmed.json +134 -49
  121. package/dist/figma/themes/dark-high-contrast.json +85 -0
  122. package/dist/figma/themes/dark-tritanopia.json +85 -0
  123. package/dist/figma/themes/dark.json +85 -0
  124. package/dist/figma/themes/light-colorblind.json +89 -4
  125. package/dist/figma/themes/light-high-contrast.json +89 -4
  126. package/dist/figma/themes/light-tritanopia.json +89 -4
  127. package/dist/figma/themes/light.json +89 -4
  128. package/dist/figma/typography/typography.json +44 -40
  129. package/dist/internalCss/dark-colorblind-high-contrast.css +208 -218
  130. package/dist/internalCss/dark-colorblind.css +208 -218
  131. package/dist/internalCss/dark-dimmed-high-contrast.css +208 -218
  132. package/dist/internalCss/dark-dimmed.css +208 -218
  133. package/dist/internalCss/dark-high-contrast.css +208 -218
  134. package/dist/internalCss/dark-tritanopia-high-contrast.css +208 -218
  135. package/dist/internalCss/dark-tritanopia.css +208 -218
  136. package/dist/internalCss/dark.css +208 -218
  137. package/dist/internalCss/light-colorblind-high-contrast.css +208 -218
  138. package/dist/internalCss/light-colorblind.css +208 -218
  139. package/dist/internalCss/light-high-contrast.css +208 -218
  140. package/dist/internalCss/light-tritanopia-high-contrast.css +208 -218
  141. package/dist/internalCss/light-tritanopia.css +208 -218
  142. package/dist/internalCss/light.css +208 -218
  143. package/dist/styleLint/base/motion/motion.json +181 -32
  144. package/dist/styleLint/base/size/size.json +76 -19
  145. package/dist/styleLint/base/typography/typography.json +30 -12
  146. package/dist/styleLint/functional/size/border.json +55 -175
  147. package/dist/styleLint/functional/size/breakpoints.json +24 -6
  148. package/dist/styleLint/functional/size/radius.json +221 -0
  149. package/dist/styleLint/functional/size/size-coarse.json +45 -3
  150. package/dist/styleLint/functional/size/size-fine.json +45 -3
  151. package/dist/styleLint/functional/size/size.json +111 -66
  152. package/dist/styleLint/functional/size/viewport.json +2 -2
  153. package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +975 -29
  154. package/dist/styleLint/functional/themes/dark-colorblind.json +975 -29
  155. package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +975 -29
  156. package/dist/styleLint/functional/themes/dark-dimmed.json +1013 -67
  157. package/dist/styleLint/functional/themes/dark-high-contrast.json +975 -29
  158. package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +975 -29
  159. package/dist/styleLint/functional/themes/dark-tritanopia.json +975 -29
  160. package/dist/styleLint/functional/themes/dark.json +975 -29
  161. package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +981 -35
  162. package/dist/styleLint/functional/themes/light-colorblind.json +981 -35
  163. package/dist/styleLint/functional/themes/light-high-contrast.json +981 -35
  164. package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +981 -35
  165. package/dist/styleLint/functional/themes/light-tritanopia.json +981 -35
  166. package/dist/styleLint/functional/themes/light.json +981 -35
  167. package/dist/styleLint/functional/typography/typography.json +196 -26
  168. package/package.json +6 -3
  169. package/src/tokens/base/motion/easing.json5 +39 -4
  170. package/src/tokens/base/motion/timing.json5 +12 -12
  171. package/src/tokens/base/size/size.json5 +19 -19
  172. package/src/tokens/base/typography/typography.json5 +6 -6
  173. package/src/tokens/functional/border/border.json5 +25 -0
  174. package/src/tokens/functional/color/bgColor.json5 +165 -0
  175. package/src/tokens/functional/color/borderColor.json5 +146 -0
  176. package/src/tokens/functional/color/control.json5 +24 -0
  177. package/src/tokens/functional/color/data-vis.json5 +7 -0
  178. package/src/tokens/functional/color/display.json5 +7 -0
  179. package/src/tokens/functional/color/fgColor.json5 +101 -1
  180. package/src/tokens/functional/color/focus.json5 +5 -0
  181. package/src/tokens/functional/color/selection.json5 +5 -0
  182. package/src/tokens/functional/color/syntax.json5 +14 -0
  183. package/src/tokens/functional/shadow/shadow.json5 +49 -4
  184. package/src/tokens/functional/size/border.json5 +22 -74
  185. package/src/tokens/functional/size/breakpoints.json5 +6 -6
  186. package/src/tokens/functional/size/radius.json5 +90 -0
  187. package/src/tokens/functional/size/size-coarse.json5 +24 -3
  188. package/src/tokens/functional/size/size-fine.json5 +45 -24
  189. package/src/tokens/functional/size/size.json5 +50 -15
  190. package/src/tokens/functional/size/viewport.json5 +1 -1
  191. package/src/tokens/functional/typography/font-stack.json5 +60 -0
  192. package/src/tokens/functional/typography/typography.json5 +71 -44
  193. package/dist/build/parsers/index.d.ts +0 -1
  194. package/dist/build/parsers/index.js +0 -1
  195. package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
  196. package/dist/build/parsers/w3cJsonParser.js +0 -25
  197. package/dist/removed/testing.json5 +0 -4
  198. package/src/tokens/removed/testing.json5 +0 -4
@@ -3,21 +3,31 @@
3
3
  "key": "{fontStack.monospace}",
4
4
  "$value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
5
5
  "$type": "fontFamily",
6
+ "$description": "Monospace font stack for code, technical content, and tabular data.",
6
7
  "$extensions": {
7
8
  "org.primer.figma": {
8
9
  "collection": "typography",
9
10
  "scopes": ["fontFamily"]
11
+ },
12
+ "org.primer.llm": {
13
+ "usage": ["code-block", "inline-code", "terminal", "technical-data", "tabular-numbers"],
14
+ "rules": "MUST use for all code display. Use for technical content requiring fixed-width characters."
10
15
  }
11
16
  },
12
- "filePath": "src/tokens/functional/typography/typography.json5",
17
+ "filePath": "src/tokens/functional/typography/font-stack.json5",
13
18
  "isSource": true,
14
19
  "original": {
15
20
  "$value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
16
21
  "$type": "fontFamily",
22
+ "$description": "Monospace font stack for code, technical content, and tabular data.",
17
23
  "$extensions": {
18
24
  "org.primer.figma": {
19
25
  "collection": "typography",
20
26
  "scopes": ["fontFamily"]
27
+ },
28
+ "org.primer.llm": {
29
+ "usage": ["code-block", "inline-code", "terminal", "technical-data", "tabular-numbers"],
30
+ "rules": "MUST use for all code display. Use for technical content requiring fixed-width characters."
21
31
  }
22
32
  },
23
33
  "key": "{fontStack.monospace}"
@@ -30,21 +40,31 @@
30
40
  "key": "{fontStack.sansSerif}",
31
41
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
32
42
  "$type": "fontFamily",
43
+ "$description": "Sans-serif font stack for body text and general UI elements.",
33
44
  "$extensions": {
34
45
  "org.primer.figma": {
35
46
  "collection": "typography",
36
47
  "scopes": ["fontFamily"]
48
+ },
49
+ "org.primer.llm": {
50
+ "usage": ["body-text", "form-inputs", "labels", "paragraphs"],
51
+ "rules": "Default font stack for all UI text. Use for body text and standard UI elements. MUST use for readable content."
37
52
  }
38
53
  },
39
- "filePath": "src/tokens/functional/typography/typography.json5",
54
+ "filePath": "src/tokens/functional/typography/font-stack.json5",
40
55
  "isSource": true,
41
56
  "original": {
42
57
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
43
58
  "$type": "fontFamily",
59
+ "$description": "Sans-serif font stack for body text and general UI elements.",
44
60
  "$extensions": {
45
61
  "org.primer.figma": {
46
62
  "collection": "typography",
47
63
  "scopes": ["fontFamily"]
64
+ },
65
+ "org.primer.llm": {
66
+ "usage": ["body-text", "form-inputs", "labels", "paragraphs"],
67
+ "rules": "Default font stack for all UI text. Use for body text and standard UI elements. MUST use for readable content."
48
68
  }
49
69
  },
50
70
  "key": "{fontStack.sansSerif}"
@@ -57,21 +77,31 @@
57
77
  "key": "{fontStack.sansSerifDisplay}",
58
78
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
59
79
  "$type": "fontFamily",
80
+ "$description": "Display font stack for headings and titles. Same as sansSerif but semantically distinct.",
60
81
  "$extensions": {
61
82
  "org.primer.figma": {
62
83
  "collection": "typography",
63
84
  "scopes": ["fontFamily"]
85
+ },
86
+ "org.primer.llm": {
87
+ "usage": ["heading", "title", "display-text", "hero-text"],
88
+ "rules": "Use for headings and display text. Prefer over sansSerif for titles."
64
89
  }
65
90
  },
66
- "filePath": "src/tokens/functional/typography/typography.json5",
91
+ "filePath": "src/tokens/functional/typography/font-stack.json5",
67
92
  "isSource": true,
68
93
  "original": {
69
94
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
70
95
  "$type": "fontFamily",
96
+ "$description": "Display font stack for headings and titles. Same as sansSerif but semantically distinct.",
71
97
  "$extensions": {
72
98
  "org.primer.figma": {
73
99
  "collection": "typography",
74
100
  "scopes": ["fontFamily"]
101
+ },
102
+ "org.primer.llm": {
103
+ "usage": ["heading", "title", "display-text", "hero-text"],
104
+ "rules": "Use for headings and display text. Prefer over sansSerif for titles."
75
105
  }
76
106
  },
77
107
  "key": "{fontStack.sansSerifDisplay}"
@@ -84,17 +114,19 @@
84
114
  "key": "{fontStack.system}",
85
115
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
86
116
  "$type": "fontFamily",
117
+ "$description": "System font stack optimized for cross-platform rendering. Primary font for all UI text.",
87
118
  "$extensions": {
88
119
  "org.primer.figma": {
89
120
  "collection": "typography",
90
121
  "scopes": ["fontFamily"]
91
122
  }
92
123
  },
93
- "filePath": "src/tokens/functional/typography/typography.json5",
124
+ "filePath": "src/tokens/functional/typography/font-stack.json5",
94
125
  "isSource": true,
95
126
  "original": {
96
127
  "$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
97
128
  "$type": "fontFamily",
129
+ "$description": "System font stack optimized for cross-platform rendering. Primary font for all UI text.",
98
130
  "$extensions": {
99
131
  "org.primer.figma": {
100
132
  "collection": "typography",
@@ -208,9 +240,15 @@
208
240
  },
209
241
  "text-body-shorthand-large": {
210
242
  "key": "{text.body.shorthand.large}",
211
- "$value": "400 ,16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
243
+ "$value": "400 1rem,16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
212
244
  "$type": "typography",
213
245
  "$description": "User-generated content, markdown rendering.",
246
+ "$extensions": {
247
+ "org.primer.llm": {
248
+ "usage": ["markdown-content", "article-text", "readme", "comment-body"],
249
+ "rules": "Use for user-generated content and markdown. Better readability for longer text."
250
+ }
251
+ },
214
252
  "filePath": "src/tokens/functional/typography/typography.json5",
215
253
  "isSource": true,
216
254
  "original": {
@@ -222,6 +260,12 @@
222
260
  },
223
261
  "$type": "typography",
224
262
  "$description": "User-generated content, markdown rendering.",
263
+ "$extensions": {
264
+ "org.primer.llm": {
265
+ "usage": ["markdown-content", "article-text", "readme", "comment-body"],
266
+ "rules": "Use for user-generated content and markdown. Better readability for longer text."
267
+ }
268
+ },
225
269
  "key": "{text.body.shorthand.large}"
226
270
  },
227
271
  "name": "text-body-shorthand-large",
@@ -230,9 +274,15 @@
230
274
  },
231
275
  "text-body-shorthand-medium": {
232
276
  "key": "{text.body.shorthand.medium}",
233
- "$value": "400 ,14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
277
+ "$value": "400 0.875rem,14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
234
278
  "$type": "typography",
235
279
  "$description": "Default UI font. Most commonly used for body text.",
280
+ "$extensions": {
281
+ "org.primer.llm": {
282
+ "usage": ["body-text", "ui-text", "form-label", "button-text", "navigation"],
283
+ "rules": "RECOMMENDED default for UI text. Use for buttons, labels, and general interface text."
284
+ }
285
+ },
236
286
  "filePath": "src/tokens/functional/typography/typography.json5",
237
287
  "isSource": true,
238
288
  "original": {
@@ -244,6 +294,12 @@
244
294
  },
245
295
  "$type": "typography",
246
296
  "$description": "Default UI font. Most commonly used for body text.",
297
+ "$extensions": {
298
+ "org.primer.llm": {
299
+ "usage": ["body-text", "ui-text", "form-label", "button-text", "navigation"],
300
+ "rules": "RECOMMENDED default for UI text. Use for buttons, labels, and general interface text."
301
+ }
302
+ },
247
303
  "key": "{text.body.shorthand.medium}"
248
304
  },
249
305
  "name": "text-body-shorthand-medium",
@@ -252,9 +308,15 @@
252
308
  },
253
309
  "text-body-shorthand-small": {
254
310
  "key": "{text.body.shorthand.small}",
255
- "$value": "400 ,12px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
311
+ "$value": "400 0.75rem,12px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
256
312
  "$type": "typography",
257
313
  "$description": "Small body text for discrete UI applications, such as helper, footnote text. Should be used sparingly across pages. Line-height matches Body (medium) at 20px.",
314
+ "$extensions": {
315
+ "org.primer.llm": {
316
+ "usage": ["helper-text", "footnote", "metadata", "timestamp"],
317
+ "rules": "Use sparingly for secondary information. Do NOT use for primary content or interactive elements."
318
+ }
319
+ },
258
320
  "filePath": "src/tokens/functional/typography/typography.json5",
259
321
  "isSource": true,
260
322
  "original": {
@@ -266,6 +328,12 @@
266
328
  },
267
329
  "$type": "typography",
268
330
  "$description": "Small body text for discrete UI applications, such as helper, footnote text. Should be used sparingly across pages. Line-height matches Body (medium) at 20px.",
331
+ "$extensions": {
332
+ "org.primer.llm": {
333
+ "usage": ["helper-text", "footnote", "metadata", "timestamp"],
334
+ "rules": "Use sparingly for secondary information. Do NOT use for primary content or interactive elements."
335
+ }
336
+ },
269
337
  "key": "{text.body.shorthand.small}"
270
338
  },
271
339
  "name": "text-body-shorthand-small",
@@ -274,7 +342,7 @@
274
342
  },
275
343
  "text-body-size-large": {
276
344
  "key": "{text.body.size.large}",
277
- "$value": [null, "16px"],
345
+ "$value": ["1rem", "16px"],
278
346
  "$type": "dimension",
279
347
  "$extensions": {
280
348
  "org.primer.figma": {
@@ -301,7 +369,7 @@
301
369
  },
302
370
  "text-body-size-medium": {
303
371
  "key": "{text.body.size.medium}",
304
- "$value": [null, "14px"],
372
+ "$value": ["0.875rem", "14px"],
305
373
  "$type": "dimension",
306
374
  "$extensions": {
307
375
  "org.primer.figma": {
@@ -328,7 +396,7 @@
328
396
  },
329
397
  "text-body-size-small": {
330
398
  "key": "{text.body.size.small}",
331
- "$value": [null, "12px"],
399
+ "$value": ["0.75rem", "12px"],
332
400
  "$type": "dimension",
333
401
  "$extensions": {
334
402
  "org.primer.figma": {
@@ -415,9 +483,15 @@
415
483
  },
416
484
  "text-caption-shorthand": {
417
485
  "key": "{text.caption.shorthand}",
418
- "$value": "400 ,12px/1.25 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
486
+ "$value": "400 0.75rem,12px/1.25 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
419
487
  "$type": "typography",
420
488
  "$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.",
489
+ "$extensions": {
490
+ "org.primer.llm": {
491
+ "usage": ["caption", "label", "badge-text", "single-line-metadata"],
492
+ "rules": "Use only for single-line or short text. Does NOT meet accessibility requirements for body text."
493
+ }
494
+ },
421
495
  "filePath": "src/tokens/functional/typography/typography.json5",
422
496
  "isSource": true,
423
497
  "original": {
@@ -429,6 +503,12 @@
429
503
  },
430
504
  "$type": "typography",
431
505
  "$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.",
506
+ "$extensions": {
507
+ "org.primer.llm": {
508
+ "usage": ["caption", "label", "badge-text", "single-line-metadata"],
509
+ "rules": "Use only for single-line or short text. Does NOT meet accessibility requirements for body text."
510
+ }
511
+ },
432
512
  "key": "{text.caption.shorthand}"
433
513
  },
434
514
  "name": "text-caption-shorthand",
@@ -437,7 +517,7 @@
437
517
  },
438
518
  "text-caption-size": {
439
519
  "key": "{text.caption.size}",
440
- "$value": [null, "12px"],
520
+ "$value": ["0.75rem", "12px"],
441
521
  "$type": "dimension",
442
522
  "$extensions": {
443
523
  "org.primer.figma": {
@@ -527,6 +607,12 @@
527
607
  "$value": "400 0.8125rem,13px/1.5 ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
528
608
  "$type": "typography",
529
609
  "$description": "Default style for rendering code blocks.",
610
+ "$extensions": {
611
+ "org.primer.llm": {
612
+ "usage": ["code-block", "pre-element", "code-snippet", "terminal-output"],
613
+ "rules": "MUST use for multi-line code. Use monospace font stack."
614
+ }
615
+ },
530
616
  "filePath": "src/tokens/functional/typography/typography.json5",
531
617
  "isSource": true,
532
618
  "original": {
@@ -538,6 +624,12 @@
538
624
  },
539
625
  "$type": "typography",
540
626
  "$description": "Default style for rendering code blocks.",
627
+ "$extensions": {
628
+ "org.primer.llm": {
629
+ "usage": ["code-block", "pre-element", "code-snippet", "terminal-output"],
630
+ "rules": "MUST use for multi-line code. Use monospace font stack."
631
+ }
632
+ },
541
633
  "key": "{text.codeBlock.shorthand}"
542
634
  },
543
635
  "name": "text-codeBlock-shorthand",
@@ -557,7 +649,10 @@
557
649
  "filePath": "src/tokens/functional/typography/typography.json5",
558
650
  "isSource": true,
559
651
  "original": {
560
- "$value": "13px",
652
+ "$value": {
653
+ "value": 13,
654
+ "unit": "px"
655
+ },
561
656
  "$type": "dimension",
562
657
  "$extensions": {
563
658
  "org.primer.figma": {
@@ -600,9 +695,15 @@
600
695
  },
601
696
  "text-codeInline-shorthand": {
602
697
  "key": "{text.codeInline.shorthand}",
603
- "$value": "400 ,14.856px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
698
+ "$value": "400 0.9285em,0.9285em ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
604
699
  "$type": "typography",
605
700
  "$description": "Inline code blocks using em units to inherit size from its parent.",
701
+ "$extensions": {
702
+ "org.primer.llm": {
703
+ "usage": ["inline-code", "code-element", "variable-name", "command"],
704
+ "rules": "Use for inline code within text. Size inherits from parent using em units."
705
+ }
706
+ },
606
707
  "filePath": "src/tokens/functional/typography/typography.json5",
607
708
  "isSource": true,
608
709
  "original": {
@@ -613,6 +714,12 @@
613
714
  },
614
715
  "$type": "typography",
615
716
  "$description": "Inline code blocks using em units to inherit size from its parent.",
717
+ "$extensions": {
718
+ "org.primer.llm": {
719
+ "usage": ["inline-code", "code-element", "variable-name", "command"],
720
+ "rules": "Use for inline code within text. Size inherits from parent using em units."
721
+ }
722
+ },
616
723
  "key": "{text.codeInline.shorthand}"
617
724
  },
618
725
  "name": "text-codeInline-shorthand",
@@ -621,7 +728,7 @@
621
728
  },
622
729
  "text-codeInline-size": {
623
730
  "key": "{text.codeInline.size}",
624
- "$value": [null, "14.856px"],
731
+ "$value": ["0.9285em", "0.9285em"],
625
732
  "$type": "dimension",
626
733
  "$extensions": {
627
734
  "org.primer.figma": {
@@ -632,7 +739,10 @@
632
739
  "filePath": "src/tokens/functional/typography/typography.json5",
633
740
  "isSource": true,
634
741
  "original": {
635
- "$value": "0.9285em",
742
+ "$value": {
743
+ "value": 0.9285,
744
+ "unit": "em"
745
+ },
636
746
  "$type": "dimension",
637
747
  "$extensions": {
638
748
  "org.primer.figma": {
@@ -743,9 +853,15 @@
743
853
  },
744
854
  "text-display-shorthand": {
745
855
  "key": "{text.display.shorthand}",
746
- "$value": "500 ,40px/1.375 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
856
+ "$value": "500 2.5rem,40px/1.375 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
747
857
  "$type": "typography",
748
858
  "$description": "Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports.",
859
+ "$extensions": {
860
+ "org.primer.llm": {
861
+ "usage": ["hero-section", "landing-page", "marketing-header"],
862
+ "rules": "Use sparingly for hero sections. Switch to title.large on narrow viewports."
863
+ }
864
+ },
749
865
  "filePath": "src/tokens/functional/typography/typography.json5",
750
866
  "isSource": true,
751
867
  "original": {
@@ -757,6 +873,12 @@
757
873
  },
758
874
  "$type": "typography",
759
875
  "$description": "Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports.",
876
+ "$extensions": {
877
+ "org.primer.llm": {
878
+ "usage": ["hero-section", "landing-page", "marketing-header"],
879
+ "rules": "Use sparingly for hero sections. Switch to title.large on narrow viewports."
880
+ }
881
+ },
760
882
  "key": "{text.display.shorthand}"
761
883
  },
762
884
  "name": "text-display-shorthand",
@@ -765,7 +887,7 @@
765
887
  },
766
888
  "text-display-size": {
767
889
  "key": "{text.display.size}",
768
- "$value": [null, "40px"],
890
+ "$value": ["2.5rem", "40px"],
769
891
  "$type": "dimension",
770
892
  "$extensions": {
771
893
  "org.primer.figma": {
@@ -852,9 +974,15 @@
852
974
  },
853
975
  "text-subtitle-shorthand": {
854
976
  "key": "{text.subtitle.shorthand}",
855
- "$value": "400 ,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
977
+ "$value": "400 1.25rem,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
856
978
  "$type": "typography",
857
979
  "$description": "Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium).",
980
+ "$extensions": {
981
+ "org.primer.llm": {
982
+ "usage": ["subtitle", "description", "secondary-heading", "lead-text"],
983
+ "rules": "Use below titles for supporting text. Normal weight distinguishes from title styles."
984
+ }
985
+ },
858
986
  "filePath": "src/tokens/functional/typography/typography.json5",
859
987
  "isSource": true,
860
988
  "original": {
@@ -866,6 +994,12 @@
866
994
  },
867
995
  "$type": "typography",
868
996
  "$description": "Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium).",
997
+ "$extensions": {
998
+ "org.primer.llm": {
999
+ "usage": ["subtitle", "description", "secondary-heading", "lead-text"],
1000
+ "rules": "Use below titles for supporting text. Normal weight distinguishes from title styles."
1001
+ }
1002
+ },
869
1003
  "key": "{text.subtitle.shorthand}"
870
1004
  },
871
1005
  "name": "text-subtitle-shorthand",
@@ -874,7 +1008,7 @@
874
1008
  },
875
1009
  "text-subtitle-size": {
876
1010
  "key": "{text.subtitle.size}",
877
- "$value": [null, "20px"],
1011
+ "$value": ["1.25rem", "20px"],
878
1012
  "$type": "dimension",
879
1013
  "$extensions": {
880
1014
  "org.primer.figma": {
@@ -1027,9 +1161,15 @@
1027
1161
  },
1028
1162
  "text-title-shorthand-large": {
1029
1163
  "key": "{text.title.shorthand.large}",
1030
- "$value": "600 ,32px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1164
+ "$value": "600 2rem,32px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1031
1165
  "$type": "typography",
1032
1166
  "$description": "Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports.",
1167
+ "$extensions": {
1168
+ "org.primer.llm": {
1169
+ "usage": ["page-heading", "issue-title", "pr-title", "h1"],
1170
+ "rules": "Use for primary page headings. Switch to title.medium on narrow viewports."
1171
+ }
1172
+ },
1033
1173
  "filePath": "src/tokens/functional/typography/typography.json5",
1034
1174
  "isSource": true,
1035
1175
  "original": {
@@ -1041,6 +1181,12 @@
1041
1181
  },
1042
1182
  "$type": "typography",
1043
1183
  "$description": "Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports.",
1184
+ "$extensions": {
1185
+ "org.primer.llm": {
1186
+ "usage": ["page-heading", "issue-title", "pr-title", "h1"],
1187
+ "rules": "Use for primary page headings. Switch to title.medium on narrow viewports."
1188
+ }
1189
+ },
1044
1190
  "key": "{text.title.shorthand.large}"
1045
1191
  },
1046
1192
  "name": "text-title-shorthand-large",
@@ -1049,9 +1195,15 @@
1049
1195
  },
1050
1196
  "text-title-shorthand-medium": {
1051
1197
  "key": "{text.title.shorthand.medium}",
1052
- "$value": "600 ,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1198
+ "$value": "600 1.25rem,20px/1.625 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1053
1199
  "$type": "typography",
1054
1200
  "$description": "Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition.",
1201
+ "$extensions": {
1202
+ "org.primer.llm": {
1203
+ "usage": ["section-heading", "card-title", "dialog-title", "h2"],
1204
+ "rules": "RECOMMENDED default for page titles. Use for section headings and dialog titles."
1205
+ }
1206
+ },
1055
1207
  "filePath": "src/tokens/functional/typography/typography.json5",
1056
1208
  "isSource": true,
1057
1209
  "original": {
@@ -1063,6 +1215,12 @@
1063
1215
  },
1064
1216
  "$type": "typography",
1065
1217
  "$description": "Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition.",
1218
+ "$extensions": {
1219
+ "org.primer.llm": {
1220
+ "usage": ["section-heading", "card-title", "dialog-title", "h2"],
1221
+ "rules": "RECOMMENDED default for page titles. Use for section headings and dialog titles."
1222
+ }
1223
+ },
1066
1224
  "key": "{text.title.shorthand.medium}"
1067
1225
  },
1068
1226
  "name": "text-title-shorthand-medium",
@@ -1071,9 +1229,15 @@
1071
1229
  },
1072
1230
  "text-title-shorthand-small": {
1073
1231
  "key": "{text.title.shorthand.small}",
1074
- "$value": "600 ,16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1232
+ "$value": "600 1rem,16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
1075
1233
  "$type": "typography",
1076
1234
  "$description": "Uses the same size as body (large) with a heavier weight of semibold (600).",
1235
+ "$extensions": {
1236
+ "org.primer.llm": {
1237
+ "usage": ["subsection-heading", "list-title", "h3", "sidebar-heading"],
1238
+ "rules": "Use for smaller headings within sections. Same size as body.large but semibold."
1239
+ }
1240
+ },
1077
1241
  "filePath": "src/tokens/functional/typography/typography.json5",
1078
1242
  "isSource": true,
1079
1243
  "original": {
@@ -1085,6 +1249,12 @@
1085
1249
  },
1086
1250
  "$type": "typography",
1087
1251
  "$description": "Uses the same size as body (large) with a heavier weight of semibold (600).",
1252
+ "$extensions": {
1253
+ "org.primer.llm": {
1254
+ "usage": ["subsection-heading", "list-title", "h3", "sidebar-heading"],
1255
+ "rules": "Use for smaller headings within sections. Same size as body.large but semibold."
1256
+ }
1257
+ },
1088
1258
  "key": "{text.title.shorthand.small}"
1089
1259
  },
1090
1260
  "name": "text-title-shorthand-small",
@@ -1093,7 +1263,7 @@
1093
1263
  },
1094
1264
  "text-title-size-large": {
1095
1265
  "key": "{text.title.size.large}",
1096
- "$value": [null, "32px"],
1266
+ "$value": ["2rem", "32px"],
1097
1267
  "$type": "dimension",
1098
1268
  "$extensions": {
1099
1269
  "org.primer.figma": {
@@ -1120,7 +1290,7 @@
1120
1290
  },
1121
1291
  "text-title-size-medium": {
1122
1292
  "key": "{text.title.size.medium}",
1123
- "$value": [null, "20px"],
1293
+ "$value": ["1.25rem", "20px"],
1124
1294
  "$type": "dimension",
1125
1295
  "$extensions": {
1126
1296
  "org.primer.figma": {
@@ -1147,7 +1317,7 @@
1147
1317
  },
1148
1318
  "text-title-size-small": {
1149
1319
  "key": "{text.title.size.small}",
1150
- "$value": [null, "16px"],
1320
+ "$value": ["1rem", "16px"],
1151
1321
  "$type": "dimension",
1152
1322
  "$extensions": {
1153
1323
  "org.primer.figma": {
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "11.4.0-rc.f798df25",
3
+ "version": "11.4.1-rc.4e2d1de5",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
- "src/tokens"
8
+ "src/tokens",
9
+ "DESIGN_TOKENS_SPEC.md",
10
+ "DESIGN_TOKENS_GUIDE.md"
9
11
  ],
10
12
  "repository": "https://github.com/primer/primitives",
11
13
  "keywords": [
@@ -23,11 +25,12 @@
23
25
  },
24
26
  "homepage": "https://github.com/primer/primitives#readme",
25
27
  "scripts": {
26
- "build": "npm run clean && npm run build:tokens && npm run build:fallbacks && npm run build:figma && npm run build:config",
28
+ "build": "npm run clean && npm run build:tokens && npm run build:fallbacks && npm run build:figma && npm run build:config && npm run build:llm",
27
29
  "build:tokens": "tsx ./scripts/buildTokens.ts",
28
30
  "build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
29
31
  "build:figma": "tsx scripts/buildFigma.ts",
30
32
  "build:config": "tsc -p build.tsconfig.jsonc && tsx ./scripts/copyDir.ts src/types dist/build/types",
33
+ "build:llm": "tsx ./scripts/buildLlm.ts",
31
34
  "clean": "rm -rf dist",
32
35
  "validate:contrast": "tsx scripts/colorContrast.ts",
33
36
  "format": "prettier --check '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
@@ -4,22 +4,57 @@
4
4
  linear: {
5
5
  $value: [0, 0, 1, 1],
6
6
  $type: 'cubicBezier',
7
- $description: 'Ideal for non-movement properties, like opacity or background color.',
7
+ $description: 'Constant motion with no acceleration. Use for continuous animations like progress bars or loaders.',
8
+ $extensions: {
9
+ 'org.primer.llm': {
10
+ usage: ['progress-bar', 'loader', 'continuous-animation', 'scrolling'],
11
+ rules: 'Use if the motion is constant.',
12
+ },
13
+ },
14
+ },
15
+ ease: {
16
+ $value: [0.25, 0.1, 0.25, 1],
17
+ $type: 'cubicBezier',
18
+ $description: 'CSS default easing. Use for hover state changes and micro-interactions.',
19
+ $extensions: {
20
+ 'org.primer.llm': {
21
+ usage: ['hover-state', 'micro-interaction', 'button-hover', 'link-hover'],
22
+ rules: 'Use for hover state changes.',
23
+ },
24
+ },
8
25
  },
9
26
  easeIn: {
10
27
  $value: [0.7, 0.1, 0.75, 0.9],
11
28
  $type: 'cubicBezier',
12
- $description: 'Ideal for movement that starts on the page and ends off the page.',
29
+ $description: 'Accelerating motion. Use for elements exiting the viewport (moving off-screen).',
30
+ $extensions: {
31
+ 'org.primer.llm': {
32
+ usage: ['exit-animation', 'element-leaving', 'off-screen-motion'],
33
+ rules: 'Rarely used alone. Prefer ease-out for most exit animations.',
34
+ },
35
+ },
13
36
  },
14
37
  easeOut: {
15
38
  $value: [0.3, 0.8, 0.6, 1],
16
39
  $type: 'cubicBezier',
17
- $description: 'Ideal for movement that starts off the page and ends on the page.',
40
+ $description: 'Decelerating motion. Use for elements entering the viewport or appearing on screen.',
41
+ $extensions: {
42
+ 'org.primer.llm': {
43
+ usage: ['enter-animation', 'element-appearing', 'modal-open', 'dropdown-open', 'tooltip-appear'],
44
+ rules: 'RECOMMENDED default. Use if an element enters or exits the viewport.',
45
+ },
46
+ },
18
47
  },
19
48
  easeInOut: {
20
49
  $value: [0.6, 0, 0.2, 1],
21
50
  $type: 'cubicBezier',
22
- $description: 'Ideal for movement that starts and ends on the page.',
51
+ $description: 'Smooth acceleration and deceleration. Use for elements moving or morphing within the viewport.',
52
+ $extensions: {
53
+ 'org.primer.llm': {
54
+ usage: ['position-change', 'size-change', 'morph-animation', 'expand-collapse', 'slide-transition'],
55
+ rules: 'Use if an element moves or morphs on screen.',
56
+ },
57
+ },
23
58
  },
24
59
  },
25
60
  },