@sanity/ui 3.0.0-static.10 → 3.0.0-static.11
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/_chunks-cjs/_visual-editing.js +160 -207
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +161 -208
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -3
- package/dist/_visual-editing.d.ts +1 -3
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +115 -2
- package/dist/css.d.ts +115 -2
- package/dist/css.js +539 -402
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +541 -404
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -12
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +418 -182
- package/dist/theme.js +10 -11
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +10 -11
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/_resp.ts +0 -1
- package/src/css/aspects/font/font.style.ts +7 -66
- package/src/css/aspects/shadow/shadow.style.ts +16 -41
- package/src/css/compile/compilePalette.ts +4 -3
- package/src/css/compile/compileSystem.ts +0 -3
- package/src/css/compile/compileTheme_v3.ts +233 -219
- package/src/css/components/skeleton/skeleton.style.ts +8 -4
- package/src/css/constants.ts +9 -0
- package/src/css/index.ts +1 -0
- package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
- package/src/css/primitives/_arrow/_arrow.ts +4 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +23 -23
- package/src/css/primitives/button/button.style.ts +48 -15
- package/src/css/primitives/card/card.style.ts +1 -1
- package/src/css/primitives/token/token.style.ts +37 -36
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/types.ts +106 -3
- package/src/css/varNames.ts +101 -4
- package/src/css/vars.ts +52 -16
- package/src/theme/v3/buildTheme_v3.ts +1 -1
- package/src/theme/v3/{defaults.ts → defaultTokens.ts} +1 -2
- package/src/theme/v3/index.ts +1 -1
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +41 -0
- package/src/ui/_compat/helpers.ts +72 -0
- package/src/ui/_compat/index.ts +2 -6
- package/src/ui/_compat/studioTheme.ts +7 -0
- package/src/ui/_compat/types.ts +0 -83
- package/src/ui/index.ts +1 -0
- package/src/ui/primitives/button/button.tsx +5 -6
- package/src/ui/primitives/popover/popover.tsx +25 -7
- package/src/ui/primitives/popover/popoverCard.tsx +46 -45
- package/src/ui/primitives/tooltip/tooltip.tsx +9 -2
- package/src/ui/primitives/tooltip/tooltipCard.tsx +1 -1
- package/src/ui/utils/arrow/arrow.tsx +3 -11
- package/src/ui/utils/elementQuery/elementQuery.tsx +10 -8
- package/src/ui/utils/virtualList/virtualList.tsx +37 -32
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -78
- package/src/css/components/skeleton/rules.ts +0 -113
- package/src/css/components/toast/rules.ts +0 -18
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/spinner/rules.ts +0 -21
- package/src/css/primitives/token/rules.ts +0 -45
package/dist/css.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from "@sanity/color";
|
|
2
|
-
import {
|
|
1
|
+
import { COLOR_HUES, COLOR_TINTS, color } from "@sanity/color";
|
|
2
|
+
import { SPACE, SHADOW, RADIUS, FONT_TEXT_SIZE, FONT_LABEL_SIZE, FONT_HEADING_SIZE, FONT_CODE_SIZE, AVATAR_SIZE, THEME_COLOR_STATE_TONES, HUES, TINTS, THEME_COLOR_CARD_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_SCHEMES as THEME_COLOR_SCHEMES$1, renderColor } from "@sanity/ui/theme";
|
|
3
3
|
function _resp(prefix, prop) {
|
|
4
4
|
if (!(prop === void 0 || prop === !1))
|
|
5
5
|
return Array.isArray(prop) ? prop.map((value, index) => {
|
|
@@ -74,7 +74,14 @@ function radius(props) {
|
|
|
74
74
|
function shadow(props) {
|
|
75
75
|
return composeClassNames(_resp("shadow", props.shadow));
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const BREAKPOINTS = {
|
|
78
|
+
1: 360,
|
|
79
|
+
2: 600,
|
|
80
|
+
3: 900,
|
|
81
|
+
4: 1200,
|
|
82
|
+
5: 1800,
|
|
83
|
+
6: 2400
|
|
84
|
+
}, PREFIX = "s-";
|
|
78
85
|
function scopeClassName(className) {
|
|
79
86
|
if (className !== void 0)
|
|
80
87
|
return `${PREFIX}${className.trim()}`;
|
|
@@ -88,98 +95,6 @@ function textOverflow(props) {
|
|
|
88
95
|
function width(props) {
|
|
89
96
|
return _resp("w", props.width) ?? "";
|
|
90
97
|
}
|
|
91
|
-
function compileRule(selector, props, context) {
|
|
92
|
-
let css = compileProperties$1(selector, props);
|
|
93
|
-
if (props["@nest"] && (css += compileNestedRules(selector, props["@nest"], context)), props["@keyframes"])
|
|
94
|
-
for (const name in props["@keyframes"])
|
|
95
|
-
context.keyframes[name] = props["@keyframes"][name];
|
|
96
|
-
if (props["@media"])
|
|
97
|
-
for (const key in props["@media"])
|
|
98
|
-
context.media[key] || (context.media[key] = {}), context.media[key][selector] = props["@media"][key];
|
|
99
|
-
return css;
|
|
100
|
-
}
|
|
101
|
-
function compileProperties$1(selector, props) {
|
|
102
|
-
let css = "{";
|
|
103
|
-
for (const key in props) {
|
|
104
|
-
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
105
|
-
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
106
|
-
for (const v of valueArr)
|
|
107
|
-
css += toSnakeCase$1(key) + ":" + v + ";";
|
|
108
|
-
}
|
|
109
|
-
return css === "{" ? "" : selector + css + "}";
|
|
110
|
-
}
|
|
111
|
-
function compileNestedRules(selector, props, context) {
|
|
112
|
-
if (!props) return "";
|
|
113
|
-
let css = "";
|
|
114
|
-
for (const [_selector, _props] of Object.entries(props))
|
|
115
|
-
css += `
|
|
116
|
-
` + compileRule(_selector.replace(/\./g, `.${PREFIX}`).replace(/&/g, selector), _props, context);
|
|
117
|
-
return css;
|
|
118
|
-
}
|
|
119
|
-
function toSnakeCase$1(value) {
|
|
120
|
-
return value.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
|
|
121
|
-
}
|
|
122
|
-
function compilePalette() {
|
|
123
|
-
const props = {
|
|
124
|
-
...compileHues(),
|
|
125
|
-
"--black": color.black.hex,
|
|
126
|
-
"--white": color.white.hex
|
|
127
|
-
};
|
|
128
|
-
return compileRule(":root", props, {
|
|
129
|
-
keyframes: {},
|
|
130
|
-
media: {}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
function compileHues() {
|
|
134
|
-
const rules2 = {};
|
|
135
|
-
for (const hue of HUES)
|
|
136
|
-
for (const tint of TINTS)
|
|
137
|
-
rules2[`--${hue}-${tint}`] = color[hue][tint].hex;
|
|
138
|
-
return rules2;
|
|
139
|
-
}
|
|
140
|
-
function _mergeStyles(styles) {
|
|
141
|
-
const keyframes2 = {}, layers = {}, rules2 = {};
|
|
142
|
-
for (const s of styles)
|
|
143
|
-
if (s) {
|
|
144
|
-
Object.assign(keyframes2, s.keyframes);
|
|
145
|
-
for (const layerName in s.layers)
|
|
146
|
-
layers[layerName] || (layers[layerName] = {}), Object.assign(layers[layerName], s.layers[layerName]);
|
|
147
|
-
Object.assign(rules2, s.rules);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
keyframes: keyframes2,
|
|
151
|
-
layers,
|
|
152
|
-
rules: rules2
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function _responsiveRule(rules2, _name, properties) {
|
|
156
|
-
const name = _name.replace(/\./g, "_");
|
|
157
|
-
rules2[`.${name}`] = properties, rules2[`.1\\:${name}`] = {
|
|
158
|
-
"@media": {
|
|
159
|
-
"screen and (min-width: 360px)": properties
|
|
160
|
-
}
|
|
161
|
-
}, rules2[`.2\\:${name}`] = {
|
|
162
|
-
"@media": {
|
|
163
|
-
"screen and (min-width: 600px)": properties
|
|
164
|
-
}
|
|
165
|
-
}, rules2[`.3\\:${name}`] = {
|
|
166
|
-
"@media": {
|
|
167
|
-
"screen and (min-width: 900px)": properties
|
|
168
|
-
}
|
|
169
|
-
}, rules2[`.4\\:${name}`] = {
|
|
170
|
-
"@media": {
|
|
171
|
-
"screen and (min-width: 1200px)": properties
|
|
172
|
-
}
|
|
173
|
-
}, rules2[`.5\\:${name}`] = {
|
|
174
|
-
"@media": {
|
|
175
|
-
"screen and (min-width: 1800px)": properties
|
|
176
|
-
}
|
|
177
|
-
}, rules2[`.6\\:${name}`] = {
|
|
178
|
-
"@media": {
|
|
179
|
-
"screen and (min-width: 2400px)": properties
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
98
|
const varNames = {
|
|
184
99
|
avatar: {
|
|
185
100
|
distance: "--avatar-distance",
|
|
@@ -196,6 +111,20 @@ const varNames = {
|
|
|
196
111
|
}
|
|
197
112
|
}), {})
|
|
198
113
|
},
|
|
114
|
+
button: {
|
|
115
|
+
border: {
|
|
116
|
+
width: "--button-border-width"
|
|
117
|
+
},
|
|
118
|
+
focusRing: {
|
|
119
|
+
offset: "--button-focus-ring-offset",
|
|
120
|
+
width: "--button-focus-ring-width"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
card: {
|
|
124
|
+
shadow: {
|
|
125
|
+
outline: "--card-shadow-outline"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
199
128
|
color: {
|
|
200
129
|
// card scope
|
|
201
130
|
accent: {
|
|
@@ -423,6 +352,7 @@ const varNames = {
|
|
|
423
352
|
font: {
|
|
424
353
|
code: {
|
|
425
354
|
family: "--font-code-family",
|
|
355
|
+
featureSettings: "--font-code-feature-settings",
|
|
426
356
|
sizes: FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
427
357
|
...acc,
|
|
428
358
|
[size]: {
|
|
@@ -434,7 +364,7 @@ const varNames = {
|
|
|
434
364
|
iconSize: `--font-code-${size}-icon-size`
|
|
435
365
|
}
|
|
436
366
|
}), {}),
|
|
437
|
-
|
|
367
|
+
weights: {
|
|
438
368
|
regular: "--font-code-weight-regular",
|
|
439
369
|
medium: "--font-code-weight-medium",
|
|
440
370
|
semibold: "--font-code-weight-semibold",
|
|
@@ -443,6 +373,7 @@ const varNames = {
|
|
|
443
373
|
},
|
|
444
374
|
heading: {
|
|
445
375
|
family: "--font-heading-family",
|
|
376
|
+
featureSettings: "--font-heading-feature-settings",
|
|
446
377
|
sizes: FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
447
378
|
...acc,
|
|
448
379
|
[size]: {
|
|
@@ -454,7 +385,7 @@ const varNames = {
|
|
|
454
385
|
iconSize: `--font-heading-${size}-icon-size`
|
|
455
386
|
}
|
|
456
387
|
}), {}),
|
|
457
|
-
|
|
388
|
+
weights: {
|
|
458
389
|
regular: "--font-heading-weight-regular",
|
|
459
390
|
medium: "--font-heading-weight-medium",
|
|
460
391
|
semibold: "--font-heading-weight-semibold",
|
|
@@ -463,6 +394,7 @@ const varNames = {
|
|
|
463
394
|
},
|
|
464
395
|
label: {
|
|
465
396
|
family: "--font-label-family",
|
|
397
|
+
featureSettings: "--font-label-feature-settings",
|
|
466
398
|
sizes: FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
467
399
|
...acc,
|
|
468
400
|
[size]: {
|
|
@@ -474,7 +406,7 @@ const varNames = {
|
|
|
474
406
|
iconSize: `--font-label-${size}-icon-size`
|
|
475
407
|
}
|
|
476
408
|
}), {}),
|
|
477
|
-
|
|
409
|
+
weights: {
|
|
478
410
|
regular: "--font-label-weight-regular",
|
|
479
411
|
medium: "--font-label-weight-medium",
|
|
480
412
|
semibold: "--font-label-weight-semibold",
|
|
@@ -483,6 +415,7 @@ const varNames = {
|
|
|
483
415
|
},
|
|
484
416
|
text: {
|
|
485
417
|
family: "--font-text-family",
|
|
418
|
+
featureSettings: "--font-text-feature-settings",
|
|
486
419
|
sizes: FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
487
420
|
...acc,
|
|
488
421
|
[size]: {
|
|
@@ -494,7 +427,7 @@ const varNames = {
|
|
|
494
427
|
iconSize: `--font-text-${size}-icon-size`
|
|
495
428
|
}
|
|
496
429
|
}), {}),
|
|
497
|
-
|
|
430
|
+
weights: {
|
|
498
431
|
regular: "--font-text-weight-regular",
|
|
499
432
|
medium: "--font-text-weight-medium",
|
|
500
433
|
semibold: "--font-text-weight-semibold",
|
|
@@ -503,6 +436,47 @@ const varNames = {
|
|
|
503
436
|
}
|
|
504
437
|
},
|
|
505
438
|
input: {
|
|
439
|
+
border: {
|
|
440
|
+
width: "--input-border-width"
|
|
441
|
+
},
|
|
442
|
+
checkbox: {
|
|
443
|
+
focusRing: {
|
|
444
|
+
offset: "--input-checkbox-focus-ring-offset",
|
|
445
|
+
width: "--input-checkbox-focus-ring-width"
|
|
446
|
+
},
|
|
447
|
+
size: "--input-checkbox-size"
|
|
448
|
+
},
|
|
449
|
+
radio: {
|
|
450
|
+
focusRing: {
|
|
451
|
+
offset: "--input-radio-focus-ring-offset",
|
|
452
|
+
width: "--input-radio-focus-ring-width"
|
|
453
|
+
},
|
|
454
|
+
markSize: "--input-radio-mark-size",
|
|
455
|
+
size: "--input-radio-size"
|
|
456
|
+
},
|
|
457
|
+
select: {
|
|
458
|
+
focusRing: {
|
|
459
|
+
offset: "--input-select-focus-ring-offset",
|
|
460
|
+
width: "--input-select-focus-ring-width"
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
switch: {
|
|
464
|
+
focusRing: {
|
|
465
|
+
offset: "--input-switch-focus-ring-offset",
|
|
466
|
+
width: "--input-switch-focus-ring-width"
|
|
467
|
+
},
|
|
468
|
+
height: "--input-switch-height",
|
|
469
|
+
padding: "--input-switch-padding",
|
|
470
|
+
transitionDurationMs: "--input-switch-transition-duration-ms",
|
|
471
|
+
transitionTimingFunction: "--input-switch-transition-timing-function",
|
|
472
|
+
width: "--input-switch-width"
|
|
473
|
+
},
|
|
474
|
+
text: {
|
|
475
|
+
focusRing: {
|
|
476
|
+
offset: "--input-text-focus-ring-offset",
|
|
477
|
+
width: "--input-text-focus-ring-width"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
506
480
|
fontSize: "--input-font-size",
|
|
507
481
|
lineHeight: "--input-line-height",
|
|
508
482
|
letterSpacing: "--input-letter-spacing",
|
|
@@ -513,7 +487,21 @@ const varNames = {
|
|
|
513
487
|
padding: "--input-padding"
|
|
514
488
|
},
|
|
515
489
|
radius: Object.fromEntries(RADIUS.map((radius2) => [radius2, `--radius-${radius2}`])),
|
|
516
|
-
|
|
490
|
+
shadow: Object.fromEntries(SHADOW.map((shadow2) => [shadow2, {
|
|
491
|
+
umbra: `--shadow-${shadow2}-umbra`,
|
|
492
|
+
penumbra: `--shadow-${shadow2}-penumbra`,
|
|
493
|
+
ambient: `--shadow-${shadow2}-ambient`
|
|
494
|
+
}])),
|
|
495
|
+
space: Object.fromEntries(SPACE.map((space) => [space, `--space-${String(space).replace(".", "_")}`])),
|
|
496
|
+
// color
|
|
497
|
+
black: "--black",
|
|
498
|
+
white: "--white",
|
|
499
|
+
...COLOR_HUES.reduce((acc, hue) => {
|
|
500
|
+
const tints = {};
|
|
501
|
+
for (const tint of COLOR_TINTS)
|
|
502
|
+
tints[tint] = `--${hue}-${tint}`;
|
|
503
|
+
return acc[hue] = tints, acc;
|
|
504
|
+
}, {})
|
|
517
505
|
};
|
|
518
506
|
function buildColorCardVarNames(props) {
|
|
519
507
|
const {
|
|
@@ -691,6 +679,98 @@ function buildColorVariantVarNames(options) {
|
|
|
691
679
|
}
|
|
692
680
|
return vars2;
|
|
693
681
|
}
|
|
682
|
+
function compileRule(selector, props, context) {
|
|
683
|
+
let css = compileProperties$1(selector, props);
|
|
684
|
+
if (props["@nest"] && (css += compileNestedRules(selector, props["@nest"], context)), props["@keyframes"])
|
|
685
|
+
for (const name in props["@keyframes"])
|
|
686
|
+
context.keyframes[name] = props["@keyframes"][name];
|
|
687
|
+
if (props["@media"])
|
|
688
|
+
for (const key in props["@media"])
|
|
689
|
+
context.media[key] || (context.media[key] = {}), context.media[key][selector] = props["@media"][key];
|
|
690
|
+
return css;
|
|
691
|
+
}
|
|
692
|
+
function compileProperties$1(selector, props) {
|
|
693
|
+
let css = "{";
|
|
694
|
+
for (const key in props) {
|
|
695
|
+
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
696
|
+
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
697
|
+
for (const v of valueArr)
|
|
698
|
+
css += toSnakeCase$1(key) + ":" + v + ";";
|
|
699
|
+
}
|
|
700
|
+
return css === "{" ? "" : selector + css + "}";
|
|
701
|
+
}
|
|
702
|
+
function compileNestedRules(selector, props, context) {
|
|
703
|
+
if (!props) return "";
|
|
704
|
+
let css = "";
|
|
705
|
+
for (const [_selector, _props] of Object.entries(props))
|
|
706
|
+
css += `
|
|
707
|
+
` + compileRule(_selector.replace(/\./g, `.${PREFIX}`).replace(/&/g, selector), _props, context);
|
|
708
|
+
return css;
|
|
709
|
+
}
|
|
710
|
+
function toSnakeCase$1(value) {
|
|
711
|
+
return value.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
|
|
712
|
+
}
|
|
713
|
+
function compilePalette() {
|
|
714
|
+
const props = {
|
|
715
|
+
...compileHues(),
|
|
716
|
+
[varNames.black]: color.black.hex,
|
|
717
|
+
[varNames.white]: color.white.hex
|
|
718
|
+
};
|
|
719
|
+
return compileRule(":root", props, {
|
|
720
|
+
keyframes: {},
|
|
721
|
+
media: {}
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
function compileHues() {
|
|
725
|
+
const rules2 = {};
|
|
726
|
+
for (const hue of HUES)
|
|
727
|
+
for (const tint of TINTS)
|
|
728
|
+
rules2[varNames[hue][tint]] = color[hue][tint].hex;
|
|
729
|
+
return rules2;
|
|
730
|
+
}
|
|
731
|
+
function _mergeStyles(styles) {
|
|
732
|
+
const keyframes2 = {}, layers = {}, rules2 = {};
|
|
733
|
+
for (const s of styles)
|
|
734
|
+
if (s) {
|
|
735
|
+
Object.assign(keyframes2, s.keyframes);
|
|
736
|
+
for (const layerName in s.layers)
|
|
737
|
+
layers[layerName] || (layers[layerName] = {}), Object.assign(layers[layerName], s.layers[layerName]);
|
|
738
|
+
Object.assign(rules2, s.rules);
|
|
739
|
+
}
|
|
740
|
+
return {
|
|
741
|
+
keyframes: keyframes2,
|
|
742
|
+
layers,
|
|
743
|
+
rules: rules2
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function _responsiveRule(rules2, _name, properties) {
|
|
747
|
+
const name = _name.replace(/\./g, "_");
|
|
748
|
+
rules2[`.${name}`] = properties, rules2[`.1\\:${name}`] = {
|
|
749
|
+
"@media": {
|
|
750
|
+
"screen and (min-width: 360px)": properties
|
|
751
|
+
}
|
|
752
|
+
}, rules2[`.2\\:${name}`] = {
|
|
753
|
+
"@media": {
|
|
754
|
+
"screen and (min-width: 600px)": properties
|
|
755
|
+
}
|
|
756
|
+
}, rules2[`.3\\:${name}`] = {
|
|
757
|
+
"@media": {
|
|
758
|
+
"screen and (min-width: 900px)": properties
|
|
759
|
+
}
|
|
760
|
+
}, rules2[`.4\\:${name}`] = {
|
|
761
|
+
"@media": {
|
|
762
|
+
"screen and (min-width: 1200px)": properties
|
|
763
|
+
}
|
|
764
|
+
}, rules2[`.5\\:${name}`] = {
|
|
765
|
+
"@media": {
|
|
766
|
+
"screen and (min-width: 1800px)": properties
|
|
767
|
+
}
|
|
768
|
+
}, rules2[`.6\\:${name}`] = {
|
|
769
|
+
"@media": {
|
|
770
|
+
"screen and (min-width: 2400px)": properties
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
}
|
|
694
774
|
const darkColorVars = {};
|
|
695
775
|
for (const tone of THEME_COLOR_CARD_TONES)
|
|
696
776
|
darkColorVars[tone] = buildColorCardVars({
|
|
@@ -843,6 +923,11 @@ const colorVars = {
|
|
|
843
923
|
}
|
|
844
924
|
}), {})
|
|
845
925
|
},
|
|
926
|
+
card: {
|
|
927
|
+
shadow: {
|
|
928
|
+
outline: `var(${varNames.card.shadow.outline})`
|
|
929
|
+
}
|
|
930
|
+
},
|
|
846
931
|
color: colorVars,
|
|
847
932
|
container: {
|
|
848
933
|
0: `var(${varNames.container[0]})`,
|
|
@@ -867,10 +952,10 @@ const colorVars = {
|
|
|
867
952
|
}
|
|
868
953
|
}), {}),
|
|
869
954
|
weight: {
|
|
870
|
-
regular: `var(${varNames.font.code.
|
|
871
|
-
medium: `var(${varNames.font.code.
|
|
872
|
-
semibold: `var(${varNames.font.code.
|
|
873
|
-
bold: `var(${varNames.font.code.
|
|
955
|
+
regular: `var(${varNames.font.code.weights.regular})`,
|
|
956
|
+
medium: `var(${varNames.font.code.weights.medium})`,
|
|
957
|
+
semibold: `var(${varNames.font.code.weights.semibold})`,
|
|
958
|
+
bold: `var(${varNames.font.code.weights.bold})`
|
|
874
959
|
}
|
|
875
960
|
},
|
|
876
961
|
heading: {
|
|
@@ -887,10 +972,10 @@ const colorVars = {
|
|
|
887
972
|
}
|
|
888
973
|
}), {}),
|
|
889
974
|
weight: {
|
|
890
|
-
regular: `var(${varNames.font.heading.
|
|
891
|
-
medium: `var(${varNames.font.heading.
|
|
892
|
-
semibold: `var(${varNames.font.heading.
|
|
893
|
-
bold: `var(${varNames.font.heading.
|
|
975
|
+
regular: `var(${varNames.font.heading.weights.regular})`,
|
|
976
|
+
medium: `var(${varNames.font.heading.weights.medium})`,
|
|
977
|
+
semibold: `var(${varNames.font.heading.weights.semibold})`,
|
|
978
|
+
bold: `var(${varNames.font.heading.weights.bold})`
|
|
894
979
|
}
|
|
895
980
|
},
|
|
896
981
|
label: {
|
|
@@ -907,10 +992,10 @@ const colorVars = {
|
|
|
907
992
|
}
|
|
908
993
|
}), {}),
|
|
909
994
|
weight: {
|
|
910
|
-
regular: `var(${varNames.font.label.
|
|
911
|
-
medium: `var(${varNames.font.label.
|
|
912
|
-
semibold: `var(${varNames.font.label.
|
|
913
|
-
bold: `var(${varNames.font.label.
|
|
995
|
+
regular: `var(${varNames.font.label.weights.regular})`,
|
|
996
|
+
medium: `var(${varNames.font.label.weights.medium})`,
|
|
997
|
+
semibold: `var(${varNames.font.label.weights.semibold})`,
|
|
998
|
+
bold: `var(${varNames.font.label.weights.bold})`
|
|
914
999
|
}
|
|
915
1000
|
},
|
|
916
1001
|
text: {
|
|
@@ -927,10 +1012,10 @@ const colorVars = {
|
|
|
927
1012
|
}
|
|
928
1013
|
}), {}),
|
|
929
1014
|
weight: {
|
|
930
|
-
regular: `var(${varNames.font.text.
|
|
931
|
-
medium: `var(${varNames.font.text.
|
|
932
|
-
semibold: `var(${varNames.font.text.
|
|
933
|
-
bold: `var(${varNames.font.text.
|
|
1015
|
+
regular: `var(${varNames.font.text.weights.regular})`,
|
|
1016
|
+
medium: `var(${varNames.font.text.weights.medium})`,
|
|
1017
|
+
semibold: `var(${varNames.font.text.weights.semibold})`,
|
|
1018
|
+
bold: `var(${varNames.font.text.weights.bold})`
|
|
934
1019
|
}
|
|
935
1020
|
}
|
|
936
1021
|
},
|
|
@@ -951,7 +1036,21 @@ const colorVars = {
|
|
|
951
1036
|
}
|
|
952
1037
|
},
|
|
953
1038
|
radius: Object.fromEntries(RADIUS.map((radius2) => [radius2, `var(${varNames.radius[radius2]})`])),
|
|
954
|
-
|
|
1039
|
+
shadow: Object.fromEntries(SHADOW.map((shadow2) => [shadow2, {
|
|
1040
|
+
umbra: `var(${varNames.shadow[shadow2].umbra})`,
|
|
1041
|
+
penumbra: `var(${varNames.shadow[shadow2].penumbra})`,
|
|
1042
|
+
ambient: `var(${varNames.shadow[shadow2].ambient})`
|
|
1043
|
+
}])),
|
|
1044
|
+
space: Object.fromEntries(SPACE.map((space) => [space, `var(${varNames.space[space]})`])),
|
|
1045
|
+
// color
|
|
1046
|
+
black: `var(${varNames.black})`,
|
|
1047
|
+
white: `var(${varNames.white})`,
|
|
1048
|
+
...COLOR_HUES.reduce((acc, hue) => {
|
|
1049
|
+
const tints = {};
|
|
1050
|
+
for (const tint of COLOR_TINTS)
|
|
1051
|
+
tints[tint] = `var(--${hue}-${tint})`;
|
|
1052
|
+
return acc[hue] = tints, acc;
|
|
1053
|
+
}, {})
|
|
955
1054
|
};
|
|
956
1055
|
function buildColorCardVars(props) {
|
|
957
1056
|
const {
|
|
@@ -1292,9 +1391,8 @@ const flexStyle = {
|
|
|
1292
1391
|
layers: {
|
|
1293
1392
|
util: util$n
|
|
1294
1393
|
}
|
|
1295
|
-
},
|
|
1394
|
+
}, primitive$q = {
|
|
1296
1395
|
".font": {
|
|
1297
|
-
// 'position': 'relative',
|
|
1298
1396
|
fontFamily: "var(--font-family)",
|
|
1299
1397
|
fontFeatureSettings: "var(--font-feature-settings)",
|
|
1300
1398
|
fontSize: "var(--font-size)",
|
|
@@ -1349,24 +1447,24 @@ const flexStyle = {
|
|
|
1349
1447
|
"--font-weight": "var(--font-weight-bold)"
|
|
1350
1448
|
}
|
|
1351
1449
|
};
|
|
1352
|
-
_responsiveRule(
|
|
1450
|
+
_responsiveRule(primitive$q, "text-align-initial", {
|
|
1353
1451
|
textAlign: "initial"
|
|
1354
1452
|
});
|
|
1355
|
-
_responsiveRule(
|
|
1453
|
+
_responsiveRule(primitive$q, "text-align-left", {
|
|
1356
1454
|
textAlign: "left"
|
|
1357
1455
|
});
|
|
1358
|
-
_responsiveRule(
|
|
1456
|
+
_responsiveRule(primitive$q, "text-align-center", {
|
|
1359
1457
|
textAlign: "center"
|
|
1360
1458
|
});
|
|
1361
|
-
_responsiveRule(
|
|
1459
|
+
_responsiveRule(primitive$q, "text-align-right", {
|
|
1362
1460
|
textAlign: "right"
|
|
1363
1461
|
});
|
|
1364
|
-
_responsiveRule(
|
|
1462
|
+
_responsiveRule(primitive$q, "text-align-justify", {
|
|
1365
1463
|
textAlign: "justify"
|
|
1366
1464
|
});
|
|
1367
1465
|
const fontStyle = {
|
|
1368
1466
|
layers: {
|
|
1369
|
-
primitive:
|
|
1467
|
+
primitive: primitive$q
|
|
1370
1468
|
}
|
|
1371
1469
|
}, util$m = {};
|
|
1372
1470
|
for (const space of SPACE)
|
|
@@ -2018,24 +2116,12 @@ const radiusStyle = {
|
|
|
2018
2116
|
util: util$2
|
|
2019
2117
|
}
|
|
2020
2118
|
}, util$1 = {};
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
_responsiveRule(util$1,
|
|
2025
|
-
|
|
2026
|
-
});
|
|
2027
|
-
_responsiveRule(util$1, "shadow-2", {
|
|
2028
|
-
boxShadow: [`var(--shadow-outline) ${vars.color.shadow.outline}`, `var(--shadow-2-umbra) ${vars.color.shadow.umbra}`, `var(--shadow-2-penumbra) ${vars.color.shadow.penumbra}`, `var(--shadow-2-ambient) ${vars.color.shadow.ambient}`].join(", ")
|
|
2029
|
-
});
|
|
2030
|
-
_responsiveRule(util$1, "shadow-3", {
|
|
2031
|
-
boxShadow: [`var(--shadow-outline) ${vars.color.shadow.outline}`, `var(--shadow-3-umbra) ${vars.color.shadow.umbra}`, `var(--shadow-3-penumbra) ${vars.color.shadow.penumbra}`, `var(--shadow-3-ambient) ${vars.color.shadow.ambient}`].join(", ")
|
|
2032
|
-
});
|
|
2033
|
-
_responsiveRule(util$1, "shadow-4", {
|
|
2034
|
-
boxShadow: [`var(--shadow-outline) ${vars.color.shadow.outline}`, `var(--shadow-4-umbra) ${vars.color.shadow.umbra}`, `var(--shadow-4-penumbra) ${vars.color.shadow.penumbra}`, `var(--shadow-4-ambient) ${vars.color.shadow.ambient}`].join(", ")
|
|
2035
|
-
});
|
|
2036
|
-
_responsiveRule(util$1, "shadow-5", {
|
|
2037
|
-
boxShadow: [`var(--shadow-outline) ${vars.color.shadow.outline}`, `var(--shadow-5-umbra) ${vars.color.shadow.umbra}`, `var(--shadow-5-penumbra) ${vars.color.shadow.penumbra}`, `var(--shadow-5-ambient) ${vars.color.shadow.ambient}`].join(", ")
|
|
2038
|
-
});
|
|
2119
|
+
for (const shadow2 of SHADOW)
|
|
2120
|
+
shadow2 === 0 ? _responsiveRule(util$1, "shadow-0", {
|
|
2121
|
+
boxShadow: "none"
|
|
2122
|
+
}) : _responsiveRule(util$1, `shadow-${shadow2}`, {
|
|
2123
|
+
boxShadow: [`0 0 0 ${vars.card.shadow.outline} ${vars.color.shadow.outline}`, `${vars.shadow[shadow2].umbra} ${vars.color.shadow.umbra}`, `${vars.shadow[shadow2].penumbra} ${vars.color.shadow.penumbra}`, `${vars.shadow[shadow2].ambient} ${vars.color.shadow.ambient}`].join(", ")
|
|
2124
|
+
});
|
|
2039
2125
|
const shadowStyle = {
|
|
2040
2126
|
layers: {
|
|
2041
2127
|
util: util$1
|
|
@@ -2157,8 +2243,8 @@ const widthStyle = {
|
|
|
2157
2243
|
layers: {
|
|
2158
2244
|
component: component$3
|
|
2159
2245
|
}
|
|
2160
|
-
}, keyframes$1 = {
|
|
2161
|
-
|
|
2246
|
+
}, KEYFRAMES_PULSE = "skeleton-pulse", keyframes$1 = {
|
|
2247
|
+
[KEYFRAMES_PULSE]: {
|
|
2162
2248
|
"0%": {
|
|
2163
2249
|
backgroundPosition: "100%"
|
|
2164
2250
|
},
|
|
@@ -2168,8 +2254,8 @@ const widthStyle = {
|
|
|
2168
2254
|
}
|
|
2169
2255
|
}, component$2 = {
|
|
2170
2256
|
".skeleton": {
|
|
2171
|
-
|
|
2172
|
-
|
|
2257
|
+
[varNames.color.skeleton.from]: `color-mix(in srgb, transparent, ${vars.color.muted.fg} 5%)`,
|
|
2258
|
+
[varNames.color.skeleton.to]: `color-mix(in srgb, transparent, ${vars.color.muted.fg} 10%)`,
|
|
2173
2259
|
backgroundColor: vars.color.skeleton.from,
|
|
2174
2260
|
backgroundPosition: "100%",
|
|
2175
2261
|
backgroundSize: "200% 100%",
|
|
@@ -2179,7 +2265,7 @@ const widthStyle = {
|
|
|
2179
2265
|
"@nest": {
|
|
2180
2266
|
"&[data-animated]": {
|
|
2181
2267
|
backgroundImage: ["linear-gradient(to right", vars.color.skeleton.from, vars.color.skeleton.to, vars.color.skeleton.from, vars.color.skeleton.from, vars.color.skeleton.from, ")"].join(", "),
|
|
2182
|
-
animationName:
|
|
2268
|
+
animationName: KEYFRAMES_PULSE,
|
|
2183
2269
|
animationTimingFunction: "ease-in-out",
|
|
2184
2270
|
animationIterationCount: "infinite",
|
|
2185
2271
|
animationDuration: "2000ms"
|
|
@@ -2334,8 +2420,13 @@ const skeletonStyle = {
|
|
|
2334
2420
|
}
|
|
2335
2421
|
}
|
|
2336
2422
|
},
|
|
2423
|
+
".arrow-stroke-mask": {
|
|
2424
|
+
// @ts-expect-error `y` is not a valid property in 'csstype'
|
|
2425
|
+
y: vars.shadow.outline
|
|
2426
|
+
},
|
|
2337
2427
|
".arrow-stroke": {
|
|
2338
|
-
stroke: vars.color.shadow.outline
|
|
2428
|
+
stroke: vars.color.shadow.outline,
|
|
2429
|
+
strokeWidth: `calc(${vars.card.shadow.outline} * 2)`
|
|
2339
2430
|
},
|
|
2340
2431
|
".arrow-shape": {
|
|
2341
2432
|
fill: vars.color.bg
|
|
@@ -2480,9 +2571,9 @@ const _inputStyle = {
|
|
|
2480
2571
|
".selectable": {
|
|
2481
2572
|
backgroundColor: vars.color.bg,
|
|
2482
2573
|
color: vars.color.fg,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2574
|
+
[varNames.color.bg]: vars.color.tinted.bg[0],
|
|
2575
|
+
[varNames.color.border]: vars.color.tinted.border[2],
|
|
2576
|
+
[varNames.color.fg]: vars.color.tinted.fg[2],
|
|
2486
2577
|
"@nest": {
|
|
2487
2578
|
"&:is(button)": {
|
|
2488
2579
|
WebkitFontSmoothing: "inherit",
|
|
@@ -2508,32 +2599,32 @@ const _inputStyle = {
|
|
|
2508
2599
|
// cursor: 'pointer',
|
|
2509
2600
|
},
|
|
2510
2601
|
"&:not([data-disabled]):hover": {
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2602
|
+
[varNames.color.bg]: vars.color.tinted.bg[1],
|
|
2603
|
+
[varNames.color.border]: vars.color.tinted.border[3],
|
|
2604
|
+
[varNames.color.fg]: vars.color.tinted.fg[1],
|
|
2605
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[2],
|
|
2606
|
+
[varNames.color.muted.fg]: vars.color.tinted.fg[4]
|
|
2516
2607
|
},
|
|
2517
2608
|
'&:not([data-disabled]):active, &:not([data-disabled])[aria-pressed="true"], &:not([data-disabled])[data-pressed]': {
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2609
|
+
[varNames.color.bg]: vars.color.tinted.bg[2],
|
|
2610
|
+
[varNames.color.border]: vars.color.tinted.border[4],
|
|
2611
|
+
[varNames.color.fg]: vars.color.tinted.fg[0],
|
|
2612
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[3],
|
|
2613
|
+
[varNames.color.muted.fg]: vars.color.tinted.fg[4]
|
|
2523
2614
|
},
|
|
2524
2615
|
"&:not([data-disabled]):focus": {
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2616
|
+
[varNames.color.bg]: vars.color.solid.primary.bg[0],
|
|
2617
|
+
[varNames.color.border]: vars.color.solid.primary.border[1],
|
|
2618
|
+
[varNames.color.fg]: vars.color.solid.primary.fg[0],
|
|
2619
|
+
[varNames.color.muted.bg]: vars.color.solid.primary.bg[1],
|
|
2620
|
+
[varNames.color.muted.fg]: vars.color.solid.primary.fg[3]
|
|
2530
2621
|
},
|
|
2531
2622
|
"&[data-disabled]": {
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2623
|
+
[varNames.color.bg]: vars.color.tinted.bg[0],
|
|
2624
|
+
[varNames.color.border]: vars.color.tinted.border[1],
|
|
2625
|
+
[varNames.color.fg]: vars.color.tinted.border[4],
|
|
2626
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[1],
|
|
2627
|
+
[varNames.color.muted.fg]: vars.color.tinted.border[4]
|
|
2537
2628
|
}
|
|
2538
2629
|
}
|
|
2539
2630
|
}
|
|
@@ -2854,11 +2945,22 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2854
2945
|
[varNames.color.muted.fg]: solid.fg[4]
|
|
2855
2946
|
},
|
|
2856
2947
|
"&[data-disabled]": {
|
|
2857
|
-
[varNames.color.bg]: vars.color.default.
|
|
2858
|
-
[varNames.color.
|
|
2859
|
-
[varNames.color.
|
|
2860
|
-
[varNames.color.
|
|
2861
|
-
[varNames.color.
|
|
2948
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[3],
|
|
2949
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[3],
|
|
2950
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[3],
|
|
2951
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[3],
|
|
2952
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[3],
|
|
2953
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[3],
|
|
2954
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[3],
|
|
2955
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[3],
|
|
2956
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[3],
|
|
2957
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[1],
|
|
2958
|
+
[varNames.color.border]: vars.color.tinted.default.border[1],
|
|
2959
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[2],
|
|
2960
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[4],
|
|
2961
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
2962
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[2],
|
|
2963
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[4]
|
|
2862
2964
|
}
|
|
2863
2965
|
}
|
|
2864
2966
|
}, primitive$j[`.button.${variantMap.ghost}.${toneMap$1[tone]}`] = {
|
|
@@ -2894,11 +2996,22 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2894
2996
|
"--button-box-shadow": "inset 0 0 0 var(--button-border-width) var(--color-border)"
|
|
2895
2997
|
},
|
|
2896
2998
|
"&[data-disabled]": {
|
|
2897
|
-
[varNames.color.bg]: vars.color.default.
|
|
2898
|
-
[varNames.color.
|
|
2899
|
-
[varNames.color.
|
|
2900
|
-
[varNames.color.
|
|
2901
|
-
[varNames.color.
|
|
2999
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[2],
|
|
3000
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[2],
|
|
3001
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[2],
|
|
3002
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[2],
|
|
3003
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[2],
|
|
3004
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[2],
|
|
3005
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[2],
|
|
3006
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[2],
|
|
3007
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[2],
|
|
3008
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
3009
|
+
[varNames.color.border]: vars.color.tinted.default.border[0],
|
|
3010
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[1],
|
|
3011
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[3],
|
|
3012
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
3013
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
3014
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
2902
3015
|
}
|
|
2903
3016
|
}
|
|
2904
3017
|
}, primitive$j[`.button.${variantMap.bleed}.${toneMap$1[tone]}`] = {
|
|
@@ -2932,11 +3045,22 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2932
3045
|
[varNames.color.muted.fg]: tinted.fg[3]
|
|
2933
3046
|
},
|
|
2934
3047
|
"&[data-disabled]": {
|
|
2935
|
-
[varNames.color.bg]: vars.color.default.
|
|
2936
|
-
[varNames.color.
|
|
2937
|
-
[varNames.color.
|
|
2938
|
-
[varNames.color.
|
|
2939
|
-
[varNames.color.
|
|
3048
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[2],
|
|
3049
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[2],
|
|
3050
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[2],
|
|
3051
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[2],
|
|
3052
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[2],
|
|
3053
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[2],
|
|
3054
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[2],
|
|
3055
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[2],
|
|
3056
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[2],
|
|
3057
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
3058
|
+
[varNames.color.border]: vars.color.tinted.default.border[0],
|
|
3059
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[1],
|
|
3060
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[3],
|
|
3061
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
3062
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
3063
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
2940
3064
|
}
|
|
2941
3065
|
}
|
|
2942
3066
|
};
|
|
@@ -3029,7 +3153,7 @@ const buttonStyle = {
|
|
|
3029
3153
|
// '--color-muted-bg': vars.color.solid.bg[1],
|
|
3030
3154
|
// '--color-muted-fg': vars.color.solid.fg[3],
|
|
3031
3155
|
// },
|
|
3032
|
-
"a&[data-disabled]
|
|
3156
|
+
"a&[data-disabled], button&[data-disabled]": {
|
|
3033
3157
|
[varNames.color.bg]: vars.color.tinted.default.bg[2],
|
|
3034
3158
|
[varNames.color.border]: vars.color.tinted.default.border[4],
|
|
3035
3159
|
[varNames.color.fg]: vars.color.tinted.default.fg[0],
|
|
@@ -3908,115 +4032,115 @@ const textStyle = {
|
|
|
3908
4032
|
_prefix: !1,
|
|
3909
4033
|
"@nest": {
|
|
3910
4034
|
"&.atrule": {
|
|
3911
|
-
color:
|
|
4035
|
+
color: vars.color.code.token.atrule
|
|
3912
4036
|
},
|
|
3913
4037
|
"&.attr-name": {
|
|
3914
|
-
color:
|
|
4038
|
+
color: vars.color.code.token.attrName
|
|
3915
4039
|
},
|
|
3916
4040
|
"&.attr-value": {
|
|
3917
|
-
color:
|
|
4041
|
+
color: vars.color.code.token.attrValue
|
|
3918
4042
|
},
|
|
3919
4043
|
"&.attribute": {
|
|
3920
|
-
color:
|
|
4044
|
+
color: vars.color.code.token.attribute
|
|
3921
4045
|
},
|
|
3922
4046
|
"&.boolean": {
|
|
3923
|
-
color:
|
|
4047
|
+
color: vars.color.code.token.boolean
|
|
3924
4048
|
},
|
|
3925
4049
|
"&.builtin": {
|
|
3926
|
-
color:
|
|
4050
|
+
color: vars.color.code.token.builtin
|
|
3927
4051
|
},
|
|
3928
4052
|
"&.cdata": {
|
|
3929
|
-
color:
|
|
4053
|
+
color: vars.color.code.token.cdata
|
|
3930
4054
|
},
|
|
3931
4055
|
"&.char": {
|
|
3932
|
-
color:
|
|
4056
|
+
color: vars.color.code.token.char
|
|
3933
4057
|
},
|
|
3934
4058
|
"&.class": {
|
|
3935
|
-
color:
|
|
4059
|
+
color: vars.color.code.token.class
|
|
3936
4060
|
},
|
|
3937
4061
|
"&.class-name": {
|
|
3938
|
-
color:
|
|
4062
|
+
color: vars.color.code.token.className
|
|
3939
4063
|
},
|
|
3940
4064
|
"&.comment": {
|
|
3941
|
-
color:
|
|
4065
|
+
color: vars.color.code.token.comment
|
|
3942
4066
|
},
|
|
3943
4067
|
"&.constant": {
|
|
3944
|
-
color:
|
|
4068
|
+
color: vars.color.code.token.constant
|
|
3945
4069
|
},
|
|
3946
4070
|
"&.deleted": {
|
|
3947
|
-
color:
|
|
4071
|
+
color: vars.color.code.token.deleted
|
|
3948
4072
|
},
|
|
3949
4073
|
"&.doctype": {
|
|
3950
|
-
color:
|
|
4074
|
+
color: vars.color.code.token.doctype
|
|
3951
4075
|
},
|
|
3952
4076
|
"&.entity": {
|
|
3953
|
-
color:
|
|
4077
|
+
color: vars.color.code.token.entity
|
|
3954
4078
|
},
|
|
3955
4079
|
"&.function": {
|
|
3956
|
-
color:
|
|
4080
|
+
color: vars.color.code.token.function
|
|
3957
4081
|
},
|
|
3958
4082
|
"&.hexcode": {
|
|
3959
|
-
color:
|
|
4083
|
+
color: vars.color.code.token.hexcode
|
|
3960
4084
|
},
|
|
3961
4085
|
"&.id": {
|
|
3962
|
-
color:
|
|
4086
|
+
color: vars.color.code.token.id
|
|
3963
4087
|
},
|
|
3964
4088
|
"&.important": {
|
|
3965
|
-
color:
|
|
4089
|
+
color: vars.color.code.token.important
|
|
3966
4090
|
},
|
|
3967
4091
|
"&.inserted": {
|
|
3968
|
-
color:
|
|
4092
|
+
color: vars.color.code.token.inserted
|
|
3969
4093
|
},
|
|
3970
4094
|
"&.keyword": {
|
|
3971
|
-
color:
|
|
4095
|
+
color: vars.color.code.token.keyword
|
|
3972
4096
|
},
|
|
3973
4097
|
"&.number": {
|
|
3974
|
-
color:
|
|
4098
|
+
color: vars.color.code.token.number
|
|
3975
4099
|
},
|
|
3976
4100
|
"&.operator": {
|
|
3977
|
-
color:
|
|
4101
|
+
color: vars.color.code.token.operator
|
|
3978
4102
|
},
|
|
3979
4103
|
"&.prolog": {
|
|
3980
|
-
color:
|
|
4104
|
+
color: vars.color.code.token.prolog
|
|
3981
4105
|
},
|
|
3982
4106
|
"&.property": {
|
|
3983
|
-
color:
|
|
4107
|
+
color: vars.color.code.token.property
|
|
3984
4108
|
},
|
|
3985
4109
|
"&.pseudo-class": {
|
|
3986
|
-
color:
|
|
4110
|
+
color: vars.color.code.token.pseudoClass
|
|
3987
4111
|
},
|
|
3988
4112
|
"&.pseudo-element": {
|
|
3989
|
-
color:
|
|
4113
|
+
color: vars.color.code.token.pseudoElement
|
|
3990
4114
|
},
|
|
3991
4115
|
"&.punctuation": {
|
|
3992
|
-
color:
|
|
4116
|
+
color: vars.color.code.token.punctuation
|
|
3993
4117
|
},
|
|
3994
4118
|
"&.attr-value &:not(.attr-equals).punctuation": {
|
|
3995
4119
|
color: "inherit"
|
|
3996
4120
|
},
|
|
3997
4121
|
"&.regex": {
|
|
3998
|
-
color:
|
|
4122
|
+
color: vars.color.code.token.regex
|
|
3999
4123
|
},
|
|
4000
4124
|
"&.selector": {
|
|
4001
|
-
color:
|
|
4125
|
+
color: vars.color.code.token.selector
|
|
4002
4126
|
},
|
|
4003
4127
|
"&.string": {
|
|
4004
|
-
color:
|
|
4128
|
+
color: vars.color.code.token.string
|
|
4005
4129
|
},
|
|
4006
4130
|
"&.symbol": {
|
|
4007
|
-
color:
|
|
4131
|
+
color: vars.color.code.token.symbol
|
|
4008
4132
|
},
|
|
4009
4133
|
"&.tag": {
|
|
4010
|
-
color:
|
|
4134
|
+
color: vars.color.code.token.tag
|
|
4011
4135
|
},
|
|
4012
4136
|
"&.unit": {
|
|
4013
|
-
color:
|
|
4137
|
+
color: vars.color.code.token.unit
|
|
4014
4138
|
},
|
|
4015
4139
|
"&.url": {
|
|
4016
|
-
color:
|
|
4140
|
+
color: vars.color.code.token.url
|
|
4017
4141
|
},
|
|
4018
4142
|
"&.variable": {
|
|
4019
|
-
color:
|
|
4143
|
+
color: vars.color.code.token.variable
|
|
4020
4144
|
}
|
|
4021
4145
|
}
|
|
4022
4146
|
}
|
|
@@ -4244,6 +4368,7 @@ function toSnakeCase(str) {
|
|
|
4244
4368
|
function compileSystem() {
|
|
4245
4369
|
return compileStyle(systemStyle);
|
|
4246
4370
|
}
|
|
4371
|
+
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4247
4372
|
function compileTheme_v3(theme) {
|
|
4248
4373
|
return compileRule(":root", compileThemeProperties(theme), {
|
|
4249
4374
|
keyframes: {},
|
|
@@ -4254,6 +4379,7 @@ function compileThemeProperties(theme) {
|
|
|
4254
4379
|
return {
|
|
4255
4380
|
...buildAvatarThemeProperties(theme),
|
|
4256
4381
|
...buildButtonThemeProperties(theme),
|
|
4382
|
+
[varNames.card.shadow.outline]: px(theme.card.shadow.outline),
|
|
4257
4383
|
...buildContainerThemeProperties(theme),
|
|
4258
4384
|
...buildFontCodeThemeProperties(theme),
|
|
4259
4385
|
...buildFontHeadingThemeProperties(theme),
|
|
@@ -4268,161 +4394,166 @@ function compileThemeProperties(theme) {
|
|
|
4268
4394
|
}
|
|
4269
4395
|
function buildAvatarThemeProperties(theme) {
|
|
4270
4396
|
return {
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4397
|
+
[varNames.avatar.focusRing.offset]: px(theme.avatar.focusRing.offset),
|
|
4398
|
+
[varNames.avatar.focusRing.width]: px(theme.avatar.focusRing.width),
|
|
4399
|
+
[varNames.avatar.sizes[0].distance]: px(theme.avatar.sizes[0].distance),
|
|
4400
|
+
[varNames.avatar.sizes[0].size]: px(theme.avatar.sizes[0].size),
|
|
4401
|
+
[varNames.avatar.sizes[1].distance]: px(theme.avatar.sizes[1].distance),
|
|
4402
|
+
[varNames.avatar.sizes[1].size]: px(theme.avatar.sizes[1].size),
|
|
4403
|
+
[varNames.avatar.sizes[2].distance]: px(theme.avatar.sizes[2].distance),
|
|
4404
|
+
[varNames.avatar.sizes[2].size]: px(theme.avatar.sizes[2].size),
|
|
4405
|
+
[varNames.avatar.sizes[3].distance]: px(theme.avatar.sizes[3].distance),
|
|
4406
|
+
[varNames.avatar.sizes[3].size]: px(theme.avatar.sizes[3].size)
|
|
4281
4407
|
};
|
|
4282
4408
|
}
|
|
4283
4409
|
function buildButtonThemeProperties(theme) {
|
|
4284
4410
|
return {
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
// [`--button-text-weight`]: theme.button.textWeight,
|
|
4411
|
+
[varNames.button.border.width]: px(theme.button.border.width),
|
|
4412
|
+
[varNames.button.focusRing.offset]: px(theme.button.focusRing.offset),
|
|
4413
|
+
[varNames.button.focusRing.width]: px(theme.button.focusRing.width)
|
|
4289
4414
|
};
|
|
4290
4415
|
}
|
|
4291
4416
|
function buildContainerThemeProperties(theme) {
|
|
4292
4417
|
return {
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4418
|
+
[varNames.container[0]]: px(theme.container[0]),
|
|
4419
|
+
[varNames.container[1]]: px(theme.container[1]),
|
|
4420
|
+
[varNames.container[2]]: px(theme.container[2]),
|
|
4421
|
+
[varNames.container[3]]: px(theme.container[3]),
|
|
4422
|
+
[varNames.container[4]]: px(theme.container[4]),
|
|
4423
|
+
[varNames.container[5]]: px(theme.container[5])
|
|
4299
4424
|
};
|
|
4300
4425
|
}
|
|
4301
4426
|
function buildFontCodeThemeProperties(theme) {
|
|
4302
4427
|
const props = {
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4428
|
+
[varNames.font.code.family]: theme.font.code.family,
|
|
4429
|
+
[varNames.font.code.featureSettings]: theme.font.code.featureSettings,
|
|
4430
|
+
[varNames.font.code.weights.regular]: `${theme.font.code.weights.regular}`,
|
|
4431
|
+
[varNames.font.code.weights.medium]: `${theme.font.code.weights.medium}`,
|
|
4432
|
+
[varNames.font.code.weights.semibold]: `${theme.font.code.weights.semibold}`,
|
|
4433
|
+
[varNames.font.code.weights.bold]: `${theme.font.code.weights.bold}`
|
|
4309
4434
|
};
|
|
4310
|
-
for (const size of FONT_CODE_SIZE)
|
|
4311
|
-
|
|
4435
|
+
for (const size of FONT_CODE_SIZE) {
|
|
4436
|
+
const v = varNames.font.code.sizes[size], t = theme.font.code.sizes[size];
|
|
4437
|
+
props[v.fontSize] = rem(t.fontSize), props[v.lineHeight] = rem(t.lineHeight), props[v.ascenderHeight] = px(t.ascenderHeight), props[v.descenderHeight] = px(t.descenderHeight), props[v.letterSpacing] = px(t.letterSpacing), props[v.iconSize] = px(t.iconSize);
|
|
4438
|
+
}
|
|
4312
4439
|
return props;
|
|
4313
4440
|
}
|
|
4314
4441
|
function buildFontHeadingThemeProperties(theme) {
|
|
4315
4442
|
const props = {
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4443
|
+
[varNames.font.heading.family]: theme.font.heading.family,
|
|
4444
|
+
[varNames.font.heading.featureSettings]: theme.font.heading.featureSettings,
|
|
4445
|
+
[varNames.font.heading.weights.regular]: `${theme.font.heading.weights.regular}`,
|
|
4446
|
+
[varNames.font.heading.weights.medium]: `${theme.font.heading.weights.medium}`,
|
|
4447
|
+
[varNames.font.heading.weights.semibold]: `${theme.font.heading.weights.semibold}`,
|
|
4448
|
+
[varNames.font.heading.weights.bold]: `${theme.font.heading.weights.bold}`
|
|
4322
4449
|
};
|
|
4323
|
-
for (const size of FONT_HEADING_SIZE)
|
|
4324
|
-
|
|
4450
|
+
for (const size of FONT_HEADING_SIZE) {
|
|
4451
|
+
const v = varNames.font.heading.sizes[size], t = theme.font.heading.sizes[size];
|
|
4452
|
+
props[v.fontSize] = rem(t.fontSize), props[v.lineHeight] = rem(t.lineHeight), props[v.ascenderHeight] = px(t.ascenderHeight), props[v.descenderHeight] = px(t.descenderHeight), props[v.letterSpacing] = px(t.letterSpacing), props[v.iconSize] = px(t.iconSize);
|
|
4453
|
+
}
|
|
4325
4454
|
return props;
|
|
4326
4455
|
}
|
|
4327
4456
|
function buildFontLabelThemeProperties(theme) {
|
|
4328
4457
|
const props = {
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4458
|
+
[varNames.font.label.family]: theme.font.label.family,
|
|
4459
|
+
[varNames.font.label.featureSettings]: theme.font.label.featureSettings,
|
|
4460
|
+
[varNames.font.label.weights.regular]: `${theme.font.label.weights.regular}`,
|
|
4461
|
+
[varNames.font.label.weights.medium]: `${theme.font.label.weights.medium}`,
|
|
4462
|
+
[varNames.font.label.weights.semibold]: `${theme.font.label.weights.semibold}`,
|
|
4463
|
+
[varNames.font.label.weights.bold]: `${theme.font.label.weights.bold}`
|
|
4335
4464
|
};
|
|
4336
|
-
for (const size of FONT_LABEL_SIZE)
|
|
4337
|
-
|
|
4465
|
+
for (const size of FONT_LABEL_SIZE) {
|
|
4466
|
+
const v = varNames.font.label.sizes[size], t = theme.font.label.sizes[size];
|
|
4467
|
+
props[v.fontSize] = rem(t.fontSize), props[v.lineHeight] = rem(t.lineHeight), props[v.ascenderHeight] = px(t.ascenderHeight), props[v.descenderHeight] = px(t.descenderHeight), props[v.letterSpacing] = px(t.letterSpacing), props[v.iconSize] = px(t.iconSize);
|
|
4468
|
+
}
|
|
4338
4469
|
return props;
|
|
4339
4470
|
}
|
|
4340
4471
|
function buildFontTextThemeProperties(theme) {
|
|
4341
4472
|
const props = {
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4473
|
+
[varNames.font.text.family]: theme.font.text.family,
|
|
4474
|
+
[varNames.font.text.featureSettings]: theme.font.text.featureSettings,
|
|
4475
|
+
[varNames.font.text.weights.regular]: `${theme.font.text.weights.regular}`,
|
|
4476
|
+
[varNames.font.text.weights.medium]: `${theme.font.text.weights.medium}`,
|
|
4477
|
+
[varNames.font.text.weights.semibold]: `${theme.font.text.weights.semibold}`,
|
|
4478
|
+
[varNames.font.text.weights.bold]: `${theme.font.text.weights.bold}`
|
|
4348
4479
|
};
|
|
4349
|
-
for (const size of FONT_TEXT_SIZE)
|
|
4350
|
-
|
|
4480
|
+
for (const size of FONT_TEXT_SIZE) {
|
|
4481
|
+
const v = varNames.font.text.sizes[size], t = theme.font.text.sizes[size];
|
|
4482
|
+
props[v.fontSize] = rem(t.fontSize), props[v.lineHeight] = rem(t.lineHeight), props[v.ascenderHeight] = px(t.ascenderHeight), props[v.descenderHeight] = px(t.descenderHeight), props[v.letterSpacing] = px(t.letterSpacing), props[v.iconSize] = px(t.iconSize);
|
|
4483
|
+
}
|
|
4351
4484
|
return props;
|
|
4352
4485
|
}
|
|
4353
4486
|
function buildInputThemeProperties(theme) {
|
|
4354
4487
|
return {
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4488
|
+
[varNames.input.border.width]: px(theme.input.border.width),
|
|
4489
|
+
[varNames.input.checkbox.focusRing.offset]: px(theme.input.checkbox.focusRing.offset),
|
|
4490
|
+
[varNames.input.checkbox.focusRing.width]: px(theme.input.checkbox.focusRing.width),
|
|
4491
|
+
[varNames.input.checkbox.size]: px(theme.input.checkbox.size),
|
|
4492
|
+
[varNames.input.radio.focusRing.offset]: px(theme.input.radio.focusRing.offset),
|
|
4493
|
+
[varNames.input.radio.focusRing.width]: px(theme.input.radio.focusRing.width),
|
|
4494
|
+
[varNames.input.radio.markSize]: px(theme.input.radio.markSize),
|
|
4495
|
+
[varNames.input.radio.size]: px(theme.input.radio.size),
|
|
4496
|
+
[varNames.input.select.focusRing.offset]: px(theme.input.select.focusRing.offset),
|
|
4497
|
+
[varNames.input.select.focusRing.width]: px(theme.input.select.focusRing.width),
|
|
4498
|
+
[varNames.input.switch.focusRing.offset]: px(theme.input.switch.focusRing.offset),
|
|
4499
|
+
[varNames.input.switch.focusRing.width]: px(theme.input.switch.focusRing.width),
|
|
4500
|
+
[varNames.input.switch.height]: px(theme.input.switch.height),
|
|
4501
|
+
[varNames.input.switch.padding]: px(theme.input.switch.padding),
|
|
4502
|
+
[varNames.input.switch.transitionDurationMs]: `${theme.input.switch.transitionDurationMs}ms`,
|
|
4503
|
+
[varNames.input.switch.transitionTimingFunction]: theme.input.switch.transitionTimingFunction,
|
|
4504
|
+
[varNames.input.switch.width]: px(theme.input.switch.width),
|
|
4505
|
+
[varNames.input.text.focusRing.offset]: px(theme.input.text.focusRing.offset),
|
|
4506
|
+
[varNames.input.text.focusRing.width]: px(theme.input.text.focusRing.width)
|
|
4374
4507
|
};
|
|
4375
4508
|
}
|
|
4376
4509
|
function buildRadiusThemeProperties(theme) {
|
|
4377
4510
|
return {
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4511
|
+
[varNames.radius[0]]: rem(theme.radius[0]),
|
|
4512
|
+
[varNames.radius[1]]: rem(theme.radius[1]),
|
|
4513
|
+
[varNames.radius[2]]: rem(theme.radius[2]),
|
|
4514
|
+
[varNames.radius[3]]: rem(theme.radius[3]),
|
|
4515
|
+
[varNames.radius[4]]: rem(theme.radius[4]),
|
|
4516
|
+
[varNames.radius[5]]: rem(theme.radius[5]),
|
|
4517
|
+
[varNames.radius[6]]: rem(theme.radius[6])
|
|
4385
4518
|
};
|
|
4386
4519
|
}
|
|
4387
4520
|
function buildShadowThemeProperties(theme) {
|
|
4388
4521
|
return {
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
"--shadow-5-ambient": toBoxShadow(theme.shadow[5]?.ambient)
|
|
4522
|
+
[varNames.shadow[0].umbra]: toBoxShadow(theme.shadow[0]?.umbra),
|
|
4523
|
+
[varNames.shadow[0].penumbra]: toBoxShadow(theme.shadow[0]?.penumbra),
|
|
4524
|
+
[varNames.shadow[0].ambient]: toBoxShadow(theme.shadow[0]?.ambient),
|
|
4525
|
+
[varNames.shadow[1].umbra]: toBoxShadow(theme.shadow[1]?.umbra),
|
|
4526
|
+
[varNames.shadow[1].penumbra]: toBoxShadow(theme.shadow[1]?.penumbra),
|
|
4527
|
+
[varNames.shadow[1].ambient]: toBoxShadow(theme.shadow[1]?.ambient),
|
|
4528
|
+
[varNames.shadow[2].umbra]: toBoxShadow(theme.shadow[2]?.umbra),
|
|
4529
|
+
[varNames.shadow[2].penumbra]: toBoxShadow(theme.shadow[2]?.penumbra),
|
|
4530
|
+
[varNames.shadow[2].ambient]: toBoxShadow(theme.shadow[2]?.ambient),
|
|
4531
|
+
[varNames.shadow[3].umbra]: toBoxShadow(theme.shadow[3]?.umbra),
|
|
4532
|
+
[varNames.shadow[3].penumbra]: toBoxShadow(theme.shadow[3]?.penumbra),
|
|
4533
|
+
[varNames.shadow[3].ambient]: toBoxShadow(theme.shadow[3]?.ambient),
|
|
4534
|
+
[varNames.shadow[4].umbra]: toBoxShadow(theme.shadow[4]?.umbra),
|
|
4535
|
+
[varNames.shadow[4].penumbra]: toBoxShadow(theme.shadow[4]?.penumbra),
|
|
4536
|
+
[varNames.shadow[4].ambient]: toBoxShadow(theme.shadow[4]?.ambient),
|
|
4537
|
+
[varNames.shadow[5].umbra]: toBoxShadow(theme.shadow[5]?.umbra),
|
|
4538
|
+
[varNames.shadow[5].penumbra]: toBoxShadow(theme.shadow[5]?.penumbra),
|
|
4539
|
+
[varNames.shadow[5].ambient]: toBoxShadow(theme.shadow[5]?.ambient)
|
|
4408
4540
|
};
|
|
4409
4541
|
}
|
|
4410
4542
|
function buildSpaceThemeProperties(theme) {
|
|
4411
4543
|
return {
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4544
|
+
[varNames.space[0]]: rem(theme.space[0]),
|
|
4545
|
+
[varNames.space[0.5]]: rem(theme.space[1] / 2),
|
|
4546
|
+
[varNames.space[1]]: rem(theme.space[1]),
|
|
4547
|
+
[varNames.space[2]]: rem(theme.space[2]),
|
|
4548
|
+
[varNames.space[3]]: rem(theme.space[3]),
|
|
4549
|
+
[varNames.space[4]]: rem(theme.space[4]),
|
|
4550
|
+
[varNames.space[5]]: rem(theme.space[5]),
|
|
4551
|
+
[varNames.space[6]]: rem(theme.space[6]),
|
|
4552
|
+
[varNames.space[7]]: rem(theme.space[7]),
|
|
4553
|
+
[varNames.space[8]]: rem(theme.space[8]),
|
|
4554
|
+
[varNames.space[9]]: rem(theme.space[9])
|
|
4423
4555
|
};
|
|
4424
4556
|
}
|
|
4425
|
-
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4426
4557
|
function buildColorThemeProperties(theme) {
|
|
4427
4558
|
const props = {};
|
|
4428
4559
|
for (const scheme of THEME_COLOR_SCHEMES)
|
|
@@ -4436,27 +4567,27 @@ function buildColorThemeProperties(theme) {
|
|
|
4436
4567
|
}));
|
|
4437
4568
|
for (const colorVariant of THEME_COLOR_VARIANTS)
|
|
4438
4569
|
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
4439
|
-
const
|
|
4440
|
-
bgVar:
|
|
4441
|
-
hue:
|
|
4570
|
+
const v = varNames.color[scheme][cardTone][colorVariant][elementTone], t = theme._tokens.color[cardTone].variant[colorVariant][elementTone], context = {
|
|
4571
|
+
bgVar: v.bg[0],
|
|
4572
|
+
hue: t._hue,
|
|
4442
4573
|
scheme
|
|
4443
4574
|
};
|
|
4444
4575
|
Object.assign(props, {
|
|
4445
|
-
[
|
|
4446
|
-
[
|
|
4447
|
-
[
|
|
4448
|
-
[
|
|
4449
|
-
[
|
|
4450
|
-
[
|
|
4451
|
-
[
|
|
4452
|
-
[
|
|
4453
|
-
[
|
|
4454
|
-
[
|
|
4455
|
-
[
|
|
4456
|
-
[
|
|
4457
|
-
[
|
|
4458
|
-
[
|
|
4459
|
-
[
|
|
4576
|
+
[v.bg[0]]: renderColor(t.bg[0], context),
|
|
4577
|
+
[v.bg[1]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 25%)`,
|
|
4578
|
+
[v.bg[2]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 50%)`,
|
|
4579
|
+
[v.bg[3]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 75%)`,
|
|
4580
|
+
[v.bg[4]]: renderColor(t.bg[4], context),
|
|
4581
|
+
[v.border[0]]: renderColor(t.border[0], context),
|
|
4582
|
+
[v.border[1]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 25%)`,
|
|
4583
|
+
[v.border[2]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 50%)`,
|
|
4584
|
+
[v.border[3]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 75%)`,
|
|
4585
|
+
[v.border[4]]: renderColor(t.border[4], context),
|
|
4586
|
+
[v.fg[0]]: renderColor(t.fg[0], context),
|
|
4587
|
+
[v.fg[1]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 25%)`,
|
|
4588
|
+
[v.fg[2]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 50%)`,
|
|
4589
|
+
[v.fg[3]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 75%)`,
|
|
4590
|
+
[v.fg[4]]: renderColor(t.fg[4], context)
|
|
4460
4591
|
});
|
|
4461
4592
|
}
|
|
4462
4593
|
}
|
|
@@ -4466,16 +4597,16 @@ function buildColorAvatarThemeProperties(theme, options) {
|
|
|
4466
4597
|
const {
|
|
4467
4598
|
scheme,
|
|
4468
4599
|
cardTone
|
|
4469
|
-
} = options,
|
|
4600
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme._tokens.color[cardTone], props = {};
|
|
4470
4601
|
for (const hue of HUES) {
|
|
4471
4602
|
const context = {
|
|
4472
|
-
bgVar:
|
|
4473
|
-
hue:
|
|
4603
|
+
bgVar: varNames.color.bg,
|
|
4604
|
+
hue: t.avatar[hue]._hue ?? hue,
|
|
4474
4605
|
scheme
|
|
4475
4606
|
};
|
|
4476
4607
|
Object.assign(props, {
|
|
4477
|
-
[
|
|
4478
|
-
[
|
|
4608
|
+
[v.avatar[hue].bg]: renderColor(t.avatar[hue].bg, context),
|
|
4609
|
+
[v.avatar[hue].fg]: renderColor(t.avatar[hue].fg, context)
|
|
4479
4610
|
});
|
|
4480
4611
|
}
|
|
4481
4612
|
return props;
|
|
@@ -4484,63 +4615,63 @@ function buildColorCardThemeProperties(theme, options) {
|
|
|
4484
4615
|
const {
|
|
4485
4616
|
scheme,
|
|
4486
4617
|
cardTone
|
|
4487
|
-
} = options,
|
|
4488
|
-
bgVar:
|
|
4489
|
-
hue:
|
|
4618
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme._tokens.color[cardTone], context = {
|
|
4619
|
+
bgVar: varNames.color.bg,
|
|
4620
|
+
hue: t._hue,
|
|
4490
4621
|
scheme
|
|
4491
4622
|
};
|
|
4492
4623
|
return {
|
|
4493
4624
|
// backdrop
|
|
4494
|
-
[
|
|
4625
|
+
[v.backdrop]: renderColor(t.backdrop, context),
|
|
4495
4626
|
// code
|
|
4496
|
-
[
|
|
4497
|
-
[
|
|
4627
|
+
[v.code.bg]: renderColor(t.code.bg, context),
|
|
4628
|
+
[v.code.fg]: renderColor(t.code.fg, context),
|
|
4498
4629
|
// code / token
|
|
4499
|
-
[
|
|
4500
|
-
[
|
|
4501
|
-
[
|
|
4502
|
-
[
|
|
4503
|
-
[
|
|
4504
|
-
[
|
|
4505
|
-
[
|
|
4506
|
-
[
|
|
4507
|
-
[
|
|
4508
|
-
[
|
|
4509
|
-
[
|
|
4510
|
-
[
|
|
4511
|
-
[
|
|
4512
|
-
[
|
|
4513
|
-
[
|
|
4514
|
-
[
|
|
4515
|
-
[
|
|
4516
|
-
[
|
|
4517
|
-
[
|
|
4518
|
-
[
|
|
4519
|
-
[
|
|
4520
|
-
[
|
|
4521
|
-
[
|
|
4522
|
-
[
|
|
4523
|
-
[
|
|
4524
|
-
[
|
|
4525
|
-
[
|
|
4526
|
-
[
|
|
4527
|
-
[
|
|
4528
|
-
[
|
|
4529
|
-
[
|
|
4530
|
-
[
|
|
4531
|
-
[
|
|
4532
|
-
[
|
|
4533
|
-
[
|
|
4534
|
-
[
|
|
4630
|
+
[v.code.token.atrule]: renderColor(t.code.token.atrule, context),
|
|
4631
|
+
[v.code.token.attrName]: renderColor(t.code.token.attrName, context),
|
|
4632
|
+
[v.code.token.attrValue]: renderColor(t.code.token.attrValue, context),
|
|
4633
|
+
[v.code.token.attribute]: renderColor(t.code.token.attribute, context),
|
|
4634
|
+
[v.code.token.boolean]: renderColor(t.code.token.boolean, context),
|
|
4635
|
+
[v.code.token.builtin]: renderColor(t.code.token.builtin, context),
|
|
4636
|
+
[v.code.token.cdata]: renderColor(t.code.token.cdata, context),
|
|
4637
|
+
[v.code.token.char]: renderColor(t.code.token.char, context),
|
|
4638
|
+
[v.code.token.className]: renderColor(t.code.token.className, context),
|
|
4639
|
+
[v.code.token.class]: renderColor(t.code.token.class, context),
|
|
4640
|
+
[v.code.token.comment]: renderColor(t.code.token.comment, context),
|
|
4641
|
+
[v.code.token.constant]: renderColor(t.code.token.constant, context),
|
|
4642
|
+
[v.code.token.deleted]: renderColor(t.code.token.deleted, context),
|
|
4643
|
+
[v.code.token.doctype]: renderColor(t.code.token.doctype, context),
|
|
4644
|
+
[v.code.token.entity]: renderColor(t.code.token.entity, context),
|
|
4645
|
+
[v.code.token.function]: renderColor(t.code.token.function, context),
|
|
4646
|
+
[v.code.token.hexcode]: renderColor(t.code.token.hexcode, context),
|
|
4647
|
+
[v.code.token.id]: renderColor(t.code.token.id, context),
|
|
4648
|
+
[v.code.token.important]: renderColor(t.code.token.important, context),
|
|
4649
|
+
[v.code.token.inserted]: renderColor(t.code.token.inserted, context),
|
|
4650
|
+
[v.code.token.keyword]: renderColor(t.code.token.keyword, context),
|
|
4651
|
+
[v.code.token.number]: renderColor(t.code.token.number, context),
|
|
4652
|
+
[v.code.token.operator]: renderColor(t.code.token.operator, context),
|
|
4653
|
+
[v.code.token.prolog]: renderColor(t.code.token.prolog, context),
|
|
4654
|
+
[v.code.token.property]: renderColor(t.code.token.property, context),
|
|
4655
|
+
[v.code.token.pseudoClass]: renderColor(t.code.token.pseudoClass, context),
|
|
4656
|
+
[v.code.token.pseudoElement]: renderColor(t.code.token.pseudoElement, context),
|
|
4657
|
+
[v.code.token.punctuation]: renderColor(t.code.token.punctuation, context),
|
|
4658
|
+
[v.code.token.regex]: renderColor(t.code.token.regex, context),
|
|
4659
|
+
[v.code.token.selector]: renderColor(t.code.token.selector, context),
|
|
4660
|
+
[v.code.token.string]: renderColor(t.code.token.string, context),
|
|
4661
|
+
[v.code.token.symbol]: renderColor(t.code.token.symbol, context),
|
|
4662
|
+
[v.code.token.tag]: renderColor(t.code.token.tag, context),
|
|
4663
|
+
[v.code.token.unit]: renderColor(t.code.token.unit, context),
|
|
4664
|
+
[v.code.token.url]: renderColor(t.code.token.url, context),
|
|
4665
|
+
[v.code.token.variable]: renderColor(t.code.token.variable, context),
|
|
4535
4666
|
// focus ring
|
|
4536
|
-
[
|
|
4667
|
+
[v.focusRing]: renderColor(t.focusRing, context),
|
|
4537
4668
|
// link
|
|
4538
|
-
[
|
|
4669
|
+
[v.link.fg]: renderColor(t.link.fg, context),
|
|
4539
4670
|
// shadow
|
|
4540
|
-
[
|
|
4541
|
-
[
|
|
4542
|
-
[
|
|
4543
|
-
[
|
|
4671
|
+
[v.shadow.outline]: renderColor(t.shadow.outline, context),
|
|
4672
|
+
[v.shadow.umbra]: renderColor(t.shadow.umbra, context),
|
|
4673
|
+
[v.shadow.penumbra]: renderColor(t.shadow.penumbra, context),
|
|
4674
|
+
[v.shadow.ambient]: renderColor(t.shadow.ambient, context)
|
|
4544
4675
|
};
|
|
4545
4676
|
}
|
|
4546
4677
|
function compileTheme(theme) {
|
|
@@ -4619,6 +4750,9 @@ function _arrow() {
|
|
|
4619
4750
|
function _arrowStroke() {
|
|
4620
4751
|
return _comp("arrow-stroke");
|
|
4621
4752
|
}
|
|
4753
|
+
function _arrowStrokeMask() {
|
|
4754
|
+
return _comp("arrow-stroke-mask");
|
|
4755
|
+
}
|
|
4622
4756
|
function _arrowShape() {
|
|
4623
4757
|
return _comp("arrow-shape");
|
|
4624
4758
|
}
|
|
@@ -4776,9 +4910,12 @@ function srOnly() {
|
|
|
4776
4910
|
return composeClassNames("sr-only");
|
|
4777
4911
|
}
|
|
4778
4912
|
export {
|
|
4913
|
+
BREAKPOINTS,
|
|
4914
|
+
PREFIX,
|
|
4779
4915
|
_arrow,
|
|
4780
4916
|
_arrowShape,
|
|
4781
4917
|
_arrowStroke,
|
|
4918
|
+
_arrowStrokeMask,
|
|
4782
4919
|
_input,
|
|
4783
4920
|
_inputElement,
|
|
4784
4921
|
_inputPresentation,
|