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