@sanity/ui 3.0.0-static.11 → 3.0.0-static.13
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 +1293 -1215
- 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 +1284 -1202
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +528 -358
- package/dist/_visual-editing.d.ts +528 -358
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +143 -73
- package/dist/css.d.ts +143 -73
- package/dist/css.js +329 -472
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +330 -473
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1362 -869
- package/dist/index.d.ts +1362 -869
- package/dist/index.js +383 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +387 -312
- 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 -21946
- 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 +9 -9
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +9 -9
- 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/{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/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.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/{compile/compilePalette.ts → compilePalette.ts} +14 -10
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
- 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.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 +2 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_arrow/_arrow.ts +3 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
- 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.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 +3 -6
- 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/tooltip/tooltip.ts +2 -0
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +9 -12
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +3 -1
- package/src/css/varNames.ts +131 -141
- package/src/css/vars.ts +1 -6
- 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 +1 -0
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/defaultTokens.ts +1 -0
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +3 -0
- package/src/ui/StyleTags.tsx +3 -1
- 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/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/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 +64 -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 +41 -26
- package/src/ui/primitives/popover/popover.tsx +281 -277
- package/src/ui/primitives/popover/popoverCard.tsx +119 -118
- 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 +42 -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 +76 -59
- 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 +40 -14
- 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 +36 -14
- 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 +36 -24
- 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 -7
- package/src/css/compile/types.ts +0 -6
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- 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
1
|
import { COLOR_HUES, COLOR_TINTS, color } from "@sanity/color";
|
|
2
|
-
import { SPACE, SHADOW, RADIUS, FONT_TEXT_SIZE, FONT_LABEL_SIZE, FONT_HEADING_SIZE, FONT_CODE_SIZE, AVATAR_SIZE, THEME_COLOR_STATE_TONES, HUES, TINTS,
|
|
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));
|
|
@@ -87,7 +87,7 @@ function scopeClassName(className) {
|
|
|
87
87
|
return `${PREFIX}${className.trim()}`;
|
|
88
88
|
}
|
|
89
89
|
function _comp(...classNames) {
|
|
90
|
-
return
|
|
90
|
+
return _getClassNames(...classNames).filter(Boolean).map(scopeClassName).join(" ") || void 0;
|
|
91
91
|
}
|
|
92
92
|
function textOverflow(props) {
|
|
93
93
|
return _comp(props.textOverflow && `text-overflow-${props.textOverflow}`);
|
|
@@ -95,6 +95,109 @@ function textOverflow(props) {
|
|
|
95
95
|
function width(props) {
|
|
96
96
|
return _resp("w", props.width) ?? "";
|
|
97
97
|
}
|
|
98
|
+
function isRecord(value) {
|
|
99
|
+
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
100
|
+
}
|
|
101
|
+
function isArray(value) {
|
|
102
|
+
return Array.isArray(value);
|
|
103
|
+
}
|
|
104
|
+
function rem(value) {
|
|
105
|
+
return value === 0 ? "0" : `${value / 16}rem`;
|
|
106
|
+
}
|
|
107
|
+
function px(value) {
|
|
108
|
+
return value === 0 ? "0" : `${value}px`;
|
|
109
|
+
}
|
|
110
|
+
function toBoxShadow(value) {
|
|
111
|
+
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
112
|
+
}
|
|
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 += `
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
`, css += keyframesCss;
|
|
127
|
+
}
|
|
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;
|
|
135
|
+
}
|
|
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);
|
|
150
|
+
}
|
|
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
|
+
`;
|
|
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()}`);
|
|
200
|
+
}
|
|
98
201
|
const varNames = {
|
|
99
202
|
avatar: {
|
|
100
203
|
distance: "--avatar-distance",
|
|
@@ -127,9 +230,6 @@ const varNames = {
|
|
|
127
230
|
},
|
|
128
231
|
color: {
|
|
129
232
|
// card scope
|
|
130
|
-
accent: {
|
|
131
|
-
fg: "--color-accent-fg"
|
|
132
|
-
},
|
|
133
233
|
avatar: {
|
|
134
234
|
bg: "--color-avatar-bg",
|
|
135
235
|
fg: "--color-avatar-fg",
|
|
@@ -247,99 +347,18 @@ const varNames = {
|
|
|
247
347
|
variant: "tinted"
|
|
248
348
|
}),
|
|
249
349
|
// tone scopes
|
|
250
|
-
|
|
251
|
-
tone
|
|
252
|
-
}),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
tone
|
|
261
|
-
}),
|
|
262
|
-
suggest: buildColorCardVarNames({
|
|
263
|
-
tone: "suggest"
|
|
264
|
-
}),
|
|
265
|
-
positive: buildColorCardVarNames({
|
|
266
|
-
tone: "positive"
|
|
267
|
-
}),
|
|
268
|
-
caution: buildColorCardVarNames({
|
|
269
|
-
tone: "caution"
|
|
270
|
-
}),
|
|
271
|
-
critical: buildColorCardVarNames({
|
|
272
|
-
tone: "critical"
|
|
273
|
-
}),
|
|
274
|
-
// scheme scope
|
|
275
|
-
dark: {
|
|
276
|
-
transparent: buildColorCardVarNames({
|
|
277
|
-
scheme: "dark",
|
|
278
|
-
tone: "transparent"
|
|
279
|
-
}),
|
|
280
|
-
default: buildColorCardVarNames({
|
|
281
|
-
scheme: "dark",
|
|
282
|
-
tone: "default"
|
|
283
|
-
}),
|
|
284
|
-
neutral: buildColorCardVarNames({
|
|
285
|
-
scheme: "dark",
|
|
286
|
-
tone: "neutral"
|
|
287
|
-
}),
|
|
288
|
-
primary: buildColorCardVarNames({
|
|
289
|
-
scheme: "dark",
|
|
290
|
-
tone: "primary"
|
|
291
|
-
}),
|
|
292
|
-
suggest: buildColorCardVarNames({
|
|
293
|
-
scheme: "dark",
|
|
294
|
-
tone: "neutral"
|
|
295
|
-
}),
|
|
296
|
-
positive: buildColorCardVarNames({
|
|
297
|
-
scheme: "dark",
|
|
298
|
-
tone: "positive"
|
|
299
|
-
}),
|
|
300
|
-
caution: buildColorCardVarNames({
|
|
301
|
-
scheme: "dark",
|
|
302
|
-
tone: "caution"
|
|
303
|
-
}),
|
|
304
|
-
critical: buildColorCardVarNames({
|
|
305
|
-
scheme: "dark",
|
|
306
|
-
tone: "critical"
|
|
307
|
-
})
|
|
308
|
-
},
|
|
309
|
-
light: {
|
|
310
|
-
transparent: buildColorCardVarNames({
|
|
311
|
-
scheme: "light",
|
|
312
|
-
tone: "transparent"
|
|
313
|
-
}),
|
|
314
|
-
default: buildColorCardVarNames({
|
|
315
|
-
scheme: "light",
|
|
316
|
-
tone: "default"
|
|
317
|
-
}),
|
|
318
|
-
neutral: buildColorCardVarNames({
|
|
319
|
-
scheme: "light",
|
|
320
|
-
tone: "neutral"
|
|
321
|
-
}),
|
|
322
|
-
primary: buildColorCardVarNames({
|
|
323
|
-
scheme: "light",
|
|
324
|
-
tone: "primary"
|
|
325
|
-
}),
|
|
326
|
-
suggest: buildColorCardVarNames({
|
|
327
|
-
scheme: "light",
|
|
328
|
-
tone: "suggest"
|
|
329
|
-
}),
|
|
330
|
-
positive: buildColorCardVarNames({
|
|
331
|
-
scheme: "light",
|
|
332
|
-
tone: "positive"
|
|
333
|
-
}),
|
|
334
|
-
caution: buildColorCardVarNames({
|
|
335
|
-
scheme: "light",
|
|
336
|
-
tone: "caution"
|
|
337
|
-
}),
|
|
338
|
-
critical: buildColorCardVarNames({
|
|
339
|
-
scheme: "light",
|
|
340
|
-
tone: "critical"
|
|
341
|
-
})
|
|
342
|
-
}
|
|
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), {})
|
|
343
362
|
},
|
|
344
363
|
container: {
|
|
345
364
|
0: "--container-0",
|
|
@@ -482,7 +501,6 @@ const varNames = {
|
|
|
482
501
|
letterSpacing: "--input-letter-spacing",
|
|
483
502
|
ascenderHeight: "--input-ascender-height",
|
|
484
503
|
descenderHeight: "--input-descender-height",
|
|
485
|
-
// capHeight: `--input-cap-height`,
|
|
486
504
|
gap: "--input-gap",
|
|
487
505
|
padding: "--input-padding"
|
|
488
506
|
},
|
|
@@ -507,109 +525,106 @@ function buildColorCardVarNames(props) {
|
|
|
507
525
|
const {
|
|
508
526
|
scheme,
|
|
509
527
|
tone
|
|
510
|
-
} = props,
|
|
528
|
+
} = props, prefix = scheme ? `--color-${scheme}-${tone}` : `--color-${tone}`;
|
|
511
529
|
return {
|
|
512
|
-
accent: {
|
|
513
|
-
fg: `${sourcePrefix}-accent-fg`
|
|
514
|
-
},
|
|
515
530
|
avatar: {
|
|
516
531
|
gray: {
|
|
517
|
-
bg: `${
|
|
518
|
-
fg: `${
|
|
532
|
+
bg: `${prefix}-avatar-gray-bg`,
|
|
533
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
519
534
|
},
|
|
520
535
|
blue: {
|
|
521
|
-
bg: `${
|
|
522
|
-
fg: `${
|
|
536
|
+
bg: `${prefix}-avatar-blue-bg`,
|
|
537
|
+
fg: `${prefix}-avatar-blue-fg`
|
|
523
538
|
},
|
|
524
539
|
purple: {
|
|
525
|
-
bg: `${
|
|
526
|
-
fg: `${
|
|
540
|
+
bg: `${prefix}-avatar-purple-bg`,
|
|
541
|
+
fg: `${prefix}-avatar-purple-fg`
|
|
527
542
|
},
|
|
528
543
|
magenta: {
|
|
529
|
-
bg: `${
|
|
530
|
-
fg: `${
|
|
544
|
+
bg: `${prefix}-avatar-magenta-bg`,
|
|
545
|
+
fg: `${prefix}-avatar-magenta-fg`
|
|
531
546
|
},
|
|
532
547
|
red: {
|
|
533
|
-
bg: `${
|
|
534
|
-
fg: `${
|
|
548
|
+
bg: `${prefix}-avatar-red-bg`,
|
|
549
|
+
fg: `${prefix}-avatar-red-fg`
|
|
535
550
|
},
|
|
536
551
|
orange: {
|
|
537
|
-
bg: `${
|
|
538
|
-
fg: `${
|
|
552
|
+
bg: `${prefix}-avatar-orange-bg`,
|
|
553
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
539
554
|
},
|
|
540
555
|
yellow: {
|
|
541
|
-
bg: `${
|
|
542
|
-
fg: `${
|
|
556
|
+
bg: `${prefix}-avatar-yellow-bg`,
|
|
557
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
543
558
|
},
|
|
544
559
|
green: {
|
|
545
|
-
bg: `${
|
|
546
|
-
fg: `${
|
|
560
|
+
bg: `${prefix}-avatar-green-bg`,
|
|
561
|
+
fg: `${prefix}-avatar-green-fg`
|
|
547
562
|
},
|
|
548
563
|
cyan: {
|
|
549
|
-
bg: `${
|
|
550
|
-
fg: `${
|
|
564
|
+
bg: `${prefix}-avatar-cyan-bg`,
|
|
565
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
551
566
|
}
|
|
552
567
|
},
|
|
553
|
-
backdrop: `${
|
|
568
|
+
backdrop: `${prefix}-backdrop`,
|
|
554
569
|
code: {
|
|
555
|
-
bg: `${
|
|
556
|
-
fg: `${
|
|
570
|
+
bg: `${prefix}-code-bg`,
|
|
571
|
+
fg: `${prefix}-code-fg`,
|
|
557
572
|
token: {
|
|
558
|
-
atrule: `${
|
|
559
|
-
attrName: `${
|
|
560
|
-
attrValue: `${
|
|
561
|
-
attribute: `${
|
|
562
|
-
boolean: `${
|
|
563
|
-
builtin: `${
|
|
564
|
-
cdata: `${
|
|
565
|
-
char: `${
|
|
566
|
-
class: `${
|
|
567
|
-
className: `${
|
|
568
|
-
comment: `${
|
|
569
|
-
constant: `${
|
|
570
|
-
deleted: `${
|
|
571
|
-
doctype: `${
|
|
572
|
-
entity: `${
|
|
573
|
-
function: `${
|
|
574
|
-
hexcode: `${
|
|
575
|
-
id: `${
|
|
576
|
-
important: `${
|
|
577
|
-
inserted: `${
|
|
578
|
-
keyword: `${
|
|
579
|
-
number: `${
|
|
580
|
-
operator: `${
|
|
581
|
-
prolog: `${
|
|
582
|
-
property: `${
|
|
583
|
-
pseudoClass: `${
|
|
584
|
-
pseudoElement: `${
|
|
585
|
-
punctuation: `${
|
|
586
|
-
regex: `${
|
|
587
|
-
selector: `${
|
|
588
|
-
string: `${
|
|
589
|
-
symbol: `${
|
|
590
|
-
tag: `${
|
|
591
|
-
unit: `${
|
|
592
|
-
url: `${
|
|
593
|
-
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`
|
|
594
609
|
}
|
|
595
610
|
},
|
|
596
|
-
focusRing: `${
|
|
611
|
+
focusRing: `${prefix}-focus-ring`,
|
|
597
612
|
link: {
|
|
598
|
-
fg: `${
|
|
613
|
+
fg: `${prefix}-link-fg`
|
|
599
614
|
},
|
|
600
615
|
muted: {
|
|
601
|
-
bg: `${
|
|
602
|
-
fg: `${
|
|
616
|
+
bg: `${prefix}-muted-bg`,
|
|
617
|
+
fg: `${prefix}-muted-fg`
|
|
603
618
|
},
|
|
604
619
|
shadow: {
|
|
605
|
-
outline: `${
|
|
606
|
-
umbra: `${
|
|
607
|
-
penumbra: `${
|
|
608
|
-
ambient: `${
|
|
620
|
+
outline: `${prefix}-shadow-outline`,
|
|
621
|
+
umbra: `${prefix}-shadow-umbra`,
|
|
622
|
+
penumbra: `${prefix}-shadow-penumbra`,
|
|
623
|
+
ambient: `${prefix}-shadow-ambient`
|
|
609
624
|
},
|
|
610
625
|
skeleton: {
|
|
611
|
-
from: `${
|
|
612
|
-
to: `${
|
|
626
|
+
from: `${prefix}-skeleton-from`,
|
|
627
|
+
to: `${prefix}-skeleton-to`
|
|
613
628
|
},
|
|
614
629
|
solid: buildColorVariantVarNames({
|
|
615
630
|
scheme,
|
|
@@ -628,101 +643,71 @@ function buildColorVariantVarNames(options) {
|
|
|
628
643
|
scheme,
|
|
629
644
|
tone,
|
|
630
645
|
variant
|
|
631
|
-
} = options,
|
|
646
|
+
} = options, prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}` : tone ? `--color-${tone}-${variant}` : `--color-${variant}`, vars2 = {
|
|
632
647
|
bg: {
|
|
633
|
-
0: `${
|
|
634
|
-
1: `${
|
|
635
|
-
2: `${
|
|
636
|
-
3: `${
|
|
637
|
-
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`
|
|
638
653
|
},
|
|
639
654
|
border: {
|
|
640
|
-
0: `${
|
|
641
|
-
1: `${
|
|
642
|
-
2: `${
|
|
643
|
-
3: `${
|
|
644
|
-
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`
|
|
645
660
|
},
|
|
646
661
|
fg: {
|
|
647
|
-
0: `${
|
|
648
|
-
1: `${
|
|
649
|
-
2: `${
|
|
650
|
-
3: `${
|
|
651
|
-
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`
|
|
652
667
|
}
|
|
653
668
|
};
|
|
654
669
|
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
655
|
-
const
|
|
670
|
+
const _prefix = scheme && tone ? `--color-${scheme}-${tone}-${variant}-${elementTone}` : tone ? `--color-${tone}-${variant}-${elementTone}` : `--color-${variant}-${elementTone}`;
|
|
656
671
|
vars2[elementTone] = {
|
|
657
672
|
bg: {
|
|
658
|
-
0: `${
|
|
659
|
-
1: `${
|
|
660
|
-
2: `${
|
|
661
|
-
3: `${
|
|
662
|
-
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`
|
|
663
678
|
},
|
|
664
679
|
border: {
|
|
665
|
-
0: `${
|
|
666
|
-
1: `${
|
|
667
|
-
2: `${
|
|
668
|
-
3: `${
|
|
669
|
-
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`
|
|
670
685
|
},
|
|
671
686
|
fg: {
|
|
672
|
-
0: `${
|
|
673
|
-
1: `${
|
|
674
|
-
2: `${
|
|
675
|
-
3: `${
|
|
676
|
-
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`
|
|
677
692
|
}
|
|
678
693
|
};
|
|
679
694
|
}
|
|
680
695
|
return vars2;
|
|
681
696
|
}
|
|
682
|
-
function compileRule(selector, props, context) {
|
|
683
|
-
let css = compileProperties$1(selector, props);
|
|
684
|
-
if (props["@nest"] && (css += compileNestedRules(selector, props["@nest"], context)), props["@keyframes"])
|
|
685
|
-
for (const name in props["@keyframes"])
|
|
686
|
-
context.keyframes[name] = props["@keyframes"][name];
|
|
687
|
-
if (props["@media"])
|
|
688
|
-
for (const key in props["@media"])
|
|
689
|
-
context.media[key] || (context.media[key] = {}), context.media[key][selector] = props["@media"][key];
|
|
690
|
-
return css;
|
|
691
|
-
}
|
|
692
|
-
function compileProperties$1(selector, props) {
|
|
693
|
-
let css = "{";
|
|
694
|
-
for (const key in props) {
|
|
695
|
-
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
696
|
-
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
697
|
-
for (const v of valueArr)
|
|
698
|
-
css += toSnakeCase$1(key) + ":" + v + ";";
|
|
699
|
-
}
|
|
700
|
-
return css === "{" ? "" : selector + css + "}";
|
|
701
|
-
}
|
|
702
|
-
function compileNestedRules(selector, props, context) {
|
|
703
|
-
if (!props) return "";
|
|
704
|
-
let css = "";
|
|
705
|
-
for (const [_selector, _props] of Object.entries(props))
|
|
706
|
-
css += `
|
|
707
|
-
` + compileRule(_selector.replace(/\./g, `.${PREFIX}`).replace(/&/g, selector), _props, context);
|
|
708
|
-
return css;
|
|
709
|
-
}
|
|
710
|
-
function toSnakeCase$1(value) {
|
|
711
|
-
return value.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
|
|
712
|
-
}
|
|
713
697
|
function compilePalette() {
|
|
714
|
-
|
|
715
|
-
|
|
698
|
+
return _compileStyle({
|
|
699
|
+
layers: {
|
|
700
|
+
theme: {
|
|
701
|
+
":root": compilePaletteProperties()
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
function compilePaletteProperties() {
|
|
707
|
+
const rules2 = {
|
|
716
708
|
[varNames.black]: color.black.hex,
|
|
717
709
|
[varNames.white]: color.white.hex
|
|
718
710
|
};
|
|
719
|
-
return compileRule(":root", props, {
|
|
720
|
-
keyframes: {},
|
|
721
|
-
media: {}
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
function compileHues() {
|
|
725
|
-
const rules2 = {};
|
|
726
711
|
for (const hue of HUES)
|
|
727
712
|
for (const tint of TINTS)
|
|
728
713
|
rules2[varNames[hue][tint]] = color[hue][tint].hex;
|
|
@@ -784,9 +769,6 @@ for (const tone of THEME_COLOR_CARD_TONES)
|
|
|
784
769
|
tone
|
|
785
770
|
});
|
|
786
771
|
const colorVars = {
|
|
787
|
-
accent: {
|
|
788
|
-
fg: `var(${varNames.color.accent.fg})`
|
|
789
|
-
},
|
|
790
772
|
avatar: {
|
|
791
773
|
bg: `var(${varNames.color.avatar.bg})`,
|
|
792
774
|
fg: `var(${varNames.color.avatar.fg})`,
|
|
@@ -1058,9 +1040,6 @@ function buildColorCardVars(props) {
|
|
|
1058
1040
|
tone
|
|
1059
1041
|
} = props, prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone];
|
|
1060
1042
|
return {
|
|
1061
|
-
accent: {
|
|
1062
|
-
fg: `var(${prefix.accent.fg})`
|
|
1063
|
-
},
|
|
1064
1043
|
avatar: {
|
|
1065
1044
|
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color2) => ({
|
|
1066
1045
|
...acc,
|
|
@@ -2559,14 +2538,6 @@ const _inputStyle = {
|
|
|
2559
2538
|
layers: {
|
|
2560
2539
|
primitive: primitive$o
|
|
2561
2540
|
}
|
|
2562
|
-
}, toneMap$2 = {
|
|
2563
|
-
default: "default",
|
|
2564
|
-
neutral: "neutral",
|
|
2565
|
-
suggest: "suggest",
|
|
2566
|
-
primary: "accent",
|
|
2567
|
-
positive: "positive",
|
|
2568
|
-
caution: "caution",
|
|
2569
|
-
critical: "critical"
|
|
2570
2541
|
}, primitive$n = {
|
|
2571
2542
|
".selectable": {
|
|
2572
2543
|
backgroundColor: vars.color.bg,
|
|
@@ -2639,7 +2610,7 @@ function buildSelectableTones() {
|
|
|
2639
2610
|
const rules2 = {};
|
|
2640
2611
|
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
2641
2612
|
const target = varNames.color, source = vars.color;
|
|
2642
|
-
rules2[`&.${
|
|
2613
|
+
rules2[`&.${tone}`] = {
|
|
2643
2614
|
[target.tinted.bg[0]]: source.tinted[tone].bg[0],
|
|
2644
2615
|
[target.tinted.bg[1]]: source.tinted[tone].bg[1],
|
|
2645
2616
|
[target.tinted.bg[2]]: source.tinted[tone].bg[2],
|
|
@@ -2676,6 +2647,7 @@ function buildSelectableTones() {
|
|
|
2676
2647
|
}
|
|
2677
2648
|
const primitive$m = {
|
|
2678
2649
|
".avatar": {
|
|
2650
|
+
[varNames.color.fg]: vars.color.avatar.fg,
|
|
2679
2651
|
backgroundColor: vars.color.avatar.bg,
|
|
2680
2652
|
position: "relative",
|
|
2681
2653
|
boxSizing: "border-box",
|
|
@@ -2686,11 +2658,7 @@ const primitive$m = {
|
|
|
2686
2658
|
height: vars.avatar.size,
|
|
2687
2659
|
borderRadius: vars.avatar.size,
|
|
2688
2660
|
"@nest": {
|
|
2689
|
-
|
|
2690
|
-
opacity: 0.5
|
|
2691
|
-
},
|
|
2692
|
-
// &:is(button)
|
|
2693
|
-
"&:is(button)": {
|
|
2661
|
+
"button&": {
|
|
2694
2662
|
WebkitFontSmoothing: "inherit",
|
|
2695
2663
|
appearance: "none",
|
|
2696
2664
|
margin: 0,
|
|
@@ -2700,11 +2668,11 @@ const primitive$m = {
|
|
|
2700
2668
|
color: "inherit",
|
|
2701
2669
|
outline: "none"
|
|
2702
2670
|
},
|
|
2703
|
-
"&:
|
|
2671
|
+
"button&:focus": {
|
|
2704
2672
|
outline: "var(--avatar-focus-ring-width) solid var(--color-focus-ring)",
|
|
2705
2673
|
outlineOffset: "var(--avatar-focus-ring-offset)"
|
|
2706
2674
|
},
|
|
2707
|
-
"&:
|
|
2675
|
+
"button&:focus:not(:focus-visible)": {
|
|
2708
2676
|
boxShadow: "none"
|
|
2709
2677
|
},
|
|
2710
2678
|
":disabled &, [data-disabled] &": {
|
|
@@ -2854,7 +2822,7 @@ const badgeStyle = {
|
|
|
2854
2822
|
layers: {
|
|
2855
2823
|
primitive: primitive$k
|
|
2856
2824
|
}
|
|
2857
|
-
}, toneMap
|
|
2825
|
+
}, toneMap = {
|
|
2858
2826
|
default: "default",
|
|
2859
2827
|
neutral: "neutral",
|
|
2860
2828
|
suggest: "suggest",
|
|
@@ -2915,7 +2883,7 @@ const badgeStyle = {
|
|
|
2915
2883
|
};
|
|
2916
2884
|
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
2917
2885
|
const solid = vars.color.solid[tone], tinted = vars.color.tinted[tone];
|
|
2918
|
-
primitive$j[`.button.${variantMap.default}.${toneMap
|
|
2886
|
+
primitive$j[`.button.${variantMap.default}.${toneMap[tone]}`] = {
|
|
2919
2887
|
[varNames.color.bg]: solid.bg[0],
|
|
2920
2888
|
[varNames.color.border]: solid.border[1],
|
|
2921
2889
|
[varNames.color.fg]: solid.fg[0],
|
|
@@ -2963,7 +2931,7 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
2963
2931
|
[varNames.color.muted.fg]: vars.color.tinted.default.border[4]
|
|
2964
2932
|
}
|
|
2965
2933
|
}
|
|
2966
|
-
}, primitive$j[`.button.${variantMap.ghost}.${toneMap
|
|
2934
|
+
}, primitive$j[`.button.${variantMap.ghost}.${toneMap[tone]}`] = {
|
|
2967
2935
|
[varNames.color.bg]: tinted.bg[1],
|
|
2968
2936
|
[varNames.color.border]: tinted.border[0],
|
|
2969
2937
|
[varNames.color.fg]: tinted.fg[2],
|
|
@@ -3014,7 +2982,7 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
3014
2982
|
[varNames.color.muted.fg]: vars.color.tinted.default.border[3]
|
|
3015
2983
|
}
|
|
3016
2984
|
}
|
|
3017
|
-
}, primitive$j[`.button.${variantMap.bleed}.${toneMap
|
|
2985
|
+
}, primitive$j[`.button.${variantMap.bleed}.${toneMap[tone]}`] = {
|
|
3018
2986
|
boxShadow: "none",
|
|
3019
2987
|
[varNames.color.bg]: tinted.bg[0],
|
|
3020
2988
|
[varNames.color.border]: tinted.border[1],
|
|
@@ -3069,16 +3037,6 @@ const buttonStyle = {
|
|
|
3069
3037
|
layers: {
|
|
3070
3038
|
primitive: primitive$j
|
|
3071
3039
|
}
|
|
3072
|
-
}, toneMap = {
|
|
3073
|
-
transparent: "transparent",
|
|
3074
|
-
default: "default",
|
|
3075
|
-
neutral: "neutral",
|
|
3076
|
-
suggest: "suggest",
|
|
3077
|
-
primary: "accent",
|
|
3078
|
-
positive: "positive",
|
|
3079
|
-
caution: "caution",
|
|
3080
|
-
critical: "critical",
|
|
3081
|
-
inherit: void 0
|
|
3082
3040
|
}, primitive$i = {
|
|
3083
3041
|
".card": {
|
|
3084
3042
|
backgroundColor: vars.color.bg,
|
|
@@ -3204,9 +3162,10 @@ for (const tone of THEME_COLOR_CARD_TONES) {
|
|
|
3204
3162
|
"--card-shadow-umbra-color": vars.color.shadow.umbra,
|
|
3205
3163
|
"--card-shadow-penumbra-color": vars.color.shadow.penumbra,
|
|
3206
3164
|
"--card-shadow-ambient-color": vars.color.shadow.ambient
|
|
3165
|
+
// todo
|
|
3207
3166
|
// '--card-skeleton-from-color': 'var(--color-skeleton-from)',
|
|
3208
3167
|
// '--card-skeleton-to-color': 'var(--color-skeleton-to)',
|
|
3209
|
-
}), primitive$i[`.card.${
|
|
3168
|
+
}), primitive$i[`.card.${tone}`] = toneProps;
|
|
3210
3169
|
}
|
|
3211
3170
|
const cardStyle = {
|
|
3212
3171
|
layers: {
|
|
@@ -3214,9 +3173,6 @@ const cardStyle = {
|
|
|
3214
3173
|
}
|
|
3215
3174
|
};
|
|
3216
3175
|
function _assignToneProps(toneProps, _varNames, _vars) {
|
|
3217
|
-
Object.assign(toneProps, {
|
|
3218
|
-
[_varNames.accent.fg]: _vars.accent.fg
|
|
3219
|
-
});
|
|
3220
3176
|
for (const hue of THEME_COLOR_AVATAR_COLORS)
|
|
3221
3177
|
toneProps[`${_varNames.avatar[hue].bg}`] = _vars.avatar[hue].bg, toneProps[`${_varNames.avatar[hue].fg}`] = _vars.avatar[hue].fg;
|
|
3222
3178
|
Object.assign(toneProps, {
|
|
@@ -4179,8 +4135,8 @@ const textStyle = {
|
|
|
4179
4135
|
layers: {
|
|
4180
4136
|
primitive
|
|
4181
4137
|
}
|
|
4182
|
-
},
|
|
4183
|
-
// NOTE:
|
|
4138
|
+
}, _systemStyle = _mergeStyles([
|
|
4139
|
+
// NOTE: Order matters in CSS!
|
|
4184
4140
|
{
|
|
4185
4141
|
// define order of layers
|
|
4186
4142
|
layers: {
|
|
@@ -4263,116 +4219,17 @@ const textStyle = {
|
|
|
4263
4219
|
toastStyle,
|
|
4264
4220
|
treeStyle
|
|
4265
4221
|
]);
|
|
4266
|
-
function isRecord(value) {
|
|
4267
|
-
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
4268
|
-
}
|
|
4269
|
-
function isArray(value) {
|
|
4270
|
-
return Array.isArray(value);
|
|
4271
|
-
}
|
|
4272
|
-
function rem(value) {
|
|
4273
|
-
return value === 0 ? "0" : `${value / 16}rem`;
|
|
4274
|
-
}
|
|
4275
|
-
function px(value) {
|
|
4276
|
-
return value === 0 ? "0" : `${value}px`;
|
|
4277
|
-
}
|
|
4278
|
-
function toBoxShadow(value) {
|
|
4279
|
-
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
4280
|
-
}
|
|
4281
|
-
function compileStyle(style) {
|
|
4282
|
-
let css = "";
|
|
4283
|
-
if (style.rules && (css += compileStyleRules(style.rules)), style.keyframes && Object.keys(style.keyframes).length > 0)
|
|
4284
|
-
for (const [name, value] of Object.entries(style.keyframes)) {
|
|
4285
|
-
let keyframesCss = `@keyframes ${name} {
|
|
4286
|
-
`;
|
|
4287
|
-
for (const [key, props] of Object.entries(value))
|
|
4288
|
-
keyframesCss += ` ${key} {
|
|
4289
|
-
`, keyframesCss += compileProperties(props), keyframesCss += `}
|
|
4290
|
-
`;
|
|
4291
|
-
keyframesCss += `
|
|
4292
|
-
}
|
|
4293
|
-
`, css += keyframesCss;
|
|
4294
|
-
}
|
|
4295
|
-
if (style.layers && Object.keys(style.layers).length > 0)
|
|
4296
|
-
for (const [layerName, layerRules] of Object.entries(style.layers))
|
|
4297
|
-
Object.keys(layerRules).length > 0 && (css += `@layer ${PREFIX}${layerName} {
|
|
4298
|
-
`, css += compileStyleRules(layerRules), css += `}
|
|
4299
|
-
|
|
4300
|
-
`);
|
|
4301
|
-
return css;
|
|
4302
|
-
}
|
|
4303
|
-
function compileStyleRules(rules2) {
|
|
4304
|
-
let css = "";
|
|
4305
|
-
const mediaMap = /* @__PURE__ */ new Map();
|
|
4306
|
-
for (const [selector, properties] of Object.entries(rules2))
|
|
4307
|
-
if (properties) {
|
|
4308
|
-
if (properties["@media"])
|
|
4309
|
-
for (const [mediaQuery, mediaProps] of Object.entries(properties["@media"])) {
|
|
4310
|
-
const arr = mediaMap.get(mediaQuery) ?? [];
|
|
4311
|
-
arr.push({
|
|
4312
|
-
selector,
|
|
4313
|
-
props: mediaProps
|
|
4314
|
-
}), mediaMap.set(mediaQuery, arr);
|
|
4315
|
-
}
|
|
4316
|
-
css += compileStyleRule(selector, properties);
|
|
4317
|
-
}
|
|
4318
|
-
for (const [mediaQuery, mediaRules] of mediaMap) {
|
|
4319
|
-
css += `@media ${mediaQuery} {
|
|
4320
|
-
`;
|
|
4321
|
-
for (const rule of mediaRules)
|
|
4322
|
-
css += compileStyleRule(rule.selector, rule.props);
|
|
4323
|
-
css += `}
|
|
4324
|
-
|
|
4325
|
-
`;
|
|
4326
|
-
}
|
|
4327
|
-
return css;
|
|
4328
|
-
}
|
|
4329
|
-
function compileStyleRule(_selector, properties) {
|
|
4330
|
-
let css = "";
|
|
4331
|
-
const {
|
|
4332
|
-
_prefix = !0,
|
|
4333
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4334
|
-
"@media": _mediaProps,
|
|
4335
|
-
"@nest": nestedProps,
|
|
4336
|
-
...restProperties
|
|
4337
|
-
} = properties, selector = _prefix ? `${_selector.replace(/\./g, `.${PREFIX}`)}` : _selector;
|
|
4338
|
-
if (Object.entries(restProperties).length && (css += `${selector} {
|
|
4339
|
-
`, css += compileProperties(restProperties), css += `}
|
|
4340
|
-
|
|
4341
|
-
`), nestedProps)
|
|
4342
|
-
for (const [_nestedSelector, nestedProperties] of Object.entries(nestedProps)) {
|
|
4343
|
-
const nestedSelector = _prefix && (nestedProperties._prefix ?? !0) ? _nestedSelector.replace(/\./g, `.${PREFIX}`) : _nestedSelector;
|
|
4344
|
-
css += `${nestedSelector.replace(/&/g, selector)} {
|
|
4345
|
-
`, css += compileProperties(nestedProperties), css += `}
|
|
4346
|
-
|
|
4347
|
-
`;
|
|
4348
|
-
}
|
|
4349
|
-
return css;
|
|
4350
|
-
}
|
|
4351
|
-
function compileProperties(props) {
|
|
4352
|
-
let css = "";
|
|
4353
|
-
const propEntries = Object.entries(props);
|
|
4354
|
-
for (const [key, value] of propEntries)
|
|
4355
|
-
if (!key.startsWith("@"))
|
|
4356
|
-
if (isArray(value))
|
|
4357
|
-
for (const item of value)
|
|
4358
|
-
css += ` ${toSnakeCase(key)}: ${item};
|
|
4359
|
-
`;
|
|
4360
|
-
else
|
|
4361
|
-
css += ` ${toSnakeCase(key)}: ${value};
|
|
4362
|
-
`;
|
|
4363
|
-
return css;
|
|
4364
|
-
}
|
|
4365
|
-
function toSnakeCase(str) {
|
|
4366
|
-
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
4367
|
-
}
|
|
4368
4222
|
function compileSystem() {
|
|
4369
|
-
return
|
|
4223
|
+
return _compileStyle(_systemStyle);
|
|
4370
4224
|
}
|
|
4371
4225
|
const THEME_COLOR_SCHEMES = ["dark", "light"], THEME_COLOR_VARIANTS = ["tinted", "solid"];
|
|
4372
4226
|
function compileTheme_v3(theme) {
|
|
4373
|
-
return
|
|
4374
|
-
|
|
4375
|
-
|
|
4227
|
+
return _compileStyle({
|
|
4228
|
+
layers: {
|
|
4229
|
+
theme: {
|
|
4230
|
+
":root": compileThemeProperties(theme)
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4376
4233
|
});
|
|
4377
4234
|
}
|
|
4378
4235
|
function compileThemeProperties(theme) {
|
|
@@ -4380,6 +4237,7 @@ function compileThemeProperties(theme) {
|
|
|
4380
4237
|
...buildAvatarThemeProperties(theme),
|
|
4381
4238
|
...buildButtonThemeProperties(theme),
|
|
4382
4239
|
[varNames.card.shadow.outline]: px(theme.card.shadow.outline),
|
|
4240
|
+
...buildColorThemeProperties(theme),
|
|
4383
4241
|
...buildContainerThemeProperties(theme),
|
|
4384
4242
|
...buildFontCodeThemeProperties(theme),
|
|
4385
4243
|
...buildFontHeadingThemeProperties(theme),
|
|
@@ -4388,22 +4246,21 @@ function compileThemeProperties(theme) {
|
|
|
4388
4246
|
...buildInputThemeProperties(theme),
|
|
4389
4247
|
...buildRadiusThemeProperties(theme),
|
|
4390
4248
|
...buildShadowThemeProperties(theme),
|
|
4391
|
-
...buildSpaceThemeProperties(theme)
|
|
4392
|
-
...buildColorThemeProperties(theme)
|
|
4249
|
+
...buildSpaceThemeProperties(theme)
|
|
4393
4250
|
};
|
|
4394
4251
|
}
|
|
4395
4252
|
function buildAvatarThemeProperties(theme) {
|
|
4396
4253
|
return {
|
|
4397
4254
|
[varNames.avatar.focusRing.offset]: px(theme.avatar.focusRing.offset),
|
|
4398
4255
|
[varNames.avatar.focusRing.width]: px(theme.avatar.focusRing.width),
|
|
4399
|
-
[varNames.avatar.sizes[0].distance]:
|
|
4400
|
-
[varNames.avatar.sizes[0].size]:
|
|
4401
|
-
[varNames.avatar.sizes[1].distance]:
|
|
4402
|
-
[varNames.avatar.sizes[1].size]:
|
|
4403
|
-
[varNames.avatar.sizes[2].distance]:
|
|
4404
|
-
[varNames.avatar.sizes[2].size]:
|
|
4405
|
-
[varNames.avatar.sizes[3].distance]:
|
|
4406
|
-
[varNames.avatar.sizes[3].size]:
|
|
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)
|
|
4407
4264
|
};
|
|
4408
4265
|
}
|
|
4409
4266
|
function buildButtonThemeProperties(theme) {
|
|
@@ -4415,71 +4272,71 @@ function buildButtonThemeProperties(theme) {
|
|
|
4415
4272
|
}
|
|
4416
4273
|
function buildContainerThemeProperties(theme) {
|
|
4417
4274
|
return {
|
|
4418
|
-
[varNames.container[0]]:
|
|
4419
|
-
[varNames.container[1]]:
|
|
4420
|
-
[varNames.container[2]]:
|
|
4421
|
-
[varNames.container[3]]:
|
|
4422
|
-
[varNames.container[4]]:
|
|
4423
|
-
[varNames.container[5]]:
|
|
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])
|
|
4424
4281
|
};
|
|
4425
4282
|
}
|
|
4426
4283
|
function buildFontCodeThemeProperties(theme) {
|
|
4427
|
-
const props = {
|
|
4428
|
-
[
|
|
4429
|
-
[
|
|
4430
|
-
[
|
|
4431
|
-
[
|
|
4432
|
-
[
|
|
4433
|
-
[
|
|
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
|
|
4434
4291
|
};
|
|
4435
4292
|
for (const size of FONT_CODE_SIZE) {
|
|
4436
|
-
const
|
|
4437
|
-
props[
|
|
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);
|
|
4438
4295
|
}
|
|
4439
4296
|
return props;
|
|
4440
4297
|
}
|
|
4441
4298
|
function buildFontHeadingThemeProperties(theme) {
|
|
4442
|
-
const props = {
|
|
4443
|
-
[
|
|
4444
|
-
[
|
|
4445
|
-
[
|
|
4446
|
-
[
|
|
4447
|
-
[
|
|
4448
|
-
[
|
|
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
|
|
4449
4306
|
};
|
|
4450
4307
|
for (const size of FONT_HEADING_SIZE) {
|
|
4451
|
-
const
|
|
4452
|
-
props[
|
|
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);
|
|
4453
4310
|
}
|
|
4454
4311
|
return props;
|
|
4455
4312
|
}
|
|
4456
4313
|
function buildFontLabelThemeProperties(theme) {
|
|
4457
|
-
const props = {
|
|
4458
|
-
[
|
|
4459
|
-
[
|
|
4460
|
-
[
|
|
4461
|
-
[
|
|
4462
|
-
[
|
|
4463
|
-
[
|
|
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
|
|
4464
4321
|
};
|
|
4465
4322
|
for (const size of FONT_LABEL_SIZE) {
|
|
4466
|
-
const
|
|
4467
|
-
props[
|
|
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);
|
|
4468
4325
|
}
|
|
4469
4326
|
return props;
|
|
4470
4327
|
}
|
|
4471
4328
|
function buildFontTextThemeProperties(theme) {
|
|
4472
|
-
const props = {
|
|
4473
|
-
[
|
|
4474
|
-
[
|
|
4475
|
-
[
|
|
4476
|
-
[
|
|
4477
|
-
[
|
|
4478
|
-
[
|
|
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
|
|
4479
4336
|
};
|
|
4480
4337
|
for (const size of FONT_TEXT_SIZE) {
|
|
4481
|
-
const
|
|
4482
|
-
props[
|
|
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);
|
|
4483
4340
|
}
|
|
4484
4341
|
return props;
|
|
4485
4342
|
}
|
|
@@ -4488,33 +4345,33 @@ function buildInputThemeProperties(theme) {
|
|
|
4488
4345
|
[varNames.input.border.width]: px(theme.input.border.width),
|
|
4489
4346
|
[varNames.input.checkbox.focusRing.offset]: px(theme.input.checkbox.focusRing.offset),
|
|
4490
4347
|
[varNames.input.checkbox.focusRing.width]: px(theme.input.checkbox.focusRing.width),
|
|
4491
|
-
[varNames.input.checkbox.size]:
|
|
4348
|
+
[varNames.input.checkbox.size]: rem(theme.input.checkbox.size),
|
|
4492
4349
|
[varNames.input.radio.focusRing.offset]: px(theme.input.radio.focusRing.offset),
|
|
4493
4350
|
[varNames.input.radio.focusRing.width]: px(theme.input.radio.focusRing.width),
|
|
4494
|
-
[varNames.input.radio.markSize]:
|
|
4495
|
-
[varNames.input.radio.size]:
|
|
4351
|
+
[varNames.input.radio.markSize]: rem(theme.input.radio.markSize),
|
|
4352
|
+
[varNames.input.radio.size]: rem(theme.input.radio.size),
|
|
4496
4353
|
[varNames.input.select.focusRing.offset]: px(theme.input.select.focusRing.offset),
|
|
4497
4354
|
[varNames.input.select.focusRing.width]: px(theme.input.select.focusRing.width),
|
|
4498
4355
|
[varNames.input.switch.focusRing.offset]: px(theme.input.switch.focusRing.offset),
|
|
4499
4356
|
[varNames.input.switch.focusRing.width]: px(theme.input.switch.focusRing.width),
|
|
4500
|
-
[varNames.input.switch.height]:
|
|
4501
|
-
[varNames.input.switch.padding]:
|
|
4357
|
+
[varNames.input.switch.height]: rem(theme.input.switch.height),
|
|
4358
|
+
[varNames.input.switch.padding]: rem(theme.input.switch.padding),
|
|
4502
4359
|
[varNames.input.switch.transitionDurationMs]: `${theme.input.switch.transitionDurationMs}ms`,
|
|
4503
4360
|
[varNames.input.switch.transitionTimingFunction]: theme.input.switch.transitionTimingFunction,
|
|
4504
|
-
[varNames.input.switch.width]:
|
|
4361
|
+
[varNames.input.switch.width]: rem(theme.input.switch.width),
|
|
4505
4362
|
[varNames.input.text.focusRing.offset]: px(theme.input.text.focusRing.offset),
|
|
4506
4363
|
[varNames.input.text.focusRing.width]: px(theme.input.text.focusRing.width)
|
|
4507
4364
|
};
|
|
4508
4365
|
}
|
|
4509
4366
|
function buildRadiusThemeProperties(theme) {
|
|
4510
4367
|
return {
|
|
4511
|
-
[varNames.radius[0]]:
|
|
4512
|
-
[varNames.radius[1]]:
|
|
4513
|
-
[varNames.radius[2]]:
|
|
4514
|
-
[varNames.radius[3]]:
|
|
4515
|
-
[varNames.radius[4]]:
|
|
4516
|
-
[varNames.radius[5]]:
|
|
4517
|
-
[varNames.radius[6]]:
|
|
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])
|
|
4518
4375
|
};
|
|
4519
4376
|
}
|
|
4520
4377
|
function buildShadowThemeProperties(theme) {
|
|
@@ -4541,17 +4398,17 @@ function buildShadowThemeProperties(theme) {
|
|
|
4541
4398
|
}
|
|
4542
4399
|
function buildSpaceThemeProperties(theme) {
|
|
4543
4400
|
return {
|
|
4544
|
-
[varNames.space[0]]:
|
|
4545
|
-
[varNames.space[0.5]]:
|
|
4546
|
-
[varNames.space[1]]:
|
|
4547
|
-
[varNames.space[2]]:
|
|
4548
|
-
[varNames.space[3]]:
|
|
4549
|
-
[varNames.space[4]]:
|
|
4550
|
-
[varNames.space[5]]:
|
|
4551
|
-
[varNames.space[6]]:
|
|
4552
|
-
[varNames.space[7]]:
|
|
4553
|
-
[varNames.space[8]]:
|
|
4554
|
-
[varNames.space[9]]:
|
|
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])
|
|
4555
4412
|
};
|
|
4556
4413
|
}
|
|
4557
4414
|
function buildColorThemeProperties(theme) {
|
|
@@ -4766,7 +4623,7 @@ function _inputPresentation() {
|
|
|
4766
4623
|
return _comp("input-presentation");
|
|
4767
4624
|
}
|
|
4768
4625
|
function _selectable(props) {
|
|
4769
|
-
return _comp("selectable",
|
|
4626
|
+
return _comp("selectable", props.tone ?? "default", radius(props));
|
|
4770
4627
|
}
|
|
4771
4628
|
function avatar(props) {
|
|
4772
4629
|
return _comp("avatar", props.color || "gray", _resp("avatar", props.size));
|
|
@@ -4821,13 +4678,13 @@ function button(props) {
|
|
|
4821
4678
|
mode,
|
|
4822
4679
|
tone
|
|
4823
4680
|
} = props;
|
|
4824
|
-
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));
|
|
4825
4682
|
}
|
|
4826
4683
|
function buttonLoadingBox() {
|
|
4827
4684
|
return "button-loading-box";
|
|
4828
4685
|
}
|
|
4829
4686
|
function card(props) {
|
|
4830
|
-
return _comp(props.scheme,
|
|
4687
|
+
return _comp(props.scheme, props.tone ?? "default", "card", props.checkered && "card-checkered", shadow(props));
|
|
4831
4688
|
}
|
|
4832
4689
|
function checkbox() {
|
|
4833
4690
|
return _comp("checkbox");
|
|
@@ -4907,7 +4764,7 @@ function tooltipCard() {
|
|
|
4907
4764
|
return _comp("tooltip-card");
|
|
4908
4765
|
}
|
|
4909
4766
|
function srOnly() {
|
|
4910
|
-
return composeClassNames("sr-only");
|
|
4767
|
+
return _comp(composeClassNames("sr-only"));
|
|
4911
4768
|
}
|
|
4912
4769
|
export {
|
|
4913
4770
|
BREAKPOINTS,
|
|
@@ -4916,6 +4773,7 @@ export {
|
|
|
4916
4773
|
_arrowShape,
|
|
4917
4774
|
_arrowStroke,
|
|
4918
4775
|
_arrowStrokeMask,
|
|
4776
|
+
_getClassNames,
|
|
4919
4777
|
_input,
|
|
4920
4778
|
_inputElement,
|
|
4921
4779
|
_inputPresentation,
|
|
@@ -4960,7 +4818,6 @@ export {
|
|
|
4960
4818
|
flexItem,
|
|
4961
4819
|
font,
|
|
4962
4820
|
gap,
|
|
4963
|
-
getClassNames,
|
|
4964
4821
|
grid,
|
|
4965
4822
|
gridItem,
|
|
4966
4823
|
heading,
|