@sanity/ui 3.0.0-static.16 → 3.0.0-static.18
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/README.md +2 -4
- package/bin/{ui.js → sanity-ui.cjs} +1 -1
- package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +6 -6
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
- package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +7 -7
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -0
- package/dist/_visual-editing.cjs +30 -0
- package/dist/_visual-editing.cjs.map +1 -0
- package/dist/_visual-editing.js +29 -29
- package/dist/_visual-editing.js.map +1 -1
- package/dist/{cli.js → cli.cjs} +4 -4
- package/dist/cli.cjs.map +1 -0
- package/dist/{css.mjs → css.cjs} +491 -499
- package/dist/css.cjs.map +1 -0
- package/dist/{css.d.mts → css.d.cts} +26 -26
- package/dist/css.d.ts +26 -26
- package/dist/css.js +491 -497
- package/dist/css.js.map +1 -1
- package/dist/{index.mjs → index.cjs} +368 -367
- package/dist/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/{index.d.mts → index.d.cts} +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +366 -367
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +219 -196
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +218 -195
- package/dist/theme.js.map +1 -1
- package/dist/{sanity-palette.css → ui-palette.css} +1 -1
- package/dist/ui-palette.min.css +1 -0
- package/dist/{system.css → ui-system.css} +258 -140
- package/dist/ui-system.min.css +1 -0
- package/dist/{sanity-theme.css → ui-theme.css} +199 -199
- package/dist/ui-theme.min.css +1 -0
- package/dist/ui.css +29152 -0
- package/dist/ui.min.css +1 -0
- package/package.json +20 -20
- package/src/cli/buildCommand.ts +55 -20
- package/src/cli/index.ts +1 -1
- package/src/core/StyleTags.tsx +4 -4
- package/src/core/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -18
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +9 -9
- package/src/core/primitives/button/__workshop__/custom.tsx +18 -41
- package/src/core/primitives/button/button.tsx +3 -1
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -9
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -1
- package/src/core/primitives/card/__workshop__/props.tsx +0 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +6 -37
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/heading/__workshop__/plain.tsx +1 -8
- package/src/core/primitives/label/__workshop__/plain.tsx +1 -9
- package/src/core/primitives/text/__workshop__/example.tsx +1 -9
- package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
- package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
- package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
- package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
- package/src/css/_system.style.ts +1 -0
- package/src/css/constants.ts +1 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/button/button.style.ts +23 -9
- package/src/css/primitives/button/button.ts +1 -12
- package/src/css/primitives/button/types.ts +1 -6
- package/src/css/primitives/card/card.style.ts +12 -21
- package/src/css/primitives/kbd/kbd.style.ts +3 -6
- package/src/css/types.ts +32 -27
- package/src/theme/v3/color/buildColor_v3.ts +53 -25
- package/src/theme/v3/color/card.ts +0 -42
- package/src/theme/v3/color/renderColor.test.ts +1 -0
- package/src/theme/v3/color/renderColor.ts +9 -2
- package/src/theme/v3/color/token.ts +1 -0
- package/src/theme/v3/defaultTokens.ts +7 -2
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/buildCommand.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_visual-editing.mjs +0 -30
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/css.mjs.map +0 -1
- package/dist/sanity-palette.min.css +0 -1
- package/dist/sanity-theme.min.css +0 -1
- package/dist/system.min.css +0 -1
- package/dist/theme.mjs.map +0 -1
- package/src/css/primitives/button/_constants.ts +0 -17
- /package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +0 -0
- /package/dist/{cli.d.ts → cli.d.cts} +0 -0
package/dist/{css.mjs → css.cjs}
RENAMED
|
@@ -1,83 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!(prop === void 0 || prop === !1))
|
|
5
|
-
return Array.isArray(prop) ? prop.map((value, index) => {
|
|
6
|
-
if (value === void 0 || typeof prop == "boolean" && prop === !1) return;
|
|
7
|
-
const className = (typeof value == "boolean" ? [prefix] : [prefix, value]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
8
|
-
return index === 0 ? className : `${index}:${className}`;
|
|
9
|
-
}).filter(Boolean).join(" ") : (typeof prop == "boolean" ? [prefix] : [prefix, prop]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
10
|
-
}
|
|
11
|
-
function _getClassNames(...classNames) {
|
|
12
|
-
return classNames.map((n) => typeof n == "string" && n.trim()).filter(Boolean).join(" ").split(" ");
|
|
13
|
-
}
|
|
14
|
-
function composeClassNames(...classNames) {
|
|
15
|
-
return unique(_getClassNames(...classNames)).join(" ") || void 0;
|
|
16
|
-
}
|
|
17
|
-
function unique(array) {
|
|
18
|
-
return Array.from(new Set(array));
|
|
19
|
-
}
|
|
20
|
-
function border(props) {
|
|
21
|
-
return composeClassNames(_resp("border", props.border), _resp("border-t", props.borderTop), _resp("border-r", props.borderRight), _resp("border-b", props.borderBottom), _resp("border-l", props.borderLeft));
|
|
22
|
-
}
|
|
23
|
-
function display(props) {
|
|
24
|
-
return composeClassNames(_resp(void 0, props.display));
|
|
25
|
-
}
|
|
26
|
-
function flex(props) {
|
|
27
|
-
return composeClassNames(_resp("flex-align", props.align), _resp("f", props.direction), _resp("flex-justify", props.justify), _resp("flex", props.wrap));
|
|
28
|
-
}
|
|
29
|
-
function flexItem(props) {
|
|
30
|
-
return composeClassNames(_resp("f", props.flex));
|
|
31
|
-
}
|
|
32
|
-
function font(props) {
|
|
33
|
-
return composeClassNames("font", props.weight && `font-${props.weight}`);
|
|
34
|
-
}
|
|
35
|
-
function gap(props) {
|
|
36
|
-
return composeClassNames(_resp("g", props.gap), _resp("gx", props.gapX), _resp("gy", props.gapY));
|
|
37
|
-
}
|
|
38
|
-
function grid(props) {
|
|
39
|
-
return composeClassNames(_resp("auto-cols", props.autoCols), _resp("auto-flow", props.autoFlow), _resp("auto-rows", props.autoRows), _resp("cols", props.columns), _resp("rows", props.rows));
|
|
40
|
-
}
|
|
41
|
-
function gridItem(props) {
|
|
42
|
-
return composeClassNames(_resp("col", props.column), _resp("col-start", props.columnStart), _resp("col-end", props.columnEnd), _resp("row", props.row), _resp("row-start", props.rowStart), _resp("row-end", props.rowEnd));
|
|
43
|
-
}
|
|
44
|
-
function height(props) {
|
|
45
|
-
return composeClassNames(_resp("h", props.height));
|
|
46
|
-
}
|
|
47
|
-
function inset(props) {
|
|
48
|
-
return composeClassNames(_resp("inset", props.inset), _resp("top", props.insetTop), _resp("right", props.insetRight), _resp("bottom", props.insetBottom), _resp("left", props.insetLeft));
|
|
49
|
-
}
|
|
50
|
-
function margin(props) {
|
|
51
|
-
return composeClassNames(_resp("m", props.margin), _resp("mx", props.marginX), _resp("my", props.marginY), _resp("mt", props.marginTop), _resp("mr", props.marginRight), _resp("mb", props.marginBottom), _resp("ml", props.marginLeft));
|
|
52
|
-
}
|
|
53
|
-
function maxWidth(props) {
|
|
54
|
-
return _resp("max-w", props.maxWidth) ?? "";
|
|
55
|
-
}
|
|
56
|
-
function minWidth(props) {
|
|
57
|
-
return _resp("min-w", props.minWidth) ?? "";
|
|
58
|
-
}
|
|
59
|
-
function overflow(props) {
|
|
60
|
-
return composeClassNames(_resp("overflow", props.overflow), _resp("overflow-x", props.overflowX), _resp("overflow-y", props.overflowY));
|
|
61
|
-
}
|
|
62
|
-
function padding(props) {
|
|
63
|
-
return composeClassNames(_resp("p", props.padding), _resp("px", props.paddingX), _resp("py", props.paddingY), _resp("pt", props.paddingTop), _resp("pr", props.paddingRight), _resp("pb", props.paddingBottom), _resp("pl", props.paddingLeft));
|
|
64
|
-
}
|
|
65
|
-
function pointerEvents(props) {
|
|
66
|
-
return composeClassNames(props.pointerEvents && `pointer-events-${props.pointerEvents}`);
|
|
67
|
-
}
|
|
68
|
-
function position(props) {
|
|
69
|
-
return composeClassNames(_resp("position", props.position));
|
|
70
|
-
}
|
|
71
|
-
function radius(props) {
|
|
72
|
-
return composeClassNames(_resp("r", props.radius));
|
|
73
|
-
}
|
|
74
|
-
function shadow(props) {
|
|
75
|
-
return composeClassNames(_resp("shadow", props.shadow));
|
|
76
|
-
}
|
|
77
|
-
function textAlign(props) {
|
|
78
|
-
return composeClassNames(_resp("text-align", props.textAlign));
|
|
79
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
+
var color = require("@sanity/color"), theme = require("@sanity/ui/theme");
|
|
80
4
|
const BREAKPOINTS = {
|
|
5
|
+
0: 0,
|
|
81
6
|
1: 360,
|
|
82
7
|
2: 600,
|
|
83
8
|
3: 900,
|
|
@@ -85,19 +10,6 @@ const BREAKPOINTS = {
|
|
|
85
10
|
5: 1800,
|
|
86
11
|
6: 2400
|
|
87
12
|
}, PREFIX = "s-";
|
|
88
|
-
function scopeClassName(className) {
|
|
89
|
-
if (className !== void 0)
|
|
90
|
-
return `${PREFIX}${className.trim()}`;
|
|
91
|
-
}
|
|
92
|
-
function _comp(...classNames) {
|
|
93
|
-
return _getClassNames(...classNames).filter(Boolean).map(scopeClassName).join(" ") || void 0;
|
|
94
|
-
}
|
|
95
|
-
function textOverflow(props) {
|
|
96
|
-
return _comp(props.textOverflow && `text-overflow-${props.textOverflow}`);
|
|
97
|
-
}
|
|
98
|
-
function width(props) {
|
|
99
|
-
return _resp("w", props.width) ?? "";
|
|
100
|
-
}
|
|
101
13
|
function isRecord(value) {
|
|
102
14
|
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
103
15
|
}
|
|
@@ -209,7 +121,7 @@ const varNames = {
|
|
|
209
121
|
width: "--avatar-focus-ring-width"
|
|
210
122
|
},
|
|
211
123
|
size: "--avatar-size",
|
|
212
|
-
sizes: AVATAR_SIZE.reduce((acc, size) => ({
|
|
124
|
+
sizes: theme.AVATAR_SIZE.reduce((acc, size) => ({
|
|
213
125
|
...acc,
|
|
214
126
|
[size]: {
|
|
215
127
|
distance: `--avatar-${size}-distance`,
|
|
@@ -350,15 +262,15 @@ const varNames = {
|
|
|
350
262
|
variant: "tinted"
|
|
351
263
|
}),
|
|
352
264
|
// tone scopes
|
|
353
|
-
...THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
265
|
+
...theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
354
266
|
tone
|
|
355
267
|
}), acc), {}),
|
|
356
268
|
// scheme scopes
|
|
357
|
-
dark: THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
269
|
+
dark: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
358
270
|
scheme: "dark",
|
|
359
271
|
tone
|
|
360
272
|
}), acc), {}),
|
|
361
|
-
light: THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
273
|
+
light: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
362
274
|
scheme: "light",
|
|
363
275
|
tone
|
|
364
276
|
}), acc), {})
|
|
@@ -375,7 +287,7 @@ const varNames = {
|
|
|
375
287
|
code: {
|
|
376
288
|
family: "--font-code-family",
|
|
377
289
|
featureSettings: "--font-code-feature-settings",
|
|
378
|
-
sizes: FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
290
|
+
sizes: theme.FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
379
291
|
...acc,
|
|
380
292
|
[size]: {
|
|
381
293
|
fontSize: `--font-code-${size}-size`,
|
|
@@ -396,7 +308,7 @@ const varNames = {
|
|
|
396
308
|
heading: {
|
|
397
309
|
family: "--font-heading-family",
|
|
398
310
|
featureSettings: "--font-heading-feature-settings",
|
|
399
|
-
sizes: FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
311
|
+
sizes: theme.FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
400
312
|
...acc,
|
|
401
313
|
[size]: {
|
|
402
314
|
fontSize: `--font-heading-${size}-size`,
|
|
@@ -417,7 +329,7 @@ const varNames = {
|
|
|
417
329
|
label: {
|
|
418
330
|
family: "--font-label-family",
|
|
419
331
|
featureSettings: "--font-label-feature-settings",
|
|
420
|
-
sizes: FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
332
|
+
sizes: theme.FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
421
333
|
...acc,
|
|
422
334
|
[size]: {
|
|
423
335
|
fontSize: `--font-label-${size}-size`,
|
|
@@ -438,7 +350,7 @@ const varNames = {
|
|
|
438
350
|
text: {
|
|
439
351
|
family: "--font-text-family",
|
|
440
352
|
featureSettings: "--font-text-feature-settings",
|
|
441
|
-
sizes: FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
353
|
+
sizes: theme.FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
442
354
|
...acc,
|
|
443
355
|
[size]: {
|
|
444
356
|
fontSize: `--font-text-${size}-size`,
|
|
@@ -507,19 +419,19 @@ const varNames = {
|
|
|
507
419
|
gap: "--input-gap",
|
|
508
420
|
padding: "--input-padding"
|
|
509
421
|
},
|
|
510
|
-
radius: Object.fromEntries(RADIUS.map((radius2) => [radius2, `--radius-${radius2}`])),
|
|
511
|
-
shadow: Object.fromEntries(SHADOW.map((shadow2) => [shadow2, {
|
|
422
|
+
radius: Object.fromEntries(theme.RADIUS.map((radius2) => [radius2, `--radius-${radius2}`])),
|
|
423
|
+
shadow: Object.fromEntries(theme.SHADOW.map((shadow2) => [shadow2, {
|
|
512
424
|
umbra: `--shadow-${shadow2}-umbra`,
|
|
513
425
|
penumbra: `--shadow-${shadow2}-penumbra`,
|
|
514
426
|
ambient: `--shadow-${shadow2}-ambient`
|
|
515
427
|
}])),
|
|
516
|
-
space: Object.fromEntries(SPACE.map((space) => [space, `--space-${String(space).replace(".", "_")}`])),
|
|
428
|
+
space: Object.fromEntries(theme.SPACE.map((space) => [space, `--space-${String(space).replace(".", "_")}`])),
|
|
517
429
|
// color
|
|
518
430
|
black: "--black",
|
|
519
431
|
white: "--white",
|
|
520
|
-
...COLOR_HUES.reduce((acc, hue) => {
|
|
432
|
+
...color.COLOR_HUES.reduce((acc, hue) => {
|
|
521
433
|
const tints = {};
|
|
522
|
-
for (const tint of COLOR_TINTS)
|
|
434
|
+
for (const tint of color.COLOR_TINTS)
|
|
523
435
|
tints[tint] = `--${hue}-${tint}`;
|
|
524
436
|
return acc[hue] = tints, acc;
|
|
525
437
|
}, {})
|
|
@@ -669,7 +581,7 @@ function buildColorVariantVarNames(options) {
|
|
|
669
581
|
4: `${prefix}-fg-4`
|
|
670
582
|
}
|
|
671
583
|
};
|
|
672
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
584
|
+
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
673
585
|
const _prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
674
586
|
vars2[elementTone] = {
|
|
675
587
|
bg: {
|
|
@@ -697,10 +609,10 @@ function buildColorVariantVarNames(options) {
|
|
|
697
609
|
}
|
|
698
610
|
return vars2;
|
|
699
611
|
}
|
|
700
|
-
function
|
|
612
|
+
function _compilePalette() {
|
|
701
613
|
return _compileStyle({
|
|
702
614
|
layers: {
|
|
703
|
-
|
|
615
|
+
palette: {
|
|
704
616
|
":root": compilePaletteProperties()
|
|
705
617
|
}
|
|
706
618
|
}
|
|
@@ -708,12 +620,12 @@ function compilePalette() {
|
|
|
708
620
|
}
|
|
709
621
|
function compilePaletteProperties() {
|
|
710
622
|
const rules2 = {
|
|
711
|
-
[varNames.black]: color.black.hex,
|
|
712
|
-
[varNames.white]: color.white.hex
|
|
623
|
+
[varNames.black]: color.color.black.hex,
|
|
624
|
+
[varNames.white]: color.color.white.hex
|
|
713
625
|
};
|
|
714
|
-
for (const hue of HUES)
|
|
715
|
-
for (const tint of TINTS)
|
|
716
|
-
rules2[varNames[hue][tint]] = color[hue][tint].hex;
|
|
626
|
+
for (const hue of theme.HUES)
|
|
627
|
+
for (const tint of theme.TINTS)
|
|
628
|
+
rules2[varNames[hue][tint]] = color.color[hue][tint].hex;
|
|
717
629
|
return rules2;
|
|
718
630
|
}
|
|
719
631
|
function _mergeStyles(styles) {
|
|
@@ -759,13 +671,13 @@ function _responsiveRule(rules2, _name, properties) {
|
|
|
759
671
|
};
|
|
760
672
|
}
|
|
761
673
|
const darkColorVars = {};
|
|
762
|
-
for (const tone of THEME_COLOR_CARD_TONES)
|
|
674
|
+
for (const tone of theme.THEME_COLOR_CARD_TONES)
|
|
763
675
|
darkColorVars[tone] = buildColorCardVars({
|
|
764
676
|
scheme: "dark",
|
|
765
677
|
tone
|
|
766
678
|
});
|
|
767
679
|
const lightColorVars = {};
|
|
768
|
-
for (const tone of THEME_COLOR_CARD_TONES)
|
|
680
|
+
for (const tone of theme.THEME_COLOR_CARD_TONES)
|
|
769
681
|
lightColorVars[tone] = buildColorCardVars({
|
|
770
682
|
scheme: "light",
|
|
771
683
|
tone
|
|
@@ -887,7 +799,7 @@ const colorVars = {
|
|
|
887
799
|
tinted: buildColorVariantVars({
|
|
888
800
|
variant: "tinted"
|
|
889
801
|
}),
|
|
890
|
-
...THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
802
|
+
...theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
891
803
|
...acc,
|
|
892
804
|
[tone]: buildColorCardVars({
|
|
893
805
|
tone
|
|
@@ -899,7 +811,7 @@ const colorVars = {
|
|
|
899
811
|
avatar: {
|
|
900
812
|
distance: `var(${varNames.avatar.distance})`,
|
|
901
813
|
size: `var(${varNames.avatar.size})`,
|
|
902
|
-
sizes: AVATAR_SIZE.reduce((acc, size) => ({
|
|
814
|
+
sizes: theme.AVATAR_SIZE.reduce((acc, size) => ({
|
|
903
815
|
...acc,
|
|
904
816
|
[size]: {
|
|
905
817
|
size: `var(${varNames.avatar.sizes[size].size})`,
|
|
@@ -924,7 +836,7 @@ const colorVars = {
|
|
|
924
836
|
font: {
|
|
925
837
|
code: {
|
|
926
838
|
family: `var(${varNames.font.code.family})`,
|
|
927
|
-
sizes: FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
839
|
+
sizes: theme.FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
928
840
|
...acc,
|
|
929
841
|
[size]: {
|
|
930
842
|
fontSize: `var(${varNames.font.code.sizes[size].fontSize})`,
|
|
@@ -944,7 +856,7 @@ const colorVars = {
|
|
|
944
856
|
},
|
|
945
857
|
heading: {
|
|
946
858
|
family: `var(${varNames.font.heading.family})`,
|
|
947
|
-
sizes: FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
859
|
+
sizes: theme.FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
948
860
|
...acc,
|
|
949
861
|
[size]: {
|
|
950
862
|
fontSize: `var(${varNames.font.heading.sizes[size].fontSize})`,
|
|
@@ -964,7 +876,7 @@ const colorVars = {
|
|
|
964
876
|
},
|
|
965
877
|
label: {
|
|
966
878
|
family: `var(${varNames.font.label.family})`,
|
|
967
|
-
sizes: FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
879
|
+
sizes: theme.FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
968
880
|
...acc,
|
|
969
881
|
[size]: {
|
|
970
882
|
fontSize: `var(${varNames.font.label.sizes[size].fontSize})`,
|
|
@@ -984,7 +896,7 @@ const colorVars = {
|
|
|
984
896
|
},
|
|
985
897
|
text: {
|
|
986
898
|
family: `var(${varNames.font.text.family})`,
|
|
987
|
-
sizes: FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
899
|
+
sizes: theme.FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
988
900
|
...acc,
|
|
989
901
|
[size]: {
|
|
990
902
|
fontSize: `var(${varNames.font.text.sizes[size].fontSize})`,
|
|
@@ -1019,19 +931,19 @@ const colorVars = {
|
|
|
1019
931
|
}
|
|
1020
932
|
}
|
|
1021
933
|
},
|
|
1022
|
-
radius: Object.fromEntries(RADIUS.map((radius2) => [radius2, `var(${varNames.radius[radius2]})`])),
|
|
1023
|
-
shadow: Object.fromEntries(SHADOW.map((shadow2) => [shadow2, {
|
|
934
|
+
radius: Object.fromEntries(theme.RADIUS.map((radius2) => [radius2, `var(${varNames.radius[radius2]})`])),
|
|
935
|
+
shadow: Object.fromEntries(theme.SHADOW.map((shadow2) => [shadow2, {
|
|
1024
936
|
umbra: `var(${varNames.shadow[shadow2].umbra})`,
|
|
1025
937
|
penumbra: `var(${varNames.shadow[shadow2].penumbra})`,
|
|
1026
938
|
ambient: `var(${varNames.shadow[shadow2].ambient})`
|
|
1027
939
|
}])),
|
|
1028
|
-
space: Object.fromEntries(SPACE.map((space) => [space, `var(${varNames.space[space]})`])),
|
|
940
|
+
space: Object.fromEntries(theme.SPACE.map((space) => [space, `var(${varNames.space[space]})`])),
|
|
1029
941
|
// color
|
|
1030
942
|
black: `var(${varNames.black})`,
|
|
1031
943
|
white: `var(${varNames.white})`,
|
|
1032
|
-
...COLOR_HUES.reduce((acc, hue) => {
|
|
944
|
+
...color.COLOR_HUES.reduce((acc, hue) => {
|
|
1033
945
|
const tints = {};
|
|
1034
|
-
for (const tint of COLOR_TINTS)
|
|
946
|
+
for (const tint of color.COLOR_TINTS)
|
|
1035
947
|
tints[tint] = `var(--${hue}-${tint})`;
|
|
1036
948
|
return acc[hue] = tints, acc;
|
|
1037
949
|
}, {})
|
|
@@ -1043,7 +955,7 @@ function buildColorCardVars(props) {
|
|
|
1043
955
|
} = props, prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone];
|
|
1044
956
|
return {
|
|
1045
957
|
avatar: {
|
|
1046
|
-
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
958
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
1047
959
|
...acc,
|
|
1048
960
|
[color2]: {
|
|
1049
961
|
bg: `var(${prefix.avatar[color2].bg})`,
|
|
@@ -1152,7 +1064,7 @@ function buildColorVariantVars(options) {
|
|
|
1152
1064
|
4: `var(${_prefix}-fg-4)`
|
|
1153
1065
|
}
|
|
1154
1066
|
};
|
|
1155
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
1067
|
+
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
1156
1068
|
const prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
1157
1069
|
vars2[elementTone] = {
|
|
1158
1070
|
bg: {
|
|
@@ -1432,15 +1344,15 @@ const flexStyle = {
|
|
|
1432
1344
|
primitive: primitive$q
|
|
1433
1345
|
}
|
|
1434
1346
|
}, util$n = {};
|
|
1435
|
-
for (const space of SPACE)
|
|
1347
|
+
for (const space of theme.SPACE)
|
|
1436
1348
|
_responsiveRule(util$n, `g-${space}`, {
|
|
1437
1349
|
gap: vars.space[space]
|
|
1438
1350
|
});
|
|
1439
|
-
for (const space of SPACE)
|
|
1351
|
+
for (const space of theme.SPACE)
|
|
1440
1352
|
_responsiveRule(util$n, `gx-${space}`, {
|
|
1441
1353
|
columnGap: vars.space[space]
|
|
1442
1354
|
});
|
|
1443
|
-
for (const space of SPACE)
|
|
1355
|
+
for (const space of theme.SPACE)
|
|
1444
1356
|
_responsiveRule(util$n, `gy-${space}`, {
|
|
1445
1357
|
rowGap: vars.space[space]
|
|
1446
1358
|
});
|
|
@@ -1874,33 +1786,33 @@ const insetStyle = {
|
|
|
1874
1786
|
util: util$a
|
|
1875
1787
|
}
|
|
1876
1788
|
}, util$9 = {};
|
|
1877
|
-
for (const space of SPACE)
|
|
1789
|
+
for (const space of theme.SPACE)
|
|
1878
1790
|
_responsiveRule(util$9, `m-${space}`, {
|
|
1879
1791
|
margin: vars.space[space]
|
|
1880
1792
|
});
|
|
1881
|
-
for (const space of SPACE)
|
|
1793
|
+
for (const space of theme.SPACE)
|
|
1882
1794
|
_responsiveRule(util$9, `mx-${space}`, {
|
|
1883
1795
|
marginLeft: vars.space[space],
|
|
1884
1796
|
marginRight: vars.space[space]
|
|
1885
1797
|
});
|
|
1886
|
-
for (const space of SPACE)
|
|
1798
|
+
for (const space of theme.SPACE)
|
|
1887
1799
|
_responsiveRule(util$9, `my-${space}`, {
|
|
1888
1800
|
marginTop: vars.space[space],
|
|
1889
1801
|
marginBottom: vars.space[space]
|
|
1890
1802
|
});
|
|
1891
|
-
for (const space of SPACE)
|
|
1803
|
+
for (const space of theme.SPACE)
|
|
1892
1804
|
_responsiveRule(util$9, `mt-${space}`, {
|
|
1893
1805
|
marginTop: vars.space[space]
|
|
1894
1806
|
});
|
|
1895
|
-
for (const space of SPACE)
|
|
1807
|
+
for (const space of theme.SPACE)
|
|
1896
1808
|
_responsiveRule(util$9, `mr-${space}`, {
|
|
1897
1809
|
marginRight: vars.space[space]
|
|
1898
1810
|
});
|
|
1899
|
-
for (const space of SPACE)
|
|
1811
|
+
for (const space of theme.SPACE)
|
|
1900
1812
|
_responsiveRule(util$9, `mb-${space}`, {
|
|
1901
1813
|
marginBottom: vars.space[space]
|
|
1902
1814
|
});
|
|
1903
|
-
for (const space of SPACE)
|
|
1815
|
+
for (const space of theme.SPACE)
|
|
1904
1816
|
_responsiveRule(util$9, `ml-${space}`, {
|
|
1905
1817
|
marginLeft: vars.space[space]
|
|
1906
1818
|
});
|
|
@@ -1986,33 +1898,33 @@ const overflowStyle = {
|
|
|
1986
1898
|
util: util$6
|
|
1987
1899
|
}
|
|
1988
1900
|
}, util$5 = {};
|
|
1989
|
-
for (const space of SPACE)
|
|
1901
|
+
for (const space of theme.SPACE)
|
|
1990
1902
|
_responsiveRule(util$5, `p-${space}`, {
|
|
1991
1903
|
padding: vars.space[space]
|
|
1992
1904
|
});
|
|
1993
|
-
for (const space of SPACE)
|
|
1905
|
+
for (const space of theme.SPACE)
|
|
1994
1906
|
_responsiveRule(util$5, `px-${space}`, {
|
|
1995
1907
|
paddingLeft: vars.space[space],
|
|
1996
1908
|
paddingRight: vars.space[space]
|
|
1997
1909
|
});
|
|
1998
|
-
for (const space of SPACE)
|
|
1910
|
+
for (const space of theme.SPACE)
|
|
1999
1911
|
_responsiveRule(util$5, `py-${space}`, {
|
|
2000
1912
|
paddingTop: vars.space[space],
|
|
2001
1913
|
paddingBottom: vars.space[space]
|
|
2002
1914
|
});
|
|
2003
|
-
for (const space of SPACE)
|
|
1915
|
+
for (const space of theme.SPACE)
|
|
2004
1916
|
_responsiveRule(util$5, `pt-${space}`, {
|
|
2005
1917
|
paddingTop: vars.space[space]
|
|
2006
1918
|
});
|
|
2007
|
-
for (const space of SPACE)
|
|
1919
|
+
for (const space of theme.SPACE)
|
|
2008
1920
|
_responsiveRule(util$5, `pr-${space}`, {
|
|
2009
1921
|
paddingRight: vars.space[space]
|
|
2010
1922
|
});
|
|
2011
|
-
for (const space of SPACE)
|
|
1923
|
+
for (const space of theme.SPACE)
|
|
2012
1924
|
_responsiveRule(util$5, `pb-${space}`, {
|
|
2013
1925
|
paddingBottom: vars.space[space]
|
|
2014
1926
|
});
|
|
2015
|
-
for (const space of SPACE)
|
|
1927
|
+
for (const space of theme.SPACE)
|
|
2016
1928
|
_responsiveRule(util$5, `pl-${space}`, {
|
|
2017
1929
|
paddingLeft: vars.space[space]
|
|
2018
1930
|
});
|
|
@@ -2081,7 +1993,7 @@ const radiusStyle = {
|
|
|
2081
1993
|
util: util$3
|
|
2082
1994
|
}
|
|
2083
1995
|
}, util$2 = {};
|
|
2084
|
-
for (const shadow2 of SHADOW)
|
|
1996
|
+
for (const shadow2 of theme.SHADOW)
|
|
2085
1997
|
shadow2 === 0 ? _responsiveRule(util$2, "shadow-0", {
|
|
2086
1998
|
boxShadow: "none"
|
|
2087
1999
|
}) : _responsiveRule(util$2, `shadow-${shadow2}`, {
|
|
@@ -2269,25 +2181,25 @@ const widthStyle = {
|
|
|
2269
2181
|
height: "calc(var(--font-skeleton-line-height) - var(--font-skeleton-ascender-height) - var(--font-skeleton-descender-height))"
|
|
2270
2182
|
}
|
|
2271
2183
|
};
|
|
2272
|
-
for (const size of FONT_CODE_SIZE)
|
|
2184
|
+
for (const size of theme.FONT_CODE_SIZE)
|
|
2273
2185
|
_responsiveRule(component$2, `code-skeleton-${size}`, {
|
|
2274
2186
|
"--font-skeleton-line-height": vars.font.code.sizes[size].lineHeight,
|
|
2275
2187
|
"--font-skeleton-ascender-height": vars.font.code.sizes[size].ascenderHeight,
|
|
2276
2188
|
"--font-skeleton-descender-height": vars.font.code.sizes[size].descenderHeight
|
|
2277
2189
|
});
|
|
2278
|
-
for (const size of FONT_HEADING_SIZE)
|
|
2190
|
+
for (const size of theme.FONT_HEADING_SIZE)
|
|
2279
2191
|
_responsiveRule(component$2, `heading-skeleton-${size}`, {
|
|
2280
2192
|
"--font-skeleton-line-height": vars.font.heading.sizes[size].lineHeight,
|
|
2281
2193
|
"--font-skeleton-ascender-height": vars.font.heading.sizes[size].ascenderHeight,
|
|
2282
2194
|
"--font-skeleton-descender-height": vars.font.heading.sizes[size].descenderHeight
|
|
2283
2195
|
});
|
|
2284
|
-
for (const size of FONT_LABEL_SIZE)
|
|
2196
|
+
for (const size of theme.FONT_LABEL_SIZE)
|
|
2285
2197
|
_responsiveRule(component$2, `label-skeleton-${size}`, {
|
|
2286
2198
|
"--font-skeleton-line-height": vars.font.label.sizes[size].lineHeight,
|
|
2287
2199
|
"--font-skeleton-ascender-height": vars.font.label.sizes[size].ascenderHeight,
|
|
2288
2200
|
"--font-skeleton-descender-height": vars.font.label.sizes[size].descenderHeight
|
|
2289
2201
|
});
|
|
2290
|
-
for (const size of FONT_TEXT_SIZE)
|
|
2202
|
+
for (const size of theme.FONT_TEXT_SIZE)
|
|
2291
2203
|
_responsiveRule(component$2, `text-skeleton-${size}`, {
|
|
2292
2204
|
"--font-skeleton-line-height": vars.font.text.sizes[size].lineHeight,
|
|
2293
2205
|
"--font-skeleton-ascender-height": vars.font.text.sizes[size].ascenderHeight,
|
|
@@ -2522,7 +2434,7 @@ const skeletonStyle = {
|
|
|
2522
2434
|
}
|
|
2523
2435
|
}
|
|
2524
2436
|
};
|
|
2525
|
-
for (const size of FONT_TEXT_SIZE) {
|
|
2437
|
+
for (const size of theme.FONT_TEXT_SIZE) {
|
|
2526
2438
|
const source = vars.font.text.sizes[size];
|
|
2527
2439
|
_responsiveRule(primitive$o, `input-${size}`, {
|
|
2528
2440
|
[varNames.input.fontSize]: source.fontSize,
|
|
@@ -2532,11 +2444,11 @@ for (const size of FONT_TEXT_SIZE) {
|
|
|
2532
2444
|
[varNames.input.descenderHeight]: source.descenderHeight
|
|
2533
2445
|
});
|
|
2534
2446
|
}
|
|
2535
|
-
for (const space of SPACE)
|
|
2447
|
+
for (const space of theme.SPACE)
|
|
2536
2448
|
_responsiveRule(primitive$o, `input-p-${space}`, {
|
|
2537
2449
|
[varNames.input.padding]: vars.space[space]
|
|
2538
2450
|
});
|
|
2539
|
-
for (const space of SPACE)
|
|
2451
|
+
for (const space of theme.SPACE)
|
|
2540
2452
|
_responsiveRule(primitive$o, `input-g-${space}`, {
|
|
2541
2453
|
[varNames.input.gap]: vars.space[space]
|
|
2542
2454
|
});
|
|
@@ -2614,7 +2526,7 @@ const _inputStyle = {
|
|
|
2614
2526
|
};
|
|
2615
2527
|
function buildSelectableTones() {
|
|
2616
2528
|
const rules2 = {};
|
|
2617
|
-
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
2529
|
+
for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
2618
2530
|
const target = varNames.color, source = vars.color;
|
|
2619
2531
|
rules2[`&.${tone}`] = {
|
|
2620
2532
|
[target.tinted.bg[0]]: source.tinted[tone].bg[0],
|
|
@@ -2685,7 +2597,7 @@ const primitive$m = {
|
|
|
2685
2597
|
[varNames.color.avatar.bg]: vars.color.border,
|
|
2686
2598
|
[varNames.color.avatar.fg]: vars.color.bg
|
|
2687
2599
|
},
|
|
2688
|
-
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
2600
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
2689
2601
|
...acc,
|
|
2690
2602
|
[`&.${color2}`]: {
|
|
2691
2603
|
[varNames.color.avatar.bg]: vars.color.avatar[color2].bg,
|
|
@@ -2779,7 +2691,7 @@ const primitive$m = {
|
|
|
2779
2691
|
}
|
|
2780
2692
|
}
|
|
2781
2693
|
};
|
|
2782
|
-
for (const size of AVATAR_SIZE)
|
|
2694
|
+
for (const size of theme.AVATAR_SIZE)
|
|
2783
2695
|
_responsiveRule(primitive$m, `avatar-${size}`, {
|
|
2784
2696
|
[varNames.avatar.distance]: vars.avatar.sizes[size].distance,
|
|
2785
2697
|
[varNames.avatar.size]: vars.avatar.sizes[size].size
|
|
@@ -2795,7 +2707,7 @@ const avatarStyle = {
|
|
|
2795
2707
|
verticalAlign: "top"
|
|
2796
2708
|
}
|
|
2797
2709
|
};
|
|
2798
|
-
for (const tone of THEME_COLOR_STATE_TONES)
|
|
2710
|
+
for (const tone of theme.THEME_COLOR_STATE_TONES)
|
|
2799
2711
|
primitive$l[`.badge-${tone}`] = {
|
|
2800
2712
|
[varNames.color.bg]: vars.color.tinted[tone].bg[4],
|
|
2801
2713
|
[varNames.color.fg]: vars.color.tinted[tone].fg[3]
|
|
@@ -2831,18 +2743,6 @@ const badgeStyle = {
|
|
|
2831
2743
|
layers: {
|
|
2832
2744
|
primitive: primitive$k
|
|
2833
2745
|
}
|
|
2834
|
-
}, toneMap = {
|
|
2835
|
-
default: "default",
|
|
2836
|
-
neutral: "neutral",
|
|
2837
|
-
suggest: "suggest",
|
|
2838
|
-
primary: "accent",
|
|
2839
|
-
positive: "positive",
|
|
2840
|
-
caution: "caution",
|
|
2841
|
-
critical: "critical"
|
|
2842
|
-
}, variantMap = {
|
|
2843
|
-
default: "solid",
|
|
2844
|
-
ghost: "ghost",
|
|
2845
|
-
bleed: "tinted"
|
|
2846
2746
|
}, primitive$j = {
|
|
2847
2747
|
".button": {
|
|
2848
2748
|
WebkitFontSmoothing: "inherit",
|
|
@@ -2890,11 +2790,13 @@ const badgeStyle = {
|
|
|
2890
2790
|
opacity: 0.8
|
|
2891
2791
|
}
|
|
2892
2792
|
};
|
|
2893
|
-
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
2793
|
+
for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
2894
2794
|
const solid = vars.color.solid[tone], tinted = vars.color.tinted[tone];
|
|
2895
|
-
primitive$j[`.button
|
|
2795
|
+
primitive$j[`.button[data-mode="default"][data-tone="${tone}"]`] = {
|
|
2896
2796
|
[varNames.color.bg]: solid.bg[0],
|
|
2897
2797
|
[varNames.color.border]: solid.border[1],
|
|
2798
|
+
[varNames.color.code.bg]: solid.bg[1],
|
|
2799
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
2898
2800
|
[varNames.color.fg]: solid.fg[0],
|
|
2899
2801
|
[varNames.color.muted.bg]: solid.bg[1],
|
|
2900
2802
|
[varNames.color.muted.fg]: solid.fg[4],
|
|
@@ -2903,6 +2805,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2903
2805
|
"&:not([data-disabled]):hover": {
|
|
2904
2806
|
[varNames.color.bg]: solid.bg[1],
|
|
2905
2807
|
[varNames.color.border]: solid.border[2],
|
|
2808
|
+
[varNames.color.code.bg]: solid.bg[2],
|
|
2809
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
2906
2810
|
[varNames.color.fg]: solid.fg[0],
|
|
2907
2811
|
[varNames.color.muted.bg]: solid.bg[2],
|
|
2908
2812
|
[varNames.color.muted.fg]: solid.fg[4]
|
|
@@ -2910,6 +2814,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2910
2814
|
"&:not([data-disabled]):active": {
|
|
2911
2815
|
[varNames.color.bg]: solid.bg[2],
|
|
2912
2816
|
[varNames.color.border]: solid.border[3],
|
|
2817
|
+
[varNames.color.code.bg]: solid.bg[3],
|
|
2818
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
2913
2819
|
[varNames.color.fg]: solid.fg[0],
|
|
2914
2820
|
[varNames.color.muted.bg]: solid.bg[3],
|
|
2915
2821
|
[varNames.color.muted.fg]: solid.fg[4]
|
|
@@ -2917,6 +2823,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2917
2823
|
"&:not([data-disabled])[data-selected]": {
|
|
2918
2824
|
[varNames.color.bg]: solid.bg[2],
|
|
2919
2825
|
[varNames.color.border]: solid.border[3],
|
|
2826
|
+
[varNames.color.code.bg]: solid.bg[3],
|
|
2827
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
2920
2828
|
[varNames.color.fg]: solid.fg[0],
|
|
2921
2829
|
[varNames.color.muted.bg]: solid.bg[3],
|
|
2922
2830
|
[varNames.color.muted.fg]: solid.fg[4]
|
|
@@ -2940,25 +2848,30 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2940
2848
|
[varNames.color.muted.fg]: vars.color.tinted.default.border[4]
|
|
2941
2849
|
}
|
|
2942
2850
|
}
|
|
2943
|
-
}, primitive$j[`.button
|
|
2851
|
+
}, primitive$j[`.button[data-mode="ghost"][data-tone="${tone}"]`] = {
|
|
2944
2852
|
[varNames.color.bg]: tinted.bg[1],
|
|
2945
|
-
[varNames.color.border]: tinted.border[
|
|
2853
|
+
[varNames.color.border]: tinted.border[1],
|
|
2946
2854
|
[varNames.color.fg]: tinted.fg[2],
|
|
2855
|
+
[varNames.color.code.bg]: tinted.bg[2],
|
|
2856
|
+
[varNames.color.code.fg]: tinted.fg[4],
|
|
2947
2857
|
[varNames.color.muted.bg]: tinted.bg[2],
|
|
2948
2858
|
[varNames.color.muted.fg]: tinted.fg[4],
|
|
2949
2859
|
"--button-box-shadow": "inset 0 0 0 var(--button-border-width) var(--color-border)",
|
|
2950
2860
|
"@nest": {
|
|
2951
2861
|
"&:not([data-disabled]):hover": {
|
|
2952
2862
|
[varNames.color.bg]: tinted.bg[2],
|
|
2953
|
-
[varNames.color.border]: tinted.border[
|
|
2863
|
+
[varNames.color.border]: tinted.border[2],
|
|
2864
|
+
[varNames.color.code.bg]: tinted.bg[3],
|
|
2865
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
2954
2866
|
[varNames.color.fg]: tinted.fg[1],
|
|
2955
2867
|
[varNames.color.muted.bg]: tinted.bg[3],
|
|
2956
2868
|
[varNames.color.muted.fg]: tinted.fg[3]
|
|
2957
|
-
// '--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
2958
2869
|
},
|
|
2959
2870
|
"&:not([data-disabled]):active": {
|
|
2960
2871
|
[varNames.color.bg]: tinted.bg[3],
|
|
2961
|
-
[varNames.color.border]: tinted.border[
|
|
2872
|
+
[varNames.color.border]: tinted.border[3],
|
|
2873
|
+
[varNames.color.code.bg]: tinted.bg[4],
|
|
2874
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
2962
2875
|
[varNames.color.fg]: tinted.fg[1],
|
|
2963
2876
|
[varNames.color.muted.bg]: tinted.bg[4],
|
|
2964
2877
|
[varNames.color.muted.fg]: tinted.fg[3],
|
|
@@ -2966,7 +2879,9 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2966
2879
|
},
|
|
2967
2880
|
"&:not([data-disabled])[data-selected]": {
|
|
2968
2881
|
[varNames.color.bg]: tinted.bg[3],
|
|
2969
|
-
[varNames.color.border]: tinted.border[
|
|
2882
|
+
[varNames.color.border]: tinted.border[3],
|
|
2883
|
+
[varNames.color.code.bg]: tinted.bg[4],
|
|
2884
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
2970
2885
|
[varNames.color.fg]: tinted.fg[1],
|
|
2971
2886
|
[varNames.color.muted.bg]: tinted.bg[4],
|
|
2972
2887
|
[varNames.color.muted.fg]: tinted.fg[3],
|
|
@@ -2991,7 +2906,7 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2991
2906
|
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
2992
2907
|
}
|
|
2993
2908
|
}
|
|
2994
|
-
}, primitive$j[`.button
|
|
2909
|
+
}, primitive$j[`.button[data-mode="bleed"][data-tone="${tone}"]`] = {
|
|
2995
2910
|
boxShadow: "none",
|
|
2996
2911
|
[varNames.color.bg]: tinted.bg[0],
|
|
2997
2912
|
[varNames.color.border]: tinted.border[1],
|
|
@@ -3077,6 +2992,11 @@ const buttonStyle = {
|
|
|
3077
2992
|
font: "inherit",
|
|
3078
2993
|
whiteSpace: "inherit"
|
|
3079
2994
|
},
|
|
2995
|
+
"&[data-checkered]": {
|
|
2996
|
+
backgroundSize: `${vars.space[3]} ${vars.space[3]}`,
|
|
2997
|
+
backgroundPosition: "top left",
|
|
2998
|
+
backgroundImage: `repeating-conic-gradient(${vars.color.bg} 0% 25%, ${vars.color.muted.bg} 0% 50%)`
|
|
2999
|
+
},
|
|
3080
3000
|
"a&:not([data-disabled]):hover, button&:not([data-disabled]):hover": {
|
|
3081
3001
|
[varNames.color.bg]: vars.color.tinted.default.bg[1],
|
|
3082
3002
|
[varNames.color.border]: vars.color.tinted.default.border[3],
|
|
@@ -3113,41 +3033,27 @@ const buttonStyle = {
|
|
|
3113
3033
|
[varNames.color.muted.bg]: vars.color.solid.primary.bg[1],
|
|
3114
3034
|
[varNames.color.muted.fg]: vars.color.solid.primary.fg[3]
|
|
3115
3035
|
},
|
|
3116
|
-
// '&:not([data-disabled]):focus': {
|
|
3117
|
-
// '--color-bg': vars.color.solid.bg[0],
|
|
3118
|
-
// '--color-border': vars.color.solid.border[1],
|
|
3119
|
-
// '--color-fg': vars.color.solid.fg[1],
|
|
3120
|
-
// '--color-muted-bg': vars.color.solid.bg[1],
|
|
3121
|
-
// '--color-muted-fg': vars.color.solid.fg[3],
|
|
3122
|
-
// },
|
|
3123
3036
|
"a&[data-disabled], button&[data-disabled]": {
|
|
3124
|
-
[varNames.color.bg]: vars.color.tinted.default.bg[
|
|
3125
|
-
[varNames.color.border]: vars.color.tinted.default.border[
|
|
3126
|
-
[varNames.color.fg]: vars.color.tinted.default.
|
|
3127
|
-
[varNames.color.muted.bg]: vars.color.tinted.default.bg[
|
|
3128
|
-
[varNames.color.muted.fg]: vars.color.tinted.default.
|
|
3037
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
3038
|
+
[varNames.color.border]: vars.color.tinted.default.border[1],
|
|
3039
|
+
[varNames.color.fg]: vars.color.tinted.default.border[3],
|
|
3040
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
3041
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[1]
|
|
3129
3042
|
}
|
|
3130
|
-
// '&[data-disabled]': {
|
|
3131
|
-
// '--color-bg': vars.color.tinted.bg[0],
|
|
3132
|
-
// '--color-border': vars.color.tinted.border[1],
|
|
3133
|
-
// '--color-fg': vars.color.tinted.border[4],
|
|
3134
|
-
// '--color-muted-bg': vars.color.tinted.bg[1],
|
|
3135
|
-
// '--color-muted-fg': vars.color.tinted.border[4],
|
|
3136
|
-
// },
|
|
3137
3043
|
}
|
|
3138
3044
|
}
|
|
3139
3045
|
};
|
|
3140
|
-
for (const scheme of THEME_COLOR_SCHEMES
|
|
3046
|
+
for (const scheme of theme.THEME_COLOR_SCHEMES) {
|
|
3141
3047
|
const schemeProps = {
|
|
3142
3048
|
colorScheme: scheme
|
|
3143
3049
|
};
|
|
3144
|
-
for (const tone of THEME_COLOR_CARD_TONES) {
|
|
3050
|
+
for (const tone of theme.THEME_COLOR_CARD_TONES) {
|
|
3145
3051
|
const _varNames = varNames.color[tone], _vars = vars.color[scheme][tone];
|
|
3146
3052
|
_assignToneProps(schemeProps, _varNames, _vars);
|
|
3147
3053
|
}
|
|
3148
3054
|
primitive$i[`.card.${scheme}`] = schemeProps;
|
|
3149
3055
|
}
|
|
3150
|
-
for (const tone of THEME_COLOR_CARD_TONES) {
|
|
3056
|
+
for (const tone of theme.THEME_COLOR_CARD_TONES) {
|
|
3151
3057
|
const _varNames = varNames.color, _vars = vars.color[tone], toneProps = {};
|
|
3152
3058
|
_assignToneProps(toneProps, _varNames, _vars), Object.assign(toneProps, {
|
|
3153
3059
|
"--card-bg-color": vars.color.bg,
|
|
@@ -3182,7 +3088,7 @@ const cardStyle = {
|
|
|
3182
3088
|
}
|
|
3183
3089
|
};
|
|
3184
3090
|
function _assignToneProps(toneProps, _varNames, _vars) {
|
|
3185
|
-
for (const hue of THEME_COLOR_AVATAR_COLORS)
|
|
3091
|
+
for (const hue of theme.THEME_COLOR_AVATAR_COLORS)
|
|
3186
3092
|
toneProps[`${_varNames.avatar[hue].bg}`] = _vars.avatar[hue].bg, toneProps[`${_varNames.avatar[hue].fg}`] = _vars.avatar[hue].fg;
|
|
3187
3093
|
Object.assign(toneProps, {
|
|
3188
3094
|
[_varNames.backdrop]: _vars.backdrop,
|
|
@@ -3232,7 +3138,7 @@ function _assignToneProps(toneProps, _varNames, _vars) {
|
|
|
3232
3138
|
[_varNames.shadow.ambient]: _vars.shadow.ambient
|
|
3233
3139
|
});
|
|
3234
3140
|
for (const variant of ["solid", "tinted"])
|
|
3235
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
3141
|
+
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
3236
3142
|
const __varNames = _varNames[variant][elementTone], __vars = _vars[variant][elementTone];
|
|
3237
3143
|
Object.assign(toneProps, {
|
|
3238
3144
|
[__varNames.bg[0]]: __vars.bg[0],
|
|
@@ -3420,7 +3326,7 @@ const primitive$h = {
|
|
|
3420
3326
|
}
|
|
3421
3327
|
}
|
|
3422
3328
|
};
|
|
3423
|
-
for (const size of FONT_CODE_SIZE)
|
|
3329
|
+
for (const size of theme.FONT_CODE_SIZE)
|
|
3424
3330
|
_responsiveRule(primitive$g, `code-${size}`, {
|
|
3425
3331
|
"--font-size": `var(--font-code-${size}-size)`,
|
|
3426
3332
|
"--font-line-height": `var(--font-code-${size}-line-height)`,
|
|
@@ -3466,7 +3372,7 @@ const codeStyle = {
|
|
|
3466
3372
|
"--color-fg": "var(--color-tinted-default-fg-4)"
|
|
3467
3373
|
}
|
|
3468
3374
|
};
|
|
3469
|
-
for (const size of FONT_HEADING_SIZE)
|
|
3375
|
+
for (const size of theme.FONT_HEADING_SIZE)
|
|
3470
3376
|
_responsiveRule(primitive$e, `heading-${size}`, {
|
|
3471
3377
|
"--font-size": `var(--font-heading-${size}-size)`,
|
|
3472
3378
|
"--font-line-height": `var(--font-heading-${size}-line-height)`,
|
|
@@ -3482,11 +3388,8 @@ const headingStyle = {
|
|
|
3482
3388
|
}
|
|
3483
3389
|
}, primitive$d = {
|
|
3484
3390
|
".kbd": {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
// '--color-fg': 'var(--color-tinted-default-fg-3)',
|
|
3488
|
-
boxShadow: "inset 0 0 0 0.5px var(--color-tinted-default-border-3)",
|
|
3489
|
-
background: "var(--color-muted-bg)",
|
|
3391
|
+
boxShadow: `inset 0 0 0 0.5px ${vars.color.border}`,
|
|
3392
|
+
backgroundColor: vars.color.muted.bg,
|
|
3490
3393
|
font: "inherit",
|
|
3491
3394
|
verticalAlign: "top",
|
|
3492
3395
|
"@nest": {
|
|
@@ -3523,7 +3426,7 @@ const headingStyle = {
|
|
|
3523
3426
|
"--color-fg": "var(--color-muted-fg)"
|
|
3524
3427
|
}
|
|
3525
3428
|
};
|
|
3526
|
-
for (const size of FONT_LABEL_SIZE)
|
|
3429
|
+
for (const size of theme.FONT_LABEL_SIZE)
|
|
3527
3430
|
_responsiveRule(primitive$c, `label-${size}`, {
|
|
3528
3431
|
"--font-size": `var(--font-label-${size}-size)`,
|
|
3529
3432
|
"--font-line-height": `var(--font-label-${size}-line-height)`,
|
|
@@ -3807,7 +3710,7 @@ const labelStyle = {
|
|
|
3807
3710
|
color: "var(--color-muted-fg)"
|
|
3808
3711
|
}
|
|
3809
3712
|
};
|
|
3810
|
-
for (const size of FONT_TEXT_SIZE)
|
|
3713
|
+
for (const size of theme.FONT_TEXT_SIZE)
|
|
3811
3714
|
_responsiveRule(primitive$5, `text-${size}`, {
|
|
3812
3715
|
"--font-size": `var(--font-text-${size}-size)`,
|
|
3813
3716
|
"--font-line-height": `var(--font-text-${size}-line-height)`,
|
|
@@ -4026,6 +3929,7 @@ const textStyle = {
|
|
|
4026
3929
|
{
|
|
4027
3930
|
// define order of layers
|
|
4028
3931
|
layers: {
|
|
3932
|
+
palette: {},
|
|
4029
3933
|
theme: {},
|
|
4030
3934
|
base: {},
|
|
4031
3935
|
util: {},
|
|
@@ -4106,69 +4010,70 @@ const textStyle = {
|
|
|
4106
4010
|
toastStyle,
|
|
4107
4011
|
treeStyle
|
|
4108
4012
|
]);
|
|
4109
|
-
function
|
|
4013
|
+
function _compileSystem() {
|
|
4110
4014
|
return _compileStyle(_systemStyle);
|
|
4111
4015
|
}
|
|
4112
4016
|
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4113
|
-
function
|
|
4017
|
+
function _compileTheme_v3(theme2) {
|
|
4114
4018
|
return _compileStyle({
|
|
4115
4019
|
layers: {
|
|
4116
4020
|
theme: {
|
|
4117
|
-
":root": compileThemeProperties(
|
|
4021
|
+
":root": compileThemeProperties(theme2)
|
|
4118
4022
|
}
|
|
4119
4023
|
}
|
|
4120
4024
|
});
|
|
4121
4025
|
}
|
|
4122
|
-
function compileThemeProperties(
|
|
4026
|
+
function compileThemeProperties(theme2) {
|
|
4123
4027
|
return {
|
|
4124
|
-
...buildAvatarThemeProperties(
|
|
4125
|
-
...buildButtonThemeProperties(
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
...
|
|
4129
|
-
...
|
|
4130
|
-
...
|
|
4131
|
-
...
|
|
4132
|
-
...
|
|
4133
|
-
...
|
|
4134
|
-
...
|
|
4135
|
-
...
|
|
4136
|
-
...
|
|
4028
|
+
...buildAvatarThemeProperties(theme2),
|
|
4029
|
+
...buildButtonThemeProperties(theme2),
|
|
4030
|
+
// card
|
|
4031
|
+
[varNames.card.shadow.outline]: px(theme2.card.shadow.outline),
|
|
4032
|
+
...buildColorThemeProperties(theme2),
|
|
4033
|
+
...buildContainerThemeProperties(theme2),
|
|
4034
|
+
...buildFontCodeThemeProperties(theme2),
|
|
4035
|
+
...buildFontHeadingThemeProperties(theme2),
|
|
4036
|
+
...buildFontLabelThemeProperties(theme2),
|
|
4037
|
+
...buildFontTextThemeProperties(theme2),
|
|
4038
|
+
...buildInputThemeProperties(theme2),
|
|
4039
|
+
...buildRadiusThemeProperties(theme2),
|
|
4040
|
+
...buildShadowThemeProperties(theme2),
|
|
4041
|
+
...buildSpaceThemeProperties(theme2)
|
|
4137
4042
|
};
|
|
4138
4043
|
}
|
|
4139
|
-
function buildAvatarThemeProperties(
|
|
4044
|
+
function buildAvatarThemeProperties(theme2) {
|
|
4140
4045
|
return {
|
|
4141
|
-
[varNames.avatar.focusRing.offset]: px(
|
|
4142
|
-
[varNames.avatar.focusRing.width]: px(
|
|
4143
|
-
[varNames.avatar.sizes[0].distance]: rem(
|
|
4144
|
-
[varNames.avatar.sizes[0].size]: rem(
|
|
4145
|
-
[varNames.avatar.sizes[1].distance]: rem(
|
|
4146
|
-
[varNames.avatar.sizes[1].size]: rem(
|
|
4147
|
-
[varNames.avatar.sizes[2].distance]: rem(
|
|
4148
|
-
[varNames.avatar.sizes[2].size]: rem(
|
|
4149
|
-
[varNames.avatar.sizes[3].distance]: rem(
|
|
4150
|
-
[varNames.avatar.sizes[3].size]: rem(
|
|
4046
|
+
[varNames.avatar.focusRing.offset]: px(theme2.avatar.focusRing.offset),
|
|
4047
|
+
[varNames.avatar.focusRing.width]: px(theme2.avatar.focusRing.width),
|
|
4048
|
+
[varNames.avatar.sizes[0].distance]: rem(theme2.avatar.sizes[0].distance),
|
|
4049
|
+
[varNames.avatar.sizes[0].size]: rem(theme2.avatar.sizes[0].size),
|
|
4050
|
+
[varNames.avatar.sizes[1].distance]: rem(theme2.avatar.sizes[1].distance),
|
|
4051
|
+
[varNames.avatar.sizes[1].size]: rem(theme2.avatar.sizes[1].size),
|
|
4052
|
+
[varNames.avatar.sizes[2].distance]: rem(theme2.avatar.sizes[2].distance),
|
|
4053
|
+
[varNames.avatar.sizes[2].size]: rem(theme2.avatar.sizes[2].size),
|
|
4054
|
+
[varNames.avatar.sizes[3].distance]: rem(theme2.avatar.sizes[3].distance),
|
|
4055
|
+
[varNames.avatar.sizes[3].size]: rem(theme2.avatar.sizes[3].size)
|
|
4151
4056
|
};
|
|
4152
4057
|
}
|
|
4153
|
-
function buildButtonThemeProperties(
|
|
4058
|
+
function buildButtonThemeProperties(theme2) {
|
|
4154
4059
|
return {
|
|
4155
|
-
[varNames.button.border.width]: px(
|
|
4156
|
-
[varNames.button.focusRing.offset]: px(
|
|
4157
|
-
[varNames.button.focusRing.width]: px(
|
|
4060
|
+
[varNames.button.border.width]: px(theme2.button.border.width),
|
|
4061
|
+
[varNames.button.focusRing.offset]: px(theme2.button.focusRing.offset),
|
|
4062
|
+
[varNames.button.focusRing.width]: px(theme2.button.focusRing.width)
|
|
4158
4063
|
};
|
|
4159
4064
|
}
|
|
4160
|
-
function buildContainerThemeProperties(
|
|
4065
|
+
function buildContainerThemeProperties(theme2) {
|
|
4161
4066
|
return {
|
|
4162
|
-
[varNames.container[0]]: rem(
|
|
4163
|
-
[varNames.container[1]]: rem(
|
|
4164
|
-
[varNames.container[2]]: rem(
|
|
4165
|
-
[varNames.container[3]]: rem(
|
|
4166
|
-
[varNames.container[4]]: rem(
|
|
4167
|
-
[varNames.container[5]]: rem(
|
|
4067
|
+
[varNames.container[0]]: rem(theme2.container[0]),
|
|
4068
|
+
[varNames.container[1]]: rem(theme2.container[1]),
|
|
4069
|
+
[varNames.container[2]]: rem(theme2.container[2]),
|
|
4070
|
+
[varNames.container[3]]: rem(theme2.container[3]),
|
|
4071
|
+
[varNames.container[4]]: rem(theme2.container[4]),
|
|
4072
|
+
[varNames.container[5]]: rem(theme2.container[5])
|
|
4168
4073
|
};
|
|
4169
4074
|
}
|
|
4170
|
-
function buildFontCodeThemeProperties(theme) {
|
|
4171
|
-
const v = varNames.font.code, t = theme.font.code, props = {
|
|
4075
|
+
function buildFontCodeThemeProperties(theme$1) {
|
|
4076
|
+
const v = varNames.font.code, t = theme$1.font.code, props = {
|
|
4172
4077
|
[v.family]: t.family,
|
|
4173
4078
|
[v.featureSettings]: t.featureSettings || "normal",
|
|
4174
4079
|
[v.weights.regular]: t.weights.regular,
|
|
@@ -4176,14 +4081,14 @@ function buildFontCodeThemeProperties(theme) {
|
|
|
4176
4081
|
[v.weights.semibold]: t.weights.semibold,
|
|
4177
4082
|
[v.weights.bold]: t.weights.bold
|
|
4178
4083
|
};
|
|
4179
|
-
for (const size of FONT_CODE_SIZE) {
|
|
4180
|
-
const _v = varNames.font.code.sizes[size], _t = theme.font.code.sizes[size];
|
|
4084
|
+
for (const size of theme.FONT_CODE_SIZE) {
|
|
4085
|
+
const _v = varNames.font.code.sizes[size], _t = theme$1.font.code.sizes[size];
|
|
4181
4086
|
props[_v.fontSize] = rem(_t.fontSize), props[_v.lineHeight] = rem(_t.lineHeight), props[_v.ascenderHeight] = rem(_t.ascenderHeight), props[_v.descenderHeight] = rem(_t.descenderHeight), props[_v.letterSpacing] = rem(_t.letterSpacing), props[_v.iconSize] = rem(_t.iconSize);
|
|
4182
4087
|
}
|
|
4183
4088
|
return props;
|
|
4184
4089
|
}
|
|
4185
|
-
function buildFontHeadingThemeProperties(theme) {
|
|
4186
|
-
const v = varNames.font.heading, t = theme.font.heading, props = {
|
|
4090
|
+
function buildFontHeadingThemeProperties(theme$1) {
|
|
4091
|
+
const v = varNames.font.heading, t = theme$1.font.heading, props = {
|
|
4187
4092
|
[v.family]: t.family,
|
|
4188
4093
|
[v.featureSettings]: t.featureSettings,
|
|
4189
4094
|
[v.weights.regular]: t.weights.regular,
|
|
@@ -4191,14 +4096,14 @@ function buildFontHeadingThemeProperties(theme) {
|
|
|
4191
4096
|
[v.weights.semibold]: t.weights.semibold,
|
|
4192
4097
|
[v.weights.bold]: t.weights.bold
|
|
4193
4098
|
};
|
|
4194
|
-
for (const size of FONT_HEADING_SIZE) {
|
|
4099
|
+
for (const size of theme.FONT_HEADING_SIZE) {
|
|
4195
4100
|
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4196
4101
|
props[_v.fontSize] = rem(_t.fontSize), props[_v.lineHeight] = rem(_t.lineHeight), props[_v.ascenderHeight] = rem(_t.ascenderHeight), props[_v.descenderHeight] = rem(_t.descenderHeight), props[_v.letterSpacing] = rem(_t.letterSpacing), props[_v.iconSize] = rem(_t.iconSize);
|
|
4197
4102
|
}
|
|
4198
4103
|
return props;
|
|
4199
4104
|
}
|
|
4200
|
-
function buildFontLabelThemeProperties(theme) {
|
|
4201
|
-
const v = varNames.font.label, t = theme.font.label, props = {
|
|
4105
|
+
function buildFontLabelThemeProperties(theme$1) {
|
|
4106
|
+
const v = varNames.font.label, t = theme$1.font.label, props = {
|
|
4202
4107
|
[v.family]: t.family,
|
|
4203
4108
|
[v.featureSettings]: t.featureSettings,
|
|
4204
4109
|
[v.weights.regular]: t.weights.regular,
|
|
@@ -4206,14 +4111,14 @@ function buildFontLabelThemeProperties(theme) {
|
|
|
4206
4111
|
[v.weights.semibold]: t.weights.semibold,
|
|
4207
4112
|
[v.weights.bold]: t.weights.bold
|
|
4208
4113
|
};
|
|
4209
|
-
for (const size of FONT_LABEL_SIZE) {
|
|
4114
|
+
for (const size of theme.FONT_LABEL_SIZE) {
|
|
4210
4115
|
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4211
4116
|
props[_v.fontSize] = rem(_t.fontSize), props[_v.lineHeight] = rem(_t.lineHeight), props[_v.ascenderHeight] = rem(_t.ascenderHeight), props[_v.descenderHeight] = rem(_t.descenderHeight), props[_v.letterSpacing] = rem(_t.letterSpacing), props[_v.iconSize] = rem(_t.iconSize);
|
|
4212
4117
|
}
|
|
4213
4118
|
return props;
|
|
4214
4119
|
}
|
|
4215
|
-
function buildFontTextThemeProperties(theme) {
|
|
4216
|
-
const v = varNames.font.text, t = theme.font.text, props = {
|
|
4120
|
+
function buildFontTextThemeProperties(theme$1) {
|
|
4121
|
+
const v = varNames.font.text, t = theme$1.font.text, props = {
|
|
4217
4122
|
[v.family]: t.family,
|
|
4218
4123
|
[v.featureSettings]: t.featureSettings,
|
|
4219
4124
|
[v.weights.regular]: t.weights.regular,
|
|
@@ -4221,208 +4126,301 @@ function buildFontTextThemeProperties(theme) {
|
|
|
4221
4126
|
[v.weights.semibold]: t.weights.semibold,
|
|
4222
4127
|
[v.weights.bold]: t.weights.bold
|
|
4223
4128
|
};
|
|
4224
|
-
for (const size of FONT_TEXT_SIZE) {
|
|
4129
|
+
for (const size of theme.FONT_TEXT_SIZE) {
|
|
4225
4130
|
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4226
4131
|
props[_v.fontSize] = rem(_t.fontSize), props[_v.lineHeight] = rem(_t.lineHeight), props[_v.ascenderHeight] = rem(_t.ascenderHeight), props[_v.descenderHeight] = rem(_t.descenderHeight), props[_v.letterSpacing] = rem(_t.letterSpacing), props[_v.iconSize] = rem(_t.iconSize);
|
|
4227
4132
|
}
|
|
4228
4133
|
return props;
|
|
4229
4134
|
}
|
|
4230
|
-
function buildInputThemeProperties(
|
|
4135
|
+
function buildInputThemeProperties(theme2) {
|
|
4231
4136
|
return {
|
|
4232
|
-
[varNames.input.border.width]: px(
|
|
4233
|
-
[varNames.input.checkbox.focusRing.offset]: px(
|
|
4234
|
-
[varNames.input.checkbox.focusRing.width]: px(
|
|
4235
|
-
[varNames.input.checkbox.size]: rem(
|
|
4236
|
-
[varNames.input.radio.focusRing.offset]: px(
|
|
4237
|
-
[varNames.input.radio.focusRing.width]: px(
|
|
4238
|
-
[varNames.input.radio.markSize]: rem(
|
|
4239
|
-
[varNames.input.radio.size]: rem(
|
|
4240
|
-
[varNames.input.select.focusRing.offset]: px(
|
|
4241
|
-
[varNames.input.select.focusRing.width]: px(
|
|
4242
|
-
[varNames.input.switch.focusRing.offset]: px(
|
|
4243
|
-
[varNames.input.switch.focusRing.width]: px(
|
|
4244
|
-
[varNames.input.switch.height]: rem(
|
|
4245
|
-
[varNames.input.switch.padding]: rem(
|
|
4246
|
-
[varNames.input.switch.transitionDurationMs]: `${
|
|
4247
|
-
[varNames.input.switch.transitionTimingFunction]:
|
|
4248
|
-
[varNames.input.switch.width]: rem(
|
|
4249
|
-
[varNames.input.text.focusRing.offset]: px(
|
|
4250
|
-
[varNames.input.text.focusRing.width]: px(
|
|
4137
|
+
[varNames.input.border.width]: px(theme2.input.border.width),
|
|
4138
|
+
[varNames.input.checkbox.focusRing.offset]: px(theme2.input.checkbox.focusRing.offset),
|
|
4139
|
+
[varNames.input.checkbox.focusRing.width]: px(theme2.input.checkbox.focusRing.width),
|
|
4140
|
+
[varNames.input.checkbox.size]: rem(theme2.input.checkbox.size),
|
|
4141
|
+
[varNames.input.radio.focusRing.offset]: px(theme2.input.radio.focusRing.offset),
|
|
4142
|
+
[varNames.input.radio.focusRing.width]: px(theme2.input.radio.focusRing.width),
|
|
4143
|
+
[varNames.input.radio.markSize]: rem(theme2.input.radio.markSize),
|
|
4144
|
+
[varNames.input.radio.size]: rem(theme2.input.radio.size),
|
|
4145
|
+
[varNames.input.select.focusRing.offset]: px(theme2.input.select.focusRing.offset),
|
|
4146
|
+
[varNames.input.select.focusRing.width]: px(theme2.input.select.focusRing.width),
|
|
4147
|
+
[varNames.input.switch.focusRing.offset]: px(theme2.input.switch.focusRing.offset),
|
|
4148
|
+
[varNames.input.switch.focusRing.width]: px(theme2.input.switch.focusRing.width),
|
|
4149
|
+
[varNames.input.switch.height]: rem(theme2.input.switch.height),
|
|
4150
|
+
[varNames.input.switch.padding]: rem(theme2.input.switch.padding),
|
|
4151
|
+
[varNames.input.switch.transitionDurationMs]: `${theme2.input.switch.transitionDurationMs}ms`,
|
|
4152
|
+
[varNames.input.switch.transitionTimingFunction]: theme2.input.switch.transitionTimingFunction,
|
|
4153
|
+
[varNames.input.switch.width]: rem(theme2.input.switch.width),
|
|
4154
|
+
[varNames.input.text.focusRing.offset]: px(theme2.input.text.focusRing.offset),
|
|
4155
|
+
[varNames.input.text.focusRing.width]: px(theme2.input.text.focusRing.width)
|
|
4251
4156
|
};
|
|
4252
4157
|
}
|
|
4253
|
-
function buildRadiusThemeProperties(
|
|
4158
|
+
function buildRadiusThemeProperties(theme2) {
|
|
4254
4159
|
return {
|
|
4255
|
-
[varNames.radius[0]]: px(
|
|
4256
|
-
[varNames.radius[1]]: px(
|
|
4257
|
-
[varNames.radius[2]]: px(
|
|
4258
|
-
[varNames.radius[3]]: px(
|
|
4259
|
-
[varNames.radius[4]]: px(
|
|
4260
|
-
[varNames.radius[5]]: px(
|
|
4261
|
-
[varNames.radius[6]]: px(
|
|
4160
|
+
[varNames.radius[0]]: px(theme2.radius[0]),
|
|
4161
|
+
[varNames.radius[1]]: px(theme2.radius[1]),
|
|
4162
|
+
[varNames.radius[2]]: px(theme2.radius[2]),
|
|
4163
|
+
[varNames.radius[3]]: px(theme2.radius[3]),
|
|
4164
|
+
[varNames.radius[4]]: px(theme2.radius[4]),
|
|
4165
|
+
[varNames.radius[5]]: px(theme2.radius[5]),
|
|
4166
|
+
[varNames.radius[6]]: px(theme2.radius[6])
|
|
4262
4167
|
};
|
|
4263
4168
|
}
|
|
4264
|
-
function buildShadowThemeProperties(
|
|
4169
|
+
function buildShadowThemeProperties(theme2) {
|
|
4265
4170
|
return {
|
|
4266
|
-
[varNames.shadow[0].umbra]: toBoxShadow(
|
|
4267
|
-
[varNames.shadow[0].penumbra]: toBoxShadow(
|
|
4268
|
-
[varNames.shadow[0].ambient]: toBoxShadow(
|
|
4269
|
-
[varNames.shadow[1].umbra]: toBoxShadow(
|
|
4270
|
-
[varNames.shadow[1].penumbra]: toBoxShadow(
|
|
4271
|
-
[varNames.shadow[1].ambient]: toBoxShadow(
|
|
4272
|
-
[varNames.shadow[2].umbra]: toBoxShadow(
|
|
4273
|
-
[varNames.shadow[2].penumbra]: toBoxShadow(
|
|
4274
|
-
[varNames.shadow[2].ambient]: toBoxShadow(
|
|
4275
|
-
[varNames.shadow[3].umbra]: toBoxShadow(
|
|
4276
|
-
[varNames.shadow[3].penumbra]: toBoxShadow(
|
|
4277
|
-
[varNames.shadow[3].ambient]: toBoxShadow(
|
|
4278
|
-
[varNames.shadow[4].umbra]: toBoxShadow(
|
|
4279
|
-
[varNames.shadow[4].penumbra]: toBoxShadow(
|
|
4280
|
-
[varNames.shadow[4].ambient]: toBoxShadow(
|
|
4281
|
-
[varNames.shadow[5].umbra]: toBoxShadow(
|
|
4282
|
-
[varNames.shadow[5].penumbra]: toBoxShadow(
|
|
4283
|
-
[varNames.shadow[5].ambient]: toBoxShadow(
|
|
4171
|
+
[varNames.shadow[0].umbra]: toBoxShadow(theme2.shadow[0]?.umbra),
|
|
4172
|
+
[varNames.shadow[0].penumbra]: toBoxShadow(theme2.shadow[0]?.penumbra),
|
|
4173
|
+
[varNames.shadow[0].ambient]: toBoxShadow(theme2.shadow[0]?.ambient),
|
|
4174
|
+
[varNames.shadow[1].umbra]: toBoxShadow(theme2.shadow[1]?.umbra),
|
|
4175
|
+
[varNames.shadow[1].penumbra]: toBoxShadow(theme2.shadow[1]?.penumbra),
|
|
4176
|
+
[varNames.shadow[1].ambient]: toBoxShadow(theme2.shadow[1]?.ambient),
|
|
4177
|
+
[varNames.shadow[2].umbra]: toBoxShadow(theme2.shadow[2]?.umbra),
|
|
4178
|
+
[varNames.shadow[2].penumbra]: toBoxShadow(theme2.shadow[2]?.penumbra),
|
|
4179
|
+
[varNames.shadow[2].ambient]: toBoxShadow(theme2.shadow[2]?.ambient),
|
|
4180
|
+
[varNames.shadow[3].umbra]: toBoxShadow(theme2.shadow[3]?.umbra),
|
|
4181
|
+
[varNames.shadow[3].penumbra]: toBoxShadow(theme2.shadow[3]?.penumbra),
|
|
4182
|
+
[varNames.shadow[3].ambient]: toBoxShadow(theme2.shadow[3]?.ambient),
|
|
4183
|
+
[varNames.shadow[4].umbra]: toBoxShadow(theme2.shadow[4]?.umbra),
|
|
4184
|
+
[varNames.shadow[4].penumbra]: toBoxShadow(theme2.shadow[4]?.penumbra),
|
|
4185
|
+
[varNames.shadow[4].ambient]: toBoxShadow(theme2.shadow[4]?.ambient),
|
|
4186
|
+
[varNames.shadow[5].umbra]: toBoxShadow(theme2.shadow[5]?.umbra),
|
|
4187
|
+
[varNames.shadow[5].penumbra]: toBoxShadow(theme2.shadow[5]?.penumbra),
|
|
4188
|
+
[varNames.shadow[5].ambient]: toBoxShadow(theme2.shadow[5]?.ambient)
|
|
4284
4189
|
};
|
|
4285
4190
|
}
|
|
4286
|
-
function buildSpaceThemeProperties(
|
|
4191
|
+
function buildSpaceThemeProperties(theme2) {
|
|
4287
4192
|
return {
|
|
4288
|
-
[varNames.space[0]]: px(
|
|
4289
|
-
[varNames.space[0.5]]: px(
|
|
4290
|
-
[varNames.space[1]]: px(
|
|
4291
|
-
[varNames.space[2]]: px(
|
|
4292
|
-
[varNames.space[3]]: px(
|
|
4293
|
-
[varNames.space[4]]: px(
|
|
4294
|
-
[varNames.space[5]]: px(
|
|
4295
|
-
[varNames.space[6]]: px(
|
|
4296
|
-
[varNames.space[7]]: px(
|
|
4297
|
-
[varNames.space[8]]: px(
|
|
4298
|
-
[varNames.space[9]]: px(
|
|
4193
|
+
[varNames.space[0]]: px(theme2.space[0]),
|
|
4194
|
+
[varNames.space[0.5]]: px(theme2.space[1] / 2),
|
|
4195
|
+
[varNames.space[1]]: px(theme2.space[1]),
|
|
4196
|
+
[varNames.space[2]]: px(theme2.space[2]),
|
|
4197
|
+
[varNames.space[3]]: px(theme2.space[3]),
|
|
4198
|
+
[varNames.space[4]]: px(theme2.space[4]),
|
|
4199
|
+
[varNames.space[5]]: px(theme2.space[5]),
|
|
4200
|
+
[varNames.space[6]]: px(theme2.space[6]),
|
|
4201
|
+
[varNames.space[7]]: px(theme2.space[7]),
|
|
4202
|
+
[varNames.space[8]]: px(theme2.space[8]),
|
|
4203
|
+
[varNames.space[9]]: px(theme2.space[9])
|
|
4299
4204
|
};
|
|
4300
4205
|
}
|
|
4301
|
-
function buildColorThemeProperties(theme) {
|
|
4206
|
+
function buildColorThemeProperties(theme$1) {
|
|
4302
4207
|
const props = {};
|
|
4303
4208
|
for (const scheme of THEME_COLOR_SCHEMES)
|
|
4304
|
-
for (const cardTone of THEME_COLOR_CARD_TONES) {
|
|
4305
|
-
Object.assign(props, buildColorAvatarThemeProperties(theme, {
|
|
4209
|
+
for (const cardTone of theme.THEME_COLOR_CARD_TONES) {
|
|
4210
|
+
Object.assign(props, buildColorAvatarThemeProperties(theme$1, {
|
|
4306
4211
|
scheme,
|
|
4307
4212
|
cardTone
|
|
4308
|
-
})), Object.assign(props, buildColorCardThemeProperties(theme, {
|
|
4213
|
+
})), Object.assign(props, buildColorCardThemeProperties(theme$1, {
|
|
4309
4214
|
scheme,
|
|
4310
4215
|
cardTone
|
|
4311
4216
|
}));
|
|
4312
4217
|
for (const colorVariant of THEME_COLOR_VARIANTS)
|
|
4313
|
-
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
4314
|
-
const v = varNames.color[scheme][cardTone][colorVariant][elementTone], t = theme._tokens.color[cardTone].variant[colorVariant][elementTone], context = {
|
|
4218
|
+
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
4219
|
+
const v = varNames.color[scheme][cardTone][colorVariant][elementTone], t = theme$1._tokens.color[cardTone].variant[colorVariant][elementTone], context = {
|
|
4220
|
+
bgValue: "transparent",
|
|
4315
4221
|
bgVar: v.bg[0],
|
|
4316
4222
|
hue: t._hue,
|
|
4317
4223
|
scheme
|
|
4318
4224
|
};
|
|
4319
4225
|
Object.assign(props, {
|
|
4320
|
-
[v.bg[0]]: renderColor(t.bg[0], context),
|
|
4226
|
+
[v.bg[0]]: theme.renderColor(t.bg[0], context),
|
|
4321
4227
|
[v.bg[1]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 25%)`,
|
|
4322
4228
|
[v.bg[2]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 50%)`,
|
|
4323
4229
|
[v.bg[3]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 75%)`,
|
|
4324
|
-
[v.bg[4]]: renderColor(t.bg[4], context),
|
|
4325
|
-
[v.border[0]]: renderColor(t.border[0], context),
|
|
4230
|
+
[v.bg[4]]: theme.renderColor(t.bg[4], context),
|
|
4231
|
+
[v.border[0]]: theme.renderColor(t.border[0], context),
|
|
4326
4232
|
[v.border[1]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 25%)`,
|
|
4327
4233
|
[v.border[2]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 50%)`,
|
|
4328
4234
|
[v.border[3]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 75%)`,
|
|
4329
|
-
[v.border[4]]: renderColor(t.border[4], context),
|
|
4330
|
-
[v.fg[0]]: renderColor(t.fg[0], context),
|
|
4235
|
+
[v.border[4]]: theme.renderColor(t.border[4], context),
|
|
4236
|
+
[v.fg[0]]: theme.renderColor(t.fg[0], context),
|
|
4331
4237
|
[v.fg[1]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 25%)`,
|
|
4332
4238
|
[v.fg[2]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 50%)`,
|
|
4333
4239
|
[v.fg[3]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 75%)`,
|
|
4334
|
-
[v.fg[4]]: renderColor(t.fg[4], context)
|
|
4240
|
+
[v.fg[4]]: theme.renderColor(t.fg[4], context)
|
|
4335
4241
|
});
|
|
4336
4242
|
}
|
|
4337
4243
|
}
|
|
4338
4244
|
return props;
|
|
4339
4245
|
}
|
|
4340
|
-
function buildColorAvatarThemeProperties(theme, options) {
|
|
4246
|
+
function buildColorAvatarThemeProperties(theme$1, options) {
|
|
4341
4247
|
const {
|
|
4342
4248
|
scheme,
|
|
4343
4249
|
cardTone
|
|
4344
|
-
} = options, v = varNames.color[scheme][cardTone], t = theme._tokens.color[cardTone], props = {};
|
|
4345
|
-
for (const hue of HUES) {
|
|
4250
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme$1._tokens.color[cardTone], props = {};
|
|
4251
|
+
for (const hue of theme.HUES) {
|
|
4346
4252
|
const context = {
|
|
4253
|
+
bgValue: "transparent",
|
|
4347
4254
|
bgVar: varNames.color.bg,
|
|
4348
4255
|
hue: t.avatar[hue]._hue ?? hue,
|
|
4349
4256
|
scheme
|
|
4350
4257
|
};
|
|
4351
4258
|
Object.assign(props, {
|
|
4352
|
-
[v.avatar[hue].bg]: renderColor(t.avatar[hue].bg, context),
|
|
4353
|
-
[v.avatar[hue].fg]: renderColor(t.avatar[hue].fg, context)
|
|
4259
|
+
[v.avatar[hue].bg]: theme.renderColor(t.avatar[hue].bg, context),
|
|
4260
|
+
[v.avatar[hue].fg]: theme.renderColor(t.avatar[hue].fg, context)
|
|
4354
4261
|
});
|
|
4355
4262
|
}
|
|
4356
4263
|
return props;
|
|
4357
4264
|
}
|
|
4358
|
-
function buildColorCardThemeProperties(theme, options) {
|
|
4265
|
+
function buildColorCardThemeProperties(theme$1, options) {
|
|
4359
4266
|
const {
|
|
4360
4267
|
scheme,
|
|
4361
4268
|
cardTone
|
|
4362
|
-
} = options, v = varNames.color[scheme][cardTone], t = theme._tokens.color[cardTone], context = {
|
|
4269
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme$1._tokens.color[cardTone], context = {
|
|
4270
|
+
bgValue: "transparent",
|
|
4363
4271
|
bgVar: varNames.color.bg,
|
|
4364
4272
|
hue: t._hue,
|
|
4365
4273
|
scheme
|
|
4366
4274
|
};
|
|
4367
4275
|
return {
|
|
4368
4276
|
// backdrop
|
|
4369
|
-
[v.backdrop]: renderColor(t.backdrop, context),
|
|
4277
|
+
[v.backdrop]: theme.renderColor(t.backdrop, context),
|
|
4370
4278
|
// code
|
|
4371
|
-
[v.code.bg]: renderColor(t.code.bg, context),
|
|
4372
|
-
[v.code.fg]: renderColor(t.code.fg, context),
|
|
4279
|
+
[v.code.bg]: theme.renderColor(t.code.bg, context),
|
|
4280
|
+
[v.code.fg]: theme.renderColor(t.code.fg, context),
|
|
4373
4281
|
// code / token
|
|
4374
|
-
[v.code.token.atrule]: renderColor(t.code.token.atrule, context),
|
|
4375
|
-
[v.code.token.attrName]: renderColor(t.code.token.attrName, context),
|
|
4376
|
-
[v.code.token.attrValue]: renderColor(t.code.token.attrValue, context),
|
|
4377
|
-
[v.code.token.attribute]: renderColor(t.code.token.attribute, context),
|
|
4378
|
-
[v.code.token.boolean]: renderColor(t.code.token.boolean, context),
|
|
4379
|
-
[v.code.token.builtin]: renderColor(t.code.token.builtin, context),
|
|
4380
|
-
[v.code.token.cdata]: renderColor(t.code.token.cdata, context),
|
|
4381
|
-
[v.code.token.char]: renderColor(t.code.token.char, context),
|
|
4382
|
-
[v.code.token.className]: renderColor(t.code.token.className, context),
|
|
4383
|
-
[v.code.token.class]: renderColor(t.code.token.class, context),
|
|
4384
|
-
[v.code.token.comment]: renderColor(t.code.token.comment, context),
|
|
4385
|
-
[v.code.token.constant]: renderColor(t.code.token.constant, context),
|
|
4386
|
-
[v.code.token.deleted]: renderColor(t.code.token.deleted, context),
|
|
4387
|
-
[v.code.token.doctype]: renderColor(t.code.token.doctype, context),
|
|
4388
|
-
[v.code.token.entity]: renderColor(t.code.token.entity, context),
|
|
4389
|
-
[v.code.token.function]: renderColor(t.code.token.function, context),
|
|
4390
|
-
[v.code.token.hexcode]: renderColor(t.code.token.hexcode, context),
|
|
4391
|
-
[v.code.token.id]: renderColor(t.code.token.id, context),
|
|
4392
|
-
[v.code.token.important]: renderColor(t.code.token.important, context),
|
|
4393
|
-
[v.code.token.inserted]: renderColor(t.code.token.inserted, context),
|
|
4394
|
-
[v.code.token.keyword]: renderColor(t.code.token.keyword, context),
|
|
4395
|
-
[v.code.token.number]: renderColor(t.code.token.number, context),
|
|
4396
|
-
[v.code.token.operator]: renderColor(t.code.token.operator, context),
|
|
4397
|
-
[v.code.token.prolog]: renderColor(t.code.token.prolog, context),
|
|
4398
|
-
[v.code.token.property]: renderColor(t.code.token.property, context),
|
|
4399
|
-
[v.code.token.pseudoClass]: renderColor(t.code.token.pseudoClass, context),
|
|
4400
|
-
[v.code.token.pseudoElement]: renderColor(t.code.token.pseudoElement, context),
|
|
4401
|
-
[v.code.token.punctuation]: renderColor(t.code.token.punctuation, context),
|
|
4402
|
-
[v.code.token.regex]: renderColor(t.code.token.regex, context),
|
|
4403
|
-
[v.code.token.selector]: renderColor(t.code.token.selector, context),
|
|
4404
|
-
[v.code.token.string]: renderColor(t.code.token.string, context),
|
|
4405
|
-
[v.code.token.symbol]: renderColor(t.code.token.symbol, context),
|
|
4406
|
-
[v.code.token.tag]: renderColor(t.code.token.tag, context),
|
|
4407
|
-
[v.code.token.unit]: renderColor(t.code.token.unit, context),
|
|
4408
|
-
[v.code.token.url]: renderColor(t.code.token.url, context),
|
|
4409
|
-
[v.code.token.variable]: renderColor(t.code.token.variable, context),
|
|
4282
|
+
[v.code.token.atrule]: theme.renderColor(t.code.token.atrule, context),
|
|
4283
|
+
[v.code.token.attrName]: theme.renderColor(t.code.token.attrName, context),
|
|
4284
|
+
[v.code.token.attrValue]: theme.renderColor(t.code.token.attrValue, context),
|
|
4285
|
+
[v.code.token.attribute]: theme.renderColor(t.code.token.attribute, context),
|
|
4286
|
+
[v.code.token.boolean]: theme.renderColor(t.code.token.boolean, context),
|
|
4287
|
+
[v.code.token.builtin]: theme.renderColor(t.code.token.builtin, context),
|
|
4288
|
+
[v.code.token.cdata]: theme.renderColor(t.code.token.cdata, context),
|
|
4289
|
+
[v.code.token.char]: theme.renderColor(t.code.token.char, context),
|
|
4290
|
+
[v.code.token.className]: theme.renderColor(t.code.token.className, context),
|
|
4291
|
+
[v.code.token.class]: theme.renderColor(t.code.token.class, context),
|
|
4292
|
+
[v.code.token.comment]: theme.renderColor(t.code.token.comment, context),
|
|
4293
|
+
[v.code.token.constant]: theme.renderColor(t.code.token.constant, context),
|
|
4294
|
+
[v.code.token.deleted]: theme.renderColor(t.code.token.deleted, context),
|
|
4295
|
+
[v.code.token.doctype]: theme.renderColor(t.code.token.doctype, context),
|
|
4296
|
+
[v.code.token.entity]: theme.renderColor(t.code.token.entity, context),
|
|
4297
|
+
[v.code.token.function]: theme.renderColor(t.code.token.function, context),
|
|
4298
|
+
[v.code.token.hexcode]: theme.renderColor(t.code.token.hexcode, context),
|
|
4299
|
+
[v.code.token.id]: theme.renderColor(t.code.token.id, context),
|
|
4300
|
+
[v.code.token.important]: theme.renderColor(t.code.token.important, context),
|
|
4301
|
+
[v.code.token.inserted]: theme.renderColor(t.code.token.inserted, context),
|
|
4302
|
+
[v.code.token.keyword]: theme.renderColor(t.code.token.keyword, context),
|
|
4303
|
+
[v.code.token.number]: theme.renderColor(t.code.token.number, context),
|
|
4304
|
+
[v.code.token.operator]: theme.renderColor(t.code.token.operator, context),
|
|
4305
|
+
[v.code.token.prolog]: theme.renderColor(t.code.token.prolog, context),
|
|
4306
|
+
[v.code.token.property]: theme.renderColor(t.code.token.property, context),
|
|
4307
|
+
[v.code.token.pseudoClass]: theme.renderColor(t.code.token.pseudoClass, context),
|
|
4308
|
+
[v.code.token.pseudoElement]: theme.renderColor(t.code.token.pseudoElement, context),
|
|
4309
|
+
[v.code.token.punctuation]: theme.renderColor(t.code.token.punctuation, context),
|
|
4310
|
+
[v.code.token.regex]: theme.renderColor(t.code.token.regex, context),
|
|
4311
|
+
[v.code.token.selector]: theme.renderColor(t.code.token.selector, context),
|
|
4312
|
+
[v.code.token.string]: theme.renderColor(t.code.token.string, context),
|
|
4313
|
+
[v.code.token.symbol]: theme.renderColor(t.code.token.symbol, context),
|
|
4314
|
+
[v.code.token.tag]: theme.renderColor(t.code.token.tag, context),
|
|
4315
|
+
[v.code.token.unit]: theme.renderColor(t.code.token.unit, context),
|
|
4316
|
+
[v.code.token.url]: theme.renderColor(t.code.token.url, context),
|
|
4317
|
+
[v.code.token.variable]: theme.renderColor(t.code.token.variable, context),
|
|
4410
4318
|
// focus ring
|
|
4411
|
-
[v.focusRing]: renderColor(t.focusRing, context),
|
|
4319
|
+
[v.focusRing]: theme.renderColor(t.focusRing, context),
|
|
4412
4320
|
// link
|
|
4413
|
-
[v.link.fg]: renderColor(t.link.fg, context),
|
|
4321
|
+
[v.link.fg]: theme.renderColor(t.link.fg, context),
|
|
4414
4322
|
// shadow
|
|
4415
|
-
[v.shadow.outline]: renderColor(t.shadow.outline, context),
|
|
4416
|
-
[v.shadow.umbra]: renderColor(t.shadow.umbra, context),
|
|
4417
|
-
[v.shadow.penumbra]: renderColor(t.shadow.penumbra, context),
|
|
4418
|
-
[v.shadow.ambient]: renderColor(t.shadow.ambient, context)
|
|
4323
|
+
[v.shadow.outline]: theme.renderColor(t.shadow.outline, context),
|
|
4324
|
+
[v.shadow.umbra]: theme.renderColor(t.shadow.umbra, context),
|
|
4325
|
+
[v.shadow.penumbra]: theme.renderColor(t.shadow.penumbra, context),
|
|
4326
|
+
[v.shadow.ambient]: theme.renderColor(t.shadow.ambient, context)
|
|
4419
4327
|
};
|
|
4420
4328
|
}
|
|
4421
|
-
function
|
|
4422
|
-
return
|
|
4329
|
+
function _compileTheme(theme2) {
|
|
4330
|
+
return theme2.v3 ? _compileTheme_v3(theme2.v3) : theme2.v2 ? `/* v2 - not supported */
|
|
4423
4331
|
` : `/* v0 - not supported */
|
|
4424
4332
|
`;
|
|
4425
4333
|
}
|
|
4334
|
+
function _resp(prefix, prop) {
|
|
4335
|
+
if (!(prop === void 0 || prop === !1))
|
|
4336
|
+
return Array.isArray(prop) ? prop.map((value, index) => {
|
|
4337
|
+
if (value === void 0 || typeof prop == "boolean" && prop === !1) return;
|
|
4338
|
+
const className = (typeof value == "boolean" ? [prefix] : [prefix, value]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
4339
|
+
return index === 0 ? className : `${index}:${className}`;
|
|
4340
|
+
}).filter(Boolean).join(" ") : (typeof prop == "boolean" ? [prefix] : [prefix, prop]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
4341
|
+
}
|
|
4342
|
+
function _getClassNames(...classNames) {
|
|
4343
|
+
return classNames.map((n) => typeof n == "string" && n.trim()).filter(Boolean).join(" ").split(" ");
|
|
4344
|
+
}
|
|
4345
|
+
function composeClassNames(...classNames) {
|
|
4346
|
+
return unique(_getClassNames(...classNames)).join(" ") || void 0;
|
|
4347
|
+
}
|
|
4348
|
+
function unique(array) {
|
|
4349
|
+
return Array.from(new Set(array));
|
|
4350
|
+
}
|
|
4351
|
+
function border(props) {
|
|
4352
|
+
return composeClassNames(_resp("border", props.border), _resp("border-t", props.borderTop), _resp("border-r", props.borderRight), _resp("border-b", props.borderBottom), _resp("border-l", props.borderLeft));
|
|
4353
|
+
}
|
|
4354
|
+
function display(props) {
|
|
4355
|
+
return composeClassNames(_resp(void 0, props.display));
|
|
4356
|
+
}
|
|
4357
|
+
function flex(props) {
|
|
4358
|
+
return composeClassNames(_resp("flex-align", props.align), _resp("f", props.direction), _resp("flex-justify", props.justify), _resp("flex", props.wrap));
|
|
4359
|
+
}
|
|
4360
|
+
function flexItem(props) {
|
|
4361
|
+
return composeClassNames(_resp("f", props.flex));
|
|
4362
|
+
}
|
|
4363
|
+
function font(props) {
|
|
4364
|
+
return composeClassNames("font", props.weight && `font-${props.weight}`);
|
|
4365
|
+
}
|
|
4366
|
+
function gap(props) {
|
|
4367
|
+
return composeClassNames(_resp("g", props.gap), _resp("gx", props.gapX), _resp("gy", props.gapY));
|
|
4368
|
+
}
|
|
4369
|
+
function grid(props) {
|
|
4370
|
+
return composeClassNames(_resp("auto-cols", props.autoCols), _resp("auto-flow", props.autoFlow), _resp("auto-rows", props.autoRows), _resp("cols", props.columns), _resp("rows", props.rows));
|
|
4371
|
+
}
|
|
4372
|
+
function gridItem(props) {
|
|
4373
|
+
return composeClassNames(_resp("col", props.column), _resp("col-start", props.columnStart), _resp("col-end", props.columnEnd), _resp("row", props.row), _resp("row-start", props.rowStart), _resp("row-end", props.rowEnd));
|
|
4374
|
+
}
|
|
4375
|
+
function height(props) {
|
|
4376
|
+
return composeClassNames(_resp("h", props.height));
|
|
4377
|
+
}
|
|
4378
|
+
function inset(props) {
|
|
4379
|
+
return composeClassNames(_resp("inset", props.inset), _resp("top", props.insetTop), _resp("right", props.insetRight), _resp("bottom", props.insetBottom), _resp("left", props.insetLeft));
|
|
4380
|
+
}
|
|
4381
|
+
function margin(props) {
|
|
4382
|
+
return composeClassNames(_resp("m", props.margin), _resp("mx", props.marginX), _resp("my", props.marginY), _resp("mt", props.marginTop), _resp("mr", props.marginRight), _resp("mb", props.marginBottom), _resp("ml", props.marginLeft));
|
|
4383
|
+
}
|
|
4384
|
+
function maxWidth(props) {
|
|
4385
|
+
return _resp("max-w", props.maxWidth) ?? "";
|
|
4386
|
+
}
|
|
4387
|
+
function minWidth(props) {
|
|
4388
|
+
return _resp("min-w", props.minWidth) ?? "";
|
|
4389
|
+
}
|
|
4390
|
+
function overflow(props) {
|
|
4391
|
+
return composeClassNames(_resp("overflow", props.overflow), _resp("overflow-x", props.overflowX), _resp("overflow-y", props.overflowY));
|
|
4392
|
+
}
|
|
4393
|
+
function padding(props) {
|
|
4394
|
+
return composeClassNames(_resp("p", props.padding), _resp("px", props.paddingX), _resp("py", props.paddingY), _resp("pt", props.paddingTop), _resp("pr", props.paddingRight), _resp("pb", props.paddingBottom), _resp("pl", props.paddingLeft));
|
|
4395
|
+
}
|
|
4396
|
+
function pointerEvents(props) {
|
|
4397
|
+
return composeClassNames(props.pointerEvents && `pointer-events-${props.pointerEvents}`);
|
|
4398
|
+
}
|
|
4399
|
+
function position(props) {
|
|
4400
|
+
return composeClassNames(_resp("position", props.position));
|
|
4401
|
+
}
|
|
4402
|
+
function radius(props) {
|
|
4403
|
+
return composeClassNames(_resp("r", props.radius));
|
|
4404
|
+
}
|
|
4405
|
+
function shadow(props) {
|
|
4406
|
+
return composeClassNames(_resp("shadow", props.shadow));
|
|
4407
|
+
}
|
|
4408
|
+
function textAlign(props) {
|
|
4409
|
+
return composeClassNames(_resp("text-align", props.textAlign));
|
|
4410
|
+
}
|
|
4411
|
+
function scopeClassName(className) {
|
|
4412
|
+
if (className !== void 0)
|
|
4413
|
+
return `${PREFIX}${className.trim()}`;
|
|
4414
|
+
}
|
|
4415
|
+
function _comp(...classNames) {
|
|
4416
|
+
return _getClassNames(...classNames).filter(Boolean).map(scopeClassName).join(" ") || void 0;
|
|
4417
|
+
}
|
|
4418
|
+
function textOverflow(props) {
|
|
4419
|
+
return _comp(props.textOverflow && `text-overflow-${props.textOverflow}`);
|
|
4420
|
+
}
|
|
4421
|
+
function width(props) {
|
|
4422
|
+
return _resp("w", props.width) ?? "";
|
|
4423
|
+
}
|
|
4426
4424
|
function breadcrumbs() {
|
|
4427
4425
|
return _comp("breadcrumbs");
|
|
4428
4426
|
}
|
|
@@ -4562,11 +4560,7 @@ function box(props) {
|
|
|
4562
4560
|
);
|
|
4563
4561
|
}
|
|
4564
4562
|
function button(props) {
|
|
4565
|
-
|
|
4566
|
-
mode,
|
|
4567
|
-
tone
|
|
4568
|
-
} = props;
|
|
4569
|
-
return _comp("button", variantMap[mode ?? "default"], toneMap[tone ?? "default"], display(props), flexItem(props), radius(props), width(props));
|
|
4563
|
+
return _comp("button", display(props), flexItem(props), radius(props), width(props));
|
|
4570
4564
|
}
|
|
4571
4565
|
function buttonLoadingBox() {
|
|
4572
4566
|
return "button-loading-box";
|
|
@@ -4660,109 +4654,107 @@ function tooltipCard() {
|
|
|
4660
4654
|
function srOnly() {
|
|
4661
4655
|
return _comp(composeClassNames("sr-only"));
|
|
4662
4656
|
}
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
};
|
|
4768
|
-
//# sourceMappingURL=css.mjs.map
|
|
4657
|
+
exports.BREAKPOINTS = BREAKPOINTS;
|
|
4658
|
+
exports.PREFIX = PREFIX;
|
|
4659
|
+
exports._arrow = _arrow;
|
|
4660
|
+
exports._arrowShape = _arrowShape;
|
|
4661
|
+
exports._arrowStroke = _arrowStroke;
|
|
4662
|
+
exports._arrowStrokeMask = _arrowStrokeMask;
|
|
4663
|
+
exports._compilePalette = _compilePalette;
|
|
4664
|
+
exports._compileSystem = _compileSystem;
|
|
4665
|
+
exports._compileTheme = _compileTheme;
|
|
4666
|
+
exports._getClassNames = _getClassNames;
|
|
4667
|
+
exports._input = _input;
|
|
4668
|
+
exports._inputElement = _inputElement;
|
|
4669
|
+
exports._inputPresentation = _inputPresentation;
|
|
4670
|
+
exports._selectable = _selectable;
|
|
4671
|
+
exports._switch = _switch;
|
|
4672
|
+
exports._switchElement = _switchElement;
|
|
4673
|
+
exports._switchPresentation = _switchPresentation;
|
|
4674
|
+
exports._switchThumb = _switchThumb;
|
|
4675
|
+
exports._switchTrack = _switchTrack;
|
|
4676
|
+
exports.animatedSpinnerIcon = animatedSpinnerIcon;
|
|
4677
|
+
exports.avatar = avatar;
|
|
4678
|
+
exports.avatarArrow = avatarArrow;
|
|
4679
|
+
exports.avatarCounter = avatarCounter;
|
|
4680
|
+
exports.avatarImage = avatarImage;
|
|
4681
|
+
exports.avatarInitials = avatarInitials;
|
|
4682
|
+
exports.avatarStack = avatarStack;
|
|
4683
|
+
exports.badge = badge;
|
|
4684
|
+
exports.border = border;
|
|
4685
|
+
exports.box = box;
|
|
4686
|
+
exports.breadcrumbs = breadcrumbs;
|
|
4687
|
+
exports.button = button;
|
|
4688
|
+
exports.buttonLoadingBox = buttonLoadingBox;
|
|
4689
|
+
exports.card = card;
|
|
4690
|
+
exports.checkbox = checkbox;
|
|
4691
|
+
exports.checkboxInput = checkboxInput;
|
|
4692
|
+
exports.code = code;
|
|
4693
|
+
exports.codeSkeleton = codeSkeleton;
|
|
4694
|
+
exports.composeClassNames = composeClassNames;
|
|
4695
|
+
exports.container = container;
|
|
4696
|
+
exports.dialog = dialog;
|
|
4697
|
+
exports.dialogCardRoot = dialogCardRoot;
|
|
4698
|
+
exports.dialogContainer = dialogContainer;
|
|
4699
|
+
exports.dialogContent = dialogContent;
|
|
4700
|
+
exports.dialogFooter = dialogFooter;
|
|
4701
|
+
exports.dialogHeader = dialogHeader;
|
|
4702
|
+
exports.dialogLayout = dialogLayout;
|
|
4703
|
+
exports.display = display;
|
|
4704
|
+
exports.flex = flex;
|
|
4705
|
+
exports.flexItem = flexItem;
|
|
4706
|
+
exports.font = font;
|
|
4707
|
+
exports.gap = gap;
|
|
4708
|
+
exports.grid = grid;
|
|
4709
|
+
exports.gridItem = gridItem;
|
|
4710
|
+
exports.heading = heading;
|
|
4711
|
+
exports.headingSkeleton = headingSkeleton;
|
|
4712
|
+
exports.height = height;
|
|
4713
|
+
exports.inset = inset;
|
|
4714
|
+
exports.isArray = isArray;
|
|
4715
|
+
exports.isRecord = isRecord;
|
|
4716
|
+
exports.kbd = kbd;
|
|
4717
|
+
exports.label = label;
|
|
4718
|
+
exports.labelSkeleton = labelSkeleton;
|
|
4719
|
+
exports.margin = margin;
|
|
4720
|
+
exports.maxWidth = maxWidth;
|
|
4721
|
+
exports.menu = menu;
|
|
4722
|
+
exports.menuDivider = menuDivider;
|
|
4723
|
+
exports.minWidth = minWidth;
|
|
4724
|
+
exports.overflow = overflow;
|
|
4725
|
+
exports.padding = padding;
|
|
4726
|
+
exports.pointerEvents = pointerEvents;
|
|
4727
|
+
exports.popover = popover;
|
|
4728
|
+
exports.popoverCard = popoverCard;
|
|
4729
|
+
exports.position = position;
|
|
4730
|
+
exports.px = px;
|
|
4731
|
+
exports.radio = radio;
|
|
4732
|
+
exports.radius = radius;
|
|
4733
|
+
exports.rem = rem;
|
|
4734
|
+
exports.scopeClassName = scopeClassName;
|
|
4735
|
+
exports.select = select;
|
|
4736
|
+
exports.selectPresentation = selectPresentation;
|
|
4737
|
+
exports.shadow = shadow;
|
|
4738
|
+
exports.skeleton = skeleton;
|
|
4739
|
+
exports.spinner = spinner;
|
|
4740
|
+
exports.srOnly = srOnly;
|
|
4741
|
+
exports.stack = stack;
|
|
4742
|
+
exports.text = text;
|
|
4743
|
+
exports.textAlign = textAlign;
|
|
4744
|
+
exports.textArea = textArea;
|
|
4745
|
+
exports.textInput = textInput;
|
|
4746
|
+
exports.textOverflow = textOverflow;
|
|
4747
|
+
exports.textSkeleton = textSkeleton;
|
|
4748
|
+
exports.toBoxShadow = toBoxShadow;
|
|
4749
|
+
exports.toast = toast;
|
|
4750
|
+
exports.toastLayer = toastLayer;
|
|
4751
|
+
exports.toastLoadingBar = toastLoadingBar;
|
|
4752
|
+
exports.toastLoadingBarMask = toastLoadingBarMask;
|
|
4753
|
+
exports.toastLoadingBarProgress = toastLoadingBarProgress;
|
|
4754
|
+
exports.tooltip = tooltip;
|
|
4755
|
+
exports.tooltipCard = tooltipCard;
|
|
4756
|
+
exports.treeItem = treeItem;
|
|
4757
|
+
exports.varNames = varNames;
|
|
4758
|
+
exports.vars = vars;
|
|
4759
|
+
exports.width = width;
|
|
4760
|
+
//# sourceMappingURL=css.cjs.map
|