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