@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
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
inset: true,
|
|
12
12
|
},
|
|
13
13
|
$type: 'shadow',
|
|
14
|
+
$description: 'Inset shadow for recessed elements',
|
|
14
15
|
$extensions: {
|
|
15
16
|
'org.primer.figma': {
|
|
16
17
|
collection: 'mode',
|
|
@@ -29,13 +30,17 @@
|
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
},
|
|
33
|
+
'org.primer.llm': {
|
|
34
|
+
usage: ['input-field', 'pressed-button', 'recessed-area', 'well'],
|
|
35
|
+
rules: 'Use for elements that appear pressed or inset into the surface. Commonly used for input fields and wells. Do NOT use for floating elements.',
|
|
36
|
+
},
|
|
32
37
|
},
|
|
33
38
|
},
|
|
34
39
|
resting: {
|
|
35
40
|
xsmall: {
|
|
36
41
|
$value: {
|
|
37
42
|
color: '{base.color.neutral.13}',
|
|
38
|
-
alpha: 0.
|
|
43
|
+
alpha: 0.05,
|
|
39
44
|
offsetX: '0px',
|
|
40
45
|
offsetY: '1px',
|
|
41
46
|
blur: '1px',
|
|
@@ -43,6 +48,7 @@
|
|
|
43
48
|
inset: false,
|
|
44
49
|
},
|
|
45
50
|
$type: 'shadow',
|
|
51
|
+
$description: 'Extra small resting shadow for minimal elevation',
|
|
46
52
|
$extensions: {
|
|
47
53
|
'org.primer.figma': {
|
|
48
54
|
collection: 'mode',
|
|
@@ -61,13 +67,17 @@
|
|
|
61
67
|
},
|
|
62
68
|
},
|
|
63
69
|
},
|
|
70
|
+
'org.primer.llm': {
|
|
71
|
+
usage: ['badge', 'chip', 'small-card', 'subtle-elevation'],
|
|
72
|
+
rules: 'Use for very subtle elevation on small elements. Provides minimal lift from surface. Do NOT use for interactive elements needing clear affordance.',
|
|
73
|
+
},
|
|
64
74
|
},
|
|
65
75
|
},
|
|
66
76
|
small: {
|
|
67
77
|
$value: [
|
|
68
78
|
{
|
|
69
79
|
color: '{base.color.neutral.13}',
|
|
70
|
-
alpha: 0.
|
|
80
|
+
alpha: 0.04,
|
|
71
81
|
offsetX: '0px',
|
|
72
82
|
offsetY: '1px',
|
|
73
83
|
blur: '1px',
|
|
@@ -76,15 +86,16 @@
|
|
|
76
86
|
},
|
|
77
87
|
{
|
|
78
88
|
color: '{base.color.neutral.13}',
|
|
79
|
-
alpha: 0.
|
|
89
|
+
alpha: 0.03,
|
|
80
90
|
offsetX: '0px',
|
|
81
91
|
offsetY: '1px',
|
|
82
|
-
blur: '
|
|
92
|
+
blur: '2px',
|
|
83
93
|
spread: '0px',
|
|
84
94
|
inset: false,
|
|
85
95
|
},
|
|
86
96
|
],
|
|
87
97
|
$type: 'shadow',
|
|
98
|
+
$description: 'Small resting shadow for buttons and interactive elements',
|
|
88
99
|
$extensions: {
|
|
89
100
|
'org.primer.figma': {
|
|
90
101
|
collection: 'mode',
|
|
@@ -114,6 +125,10 @@
|
|
|
114
125
|
],
|
|
115
126
|
},
|
|
116
127
|
},
|
|
128
|
+
'org.primer.llm': {
|
|
129
|
+
usage: ['button', 'interactive-card', 'clickable-element'],
|
|
130
|
+
rules: 'Use for buttons and small interactive elements at rest. Provides subtle depth and clickable affordance. RECOMMENDED for default button shadows.',
|
|
131
|
+
},
|
|
117
132
|
},
|
|
118
133
|
},
|
|
119
134
|
medium: {
|
|
@@ -136,6 +151,7 @@
|
|
|
136
151
|
},
|
|
137
152
|
],
|
|
138
153
|
$type: 'shadow',
|
|
154
|
+
$description: 'Medium resting shadow for cards and elevated surfaces',
|
|
139
155
|
$extensions: {
|
|
140
156
|
'org.primer.figma': {
|
|
141
157
|
collection: 'mode',
|
|
@@ -163,6 +179,10 @@
|
|
|
163
179
|
],
|
|
164
180
|
},
|
|
165
181
|
},
|
|
182
|
+
'org.primer.llm': {
|
|
183
|
+
usage: ['card', 'panel', 'elevated-surface', 'elevated-sidebar'],
|
|
184
|
+
rules: 'Use for cards and content panels that sit above the page surface. Provides moderate elevation without appearing to float. Do NOT use for overlays or modals.',
|
|
185
|
+
},
|
|
166
186
|
},
|
|
167
187
|
},
|
|
168
188
|
},
|
|
@@ -281,6 +301,7 @@
|
|
|
281
301
|
},
|
|
282
302
|
],
|
|
283
303
|
$type: 'shadow',
|
|
304
|
+
$description: 'Medium floating shadow for popovers and action menus',
|
|
284
305
|
$extensions: {
|
|
285
306
|
'org.primer.figma': {
|
|
286
307
|
collection: 'mode',
|
|
@@ -332,6 +353,10 @@
|
|
|
332
353
|
],
|
|
333
354
|
},
|
|
334
355
|
},
|
|
356
|
+
'org.primer.llm': {
|
|
357
|
+
usage: ['popover', 'action-menu', 'select-panel', 'autocomplete'],
|
|
358
|
+
rules: 'Use for medium-sized floating elements like popovers and action menus. More prominent than small but less than dialogs. Do NOT use for full modals.',
|
|
359
|
+
},
|
|
335
360
|
},
|
|
336
361
|
},
|
|
337
362
|
large: {
|
|
@@ -408,6 +433,7 @@
|
|
|
408
433
|
},
|
|
409
434
|
],
|
|
410
435
|
$type: 'shadow',
|
|
436
|
+
$description: 'Extra large floating shadow for full-screen overlays and sheets',
|
|
411
437
|
$extensions: {
|
|
412
438
|
'org.primer.figma': {
|
|
413
439
|
collection: 'mode',
|
|
@@ -435,6 +461,10 @@
|
|
|
435
461
|
],
|
|
436
462
|
},
|
|
437
463
|
},
|
|
464
|
+
'org.primer.llm': {
|
|
465
|
+
usage: ['full-screen-overlay', 'side-sheet', 'drawer', 'large-modal'],
|
|
466
|
+
rules: 'Use for full-screen or near-full-screen overlays like side sheets and drawers. Maximum elevation in the system. Do NOT use for small floating elements.',
|
|
467
|
+
},
|
|
438
468
|
},
|
|
439
469
|
},
|
|
440
470
|
legacy: {
|
|
@@ -457,6 +487,7 @@
|
|
|
457
487
|
},
|
|
458
488
|
],
|
|
459
489
|
$type: 'shadow',
|
|
490
|
+
$description: 'Legacy floating shadow for backward compatibility',
|
|
460
491
|
$extensions: {
|
|
461
492
|
'org.primer.figma': {},
|
|
462
493
|
'org.primer.overrides': {
|
|
@@ -481,6 +512,10 @@
|
|
|
481
512
|
],
|
|
482
513
|
},
|
|
483
514
|
},
|
|
515
|
+
'org.primer.llm': {
|
|
516
|
+
usage: ['legacy-component', 'backward-compatibility'],
|
|
517
|
+
rules: 'DEPRECATED: Use shadow-floating-small instead. Only use for maintaining backward compatibility with existing implementations.',
|
|
518
|
+
},
|
|
484
519
|
},
|
|
485
520
|
},
|
|
486
521
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
thin: {
|
|
32
|
-
$value: '
|
|
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: '
|
|
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: '
|
|
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:
|
|
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: '
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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: '
|
|
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: '
|
|
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,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
large: {
|
|
40
|
-
$value: '
|
|
40
|
+
$value: {value: 12, unit: 'px'},
|
|
41
41
|
$description: 'Large border radius (12px). Use for larger containers, dialogs, or when more visual softness is desired. Always use this for buttons.',
|
|
42
42
|
$type: 'dimension',
|
|
43
43
|
$extensions: {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
full: {
|
|
58
|
-
$value: '
|
|
58
|
+
$value: {value: 9999, unit: 'px'},
|
|
59
59
|
$type: 'dimension',
|
|
60
60
|
$description: 'Use this border radius for pill shaped elements',
|
|
61
61
|
$extensions: {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"paddingBlock": {
|
|
54
|
-
"$value": "
|
|
54
|
+
"$value": {"value": 2, "unit": "px"},
|
|
55
55
|
"$type": "dimension",
|
|
56
56
|
"$extensions": {
|
|
57
57
|
"org.primer.figma": {
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
}
|
|
190
190
|
},
|
|
191
191
|
"paddingBlock": {
|
|
192
|
-
"$value": "
|
|
192
|
+
"$value": {"value": 6, "unit": "px"},
|
|
193
193
|
"$type": "dimension",
|
|
194
194
|
"$extensions": {
|
|
195
195
|
"org.primer.figma": {
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
}
|
|
264
264
|
},
|
|
265
265
|
"paddingBlock": {
|
|
266
|
-
"$value": "
|
|
266
|
+
"$value": {"value": 10, "unit": "px"},
|
|
267
267
|
"$type": "dimension",
|
|
268
268
|
"$extensions": {
|
|
269
269
|
"org.primer.figma": {
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
}
|
|
328
328
|
},
|
|
329
329
|
"paddingBlock": {
|
|
330
|
-
"$value": "
|
|
330
|
+
"$value": {"value": 14, "unit": "px"},
|
|
331
331
|
"$type": "dimension",
|
|
332
332
|
"$extensions": {
|
|
333
333
|
"org.primer.figma": {
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
},
|
|
381
381
|
"strokeWidth": {
|
|
382
382
|
"default": {
|
|
383
|
-
"$value": "
|
|
383
|
+
"$value": {"value": 2, "unit": "px"},
|
|
384
384
|
"$type": "dimension"
|
|
385
385
|
}
|
|
386
386
|
},
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
},
|
|
616
616
|
"width": {
|
|
617
617
|
"xsmall": {
|
|
618
|
-
"$value": "
|
|
618
|
+
"$value": {"value": 192, "unit": "px"},
|
|
619
619
|
"$type": "dimension",
|
|
620
620
|
"$extensions": {
|
|
621
621
|
"org.primer.figma": {
|
|
@@ -625,7 +625,7 @@
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
"small": {
|
|
628
|
-
"$value": "
|
|
628
|
+
"$value": {"value": 320, "unit": "px"},
|
|
629
629
|
"$type": "dimension",
|
|
630
630
|
"$extensions": {
|
|
631
631
|
"org.primer.figma": {
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
}
|
|
636
636
|
},
|
|
637
637
|
"medium": {
|
|
638
|
-
"$value": "
|
|
638
|
+
"$value": {"value": 480, "unit": "px"},
|
|
639
639
|
"$type": "dimension",
|
|
640
640
|
"$extensions": {
|
|
641
641
|
"org.primer.figma": {
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
}
|
|
646
646
|
},
|
|
647
647
|
"large": {
|
|
648
|
-
"$value": "
|
|
648
|
+
"$value": {"value": 640, "unit": "px"},
|
|
649
649
|
"$type": "dimension",
|
|
650
650
|
"$extensions": {
|
|
651
651
|
"org.primer.figma": {
|
|
@@ -655,7 +655,7 @@
|
|
|
655
655
|
}
|
|
656
656
|
},
|
|
657
657
|
"xlarge": {
|
|
658
|
-
"$value": "
|
|
658
|
+
"$value": {"value": 960, "unit": "px"},
|
|
659
659
|
"$type": "dimension",
|
|
660
660
|
"$extensions": {
|
|
661
661
|
"org.primer.figma": {
|
|
@@ -667,7 +667,7 @@
|
|
|
667
667
|
},
|
|
668
668
|
"height": {
|
|
669
669
|
"small": {
|
|
670
|
-
"$value": "
|
|
670
|
+
"$value": {"value": 256, "unit": "px"},
|
|
671
671
|
"$type": "dimension",
|
|
672
672
|
"$extensions": {
|
|
673
673
|
"org.primer.figma": {
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
}
|
|
678
678
|
},
|
|
679
679
|
"medium": {
|
|
680
|
-
"$value": "
|
|
680
|
+
"$value": {"value": 320, "unit": "px"},
|
|
681
681
|
"$type": "dimension",
|
|
682
682
|
"$extensions": {
|
|
683
683
|
"org.primer.figma": {
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
}
|
|
688
688
|
},
|
|
689
689
|
"large": {
|
|
690
|
-
"$value": "
|
|
690
|
+
"$value": {"value": 432, "unit": "px"},
|
|
691
691
|
"$type": "dimension",
|
|
692
692
|
"$extensions": {
|
|
693
693
|
"org.primer.figma": {
|
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
}
|
|
698
698
|
},
|
|
699
699
|
"xlarge": {
|
|
700
|
-
"$value": "
|
|
700
|
+
"$value": {"value": 600, "unit": "px"},
|
|
701
701
|
"$type": "dimension",
|
|
702
702
|
"$extensions": {
|
|
703
703
|
"org.primer.figma": {
|
|
@@ -762,7 +762,7 @@
|
|
|
762
762
|
}
|
|
763
763
|
},
|
|
764
764
|
"offset": {
|
|
765
|
-
"$value": "
|
|
765
|
+
"$value": {"value": 4, "unit": "px"},
|
|
766
766
|
"$type": "dimension",
|
|
767
767
|
"$extensions": {
|
|
768
768
|
"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: '
|
|
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:
|
|
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
|
-
};
|
package/guidelines/color.llm.md
DELETED
|
@@ -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)
|
package/guidelines/motion.llm.md
DELETED
|
@@ -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
|