@primer/primitives 11.5.0-rc.eeffc81e → 11.5.0
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 +24 -0
- package/DESIGN_TOKENS_SPEC.md +42 -0
- package/dist/css/base/size/z-index.css +9 -0
- package/dist/css/functional/size/z-index.css +10 -0
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +4 -4
- package/dist/css/functional/themes/dark-colorblind.css +4 -4
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +4 -4
- package/dist/css/functional/themes/dark-dimmed.css +4 -4
- package/dist/css/functional/themes/dark-high-contrast.css +4 -4
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +4 -4
- package/dist/css/functional/themes/dark-tritanopia.css +4 -4
- package/dist/css/functional/themes/dark.css +4 -4
- package/dist/css/primitives.css +2 -0
- package/dist/docs/base/size/z-index.json +107 -0
- package/dist/docs/functional/size/z-index.json +234 -0
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +68 -20
- package/dist/docs/functional/themes/dark-colorblind.json +68 -20
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +68 -20
- package/dist/docs/functional/themes/dark-dimmed.json +68 -20
- package/dist/docs/functional/themes/dark-high-contrast.json +68 -20
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +68 -20
- package/dist/docs/functional/themes/dark-tritanopia.json +68 -20
- package/dist/docs/functional/themes/dark.json +68 -20
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +64 -16
- package/dist/docs/functional/themes/light-colorblind.json +64 -16
- package/dist/docs/functional/themes/light-high-contrast.json +64 -16
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +64 -16
- package/dist/docs/functional/themes/light-tritanopia.json +64 -16
- package/dist/docs/functional/themes/light.json +64 -16
- package/dist/fallbacks/base/size/z-index.json +9 -0
- package/dist/fallbacks/functional/size/z-index.json +10 -0
- package/dist/figma/themes/dark-colorblind.json +8 -8
- package/dist/figma/themes/dark-dimmed.json +8 -8
- package/dist/figma/themes/dark-high-contrast.json +8 -8
- package/dist/figma/themes/dark-tritanopia.json +8 -8
- package/dist/figma/themes/dark.json +8 -8
- package/dist/internalCss/dark-colorblind-high-contrast.css +4 -4
- package/dist/internalCss/dark-colorblind.css +4 -4
- package/dist/internalCss/dark-dimmed-high-contrast.css +4 -4
- package/dist/internalCss/dark-dimmed.css +4 -4
- package/dist/internalCss/dark-high-contrast.css +4 -4
- package/dist/internalCss/dark-tritanopia-high-contrast.css +4 -4
- package/dist/internalCss/dark-tritanopia.css +4 -4
- package/dist/internalCss/dark.css +4 -4
- package/dist/styleLint/base/size/z-index.json +107 -0
- package/dist/styleLint/functional/size/z-index.json +234 -0
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +68 -20
- package/dist/styleLint/functional/themes/dark-colorblind.json +68 -20
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +68 -20
- package/dist/styleLint/functional/themes/dark-dimmed.json +68 -20
- package/dist/styleLint/functional/themes/dark-high-contrast.json +68 -20
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +68 -20
- package/dist/styleLint/functional/themes/dark-tritanopia.json +68 -20
- package/dist/styleLint/functional/themes/dark.json +68 -20
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +64 -16
- package/dist/styleLint/functional/themes/light-colorblind.json +64 -16
- package/dist/styleLint/functional/themes/light-high-contrast.json +64 -16
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +64 -16
- package/dist/styleLint/functional/themes/light-tritanopia.json +64 -16
- package/dist/styleLint/functional/themes/light.json +64 -16
- package/package.json +2 -2
- package/src/tokens/base/size/z-index.json5 +34 -0
- package/src/tokens/functional/color/control.json5 +20 -8
- package/src/tokens/functional/size/z-index.json5 +92 -0
|
@@ -20418,9 +20418,33 @@
|
|
|
20418
20418
|
"scopes": ["bgColor"]
|
|
20419
20419
|
},
|
|
20420
20420
|
"org.primer.overrides": {
|
|
20421
|
-
"dark": "#
|
|
20421
|
+
"dark": "#e0e6eb",
|
|
20422
|
+
"dark-high-contrast": {
|
|
20423
|
+
"$value": "#dae0e7",
|
|
20424
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20425
|
+
"isSource": true,
|
|
20426
|
+
"$type": "color"
|
|
20427
|
+
},
|
|
20428
|
+
"dark-tritanopia-high-contrast": {
|
|
20429
|
+
"$value": "#dae0e7",
|
|
20430
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20431
|
+
"isSource": true,
|
|
20432
|
+
"$type": "color"
|
|
20433
|
+
},
|
|
20434
|
+
"dark-protanopia-deuteranopia-high-contrast": {
|
|
20435
|
+
"$value": "#dae0e7",
|
|
20436
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20437
|
+
"isSource": true,
|
|
20438
|
+
"$type": "color"
|
|
20439
|
+
},
|
|
20422
20440
|
"dark-dimmed": {
|
|
20423
|
-
"$value": "#
|
|
20441
|
+
"$value": "#dae0e7",
|
|
20442
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20443
|
+
"isSource": true,
|
|
20444
|
+
"$type": "color"
|
|
20445
|
+
},
|
|
20446
|
+
"dark-dimmed-high-contrast": {
|
|
20447
|
+
"$value": "#dae0e7",
|
|
20424
20448
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20425
20449
|
"isSource": true,
|
|
20426
20450
|
"$type": "color"
|
|
@@ -20439,9 +20463,33 @@
|
|
|
20439
20463
|
"scopes": ["bgColor"]
|
|
20440
20464
|
},
|
|
20441
20465
|
"org.primer.overrides": {
|
|
20442
|
-
"dark": "{
|
|
20466
|
+
"dark": "{base.color.neutral.4}",
|
|
20467
|
+
"dark-high-contrast": {
|
|
20468
|
+
"$value": "{base.color.neutral.5}",
|
|
20469
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20470
|
+
"isSource": true,
|
|
20471
|
+
"$type": "color"
|
|
20472
|
+
},
|
|
20473
|
+
"dark-tritanopia-high-contrast": {
|
|
20474
|
+
"$value": "{base.color.neutral.5}",
|
|
20475
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20476
|
+
"isSource": true,
|
|
20477
|
+
"$type": "color"
|
|
20478
|
+
},
|
|
20479
|
+
"dark-protanopia-deuteranopia-high-contrast": {
|
|
20480
|
+
"$value": "{base.color.neutral.5}",
|
|
20481
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20482
|
+
"isSource": true,
|
|
20483
|
+
"$type": "color"
|
|
20484
|
+
},
|
|
20443
20485
|
"dark-dimmed": {
|
|
20444
|
-
"$value": "{
|
|
20486
|
+
"$value": "{base.color.neutral.5}",
|
|
20487
|
+
"filePath": "src/tokens/functional/color/control.json5",
|
|
20488
|
+
"isSource": true,
|
|
20489
|
+
"$type": "color"
|
|
20490
|
+
},
|
|
20491
|
+
"dark-dimmed-high-contrast": {
|
|
20492
|
+
"$value": "{base.color.neutral.5}",
|
|
20445
20493
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20446
20494
|
"isSource": true,
|
|
20447
20495
|
"$type": "color"
|
|
@@ -20881,33 +20929,33 @@
|
|
|
20881
20929
|
"scopes": ["bgColor"]
|
|
20882
20930
|
},
|
|
20883
20931
|
"org.primer.overrides": {
|
|
20884
|
-
"dark": "#
|
|
20932
|
+
"dark": "#ffffff",
|
|
20885
20933
|
"dark-high-contrast": {
|
|
20886
|
-
"$value": "#
|
|
20934
|
+
"$value": "#ffffff",
|
|
20887
20935
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20888
20936
|
"isSource": true,
|
|
20889
20937
|
"$type": "color"
|
|
20890
20938
|
},
|
|
20891
20939
|
"dark-tritanopia-high-contrast": {
|
|
20892
|
-
"$value": "#
|
|
20940
|
+
"$value": "#ffffff",
|
|
20893
20941
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20894
20942
|
"isSource": true,
|
|
20895
20943
|
"$type": "color"
|
|
20896
20944
|
},
|
|
20897
20945
|
"dark-protanopia-deuteranopia-high-contrast": {
|
|
20898
|
-
"$value": "#
|
|
20946
|
+
"$value": "#ffffff",
|
|
20899
20947
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20900
20948
|
"isSource": true,
|
|
20901
20949
|
"$type": "color"
|
|
20902
20950
|
},
|
|
20903
20951
|
"dark-dimmed": {
|
|
20904
|
-
"$value": "#
|
|
20952
|
+
"$value": "#eff2f5",
|
|
20905
20953
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20906
20954
|
"isSource": true,
|
|
20907
20955
|
"$type": "color"
|
|
20908
20956
|
},
|
|
20909
20957
|
"dark-dimmed-high-contrast": {
|
|
20910
|
-
"$value": "#
|
|
20958
|
+
"$value": "#eff2f5",
|
|
20911
20959
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20912
20960
|
"isSource": true,
|
|
20913
20961
|
"$type": "color"
|
|
@@ -20944,33 +20992,33 @@
|
|
|
20944
20992
|
"scopes": ["bgColor"]
|
|
20945
20993
|
},
|
|
20946
20994
|
"org.primer.overrides": {
|
|
20947
|
-
"dark": "{base.color.neutral.
|
|
20995
|
+
"dark": "{base.color.neutral.0}",
|
|
20948
20996
|
"dark-high-contrast": {
|
|
20949
|
-
"$value": "{base.color.neutral.
|
|
20997
|
+
"$value": "{base.color.neutral.0}",
|
|
20950
20998
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20951
20999
|
"isSource": true,
|
|
20952
21000
|
"$type": "color"
|
|
20953
21001
|
},
|
|
20954
21002
|
"dark-tritanopia-high-contrast": {
|
|
20955
|
-
"$value": "{base.color.neutral.
|
|
21003
|
+
"$value": "{base.color.neutral.0}",
|
|
20956
21004
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20957
21005
|
"isSource": true,
|
|
20958
21006
|
"$type": "color"
|
|
20959
21007
|
},
|
|
20960
21008
|
"dark-protanopia-deuteranopia-high-contrast": {
|
|
20961
|
-
"$value": "{base.color.neutral.
|
|
21009
|
+
"$value": "{base.color.neutral.0}",
|
|
20962
21010
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20963
21011
|
"isSource": true,
|
|
20964
21012
|
"$type": "color"
|
|
20965
21013
|
},
|
|
20966
21014
|
"dark-dimmed": {
|
|
20967
|
-
"$value": "{base.color.neutral.
|
|
21015
|
+
"$value": "{base.color.neutral.2}",
|
|
20968
21016
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20969
21017
|
"isSource": true,
|
|
20970
21018
|
"$type": "color"
|
|
20971
21019
|
},
|
|
20972
21020
|
"dark-dimmed-high-contrast": {
|
|
20973
|
-
"$value": "{base.color.neutral.
|
|
21021
|
+
"$value": "{base.color.neutral.2}",
|
|
20974
21022
|
"filePath": "src/tokens/functional/color/control.json5",
|
|
20975
21023
|
"isSource": true,
|
|
20976
21024
|
"$type": "color"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/primitives",
|
|
3
|
-
"version": "11.5.0
|
|
3
|
+
"version": "11.5.0",
|
|
4
4
|
"description": "Typography, spacing, and color primitives for Primer design system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -81,4 +81,4 @@
|
|
|
81
81
|
"zod-validation-error": "^4.0.1",
|
|
82
82
|
"colorjs.io": "^0.6.1"
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
base: {
|
|
3
|
+
zIndex: {
|
|
4
|
+
'0': {
|
|
5
|
+
$value: 0,
|
|
6
|
+
$type: 'number',
|
|
7
|
+
},
|
|
8
|
+
'100': {
|
|
9
|
+
$value: 100,
|
|
10
|
+
$type: 'number',
|
|
11
|
+
},
|
|
12
|
+
'200': {
|
|
13
|
+
$value: 200,
|
|
14
|
+
$type: 'number',
|
|
15
|
+
},
|
|
16
|
+
'300': {
|
|
17
|
+
$value: 300,
|
|
18
|
+
$type: 'number',
|
|
19
|
+
},
|
|
20
|
+
'400': {
|
|
21
|
+
$value: 400,
|
|
22
|
+
$type: 'number',
|
|
23
|
+
},
|
|
24
|
+
'500': {
|
|
25
|
+
$value: 500,
|
|
26
|
+
$type: 'number',
|
|
27
|
+
},
|
|
28
|
+
'600': {
|
|
29
|
+
$value: 600,
|
|
30
|
+
$type: 'number',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|
|
@@ -1165,21 +1165,21 @@
|
|
|
1165
1165
|
scopes: ['bgColor'],
|
|
1166
1166
|
},
|
|
1167
1167
|
'org.primer.overrides': {
|
|
1168
|
-
dark: '{base.color.neutral.
|
|
1168
|
+
dark: '{base.color.neutral.0}',
|
|
1169
1169
|
'dark-high-contrast': {
|
|
1170
|
-
$value: '{base.color.neutral.
|
|
1170
|
+
$value: '{base.color.neutral.0}',
|
|
1171
1171
|
},
|
|
1172
1172
|
'dark-tritanopia-high-contrast': {
|
|
1173
|
-
$value: '{base.color.neutral.
|
|
1173
|
+
$value: '{base.color.neutral.0}',
|
|
1174
1174
|
},
|
|
1175
1175
|
'dark-protanopia-deuteranopia-high-contrast': {
|
|
1176
|
-
$value: '{base.color.neutral.
|
|
1176
|
+
$value: '{base.color.neutral.0}',
|
|
1177
1177
|
},
|
|
1178
1178
|
'dark-dimmed': {
|
|
1179
|
-
$value: '{base.color.neutral.
|
|
1179
|
+
$value: '{base.color.neutral.2}',
|
|
1180
1180
|
},
|
|
1181
1181
|
'dark-dimmed-high-contrast': {
|
|
1182
|
-
$value: '{base.color.neutral.
|
|
1182
|
+
$value: '{base.color.neutral.2}',
|
|
1183
1183
|
},
|
|
1184
1184
|
'light-high-contrast': {
|
|
1185
1185
|
$value: '{base.color.neutral.5}',
|
|
@@ -1397,9 +1397,21 @@
|
|
|
1397
1397
|
scopes: ['bgColor'],
|
|
1398
1398
|
},
|
|
1399
1399
|
'org.primer.overrides': {
|
|
1400
|
-
dark: '{
|
|
1400
|
+
dark: '{base.color.neutral.4}',
|
|
1401
|
+
'dark-high-contrast': {
|
|
1402
|
+
$value: '{base.color.neutral.5}',
|
|
1403
|
+
},
|
|
1404
|
+
'dark-tritanopia-high-contrast': {
|
|
1405
|
+
$value: '{base.color.neutral.5}',
|
|
1406
|
+
},
|
|
1407
|
+
'dark-protanopia-deuteranopia-high-contrast': {
|
|
1408
|
+
$value: '{base.color.neutral.5}',
|
|
1409
|
+
},
|
|
1401
1410
|
'dark-dimmed': {
|
|
1402
|
-
$value: '{
|
|
1411
|
+
$value: '{base.color.neutral.5}',
|
|
1412
|
+
},
|
|
1413
|
+
'dark-dimmed-high-contrast': {
|
|
1414
|
+
$value: '{base.color.neutral.5}',
|
|
1403
1415
|
},
|
|
1404
1416
|
},
|
|
1405
1417
|
},
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
zIndex: {
|
|
3
|
+
behind: {
|
|
4
|
+
$value: -1,
|
|
5
|
+
$type: 'number',
|
|
6
|
+
$description: 'Place element behind base content. Use for decorative backgrounds or canvas elements.',
|
|
7
|
+
$extensions: {
|
|
8
|
+
'org.primer.llm': {
|
|
9
|
+
usage: ['decorative-background', 'canvas-element', 'background-pattern'],
|
|
10
|
+
rules: 'Use to push an element behind its siblings. WARNING: Negative z-index can behave unpredictably if any ancestor creates a new stacking context (via transform, opacity < 1, filter, will-change, etc.). Only use when you control the full stacking context chain. Do NOT use as a general "hide" mechanism.',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
default: {
|
|
15
|
+
$value: '{base.zIndex.0}',
|
|
16
|
+
$type: 'number',
|
|
17
|
+
$description: 'Default stacking order. No elevation above surrounding content.',
|
|
18
|
+
$extensions: {
|
|
19
|
+
'org.primer.llm': {
|
|
20
|
+
usage: ['default-content', 'in-flow-element', 'reset'],
|
|
21
|
+
rules: 'Use to explicitly reset z-index to the default layer. Suitable for elements that should participate in normal document flow stacking. Do NOT use for any element that needs to appear above other content.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
sticky: {
|
|
26
|
+
$value: '{base.zIndex.100}',
|
|
27
|
+
$type: 'number',
|
|
28
|
+
$description: 'Sticky elements that remain visible while scrolling.',
|
|
29
|
+
$extensions: {
|
|
30
|
+
'org.primer.llm': {
|
|
31
|
+
usage: ['sticky-header', 'sticky-sidebar', 'sticky-table-header', 'sticky-footer', 'sticky-nav'],
|
|
32
|
+
rules: 'MUST use with `position: sticky` or `position: fixed` for headers, sidebars, and navigation bars that persist during scroll. Do NOT use for floating overlays or dropdowns — use higher z-index levels instead.',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
dropdown: {
|
|
37
|
+
$value: '{base.zIndex.200}',
|
|
38
|
+
$type: 'number',
|
|
39
|
+
$description: 'Dropdown menus and select panels that appear above page content.',
|
|
40
|
+
$extensions: {
|
|
41
|
+
'org.primer.llm': {
|
|
42
|
+
usage: ['dropdown-menu', 'select-panel', 'autocomplete-list', 'action-menu', 'context-menu'],
|
|
43
|
+
rules: 'Use for menus, select panels, and autocomplete lists that overlay page content. These should appear above sticky elements but below overlays and modals. Pair with `shadow.floating.small` or `shadow.floating.medium` for visual elevation.',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
overlay: {
|
|
48
|
+
$value: '{base.zIndex.300}',
|
|
49
|
+
$type: 'number',
|
|
50
|
+
$description: 'Overlay backdrops, side panels, and drawers.',
|
|
51
|
+
$extensions: {
|
|
52
|
+
'org.primer.llm': {
|
|
53
|
+
usage: ['overlay-backdrop', 'side-panel', 'drawer', 'slide-over', 'bottom-sheet'],
|
|
54
|
+
rules: 'Use for overlay surfaces that partially cover the page — drawers, side panels, and backdrop layers. These appear above dropdowns but below modal dialogs. SHOULD be paired with a backdrop/scrim element to indicate the overlay is blocking interaction with content beneath.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
modal: {
|
|
59
|
+
$value: '{base.zIndex.400}',
|
|
60
|
+
$type: 'number',
|
|
61
|
+
$description: 'Modal dialogs and full-screen overlays.',
|
|
62
|
+
$extensions: {
|
|
63
|
+
'org.primer.llm': {
|
|
64
|
+
usage: ['modal-dialog', 'dialog', 'full-screen-overlay', 'lightbox', 'confirm-dialog'],
|
|
65
|
+
rules: 'Use for modal dialogs that require user interaction before returning to the page. MUST trap focus within the modal. MUST appear above all other page content except popovers and skip links. Pair with `shadow.floating.large` or `shadow.floating.xlarge` for visual elevation.',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
popover: {
|
|
70
|
+
$value: '{base.zIndex.500}',
|
|
71
|
+
$type: 'number',
|
|
72
|
+
$description: 'Tooltips and popovers that appear above all normal UI.',
|
|
73
|
+
$extensions: {
|
|
74
|
+
'org.primer.llm': {
|
|
75
|
+
usage: ['tooltip', 'popover', 'hover-card', 'floating-label'],
|
|
76
|
+
rules: 'Use for tooltips, popovers, and hover cards that must appear above all other UI elements including modals. These are the highest layer in normal UI. Do NOT use for persistent navigation — use `sticky` instead.',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
skipLink: {
|
|
81
|
+
$value: '{base.zIndex.600}',
|
|
82
|
+
$type: 'number',
|
|
83
|
+
$description: 'Accessibility skip links. Must always be the topmost layer.',
|
|
84
|
+
$extensions: {
|
|
85
|
+
'org.primer.llm': {
|
|
86
|
+
usage: ['skip-link', 'skip-navigation', 'skip-to-content'],
|
|
87
|
+
rules: 'MUST use for accessibility skip links that allow keyboard users to bypass navigation. This is the highest z-index level and MUST always appear above everything else including modals and tooltips. NEVER use for non-accessibility purposes.',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}
|