@duro-app/tokens 5.1.0 → 5.3.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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -32
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +55 -2
- package/dist/keys.d.ts.map +1 -1
- package/dist/mockup.css +75 -0
- package/dist/raw.d.ts +52 -0
- package/dist/raw.d.ts.map +1 -1
- package/dist/raw.js +82 -14
- package/dist/raw.js.map +1 -1
- package/dist/themes/high-contrast.css.d.ts +10 -0
- package/dist/themes/high-contrast.css.d.ts.map +1 -1
- package/dist/themes/light.css.d.ts +10 -0
- package/dist/themes/light.css.d.ts.map +1 -1
- package/dist/tokens/colors.css.d.ts +8 -0
- package/dist/tokens/colors.css.d.ts.map +1 -1
- package/dist/tokens/effects.css.d.ts +5 -0
- package/dist/tokens/effects.css.d.ts.map +1 -0
- package/dist/tokens/layers.css.d.ts +13 -0
- package/dist/tokens/layers.css.d.ts.map +1 -0
- package/dist/tokens/shadows.css.d.ts +2 -0
- package/dist/tokens/shadows.css.d.ts.map +1 -1
- package/dist/tokens/sizes.css.d.ts +33 -0
- package/dist/tokens/sizes.css.d.ts.map +1 -1
- package/dist/vars.css +55 -0
- package/package.json +3 -1
- package/src/index.ts +2 -0
- package/src/keys.ts +104 -1
- package/src/raw.ts +77 -0
- package/src/themes/high-contrast.css.ts +17 -0
- package/src/themes/light.css.ts +17 -0
- package/src/tokens/colors.css.ts +15 -0
- package/src/tokens/effects.css.ts +12 -0
- package/src/tokens/layers.css.ts +39 -0
- package/src/tokens/shadows.css.ts +6 -0
- package/src/tokens/sizes.css.ts +34 -0
|
@@ -48,5 +48,38 @@ export declare const sizes: css.VarGroup<Readonly<{
|
|
|
48
48
|
pageSm: string;
|
|
49
49
|
pageMd: string;
|
|
50
50
|
pageLg: string;
|
|
51
|
+
sidebarW: string;
|
|
52
|
+
pageXs: string;
|
|
53
|
+
pageXl: string;
|
|
54
|
+
asideW: string;
|
|
55
|
+
gridColXs: string;
|
|
56
|
+
fieldMinWSm: string;
|
|
57
|
+
fieldMinW: string;
|
|
58
|
+
popoverWSm: string;
|
|
59
|
+
popoverW: string;
|
|
60
|
+
popupMaxW: string;
|
|
61
|
+
meterH: string;
|
|
62
|
+
skeletonChipW: string;
|
|
63
|
+
dropZoneMinH: string;
|
|
64
|
+
canvasMinH: string;
|
|
65
|
+
editorMinH: string;
|
|
66
|
+
toolbarH: string;
|
|
67
|
+
embedW: string;
|
|
68
|
+
colorPickerW: string;
|
|
69
|
+
colorAreaH: string;
|
|
70
|
+
colorTrackH: string;
|
|
71
|
+
colorSwatch: string;
|
|
72
|
+
colorPreviewH: string;
|
|
73
|
+
handle: string;
|
|
74
|
+
chip: string;
|
|
75
|
+
placeholderMinH: string;
|
|
76
|
+
previewMaxH: string;
|
|
77
|
+
barH: string;
|
|
78
|
+
readoutW: string;
|
|
79
|
+
sliderW: string;
|
|
80
|
+
paletteMinW: string;
|
|
81
|
+
deviceBarW: string;
|
|
82
|
+
timeGutterW: string;
|
|
83
|
+
dayHeaderH: string;
|
|
51
84
|
}>, symbol>;
|
|
52
85
|
//# sourceMappingURL=sizes.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.css.d.ts","sourceRoot":"","sources":["../../src/tokens/sizes.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAEpC,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"sizes.css.d.ts","sourceRoot":"","sources":["../../src/tokens/sizes.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAEpC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmFhB,CAAA"}
|
package/dist/vars.css
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
--duro-color-bg-card: var(--bgCard-xj2l5r);
|
|
21
21
|
--duro-color-bg-card-hover: var(--bgCardHover-xlxk7vw);
|
|
22
22
|
--duro-color-border: var(--border-x1drj1pb);
|
|
23
|
+
--duro-color-contrast-border: var(--contrastBorder-x1g9he7g);
|
|
24
|
+
--duro-color-contrast-surface: var(--contrastSurface-x1i512m4);
|
|
23
25
|
--duro-color-error: var(--error-x13gdhh0);
|
|
24
26
|
--duro-color-error-bg: var(--errorBg-xrl8836);
|
|
25
27
|
--duro-color-error-border: var(--errorBorder-x1a6pjl);
|
|
@@ -27,6 +29,10 @@
|
|
|
27
29
|
--duro-color-error-hover: var(--errorHover-x7eyu03);
|
|
28
30
|
--duro-color-error-text: var(--errorText-xf51nwe);
|
|
29
31
|
--duro-color-fixed-light: var(--fixedLight-xd608fw);
|
|
32
|
+
--duro-color-highlight: var(--highlight-x14yvf5c);
|
|
33
|
+
--duro-color-highlight-bg: var(--highlightBg-x5qhmj2);
|
|
34
|
+
--duro-color-highlight-border: var(--highlightBorder-xd7ycfq);
|
|
35
|
+
--duro-color-highlight-text: var(--highlightText-x1lyse6a);
|
|
30
36
|
--duro-color-info: var(--info-x97ho0r);
|
|
31
37
|
--duro-color-info-bg: var(--infoBg-xho8jir);
|
|
32
38
|
--duro-color-info-border: var(--infoBorder-xnevk3x);
|
|
@@ -35,6 +41,8 @@
|
|
|
35
41
|
--duro-color-inverse-border-hover: var(--inverseBorderHover-x12x46ev);
|
|
36
42
|
--duro-color-inverse-fill: var(--inverseFill-x1il694p);
|
|
37
43
|
--duro-color-inverse-fill-hover: var(--inverseFillHover-xmxqxj9);
|
|
44
|
+
--duro-color-on-contrast-surface: var(--onContrastSurface-x1dm0pi1);
|
|
45
|
+
--duro-color-overlay-light: var(--overlayLight-x71omwc);
|
|
38
46
|
--duro-color-scrim: var(--scrim-x2ypej7);
|
|
39
47
|
--duro-color-success: var(--success-x197pe5n);
|
|
40
48
|
--duro-color-success-bg: var(--successBg-xzjukav);
|
|
@@ -54,6 +62,8 @@
|
|
|
54
62
|
--duro-radius-sm: var(--sm-x1bhtfs5);
|
|
55
63
|
--duro-radius-xs: var(--xs-x1gb5bcy);
|
|
56
64
|
/* shadows */
|
|
65
|
+
--duro-shadow-drop-over: var(--dropOver-x1w3k9ro);
|
|
66
|
+
--duro-shadow-drop-ready: var(--dropReady-x19ev27m);
|
|
57
67
|
--duro-shadow-lg: var(--lg-x1mxd62i);
|
|
58
68
|
--duro-shadow-md: var(--md-x1oyt0aw);
|
|
59
69
|
--duro-shadow-sm: var(--sm-x17hhtln);
|
|
@@ -73,21 +83,39 @@
|
|
|
73
83
|
--duro-micro-spacing-px5: var(--px5-xrmlnev);
|
|
74
84
|
--duro-micro-spacing-px6: var(--px6-x1h3gnvl);
|
|
75
85
|
/* sizes */
|
|
86
|
+
--duro-size-aside-w: var(--asideW-x1sefzvd);
|
|
87
|
+
--duro-size-bar-h: var(--barH-x1oc8exn);
|
|
88
|
+
--duro-size-canvas-min-h: var(--canvasMinH-xpv99dk);
|
|
76
89
|
--duro-size-check-mark-h: var(--checkMarkH-xz3lx6u);
|
|
77
90
|
--duro-size-check-mark-w: var(--checkMarkW-xvyirw7);
|
|
91
|
+
--duro-size-chip: var(--chip-xofdvjg);
|
|
92
|
+
--duro-size-color-area-h: var(--colorAreaH-xn4he4);
|
|
93
|
+
--duro-size-color-picker-w: var(--colorPickerW-xafjozf);
|
|
94
|
+
--duro-size-color-preview-h: var(--colorPreviewH-x1by70nu);
|
|
95
|
+
--duro-size-color-swatch: var(--colorSwatch-xr73m8p);
|
|
96
|
+
--duro-size-color-track-h: var(--colorTrackH-x1ixtmdy);
|
|
78
97
|
--duro-size-control-lg: var(--controlLg-xf3drh3);
|
|
79
98
|
--duro-size-control-md: var(--controlMd-xkvaeme);
|
|
80
99
|
--duro-size-control-sm: var(--controlSm-x6ymn93);
|
|
100
|
+
--duro-size-day-header-h: var(--dayHeaderH-x1j7gty0);
|
|
101
|
+
--duro-size-device-bar-w: var(--deviceBarW-xqnx4o4);
|
|
81
102
|
--duro-size-dialog-lg: var(--dialogLg-xsd9wl3);
|
|
82
103
|
--duro-size-dialog-md: var(--dialogMd-x1yjoj5l);
|
|
83
104
|
--duro-size-dialog-sm: var(--dialogSm-x16fibl1);
|
|
84
105
|
--duro-size-divider: var(--divider-x34oj7m);
|
|
106
|
+
--duro-size-drop-zone-min-h: var(--dropZoneMinH-x9asgie);
|
|
85
107
|
--duro-size-edge-fade: var(--edgeFade-x1a8srg4);
|
|
108
|
+
--duro-size-editor-min-h: var(--editorMinH-x7umtuv);
|
|
109
|
+
--duro-size-embed-w: var(--embedW-x1jprk4i);
|
|
110
|
+
--duro-size-field-min-w: var(--fieldMinW-x3410dk);
|
|
111
|
+
--duro-size-field-min-w-sm: var(--fieldMinWSm-x17qqf6g);
|
|
86
112
|
--duro-size-glyph-md: var(--glyphMd-x1hz0jso);
|
|
87
113
|
--duro-size-glyph-sm: var(--glyphSm-x17geiot);
|
|
88
114
|
--duro-size-glyph-xs: var(--glyphXs-x7xktls);
|
|
89
115
|
--duro-size-grid-col-md: var(--gridColMd-x1cjqdt9);
|
|
90
116
|
--duro-size-grid-col-sm: var(--gridColSm-xzwpy92);
|
|
117
|
+
--duro-size-grid-col-xs: var(--gridColXs-x1uralsc);
|
|
118
|
+
--duro-size-handle: var(--handle-xt9m584);
|
|
91
119
|
--duro-size-icon-button: var(--iconButton-x16lr7a8);
|
|
92
120
|
--duro-size-icon-button-sm: var(--iconButtonSm-xtjgrhy);
|
|
93
121
|
--duro-size-icon-lg: var(--iconLg-x1lsumnr);
|
|
@@ -100,16 +128,29 @@
|
|
|
100
128
|
--duro-size-label-min-w: var(--labelMinW-x1tnvsg3);
|
|
101
129
|
--duro-size-list-max-h: var(--listMaxH-x1g3bmh3);
|
|
102
130
|
--duro-size-list-max-h-sm: var(--listMaxHSm-xhny4oa);
|
|
131
|
+
--duro-size-meter-h: var(--meterH-x5xauib);
|
|
103
132
|
--duro-size-nav-marker-h: var(--navMarkerH-xlc6r7a);
|
|
104
133
|
--duro-size-nav-marker-w: var(--navMarkerW-x1swbkx4);
|
|
105
134
|
--duro-size-page-lg: var(--pageLg-x393fnm);
|
|
106
135
|
--duro-size-page-md: var(--pageMd-xloo57l);
|
|
107
136
|
--duro-size-page-sm: var(--pageSm-x5j4ghi);
|
|
137
|
+
--duro-size-page-xl: var(--pageXl-xe1y5wy);
|
|
138
|
+
--duro-size-page-xs: var(--pageXs-xkx7b2k);
|
|
139
|
+
--duro-size-palette-min-w: var(--paletteMinW-x1514e6j);
|
|
108
140
|
--duro-size-panel-lg: var(--panelLg-x19cpfjm);
|
|
109
141
|
--duro-size-panel-md: var(--panelMd-x11x23mn);
|
|
110
142
|
--duro-size-panel-sm: var(--panelSm-x1ng1dcv);
|
|
143
|
+
--duro-size-placeholder-min-h: var(--placeholderMinH-xy0p02w);
|
|
144
|
+
--duro-size-popover-w: var(--popoverW-xf1f07);
|
|
145
|
+
--duro-size-popover-w-sm: var(--popoverWSm-x17g62mi);
|
|
146
|
+
--duro-size-popup-max-w: var(--popupMaxW-x16p43ce);
|
|
111
147
|
--duro-size-popup-min-w: var(--popupMinW-xzyp04);
|
|
148
|
+
--duro-size-preview-max-h: var(--previewMaxH-x1phh3ob);
|
|
149
|
+
--duro-size-readout-w: var(--readoutW-xi5rn1i);
|
|
112
150
|
--duro-size-scrollbar: var(--scrollbar-xppi9bb);
|
|
151
|
+
--duro-size-sidebar-w: var(--sidebarW-x16fh60r);
|
|
152
|
+
--duro-size-skeleton-chip-w: var(--skeletonChipW-xmw24hn);
|
|
153
|
+
--duro-size-slider-w: var(--sliderW-xvcfp7i);
|
|
113
154
|
--duro-size-spinner-lg: var(--spinnerLg-x1lgp9p9);
|
|
114
155
|
--duro-size-spinner-md: var(--spinnerMd-x11a4rba);
|
|
115
156
|
--duro-size-spinner-sm: var(--spinnerSm-xoj3xel);
|
|
@@ -119,7 +160,9 @@
|
|
|
119
160
|
--duro-size-switch-track-h: var(--switchTrackH-x1h3icne);
|
|
120
161
|
--duro-size-switch-track-w: var(--switchTrackW-xcah3tt);
|
|
121
162
|
--duro-size-tab-indicator: var(--tabIndicator-xeswvk3);
|
|
163
|
+
--duro-size-time-gutter-w: var(--timeGutterW-xsc6tna);
|
|
122
164
|
--duro-size-toast-max-w: var(--toastMaxW-x1po6n0z);
|
|
165
|
+
--duro-size-toolbar-h: var(--toolbarH-x16tj5lc);
|
|
123
166
|
--duro-size-touch-target: var(--touchTarget-x1u5badx);
|
|
124
167
|
/* borders */
|
|
125
168
|
--duro-border-accent: var(--accent-x1eiysj0);
|
|
@@ -128,6 +171,18 @@
|
|
|
128
171
|
--duro-border-focus-ring: var(--focusRing-x851k0b);
|
|
129
172
|
--duro-border-hairline: var(--hairline-xomm6fc);
|
|
130
173
|
--duro-border-strong: var(--strong-x1otbxzr);
|
|
174
|
+
/* layers */
|
|
175
|
+
--duro-layer-floating: var(--floating-x1bmxuyp);
|
|
176
|
+
--duro-layer-modal: var(--modal-x10p0ok);
|
|
177
|
+
--duro-layer-overlay: var(--overlay-x1pg5hea);
|
|
178
|
+
--duro-layer-popover: var(--popover-x13dty8z);
|
|
179
|
+
--duro-layer-popup: var(--popup-xgi3yzv);
|
|
180
|
+
--duro-layer-popup-backdrop: var(--popupBackdrop-x17sujb4);
|
|
181
|
+
--duro-layer-portal: var(--portal-xmizwb3);
|
|
182
|
+
--duro-layer-raised: var(--raised-xnqqeg);
|
|
183
|
+
--duro-layer-toast: var(--toast-xt0zgmc);
|
|
184
|
+
/* effects */
|
|
185
|
+
--duro-effect-overlay-blur: var(--overlayBlur-x1i07nq9);
|
|
131
186
|
/* layoutSpacing */
|
|
132
187
|
--duro-layout-spacing-container-lg: var(--containerLg-x1n6aasq);
|
|
133
188
|
--duro-layout-spacing-container-md: var(--containerMd-x170dvin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duro-app/tokens",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"./tokens/spacing.css": "./src/tokens/spacing.css.ts",
|
|
42
42
|
"./tokens/sizes.css": "./src/tokens/sizes.css.ts",
|
|
43
43
|
"./tokens/borders.css": "./src/tokens/borders.css.ts",
|
|
44
|
+
"./tokens/layers.css": "./src/tokens/layers.css.ts",
|
|
45
|
+
"./tokens/effects.css": "./src/tokens/effects.css.ts",
|
|
44
46
|
"./tokens/typography.css": "./src/tokens/typography.css.ts",
|
|
45
47
|
"./tokens/layout-spacing.css": "./src/tokens/layout-spacing.css.ts",
|
|
46
48
|
"./tokens/shadows.css": "./src/tokens/shadows.css.ts",
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,8 @@ export {colors} from './tokens/colors.css'
|
|
|
4
4
|
export {spacing, microSpacing, radii} from './tokens/spacing.css'
|
|
5
5
|
export {sizes} from './tokens/sizes.css'
|
|
6
6
|
export {borders} from './tokens/borders.css'
|
|
7
|
+
export {layers} from './tokens/layers.css'
|
|
8
|
+
export {effects} from './tokens/effects.css'
|
|
7
9
|
export {layoutSpacing} from './tokens/layout-spacing.css'
|
|
8
10
|
export {typography, typeScale} from './tokens/typography.css'
|
|
9
11
|
export {typePresets} from './tokens/type-presets.css'
|
package/src/keys.ts
CHANGED
|
@@ -55,7 +55,7 @@ export const RADII_PX = {
|
|
|
55
55
|
full: 9999,
|
|
56
56
|
} as const
|
|
57
57
|
|
|
58
|
-
export const SHADOW_KEYS = ['sm', 'md', 'lg'] as const
|
|
58
|
+
export const SHADOW_KEYS = ['sm', 'md', 'lg', 'dropReady', 'dropOver'] as const
|
|
59
59
|
export type ShadowToken = (typeof SHADOW_KEYS)[number]
|
|
60
60
|
|
|
61
61
|
// Mirrors tokens/motion.css.ts `duration`, as numbers for setTimeout use.
|
|
@@ -119,6 +119,39 @@ export const SIZE_KEYS = [
|
|
|
119
119
|
'pageSm',
|
|
120
120
|
'pageMd',
|
|
121
121
|
'pageLg',
|
|
122
|
+
'sidebarW',
|
|
123
|
+
'pageXs',
|
|
124
|
+
'pageXl',
|
|
125
|
+
'asideW',
|
|
126
|
+
'gridColXs',
|
|
127
|
+
'fieldMinWSm',
|
|
128
|
+
'fieldMinW',
|
|
129
|
+
'popoverWSm',
|
|
130
|
+
'popoverW',
|
|
131
|
+
'popupMaxW',
|
|
132
|
+
'meterH',
|
|
133
|
+
'skeletonChipW',
|
|
134
|
+
'dropZoneMinH',
|
|
135
|
+
'canvasMinH',
|
|
136
|
+
'editorMinH',
|
|
137
|
+
'toolbarH',
|
|
138
|
+
'embedW',
|
|
139
|
+
'colorPickerW',
|
|
140
|
+
'colorAreaH',
|
|
141
|
+
'colorTrackH',
|
|
142
|
+
'colorSwatch',
|
|
143
|
+
'colorPreviewH',
|
|
144
|
+
'handle',
|
|
145
|
+
'chip',
|
|
146
|
+
'placeholderMinH',
|
|
147
|
+
'previewMaxH',
|
|
148
|
+
'barH',
|
|
149
|
+
'readoutW',
|
|
150
|
+
'sliderW',
|
|
151
|
+
'paletteMinW',
|
|
152
|
+
'deviceBarW',
|
|
153
|
+
'timeGutterW',
|
|
154
|
+
'dayHeaderH',
|
|
122
155
|
] as const
|
|
123
156
|
export type SizeToken = (typeof SIZE_KEYS)[number]
|
|
124
157
|
|
|
@@ -172,6 +205,39 @@ export const SIZES_PX = {
|
|
|
172
205
|
pageSm: 600,
|
|
173
206
|
pageMd: 800,
|
|
174
207
|
pageLg: 1200,
|
|
208
|
+
sidebarW: 240,
|
|
209
|
+
pageXs: 480,
|
|
210
|
+
pageXl: 1440,
|
|
211
|
+
asideW: 320,
|
|
212
|
+
gridColXs: 200,
|
|
213
|
+
fieldMinWSm: 80,
|
|
214
|
+
fieldMinW: 160,
|
|
215
|
+
popoverWSm: 240,
|
|
216
|
+
popoverW: 320,
|
|
217
|
+
popupMaxW: 280,
|
|
218
|
+
meterH: 6,
|
|
219
|
+
skeletonChipW: 96,
|
|
220
|
+
dropZoneMinH: 128,
|
|
221
|
+
canvasMinH: 480,
|
|
222
|
+
editorMinH: 160,
|
|
223
|
+
toolbarH: 36,
|
|
224
|
+
embedW: 550,
|
|
225
|
+
colorPickerW: 196,
|
|
226
|
+
colorAreaH: 150,
|
|
227
|
+
colorTrackH: 12,
|
|
228
|
+
colorSwatch: 20,
|
|
229
|
+
colorPreviewH: 22,
|
|
230
|
+
handle: 16,
|
|
231
|
+
chip: 24,
|
|
232
|
+
placeholderMinH: 80,
|
|
233
|
+
previewMaxH: 320,
|
|
234
|
+
barH: 4,
|
|
235
|
+
readoutW: 40,
|
|
236
|
+
sliderW: 96,
|
|
237
|
+
paletteMinW: 96,
|
|
238
|
+
deviceBarW: 96,
|
|
239
|
+
timeGutterW: 64,
|
|
240
|
+
dayHeaderH: 46,
|
|
175
241
|
} as const
|
|
176
242
|
|
|
177
243
|
export const BORDER_KEYS = [
|
|
@@ -194,6 +260,41 @@ export const BORDERS_PX = {
|
|
|
194
260
|
focusOffsetSm: 1,
|
|
195
261
|
} as const
|
|
196
262
|
|
|
263
|
+
export const LAYER_KEYS = [
|
|
264
|
+
'raised',
|
|
265
|
+
'floating',
|
|
266
|
+
'overlay',
|
|
267
|
+
'modal',
|
|
268
|
+
'popover',
|
|
269
|
+
'popupBackdrop',
|
|
270
|
+
'popup',
|
|
271
|
+
'toast',
|
|
272
|
+
'portal',
|
|
273
|
+
] as const
|
|
274
|
+
export type LayerToken = (typeof LAYER_KEYS)[number]
|
|
275
|
+
|
|
276
|
+
// Mirrors tokens/layers.css.ts `layers` (unitless), as numbers: React Native
|
|
277
|
+
// takes a number for zIndex, not the CSS variable string.
|
|
278
|
+
export const LAYERS = {
|
|
279
|
+
raised: 1,
|
|
280
|
+
floating: 50,
|
|
281
|
+
overlay: 1000,
|
|
282
|
+
modal: 1001,
|
|
283
|
+
popover: 1040,
|
|
284
|
+
popupBackdrop: 1049,
|
|
285
|
+
popup: 1050,
|
|
286
|
+
toast: 1060,
|
|
287
|
+
portal: 1100,
|
|
288
|
+
} as const
|
|
289
|
+
|
|
290
|
+
export const EFFECT_KEYS = ['overlayBlur'] as const
|
|
291
|
+
export type EffectToken = (typeof EFFECT_KEYS)[number]
|
|
292
|
+
|
|
293
|
+
// Mirrors tokens/effects.css.ts `effects` verbatim.
|
|
294
|
+
export const EFFECTS = {
|
|
295
|
+
overlayBlur: 'blur(2px)',
|
|
296
|
+
} as const
|
|
297
|
+
|
|
197
298
|
// Icon rendering sizes (SVG width/height, px). Not its own css.defineVars
|
|
198
299
|
// scale — icons size via attributes — so it is derived from the `sizes` group
|
|
199
300
|
// (iconSm…iconXxl), keeping one source.
|
|
@@ -254,6 +355,8 @@ export const SHADOWS = {
|
|
|
254
355
|
sm: '0 2px 4px rgba(0, 0, 0, 0.3)',
|
|
255
356
|
md: '0 4px 12px rgba(0, 0, 0, 0.4)',
|
|
256
357
|
lg: '0 8px 24px rgba(0, 0, 0, 0.5)',
|
|
358
|
+
dropReady: 'inset 0 0 0 1px #333333',
|
|
359
|
+
dropOver: 'inset 0 0 0 2px #6aaffc',
|
|
257
360
|
} as const
|
|
258
361
|
|
|
259
362
|
// Mirrors tokens/motion.css.ts `easing` verbatim.
|
package/src/raw.ts
CHANGED
|
@@ -37,12 +37,20 @@ export type RawColors = {
|
|
|
37
37
|
infoBg: string
|
|
38
38
|
infoBorder: string
|
|
39
39
|
infoText: string
|
|
40
|
+
highlight: string
|
|
41
|
+
highlightBg: string
|
|
42
|
+
highlightBorder: string
|
|
43
|
+
highlightText: string
|
|
40
44
|
scrim: string
|
|
41
45
|
inverseFill: string
|
|
42
46
|
inverseFillHover: string
|
|
43
47
|
inverseBorder: string
|
|
44
48
|
inverseBorderHover: string
|
|
45
49
|
fixedLight: string
|
|
50
|
+
overlayLight: string
|
|
51
|
+
contrastSurface: string
|
|
52
|
+
onContrastSurface: string
|
|
53
|
+
contrastBorder: string
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
// Numeric maps for consumers that load only the compiled `/raw` entry (e.g.
|
|
@@ -86,6 +94,18 @@ export const BORDERS_PX = {
|
|
|
86
94
|
focusOffsetSm: 1,
|
|
87
95
|
} as const
|
|
88
96
|
|
|
97
|
+
export const LAYERS = {
|
|
98
|
+
raised: 1,
|
|
99
|
+
floating: 50,
|
|
100
|
+
overlay: 1000,
|
|
101
|
+
modal: 1001,
|
|
102
|
+
popover: 1040,
|
|
103
|
+
popupBackdrop: 1049,
|
|
104
|
+
popup: 1050,
|
|
105
|
+
toast: 1060,
|
|
106
|
+
portal: 1100,
|
|
107
|
+
} as const
|
|
108
|
+
|
|
89
109
|
export const SIZES_PX = {
|
|
90
110
|
touchTarget: 44,
|
|
91
111
|
controlSm: 28,
|
|
@@ -135,6 +155,39 @@ export const SIZES_PX = {
|
|
|
135
155
|
pageSm: 600,
|
|
136
156
|
pageMd: 800,
|
|
137
157
|
pageLg: 1200,
|
|
158
|
+
sidebarW: 240,
|
|
159
|
+
pageXs: 480,
|
|
160
|
+
pageXl: 1440,
|
|
161
|
+
asideW: 320,
|
|
162
|
+
gridColXs: 200,
|
|
163
|
+
fieldMinWSm: 80,
|
|
164
|
+
fieldMinW: 160,
|
|
165
|
+
popoverWSm: 240,
|
|
166
|
+
popoverW: 320,
|
|
167
|
+
popupMaxW: 280,
|
|
168
|
+
meterH: 6,
|
|
169
|
+
skeletonChipW: 96,
|
|
170
|
+
dropZoneMinH: 128,
|
|
171
|
+
canvasMinH: 480,
|
|
172
|
+
editorMinH: 160,
|
|
173
|
+
toolbarH: 36,
|
|
174
|
+
embedW: 550,
|
|
175
|
+
colorPickerW: 196,
|
|
176
|
+
colorAreaH: 150,
|
|
177
|
+
colorTrackH: 12,
|
|
178
|
+
colorSwatch: 20,
|
|
179
|
+
colorPreviewH: 22,
|
|
180
|
+
handle: 16,
|
|
181
|
+
chip: 24,
|
|
182
|
+
placeholderMinH: 80,
|
|
183
|
+
previewMaxH: 320,
|
|
184
|
+
barH: 4,
|
|
185
|
+
readoutW: 40,
|
|
186
|
+
sliderW: 96,
|
|
187
|
+
paletteMinW: 96,
|
|
188
|
+
deviceBarW: 96,
|
|
189
|
+
timeGutterW: 64,
|
|
190
|
+
dayHeaderH: 46,
|
|
138
191
|
} as const
|
|
139
192
|
|
|
140
193
|
// Email-only measures: no CSS variable (mail clients cannot read them) and not
|
|
@@ -170,12 +223,20 @@ export const darkColors: RawColors = {
|
|
|
170
223
|
infoBg: 'rgba(106, 175, 252, 0.1)',
|
|
171
224
|
infoBorder: 'rgba(106, 175, 252, 0.3)',
|
|
172
225
|
infoText: '#93c5fd',
|
|
226
|
+
highlight: '#c084fc',
|
|
227
|
+
highlightBg: 'rgba(192, 132, 252, 0.1)',
|
|
228
|
+
highlightBorder: 'rgba(192, 132, 252, 0.3)',
|
|
229
|
+
highlightText: '#d8b4fe',
|
|
173
230
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
174
231
|
inverseFill: 'rgba(0, 0, 0, 0.10)',
|
|
175
232
|
inverseFillHover: 'rgba(0, 0, 0, 0.18)',
|
|
176
233
|
inverseBorder: 'rgba(0, 0, 0, 0.55)',
|
|
177
234
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
178
235
|
fixedLight: '#ffffff',
|
|
236
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
237
|
+
contrastSurface: '#f5f5f5',
|
|
238
|
+
onContrastSurface: '#1a1a1a',
|
|
239
|
+
contrastBorder: 'rgba(0, 0, 0, 0.42)',
|
|
179
240
|
}
|
|
180
241
|
|
|
181
242
|
// Light theme — matches the overrides in `themes/light.css.ts`.
|
|
@@ -207,12 +268,20 @@ export const lightColors: RawColors = {
|
|
|
207
268
|
infoBg: 'rgba(30, 64, 175, 0.08)',
|
|
208
269
|
infoBorder: 'rgba(30, 64, 175, 0.3)',
|
|
209
270
|
infoText: '#1e40af',
|
|
271
|
+
highlight: '#6b21a8',
|
|
272
|
+
highlightBg: 'rgba(107, 33, 168, 0.08)',
|
|
273
|
+
highlightBorder: 'rgba(107, 33, 168, 0.3)',
|
|
274
|
+
highlightText: '#581c87',
|
|
210
275
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
211
276
|
inverseFill: 'rgba(0, 0, 0, 0.10)',
|
|
212
277
|
inverseFillHover: 'rgba(0, 0, 0, 0.18)',
|
|
213
278
|
inverseBorder: 'rgba(0, 0, 0, 0.55)',
|
|
214
279
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
215
280
|
fixedLight: '#ffffff',
|
|
281
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
282
|
+
contrastSurface: '#1a1a1a',
|
|
283
|
+
onContrastSurface: '#e5e5e5',
|
|
284
|
+
contrastBorder: 'rgba(255, 255, 255, 0.33)',
|
|
216
285
|
}
|
|
217
286
|
|
|
218
287
|
// High-contrast theme — matches the overrides in `themes/high-contrast.css.ts`.
|
|
@@ -244,10 +313,18 @@ export const highContrastColors: RawColors = {
|
|
|
244
313
|
infoBg: 'rgba(96, 165, 250, 0.15)',
|
|
245
314
|
infoBorder: 'rgba(96, 165, 250, 0.5)',
|
|
246
315
|
infoText: '#bfdbfe',
|
|
316
|
+
highlight: '#d8b4fe',
|
|
317
|
+
highlightBg: 'rgba(216, 180, 254, 0.15)',
|
|
318
|
+
highlightBorder: 'rgba(216, 180, 254, 0.5)',
|
|
319
|
+
highlightText: '#e9d5ff',
|
|
247
320
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
248
321
|
inverseFill: 'rgba(0, 0, 0, 0.10)',
|
|
249
322
|
inverseFillHover: 'rgba(0, 0, 0, 0.18)',
|
|
250
323
|
inverseBorder: 'rgba(0, 0, 0, 0.55)',
|
|
251
324
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
252
325
|
fixedLight: '#ffffff',
|
|
326
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
327
|
+
contrastSurface: '#ffffff',
|
|
328
|
+
onContrastSurface: '#000000',
|
|
329
|
+
contrastBorder: 'rgba(0, 0, 0, 0.42)',
|
|
253
330
|
}
|
|
@@ -30,6 +30,12 @@ export const highContrastTheme = css.createTheme(colors, {
|
|
|
30
30
|
infoBg: 'rgba(96, 165, 250, 0.15)',
|
|
31
31
|
infoBorder: 'rgba(96, 165, 250, 0.5)',
|
|
32
32
|
infoText: '#bfdbfe',
|
|
33
|
+
|
|
34
|
+
// Highlight — a non-status accent (a category, an intent); no status meaning.
|
|
35
|
+
highlight: '#d8b4fe',
|
|
36
|
+
highlightBg: 'rgba(216, 180, 254, 0.15)',
|
|
37
|
+
highlightBorder: 'rgba(216, 180, 254, 0.5)',
|
|
38
|
+
highlightText: '#e9d5ff',
|
|
33
39
|
// Fixed overlays — the same in every theme (a scrim darkens whatever is
|
|
34
40
|
// under it; the inverse overlays sit on an accent surface).
|
|
35
41
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
@@ -39,10 +45,21 @@ export const highContrastTheme = css.createTheme(colors, {
|
|
|
39
45
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
40
46
|
// A light that does not follow the theme (the Switch knob).
|
|
41
47
|
fixedLight: '#ffffff',
|
|
48
|
+
// A fixed translucent white over content (the light counterpart of scrim).
|
|
49
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
50
|
+
// The opposite tone of the theme: a surface that stands out from the page
|
|
51
|
+
// (toasts, coach marks), with its own text colour. Not the fixed inverse*
|
|
52
|
+
// overlays above, which sit on an accent fill.
|
|
53
|
+
contrastSurface: '#ffffff',
|
|
54
|
+
onContrastSurface: '#000000',
|
|
55
|
+
// A border on contrastSurface, at least 3:1 against it (non-text).
|
|
56
|
+
contrastBorder: 'rgba(0, 0, 0, 0.42)',
|
|
42
57
|
})
|
|
43
58
|
|
|
44
59
|
export const highContrastShadows = css.createTheme(shadows, {
|
|
45
60
|
sm: '0 2px 4px rgba(0, 0, 0, 0.6)',
|
|
46
61
|
md: '0 4px 12px rgba(0, 0, 0, 0.7)',
|
|
47
62
|
lg: '0 8px 24px rgba(0, 0, 0, 0.8)',
|
|
63
|
+
dropReady: 'inset 0 0 0 1px #555555',
|
|
64
|
+
dropOver: 'inset 0 0 0 2px #60a5fa',
|
|
48
65
|
})
|
package/src/themes/light.css.ts
CHANGED
|
@@ -30,6 +30,12 @@ export const lightTheme = css.createTheme(colors, {
|
|
|
30
30
|
infoBg: 'rgba(30, 64, 175, 0.08)',
|
|
31
31
|
infoBorder: 'rgba(30, 64, 175, 0.3)',
|
|
32
32
|
infoText: '#1e40af',
|
|
33
|
+
|
|
34
|
+
// Highlight — a non-status accent (a category, an intent); no status meaning.
|
|
35
|
+
highlight: '#6b21a8',
|
|
36
|
+
highlightBg: 'rgba(107, 33, 168, 0.08)',
|
|
37
|
+
highlightBorder: 'rgba(107, 33, 168, 0.3)',
|
|
38
|
+
highlightText: '#581c87',
|
|
33
39
|
// Fixed overlays — the same in every theme (a scrim darkens whatever is
|
|
34
40
|
// under it; the inverse overlays sit on an accent surface).
|
|
35
41
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
@@ -39,10 +45,21 @@ export const lightTheme = css.createTheme(colors, {
|
|
|
39
45
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
40
46
|
// A light that does not follow the theme (the Switch knob).
|
|
41
47
|
fixedLight: '#ffffff',
|
|
48
|
+
// A fixed translucent white over content (the light counterpart of scrim).
|
|
49
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
50
|
+
// The opposite tone of the theme: a surface that stands out from the page
|
|
51
|
+
// (toasts, coach marks), with its own text colour. Not the fixed inverse*
|
|
52
|
+
// overlays above, which sit on an accent fill.
|
|
53
|
+
contrastSurface: '#1a1a1a',
|
|
54
|
+
onContrastSurface: '#e5e5e5',
|
|
55
|
+
// A border on contrastSurface, at least 3:1 against it (non-text).
|
|
56
|
+
contrastBorder: 'rgba(255, 255, 255, 0.33)',
|
|
42
57
|
})
|
|
43
58
|
|
|
44
59
|
export const lightShadows = css.createTheme(shadows, {
|
|
45
60
|
sm: '0 2px 4px rgba(0, 0, 0, 0.08)',
|
|
46
61
|
md: '0 4px 12px rgba(0, 0, 0, 0.12)',
|
|
47
62
|
lg: '0 8px 24px rgba(0, 0, 0, 0.16)',
|
|
63
|
+
dropReady: 'inset 0 0 0 1px #d4d4d4',
|
|
64
|
+
dropOver: 'inset 0 0 0 2px #1e40af',
|
|
48
65
|
})
|
package/src/tokens/colors.css.ts
CHANGED
|
@@ -44,6 +44,12 @@ export const colors = css.defineVars({
|
|
|
44
44
|
infoBorder: 'rgba(106, 175, 252, 0.3)',
|
|
45
45
|
infoText: '#93c5fd',
|
|
46
46
|
|
|
47
|
+
// Highlight — a non-status accent (a category, an intent); no status meaning.
|
|
48
|
+
highlight: '#c084fc',
|
|
49
|
+
highlightBg: 'rgba(192, 132, 252, 0.1)',
|
|
50
|
+
highlightBorder: 'rgba(192, 132, 252, 0.3)',
|
|
51
|
+
highlightText: '#d8b4fe',
|
|
52
|
+
|
|
47
53
|
// Fixed overlays — the same in every theme (a scrim darkens whatever is
|
|
48
54
|
// under it; the inverse overlays sit on an accent surface).
|
|
49
55
|
scrim: 'rgba(0, 0, 0, 0.4)',
|
|
@@ -53,4 +59,13 @@ export const colors = css.defineVars({
|
|
|
53
59
|
inverseBorderHover: 'rgba(0, 0, 0, 0.70)',
|
|
54
60
|
// A light that does not follow the theme (the Switch knob).
|
|
55
61
|
fixedLight: '#ffffff',
|
|
62
|
+
// A fixed translucent white over content (the light counterpart of scrim).
|
|
63
|
+
overlayLight: 'rgba(255, 255, 255, 0.78)',
|
|
64
|
+
// The opposite tone of the theme: a surface that stands out from the page
|
|
65
|
+
// (toasts, coach marks), with its own text colour. Not the fixed inverse*
|
|
66
|
+
// overlays above, which sit on an accent fill.
|
|
67
|
+
contrastSurface: '#f5f5f5',
|
|
68
|
+
onContrastSurface: '#1a1a1a',
|
|
69
|
+
// A border on contrastSurface, at least 3:1 against it (non-text).
|
|
70
|
+
contrastBorder: 'rgba(0, 0, 0, 0.42)',
|
|
56
71
|
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {css} from 'react-strict-dom'
|
|
2
|
+
|
|
3
|
+
// Visual effects. Not themed.
|
|
4
|
+
//
|
|
5
|
+
// overlayBlur: the blur behind a modal's backdrop (a command palette, a
|
|
6
|
+
// lightbox). Apply it ONLY on the backdrop element itself: a backdropFilter
|
|
7
|
+
// (or filter) on an ancestor becomes the containing block for every fixed
|
|
8
|
+
// descendant, so a Dialog or Drawer opened inside it is positioned against
|
|
9
|
+
// that ancestor instead of the viewport.
|
|
10
|
+
export const effects = css.defineVars({
|
|
11
|
+
overlayBlur: 'blur(2px)',
|
|
12
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {css} from 'react-strict-dom'
|
|
2
|
+
import type {LayerToken} from '../keys'
|
|
3
|
+
|
|
4
|
+
// The z-index scale. Values are unitless strings so `--duro-layer-*` exists
|
|
5
|
+
// for plain CSS; React Native takes a number, so a native overlay reads the
|
|
6
|
+
// numeric LAYERS map from `@duro-app/tokens/keys` instead.
|
|
7
|
+
//
|
|
8
|
+
// They only compete inside one stacking context. Dialog, Drawer, the popups
|
|
9
|
+
// and the toast region all portal into the ThemeProvider mount (`portal`),
|
|
10
|
+
// and this is the order they keep there.
|
|
11
|
+
// StyleX types a var by its literal, so string values would type every layer
|
|
12
|
+
// as a string, which `zIndex` (a number) refuses. Typing the literals as CSS
|
|
13
|
+
// integers makes `zIndex: layers.popup` a number to TypeScript; the cast has
|
|
14
|
+
// no runtime effect (StyleX and the drift check read straight through it).
|
|
15
|
+
type LayerValue = ReturnType<typeof css.types.integer<number>>
|
|
16
|
+
|
|
17
|
+
export const layers = css.defineVars({
|
|
18
|
+
// A focused or sticky part above its siblings (a joined group's focus ring,
|
|
19
|
+
// a scrollbar, a sticky table header).
|
|
20
|
+
raised: '1',
|
|
21
|
+
// Floating chrome over the page: Tooltip, ActionBar.
|
|
22
|
+
floating: '50',
|
|
23
|
+
// A modal's backdrop.
|
|
24
|
+
overlay: '1000',
|
|
25
|
+
// A modal's panel (Dialog, Drawer).
|
|
26
|
+
modal: '1001',
|
|
27
|
+
// A Popover inside a Dialog or Drawer: above that modal, below the popups
|
|
28
|
+
// (a Select, a Menu) and the Select click-catcher opened from inside it.
|
|
29
|
+
// Outside a modal a Popover is `floating`, so a modal opened later covers it.
|
|
30
|
+
popover: '1040',
|
|
31
|
+
// A popup's click-catcher, under the popup itself.
|
|
32
|
+
popupBackdrop: '1049',
|
|
33
|
+
// Popups: Select, Listbox, Menu — above a modal or Popover they open from.
|
|
34
|
+
popup: '1050',
|
|
35
|
+
// The toast region: above popups and modals.
|
|
36
|
+
toast: '1060',
|
|
37
|
+
// The ThemeProvider portal mount that holds all of the above.
|
|
38
|
+
portal: '1100',
|
|
39
|
+
} as unknown as Readonly<Record<LayerToken, LayerValue>>)
|
|
@@ -4,4 +4,10 @@ export const shadows = css.defineVars({
|
|
|
4
4
|
sm: '0 2px 4px rgba(0, 0, 0, 0.3)',
|
|
5
5
|
md: '0 4px 12px rgba(0, 0, 0, 0.4)',
|
|
6
6
|
lg: '0 8px 24px rgba(0, 0, 0, 0.5)',
|
|
7
|
+
// DragDrop's drop-target rings: borders.hairline in colors.border on every
|
|
8
|
+
// zone that can receive, borders.strong in colors.accent on the one under the
|
|
9
|
+
// pointer. Literal per theme (StyleX needs inline literals); the drift check
|
|
10
|
+
// rebuilds each from the palette. Not focus: focus stays on outlines.
|
|
11
|
+
dropReady: 'inset 0 0 0 1px #333333',
|
|
12
|
+
dropOver: 'inset 0 0 0 2px #6aaffc',
|
|
7
13
|
})
|