@primer/primitives 11.4.0 → 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.
- package/DESIGN_TOKENS_GUIDE.md +185 -0
- package/DESIGN_TOKENS_SPEC.md +565 -0
- package/dist/build/formats/markdownLlmGuidelines.d.ts +7 -6
- package/dist/build/formats/markdownLlmGuidelines.js +1034 -60
- package/dist/build/schemas/borderToken.d.ts +16 -2
- package/dist/build/schemas/dimensionToken.d.ts +8 -1
- package/dist/build/schemas/dimensionValue.d.ts +24 -1
- package/dist/build/schemas/dimensionValue.js +20 -1
- package/dist/build/schemas/durationToken.d.ts +7 -1
- package/dist/build/schemas/durationValue.d.ts +11 -1
- package/dist/build/schemas/durationValue.js +13 -3
- package/dist/build/schemas/shadowToken.d.ts +672 -84
- package/dist/build/schemas/transitionToken.d.ts +14 -2
- package/dist/build/schemas/typographyToken.d.ts +32 -4
- package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
- package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
- package/dist/build/transformers/dimensionToRem.d.ts +2 -1
- package/dist/build/transformers/dimensionToRem.js +21 -22
- package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
- package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
- package/dist/build/transformers/durationToCss.d.ts +2 -1
- package/dist/build/transformers/durationToCss.js +18 -11
- package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
- package/dist/build/transformers/utilities/parseDimension.js +31 -0
- package/dist/build/types/dimensionTokenValue.d.ts +9 -0
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-colorblind.css +18 -14
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-dimmed.css +18 -14
- package/dist/css/functional/themes/dark-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-tritanopia.css +18 -14
- package/dist/css/functional/themes/dark.css +18 -14
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-colorblind.css +18 -14
- package/dist/css/functional/themes/light-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-tritanopia.css +18 -14
- package/dist/css/functional/themes/light.css +18 -14
- package/dist/css/primitives.css +4 -0
- package/dist/docs/base/motion/motion.json +96 -24
- package/dist/docs/base/size/size.json +76 -19
- package/dist/docs/base/typography/typography.json +24 -6
- package/dist/docs/functional/size/border.json +20 -5
- package/dist/docs/functional/size/breakpoints.json +24 -6
- package/dist/docs/functional/size/radius.json +16 -4
- package/dist/docs/functional/size/size.json +60 -15
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-colorblind.json +109 -7
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-dimmed.json +109 -7
- package/dist/docs/functional/themes/dark-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-tritanopia.json +109 -7
- package/dist/docs/functional/themes/dark.json +109 -7
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-colorblind.json +115 -13
- package/dist/docs/functional/themes/light-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-tritanopia.json +115 -13
- package/dist/docs/functional/themes/light.json +115 -13
- package/dist/docs/functional/typography/typography.json +8 -2
- package/dist/fallbacks/base/motion/motion.json +48 -12
- package/dist/figma/themes/light-colorblind.json +4 -4
- package/dist/figma/themes/light-high-contrast.json +4 -4
- package/dist/figma/themes/light-tritanopia.json +4 -4
- package/dist/figma/themes/light.json +4 -4
- package/dist/internalCss/dark-colorblind-high-contrast.css +14 -14
- package/dist/internalCss/dark-colorblind.css +14 -14
- package/dist/internalCss/dark-dimmed-high-contrast.css +14 -14
- package/dist/internalCss/dark-dimmed.css +14 -14
- package/dist/internalCss/dark-high-contrast.css +14 -14
- package/dist/internalCss/dark-tritanopia-high-contrast.css +14 -14
- package/dist/internalCss/dark-tritanopia.css +14 -14
- package/dist/internalCss/dark.css +14 -14
- package/dist/internalCss/light-colorblind-high-contrast.css +14 -14
- package/dist/internalCss/light-colorblind.css +14 -14
- package/dist/internalCss/light-high-contrast.css +14 -14
- package/dist/internalCss/light-tritanopia-high-contrast.css +14 -14
- package/dist/internalCss/light-tritanopia.css +14 -14
- package/dist/internalCss/light.css +14 -14
- package/dist/styleLint/base/motion/motion.json +96 -24
- package/dist/styleLint/base/size/size.json +76 -19
- package/dist/styleLint/base/typography/typography.json +30 -12
- package/dist/styleLint/functional/size/border.json +21 -6
- package/dist/styleLint/functional/size/breakpoints.json +24 -6
- package/dist/styleLint/functional/size/radius.json +17 -5
- package/dist/styleLint/functional/size/size-coarse.json +3 -3
- package/dist/styleLint/functional/size/size-fine.json +3 -3
- package/dist/styleLint/functional/size/size.json +111 -66
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-colorblind.json +129 -27
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-dimmed.json +129 -27
- package/dist/styleLint/functional/themes/dark-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-tritanopia.json +129 -27
- package/dist/styleLint/functional/themes/dark.json +129 -27
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-colorblind.json +135 -33
- package/dist/styleLint/functional/themes/light-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-tritanopia.json +135 -33
- package/dist/styleLint/functional/themes/light.json +135 -33
- package/dist/styleLint/functional/typography/typography.json +28 -22
- package/package.json +6 -5
- package/src/tokens/base/motion/timing.json5 +12 -12
- package/src/tokens/base/size/size.json5 +19 -19
- package/src/tokens/base/typography/typography.json5 +6 -6
- package/src/tokens/functional/color/bgColor.json5 +8 -0
- package/src/tokens/functional/color/display.json5 +7 -0
- package/src/tokens/functional/color/fgColor.json5 +8 -0
- package/src/tokens/functional/color/syntax.json5 +14 -0
- package/src/tokens/functional/shadow/shadow.json5 +39 -4
- package/src/tokens/functional/size/border.json5 +5 -5
- package/src/tokens/functional/size/breakpoints.json5 +6 -6
- package/src/tokens/functional/size/radius.json5 +4 -4
- package/src/tokens/functional/size/size.json5 +15 -15
- package/src/tokens/functional/typography/typography.json5 +8 -4
- package/dist/build/parsers/index.d.ts +0 -1
- package/dist/build/parsers/index.js +0 -1
- package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
- package/dist/build/parsers/w3cJsonParser.js +0 -25
- package/dist/removed/testing.json5 +0 -4
- package/guidelines/color.llm.md +0 -16
- package/guidelines/guidelines.llm.md +0 -34
- package/guidelines/motion.llm.md +0 -41
- package/guidelines/spacing.llm.md +0 -20
- package/guidelines/typography.llm.md +0 -14
- package/src/tokens/removed/testing.json5 +0 -4
- package/token-guidelines.llm.md +0 -695
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
},
|
|
241
241
|
"text-body-shorthand-large": {
|
|
242
242
|
"key": "{text.body.shorthand.large}",
|
|
243
|
-
"$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'",
|
|
244
244
|
"$type": "typography",
|
|
245
245
|
"$description": "User-generated content, markdown rendering.",
|
|
246
246
|
"$extensions": {
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
},
|
|
275
275
|
"text-body-shorthand-medium": {
|
|
276
276
|
"key": "{text.body.shorthand.medium}",
|
|
277
|
-
"$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'",
|
|
278
278
|
"$type": "typography",
|
|
279
279
|
"$description": "Default UI font. Most commonly used for body text.",
|
|
280
280
|
"$extensions": {
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
},
|
|
309
309
|
"text-body-shorthand-small": {
|
|
310
310
|
"key": "{text.body.shorthand.small}",
|
|
311
|
-
"$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'",
|
|
312
312
|
"$type": "typography",
|
|
313
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
314
|
"$extensions": {
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
},
|
|
343
343
|
"text-body-size-large": {
|
|
344
344
|
"key": "{text.body.size.large}",
|
|
345
|
-
"$value": [
|
|
345
|
+
"$value": ["1rem", "16px"],
|
|
346
346
|
"$type": "dimension",
|
|
347
347
|
"$extensions": {
|
|
348
348
|
"org.primer.figma": {
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
},
|
|
370
370
|
"text-body-size-medium": {
|
|
371
371
|
"key": "{text.body.size.medium}",
|
|
372
|
-
"$value": [
|
|
372
|
+
"$value": ["0.875rem", "14px"],
|
|
373
373
|
"$type": "dimension",
|
|
374
374
|
"$extensions": {
|
|
375
375
|
"org.primer.figma": {
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
},
|
|
397
397
|
"text-body-size-small": {
|
|
398
398
|
"key": "{text.body.size.small}",
|
|
399
|
-
"$value": [
|
|
399
|
+
"$value": ["0.75rem", "12px"],
|
|
400
400
|
"$type": "dimension",
|
|
401
401
|
"$extensions": {
|
|
402
402
|
"org.primer.figma": {
|
|
@@ -483,7 +483,7 @@
|
|
|
483
483
|
},
|
|
484
484
|
"text-caption-shorthand": {
|
|
485
485
|
"key": "{text.caption.shorthand}",
|
|
486
|
-
"$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'",
|
|
487
487
|
"$type": "typography",
|
|
488
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
489
|
"$extensions": {
|
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
},
|
|
518
518
|
"text-caption-size": {
|
|
519
519
|
"key": "{text.caption.size}",
|
|
520
|
-
"$value": [
|
|
520
|
+
"$value": ["0.75rem", "12px"],
|
|
521
521
|
"$type": "dimension",
|
|
522
522
|
"$extensions": {
|
|
523
523
|
"org.primer.figma": {
|
|
@@ -649,7 +649,10 @@
|
|
|
649
649
|
"filePath": "src/tokens/functional/typography/typography.json5",
|
|
650
650
|
"isSource": true,
|
|
651
651
|
"original": {
|
|
652
|
-
"$value":
|
|
652
|
+
"$value": {
|
|
653
|
+
"value": 13,
|
|
654
|
+
"unit": "px"
|
|
655
|
+
},
|
|
653
656
|
"$type": "dimension",
|
|
654
657
|
"$extensions": {
|
|
655
658
|
"org.primer.figma": {
|
|
@@ -692,7 +695,7 @@
|
|
|
692
695
|
},
|
|
693
696
|
"text-codeInline-shorthand": {
|
|
694
697
|
"key": "{text.codeInline.shorthand}",
|
|
695
|
-
"$value": "400 ,
|
|
698
|
+
"$value": "400 0.9285em,0.9285em ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
696
699
|
"$type": "typography",
|
|
697
700
|
"$description": "Inline code blocks using em units to inherit size from its parent.",
|
|
698
701
|
"$extensions": {
|
|
@@ -725,7 +728,7 @@
|
|
|
725
728
|
},
|
|
726
729
|
"text-codeInline-size": {
|
|
727
730
|
"key": "{text.codeInline.size}",
|
|
728
|
-
"$value": [
|
|
731
|
+
"$value": ["0.9285em", "0.9285em"],
|
|
729
732
|
"$type": "dimension",
|
|
730
733
|
"$extensions": {
|
|
731
734
|
"org.primer.figma": {
|
|
@@ -736,7 +739,10 @@
|
|
|
736
739
|
"filePath": "src/tokens/functional/typography/typography.json5",
|
|
737
740
|
"isSource": true,
|
|
738
741
|
"original": {
|
|
739
|
-
"$value":
|
|
742
|
+
"$value": {
|
|
743
|
+
"value": 0.9285,
|
|
744
|
+
"unit": "em"
|
|
745
|
+
},
|
|
740
746
|
"$type": "dimension",
|
|
741
747
|
"$extensions": {
|
|
742
748
|
"org.primer.figma": {
|
|
@@ -847,7 +853,7 @@
|
|
|
847
853
|
},
|
|
848
854
|
"text-display-shorthand": {
|
|
849
855
|
"key": "{text.display.shorthand}",
|
|
850
|
-
"$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'",
|
|
851
857
|
"$type": "typography",
|
|
852
858
|
"$description": "Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports.",
|
|
853
859
|
"$extensions": {
|
|
@@ -881,7 +887,7 @@
|
|
|
881
887
|
},
|
|
882
888
|
"text-display-size": {
|
|
883
889
|
"key": "{text.display.size}",
|
|
884
|
-
"$value": [
|
|
890
|
+
"$value": ["2.5rem", "40px"],
|
|
885
891
|
"$type": "dimension",
|
|
886
892
|
"$extensions": {
|
|
887
893
|
"org.primer.figma": {
|
|
@@ -968,7 +974,7 @@
|
|
|
968
974
|
},
|
|
969
975
|
"text-subtitle-shorthand": {
|
|
970
976
|
"key": "{text.subtitle.shorthand}",
|
|
971
|
-
"$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'",
|
|
972
978
|
"$type": "typography",
|
|
973
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).",
|
|
974
980
|
"$extensions": {
|
|
@@ -1002,7 +1008,7 @@
|
|
|
1002
1008
|
},
|
|
1003
1009
|
"text-subtitle-size": {
|
|
1004
1010
|
"key": "{text.subtitle.size}",
|
|
1005
|
-
"$value": [
|
|
1011
|
+
"$value": ["1.25rem", "20px"],
|
|
1006
1012
|
"$type": "dimension",
|
|
1007
1013
|
"$extensions": {
|
|
1008
1014
|
"org.primer.figma": {
|
|
@@ -1155,7 +1161,7 @@
|
|
|
1155
1161
|
},
|
|
1156
1162
|
"text-title-shorthand-large": {
|
|
1157
1163
|
"key": "{text.title.shorthand.large}",
|
|
1158
|
-
"$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'",
|
|
1159
1165
|
"$type": "typography",
|
|
1160
1166
|
"$description": "Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports.",
|
|
1161
1167
|
"$extensions": {
|
|
@@ -1189,7 +1195,7 @@
|
|
|
1189
1195
|
},
|
|
1190
1196
|
"text-title-shorthand-medium": {
|
|
1191
1197
|
"key": "{text.title.shorthand.medium}",
|
|
1192
|
-
"$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'",
|
|
1193
1199
|
"$type": "typography",
|
|
1194
1200
|
"$description": "Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition.",
|
|
1195
1201
|
"$extensions": {
|
|
@@ -1223,7 +1229,7 @@
|
|
|
1223
1229
|
},
|
|
1224
1230
|
"text-title-shorthand-small": {
|
|
1225
1231
|
"key": "{text.title.shorthand.small}",
|
|
1226
|
-
"$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'",
|
|
1227
1233
|
"$type": "typography",
|
|
1228
1234
|
"$description": "Uses the same size as body (large) with a heavier weight of semibold (600).",
|
|
1229
1235
|
"$extensions": {
|
|
@@ -1257,7 +1263,7 @@
|
|
|
1257
1263
|
},
|
|
1258
1264
|
"text-title-size-large": {
|
|
1259
1265
|
"key": "{text.title.size.large}",
|
|
1260
|
-
"$value": [
|
|
1266
|
+
"$value": ["2rem", "32px"],
|
|
1261
1267
|
"$type": "dimension",
|
|
1262
1268
|
"$extensions": {
|
|
1263
1269
|
"org.primer.figma": {
|
|
@@ -1284,7 +1290,7 @@
|
|
|
1284
1290
|
},
|
|
1285
1291
|
"text-title-size-medium": {
|
|
1286
1292
|
"key": "{text.title.size.medium}",
|
|
1287
|
-
"$value": [
|
|
1293
|
+
"$value": ["1.25rem", "20px"],
|
|
1288
1294
|
"$type": "dimension",
|
|
1289
1295
|
"$extensions": {
|
|
1290
1296
|
"org.primer.figma": {
|
|
@@ -1311,7 +1317,7 @@
|
|
|
1311
1317
|
},
|
|
1312
1318
|
"text-title-size-small": {
|
|
1313
1319
|
"key": "{text.title.size.small}",
|
|
1314
|
-
"$value": [
|
|
1320
|
+
"$value": ["1rem", "16px"],
|
|
1315
1321
|
"$type": "dimension",
|
|
1316
1322
|
"$extensions": {
|
|
1317
1323
|
"org.primer.figma": {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/primitives",
|
|
3
|
-
"version": "11.4.
|
|
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
8
|
"src/tokens",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"DESIGN_TOKENS_SPEC.md",
|
|
10
|
+
"DESIGN_TOKENS_GUIDE.md"
|
|
11
11
|
],
|
|
12
12
|
"repository": "https://github.com/primer/primitives",
|
|
13
13
|
"keywords": [
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/primer/primitives#readme",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"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",
|
|
29
29
|
"build:tokens": "tsx ./scripts/buildTokens.ts",
|
|
30
30
|
"build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
|
|
31
31
|
"build:figma": "tsx scripts/buildFigma.ts",
|
|
32
32
|
"build:config": "tsc -p build.tsconfig.jsonc && tsx ./scripts/copyDir.ts src/types dist/build/types",
|
|
33
|
+
"build:llm": "tsx ./scripts/buildLlm.ts",
|
|
33
34
|
"clean": "rm -rf dist",
|
|
34
35
|
"validate:contrast": "tsx scripts/colorContrast.ts",
|
|
35
36
|
"format": "prettier --check '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
|
|
@@ -79,4 +80,4 @@
|
|
|
79
80
|
"zod": "^4.1.3",
|
|
80
81
|
"zod-validation-error": "^4.0.1"
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
+
}
|
|
@@ -2,51 +2,51 @@
|
|
|
2
2
|
base: {
|
|
3
3
|
duration: {
|
|
4
4
|
'0': {
|
|
5
|
-
$value: '
|
|
5
|
+
$value: {value: 0, unit: 'ms'},
|
|
6
6
|
$type: 'duration',
|
|
7
7
|
},
|
|
8
8
|
'50': {
|
|
9
|
-
$value: '
|
|
9
|
+
$value: {value: 50, unit: 'ms'},
|
|
10
10
|
$type: 'duration',
|
|
11
11
|
},
|
|
12
12
|
'100': {
|
|
13
|
-
$value: '
|
|
13
|
+
$value: {value: 100, unit: 'ms'},
|
|
14
14
|
$type: 'duration',
|
|
15
15
|
},
|
|
16
16
|
'200': {
|
|
17
|
-
$value: '
|
|
17
|
+
$value: {value: 200, unit: 'ms'},
|
|
18
18
|
$type: 'duration',
|
|
19
19
|
},
|
|
20
20
|
'300': {
|
|
21
|
-
$value: '
|
|
21
|
+
$value: {value: 300, unit: 'ms'},
|
|
22
22
|
$type: 'duration',
|
|
23
23
|
},
|
|
24
24
|
'400': {
|
|
25
|
-
$value: '
|
|
25
|
+
$value: {value: 400, unit: 'ms'},
|
|
26
26
|
$type: 'duration',
|
|
27
27
|
},
|
|
28
28
|
'500': {
|
|
29
|
-
$value: '
|
|
29
|
+
$value: {value: 500, unit: 'ms'},
|
|
30
30
|
$type: 'duration',
|
|
31
31
|
},
|
|
32
32
|
'600': {
|
|
33
|
-
$value: '
|
|
33
|
+
$value: {value: 600, unit: 'ms'},
|
|
34
34
|
$type: 'duration',
|
|
35
35
|
},
|
|
36
36
|
'700': {
|
|
37
|
-
$value: '
|
|
37
|
+
$value: {value: 700, unit: 'ms'},
|
|
38
38
|
$type: 'duration',
|
|
39
39
|
},
|
|
40
40
|
'800': {
|
|
41
|
-
$value: '
|
|
41
|
+
$value: {value: 800, unit: 'ms'},
|
|
42
42
|
$type: 'duration',
|
|
43
43
|
},
|
|
44
44
|
'900': {
|
|
45
|
-
$value: '
|
|
45
|
+
$value: {value: 900, unit: 'ms'},
|
|
46
46
|
$type: 'duration',
|
|
47
47
|
},
|
|
48
48
|
'1000': {
|
|
49
|
-
$value: '
|
|
49
|
+
$value: {value: 1000, unit: 'ms'},
|
|
50
50
|
$type: 'duration',
|
|
51
51
|
},
|
|
52
52
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"base": {
|
|
3
3
|
"size": {
|
|
4
4
|
"2": {
|
|
5
|
-
"$value": "
|
|
5
|
+
"$value": { "value": 2, "unit": "px" },
|
|
6
6
|
"$type": "dimension",
|
|
7
7
|
"$extensions": {
|
|
8
8
|
"org.primer.figma": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"4": {
|
|
15
|
-
"$value": "
|
|
15
|
+
"$value": { "value": 4, "unit": "px" },
|
|
16
16
|
"$type": "dimension",
|
|
17
17
|
"$extensions": {
|
|
18
18
|
"org.primer.figma": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"6": {
|
|
25
|
-
"$value": "
|
|
25
|
+
"$value": { "value": 6, "unit": "px" },
|
|
26
26
|
"$type": "dimension",
|
|
27
27
|
"$extensions": {
|
|
28
28
|
"org.primer.figma": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"8": {
|
|
35
|
-
"$value": "
|
|
35
|
+
"$value": { "value": 8, "unit": "px" },
|
|
36
36
|
"$type": "dimension",
|
|
37
37
|
"$extensions": {
|
|
38
38
|
"org.primer.figma": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"12": {
|
|
45
|
-
"$value": "
|
|
45
|
+
"$value": { "value": 12, "unit": "px" },
|
|
46
46
|
"$type": "dimension",
|
|
47
47
|
"$extensions": {
|
|
48
48
|
"org.primer.figma": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"16": {
|
|
55
|
-
"$value": "
|
|
55
|
+
"$value": { "value": 16, "unit": "px" },
|
|
56
56
|
"$type": "dimension",
|
|
57
57
|
"$extensions": {
|
|
58
58
|
"org.primer.figma": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"20": {
|
|
65
|
-
"$value": "
|
|
65
|
+
"$value": { "value": 20, "unit": "px" },
|
|
66
66
|
"$type": "dimension",
|
|
67
67
|
"$extensions": {
|
|
68
68
|
"org.primer.figma": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"24": {
|
|
75
|
-
"$value": "
|
|
75
|
+
"$value": { "value": 24, "unit": "px" },
|
|
76
76
|
"$type": "dimension",
|
|
77
77
|
"$extensions": {
|
|
78
78
|
"org.primer.figma": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"28": {
|
|
85
|
-
"$value": "
|
|
85
|
+
"$value": { "value": 28, "unit": "px" },
|
|
86
86
|
"$type": "dimension",
|
|
87
87
|
"$extensions": {
|
|
88
88
|
"org.primer.figma": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"32": {
|
|
95
|
-
"$value": "
|
|
95
|
+
"$value": { "value": 32, "unit": "px" },
|
|
96
96
|
"$type": "dimension",
|
|
97
97
|
"$extensions": {
|
|
98
98
|
"org.primer.figma": {
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"36": {
|
|
105
|
-
"$value": "
|
|
105
|
+
"$value": { "value": 36, "unit": "px" },
|
|
106
106
|
"$type": "dimension",
|
|
107
107
|
"$extensions": {
|
|
108
108
|
"org.primer.figma": {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"40": {
|
|
115
|
-
"$value": "
|
|
115
|
+
"$value": { "value": 40, "unit": "px" },
|
|
116
116
|
"$type": "dimension",
|
|
117
117
|
"$extensions": {
|
|
118
118
|
"org.primer.figma": {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"44": {
|
|
125
|
-
"$value": "
|
|
125
|
+
"$value": { "value": 44, "unit": "px" },
|
|
126
126
|
"$type": "dimension",
|
|
127
127
|
"$extensions": {
|
|
128
128
|
"org.primer.figma": {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
"48": {
|
|
135
|
-
"$value": "
|
|
135
|
+
"$value": { "value": 48, "unit": "px" },
|
|
136
136
|
"$type": "dimension",
|
|
137
137
|
"$extensions": {
|
|
138
138
|
"org.primer.figma": {
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"64": {
|
|
145
|
-
"$value": "
|
|
145
|
+
"$value": { "value": 64, "unit": "px" },
|
|
146
146
|
"$type": "dimension",
|
|
147
147
|
"$extensions": {
|
|
148
148
|
"org.primer.figma": {
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
"80": {
|
|
155
|
-
"$value": "
|
|
155
|
+
"$value": { "value": 80, "unit": "px" },
|
|
156
156
|
"$type": "dimension",
|
|
157
157
|
"$extensions": {
|
|
158
158
|
"org.primer.figma": {
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
"96": {
|
|
165
|
-
"$value": "
|
|
165
|
+
"$value": { "value": 96, "unit": "px" },
|
|
166
166
|
"$type": "dimension",
|
|
167
167
|
"$extensions": {
|
|
168
168
|
"org.primer.figma": {
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
"112": {
|
|
175
|
-
"$value": "
|
|
175
|
+
"$value": { "value": 112, "unit": "px" },
|
|
176
176
|
"$type": "dimension",
|
|
177
177
|
"$extensions": {
|
|
178
178
|
"org.primer.figma": {
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
"128": {
|
|
185
|
-
"$value": "
|
|
185
|
+
"$value": { "value": 128, "unit": "px" },
|
|
186
186
|
"$type": "dimension",
|
|
187
187
|
"$extensions": {
|
|
188
188
|
"org.primer.figma": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
text: {
|
|
4
4
|
size: {
|
|
5
5
|
xs: {
|
|
6
|
-
$value:
|
|
6
|
+
$value: {value: 0.75, unit: 'rem'},
|
|
7
7
|
$type: 'dimension',
|
|
8
8
|
$description: '12px - Smallest text size for captions and compact UI elements.',
|
|
9
9
|
$extensions: {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
sm: {
|
|
17
|
-
$value:
|
|
17
|
+
$value: {value: 0.875, unit: 'rem'},
|
|
18
18
|
$type: 'dimension',
|
|
19
19
|
$description: '14px - Default body text size for UI.',
|
|
20
20
|
$extensions: {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
md: {
|
|
28
|
-
$value: '
|
|
28
|
+
$value: {value: 1, unit: 'rem'},
|
|
29
29
|
$type: 'dimension',
|
|
30
30
|
$description: '16px - Large body text and small titles.',
|
|
31
31
|
$extensions: {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
lg: {
|
|
39
|
-
$value:
|
|
39
|
+
$value: {value: 1.25, unit: 'rem'},
|
|
40
40
|
$type: 'dimension',
|
|
41
41
|
$description: '20px - Medium titles and subtitles.',
|
|
42
42
|
$extensions: {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
xl: {
|
|
50
|
-
$value: '
|
|
50
|
+
$value: {value: 2, unit: 'rem'},
|
|
51
51
|
$type: 'dimension',
|
|
52
52
|
$description: '32px - Large titles and page headings.',
|
|
53
53
|
$extensions: {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
'2xl': {
|
|
61
|
-
$value:
|
|
61
|
+
$value: {value: 2.5, unit: 'rem'},
|
|
62
62
|
$type: 'dimension',
|
|
63
63
|
$description: '40px - Display text for hero sections.',
|
|
64
64
|
$extensions: {
|
|
@@ -138,6 +138,10 @@
|
|
|
138
138
|
'org.primer.overrides': {
|
|
139
139
|
dark: '{base.color.neutral.13}',
|
|
140
140
|
},
|
|
141
|
+
'org.primer.llm': {
|
|
142
|
+
doNotUse: true,
|
|
143
|
+
rules: 'Avoid using raw white. Use semantic alternatives: bgColor.default for standard backgrounds, bgColor.inset for recessed areas, or bgColor.inverse for inverted contexts. Raw black/white ignore theme preferences and accessibility settings.',
|
|
144
|
+
},
|
|
141
145
|
},
|
|
142
146
|
},
|
|
143
147
|
black: {
|
|
@@ -153,6 +157,10 @@
|
|
|
153
157
|
'org.primer.overrides': {
|
|
154
158
|
dark: '{base.color.neutral.0}',
|
|
155
159
|
},
|
|
160
|
+
'org.primer.llm': {
|
|
161
|
+
doNotUse: true,
|
|
162
|
+
rules: 'Avoid using raw black. Use semantic alternatives: bgColor.emphasis for dark backgrounds, bgColor.inverse for inverted contexts. Raw black/white ignore theme preferences and accessibility settings.',
|
|
163
|
+
},
|
|
156
164
|
},
|
|
157
165
|
},
|
|
158
166
|
disabled: {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
display: {
|
|
3
|
+
$description: 'Decorative colors for categorization and visual distinction without semantic meaning. Use for labels, tags, avatars, status indicators, and user-assigned colors. Do NOT use for success/error/warning states—use semantic colors (bgColor.success/danger/attention) instead.',
|
|
4
|
+
$extensions: {
|
|
5
|
+
'org.primer.llm': {
|
|
6
|
+
usage: ['label', 'tag', 'avatar', 'badge', 'category-indicator', 'user-assigned-color', 'project-color', 'decorative-element'],
|
|
7
|
+
rules: 'Use display colors for arbitrary categorization where the color has no inherent meaning (e.g., project labels, user avatars). For meaningful states like success, error, or warning, use semantic colors instead. Scales 0-2 are lighter (backgrounds), 3-5 are mid-tones, 6-9 are darker (foregrounds/borders).',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
3
10
|
blue: {
|
|
4
11
|
scale: {
|
|
5
12
|
'0': {
|
|
@@ -108,6 +108,10 @@
|
|
|
108
108
|
'org.primer.overrides': {
|
|
109
109
|
dark: '{base.color.neutral.13}',
|
|
110
110
|
},
|
|
111
|
+
'org.primer.llm': {
|
|
112
|
+
doNotUse: true,
|
|
113
|
+
rules: 'Avoid using raw white. Use semantic alternatives: fgColor.onEmphasis for text on dark backgrounds, fgColor.onInverse for inverted contexts. Raw black/white ignore theme preferences and accessibility settings.',
|
|
114
|
+
},
|
|
111
115
|
},
|
|
112
116
|
},
|
|
113
117
|
black: {
|
|
@@ -123,6 +127,10 @@
|
|
|
123
127
|
'org.primer.overrides': {
|
|
124
128
|
dark: '{base.color.neutral.0}',
|
|
125
129
|
},
|
|
130
|
+
'org.primer.llm': {
|
|
131
|
+
doNotUse: true,
|
|
132
|
+
rules: 'Avoid using raw black. Use semantic alternatives: fgColor.default for standard text, fgColor.muted for secondary text. Raw black/white ignore theme preferences and accessibility settings.',
|
|
133
|
+
},
|
|
126
134
|
},
|
|
127
135
|
},
|
|
128
136
|
disabled: {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
color: {
|
|
3
3
|
ansi: {
|
|
4
|
+
$description: 'ANSI terminal color palette for command-line interfaces and terminal emulators. Maps standard ANSI color names to theme-appropriate values.',
|
|
5
|
+
$extensions: {
|
|
6
|
+
'org.primer.llm': {
|
|
7
|
+
usage: ['terminal-output', 'cli-interface', 'console-text', 'shell-prompt'],
|
|
8
|
+
rules: 'Use exclusively for terminal/CLI contexts. Do NOT use for general UI—use semantic colors (fgColor, bgColor) instead. These colors follow ANSI naming conventions (black, red, green, yellow, blue, magenta, cyan, white) with bright variants.',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
4
11
|
black: {
|
|
5
12
|
$value: '{base.color.neutral.13}',
|
|
6
13
|
$type: 'color',
|
|
@@ -248,6 +255,13 @@
|
|
|
248
255
|
},
|
|
249
256
|
},
|
|
250
257
|
prettylights: {
|
|
258
|
+
$description: 'Syntax highlighting colors for code display. Used by GitHub code rendering (prettylights theme).',
|
|
259
|
+
$extensions: {
|
|
260
|
+
'org.primer.llm': {
|
|
261
|
+
usage: ['code-syntax-highlighting', 'code-block', 'inline-code', 'diff-view'],
|
|
262
|
+
rules: 'Use exclusively for syntax highlighting in code display contexts. Do NOT use for general UI text or backgrounds. Each token maps to a specific syntax element (comment, keyword, string, etc.).',
|
|
263
|
+
},
|
|
264
|
+
},
|
|
251
265
|
syntax: {
|
|
252
266
|
comment: {
|
|
253
267
|
$value: '{base.color.neutral.9}',
|