@sanity/ui 3.0.0-static.4 → 3.0.0-static.6
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 +81 -31
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +82 -32
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +14 -11
- package/dist/_visual-editing.d.ts +14 -11
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +144 -852
- package/dist/css.d.ts +144 -852
- package/dist/css.js +155 -141
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +154 -141
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +14 -11
- package/dist/index.d.ts +14 -11
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -6
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +54 -49
- package/dist/theme.js +271 -33
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +252 -16
- package/dist/theme.mjs.map +1 -1
- package/package.json +2 -2
- package/src/css/aspects/flex/flexJustify.style.ts +3 -3
- package/src/css/aspects/grid/types.ts +2 -2
- package/src/css/index.ts +2 -2
- package/src/css/primitives/_input/__workshop__/index.ts +1 -1
- package/src/css/primitives/button/button.style.ts +6 -4
- package/src/css/primitives/stack/index.ts +1 -0
- package/src/css/primitives/stack/stack.style.ts +9 -0
- package/src/css/primitives/stack/stack.ts +6 -0
- package/src/css/system.style.ts +2 -0
- package/src/theme/v3/defaults.ts +1 -1
- package/src/ui/components/autocomplete/__workshop__/index.ts +1 -1
- package/src/ui/components/dialog/dialog.tsx +3 -4
- package/src/ui/constants.ts +6 -0
- package/src/ui/hooks/useMediaIndex/useMediaIndex.ts +0 -2
- package/src/ui/primitives/box/box.tsx +6 -0
- package/src/ui/primitives/button/button.tsx +11 -10
- package/src/ui/primitives/code/code.tsx +1 -1
- package/src/ui/primitives/popover/popover.tsx +5 -75
- package/src/ui/primitives/stack/stack.tsx +10 -5
- package/src/ui/primitives/textInput/textInput.tsx +1 -1
- package/src/ui/primitives/tooltip/tooltip.tsx +2 -3
- package/dist/_chunks-cjs/v3_v2.js +0 -251
- package/dist/_chunks-cjs/v3_v2.js.map +0 -1
- package/dist/_chunks-es/v3_v2.mjs +0 -252
- package/dist/_chunks-es/v3_v2.mjs.map +0 -1
package/dist/theme.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var
|
|
4
|
-
function isColorBlendModeValue(str) {
|
|
5
|
-
return v3_v2.THEME_COLOR_BLEND_MODES.includes(str);
|
|
6
|
-
}
|
|
7
|
-
function isColorHueKey(str) {
|
|
8
|
-
return color.COLOR_HUES.includes(str);
|
|
9
|
-
}
|
|
10
|
-
function isColorTintKey(str) {
|
|
11
|
-
return color.COLOR_TINTS.includes(str);
|
|
12
|
-
}
|
|
13
|
-
function isColorButtonMode(str) {
|
|
14
|
-
return v3_v2.THEME_COLOR_BUTTON_MODES.includes(str);
|
|
15
|
-
}
|
|
3
|
+
var color = require("@sanity/color");
|
|
16
4
|
const AVATAR_SIZE = [0, 1, 2, 3], CONTAINER = [0, 1, 2, 3, 4, 5, "auto"], RADIUS = [0, 1, 2, 3, 4, 5, 6, "full"], SPACE = [0, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9], FONT_CODE_SIZE = [0, 1, 2, 3, 4], FONT_HEADING_SIZE = [0, 1, 2, 3, 4, 5], FONT_LABEL_SIZE = [0, 1, 2, 3, 4, 5], FONT_TEXT_SIZE = [0, 1, 2, 3, 4], SHADOW = [0, 1, 2, 3, 4, 5];
|
|
17
5
|
function createSelectableTones(opts, base, dark, solid, muted) {
|
|
18
6
|
return {
|
|
@@ -1447,7 +1435,39 @@ const defaultThemeConfig = {
|
|
|
1447
1435
|
letterSpacing: 0
|
|
1448
1436
|
}]
|
|
1449
1437
|
}
|
|
1450
|
-
},
|
|
1438
|
+
}, THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
|
|
1439
|
+
"transparent",
|
|
1440
|
+
"default",
|
|
1441
|
+
"neutral",
|
|
1442
|
+
"primary",
|
|
1443
|
+
// deprecated
|
|
1444
|
+
"suggest",
|
|
1445
|
+
"positive",
|
|
1446
|
+
"caution",
|
|
1447
|
+
"critical"
|
|
1448
|
+
], THEME_COLOR_STATE_TONES = [
|
|
1449
|
+
"default",
|
|
1450
|
+
"neutral",
|
|
1451
|
+
"primary",
|
|
1452
|
+
// deprecated
|
|
1453
|
+
"suggest",
|
|
1454
|
+
"positive",
|
|
1455
|
+
"caution",
|
|
1456
|
+
"critical"
|
|
1457
|
+
], THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"], THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"], THEME_COLOR_INPUT_MODES = ["default", "invalid"], THEME_COLOR_INPUT_STATES = ["enabled", "hovered", "readOnly", "disabled"], THEME_COLOR_AVATAR_COLORS = color.COLOR_HUES;
|
|
1458
|
+
function isColorBlendModeValue(str) {
|
|
1459
|
+
return THEME_COLOR_BLEND_MODES.includes(str);
|
|
1460
|
+
}
|
|
1461
|
+
function isColorHueKey(str) {
|
|
1462
|
+
return color.COLOR_HUES.includes(str);
|
|
1463
|
+
}
|
|
1464
|
+
function isColorTintKey(str) {
|
|
1465
|
+
return color.COLOR_TINTS.includes(str);
|
|
1466
|
+
}
|
|
1467
|
+
function isColorButtonMode(str) {
|
|
1468
|
+
return THEME_COLOR_BUTTON_MODES.includes(str);
|
|
1469
|
+
}
|
|
1470
|
+
const HUES = ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"], TINTS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950], RE_PERCENTAGE = /^([0-9]+)%/, RE_OPACITY = /^(1|0\.[0-9]+)?/;
|
|
1451
1471
|
function parseColor$1(str) {
|
|
1452
1472
|
let cursor = 0;
|
|
1453
1473
|
const color2 = getColor();
|
|
@@ -1546,7 +1566,7 @@ function buildColorScheme_v3(tokens, options) {
|
|
|
1546
1566
|
scheme
|
|
1547
1567
|
} = options;
|
|
1548
1568
|
return {
|
|
1549
|
-
card:
|
|
1569
|
+
card: THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCard_v3(tokens[tone], {
|
|
1550
1570
|
scheme
|
|
1551
1571
|
}), acc), {})
|
|
1552
1572
|
};
|
|
@@ -1561,7 +1581,7 @@ function buildColorCard_v3(tokens, options) {
|
|
|
1561
1581
|
};
|
|
1562
1582
|
return {
|
|
1563
1583
|
_hue: tokens._hue ?? "gray",
|
|
1564
|
-
avatar:
|
|
1584
|
+
avatar: THEME_COLOR_AVATAR_COLORS.reduce((acc, hue) => {
|
|
1565
1585
|
const avatarTokens = tokens.avatar[hue];
|
|
1566
1586
|
return acc[hue] = {
|
|
1567
1587
|
bg: renderColor(avatarTokens.bg, {
|
|
@@ -1628,7 +1648,7 @@ function buildColorCard_v3(tokens, options) {
|
|
|
1628
1648
|
},
|
|
1629
1649
|
variant: {
|
|
1630
1650
|
solid: {
|
|
1631
|
-
...
|
|
1651
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
|
|
1632
1652
|
...acc,
|
|
1633
1653
|
[tone]: buildColorElement_v3(tokens.variant.solid[tone], {
|
|
1634
1654
|
scheme
|
|
@@ -1636,7 +1656,7 @@ function buildColorCard_v3(tokens, options) {
|
|
|
1636
1656
|
}), {})
|
|
1637
1657
|
},
|
|
1638
1658
|
tinted: {
|
|
1639
|
-
...
|
|
1659
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
|
|
1640
1660
|
...acc,
|
|
1641
1661
|
[tone]: buildColorElement_v3(tokens.variant.tinted[tone], {
|
|
1642
1662
|
scheme
|
|
@@ -1806,7 +1826,7 @@ const defaultTokens = {
|
|
|
1806
1826
|
4: ["800", "300 50%"]
|
|
1807
1827
|
},
|
|
1808
1828
|
border: {
|
|
1809
|
-
0: ["900", "
|
|
1829
|
+
0: ["900", "300 40%"],
|
|
1810
1830
|
4: ["700", "300"]
|
|
1811
1831
|
},
|
|
1812
1832
|
fg: {
|
|
@@ -1885,7 +1905,7 @@ function resolveTokens(tokens = {}) {
|
|
|
1885
1905
|
return {
|
|
1886
1906
|
color: {
|
|
1887
1907
|
"*": resolveCardColorTokens(tokens.color?.["*"]),
|
|
1888
|
-
...
|
|
1908
|
+
...THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
1889
1909
|
...acc,
|
|
1890
1910
|
[tone]: resolveCardColorTokens(merge(tokens.color?.["*"], tokens.color?.[tone]))
|
|
1891
1911
|
}), {})
|
|
@@ -1998,11 +2018,11 @@ function resolveCardColorTokens(tokens) {
|
|
|
1998
2018
|
variant: {
|
|
1999
2019
|
solid: {
|
|
2000
2020
|
"*": resolveElementTokens(tokens?.variant?.solid?.["*"]),
|
|
2001
|
-
...
|
|
2021
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.solid?.["*"], tokens?.variant?.solid?.[tone])), acc), {})
|
|
2002
2022
|
},
|
|
2003
2023
|
tinted: {
|
|
2004
2024
|
"*": resolveElementTokens(tokens?.variant?.tinted?.["*"]),
|
|
2005
|
-
...
|
|
2025
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.tinted?.["*"], tokens?.variant?.tinted?.[tone])), acc), {})
|
|
2006
2026
|
}
|
|
2007
2027
|
}
|
|
2008
2028
|
};
|
|
@@ -2153,11 +2173,229 @@ function inputStateThemeColor_v2_v0(t) {
|
|
|
2153
2173
|
placeholder: t.placeholder
|
|
2154
2174
|
};
|
|
2155
2175
|
}
|
|
2176
|
+
function themeColor_v3_v2(options) {
|
|
2177
|
+
const {
|
|
2178
|
+
color: color2,
|
|
2179
|
+
dark
|
|
2180
|
+
} = options;
|
|
2181
|
+
return {
|
|
2182
|
+
_blend: "screen",
|
|
2183
|
+
_dark: dark,
|
|
2184
|
+
...buildColorState({
|
|
2185
|
+
cardColor: color2,
|
|
2186
|
+
state: "enabled",
|
|
2187
|
+
tone: "default",
|
|
2188
|
+
variant: "tinted"
|
|
2189
|
+
}),
|
|
2190
|
+
backdrop: color2.backdrop,
|
|
2191
|
+
button: THEME_COLOR_BUTTON_MODES.reduce((modes, mode) => (modes[mode] = THEME_COLOR_STATE_TONES.reduce((tones2, tone) => (tones2[tone] = THEME_COLOR_STATES.reduce((states, state) => (states[state] = buildColorState({
|
|
2192
|
+
cardColor: color2,
|
|
2193
|
+
state,
|
|
2194
|
+
tone,
|
|
2195
|
+
variant: mode === "default" ? "solid" : "tinted"
|
|
2196
|
+
}), mode === "bleed" && (states[state].border = "transparent"), states), {}), tones2), {}), modes), {}),
|
|
2197
|
+
focusRing: color2.focusRing,
|
|
2198
|
+
input: THEME_COLOR_INPUT_MODES.reduce((modes, mode) => (modes[mode] = THEME_COLOR_INPUT_STATES.reduce((states, state) => (states[state] = buildInputState(color2.variant.tinted.default), states), {}), modes), {}),
|
|
2199
|
+
selectable: THEME_COLOR_STATE_TONES.reduce((tones2, tone) => (tones2[tone] = THEME_COLOR_STATES.reduce((states, state) => (states[state] = buildColorState({
|
|
2200
|
+
cardColor: color2,
|
|
2201
|
+
// cardVars: vars,
|
|
2202
|
+
state,
|
|
2203
|
+
tone,
|
|
2204
|
+
variant: "tinted"
|
|
2205
|
+
}), states), {}), tones2), {}),
|
|
2206
|
+
shadow: color2.shadow,
|
|
2207
|
+
syntax: color2.token
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
const stateShades = {
|
|
2211
|
+
enabled: {
|
|
2212
|
+
bg: [0, 1, 2],
|
|
2213
|
+
border: [0, 1, 2],
|
|
2214
|
+
fg: [0, 1, 2]
|
|
2215
|
+
},
|
|
2216
|
+
hovered: {
|
|
2217
|
+
bg: [1, 2, 3],
|
|
2218
|
+
border: [1, 2, 3],
|
|
2219
|
+
fg: [1, 2, 3]
|
|
2220
|
+
},
|
|
2221
|
+
pressed: {
|
|
2222
|
+
bg: [2, 3, 4],
|
|
2223
|
+
border: [2, 3, 4],
|
|
2224
|
+
fg: [2, 3, 4]
|
|
2225
|
+
},
|
|
2226
|
+
selected: {
|
|
2227
|
+
bg: [3, 4, 4],
|
|
2228
|
+
border: [3, 4, 4],
|
|
2229
|
+
fg: [3, 4, 4]
|
|
2230
|
+
},
|
|
2231
|
+
disabled: {
|
|
2232
|
+
bg: [4, 4, 4],
|
|
2233
|
+
border: [4, 4, 4],
|
|
2234
|
+
fg: [4, 4, 4]
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
function mix$1(tokens, index) {
|
|
2238
|
+
return index === 0 ? tokens[0] : index === 4 ? tokens[4] : `color-mix(in oklch, ${tokens[0]}, ${tokens[4]} ${index * 25}%)`;
|
|
2239
|
+
}
|
|
2240
|
+
function buildColorState(options) {
|
|
2241
|
+
const {
|
|
2242
|
+
cardColor,
|
|
2243
|
+
state,
|
|
2244
|
+
tone,
|
|
2245
|
+
variant
|
|
2246
|
+
} = options, color2 = cardColor.variant[variant][tone], shades = stateShades[state];
|
|
2247
|
+
return {
|
|
2248
|
+
accent: {
|
|
2249
|
+
fg: color2.fg[4]
|
|
2250
|
+
},
|
|
2251
|
+
avatar: cardColor.avatar,
|
|
2252
|
+
badge: THEME_COLOR_STATE_TONES.reduce((tones2, tone2) => (tones2[tone2] = {
|
|
2253
|
+
bg: mix$1(color2.bg, 1),
|
|
2254
|
+
fg: mix$1(color2.fg, 1),
|
|
2255
|
+
dot: mix$1(color2.fg, 3),
|
|
2256
|
+
icon: mix$1(color2.fg, 3)
|
|
2257
|
+
}, tones2), {}),
|
|
2258
|
+
bg: mix$1(color2.bg, shades.bg[0]),
|
|
2259
|
+
border: mix$1(color2.border, shades.border[0]),
|
|
2260
|
+
fg: mix$1(color2.fg, shades.fg[0]),
|
|
2261
|
+
code: {
|
|
2262
|
+
bg: mix$1(color2.bg, shades.bg[1]),
|
|
2263
|
+
fg: mix$1(color2.fg, shades.fg[2])
|
|
2264
|
+
},
|
|
2265
|
+
icon: mix$1(color2.fg, shades.fg[2]),
|
|
2266
|
+
kbd: {
|
|
2267
|
+
bg: mix$1(color2.bg, 0),
|
|
2268
|
+
fg: mix$1(color2.fg, 0),
|
|
2269
|
+
border: mix$1(color2.bg, 0)
|
|
2270
|
+
},
|
|
2271
|
+
link: {
|
|
2272
|
+
fg: mix$1(color2.fg, shades.fg[2])
|
|
2273
|
+
},
|
|
2274
|
+
muted: {
|
|
2275
|
+
bg: mix$1(color2.bg, shades.bg[1]),
|
|
2276
|
+
fg: mix$1(color2.fg, shades.fg[2])
|
|
2277
|
+
},
|
|
2278
|
+
skeleton: cardColor.skeleton
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
function buildInputState(colorElement) {
|
|
2282
|
+
return {
|
|
2283
|
+
bg: colorElement.bg[0],
|
|
2284
|
+
border: colorElement.bg[0],
|
|
2285
|
+
fg: colorElement.fg[0],
|
|
2286
|
+
muted: {
|
|
2287
|
+
bg: colorElement.bg[0]
|
|
2288
|
+
},
|
|
2289
|
+
placeholder: colorElement.fg[0]
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
function v3_v2(theme_v3) {
|
|
2293
|
+
return {
|
|
2294
|
+
_version: 2,
|
|
2295
|
+
avatar: theme_v3.avatar,
|
|
2296
|
+
button: theme_v3.button,
|
|
2297
|
+
card: theme_v3.card,
|
|
2298
|
+
color: {
|
|
2299
|
+
dark: {
|
|
2300
|
+
transparent: themeColor_v3_v2({
|
|
2301
|
+
color: theme_v3.color.dark.card.transparent,
|
|
2302
|
+
dark: !0
|
|
2303
|
+
// vars: vars.color.dark.transparent,
|
|
2304
|
+
}),
|
|
2305
|
+
default: themeColor_v3_v2({
|
|
2306
|
+
color: theme_v3.color.dark.card.default,
|
|
2307
|
+
dark: !0
|
|
2308
|
+
// vars: vars.color.dark.default,
|
|
2309
|
+
}),
|
|
2310
|
+
neutral: themeColor_v3_v2({
|
|
2311
|
+
color: theme_v3.color.dark.card.neutral,
|
|
2312
|
+
dark: !0
|
|
2313
|
+
// vars: vars.color.dark.neutral,
|
|
2314
|
+
}),
|
|
2315
|
+
primary: themeColor_v3_v2({
|
|
2316
|
+
color: theme_v3.color.dark.card.primary,
|
|
2317
|
+
dark: !0
|
|
2318
|
+
// vars: vars.color.dark.primary,
|
|
2319
|
+
}),
|
|
2320
|
+
suggest: themeColor_v3_v2({
|
|
2321
|
+
color: theme_v3.color.dark.card.suggest,
|
|
2322
|
+
dark: !0
|
|
2323
|
+
// vars: vars.color.dark.suggest,
|
|
2324
|
+
}),
|
|
2325
|
+
positive: themeColor_v3_v2({
|
|
2326
|
+
color: theme_v3.color.dark.card.positive,
|
|
2327
|
+
dark: !0
|
|
2328
|
+
// vars: vars.color.dark.positive,
|
|
2329
|
+
}),
|
|
2330
|
+
caution: themeColor_v3_v2({
|
|
2331
|
+
color: theme_v3.color.dark.card.caution,
|
|
2332
|
+
dark: !0
|
|
2333
|
+
// vars: vars.color.dark.caution,
|
|
2334
|
+
}),
|
|
2335
|
+
critical: themeColor_v3_v2({
|
|
2336
|
+
color: theme_v3.color.dark.card.critical,
|
|
2337
|
+
dark: !0
|
|
2338
|
+
// vars: vars.color.dark.critical,
|
|
2339
|
+
})
|
|
2340
|
+
},
|
|
2341
|
+
light: {
|
|
2342
|
+
transparent: themeColor_v3_v2({
|
|
2343
|
+
color: theme_v3.color.light.card.transparent,
|
|
2344
|
+
dark: !1
|
|
2345
|
+
// vars: vars.color.light.transparent,
|
|
2346
|
+
}),
|
|
2347
|
+
default: themeColor_v3_v2({
|
|
2348
|
+
color: theme_v3.color.light.card.default,
|
|
2349
|
+
dark: !1
|
|
2350
|
+
// vars: vars.color.light.default,
|
|
2351
|
+
}),
|
|
2352
|
+
neutral: themeColor_v3_v2({
|
|
2353
|
+
color: theme_v3.color.light.card.neutral,
|
|
2354
|
+
dark: !1
|
|
2355
|
+
// vars: vars.color.light.neutral,
|
|
2356
|
+
}),
|
|
2357
|
+
primary: themeColor_v3_v2({
|
|
2358
|
+
color: theme_v3.color.light.card.primary,
|
|
2359
|
+
dark: !1
|
|
2360
|
+
// vars: vars.color.light.primary,
|
|
2361
|
+
}),
|
|
2362
|
+
suggest: themeColor_v3_v2({
|
|
2363
|
+
color: theme_v3.color.light.card.suggest,
|
|
2364
|
+
dark: !1
|
|
2365
|
+
// vars: vars.color.light.suggest,
|
|
2366
|
+
}),
|
|
2367
|
+
positive: themeColor_v3_v2({
|
|
2368
|
+
color: theme_v3.color.light.card.positive,
|
|
2369
|
+
dark: !1
|
|
2370
|
+
// vars: vars.color.light.positive,
|
|
2371
|
+
}),
|
|
2372
|
+
caution: themeColor_v3_v2({
|
|
2373
|
+
color: theme_v3.color.light.card.caution,
|
|
2374
|
+
dark: !1
|
|
2375
|
+
// vars: vars.color.light.caution,
|
|
2376
|
+
}),
|
|
2377
|
+
critical: themeColor_v3_v2({
|
|
2378
|
+
color: theme_v3.color.light.card.critical,
|
|
2379
|
+
dark: !1
|
|
2380
|
+
// vars: vars.color.light.critical,
|
|
2381
|
+
})
|
|
2382
|
+
}
|
|
2383
|
+
},
|
|
2384
|
+
container: theme_v3.container,
|
|
2385
|
+
font: theme_v3.font,
|
|
2386
|
+
input: theme_v3.input,
|
|
2387
|
+
layer: theme_v3.layer,
|
|
2388
|
+
media: theme_v3.media,
|
|
2389
|
+
radius: theme_v3.radius,
|
|
2390
|
+
shadow: theme_v3.shadow,
|
|
2391
|
+
space: theme_v3.space
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2156
2394
|
function buildTheme(_config) {
|
|
2157
2395
|
const v3 = buildTheme_v3({
|
|
2158
2396
|
v2: _config
|
|
2159
2397
|
});
|
|
2160
|
-
return v2_v0(v3_v2
|
|
2398
|
+
return v2_v0(v3_v2(v3), v3);
|
|
2161
2399
|
}
|
|
2162
2400
|
function mixChannel(b, s, weight) {
|
|
2163
2401
|
const delta = (s - b) * weight;
|
|
@@ -2306,7 +2544,7 @@ function rgba(color2, a) {
|
|
|
2306
2544
|
const rgb = parseColor(color2);
|
|
2307
2545
|
return `rgba(${rgb.r},${rgb.g},${rgb.b},${a})`;
|
|
2308
2546
|
}
|
|
2309
|
-
const COLOR_CONFIG_STATE_KEYS = ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon"], COLOR_CONFIG_CARD_KEYS = [...COLOR_CONFIG_STATE_KEYS, "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"], COLOR_CONFIG_BLEND_KEYS = ["_blend"], COLOR_CONFIG_AVATAR_COLORS = ["*", ...
|
|
2547
|
+
const COLOR_CONFIG_STATE_KEYS = ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon"], COLOR_CONFIG_CARD_KEYS = [...COLOR_CONFIG_STATE_KEYS, "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"], COLOR_CONFIG_BLEND_KEYS = ["_blend"], COLOR_CONFIG_AVATAR_COLORS = ["*", ...THEME_COLOR_AVATAR_COLORS], COLOR_CONFIG_CARD_TONES = ["*", ...THEME_COLOR_CARD_TONES], COLOR_CONFIG_STATE_TONES = ["*", ...THEME_COLOR_STATE_TONES], COLOR_CONFIG_STATES = ["*", ...THEME_COLOR_STATES], COLOR_CONFIG_INPUT_MODES = ["*", ...THEME_COLOR_INPUT_MODES], COLOR_CONFIG_INPUT_STATES = ["*", ...THEME_COLOR_INPUT_STATES];
|
|
2310
2548
|
function parseTokenKey(str) {
|
|
2311
2549
|
const segments = str.split("/"), segment0 = segments.shift() || "";
|
|
2312
2550
|
if (isColorConfigBaseTone(segment0)) {
|
|
@@ -2872,15 +3110,6 @@ function getTheme_v2(theme) {
|
|
|
2872
3110
|
};
|
|
2873
3111
|
return cache.set(theme, v2), v2;
|
|
2874
3112
|
}
|
|
2875
|
-
exports.THEME_COLOR_AVATAR_COLORS = v3_v2.THEME_COLOR_AVATAR_COLORS;
|
|
2876
|
-
exports.THEME_COLOR_BLEND_MODES = v3_v2.THEME_COLOR_BLEND_MODES;
|
|
2877
|
-
exports.THEME_COLOR_BUTTON_MODES = v3_v2.THEME_COLOR_BUTTON_MODES;
|
|
2878
|
-
exports.THEME_COLOR_CARD_TONES = v3_v2.THEME_COLOR_CARD_TONES;
|
|
2879
|
-
exports.THEME_COLOR_INPUT_MODES = v3_v2.THEME_COLOR_INPUT_MODES;
|
|
2880
|
-
exports.THEME_COLOR_INPUT_STATES = v3_v2.THEME_COLOR_INPUT_STATES;
|
|
2881
|
-
exports.THEME_COLOR_SCHEMES = v3_v2.THEME_COLOR_SCHEMES;
|
|
2882
|
-
exports.THEME_COLOR_STATES = v3_v2.THEME_COLOR_STATES;
|
|
2883
|
-
exports.THEME_COLOR_STATE_TONES = v3_v2.THEME_COLOR_STATE_TONES;
|
|
2884
3113
|
exports.AVATAR_SIZE = AVATAR_SIZE;
|
|
2885
3114
|
exports.COLOR_CONFIG_AVATAR_COLORS = COLOR_CONFIG_AVATAR_COLORS;
|
|
2886
3115
|
exports.COLOR_CONFIG_BLEND_KEYS = COLOR_CONFIG_BLEND_KEYS;
|
|
@@ -2900,6 +3129,15 @@ exports.HUES = HUES;
|
|
|
2900
3129
|
exports.RADIUS = RADIUS;
|
|
2901
3130
|
exports.SHADOW = SHADOW;
|
|
2902
3131
|
exports.SPACE = SPACE;
|
|
3132
|
+
exports.THEME_COLOR_AVATAR_COLORS = THEME_COLOR_AVATAR_COLORS;
|
|
3133
|
+
exports.THEME_COLOR_BLEND_MODES = THEME_COLOR_BLEND_MODES;
|
|
3134
|
+
exports.THEME_COLOR_BUTTON_MODES = THEME_COLOR_BUTTON_MODES;
|
|
3135
|
+
exports.THEME_COLOR_CARD_TONES = THEME_COLOR_CARD_TONES;
|
|
3136
|
+
exports.THEME_COLOR_INPUT_MODES = THEME_COLOR_INPUT_MODES;
|
|
3137
|
+
exports.THEME_COLOR_INPUT_STATES = THEME_COLOR_INPUT_STATES;
|
|
3138
|
+
exports.THEME_COLOR_SCHEMES = THEME_COLOR_SCHEMES;
|
|
3139
|
+
exports.THEME_COLOR_STATES = THEME_COLOR_STATES;
|
|
3140
|
+
exports.THEME_COLOR_STATE_TONES = THEME_COLOR_STATE_TONES;
|
|
2903
3141
|
exports.TINTS = TINTS;
|
|
2904
3142
|
exports.buildColor_v3 = buildColor_v3;
|
|
2905
3143
|
exports.buildTheme = buildTheme;
|