@sanity/ui 3.0.0-static.10 → 3.0.0-static.12
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 +1300 -1269
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/buildCommand.js +28 -10
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +1298 -1263
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +516 -360
- package/dist/_visual-editing.d.ts +516 -360
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +258 -75
- package/dist/css.d.ts +258 -75
- package/dist/css.js +746 -752
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +748 -754
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1342 -871
- package/dist/index.d.ts +1342 -871
- package/dist/index.js +433 -325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +429 -321
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-palette.css +105 -1
- package/dist/sanity-palette.min.css +1 -0
- package/dist/sanity-theme.css +4571 -1
- package/dist/sanity-theme.min.css +1 -0
- package/dist/system.css +22053 -21710
- package/dist/system.min.css +1 -0
- package/dist/theme.d.mts +51 -106
- package/dist/theme.d.ts +51 -106
- package/dist/theme.js +19 -20
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +19 -20
- package/dist/theme.mjs.map +1 -1
- package/package.json +10 -5
- package/src/cli/buildCommand.ts +46 -19
- package/src/css/_comp.ts +2 -2
- package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
- package/src/css/_resp.ts +0 -1
- package/src/css/{system.style.ts → _system.style.ts} +3 -2
- package/src/css/aspects/display/display.ts +1 -0
- package/src/css/aspects/display/types.ts +2 -3
- package/src/css/aspects/flex/types.ts +4 -12
- package/src/css/aspects/flexItem/types.ts +1 -3
- package/src/css/aspects/font/font.style.ts +7 -66
- package/src/css/aspects/font/types.ts +1 -3
- package/src/css/aspects/grid/grid.ts +1 -0
- package/src/css/aspects/grid/types.ts +5 -9
- package/src/css/aspects/gridItem/gridItem.ts +1 -1
- package/src/css/aspects/gridItem/types.ts +7 -18
- package/src/css/aspects/height/height.ts +3 -4
- package/src/css/aspects/inset/inset.ts +1 -0
- package/src/css/aspects/margin/margin.ts +1 -0
- package/src/css/aspects/margin/types.ts +1 -0
- package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
- package/src/css/aspects/maxWidth/types.ts +1 -0
- package/src/css/aspects/minWidth/minWidth.ts +1 -0
- package/src/css/aspects/minWidth/types.ts +2 -0
- package/src/css/aspects/overflow/overflow.ts +1 -0
- package/src/css/aspects/padding/padding.ts +1 -0
- package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
- package/src/css/aspects/position/position.ts +1 -0
- package/src/css/aspects/shadow/shadow.style.ts +16 -41
- package/src/css/aspects/shadow/shadow.ts +1 -0
- package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
- package/src/css/aspects/textOverflow/types.ts +1 -0
- package/src/css/aspects/width/types.ts +2 -0
- package/src/css/aspects/width/width.ts +1 -0
- package/src/css/compilePalette.ts +32 -0
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/compileTheme_v3.ts +434 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
- package/src/css/components/dialog/dialog.ts +7 -0
- package/src/css/components/menu/menu.ts +2 -0
- package/src/css/components/skeleton/skeleton.style.ts +8 -4
- package/src/css/components/skeleton/skeleton.ts +4 -0
- package/src/css/components/skeleton/types.ts +4 -0
- package/src/css/components/toast/toast.ts +5 -0
- package/src/css/components/tree/tree.ts +1 -0
- package/src/css/composeClassNames.ts +4 -2
- package/src/css/constants.ts +11 -0
- package/src/css/index.ts +4 -3
- package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
- package/src/css/primitives/_arrow/_arrow.ts +7 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +24 -25
- package/src/css/primitives/_selectable/selectable.ts +1 -2
- package/src/css/primitives/avatar/avatar.style.ts +5 -8
- package/src/css/primitives/avatar/avatar.ts +6 -0
- package/src/css/primitives/avatar/types.ts +1 -0
- package/src/css/primitives/box/types.ts +1 -3
- package/src/css/primitives/button/button.style.ts +48 -15
- package/src/css/primitives/button/button.ts +4 -21
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +18 -0
- package/src/css/primitives/card/card.style.ts +4 -7
- package/src/css/primitives/card/card.ts +2 -2
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.ts +2 -0
- package/src/css/primitives/container/container.ts +1 -0
- package/src/css/primitives/container/types.ts +1 -0
- package/src/css/primitives/kbd/kbd.ts +1 -0
- package/src/css/primitives/label/types.ts +7 -2
- package/src/css/primitives/popover/popover.ts +2 -0
- package/src/css/primitives/radio/radio.ts +1 -0
- package/src/css/primitives/select/select.ts +2 -0
- package/src/css/primitives/spinner/spinner.ts +2 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/types.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +1 -0
- package/src/css/primitives/textInput/textInput.ts +1 -0
- package/src/css/primitives/token/token.style.ts +37 -36
- package/src/css/primitives/tooltip/tooltip.ts +2 -0
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +115 -15
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +1 -0
- package/src/css/varNames.ts +230 -143
- package/src/css/vars.ts +53 -22
- package/src/theme/palette/constants.ts +2 -0
- package/src/theme/palette/types.ts +3 -0
- package/src/theme/types.ts +2 -6
- package/src/theme/v0/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -18
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v2/avatar.ts +1 -3
- package/src/theme/v2/color/_system.ts +1 -3
- package/src/theme/v2/color/avatar.ts +2 -6
- package/src/theme/v2/color/badge.ts +2 -6
- package/src/theme/v2/color/button.ts +3 -9
- package/src/theme/v2/color/color.ts +3 -9
- package/src/theme/v2/color/input.ts +3 -9
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +2 -6
- package/src/theme/v2/color/state.ts +1 -3
- package/src/theme/v2/color/syntax.ts +1 -3
- package/src/theme/v2/input.ts +1 -3
- package/src/theme/v2/theme.ts +2 -6
- package/src/theme/v3/buildTheme_v3.ts +2 -1
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/{defaults.ts → defaultTokens.ts} +2 -2
- package/src/theme/v3/index.ts +1 -1
- package/src/theme/v3/resolveTokens.ts +18 -18
- package/src/ui/RootClassNames.tsx +44 -0
- package/src/ui/StyleTags.tsx +3 -1
- 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/theme/themeColorProvider.tsx +2 -6
- package/src/ui/_compat/theme/themeProvider.tsx +2 -6
- package/src/ui/_compat/theme/types.ts +1 -3
- package/src/ui/_compat/theme/useRootTheme.ts +1 -3
- package/src/ui/_compat/theme/useTheme.ts +2 -6
- package/src/ui/_compat/types.ts +0 -83
- package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
- package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
- package/src/ui/components/autocomplete/types.ts +3 -8
- package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
- package/src/ui/components/dialog/dialog.tsx +89 -291
- package/src/ui/components/dialog/dialogCard.tsx +183 -0
- package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
- package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
- package/src/ui/components/menu/menu.tsx +27 -33
- package/src/ui/components/menu/menuButton.tsx +10 -14
- package/src/ui/components/menu/menuDivider.tsx +25 -13
- package/src/ui/components/menu/menuGroup.tsx +34 -26
- package/src/ui/components/menu/menuItem.tsx +51 -40
- package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
- package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
- package/src/ui/components/skeleton/index.ts +3 -0
- package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
- package/src/ui/components/skeleton/skeleton.tsx +39 -16
- package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
- package/src/ui/components/tab/tab.tsx +23 -19
- package/src/ui/components/tab/tabList.tsx +34 -33
- package/src/ui/components/tab/tabPanel.tsx +25 -19
- package/src/ui/components/toast/toast.tsx +21 -16
- package/src/ui/components/toast/toastLayer.tsx +28 -10
- package/src/ui/components/toast/toastProvider.tsx +2 -6
- package/src/ui/components/toast/types.ts +2 -6
- package/src/ui/components/toast/useToast.ts +1 -3
- package/src/ui/components/tree/tree.tsx +194 -187
- package/src/ui/components/tree/treeGroup.tsx +25 -5
- package/src/ui/components/tree/treeItem.tsx +35 -23
- package/src/ui/hooks/useClickOutside.ts +2 -6
- package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
- package/src/ui/index.ts +1 -0
- package/src/ui/primitives/_selectable/selectable.tsx +33 -20
- package/src/ui/primitives/avatar/avatar.tsx +28 -31
- package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
- package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
- package/src/ui/primitives/avatar/types.ts +2 -0
- package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
- package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/ui/primitives/badge/badge.tsx +33 -32
- package/src/ui/primitives/badge/types.ts +2 -1
- package/src/ui/primitives/box/box.tsx +59 -29
- package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/ui/primitives/button/button.test.tsx +1 -15
- package/src/ui/primitives/button/button.tsx +63 -70
- package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
- package/src/ui/primitives/card/card.tsx +22 -22
- package/src/ui/primitives/card/cardProvider.tsx +2 -0
- package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
- package/src/ui/primitives/code/code.tsx +24 -22
- package/src/ui/primitives/container/container.tsx +26 -15
- package/src/ui/primitives/flex/flex.tsx +21 -19
- package/src/ui/primitives/grid/grid.tsx +21 -16
- package/src/ui/primitives/heading/heading.tsx +42 -19
- package/src/ui/primitives/inline/inline.tsx +26 -23
- package/src/ui/primitives/kbd/kbd.tsx +25 -23
- package/src/ui/primitives/label/label.tsx +29 -26
- package/src/ui/primitives/popover/popover.tsx +293 -271
- package/src/ui/primitives/popover/popoverCard.tsx +122 -120
- package/src/ui/primitives/radio/radio.tsx +30 -14
- package/src/ui/primitives/select/select.tsx +24 -16
- package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
- package/src/ui/primitives/spinner/spinner.tsx +24 -12
- package/src/ui/primitives/stack/stack.tsx +27 -18
- package/src/ui/primitives/switch/switch.tsx +31 -14
- package/src/ui/primitives/text/text.tsx +30 -24
- package/src/ui/primitives/textArea/textArea.tsx +33 -18
- package/src/ui/primitives/textInput/textInput.tsx +28 -40
- package/src/ui/primitives/tooltip/constants.ts +1 -1
- package/src/ui/primitives/tooltip/tooltip.tsx +85 -61
- package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
- package/src/ui/primitives/types.ts +1 -3
- package/src/ui/types/avatar.ts +3 -6
- package/src/ui/types/badge.ts +1 -3
- package/src/ui/types/button.ts +1 -3
- package/src/ui/types/card.ts +1 -3
- package/src/ui/types/dialog.ts +1 -3
- package/src/ui/types/props.ts +20 -10
- package/src/ui/utils/arrow/arrow.tsx +43 -25
- package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
- package/src/ui/utils/boundaryElement/types.ts +1 -3
- package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
- package/src/ui/utils/elementQuery/elementQuery.tsx +43 -19
- package/src/ui/utils/errorBoundary.tsx +2 -0
- package/src/ui/utils/index.ts +0 -1
- package/src/ui/utils/layer/layer.tsx +23 -93
- package/src/ui/utils/layer/layerCard.tsx +92 -0
- package/src/ui/utils/layer/layerProvider.tsx +2 -6
- package/src/ui/utils/layer/useLayer.ts +1 -3
- package/src/ui/utils/portal/portal.ts +2 -6
- package/src/ui/utils/portal/portalProvider.tsx +2 -6
- package/src/ui/utils/portal/types.ts +1 -3
- package/src/ui/utils/portal/usePortal.ts +1 -3
- package/src/ui/utils/srOnly/srOnly.tsx +25 -20
- package/src/ui/utils/virtualList/virtualList.tsx +69 -50
- package/src/css/compile/compilePalette.ts +0 -27
- package/src/css/compile/compileRule.ts +0 -97
- package/src/css/compile/compileRules.test.ts +0 -36
- package/src/css/compile/compileRules.ts +0 -43
- package/src/css/compile/compileSystem.ts +0 -10
- package/src/css/compile/compileTheme_v3.ts +0 -401
- package/src/css/compile/types.ts +0 -6
- 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/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- 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/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/ui/utils/conditionalWrapper/index.ts +0 -1
package/dist/css.js
CHANGED
|
@@ -9,11 +9,11 @@ function _resp(prefix, prop) {
|
|
|
9
9
|
return index === 0 ? className : `${index}:${className}`;
|
|
10
10
|
}).filter(Boolean).join(" ") : (typeof prop == "boolean" ? [prefix] : [prefix, prop]).filter((s) => s === 0 || !!s).join("-").replace(/\./g, "_");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function _getClassNames(...classNames) {
|
|
13
13
|
return classNames.map((n) => typeof n == "string" && n.trim()).filter(Boolean).join(" ").split(" ");
|
|
14
14
|
}
|
|
15
15
|
function composeClassNames(...classNames) {
|
|
16
|
-
return unique(
|
|
16
|
+
return unique(_getClassNames(...classNames)).join(" ") || void 0;
|
|
17
17
|
}
|
|
18
18
|
function unique(array) {
|
|
19
19
|
return Array.from(new Set(array));
|
|
@@ -75,13 +75,20 @@ function radius(props) {
|
|
|
75
75
|
function shadow(props) {
|
|
76
76
|
return composeClassNames(_resp("shadow", props.shadow));
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const BREAKPOINTS = {
|
|
79
|
+
1: 360,
|
|
80
|
+
2: 600,
|
|
81
|
+
3: 900,
|
|
82
|
+
4: 1200,
|
|
83
|
+
5: 1800,
|
|
84
|
+
6: 2400
|
|
85
|
+
}, PREFIX = "s-";
|
|
79
86
|
function scopeClassName(className) {
|
|
80
87
|
if (className !== void 0)
|
|
81
88
|
return `${PREFIX}${className.trim()}`;
|
|
82
89
|
}
|
|
83
90
|
function _comp(...classNames) {
|
|
84
|
-
return
|
|
91
|
+
return _getClassNames(...classNames).filter(Boolean).map(scopeClassName).join(" ") || void 0;
|
|
85
92
|
}
|
|
86
93
|
function textOverflow(props) {
|
|
87
94
|
return _comp(props.textOverflow && `text-overflow-${props.textOverflow}`);
|
|
@@ -89,97 +96,108 @@ function textOverflow(props) {
|
|
|
89
96
|
function width(props) {
|
|
90
97
|
return _resp("w", props.width) ?? "";
|
|
91
98
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
if (props["@nest"] && (css += compileNestedRules(selector, props["@nest"], context)), props["@keyframes"])
|
|
95
|
-
for (const name in props["@keyframes"])
|
|
96
|
-
context.keyframes[name] = props["@keyframes"][name];
|
|
97
|
-
if (props["@media"])
|
|
98
|
-
for (const key in props["@media"])
|
|
99
|
-
context.media[key] || (context.media[key] = {}), context.media[key][selector] = props["@media"][key];
|
|
100
|
-
return css;
|
|
99
|
+
function isRecord(value) {
|
|
100
|
+
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
for (const key in props) {
|
|
105
|
-
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
106
|
-
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
107
|
-
for (const v of valueArr)
|
|
108
|
-
css += toSnakeCase$1(key) + ":" + v + ";";
|
|
109
|
-
}
|
|
110
|
-
return css === "{" ? "" : selector + css + "}";
|
|
102
|
+
function isArray(value) {
|
|
103
|
+
return Array.isArray(value);
|
|
111
104
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
let css = "";
|
|
115
|
-
for (const [_selector, _props] of Object.entries(props))
|
|
116
|
-
css += `
|
|
117
|
-
` + compileRule(_selector.replace(/\./g, `.${PREFIX}`).replace(/&/g, selector), _props, context);
|
|
118
|
-
return css;
|
|
105
|
+
function rem(value) {
|
|
106
|
+
return value === 0 ? "0" : `${value / 16}rem`;
|
|
119
107
|
}
|
|
120
|
-
function
|
|
121
|
-
return value
|
|
108
|
+
function px(value) {
|
|
109
|
+
return value === 0 ? "0" : `${value}px`;
|
|
122
110
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
...compileHues(),
|
|
126
|
-
"--black": color.color.black.hex,
|
|
127
|
-
"--white": color.color.white.hex
|
|
128
|
-
};
|
|
129
|
-
return compileRule(":root", props, {
|
|
130
|
-
keyframes: {},
|
|
131
|
-
media: {}
|
|
132
|
-
});
|
|
111
|
+
function toBoxShadow(value) {
|
|
112
|
+
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
133
113
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
for (const
|
|
138
|
-
|
|
139
|
-
|
|
114
|
+
function _compileStyle(style) {
|
|
115
|
+
let css = "";
|
|
116
|
+
if (style.rules && (css += compileStyleRules(style.rules)), style.keyframes && Object.keys(style.keyframes).length > 0)
|
|
117
|
+
for (const [name, value] of Object.entries(style.keyframes)) {
|
|
118
|
+
let keyframesCss = `@keyframes ${name} {
|
|
119
|
+
`;
|
|
120
|
+
for (const [key, props] of Object.entries(value))
|
|
121
|
+
keyframesCss += ` ${key} {
|
|
122
|
+
`, keyframesCss += compileProperties(props), keyframesCss += `}
|
|
123
|
+
`;
|
|
124
|
+
keyframesCss += `
|
|
140
125
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
for (const s of styles)
|
|
144
|
-
if (s) {
|
|
145
|
-
Object.assign(keyframes2, s.keyframes);
|
|
146
|
-
for (const layerName in s.layers)
|
|
147
|
-
layers[layerName] || (layers[layerName] = {}), Object.assign(layers[layerName], s.layers[layerName]);
|
|
148
|
-
Object.assign(rules2, s.rules);
|
|
126
|
+
|
|
127
|
+
`, css += keyframesCss;
|
|
149
128
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
129
|
+
if (style.layers && Object.keys(style.layers).length > 0)
|
|
130
|
+
for (const [layerName, layerRules] of Object.entries(style.layers))
|
|
131
|
+
Object.keys(layerRules).length > 0 && (css += `@layer ${PREFIX}${layerName} {
|
|
132
|
+
`, css += compileStyleRules(layerRules), css += `}
|
|
133
|
+
|
|
134
|
+
`);
|
|
135
|
+
return css;
|
|
155
136
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, rules2[`.4\\:${name}`] = {
|
|
171
|
-
"@media": {
|
|
172
|
-
"screen and (min-width: 1200px)": properties
|
|
173
|
-
}
|
|
174
|
-
}, rules2[`.5\\:${name}`] = {
|
|
175
|
-
"@media": {
|
|
176
|
-
"screen and (min-width: 1800px)": properties
|
|
137
|
+
function compileStyleRules(rules2) {
|
|
138
|
+
let css = "";
|
|
139
|
+
const mediaMap = /* @__PURE__ */ new Map();
|
|
140
|
+
for (const [selector, properties] of Object.entries(rules2))
|
|
141
|
+
if (properties) {
|
|
142
|
+
if (properties["@media"])
|
|
143
|
+
for (const [mediaQuery, mediaProps] of Object.entries(properties["@media"])) {
|
|
144
|
+
const arr = mediaMap.get(mediaQuery) ?? [];
|
|
145
|
+
arr.push({
|
|
146
|
+
selector,
|
|
147
|
+
props: mediaProps
|
|
148
|
+
}), mediaMap.set(mediaQuery, arr);
|
|
149
|
+
}
|
|
150
|
+
css += compileStyleRule(selector, properties);
|
|
177
151
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
152
|
+
for (const [mediaQuery, mediaRules] of mediaMap) {
|
|
153
|
+
css += `@media ${mediaQuery} {
|
|
154
|
+
`;
|
|
155
|
+
for (const rule of mediaRules)
|
|
156
|
+
css += compileStyleRule(rule.selector, rule.props);
|
|
157
|
+
css += `}
|
|
158
|
+
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
return css;
|
|
162
|
+
}
|
|
163
|
+
function compileStyleRule(_selector, properties) {
|
|
164
|
+
let css = "";
|
|
165
|
+
const {
|
|
166
|
+
_prefix = !0,
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
168
|
+
"@media": _mediaProps,
|
|
169
|
+
"@nest": nestedProps,
|
|
170
|
+
...restProperties
|
|
171
|
+
} = properties, selector = _prefix ? `${_selector.replace(/\./g, `.${PREFIX}`)}` : _selector;
|
|
172
|
+
if (Object.entries(restProperties).length && (css += `${selector} {
|
|
173
|
+
`, css += compileProperties(restProperties), css += `}
|
|
174
|
+
|
|
175
|
+
`), nestedProps)
|
|
176
|
+
for (const [_nestedSelector, nestedProperties] of Object.entries(nestedProps)) {
|
|
177
|
+
const nestedSelector = _prefix && (nestedProperties._prefix ?? !0) ? _nestedSelector.replace(/\./g, `.${PREFIX}`) : _nestedSelector;
|
|
178
|
+
css += `${nestedSelector.replace(/&/g, selector)} {
|
|
179
|
+
`, css += compileProperties(nestedProperties), css += `}
|
|
180
|
+
|
|
181
|
+
`;
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
return css;
|
|
184
|
+
}
|
|
185
|
+
function compileProperties(props) {
|
|
186
|
+
let css = "";
|
|
187
|
+
const propEntries = Object.entries(props);
|
|
188
|
+
for (const [key, value] of propEntries)
|
|
189
|
+
if (!key.startsWith("@"))
|
|
190
|
+
if (isArray(value))
|
|
191
|
+
for (const item of value)
|
|
192
|
+
css += ` ${toSnakeCase(key)}: ${item};
|
|
193
|
+
`;
|
|
194
|
+
else
|
|
195
|
+
css += ` ${toSnakeCase(key)}: ${value};
|
|
196
|
+
`;
|
|
197
|
+
return css;
|
|
198
|
+
}
|
|
199
|
+
function toSnakeCase(str) {
|
|
200
|
+
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
183
201
|
}
|
|
184
202
|
const varNames = {
|
|
185
203
|
avatar: {
|
|
@@ -197,11 +215,22 @@ const varNames = {
|
|
|
197
215
|
}
|
|
198
216
|
}), {})
|
|
199
217
|
},
|
|
218
|
+
button: {
|
|
219
|
+
border: {
|
|
220
|
+
width: "--button-border-width"
|
|
221
|
+
},
|
|
222
|
+
focusRing: {
|
|
223
|
+
offset: "--button-focus-ring-offset",
|
|
224
|
+
width: "--button-focus-ring-width"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
card: {
|
|
228
|
+
shadow: {
|
|
229
|
+
outline: "--card-shadow-outline"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
200
232
|
color: {
|
|
201
233
|
// card scope
|
|
202
|
-
accent: {
|
|
203
|
-
fg: "--color-accent-fg"
|
|
204
|
-
},
|
|
205
234
|
avatar: {
|
|
206
235
|
bg: "--color-avatar-bg",
|
|
207
236
|
fg: "--color-avatar-fg",
|
|
@@ -319,99 +348,18 @@ const varNames = {
|
|
|
319
348
|
variant: "tinted"
|
|
320
349
|
}),
|
|
321
350
|
// tone scopes
|
|
322
|
-
|
|
323
|
-
tone
|
|
324
|
-
}),
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
tone
|
|
333
|
-
}),
|
|
334
|
-
suggest: buildColorCardVarNames({
|
|
335
|
-
tone: "suggest"
|
|
336
|
-
}),
|
|
337
|
-
positive: buildColorCardVarNames({
|
|
338
|
-
tone: "positive"
|
|
339
|
-
}),
|
|
340
|
-
caution: buildColorCardVarNames({
|
|
341
|
-
tone: "caution"
|
|
342
|
-
}),
|
|
343
|
-
critical: buildColorCardVarNames({
|
|
344
|
-
tone: "critical"
|
|
345
|
-
}),
|
|
346
|
-
// scheme scope
|
|
347
|
-
dark: {
|
|
348
|
-
transparent: buildColorCardVarNames({
|
|
349
|
-
scheme: "dark",
|
|
350
|
-
tone: "transparent"
|
|
351
|
-
}),
|
|
352
|
-
default: buildColorCardVarNames({
|
|
353
|
-
scheme: "dark",
|
|
354
|
-
tone: "default"
|
|
355
|
-
}),
|
|
356
|
-
neutral: buildColorCardVarNames({
|
|
357
|
-
scheme: "dark",
|
|
358
|
-
tone: "neutral"
|
|
359
|
-
}),
|
|
360
|
-
primary: buildColorCardVarNames({
|
|
361
|
-
scheme: "dark",
|
|
362
|
-
tone: "primary"
|
|
363
|
-
}),
|
|
364
|
-
suggest: buildColorCardVarNames({
|
|
365
|
-
scheme: "dark",
|
|
366
|
-
tone: "neutral"
|
|
367
|
-
}),
|
|
368
|
-
positive: buildColorCardVarNames({
|
|
369
|
-
scheme: "dark",
|
|
370
|
-
tone: "positive"
|
|
371
|
-
}),
|
|
372
|
-
caution: buildColorCardVarNames({
|
|
373
|
-
scheme: "dark",
|
|
374
|
-
tone: "caution"
|
|
375
|
-
}),
|
|
376
|
-
critical: buildColorCardVarNames({
|
|
377
|
-
scheme: "dark",
|
|
378
|
-
tone: "critical"
|
|
379
|
-
})
|
|
380
|
-
},
|
|
381
|
-
light: {
|
|
382
|
-
transparent: buildColorCardVarNames({
|
|
383
|
-
scheme: "light",
|
|
384
|
-
tone: "transparent"
|
|
385
|
-
}),
|
|
386
|
-
default: buildColorCardVarNames({
|
|
387
|
-
scheme: "light",
|
|
388
|
-
tone: "default"
|
|
389
|
-
}),
|
|
390
|
-
neutral: buildColorCardVarNames({
|
|
391
|
-
scheme: "light",
|
|
392
|
-
tone: "neutral"
|
|
393
|
-
}),
|
|
394
|
-
primary: buildColorCardVarNames({
|
|
395
|
-
scheme: "light",
|
|
396
|
-
tone: "primary"
|
|
397
|
-
}),
|
|
398
|
-
suggest: buildColorCardVarNames({
|
|
399
|
-
scheme: "light",
|
|
400
|
-
tone: "suggest"
|
|
401
|
-
}),
|
|
402
|
-
positive: buildColorCardVarNames({
|
|
403
|
-
scheme: "light",
|
|
404
|
-
tone: "positive"
|
|
405
|
-
}),
|
|
406
|
-
caution: buildColorCardVarNames({
|
|
407
|
-
scheme: "light",
|
|
408
|
-
tone: "caution"
|
|
409
|
-
}),
|
|
410
|
-
critical: buildColorCardVarNames({
|
|
411
|
-
scheme: "light",
|
|
412
|
-
tone: "critical"
|
|
413
|
-
})
|
|
414
|
-
}
|
|
351
|
+
...theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
352
|
+
tone
|
|
353
|
+
}), acc), {}),
|
|
354
|
+
// scheme scopes
|
|
355
|
+
dark: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
356
|
+
scheme: "dark",
|
|
357
|
+
tone
|
|
358
|
+
}), acc), {}),
|
|
359
|
+
light: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCardVarNames({
|
|
360
|
+
scheme: "light",
|
|
361
|
+
tone
|
|
362
|
+
}), acc), {})
|
|
415
363
|
},
|
|
416
364
|
container: {
|
|
417
365
|
0: "--container-0",
|
|
@@ -424,6 +372,7 @@ const varNames = {
|
|
|
424
372
|
font: {
|
|
425
373
|
code: {
|
|
426
374
|
family: "--font-code-family",
|
|
375
|
+
featureSettings: "--font-code-feature-settings",
|
|
427
376
|
sizes: theme.FONT_CODE_SIZE.reduce((acc, size) => ({
|
|
428
377
|
...acc,
|
|
429
378
|
[size]: {
|
|
@@ -435,7 +384,7 @@ const varNames = {
|
|
|
435
384
|
iconSize: `--font-code-${size}-icon-size`
|
|
436
385
|
}
|
|
437
386
|
}), {}),
|
|
438
|
-
|
|
387
|
+
weights: {
|
|
439
388
|
regular: "--font-code-weight-regular",
|
|
440
389
|
medium: "--font-code-weight-medium",
|
|
441
390
|
semibold: "--font-code-weight-semibold",
|
|
@@ -444,6 +393,7 @@ const varNames = {
|
|
|
444
393
|
},
|
|
445
394
|
heading: {
|
|
446
395
|
family: "--font-heading-family",
|
|
396
|
+
featureSettings: "--font-heading-feature-settings",
|
|
447
397
|
sizes: theme.FONT_HEADING_SIZE.reduce((acc, size) => ({
|
|
448
398
|
...acc,
|
|
449
399
|
[size]: {
|
|
@@ -455,7 +405,7 @@ const varNames = {
|
|
|
455
405
|
iconSize: `--font-heading-${size}-icon-size`
|
|
456
406
|
}
|
|
457
407
|
}), {}),
|
|
458
|
-
|
|
408
|
+
weights: {
|
|
459
409
|
regular: "--font-heading-weight-regular",
|
|
460
410
|
medium: "--font-heading-weight-medium",
|
|
461
411
|
semibold: "--font-heading-weight-semibold",
|
|
@@ -464,6 +414,7 @@ const varNames = {
|
|
|
464
414
|
},
|
|
465
415
|
label: {
|
|
466
416
|
family: "--font-label-family",
|
|
417
|
+
featureSettings: "--font-label-feature-settings",
|
|
467
418
|
sizes: theme.FONT_LABEL_SIZE.reduce((acc, size) => ({
|
|
468
419
|
...acc,
|
|
469
420
|
[size]: {
|
|
@@ -475,7 +426,7 @@ const varNames = {
|
|
|
475
426
|
iconSize: `--font-label-${size}-icon-size`
|
|
476
427
|
}
|
|
477
428
|
}), {}),
|
|
478
|
-
|
|
429
|
+
weights: {
|
|
479
430
|
regular: "--font-label-weight-regular",
|
|
480
431
|
medium: "--font-label-weight-medium",
|
|
481
432
|
semibold: "--font-label-weight-semibold",
|
|
@@ -484,6 +435,7 @@ const varNames = {
|
|
|
484
435
|
},
|
|
485
436
|
text: {
|
|
486
437
|
family: "--font-text-family",
|
|
438
|
+
featureSettings: "--font-text-feature-settings",
|
|
487
439
|
sizes: theme.FONT_TEXT_SIZE.reduce((acc, size) => ({
|
|
488
440
|
...acc,
|
|
489
441
|
[size]: {
|
|
@@ -495,7 +447,7 @@ const varNames = {
|
|
|
495
447
|
iconSize: `--font-text-${size}-icon-size`
|
|
496
448
|
}
|
|
497
449
|
}), {}),
|
|
498
|
-
|
|
450
|
+
weights: {
|
|
499
451
|
regular: "--font-text-weight-regular",
|
|
500
452
|
medium: "--font-text-weight-medium",
|
|
501
453
|
semibold: "--font-text-weight-semibold",
|
|
@@ -504,125 +456,176 @@ const varNames = {
|
|
|
504
456
|
}
|
|
505
457
|
},
|
|
506
458
|
input: {
|
|
459
|
+
border: {
|
|
460
|
+
width: "--input-border-width"
|
|
461
|
+
},
|
|
462
|
+
checkbox: {
|
|
463
|
+
focusRing: {
|
|
464
|
+
offset: "--input-checkbox-focus-ring-offset",
|
|
465
|
+
width: "--input-checkbox-focus-ring-width"
|
|
466
|
+
},
|
|
467
|
+
size: "--input-checkbox-size"
|
|
468
|
+
},
|
|
469
|
+
radio: {
|
|
470
|
+
focusRing: {
|
|
471
|
+
offset: "--input-radio-focus-ring-offset",
|
|
472
|
+
width: "--input-radio-focus-ring-width"
|
|
473
|
+
},
|
|
474
|
+
markSize: "--input-radio-mark-size",
|
|
475
|
+
size: "--input-radio-size"
|
|
476
|
+
},
|
|
477
|
+
select: {
|
|
478
|
+
focusRing: {
|
|
479
|
+
offset: "--input-select-focus-ring-offset",
|
|
480
|
+
width: "--input-select-focus-ring-width"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
switch: {
|
|
484
|
+
focusRing: {
|
|
485
|
+
offset: "--input-switch-focus-ring-offset",
|
|
486
|
+
width: "--input-switch-focus-ring-width"
|
|
487
|
+
},
|
|
488
|
+
height: "--input-switch-height",
|
|
489
|
+
padding: "--input-switch-padding",
|
|
490
|
+
transitionDurationMs: "--input-switch-transition-duration-ms",
|
|
491
|
+
transitionTimingFunction: "--input-switch-transition-timing-function",
|
|
492
|
+
width: "--input-switch-width"
|
|
493
|
+
},
|
|
494
|
+
text: {
|
|
495
|
+
focusRing: {
|
|
496
|
+
offset: "--input-text-focus-ring-offset",
|
|
497
|
+
width: "--input-text-focus-ring-width"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
507
500
|
fontSize: "--input-font-size",
|
|
508
501
|
lineHeight: "--input-line-height",
|
|
509
502
|
letterSpacing: "--input-letter-spacing",
|
|
510
503
|
ascenderHeight: "--input-ascender-height",
|
|
511
504
|
descenderHeight: "--input-descender-height",
|
|
512
|
-
// capHeight: `--input-cap-height`,
|
|
513
505
|
gap: "--input-gap",
|
|
514
506
|
padding: "--input-padding"
|
|
515
507
|
},
|
|
516
508
|
radius: Object.fromEntries(theme.RADIUS.map((radius2) => [radius2, `--radius-${radius2}`])),
|
|
517
|
-
|
|
509
|
+
shadow: Object.fromEntries(theme.SHADOW.map((shadow2) => [shadow2, {
|
|
510
|
+
umbra: `--shadow-${shadow2}-umbra`,
|
|
511
|
+
penumbra: `--shadow-${shadow2}-penumbra`,
|
|
512
|
+
ambient: `--shadow-${shadow2}-ambient`
|
|
513
|
+
}])),
|
|
514
|
+
space: Object.fromEntries(theme.SPACE.map((space) => [space, `--space-${String(space).replace(".", "_")}`])),
|
|
515
|
+
// color
|
|
516
|
+
black: "--black",
|
|
517
|
+
white: "--white",
|
|
518
|
+
...color.COLOR_HUES.reduce((acc, hue) => {
|
|
519
|
+
const tints = {};
|
|
520
|
+
for (const tint of color.COLOR_TINTS)
|
|
521
|
+
tints[tint] = `--${hue}-${tint}`;
|
|
522
|
+
return acc[hue] = tints, acc;
|
|
523
|
+
}, {})
|
|
518
524
|
};
|
|
519
525
|
function buildColorCardVarNames(props) {
|
|
520
526
|
const {
|
|
521
527
|
scheme,
|
|
522
528
|
tone
|
|
523
|
-
} = props,
|
|
529
|
+
} = props, prefix = scheme ? `--color-${scheme}-${tone}` : `--color-${tone}`;
|
|
524
530
|
return {
|
|
525
|
-
accent: {
|
|
526
|
-
fg: `${sourcePrefix}-accent-fg`
|
|
527
|
-
},
|
|
528
531
|
avatar: {
|
|
529
532
|
gray: {
|
|
530
|
-
bg: `${
|
|
531
|
-
fg: `${
|
|
533
|
+
bg: `${prefix}-avatar-gray-bg`,
|
|
534
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
532
535
|
},
|
|
533
536
|
blue: {
|
|
534
|
-
bg: `${
|
|
535
|
-
fg: `${
|
|
537
|
+
bg: `${prefix}-avatar-blue-bg`,
|
|
538
|
+
fg: `${prefix}-avatar-blue-fg`
|
|
536
539
|
},
|
|
537
540
|
purple: {
|
|
538
|
-
bg: `${
|
|
539
|
-
fg: `${
|
|
541
|
+
bg: `${prefix}-avatar-purple-bg`,
|
|
542
|
+
fg: `${prefix}-avatar-purple-fg`
|
|
540
543
|
},
|
|
541
544
|
magenta: {
|
|
542
|
-
bg: `${
|
|
543
|
-
fg: `${
|
|
545
|
+
bg: `${prefix}-avatar-magenta-bg`,
|
|
546
|
+
fg: `${prefix}-avatar-magenta-fg`
|
|
544
547
|
},
|
|
545
548
|
red: {
|
|
546
|
-
bg: `${
|
|
547
|
-
fg: `${
|
|
549
|
+
bg: `${prefix}-avatar-red-bg`,
|
|
550
|
+
fg: `${prefix}-avatar-red-fg`
|
|
548
551
|
},
|
|
549
552
|
orange: {
|
|
550
|
-
bg: `${
|
|
551
|
-
fg: `${
|
|
553
|
+
bg: `${prefix}-avatar-orange-bg`,
|
|
554
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
552
555
|
},
|
|
553
556
|
yellow: {
|
|
554
|
-
bg: `${
|
|
555
|
-
fg: `${
|
|
557
|
+
bg: `${prefix}-avatar-yellow-bg`,
|
|
558
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
556
559
|
},
|
|
557
560
|
green: {
|
|
558
|
-
bg: `${
|
|
559
|
-
fg: `${
|
|
561
|
+
bg: `${prefix}-avatar-green-bg`,
|
|
562
|
+
fg: `${prefix}-avatar-green-fg`
|
|
560
563
|
},
|
|
561
564
|
cyan: {
|
|
562
|
-
bg: `${
|
|
563
|
-
fg: `${
|
|
565
|
+
bg: `${prefix}-avatar-cyan-bg`,
|
|
566
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
564
567
|
}
|
|
565
568
|
},
|
|
566
|
-
backdrop: `${
|
|
569
|
+
backdrop: `${prefix}-backdrop`,
|
|
567
570
|
code: {
|
|
568
|
-
bg: `${
|
|
569
|
-
fg: `${
|
|
571
|
+
bg: `${prefix}-code-bg`,
|
|
572
|
+
fg: `${prefix}-code-fg`,
|
|
570
573
|
token: {
|
|
571
|
-
atrule: `${
|
|
572
|
-
attrName: `${
|
|
573
|
-
attrValue: `${
|
|
574
|
-
attribute: `${
|
|
575
|
-
boolean: `${
|
|
576
|
-
builtin: `${
|
|
577
|
-
cdata: `${
|
|
578
|
-
char: `${
|
|
579
|
-
class: `${
|
|
580
|
-
className: `${
|
|
581
|
-
comment: `${
|
|
582
|
-
constant: `${
|
|
583
|
-
deleted: `${
|
|
584
|
-
doctype: `${
|
|
585
|
-
entity: `${
|
|
586
|
-
function: `${
|
|
587
|
-
hexcode: `${
|
|
588
|
-
id: `${
|
|
589
|
-
important: `${
|
|
590
|
-
inserted: `${
|
|
591
|
-
keyword: `${
|
|
592
|
-
number: `${
|
|
593
|
-
operator: `${
|
|
594
|
-
prolog: `${
|
|
595
|
-
property: `${
|
|
596
|
-
pseudoClass: `${
|
|
597
|
-
pseudoElement: `${
|
|
598
|
-
punctuation: `${
|
|
599
|
-
regex: `${
|
|
600
|
-
selector: `${
|
|
601
|
-
string: `${
|
|
602
|
-
symbol: `${
|
|
603
|
-
tag: `${
|
|
604
|
-
unit: `${
|
|
605
|
-
url: `${
|
|
606
|
-
variable: `${
|
|
574
|
+
atrule: `${prefix}-code-token-atrule`,
|
|
575
|
+
attrName: `${prefix}-code-token-attr-name`,
|
|
576
|
+
attrValue: `${prefix}-code-token-attr-value`,
|
|
577
|
+
attribute: `${prefix}-code-token-attribute`,
|
|
578
|
+
boolean: `${prefix}-code-token-boolean`,
|
|
579
|
+
builtin: `${prefix}-code-token-builtin`,
|
|
580
|
+
cdata: `${prefix}-code-token-cdata`,
|
|
581
|
+
char: `${prefix}-code-token-char`,
|
|
582
|
+
class: `${prefix}-code-token-class`,
|
|
583
|
+
className: `${prefix}-code-token-class-name`,
|
|
584
|
+
comment: `${prefix}-code-token-comment`,
|
|
585
|
+
constant: `${prefix}-code-token-constant`,
|
|
586
|
+
deleted: `${prefix}-code-token-deleted`,
|
|
587
|
+
doctype: `${prefix}-code-token-doctype`,
|
|
588
|
+
entity: `${prefix}-code-token-entity`,
|
|
589
|
+
function: `${prefix}-code-token-function`,
|
|
590
|
+
hexcode: `${prefix}-code-token-hexcode`,
|
|
591
|
+
id: `${prefix}-code-token-id`,
|
|
592
|
+
important: `${prefix}-code-token-important`,
|
|
593
|
+
inserted: `${prefix}-code-token-inserted`,
|
|
594
|
+
keyword: `${prefix}-code-token-keyword`,
|
|
595
|
+
number: `${prefix}-code-token-number`,
|
|
596
|
+
operator: `${prefix}-code-token-operator`,
|
|
597
|
+
prolog: `${prefix}-code-token-prolog`,
|
|
598
|
+
property: `${prefix}-code-token-property`,
|
|
599
|
+
pseudoClass: `${prefix}-code-token-pseudo-class`,
|
|
600
|
+
pseudoElement: `${prefix}-code-token-pseudo-element`,
|
|
601
|
+
punctuation: `${prefix}-code-token-punctuation`,
|
|
602
|
+
regex: `${prefix}-code-token-regex`,
|
|
603
|
+
selector: `${prefix}-code-token-selector`,
|
|
604
|
+
string: `${prefix}-code-token-string`,
|
|
605
|
+
symbol: `${prefix}-code-token-symbol`,
|
|
606
|
+
tag: `${prefix}-code-token-tag`,
|
|
607
|
+
unit: `${prefix}-code-token-unit`,
|
|
608
|
+
url: `${prefix}-code-token-url`,
|
|
609
|
+
variable: `${prefix}-code-token-variable`
|
|
607
610
|
}
|
|
608
611
|
},
|
|
609
|
-
focusRing: `${
|
|
612
|
+
focusRing: `${prefix}-focus-ring`,
|
|
610
613
|
link: {
|
|
611
|
-
fg: `${
|
|
614
|
+
fg: `${prefix}-link-fg`
|
|
612
615
|
},
|
|
613
616
|
muted: {
|
|
614
|
-
bg: `${
|
|
615
|
-
fg: `${
|
|
617
|
+
bg: `${prefix}-muted-bg`,
|
|
618
|
+
fg: `${prefix}-muted-fg`
|
|
616
619
|
},
|
|
617
620
|
shadow: {
|
|
618
|
-
outline: `${
|
|
619
|
-
umbra: `${
|
|
620
|
-
penumbra: `${
|
|
621
|
-
ambient: `${
|
|
621
|
+
outline: `${prefix}-shadow-outline`,
|
|
622
|
+
umbra: `${prefix}-shadow-umbra`,
|
|
623
|
+
penumbra: `${prefix}-shadow-penumbra`,
|
|
624
|
+
ambient: `${prefix}-shadow-ambient`
|
|
622
625
|
},
|
|
623
626
|
skeleton: {
|
|
624
|
-
from: `${
|
|
625
|
-
to: `${
|
|
627
|
+
from: `${prefix}-skeleton-from`,
|
|
628
|
+
to: `${prefix}-skeleton-to`
|
|
626
629
|
},
|
|
627
630
|
solid: buildColorVariantVarNames({
|
|
628
631
|
scheme,
|
|
@@ -641,57 +644,119 @@ function buildColorVariantVarNames(options) {
|
|
|
641
644
|
scheme,
|
|
642
645
|
tone,
|
|
643
646
|
variant
|
|
644
|
-
} = options,
|
|
647
|
+
} = options, prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}` : tone ? `--color-${tone}-${variant}` : `--color-${variant}`, vars2 = {
|
|
645
648
|
bg: {
|
|
646
|
-
0: `${
|
|
647
|
-
1: `${
|
|
648
|
-
2: `${
|
|
649
|
-
3: `${
|
|
650
|
-
4: `${
|
|
649
|
+
0: `${prefix}-bg-0`,
|
|
650
|
+
1: `${prefix}-bg-1`,
|
|
651
|
+
2: `${prefix}-bg-2`,
|
|
652
|
+
3: `${prefix}-bg-3`,
|
|
653
|
+
4: `${prefix}-bg-4`
|
|
651
654
|
},
|
|
652
655
|
border: {
|
|
653
|
-
0: `${
|
|
654
|
-
1: `${
|
|
655
|
-
2: `${
|
|
656
|
-
3: `${
|
|
657
|
-
4: `${
|
|
656
|
+
0: `${prefix}-border-0`,
|
|
657
|
+
1: `${prefix}-border-1`,
|
|
658
|
+
2: `${prefix}-border-2`,
|
|
659
|
+
3: `${prefix}-border-3`,
|
|
660
|
+
4: `${prefix}-border-4`
|
|
658
661
|
},
|
|
659
662
|
fg: {
|
|
660
|
-
0: `${
|
|
661
|
-
1: `${
|
|
662
|
-
2: `${
|
|
663
|
-
3: `${
|
|
664
|
-
4: `${
|
|
663
|
+
0: `${prefix}-fg-0`,
|
|
664
|
+
1: `${prefix}-fg-1`,
|
|
665
|
+
2: `${prefix}-fg-2`,
|
|
666
|
+
3: `${prefix}-fg-3`,
|
|
667
|
+
4: `${prefix}-fg-4`
|
|
665
668
|
}
|
|
666
669
|
};
|
|
667
670
|
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
668
|
-
const
|
|
671
|
+
const _prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
669
672
|
vars2[elementTone] = {
|
|
670
673
|
bg: {
|
|
671
|
-
0: `${
|
|
672
|
-
1: `${
|
|
673
|
-
2: `${
|
|
674
|
-
3: `${
|
|
675
|
-
4: `${
|
|
674
|
+
0: `${_prefix}-bg-0`,
|
|
675
|
+
1: `${_prefix}-bg-1`,
|
|
676
|
+
2: `${_prefix}-bg-2`,
|
|
677
|
+
3: `${_prefix}-bg-3`,
|
|
678
|
+
4: `${_prefix}-bg-4`
|
|
676
679
|
},
|
|
677
680
|
border: {
|
|
678
|
-
0: `${
|
|
679
|
-
1: `${
|
|
680
|
-
2: `${
|
|
681
|
-
3: `${
|
|
682
|
-
4: `${
|
|
681
|
+
0: `${_prefix}-border-0`,
|
|
682
|
+
1: `${_prefix}-border-1`,
|
|
683
|
+
2: `${_prefix}-border-2`,
|
|
684
|
+
3: `${_prefix}-border-3`,
|
|
685
|
+
4: `${_prefix}-border-4`
|
|
683
686
|
},
|
|
684
687
|
fg: {
|
|
685
|
-
0: `${
|
|
686
|
-
1: `${
|
|
687
|
-
2: `${
|
|
688
|
-
3: `${
|
|
689
|
-
4: `${
|
|
688
|
+
0: `${_prefix}-fg-0`,
|
|
689
|
+
1: `${_prefix}-fg-1`,
|
|
690
|
+
2: `${_prefix}-fg-2`,
|
|
691
|
+
3: `${_prefix}-fg-3`,
|
|
692
|
+
4: `${_prefix}-fg-4`
|
|
690
693
|
}
|
|
691
694
|
};
|
|
692
695
|
}
|
|
693
696
|
return vars2;
|
|
694
697
|
}
|
|
698
|
+
function compilePalette() {
|
|
699
|
+
return _compileStyle({
|
|
700
|
+
layers: {
|
|
701
|
+
theme: {
|
|
702
|
+
":root": compilePaletteProperties()
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
function compilePaletteProperties() {
|
|
708
|
+
const rules2 = {
|
|
709
|
+
[varNames.black]: color.color.black.hex,
|
|
710
|
+
[varNames.white]: color.color.white.hex
|
|
711
|
+
};
|
|
712
|
+
for (const hue of theme.HUES)
|
|
713
|
+
for (const tint of theme.TINTS)
|
|
714
|
+
rules2[varNames[hue][tint]] = color.color[hue][tint].hex;
|
|
715
|
+
return rules2;
|
|
716
|
+
}
|
|
717
|
+
function _mergeStyles(styles) {
|
|
718
|
+
const keyframes2 = {}, layers = {}, rules2 = {};
|
|
719
|
+
for (const s of styles)
|
|
720
|
+
if (s) {
|
|
721
|
+
Object.assign(keyframes2, s.keyframes);
|
|
722
|
+
for (const layerName in s.layers)
|
|
723
|
+
layers[layerName] || (layers[layerName] = {}), Object.assign(layers[layerName], s.layers[layerName]);
|
|
724
|
+
Object.assign(rules2, s.rules);
|
|
725
|
+
}
|
|
726
|
+
return {
|
|
727
|
+
keyframes: keyframes2,
|
|
728
|
+
layers,
|
|
729
|
+
rules: rules2
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
function _responsiveRule(rules2, _name, properties) {
|
|
733
|
+
const name = _name.replace(/\./g, "_");
|
|
734
|
+
rules2[`.${name}`] = properties, rules2[`.1\\:${name}`] = {
|
|
735
|
+
"@media": {
|
|
736
|
+
"screen and (min-width: 360px)": properties
|
|
737
|
+
}
|
|
738
|
+
}, rules2[`.2\\:${name}`] = {
|
|
739
|
+
"@media": {
|
|
740
|
+
"screen and (min-width: 600px)": properties
|
|
741
|
+
}
|
|
742
|
+
}, rules2[`.3\\:${name}`] = {
|
|
743
|
+
"@media": {
|
|
744
|
+
"screen and (min-width: 900px)": properties
|
|
745
|
+
}
|
|
746
|
+
}, rules2[`.4\\:${name}`] = {
|
|
747
|
+
"@media": {
|
|
748
|
+
"screen and (min-width: 1200px)": properties
|
|
749
|
+
}
|
|
750
|
+
}, rules2[`.5\\:${name}`] = {
|
|
751
|
+
"@media": {
|
|
752
|
+
"screen and (min-width: 1800px)": properties
|
|
753
|
+
}
|
|
754
|
+
}, rules2[`.6\\:${name}`] = {
|
|
755
|
+
"@media": {
|
|
756
|
+
"screen and (min-width: 2400px)": properties
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
}
|
|
695
760
|
const darkColorVars = {};
|
|
696
761
|
for (const tone of theme.THEME_COLOR_CARD_TONES)
|
|
697
762
|
darkColorVars[tone] = buildColorCardVars({
|
|
@@ -705,9 +770,6 @@ for (const tone of theme.THEME_COLOR_CARD_TONES)
|
|
|
705
770
|
tone
|
|
706
771
|
});
|
|
707
772
|
const colorVars = {
|
|
708
|
-
accent: {
|
|
709
|
-
fg: `var(${varNames.color.accent.fg})`
|
|
710
|
-
},
|
|
711
773
|
avatar: {
|
|
712
774
|
bg: `var(${varNames.color.avatar.bg})`,
|
|
713
775
|
fg: `var(${varNames.color.avatar.fg})`,
|
|
@@ -844,6 +906,11 @@ const colorVars = {
|
|
|
844
906
|
}
|
|
845
907
|
}), {})
|
|
846
908
|
},
|
|
909
|
+
card: {
|
|
910
|
+
shadow: {
|
|
911
|
+
outline: `var(${varNames.card.shadow.outline})`
|
|
912
|
+
}
|
|
913
|
+
},
|
|
847
914
|
color: colorVars,
|
|
848
915
|
container: {
|
|
849
916
|
0: `var(${varNames.container[0]})`,
|
|
@@ -868,10 +935,10 @@ const colorVars = {
|
|
|
868
935
|
}
|
|
869
936
|
}), {}),
|
|
870
937
|
weight: {
|
|
871
|
-
regular: `var(${varNames.font.code.
|
|
872
|
-
medium: `var(${varNames.font.code.
|
|
873
|
-
semibold: `var(${varNames.font.code.
|
|
874
|
-
bold: `var(${varNames.font.code.
|
|
938
|
+
regular: `var(${varNames.font.code.weights.regular})`,
|
|
939
|
+
medium: `var(${varNames.font.code.weights.medium})`,
|
|
940
|
+
semibold: `var(${varNames.font.code.weights.semibold})`,
|
|
941
|
+
bold: `var(${varNames.font.code.weights.bold})`
|
|
875
942
|
}
|
|
876
943
|
},
|
|
877
944
|
heading: {
|
|
@@ -888,10 +955,10 @@ const colorVars = {
|
|
|
888
955
|
}
|
|
889
956
|
}), {}),
|
|
890
957
|
weight: {
|
|
891
|
-
regular: `var(${varNames.font.heading.
|
|
892
|
-
medium: `var(${varNames.font.heading.
|
|
893
|
-
semibold: `var(${varNames.font.heading.
|
|
894
|
-
bold: `var(${varNames.font.heading.
|
|
958
|
+
regular: `var(${varNames.font.heading.weights.regular})`,
|
|
959
|
+
medium: `var(${varNames.font.heading.weights.medium})`,
|
|
960
|
+
semibold: `var(${varNames.font.heading.weights.semibold})`,
|
|
961
|
+
bold: `var(${varNames.font.heading.weights.bold})`
|
|
895
962
|
}
|
|
896
963
|
},
|
|
897
964
|
label: {
|
|
@@ -908,10 +975,10 @@ const colorVars = {
|
|
|
908
975
|
}
|
|
909
976
|
}), {}),
|
|
910
977
|
weight: {
|
|
911
|
-
regular: `var(${varNames.font.label.
|
|
912
|
-
medium: `var(${varNames.font.label.
|
|
913
|
-
semibold: `var(${varNames.font.label.
|
|
914
|
-
bold: `var(${varNames.font.label.
|
|
978
|
+
regular: `var(${varNames.font.label.weights.regular})`,
|
|
979
|
+
medium: `var(${varNames.font.label.weights.medium})`,
|
|
980
|
+
semibold: `var(${varNames.font.label.weights.semibold})`,
|
|
981
|
+
bold: `var(${varNames.font.label.weights.bold})`
|
|
915
982
|
}
|
|
916
983
|
},
|
|
917
984
|
text: {
|
|
@@ -928,10 +995,10 @@ const colorVars = {
|
|
|
928
995
|
}
|
|
929
996
|
}), {}),
|
|
930
997
|
weight: {
|
|
931
|
-
regular: `var(${varNames.font.text.
|
|
932
|
-
medium: `var(${varNames.font.text.
|
|
933
|
-
semibold: `var(${varNames.font.text.
|
|
934
|
-
bold: `var(${varNames.font.text.
|
|
998
|
+
regular: `var(${varNames.font.text.weights.regular})`,
|
|
999
|
+
medium: `var(${varNames.font.text.weights.medium})`,
|
|
1000
|
+
semibold: `var(${varNames.font.text.weights.semibold})`,
|
|
1001
|
+
bold: `var(${varNames.font.text.weights.bold})`
|
|
935
1002
|
}
|
|
936
1003
|
}
|
|
937
1004
|
},
|
|
@@ -952,7 +1019,21 @@ const colorVars = {
|
|
|
952
1019
|
}
|
|
953
1020
|
},
|
|
954
1021
|
radius: Object.fromEntries(theme.RADIUS.map((radius2) => [radius2, `var(${varNames.radius[radius2]})`])),
|
|
955
|
-
|
|
1022
|
+
shadow: Object.fromEntries(theme.SHADOW.map((shadow2) => [shadow2, {
|
|
1023
|
+
umbra: `var(${varNames.shadow[shadow2].umbra})`,
|
|
1024
|
+
penumbra: `var(${varNames.shadow[shadow2].penumbra})`,
|
|
1025
|
+
ambient: `var(${varNames.shadow[shadow2].ambient})`
|
|
1026
|
+
}])),
|
|
1027
|
+
space: Object.fromEntries(theme.SPACE.map((space) => [space, `var(${varNames.space[space]})`])),
|
|
1028
|
+
// color
|
|
1029
|
+
black: `var(${varNames.black})`,
|
|
1030
|
+
white: `var(${varNames.white})`,
|
|
1031
|
+
...color.COLOR_HUES.reduce((acc, hue) => {
|
|
1032
|
+
const tints = {};
|
|
1033
|
+
for (const tint of color.COLOR_TINTS)
|
|
1034
|
+
tints[tint] = `var(--${hue}-${tint})`;
|
|
1035
|
+
return acc[hue] = tints, acc;
|
|
1036
|
+
}, {})
|
|
956
1037
|
};
|
|
957
1038
|
function buildColorCardVars(props) {
|
|
958
1039
|
const {
|
|
@@ -960,9 +1041,6 @@ function buildColorCardVars(props) {
|
|
|
960
1041
|
tone
|
|
961
1042
|
} = props, prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone];
|
|
962
1043
|
return {
|
|
963
|
-
accent: {
|
|
964
|
-
fg: `var(${prefix.accent.fg})`
|
|
965
|
-
},
|
|
966
1044
|
avatar: {
|
|
967
1045
|
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
968
1046
|
...acc,
|
|
@@ -1293,9 +1371,8 @@ const flexStyle = {
|
|
|
1293
1371
|
layers: {
|
|
1294
1372
|
util: util$n
|
|
1295
1373
|
}
|
|
1296
|
-
},
|
|
1374
|
+
}, primitive$q = {
|
|
1297
1375
|
".font": {
|
|
1298
|
-
// 'position': 'relative',
|
|
1299
1376
|
fontFamily: "var(--font-family)",
|
|
1300
1377
|
fontFeatureSettings: "var(--font-feature-settings)",
|
|
1301
1378
|
fontSize: "var(--font-size)",
|
|
@@ -1350,24 +1427,24 @@ const flexStyle = {
|
|
|
1350
1427
|
"--font-weight": "var(--font-weight-bold)"
|
|
1351
1428
|
}
|
|
1352
1429
|
};
|
|
1353
|
-
_responsiveRule(
|
|
1430
|
+
_responsiveRule(primitive$q, "text-align-initial", {
|
|
1354
1431
|
textAlign: "initial"
|
|
1355
1432
|
});
|
|
1356
|
-
_responsiveRule(
|
|
1433
|
+
_responsiveRule(primitive$q, "text-align-left", {
|
|
1357
1434
|
textAlign: "left"
|
|
1358
1435
|
});
|
|
1359
|
-
_responsiveRule(
|
|
1436
|
+
_responsiveRule(primitive$q, "text-align-center", {
|
|
1360
1437
|
textAlign: "center"
|
|
1361
1438
|
});
|
|
1362
|
-
_responsiveRule(
|
|
1439
|
+
_responsiveRule(primitive$q, "text-align-right", {
|
|
1363
1440
|
textAlign: "right"
|
|
1364
1441
|
});
|
|
1365
|
-
_responsiveRule(
|
|
1442
|
+
_responsiveRule(primitive$q, "text-align-justify", {
|
|
1366
1443
|
textAlign: "justify"
|
|
1367
1444
|
});
|
|
1368
1445
|
const fontStyle = {
|
|
1369
1446
|
layers: {
|
|
1370
|
-
primitive:
|
|
1447
|
+
primitive: primitive$q
|
|
1371
1448
|
}
|
|
1372
1449
|
}, util$m = {};
|
|
1373
1450
|
for (const space of theme.SPACE)
|
|
@@ -2019,24 +2096,12 @@ const radiusStyle = {
|
|
|
2019
2096
|
util: util$2
|
|
2020
2097
|
}
|
|
2021
2098
|
}, util$1 = {};
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
_responsiveRule(util$1,
|
|
2026
|
-
|
|
2027
|
-
});
|
|
2028
|
-
_responsiveRule(util$1, "shadow-2", {
|
|
2029
|
-
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(", ")
|
|
2030
|
-
});
|
|
2031
|
-
_responsiveRule(util$1, "shadow-3", {
|
|
2032
|
-
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(", ")
|
|
2033
|
-
});
|
|
2034
|
-
_responsiveRule(util$1, "shadow-4", {
|
|
2035
|
-
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(", ")
|
|
2036
|
-
});
|
|
2037
|
-
_responsiveRule(util$1, "shadow-5", {
|
|
2038
|
-
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(", ")
|
|
2039
|
-
});
|
|
2099
|
+
for (const shadow2 of theme.SHADOW)
|
|
2100
|
+
shadow2 === 0 ? _responsiveRule(util$1, "shadow-0", {
|
|
2101
|
+
boxShadow: "none"
|
|
2102
|
+
}) : _responsiveRule(util$1, `shadow-${shadow2}`, {
|
|
2103
|
+
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(", ")
|
|
2104
|
+
});
|
|
2040
2105
|
const shadowStyle = {
|
|
2041
2106
|
layers: {
|
|
2042
2107
|
util: util$1
|
|
@@ -2158,8 +2223,8 @@ const widthStyle = {
|
|
|
2158
2223
|
layers: {
|
|
2159
2224
|
component: component$3
|
|
2160
2225
|
}
|
|
2161
|
-
}, keyframes$1 = {
|
|
2162
|
-
|
|
2226
|
+
}, KEYFRAMES_PULSE = "skeleton-pulse", keyframes$1 = {
|
|
2227
|
+
[KEYFRAMES_PULSE]: {
|
|
2163
2228
|
"0%": {
|
|
2164
2229
|
backgroundPosition: "100%"
|
|
2165
2230
|
},
|
|
@@ -2169,8 +2234,8 @@ const widthStyle = {
|
|
|
2169
2234
|
}
|
|
2170
2235
|
}, component$2 = {
|
|
2171
2236
|
".skeleton": {
|
|
2172
|
-
|
|
2173
|
-
|
|
2237
|
+
[varNames.color.skeleton.from]: `color-mix(in srgb, transparent, ${vars.color.muted.fg} 5%)`,
|
|
2238
|
+
[varNames.color.skeleton.to]: `color-mix(in srgb, transparent, ${vars.color.muted.fg} 10%)`,
|
|
2174
2239
|
backgroundColor: vars.color.skeleton.from,
|
|
2175
2240
|
backgroundPosition: "100%",
|
|
2176
2241
|
backgroundSize: "200% 100%",
|
|
@@ -2180,7 +2245,7 @@ const widthStyle = {
|
|
|
2180
2245
|
"@nest": {
|
|
2181
2246
|
"&[data-animated]": {
|
|
2182
2247
|
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(", "),
|
|
2183
|
-
animationName:
|
|
2248
|
+
animationName: KEYFRAMES_PULSE,
|
|
2184
2249
|
animationTimingFunction: "ease-in-out",
|
|
2185
2250
|
animationIterationCount: "infinite",
|
|
2186
2251
|
animationDuration: "2000ms"
|
|
@@ -2335,8 +2400,13 @@ const skeletonStyle = {
|
|
|
2335
2400
|
}
|
|
2336
2401
|
}
|
|
2337
2402
|
},
|
|
2403
|
+
".arrow-stroke-mask": {
|
|
2404
|
+
// @ts-expect-error `y` is not a valid property in 'csstype'
|
|
2405
|
+
y: vars.shadow.outline
|
|
2406
|
+
},
|
|
2338
2407
|
".arrow-stroke": {
|
|
2339
|
-
stroke: vars.color.shadow.outline
|
|
2408
|
+
stroke: vars.color.shadow.outline,
|
|
2409
|
+
strokeWidth: `calc(${vars.card.shadow.outline} * 2)`
|
|
2340
2410
|
},
|
|
2341
2411
|
".arrow-shape": {
|
|
2342
2412
|
fill: vars.color.bg
|
|
@@ -2469,21 +2539,13 @@ const _inputStyle = {
|
|
|
2469
2539
|
layers: {
|
|
2470
2540
|
primitive: primitive$o
|
|
2471
2541
|
}
|
|
2472
|
-
}, toneMap$2 = {
|
|
2473
|
-
default: "default",
|
|
2474
|
-
neutral: "neutral",
|
|
2475
|
-
suggest: "suggest",
|
|
2476
|
-
primary: "accent",
|
|
2477
|
-
positive: "positive",
|
|
2478
|
-
caution: "caution",
|
|
2479
|
-
critical: "critical"
|
|
2480
2542
|
}, primitive$n = {
|
|
2481
2543
|
".selectable": {
|
|
2482
2544
|
backgroundColor: vars.color.bg,
|
|
2483
2545
|
color: vars.color.fg,
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2546
|
+
[varNames.color.bg]: vars.color.tinted.bg[0],
|
|
2547
|
+
[varNames.color.border]: vars.color.tinted.border[2],
|
|
2548
|
+
[varNames.color.fg]: vars.color.tinted.fg[2],
|
|
2487
2549
|
"@nest": {
|
|
2488
2550
|
"&:is(button)": {
|
|
2489
2551
|
WebkitFontSmoothing: "inherit",
|
|
@@ -2509,32 +2571,32 @@ const _inputStyle = {
|
|
|
2509
2571
|
// cursor: 'pointer',
|
|
2510
2572
|
},
|
|
2511
2573
|
"&:not([data-disabled]):hover": {
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2574
|
+
[varNames.color.bg]: vars.color.tinted.bg[1],
|
|
2575
|
+
[varNames.color.border]: vars.color.tinted.border[3],
|
|
2576
|
+
[varNames.color.fg]: vars.color.tinted.fg[1],
|
|
2577
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[2],
|
|
2578
|
+
[varNames.color.muted.fg]: vars.color.tinted.fg[4]
|
|
2517
2579
|
},
|
|
2518
2580
|
'&:not([data-disabled]):active, &:not([data-disabled])[aria-pressed="true"], &:not([data-disabled])[data-pressed]': {
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2581
|
+
[varNames.color.bg]: vars.color.tinted.bg[2],
|
|
2582
|
+
[varNames.color.border]: vars.color.tinted.border[4],
|
|
2583
|
+
[varNames.color.fg]: vars.color.tinted.fg[0],
|
|
2584
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[3],
|
|
2585
|
+
[varNames.color.muted.fg]: vars.color.tinted.fg[4]
|
|
2524
2586
|
},
|
|
2525
2587
|
"&:not([data-disabled]):focus": {
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2588
|
+
[varNames.color.bg]: vars.color.solid.primary.bg[0],
|
|
2589
|
+
[varNames.color.border]: vars.color.solid.primary.border[1],
|
|
2590
|
+
[varNames.color.fg]: vars.color.solid.primary.fg[0],
|
|
2591
|
+
[varNames.color.muted.bg]: vars.color.solid.primary.bg[1],
|
|
2592
|
+
[varNames.color.muted.fg]: vars.color.solid.primary.fg[3]
|
|
2531
2593
|
},
|
|
2532
2594
|
"&[data-disabled]": {
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2595
|
+
[varNames.color.bg]: vars.color.tinted.bg[0],
|
|
2596
|
+
[varNames.color.border]: vars.color.tinted.border[1],
|
|
2597
|
+
[varNames.color.fg]: vars.color.tinted.border[4],
|
|
2598
|
+
[varNames.color.muted.bg]: vars.color.tinted.bg[1],
|
|
2599
|
+
[varNames.color.muted.fg]: vars.color.tinted.border[4]
|
|
2538
2600
|
}
|
|
2539
2601
|
}
|
|
2540
2602
|
}
|
|
@@ -2549,7 +2611,7 @@ function buildSelectableTones() {
|
|
|
2549
2611
|
const rules2 = {};
|
|
2550
2612
|
for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
2551
2613
|
const target = varNames.color, source = vars.color;
|
|
2552
|
-
rules2[`&.${
|
|
2614
|
+
rules2[`&.${tone}`] = {
|
|
2553
2615
|
[target.tinted.bg[0]]: source.tinted[tone].bg[0],
|
|
2554
2616
|
[target.tinted.bg[1]]: source.tinted[tone].bg[1],
|
|
2555
2617
|
[target.tinted.bg[2]]: source.tinted[tone].bg[2],
|
|
@@ -2586,6 +2648,7 @@ function buildSelectableTones() {
|
|
|
2586
2648
|
}
|
|
2587
2649
|
const primitive$m = {
|
|
2588
2650
|
".avatar": {
|
|
2651
|
+
[varNames.color.fg]: vars.color.avatar.fg,
|
|
2589
2652
|
backgroundColor: vars.color.avatar.bg,
|
|
2590
2653
|
position: "relative",
|
|
2591
2654
|
boxSizing: "border-box",
|
|
@@ -2596,11 +2659,7 @@ const primitive$m = {
|
|
|
2596
2659
|
height: vars.avatar.size,
|
|
2597
2660
|
borderRadius: vars.avatar.size,
|
|
2598
2661
|
"@nest": {
|
|
2599
|
-
|
|
2600
|
-
opacity: 0.5
|
|
2601
|
-
},
|
|
2602
|
-
// &:is(button)
|
|
2603
|
-
"&:is(button)": {
|
|
2662
|
+
"button&": {
|
|
2604
2663
|
WebkitFontSmoothing: "inherit",
|
|
2605
2664
|
appearance: "none",
|
|
2606
2665
|
margin: 0,
|
|
@@ -2610,11 +2669,11 @@ const primitive$m = {
|
|
|
2610
2669
|
color: "inherit",
|
|
2611
2670
|
outline: "none"
|
|
2612
2671
|
},
|
|
2613
|
-
"&:
|
|
2672
|
+
"button&:focus": {
|
|
2614
2673
|
outline: "var(--avatar-focus-ring-width) solid var(--color-focus-ring)",
|
|
2615
2674
|
outlineOffset: "var(--avatar-focus-ring-offset)"
|
|
2616
2675
|
},
|
|
2617
|
-
"&:
|
|
2676
|
+
"button&:focus:not(:focus-visible)": {
|
|
2618
2677
|
boxShadow: "none"
|
|
2619
2678
|
},
|
|
2620
2679
|
":disabled &, [data-disabled] &": {
|
|
@@ -2764,7 +2823,7 @@ const badgeStyle = {
|
|
|
2764
2823
|
layers: {
|
|
2765
2824
|
primitive: primitive$k
|
|
2766
2825
|
}
|
|
2767
|
-
}, toneMap
|
|
2826
|
+
}, toneMap = {
|
|
2768
2827
|
default: "default",
|
|
2769
2828
|
neutral: "neutral",
|
|
2770
2829
|
suggest: "suggest",
|
|
@@ -2825,7 +2884,7 @@ const badgeStyle = {
|
|
|
2825
2884
|
};
|
|
2826
2885
|
for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
2827
2886
|
const solid = vars.color.solid[tone], tinted = vars.color.tinted[tone];
|
|
2828
|
-
primitive$j[`.button.${variantMap.default}.${toneMap
|
|
2887
|
+
primitive$j[`.button.${variantMap.default}.${toneMap[tone]}`] = {
|
|
2829
2888
|
[varNames.color.bg]: solid.bg[0],
|
|
2830
2889
|
[varNames.color.border]: solid.border[1],
|
|
2831
2890
|
[varNames.color.fg]: solid.fg[0],
|
|
@@ -2855,14 +2914,25 @@ for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
|
2855
2914
|
[varNames.color.muted.fg]: solid.fg[4]
|
|
2856
2915
|
},
|
|
2857
2916
|
"&[data-disabled]": {
|
|
2858
|
-
[varNames.color.bg]: vars.color.default.
|
|
2859
|
-
[varNames.color.
|
|
2860
|
-
[varNames.color.
|
|
2861
|
-
[varNames.color.
|
|
2862
|
-
[varNames.color.
|
|
2917
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[3],
|
|
2918
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[3],
|
|
2919
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[3],
|
|
2920
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[3],
|
|
2921
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[3],
|
|
2922
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[3],
|
|
2923
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[3],
|
|
2924
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[3],
|
|
2925
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[3],
|
|
2926
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[1],
|
|
2927
|
+
[varNames.color.border]: vars.color.tinted.default.border[1],
|
|
2928
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[2],
|
|
2929
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[4],
|
|
2930
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
2931
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[2],
|
|
2932
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[4]
|
|
2863
2933
|
}
|
|
2864
2934
|
}
|
|
2865
|
-
}, primitive$j[`.button.${variantMap.ghost}.${toneMap
|
|
2935
|
+
}, primitive$j[`.button.${variantMap.ghost}.${toneMap[tone]}`] = {
|
|
2866
2936
|
[varNames.color.bg]: tinted.bg[1],
|
|
2867
2937
|
[varNames.color.border]: tinted.border[0],
|
|
2868
2938
|
[varNames.color.fg]: tinted.fg[2],
|
|
@@ -2895,14 +2965,25 @@ for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
|
2895
2965
|
"--button-box-shadow": "inset 0 0 0 var(--button-border-width) var(--color-border)"
|
|
2896
2966
|
},
|
|
2897
2967
|
"&[data-disabled]": {
|
|
2898
|
-
[varNames.color.bg]: vars.color.default.
|
|
2899
|
-
[varNames.color.
|
|
2900
|
-
[varNames.color.
|
|
2901
|
-
[varNames.color.
|
|
2902
|
-
[varNames.color.
|
|
2968
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[2],
|
|
2969
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[2],
|
|
2970
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[2],
|
|
2971
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[2],
|
|
2972
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[2],
|
|
2973
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[2],
|
|
2974
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[2],
|
|
2975
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[2],
|
|
2976
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[2],
|
|
2977
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
2978
|
+
[varNames.color.border]: vars.color.tinted.default.border[0],
|
|
2979
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[1],
|
|
2980
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[3],
|
|
2981
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
2982
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
2983
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
2903
2984
|
}
|
|
2904
2985
|
}
|
|
2905
|
-
}, primitive$j[`.button.${variantMap.bleed}.${toneMap
|
|
2986
|
+
}, primitive$j[`.button.${variantMap.bleed}.${toneMap[tone]}`] = {
|
|
2906
2987
|
boxShadow: "none",
|
|
2907
2988
|
[varNames.color.bg]: tinted.bg[0],
|
|
2908
2989
|
[varNames.color.border]: tinted.border[1],
|
|
@@ -2933,11 +3014,22 @@ for (const tone of theme.THEME_COLOR_STATE_TONES) {
|
|
|
2933
3014
|
[varNames.color.muted.fg]: tinted.fg[3]
|
|
2934
3015
|
},
|
|
2935
3016
|
"&[data-disabled]": {
|
|
2936
|
-
[varNames.color.bg]: vars.color.default.
|
|
2937
|
-
[varNames.color.
|
|
2938
|
-
[varNames.color.
|
|
2939
|
-
[varNames.color.
|
|
2940
|
-
[varNames.color.
|
|
3017
|
+
[varNames.color.avatar.gray.bg]: vars.color.tinted.default.bg[2],
|
|
3018
|
+
[varNames.color.avatar.blue.bg]: vars.color.tinted.default.bg[2],
|
|
3019
|
+
[varNames.color.avatar.purple.bg]: vars.color.tinted.default.bg[2],
|
|
3020
|
+
[varNames.color.avatar.magenta.bg]: vars.color.tinted.default.bg[2],
|
|
3021
|
+
[varNames.color.avatar.red.bg]: vars.color.tinted.default.bg[2],
|
|
3022
|
+
[varNames.color.avatar.orange.bg]: vars.color.tinted.default.bg[2],
|
|
3023
|
+
[varNames.color.avatar.yellow.bg]: vars.color.tinted.default.bg[2],
|
|
3024
|
+
[varNames.color.avatar.green.bg]: vars.color.tinted.default.bg[2],
|
|
3025
|
+
[varNames.color.avatar.cyan.bg]: vars.color.tinted.default.bg[2],
|
|
3026
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
3027
|
+
[varNames.color.border]: vars.color.tinted.default.border[0],
|
|
3028
|
+
[varNames.color.code.bg]: vars.color.tinted.default.bg[1],
|
|
3029
|
+
[varNames.color.code.fg]: vars.color.tinted.default.border[3],
|
|
3030
|
+
[varNames.color.fg]: vars.color.tinted.default.border[4],
|
|
3031
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
3032
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
2941
3033
|
}
|
|
2942
3034
|
}
|
|
2943
3035
|
};
|
|
@@ -2946,16 +3038,6 @@ const buttonStyle = {
|
|
|
2946
3038
|
layers: {
|
|
2947
3039
|
primitive: primitive$j
|
|
2948
3040
|
}
|
|
2949
|
-
}, toneMap = {
|
|
2950
|
-
transparent: "transparent",
|
|
2951
|
-
default: "default",
|
|
2952
|
-
neutral: "neutral",
|
|
2953
|
-
suggest: "suggest",
|
|
2954
|
-
primary: "accent",
|
|
2955
|
-
positive: "positive",
|
|
2956
|
-
caution: "caution",
|
|
2957
|
-
critical: "critical",
|
|
2958
|
-
inherit: void 0
|
|
2959
3041
|
}, primitive$i = {
|
|
2960
3042
|
".card": {
|
|
2961
3043
|
backgroundColor: vars.color.bg,
|
|
@@ -3030,7 +3112,7 @@ const buttonStyle = {
|
|
|
3030
3112
|
// '--color-muted-bg': vars.color.solid.bg[1],
|
|
3031
3113
|
// '--color-muted-fg': vars.color.solid.fg[3],
|
|
3032
3114
|
// },
|
|
3033
|
-
"a&[data-disabled]
|
|
3115
|
+
"a&[data-disabled], button&[data-disabled]": {
|
|
3034
3116
|
[varNames.color.bg]: vars.color.tinted.default.bg[2],
|
|
3035
3117
|
[varNames.color.border]: vars.color.tinted.default.border[4],
|
|
3036
3118
|
[varNames.color.fg]: vars.color.tinted.default.fg[0],
|
|
@@ -3081,9 +3163,10 @@ for (const tone of theme.THEME_COLOR_CARD_TONES) {
|
|
|
3081
3163
|
"--card-shadow-umbra-color": vars.color.shadow.umbra,
|
|
3082
3164
|
"--card-shadow-penumbra-color": vars.color.shadow.penumbra,
|
|
3083
3165
|
"--card-shadow-ambient-color": vars.color.shadow.ambient
|
|
3166
|
+
// todo
|
|
3084
3167
|
// '--card-skeleton-from-color': 'var(--color-skeleton-from)',
|
|
3085
3168
|
// '--card-skeleton-to-color': 'var(--color-skeleton-to)',
|
|
3086
|
-
}), primitive$i[`.card.${
|
|
3169
|
+
}), primitive$i[`.card.${tone}`] = toneProps;
|
|
3087
3170
|
}
|
|
3088
3171
|
const cardStyle = {
|
|
3089
3172
|
layers: {
|
|
@@ -3091,9 +3174,6 @@ const cardStyle = {
|
|
|
3091
3174
|
}
|
|
3092
3175
|
};
|
|
3093
3176
|
function _assignToneProps(toneProps, _varNames, _vars) {
|
|
3094
|
-
Object.assign(toneProps, {
|
|
3095
|
-
[_varNames.accent.fg]: _vars.accent.fg
|
|
3096
|
-
});
|
|
3097
3177
|
for (const hue of theme.THEME_COLOR_AVATAR_COLORS)
|
|
3098
3178
|
toneProps[`${_varNames.avatar[hue].bg}`] = _vars.avatar[hue].bg, toneProps[`${_varNames.avatar[hue].fg}`] = _vars.avatar[hue].fg;
|
|
3099
3179
|
Object.assign(toneProps, {
|
|
@@ -3909,115 +3989,115 @@ const textStyle = {
|
|
|
3909
3989
|
_prefix: !1,
|
|
3910
3990
|
"@nest": {
|
|
3911
3991
|
"&.atrule": {
|
|
3912
|
-
color:
|
|
3992
|
+
color: vars.color.code.token.atrule
|
|
3913
3993
|
},
|
|
3914
3994
|
"&.attr-name": {
|
|
3915
|
-
color:
|
|
3995
|
+
color: vars.color.code.token.attrName
|
|
3916
3996
|
},
|
|
3917
3997
|
"&.attr-value": {
|
|
3918
|
-
color:
|
|
3998
|
+
color: vars.color.code.token.attrValue
|
|
3919
3999
|
},
|
|
3920
4000
|
"&.attribute": {
|
|
3921
|
-
color:
|
|
4001
|
+
color: vars.color.code.token.attribute
|
|
3922
4002
|
},
|
|
3923
4003
|
"&.boolean": {
|
|
3924
|
-
color:
|
|
4004
|
+
color: vars.color.code.token.boolean
|
|
3925
4005
|
},
|
|
3926
4006
|
"&.builtin": {
|
|
3927
|
-
color:
|
|
4007
|
+
color: vars.color.code.token.builtin
|
|
3928
4008
|
},
|
|
3929
4009
|
"&.cdata": {
|
|
3930
|
-
color:
|
|
4010
|
+
color: vars.color.code.token.cdata
|
|
3931
4011
|
},
|
|
3932
4012
|
"&.char": {
|
|
3933
|
-
color:
|
|
4013
|
+
color: vars.color.code.token.char
|
|
3934
4014
|
},
|
|
3935
4015
|
"&.class": {
|
|
3936
|
-
color:
|
|
4016
|
+
color: vars.color.code.token.class
|
|
3937
4017
|
},
|
|
3938
4018
|
"&.class-name": {
|
|
3939
|
-
color:
|
|
4019
|
+
color: vars.color.code.token.className
|
|
3940
4020
|
},
|
|
3941
4021
|
"&.comment": {
|
|
3942
|
-
color:
|
|
4022
|
+
color: vars.color.code.token.comment
|
|
3943
4023
|
},
|
|
3944
4024
|
"&.constant": {
|
|
3945
|
-
color:
|
|
4025
|
+
color: vars.color.code.token.constant
|
|
3946
4026
|
},
|
|
3947
4027
|
"&.deleted": {
|
|
3948
|
-
color:
|
|
4028
|
+
color: vars.color.code.token.deleted
|
|
3949
4029
|
},
|
|
3950
4030
|
"&.doctype": {
|
|
3951
|
-
color:
|
|
4031
|
+
color: vars.color.code.token.doctype
|
|
3952
4032
|
},
|
|
3953
4033
|
"&.entity": {
|
|
3954
|
-
color:
|
|
4034
|
+
color: vars.color.code.token.entity
|
|
3955
4035
|
},
|
|
3956
4036
|
"&.function": {
|
|
3957
|
-
color:
|
|
4037
|
+
color: vars.color.code.token.function
|
|
3958
4038
|
},
|
|
3959
4039
|
"&.hexcode": {
|
|
3960
|
-
color:
|
|
4040
|
+
color: vars.color.code.token.hexcode
|
|
3961
4041
|
},
|
|
3962
4042
|
"&.id": {
|
|
3963
|
-
color:
|
|
4043
|
+
color: vars.color.code.token.id
|
|
3964
4044
|
},
|
|
3965
4045
|
"&.important": {
|
|
3966
|
-
color:
|
|
4046
|
+
color: vars.color.code.token.important
|
|
3967
4047
|
},
|
|
3968
4048
|
"&.inserted": {
|
|
3969
|
-
color:
|
|
4049
|
+
color: vars.color.code.token.inserted
|
|
3970
4050
|
},
|
|
3971
4051
|
"&.keyword": {
|
|
3972
|
-
color:
|
|
4052
|
+
color: vars.color.code.token.keyword
|
|
3973
4053
|
},
|
|
3974
4054
|
"&.number": {
|
|
3975
|
-
color:
|
|
4055
|
+
color: vars.color.code.token.number
|
|
3976
4056
|
},
|
|
3977
4057
|
"&.operator": {
|
|
3978
|
-
color:
|
|
4058
|
+
color: vars.color.code.token.operator
|
|
3979
4059
|
},
|
|
3980
4060
|
"&.prolog": {
|
|
3981
|
-
color:
|
|
4061
|
+
color: vars.color.code.token.prolog
|
|
3982
4062
|
},
|
|
3983
4063
|
"&.property": {
|
|
3984
|
-
color:
|
|
4064
|
+
color: vars.color.code.token.property
|
|
3985
4065
|
},
|
|
3986
4066
|
"&.pseudo-class": {
|
|
3987
|
-
color:
|
|
4067
|
+
color: vars.color.code.token.pseudoClass
|
|
3988
4068
|
},
|
|
3989
4069
|
"&.pseudo-element": {
|
|
3990
|
-
color:
|
|
4070
|
+
color: vars.color.code.token.pseudoElement
|
|
3991
4071
|
},
|
|
3992
4072
|
"&.punctuation": {
|
|
3993
|
-
color:
|
|
4073
|
+
color: vars.color.code.token.punctuation
|
|
3994
4074
|
},
|
|
3995
4075
|
"&.attr-value &:not(.attr-equals).punctuation": {
|
|
3996
4076
|
color: "inherit"
|
|
3997
4077
|
},
|
|
3998
4078
|
"&.regex": {
|
|
3999
|
-
color:
|
|
4079
|
+
color: vars.color.code.token.regex
|
|
4000
4080
|
},
|
|
4001
4081
|
"&.selector": {
|
|
4002
|
-
color:
|
|
4082
|
+
color: vars.color.code.token.selector
|
|
4003
4083
|
},
|
|
4004
4084
|
"&.string": {
|
|
4005
|
-
color:
|
|
4085
|
+
color: vars.color.code.token.string
|
|
4006
4086
|
},
|
|
4007
4087
|
"&.symbol": {
|
|
4008
|
-
color:
|
|
4088
|
+
color: vars.color.code.token.symbol
|
|
4009
4089
|
},
|
|
4010
4090
|
"&.tag": {
|
|
4011
|
-
color:
|
|
4091
|
+
color: vars.color.code.token.tag
|
|
4012
4092
|
},
|
|
4013
4093
|
"&.unit": {
|
|
4014
|
-
color:
|
|
4094
|
+
color: vars.color.code.token.unit
|
|
4015
4095
|
},
|
|
4016
4096
|
"&.url": {
|
|
4017
|
-
color:
|
|
4097
|
+
color: vars.color.code.token.url
|
|
4018
4098
|
},
|
|
4019
4099
|
"&.variable": {
|
|
4020
|
-
color:
|
|
4100
|
+
color: vars.color.code.token.variable
|
|
4021
4101
|
}
|
|
4022
4102
|
}
|
|
4023
4103
|
}
|
|
@@ -4056,8 +4136,8 @@ const textStyle = {
|
|
|
4056
4136
|
layers: {
|
|
4057
4137
|
primitive
|
|
4058
4138
|
}
|
|
4059
|
-
},
|
|
4060
|
-
// NOTE:
|
|
4139
|
+
}, _systemStyle = _mergeStyles([
|
|
4140
|
+
// NOTE: Order matters in CSS!
|
|
4061
4141
|
{
|
|
4062
4142
|
// define order of layers
|
|
4063
4143
|
layers: {
|
|
@@ -4140,121 +4220,25 @@ const textStyle = {
|
|
|
4140
4220
|
toastStyle,
|
|
4141
4221
|
treeStyle
|
|
4142
4222
|
]);
|
|
4143
|
-
function isRecord(value) {
|
|
4144
|
-
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
4145
|
-
}
|
|
4146
|
-
function isArray(value) {
|
|
4147
|
-
return Array.isArray(value);
|
|
4148
|
-
}
|
|
4149
|
-
function rem(value) {
|
|
4150
|
-
return value === 0 ? "0" : `${value / 16}rem`;
|
|
4151
|
-
}
|
|
4152
|
-
function px(value) {
|
|
4153
|
-
return value === 0 ? "0" : `${value}px`;
|
|
4154
|
-
}
|
|
4155
|
-
function toBoxShadow(value) {
|
|
4156
|
-
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
4157
|
-
}
|
|
4158
|
-
function compileStyle(style) {
|
|
4159
|
-
let css = "";
|
|
4160
|
-
if (style.rules && (css += compileStyleRules(style.rules)), style.keyframes && Object.keys(style.keyframes).length > 0)
|
|
4161
|
-
for (const [name, value] of Object.entries(style.keyframes)) {
|
|
4162
|
-
let keyframesCss = `@keyframes ${name} {
|
|
4163
|
-
`;
|
|
4164
|
-
for (const [key, props] of Object.entries(value))
|
|
4165
|
-
keyframesCss += ` ${key} {
|
|
4166
|
-
`, keyframesCss += compileProperties(props), keyframesCss += `}
|
|
4167
|
-
`;
|
|
4168
|
-
keyframesCss += `
|
|
4169
|
-
}
|
|
4170
|
-
`, css += keyframesCss;
|
|
4171
|
-
}
|
|
4172
|
-
if (style.layers && Object.keys(style.layers).length > 0)
|
|
4173
|
-
for (const [layerName, layerRules] of Object.entries(style.layers))
|
|
4174
|
-
Object.keys(layerRules).length > 0 && (css += `@layer ${PREFIX}${layerName} {
|
|
4175
|
-
`, css += compileStyleRules(layerRules), css += `}
|
|
4176
|
-
|
|
4177
|
-
`);
|
|
4178
|
-
return css;
|
|
4179
|
-
}
|
|
4180
|
-
function compileStyleRules(rules2) {
|
|
4181
|
-
let css = "";
|
|
4182
|
-
const mediaMap = /* @__PURE__ */ new Map();
|
|
4183
|
-
for (const [selector, properties] of Object.entries(rules2))
|
|
4184
|
-
if (properties) {
|
|
4185
|
-
if (properties["@media"])
|
|
4186
|
-
for (const [mediaQuery, mediaProps] of Object.entries(properties["@media"])) {
|
|
4187
|
-
const arr = mediaMap.get(mediaQuery) ?? [];
|
|
4188
|
-
arr.push({
|
|
4189
|
-
selector,
|
|
4190
|
-
props: mediaProps
|
|
4191
|
-
}), mediaMap.set(mediaQuery, arr);
|
|
4192
|
-
}
|
|
4193
|
-
css += compileStyleRule(selector, properties);
|
|
4194
|
-
}
|
|
4195
|
-
for (const [mediaQuery, mediaRules] of mediaMap) {
|
|
4196
|
-
css += `@media ${mediaQuery} {
|
|
4197
|
-
`;
|
|
4198
|
-
for (const rule of mediaRules)
|
|
4199
|
-
css += compileStyleRule(rule.selector, rule.props);
|
|
4200
|
-
css += `}
|
|
4201
|
-
|
|
4202
|
-
`;
|
|
4203
|
-
}
|
|
4204
|
-
return css;
|
|
4205
|
-
}
|
|
4206
|
-
function compileStyleRule(_selector, properties) {
|
|
4207
|
-
let css = "";
|
|
4208
|
-
const {
|
|
4209
|
-
_prefix = !0,
|
|
4210
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4211
|
-
"@media": _mediaProps,
|
|
4212
|
-
"@nest": nestedProps,
|
|
4213
|
-
...restProperties
|
|
4214
|
-
} = properties, selector = _prefix ? `${_selector.replace(/\./g, `.${PREFIX}`)}` : _selector;
|
|
4215
|
-
if (Object.entries(restProperties).length && (css += `${selector} {
|
|
4216
|
-
`, css += compileProperties(restProperties), css += `}
|
|
4217
|
-
|
|
4218
|
-
`), nestedProps)
|
|
4219
|
-
for (const [_nestedSelector, nestedProperties] of Object.entries(nestedProps)) {
|
|
4220
|
-
const nestedSelector = _prefix && (nestedProperties._prefix ?? !0) ? _nestedSelector.replace(/\./g, `.${PREFIX}`) : _nestedSelector;
|
|
4221
|
-
css += `${nestedSelector.replace(/&/g, selector)} {
|
|
4222
|
-
`, css += compileProperties(nestedProperties), css += `}
|
|
4223
|
-
|
|
4224
|
-
`;
|
|
4225
|
-
}
|
|
4226
|
-
return css;
|
|
4227
|
-
}
|
|
4228
|
-
function compileProperties(props) {
|
|
4229
|
-
let css = "";
|
|
4230
|
-
const propEntries = Object.entries(props);
|
|
4231
|
-
for (const [key, value] of propEntries)
|
|
4232
|
-
if (!key.startsWith("@"))
|
|
4233
|
-
if (isArray(value))
|
|
4234
|
-
for (const item of value)
|
|
4235
|
-
css += ` ${toSnakeCase(key)}: ${item};
|
|
4236
|
-
`;
|
|
4237
|
-
else
|
|
4238
|
-
css += ` ${toSnakeCase(key)}: ${value};
|
|
4239
|
-
`;
|
|
4240
|
-
return css;
|
|
4241
|
-
}
|
|
4242
|
-
function toSnakeCase(str) {
|
|
4243
|
-
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
4244
|
-
}
|
|
4245
4223
|
function compileSystem() {
|
|
4246
|
-
return
|
|
4224
|
+
return _compileStyle(_systemStyle);
|
|
4247
4225
|
}
|
|
4226
|
+
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4248
4227
|
function compileTheme_v3(theme2) {
|
|
4249
|
-
return
|
|
4250
|
-
|
|
4251
|
-
|
|
4228
|
+
return _compileStyle({
|
|
4229
|
+
layers: {
|
|
4230
|
+
theme: {
|
|
4231
|
+
":root": compileThemeProperties(theme2)
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4252
4234
|
});
|
|
4253
4235
|
}
|
|
4254
4236
|
function compileThemeProperties(theme2) {
|
|
4255
4237
|
return {
|
|
4256
4238
|
...buildAvatarThemeProperties(theme2),
|
|
4257
4239
|
...buildButtonThemeProperties(theme2),
|
|
4240
|
+
[varNames.card.shadow.outline]: px(theme2.card.shadow.outline),
|
|
4241
|
+
...buildColorThemeProperties(theme2),
|
|
4258
4242
|
...buildContainerThemeProperties(theme2),
|
|
4259
4243
|
...buildFontCodeThemeProperties(theme2),
|
|
4260
4244
|
...buildFontHeadingThemeProperties(theme2),
|
|
@@ -4263,167 +4247,171 @@ function compileThemeProperties(theme2) {
|
|
|
4263
4247
|
...buildInputThemeProperties(theme2),
|
|
4264
4248
|
...buildRadiusThemeProperties(theme2),
|
|
4265
4249
|
...buildShadowThemeProperties(theme2),
|
|
4266
|
-
...buildSpaceThemeProperties(theme2)
|
|
4267
|
-
...buildColorThemeProperties(theme2)
|
|
4250
|
+
...buildSpaceThemeProperties(theme2)
|
|
4268
4251
|
};
|
|
4269
4252
|
}
|
|
4270
4253
|
function buildAvatarThemeProperties(theme2) {
|
|
4271
4254
|
return {
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4255
|
+
[varNames.avatar.focusRing.offset]: px(theme2.avatar.focusRing.offset),
|
|
4256
|
+
[varNames.avatar.focusRing.width]: px(theme2.avatar.focusRing.width),
|
|
4257
|
+
[varNames.avatar.sizes[0].distance]: rem(theme2.avatar.sizes[0].distance),
|
|
4258
|
+
[varNames.avatar.sizes[0].size]: rem(theme2.avatar.sizes[0].size),
|
|
4259
|
+
[varNames.avatar.sizes[1].distance]: rem(theme2.avatar.sizes[1].distance),
|
|
4260
|
+
[varNames.avatar.sizes[1].size]: rem(theme2.avatar.sizes[1].size),
|
|
4261
|
+
[varNames.avatar.sizes[2].distance]: rem(theme2.avatar.sizes[2].distance),
|
|
4262
|
+
[varNames.avatar.sizes[2].size]: rem(theme2.avatar.sizes[2].size),
|
|
4263
|
+
[varNames.avatar.sizes[3].distance]: rem(theme2.avatar.sizes[3].distance),
|
|
4264
|
+
[varNames.avatar.sizes[3].size]: rem(theme2.avatar.sizes[3].size)
|
|
4282
4265
|
};
|
|
4283
4266
|
}
|
|
4284
4267
|
function buildButtonThemeProperties(theme2) {
|
|
4285
4268
|
return {
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
// [`--button-text-weight`]: theme.button.textWeight,
|
|
4269
|
+
[varNames.button.border.width]: px(theme2.button.border.width),
|
|
4270
|
+
[varNames.button.focusRing.offset]: px(theme2.button.focusRing.offset),
|
|
4271
|
+
[varNames.button.focusRing.width]: px(theme2.button.focusRing.width)
|
|
4290
4272
|
};
|
|
4291
4273
|
}
|
|
4292
4274
|
function buildContainerThemeProperties(theme2) {
|
|
4293
4275
|
return {
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4276
|
+
[varNames.container[0]]: rem(theme2.container[0]),
|
|
4277
|
+
[varNames.container[1]]: rem(theme2.container[1]),
|
|
4278
|
+
[varNames.container[2]]: rem(theme2.container[2]),
|
|
4279
|
+
[varNames.container[3]]: rem(theme2.container[3]),
|
|
4280
|
+
[varNames.container[4]]: rem(theme2.container[4]),
|
|
4281
|
+
[varNames.container[5]]: rem(theme2.container[5])
|
|
4300
4282
|
};
|
|
4301
4283
|
}
|
|
4302
4284
|
function buildFontCodeThemeProperties(theme$1) {
|
|
4303
|
-
const props = {
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4285
|
+
const v = varNames.font.code, t = theme$1.font.code, props = {
|
|
4286
|
+
[v.family]: t.family,
|
|
4287
|
+
[v.featureSettings]: t.featureSettings || "normal",
|
|
4288
|
+
[v.weights.regular]: t.weights.regular,
|
|
4289
|
+
[v.weights.medium]: t.weights.medium,
|
|
4290
|
+
[v.weights.semibold]: t.weights.semibold,
|
|
4291
|
+
[v.weights.bold]: t.weights.bold
|
|
4310
4292
|
};
|
|
4311
|
-
for (const size of theme.FONT_CODE_SIZE)
|
|
4312
|
-
|
|
4293
|
+
for (const size of theme.FONT_CODE_SIZE) {
|
|
4294
|
+
const _v = varNames.font.code.sizes[size], _t = theme$1.font.code.sizes[size];
|
|
4295
|
+
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);
|
|
4296
|
+
}
|
|
4313
4297
|
return props;
|
|
4314
4298
|
}
|
|
4315
4299
|
function buildFontHeadingThemeProperties(theme$1) {
|
|
4316
|
-
const props = {
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4300
|
+
const v = varNames.font.heading, t = theme$1.font.heading, props = {
|
|
4301
|
+
[v.family]: t.family,
|
|
4302
|
+
[v.featureSettings]: t.featureSettings,
|
|
4303
|
+
[v.weights.regular]: t.weights.regular,
|
|
4304
|
+
[v.weights.medium]: t.weights.medium,
|
|
4305
|
+
[v.weights.semibold]: t.weights.semibold,
|
|
4306
|
+
[v.weights.bold]: t.weights.bold
|
|
4323
4307
|
};
|
|
4324
|
-
for (const size of theme.FONT_HEADING_SIZE)
|
|
4325
|
-
|
|
4308
|
+
for (const size of theme.FONT_HEADING_SIZE) {
|
|
4309
|
+
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4310
|
+
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);
|
|
4311
|
+
}
|
|
4326
4312
|
return props;
|
|
4327
4313
|
}
|
|
4328
4314
|
function buildFontLabelThemeProperties(theme$1) {
|
|
4329
|
-
const props = {
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4315
|
+
const v = varNames.font.label, t = theme$1.font.label, props = {
|
|
4316
|
+
[v.family]: t.family,
|
|
4317
|
+
[v.featureSettings]: t.featureSettings,
|
|
4318
|
+
[v.weights.regular]: t.weights.regular,
|
|
4319
|
+
[v.weights.medium]: t.weights.medium,
|
|
4320
|
+
[v.weights.semibold]: t.weights.semibold,
|
|
4321
|
+
[v.weights.bold]: t.weights.bold
|
|
4336
4322
|
};
|
|
4337
|
-
for (const size of theme.FONT_LABEL_SIZE)
|
|
4338
|
-
|
|
4323
|
+
for (const size of theme.FONT_LABEL_SIZE) {
|
|
4324
|
+
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4325
|
+
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);
|
|
4326
|
+
}
|
|
4339
4327
|
return props;
|
|
4340
4328
|
}
|
|
4341
4329
|
function buildFontTextThemeProperties(theme$1) {
|
|
4342
|
-
const props = {
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4330
|
+
const v = varNames.font.text, t = theme$1.font.text, props = {
|
|
4331
|
+
[v.family]: t.family,
|
|
4332
|
+
[v.featureSettings]: t.featureSettings,
|
|
4333
|
+
[v.weights.regular]: t.weights.regular,
|
|
4334
|
+
[v.weights.medium]: t.weights.medium,
|
|
4335
|
+
[v.weights.semibold]: t.weights.semibold,
|
|
4336
|
+
[v.weights.bold]: t.weights.bold
|
|
4349
4337
|
};
|
|
4350
|
-
for (const size of theme.FONT_TEXT_SIZE)
|
|
4351
|
-
|
|
4338
|
+
for (const size of theme.FONT_TEXT_SIZE) {
|
|
4339
|
+
const _v = v.sizes[size], _t = t.sizes[size];
|
|
4340
|
+
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);
|
|
4341
|
+
}
|
|
4352
4342
|
return props;
|
|
4353
4343
|
}
|
|
4354
4344
|
function buildInputThemeProperties(theme2) {
|
|
4355
4345
|
return {
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4346
|
+
[varNames.input.border.width]: px(theme2.input.border.width),
|
|
4347
|
+
[varNames.input.checkbox.focusRing.offset]: px(theme2.input.checkbox.focusRing.offset),
|
|
4348
|
+
[varNames.input.checkbox.focusRing.width]: px(theme2.input.checkbox.focusRing.width),
|
|
4349
|
+
[varNames.input.checkbox.size]: rem(theme2.input.checkbox.size),
|
|
4350
|
+
[varNames.input.radio.focusRing.offset]: px(theme2.input.radio.focusRing.offset),
|
|
4351
|
+
[varNames.input.radio.focusRing.width]: px(theme2.input.radio.focusRing.width),
|
|
4352
|
+
[varNames.input.radio.markSize]: rem(theme2.input.radio.markSize),
|
|
4353
|
+
[varNames.input.radio.size]: rem(theme2.input.radio.size),
|
|
4354
|
+
[varNames.input.select.focusRing.offset]: px(theme2.input.select.focusRing.offset),
|
|
4355
|
+
[varNames.input.select.focusRing.width]: px(theme2.input.select.focusRing.width),
|
|
4356
|
+
[varNames.input.switch.focusRing.offset]: px(theme2.input.switch.focusRing.offset),
|
|
4357
|
+
[varNames.input.switch.focusRing.width]: px(theme2.input.switch.focusRing.width),
|
|
4358
|
+
[varNames.input.switch.height]: rem(theme2.input.switch.height),
|
|
4359
|
+
[varNames.input.switch.padding]: rem(theme2.input.switch.padding),
|
|
4360
|
+
[varNames.input.switch.transitionDurationMs]: `${theme2.input.switch.transitionDurationMs}ms`,
|
|
4361
|
+
[varNames.input.switch.transitionTimingFunction]: theme2.input.switch.transitionTimingFunction,
|
|
4362
|
+
[varNames.input.switch.width]: rem(theme2.input.switch.width),
|
|
4363
|
+
[varNames.input.text.focusRing.offset]: px(theme2.input.text.focusRing.offset),
|
|
4364
|
+
[varNames.input.text.focusRing.width]: px(theme2.input.text.focusRing.width)
|
|
4375
4365
|
};
|
|
4376
4366
|
}
|
|
4377
4367
|
function buildRadiusThemeProperties(theme2) {
|
|
4378
4368
|
return {
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4369
|
+
[varNames.radius[0]]: px(theme2.radius[0]),
|
|
4370
|
+
[varNames.radius[1]]: px(theme2.radius[1]),
|
|
4371
|
+
[varNames.radius[2]]: px(theme2.radius[2]),
|
|
4372
|
+
[varNames.radius[3]]: px(theme2.radius[3]),
|
|
4373
|
+
[varNames.radius[4]]: px(theme2.radius[4]),
|
|
4374
|
+
[varNames.radius[5]]: px(theme2.radius[5]),
|
|
4375
|
+
[varNames.radius[6]]: px(theme2.radius[6])
|
|
4386
4376
|
};
|
|
4387
4377
|
}
|
|
4388
4378
|
function buildShadowThemeProperties(theme2) {
|
|
4389
4379
|
return {
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
"--shadow-5-ambient": toBoxShadow(theme2.shadow[5]?.ambient)
|
|
4380
|
+
[varNames.shadow[0].umbra]: toBoxShadow(theme2.shadow[0]?.umbra),
|
|
4381
|
+
[varNames.shadow[0].penumbra]: toBoxShadow(theme2.shadow[0]?.penumbra),
|
|
4382
|
+
[varNames.shadow[0].ambient]: toBoxShadow(theme2.shadow[0]?.ambient),
|
|
4383
|
+
[varNames.shadow[1].umbra]: toBoxShadow(theme2.shadow[1]?.umbra),
|
|
4384
|
+
[varNames.shadow[1].penumbra]: toBoxShadow(theme2.shadow[1]?.penumbra),
|
|
4385
|
+
[varNames.shadow[1].ambient]: toBoxShadow(theme2.shadow[1]?.ambient),
|
|
4386
|
+
[varNames.shadow[2].umbra]: toBoxShadow(theme2.shadow[2]?.umbra),
|
|
4387
|
+
[varNames.shadow[2].penumbra]: toBoxShadow(theme2.shadow[2]?.penumbra),
|
|
4388
|
+
[varNames.shadow[2].ambient]: toBoxShadow(theme2.shadow[2]?.ambient),
|
|
4389
|
+
[varNames.shadow[3].umbra]: toBoxShadow(theme2.shadow[3]?.umbra),
|
|
4390
|
+
[varNames.shadow[3].penumbra]: toBoxShadow(theme2.shadow[3]?.penumbra),
|
|
4391
|
+
[varNames.shadow[3].ambient]: toBoxShadow(theme2.shadow[3]?.ambient),
|
|
4392
|
+
[varNames.shadow[4].umbra]: toBoxShadow(theme2.shadow[4]?.umbra),
|
|
4393
|
+
[varNames.shadow[4].penumbra]: toBoxShadow(theme2.shadow[4]?.penumbra),
|
|
4394
|
+
[varNames.shadow[4].ambient]: toBoxShadow(theme2.shadow[4]?.ambient),
|
|
4395
|
+
[varNames.shadow[5].umbra]: toBoxShadow(theme2.shadow[5]?.umbra),
|
|
4396
|
+
[varNames.shadow[5].penumbra]: toBoxShadow(theme2.shadow[5]?.penumbra),
|
|
4397
|
+
[varNames.shadow[5].ambient]: toBoxShadow(theme2.shadow[5]?.ambient)
|
|
4409
4398
|
};
|
|
4410
4399
|
}
|
|
4411
4400
|
function buildSpaceThemeProperties(theme2) {
|
|
4412
4401
|
return {
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4402
|
+
[varNames.space[0]]: px(theme2.space[0]),
|
|
4403
|
+
[varNames.space[0.5]]: px(theme2.space[1] / 2),
|
|
4404
|
+
[varNames.space[1]]: px(theme2.space[1]),
|
|
4405
|
+
[varNames.space[2]]: px(theme2.space[2]),
|
|
4406
|
+
[varNames.space[3]]: px(theme2.space[3]),
|
|
4407
|
+
[varNames.space[4]]: px(theme2.space[4]),
|
|
4408
|
+
[varNames.space[5]]: px(theme2.space[5]),
|
|
4409
|
+
[varNames.space[6]]: px(theme2.space[6]),
|
|
4410
|
+
[varNames.space[7]]: px(theme2.space[7]),
|
|
4411
|
+
[varNames.space[8]]: px(theme2.space[8]),
|
|
4412
|
+
[varNames.space[9]]: px(theme2.space[9])
|
|
4424
4413
|
};
|
|
4425
4414
|
}
|
|
4426
|
-
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4427
4415
|
function buildColorThemeProperties(theme$1) {
|
|
4428
4416
|
const props = {};
|
|
4429
4417
|
for (const scheme of THEME_COLOR_SCHEMES)
|
|
@@ -4437,27 +4425,27 @@ function buildColorThemeProperties(theme$1) {
|
|
|
4437
4425
|
}));
|
|
4438
4426
|
for (const colorVariant of THEME_COLOR_VARIANTS)
|
|
4439
4427
|
for (const elementTone of theme.THEME_COLOR_STATE_TONES) {
|
|
4440
|
-
const
|
|
4441
|
-
bgVar:
|
|
4442
|
-
hue:
|
|
4428
|
+
const v = varNames.color[scheme][cardTone][colorVariant][elementTone], t = theme$1._tokens.color[cardTone].variant[colorVariant][elementTone], context = {
|
|
4429
|
+
bgVar: v.bg[0],
|
|
4430
|
+
hue: t._hue,
|
|
4443
4431
|
scheme
|
|
4444
4432
|
};
|
|
4445
4433
|
Object.assign(props, {
|
|
4446
|
-
[
|
|
4447
|
-
[
|
|
4448
|
-
[
|
|
4449
|
-
[
|
|
4450
|
-
[
|
|
4451
|
-
[
|
|
4452
|
-
[
|
|
4453
|
-
[
|
|
4454
|
-
[
|
|
4455
|
-
[
|
|
4456
|
-
[
|
|
4457
|
-
[
|
|
4458
|
-
[
|
|
4459
|
-
[
|
|
4460
|
-
[
|
|
4434
|
+
[v.bg[0]]: theme.renderColor(t.bg[0], context),
|
|
4435
|
+
[v.bg[1]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 25%)`,
|
|
4436
|
+
[v.bg[2]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 50%)`,
|
|
4437
|
+
[v.bg[3]]: `color-mix(in srgb, var(${v.bg[0]}), var(${v.bg[4]}) 75%)`,
|
|
4438
|
+
[v.bg[4]]: theme.renderColor(t.bg[4], context),
|
|
4439
|
+
[v.border[0]]: theme.renderColor(t.border[0], context),
|
|
4440
|
+
[v.border[1]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 25%)`,
|
|
4441
|
+
[v.border[2]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 50%)`,
|
|
4442
|
+
[v.border[3]]: `color-mix(in srgb, var(${v.border[0]}), var(${v.border[4]}) 75%)`,
|
|
4443
|
+
[v.border[4]]: theme.renderColor(t.border[4], context),
|
|
4444
|
+
[v.fg[0]]: theme.renderColor(t.fg[0], context),
|
|
4445
|
+
[v.fg[1]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 25%)`,
|
|
4446
|
+
[v.fg[2]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 50%)`,
|
|
4447
|
+
[v.fg[3]]: `color-mix(in srgb, var(${v.fg[0]}), var(${v.fg[4]}) 75%)`,
|
|
4448
|
+
[v.fg[4]]: theme.renderColor(t.fg[4], context)
|
|
4461
4449
|
});
|
|
4462
4450
|
}
|
|
4463
4451
|
}
|
|
@@ -4467,16 +4455,16 @@ function buildColorAvatarThemeProperties(theme$1, options) {
|
|
|
4467
4455
|
const {
|
|
4468
4456
|
scheme,
|
|
4469
4457
|
cardTone
|
|
4470
|
-
} = options,
|
|
4458
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme$1._tokens.color[cardTone], props = {};
|
|
4471
4459
|
for (const hue of theme.HUES) {
|
|
4472
4460
|
const context = {
|
|
4473
|
-
bgVar:
|
|
4474
|
-
hue:
|
|
4461
|
+
bgVar: varNames.color.bg,
|
|
4462
|
+
hue: t.avatar[hue]._hue ?? hue,
|
|
4475
4463
|
scheme
|
|
4476
4464
|
};
|
|
4477
4465
|
Object.assign(props, {
|
|
4478
|
-
[
|
|
4479
|
-
[
|
|
4466
|
+
[v.avatar[hue].bg]: theme.renderColor(t.avatar[hue].bg, context),
|
|
4467
|
+
[v.avatar[hue].fg]: theme.renderColor(t.avatar[hue].fg, context)
|
|
4480
4468
|
});
|
|
4481
4469
|
}
|
|
4482
4470
|
return props;
|
|
@@ -4485,63 +4473,63 @@ function buildColorCardThemeProperties(theme$1, options) {
|
|
|
4485
4473
|
const {
|
|
4486
4474
|
scheme,
|
|
4487
4475
|
cardTone
|
|
4488
|
-
} = options,
|
|
4489
|
-
bgVar:
|
|
4490
|
-
hue:
|
|
4476
|
+
} = options, v = varNames.color[scheme][cardTone], t = theme$1._tokens.color[cardTone], context = {
|
|
4477
|
+
bgVar: varNames.color.bg,
|
|
4478
|
+
hue: t._hue,
|
|
4491
4479
|
scheme
|
|
4492
4480
|
};
|
|
4493
4481
|
return {
|
|
4494
4482
|
// backdrop
|
|
4495
|
-
[
|
|
4483
|
+
[v.backdrop]: theme.renderColor(t.backdrop, context),
|
|
4496
4484
|
// code
|
|
4497
|
-
[
|
|
4498
|
-
[
|
|
4485
|
+
[v.code.bg]: theme.renderColor(t.code.bg, context),
|
|
4486
|
+
[v.code.fg]: theme.renderColor(t.code.fg, context),
|
|
4499
4487
|
// code / token
|
|
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
|
-
[
|
|
4535
|
-
[
|
|
4488
|
+
[v.code.token.atrule]: theme.renderColor(t.code.token.atrule, context),
|
|
4489
|
+
[v.code.token.attrName]: theme.renderColor(t.code.token.attrName, context),
|
|
4490
|
+
[v.code.token.attrValue]: theme.renderColor(t.code.token.attrValue, context),
|
|
4491
|
+
[v.code.token.attribute]: theme.renderColor(t.code.token.attribute, context),
|
|
4492
|
+
[v.code.token.boolean]: theme.renderColor(t.code.token.boolean, context),
|
|
4493
|
+
[v.code.token.builtin]: theme.renderColor(t.code.token.builtin, context),
|
|
4494
|
+
[v.code.token.cdata]: theme.renderColor(t.code.token.cdata, context),
|
|
4495
|
+
[v.code.token.char]: theme.renderColor(t.code.token.char, context),
|
|
4496
|
+
[v.code.token.className]: theme.renderColor(t.code.token.className, context),
|
|
4497
|
+
[v.code.token.class]: theme.renderColor(t.code.token.class, context),
|
|
4498
|
+
[v.code.token.comment]: theme.renderColor(t.code.token.comment, context),
|
|
4499
|
+
[v.code.token.constant]: theme.renderColor(t.code.token.constant, context),
|
|
4500
|
+
[v.code.token.deleted]: theme.renderColor(t.code.token.deleted, context),
|
|
4501
|
+
[v.code.token.doctype]: theme.renderColor(t.code.token.doctype, context),
|
|
4502
|
+
[v.code.token.entity]: theme.renderColor(t.code.token.entity, context),
|
|
4503
|
+
[v.code.token.function]: theme.renderColor(t.code.token.function, context),
|
|
4504
|
+
[v.code.token.hexcode]: theme.renderColor(t.code.token.hexcode, context),
|
|
4505
|
+
[v.code.token.id]: theme.renderColor(t.code.token.id, context),
|
|
4506
|
+
[v.code.token.important]: theme.renderColor(t.code.token.important, context),
|
|
4507
|
+
[v.code.token.inserted]: theme.renderColor(t.code.token.inserted, context),
|
|
4508
|
+
[v.code.token.keyword]: theme.renderColor(t.code.token.keyword, context),
|
|
4509
|
+
[v.code.token.number]: theme.renderColor(t.code.token.number, context),
|
|
4510
|
+
[v.code.token.operator]: theme.renderColor(t.code.token.operator, context),
|
|
4511
|
+
[v.code.token.prolog]: theme.renderColor(t.code.token.prolog, context),
|
|
4512
|
+
[v.code.token.property]: theme.renderColor(t.code.token.property, context),
|
|
4513
|
+
[v.code.token.pseudoClass]: theme.renderColor(t.code.token.pseudoClass, context),
|
|
4514
|
+
[v.code.token.pseudoElement]: theme.renderColor(t.code.token.pseudoElement, context),
|
|
4515
|
+
[v.code.token.punctuation]: theme.renderColor(t.code.token.punctuation, context),
|
|
4516
|
+
[v.code.token.regex]: theme.renderColor(t.code.token.regex, context),
|
|
4517
|
+
[v.code.token.selector]: theme.renderColor(t.code.token.selector, context),
|
|
4518
|
+
[v.code.token.string]: theme.renderColor(t.code.token.string, context),
|
|
4519
|
+
[v.code.token.symbol]: theme.renderColor(t.code.token.symbol, context),
|
|
4520
|
+
[v.code.token.tag]: theme.renderColor(t.code.token.tag, context),
|
|
4521
|
+
[v.code.token.unit]: theme.renderColor(t.code.token.unit, context),
|
|
4522
|
+
[v.code.token.url]: theme.renderColor(t.code.token.url, context),
|
|
4523
|
+
[v.code.token.variable]: theme.renderColor(t.code.token.variable, context),
|
|
4536
4524
|
// focus ring
|
|
4537
|
-
[
|
|
4525
|
+
[v.focusRing]: theme.renderColor(t.focusRing, context),
|
|
4538
4526
|
// link
|
|
4539
|
-
[
|
|
4527
|
+
[v.link.fg]: theme.renderColor(t.link.fg, context),
|
|
4540
4528
|
// shadow
|
|
4541
|
-
[
|
|
4542
|
-
[
|
|
4543
|
-
[
|
|
4544
|
-
[
|
|
4529
|
+
[v.shadow.outline]: theme.renderColor(t.shadow.outline, context),
|
|
4530
|
+
[v.shadow.umbra]: theme.renderColor(t.shadow.umbra, context),
|
|
4531
|
+
[v.shadow.penumbra]: theme.renderColor(t.shadow.penumbra, context),
|
|
4532
|
+
[v.shadow.ambient]: theme.renderColor(t.shadow.ambient, context)
|
|
4545
4533
|
};
|
|
4546
4534
|
}
|
|
4547
4535
|
function compileTheme(theme2) {
|
|
@@ -4620,6 +4608,9 @@ function _arrow() {
|
|
|
4620
4608
|
function _arrowStroke() {
|
|
4621
4609
|
return _comp("arrow-stroke");
|
|
4622
4610
|
}
|
|
4611
|
+
function _arrowStrokeMask() {
|
|
4612
|
+
return _comp("arrow-stroke-mask");
|
|
4613
|
+
}
|
|
4623
4614
|
function _arrowShape() {
|
|
4624
4615
|
return _comp("arrow-shape");
|
|
4625
4616
|
}
|
|
@@ -4633,7 +4624,7 @@ function _inputPresentation() {
|
|
|
4633
4624
|
return _comp("input-presentation");
|
|
4634
4625
|
}
|
|
4635
4626
|
function _selectable(props) {
|
|
4636
|
-
return _comp("selectable",
|
|
4627
|
+
return _comp("selectable", props.tone ?? "default", radius(props));
|
|
4637
4628
|
}
|
|
4638
4629
|
function avatar(props) {
|
|
4639
4630
|
return _comp("avatar", props.color || "gray", _resp("avatar", props.size));
|
|
@@ -4688,13 +4679,13 @@ function button(props) {
|
|
|
4688
4679
|
mode,
|
|
4689
4680
|
tone
|
|
4690
4681
|
} = props;
|
|
4691
|
-
return _comp("button", variantMap[mode ?? "default"], toneMap
|
|
4682
|
+
return _comp("button", variantMap[mode ?? "default"], toneMap[tone ?? "default"], display(props), flexItem(props), radius(props), width(props));
|
|
4692
4683
|
}
|
|
4693
4684
|
function buttonLoadingBox() {
|
|
4694
4685
|
return "button-loading-box";
|
|
4695
4686
|
}
|
|
4696
4687
|
function card(props) {
|
|
4697
|
-
return _comp(props.scheme,
|
|
4688
|
+
return _comp(props.scheme, props.tone ?? "default", "card", props.checkered && "card-checkered", shadow(props));
|
|
4698
4689
|
}
|
|
4699
4690
|
function checkbox() {
|
|
4700
4691
|
return _comp("checkbox");
|
|
@@ -4776,9 +4767,13 @@ function tooltipCard() {
|
|
|
4776
4767
|
function srOnly() {
|
|
4777
4768
|
return composeClassNames("sr-only");
|
|
4778
4769
|
}
|
|
4770
|
+
exports.BREAKPOINTS = BREAKPOINTS;
|
|
4771
|
+
exports.PREFIX = PREFIX;
|
|
4779
4772
|
exports._arrow = _arrow;
|
|
4780
4773
|
exports._arrowShape = _arrowShape;
|
|
4781
4774
|
exports._arrowStroke = _arrowStroke;
|
|
4775
|
+
exports._arrowStrokeMask = _arrowStrokeMask;
|
|
4776
|
+
exports._getClassNames = _getClassNames;
|
|
4782
4777
|
exports._input = _input;
|
|
4783
4778
|
exports._inputElement = _inputElement;
|
|
4784
4779
|
exports._inputPresentation = _inputPresentation;
|
|
@@ -4823,7 +4818,6 @@ exports.flex = flex;
|
|
|
4823
4818
|
exports.flexItem = flexItem;
|
|
4824
4819
|
exports.font = font;
|
|
4825
4820
|
exports.gap = gap;
|
|
4826
|
-
exports.getClassNames = getClassNames;
|
|
4827
4821
|
exports.grid = grid;
|
|
4828
4822
|
exports.gridItem = gridItem;
|
|
4829
4823
|
exports.heading = heading;
|