@sanity/ui 2.0.0-beta.1 → 2.0.0-beta.3
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/index.cjs.mjs +10 -36
- package/dist/index.d.ts +180 -239
- package/dist/index.esm.js +105 -84
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +113 -297
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +1 -1
- package/dist/theme.d.ts +75 -111
- package/dist/theme.esm.js +169 -97
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +169 -97
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/core/__workshop__/constants.ts +3 -2
- package/src/core/_compat.ts +236 -87
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +14 -4
- package/src/core/primitives/avatar/avatarCounter.tsx +16 -5
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/kbd/kbd.tsx +2 -0
- package/src/core/primitives/tooltip/tooltip.tsx +1 -1
- package/src/core/styles/margin/marginsStyle.test.ts +2 -2
- package/src/core/styles/padding/paddingStyle.test.ts +2 -2
- package/src/core/theme/__workshop__/build/Root.tsx +20 -3
- package/src/core/theme/__workshop__/build/story.tsx +16 -10
- package/src/core/theme/__workshop__/canvas.tsx +7 -7
- package/src/core/theme/__workshop__/debug/story.tsx +159 -0
- package/src/core/theme/__workshop__/index.ts +5 -0
- package/src/core/theme/theme.test.tsx +2 -2
- package/src/core/types/avatar.ts +1 -1
- package/src/core/types/button.ts +1 -2
- package/src/theme/build/_deprecated/color/factory.ts +3 -3
- package/src/theme/build/buildColorTheme.ts +16 -16
- package/src/theme/build/colorToken/colorToken.ts +19 -0
- package/src/theme/build/colorToken/compileColorToken.ts +17 -0
- package/src/theme/build/colorToken/index.ts +2 -0
- package/src/theme/build/colorToken/types.ts +6 -0
- package/src/theme/build/renderColorTheme.ts +14 -15
- package/src/theme/build/renderColorValue.ts +1 -1
- package/src/theme/config/system.ts +9 -9
- package/src/theme/config/tokens/color/types.ts +12 -1
- package/src/theme/config/tokens/parseTokenKey.ts +1 -0
- package/src/theme/config/tokens/parseTokenValue.ts +1 -0
- package/src/theme/defaults/colorTokens.ts +127 -66
- package/src/theme/defaults/config.ts +1 -0
- package/src/theme/defaults/fonts.ts +13 -5
- package/src/theme/index.ts +0 -7
- package/src/theme/system/color/_constants.ts +5 -2
- package/src/theme/system/color/_system.ts +2 -1
- package/src/theme/system/color/avatar.ts +2 -12
- package/src/theme/system/color/button.ts +4 -20
- package/src/theme/system/color/input.ts +3 -11
- package/src/theme/system/color/selectable.ts +3 -14
- package/src/theme/system/shadow.ts +0 -6
- package/src/theme/system/styles.ts +0 -6
- package/src/theme/system/theme.ts +2 -0
- package/src/theme/system/v0/avatar.ts +1 -1
- package/src/theme/system/v0/color/button.ts +4 -4
- package/src/theme/system/v0/color/card.ts +2 -2
- package/src/theme/system/v0/color/input.ts +3 -3
- package/src/theme/system/v0/color/muted.ts +2 -2
- package/src/theme/system/v0/color/solid.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/v2_v0.ts +2 -2
- package/src/theme/build/colorToken.ts +0 -39
package/dist/theme.esm.js
CHANGED
|
@@ -1161,6 +1161,9 @@ const defaultThemeConfig = {
|
|
|
1161
1161
|
_version: 2,
|
|
1162
1162
|
avatar: {
|
|
1163
1163
|
sizes: [{
|
|
1164
|
+
distance: -4,
|
|
1165
|
+
size: 19
|
|
1166
|
+
}, {
|
|
1164
1167
|
distance: -4,
|
|
1165
1168
|
size: 25
|
|
1166
1169
|
}, {
|
|
@@ -1398,35 +1401,42 @@ const defaultThemeFonts = {
|
|
|
1398
1401
|
sizes: [{
|
|
1399
1402
|
ascenderHeight: 2,
|
|
1400
1403
|
descenderHeight: 2,
|
|
1401
|
-
fontSize:
|
|
1404
|
+
fontSize: 8.1,
|
|
1405
|
+
iconSize: 13,
|
|
1406
|
+
lineHeight: 10,
|
|
1407
|
+
letterSpacing: 0.5
|
|
1408
|
+
}, {
|
|
1409
|
+
ascenderHeight: 2,
|
|
1410
|
+
descenderHeight: 2,
|
|
1411
|
+
fontSize: 9.5,
|
|
1402
1412
|
iconSize: 15,
|
|
1403
1413
|
lineHeight: 11,
|
|
1404
1414
|
letterSpacing: 0.5
|
|
1405
1415
|
}, {
|
|
1406
1416
|
ascenderHeight: 2,
|
|
1407
1417
|
descenderHeight: 2,
|
|
1408
|
-
fontSize:
|
|
1418
|
+
fontSize: 10.8,
|
|
1409
1419
|
iconSize: 17,
|
|
1410
1420
|
lineHeight: 12,
|
|
1411
1421
|
letterSpacing: 0.5
|
|
1412
1422
|
}, {
|
|
1413
1423
|
ascenderHeight: 2,
|
|
1414
1424
|
descenderHeight: 2,
|
|
1415
|
-
fontSize: 12.
|
|
1425
|
+
fontSize: 12.25,
|
|
1416
1426
|
iconSize: 19,
|
|
1417
1427
|
lineHeight: 13,
|
|
1418
1428
|
letterSpacing: 0.5
|
|
1419
1429
|
}, {
|
|
1420
1430
|
ascenderHeight: 2,
|
|
1421
1431
|
descenderHeight: 2,
|
|
1422
|
-
fontSize:
|
|
1432
|
+
fontSize: 13.6,
|
|
1423
1433
|
iconSize: 21,
|
|
1424
1434
|
lineHeight: 14,
|
|
1425
1435
|
letterSpacing: 0.5
|
|
1426
1436
|
}, {
|
|
1427
1437
|
ascenderHeight: 2,
|
|
1428
1438
|
descenderHeight: 2,
|
|
1429
|
-
fontSize: 15
|
|
1439
|
+
fontSize: 15,
|
|
1430
1440
|
iconSize: 23,
|
|
1431
1441
|
lineHeight: 15,
|
|
1432
1442
|
letterSpacing: 0.5
|
|
@@ -1906,13 +1916,10 @@ function inputStateThemeColor_v2_v0(t) {
|
|
|
1906
1916
|
placeholder: t.placeholder
|
|
1907
1917
|
};
|
|
1908
1918
|
}
|
|
1919
|
+
const THEME_COLOR_SCHEMES = ["light", "dark"];
|
|
1909
1920
|
const THEME_COLOR_BLEND_MODES = ["multiply", "screen"];
|
|
1910
|
-
const THEME_COLOR_CARD_TONES = ["transparent", "default", "primary",
|
|
1911
|
-
|
|
1912
|
-
"positive", "caution", "critical"];
|
|
1913
|
-
const THEME_COLOR_STATE_TONES = ["default", "primary",
|
|
1914
|
-
// todo: rename to `accent` in the next breaking major version
|
|
1915
|
-
"positive", "caution", "critical"];
|
|
1921
|
+
const THEME_COLOR_CARD_TONES = ["transparent", "default", "primary", "positive", "caution", "critical"];
|
|
1922
|
+
const THEME_COLOR_STATE_TONES = ["default", "primary", "positive", "caution", "critical"];
|
|
1916
1923
|
const THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"];
|
|
1917
1924
|
const THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"];
|
|
1918
1925
|
const THEME_COLOR_INPUT_MODES = ["default", "invalid"];
|
|
@@ -2090,6 +2097,18 @@ function isColorValue(str) {
|
|
|
2090
2097
|
function isColorOpacityValue(str) {
|
|
2091
2098
|
return str === "0" || /^0\.[0-9]+$/.test(str) || str === "1";
|
|
2092
2099
|
}
|
|
2100
|
+
function compileColorTokenValue(node) {
|
|
2101
|
+
let key = "";
|
|
2102
|
+
if (node.key === "black" || node.key === "white") {
|
|
2103
|
+
key = node.key;
|
|
2104
|
+
} else {
|
|
2105
|
+
key = "".concat(node.hue, "/").concat(node.tint);
|
|
2106
|
+
}
|
|
2107
|
+
if (node.opacity !== void 0) {
|
|
2108
|
+
key += "/".concat(node.opacity);
|
|
2109
|
+
}
|
|
2110
|
+
return key;
|
|
2111
|
+
}
|
|
2093
2112
|
const DEFAULT_COLOR_TOKEN_VALUE = ["500", "500"];
|
|
2094
2113
|
function resolveColorTokenValue(context) {
|
|
2095
2114
|
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_COLOR_TOKEN_VALUE;
|
|
@@ -2106,22 +2125,13 @@ function resolveColorTokenValue(context) {
|
|
|
2106
2125
|
hue: node.hue || hue
|
|
2107
2126
|
});
|
|
2108
2127
|
}
|
|
2109
|
-
function compileColorTokenValue(node) {
|
|
2110
|
-
let key = "";
|
|
2111
|
-
if (node.key === "black" || node.key === "white") {
|
|
2112
|
-
key = node.key;
|
|
2113
|
-
} else {
|
|
2114
|
-
key = "".concat(node.hue, "/").concat(node.tint);
|
|
2115
|
-
}
|
|
2116
|
-
if (node.opacity !== void 0) {
|
|
2117
|
-
key += "/".concat(node.opacity);
|
|
2118
|
-
}
|
|
2119
|
-
return key;
|
|
2120
|
-
}
|
|
2121
2128
|
const defaultColorTokens = {
|
|
2122
2129
|
base: {
|
|
2123
2130
|
"*": {
|
|
2124
2131
|
_blend: ["multiply", "screen"],
|
|
2132
|
+
accent: {
|
|
2133
|
+
fg: ["purple/600", "purple/400"]
|
|
2134
|
+
},
|
|
2125
2135
|
avatar: {
|
|
2126
2136
|
"*": {
|
|
2127
2137
|
_blend: ["screen", "multiply"],
|
|
@@ -2142,7 +2152,9 @@ const defaultColorTokens = {
|
|
|
2142
2152
|
badge: {
|
|
2143
2153
|
"*": {
|
|
2144
2154
|
bg: ["100", "900"],
|
|
2145
|
-
fg: ["600", "400"]
|
|
2155
|
+
fg: ["600", "400"],
|
|
2156
|
+
icon: ["500", "500"],
|
|
2157
|
+
dot: ["500", "500"]
|
|
2146
2158
|
},
|
|
2147
2159
|
positive: {
|
|
2148
2160
|
bg: ["200/0.6", "900"],
|
|
@@ -2157,7 +2169,7 @@ const defaultColorTokens = {
|
|
|
2157
2169
|
border: ["200", "800"],
|
|
2158
2170
|
code: {
|
|
2159
2171
|
bg: ["50", "950"],
|
|
2160
|
-
fg: ["
|
|
2172
|
+
fg: ["700", "300"]
|
|
2161
2173
|
},
|
|
2162
2174
|
fg: ["800", "200"],
|
|
2163
2175
|
focusRing: ["blue/500", "blue/500"],
|
|
@@ -2167,7 +2179,7 @@ const defaultColorTokens = {
|
|
|
2167
2179
|
border: ["200", "800"]
|
|
2168
2180
|
},
|
|
2169
2181
|
link: {
|
|
2170
|
-
fg: ["blue/
|
|
2182
|
+
fg: ["blue/700", "blue/300"]
|
|
2171
2183
|
},
|
|
2172
2184
|
muted: {
|
|
2173
2185
|
bg: ["50", "950"],
|
|
@@ -2224,8 +2236,10 @@ const defaultColorTokens = {
|
|
|
2224
2236
|
},
|
|
2225
2237
|
badge: {
|
|
2226
2238
|
"*": {
|
|
2227
|
-
|
|
2228
|
-
|
|
2239
|
+
bg: ["900", "100"],
|
|
2240
|
+
fg: ["400", "600"],
|
|
2241
|
+
dot: ["500", "500"],
|
|
2242
|
+
icon: ["500", "500"]
|
|
2229
2243
|
}
|
|
2230
2244
|
},
|
|
2231
2245
|
bg: ["500", "400"],
|
|
@@ -2237,8 +2251,8 @@ const defaultColorTokens = {
|
|
|
2237
2251
|
fg: ["white", "black"],
|
|
2238
2252
|
icon: ["200", "800"],
|
|
2239
2253
|
kbd: {
|
|
2240
|
-
bg: ["
|
|
2241
|
-
fg: ["
|
|
2254
|
+
bg: ["black", "white"],
|
|
2255
|
+
fg: ["200", "800"],
|
|
2242
2256
|
border: ["800", "200"]
|
|
2243
2257
|
},
|
|
2244
2258
|
link: {
|
|
@@ -2265,8 +2279,21 @@ const defaultColorTokens = {
|
|
|
2265
2279
|
},
|
|
2266
2280
|
disabled: {
|
|
2267
2281
|
_hue: "gray",
|
|
2282
|
+
badge: {
|
|
2283
|
+
"*": {
|
|
2284
|
+
bg: ["gray/700", "gray/300"],
|
|
2285
|
+
fg: ["white", "black"],
|
|
2286
|
+
dot: ["white", "black"],
|
|
2287
|
+
icon: ["white", "black"]
|
|
2288
|
+
}
|
|
2289
|
+
},
|
|
2268
2290
|
bg: ["200", "800"],
|
|
2269
|
-
icon: ["white", "black"]
|
|
2291
|
+
icon: ["white", "black"],
|
|
2292
|
+
kbd: {
|
|
2293
|
+
bg: ["black", "white"],
|
|
2294
|
+
fg: ["white", "black"],
|
|
2295
|
+
border: ["700", "300"]
|
|
2296
|
+
}
|
|
2270
2297
|
}
|
|
2271
2298
|
},
|
|
2272
2299
|
default: {
|
|
@@ -2316,12 +2343,29 @@ const defaultColorTokens = {
|
|
|
2316
2343
|
"*": {
|
|
2317
2344
|
"*": {
|
|
2318
2345
|
_blend: ["multiply", "screen"],
|
|
2346
|
+
accent: {
|
|
2347
|
+
fg: ["purple/700/0.6", "purple/400/0.8"]
|
|
2348
|
+
},
|
|
2349
|
+
badge: {
|
|
2350
|
+
"*": {
|
|
2351
|
+
bg: ["100", "900"],
|
|
2352
|
+
fg: ["600", "400"],
|
|
2353
|
+
dot: ["500", "500"],
|
|
2354
|
+
icon: ["500", "500"]
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2319
2357
|
bg: ["50", "950"],
|
|
2358
|
+
border: ["100", "900"],
|
|
2359
|
+
code: {
|
|
2360
|
+
bg: ["500/0.1", "400/0.1"],
|
|
2361
|
+
fg: ["700/0.6", "400/0.6"]
|
|
2362
|
+
},
|
|
2320
2363
|
fg: ["700", "400"],
|
|
2321
2364
|
icon: ["600", "500"],
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
fg: ["
|
|
2365
|
+
kbd: {
|
|
2366
|
+
bg: ["white", "black"],
|
|
2367
|
+
fg: ["600", "400"],
|
|
2368
|
+
border: ["200", "800"]
|
|
2325
2369
|
},
|
|
2326
2370
|
link: {
|
|
2327
2371
|
fg: ["blue/700/0.6", "blue/400/0.8"]
|
|
@@ -2330,19 +2374,9 @@ const defaultColorTokens = {
|
|
|
2330
2374
|
bg: ["100", "950"],
|
|
2331
2375
|
fg: ["700/0.6", "400/0.6"]
|
|
2332
2376
|
},
|
|
2333
|
-
code: {
|
|
2334
|
-
bg: ["500/0.1", "400/0.1"],
|
|
2335
|
-
fg: ["700/0.6", "400/0.6"]
|
|
2336
|
-
},
|
|
2337
2377
|
skeleton: {
|
|
2338
2378
|
from: ["100", "900"],
|
|
2339
2379
|
to: ["100/0.5", "900/0.5"]
|
|
2340
|
-
},
|
|
2341
|
-
badge: {
|
|
2342
|
-
"*": {
|
|
2343
|
-
dot: ["300", "700"],
|
|
2344
|
-
icon: ["600", "400"]
|
|
2345
|
-
}
|
|
2346
2380
|
}
|
|
2347
2381
|
},
|
|
2348
2382
|
hovered: {
|
|
@@ -2359,21 +2393,35 @@ const defaultColorTokens = {
|
|
|
2359
2393
|
},
|
|
2360
2394
|
disabled: {
|
|
2361
2395
|
_hue: "gray",
|
|
2362
|
-
|
|
2363
|
-
|
|
2396
|
+
accent: {
|
|
2397
|
+
fg: ["200", "800"]
|
|
2398
|
+
},
|
|
2399
|
+
badge: {
|
|
2400
|
+
"*": {
|
|
2401
|
+
_hue: "gray",
|
|
2402
|
+
bg: ["50", "950"],
|
|
2403
|
+
fg: ["gray/200", "gray/800"],
|
|
2404
|
+
dot: ["gray/200", "gray/800"],
|
|
2405
|
+
icon: ["gray/200", "gray/800"]
|
|
2406
|
+
}
|
|
2407
|
+
},
|
|
2364
2408
|
border: ["100", "900"],
|
|
2365
|
-
|
|
2366
|
-
|
|
2409
|
+
code: {
|
|
2410
|
+
bg: ["50", "950"],
|
|
2411
|
+
fg: ["200", "800"]
|
|
2367
2412
|
},
|
|
2368
|
-
|
|
2369
|
-
|
|
2413
|
+
fg: ["200", "800"],
|
|
2414
|
+
icon: ["200", "800"],
|
|
2415
|
+
kbd: {
|
|
2416
|
+
bg: ["white", "black"],
|
|
2417
|
+
fg: ["200", "800"],
|
|
2418
|
+
border: ["100", "900"]
|
|
2370
2419
|
},
|
|
2371
2420
|
link: {
|
|
2372
|
-
fg: ["200
|
|
2421
|
+
fg: ["200", "800"]
|
|
2373
2422
|
},
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
fg: ["200/0.6", "900/0.6"]
|
|
2423
|
+
muted: {
|
|
2424
|
+
fg: ["200", "800"]
|
|
2377
2425
|
}
|
|
2378
2426
|
}
|
|
2379
2427
|
},
|
|
@@ -2392,33 +2440,40 @@ const defaultColorTokens = {
|
|
|
2392
2440
|
"*": {
|
|
2393
2441
|
"*": {
|
|
2394
2442
|
_blend: ["multiply", "screen"],
|
|
2443
|
+
accent: {
|
|
2444
|
+
fg: ["purple/700/0.7", "purple/300/0.7"]
|
|
2445
|
+
},
|
|
2446
|
+
badge: {
|
|
2447
|
+
"*": {
|
|
2448
|
+
bg: ["100", "900"],
|
|
2449
|
+
fg: ["600", "400"],
|
|
2450
|
+
dot: ["500", "500"],
|
|
2451
|
+
icon: ["500", "500"]
|
|
2452
|
+
}
|
|
2453
|
+
},
|
|
2395
2454
|
bg: ["white", "black"],
|
|
2396
|
-
fg: ["700", "300"],
|
|
2397
|
-
icon: ["700/0.7", "300/0.7"],
|
|
2398
2455
|
border: ["white/0", "black/0"],
|
|
2399
|
-
|
|
2456
|
+
code: {
|
|
2400
2457
|
bg: ["100", "950"],
|
|
2401
|
-
fg: ["
|
|
2458
|
+
fg: ["600", "300"]
|
|
2402
2459
|
},
|
|
2403
|
-
|
|
2404
|
-
|
|
2460
|
+
fg: ["700", "300"],
|
|
2461
|
+
icon: ["700/0.7", "300/0.7"],
|
|
2462
|
+
kbd: {
|
|
2463
|
+
bg: ["white", "black"],
|
|
2464
|
+
fg: ["600", "400"],
|
|
2465
|
+
border: ["200", "800"]
|
|
2405
2466
|
},
|
|
2406
2467
|
link: {
|
|
2407
2468
|
fg: ["blue/700/0.7", "blue/300/0.7"]
|
|
2408
2469
|
},
|
|
2409
|
-
|
|
2470
|
+
muted: {
|
|
2410
2471
|
bg: ["100", "950"],
|
|
2411
|
-
fg: ["
|
|
2472
|
+
fg: ["700/0.7", "300/0.7"]
|
|
2412
2473
|
},
|
|
2413
2474
|
skeleton: {
|
|
2414
2475
|
from: ["100", "900"],
|
|
2415
2476
|
to: ["100/0.5", "900/0.5"]
|
|
2416
|
-
},
|
|
2417
|
-
badge: {
|
|
2418
|
-
"*": {
|
|
2419
|
-
dot: ["300", "700"],
|
|
2420
|
-
icon: ["600", "400"]
|
|
2421
|
-
}
|
|
2422
2477
|
}
|
|
2423
2478
|
},
|
|
2424
2479
|
hovered: {
|
|
@@ -2438,19 +2493,33 @@ const defaultColorTokens = {
|
|
|
2438
2493
|
},
|
|
2439
2494
|
disabled: {
|
|
2440
2495
|
_hue: "gray",
|
|
2496
|
+
badge: {
|
|
2497
|
+
"*": {
|
|
2498
|
+
_hue: "gray",
|
|
2499
|
+
bg: ["50", "950"],
|
|
2500
|
+
fg: ["gray/200", "gray/800"],
|
|
2501
|
+
dot: ["gray/200", "gray/800"],
|
|
2502
|
+
icon: ["gray/200", "gray/800"]
|
|
2503
|
+
}
|
|
2504
|
+
},
|
|
2441
2505
|
fg: ["200", "800"],
|
|
2442
2506
|
muted: {
|
|
2443
|
-
fg: ["200
|
|
2507
|
+
fg: ["200", "800"]
|
|
2444
2508
|
},
|
|
2445
2509
|
accent: {
|
|
2446
|
-
fg: ["200
|
|
2510
|
+
fg: ["200", "800"]
|
|
2511
|
+
},
|
|
2512
|
+
kbd: {
|
|
2513
|
+
bg: ["white", "black"],
|
|
2514
|
+
fg: ["200", "800"],
|
|
2515
|
+
border: ["100", "900"]
|
|
2447
2516
|
},
|
|
2448
2517
|
link: {
|
|
2449
|
-
fg: ["200
|
|
2518
|
+
fg: ["200", "800"]
|
|
2450
2519
|
},
|
|
2451
2520
|
code: {
|
|
2452
|
-
bg: ["50
|
|
2453
|
-
fg: ["200
|
|
2521
|
+
bg: ["50", "950"],
|
|
2522
|
+
fg: ["200", "800"]
|
|
2454
2523
|
}
|
|
2455
2524
|
}
|
|
2456
2525
|
}
|
|
@@ -2500,10 +2569,25 @@ const defaultColorTokens = {
|
|
|
2500
2569
|
_blend: ["screen", "multiply"],
|
|
2501
2570
|
bg: ["500", "400"],
|
|
2502
2571
|
fg: ["white", "black"]
|
|
2572
|
+
},
|
|
2573
|
+
yellow: {
|
|
2574
|
+
bg: ["600", "400"]
|
|
2575
|
+
},
|
|
2576
|
+
green: {
|
|
2577
|
+
bg: ["600", "400"]
|
|
2578
|
+
},
|
|
2579
|
+
cyan: {
|
|
2580
|
+
bg: ["600", "400"]
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2583
|
+
badge: {
|
|
2584
|
+
"*": {
|
|
2585
|
+
// _blend: ['multiply', 'screen'],
|
|
2586
|
+
bg: ["100", "900"],
|
|
2587
|
+
fg: ["600", "400"],
|
|
2588
|
+
dot: ["500", "500"],
|
|
2589
|
+
icon: ["500", "500"]
|
|
2503
2590
|
}
|
|
2504
|
-
// yellow: {bg: ['600', '400']},
|
|
2505
|
-
// green: {bg: ['600', '400']},
|
|
2506
|
-
// cyan: {bg: ['600', '400']},
|
|
2507
2591
|
},
|
|
2508
2592
|
border: ["200", "800"],
|
|
2509
2593
|
muted: {
|
|
@@ -2513,6 +2597,11 @@ const defaultColorTokens = {
|
|
|
2513
2597
|
accent: {
|
|
2514
2598
|
fg: ["purple/600", "purple/400"]
|
|
2515
2599
|
},
|
|
2600
|
+
kbd: {
|
|
2601
|
+
bg: ["white", "black"],
|
|
2602
|
+
fg: ["600", "400"],
|
|
2603
|
+
border: ["200", "800"]
|
|
2604
|
+
},
|
|
2516
2605
|
link: {
|
|
2517
2606
|
fg: ["blue/700", "blue/300"]
|
|
2518
2607
|
},
|
|
@@ -2523,21 +2612,6 @@ const defaultColorTokens = {
|
|
|
2523
2612
|
skeleton: {
|
|
2524
2613
|
from: ["100", "900"],
|
|
2525
2614
|
to: ["100/0.5", "900/0.5"]
|
|
2526
|
-
},
|
|
2527
|
-
badge: {
|
|
2528
|
-
"*": {
|
|
2529
|
-
// _blend: ['multiply', 'screen'],
|
|
2530
|
-
bg: ["100", "900"],
|
|
2531
|
-
fg: ["600", "200"],
|
|
2532
|
-
dot: ["300", "700"],
|
|
2533
|
-
icon: ["600", "400"]
|
|
2534
|
-
}
|
|
2535
|
-
},
|
|
2536
|
-
kbd: {
|
|
2537
|
-
// _blend: ['multiply', 'screen'],
|
|
2538
|
-
bg: ["white", "black"],
|
|
2539
|
-
fg: ["600", "400"],
|
|
2540
|
-
border: ["200", "800"]
|
|
2541
2615
|
}
|
|
2542
2616
|
},
|
|
2543
2617
|
hovered: {
|
|
@@ -3808,7 +3882,7 @@ function renderColorValue(str, options) {
|
|
|
3808
3882
|
try {
|
|
3809
3883
|
hex = mixThemeColor(hex, mixOptions);
|
|
3810
3884
|
} catch (err) {
|
|
3811
|
-
console.
|
|
3885
|
+
console.warn("could not blend", hex, mixOptions);
|
|
3812
3886
|
throw err;
|
|
3813
3887
|
}
|
|
3814
3888
|
if (hex === "#aN") {
|
|
@@ -4060,10 +4134,9 @@ function renderThemeColorBadgeColor(value, options) {
|
|
|
4060
4134
|
colorPalette
|
|
4061
4135
|
};
|
|
4062
4136
|
return {
|
|
4063
|
-
// _blend: blendMode,
|
|
4064
4137
|
bg,
|
|
4065
|
-
fg: renderColorValue(value.fg, colorOptions),
|
|
4066
4138
|
dot: renderColorValue(value.dot, colorOptions),
|
|
4139
|
+
fg: renderColorValue(value.fg, colorOptions),
|
|
4067
4140
|
icon: renderColorValue(value.icon, colorOptions)
|
|
4068
4141
|
};
|
|
4069
4142
|
}
|
|
@@ -4122,7 +4195,7 @@ function renderThemeColorState(value, options) {
|
|
|
4122
4195
|
blendMode
|
|
4123
4196
|
}),
|
|
4124
4197
|
badge: renderThemeColorBadge(value.badge, {
|
|
4125
|
-
baseBg,
|
|
4198
|
+
baseBg: bg,
|
|
4126
4199
|
colorPalette,
|
|
4127
4200
|
blendMode
|
|
4128
4201
|
}),
|
|
@@ -4330,6 +4403,5 @@ function _setCachedTheme(rootTheme, scheme, tone, theme) {
|
|
|
4330
4403
|
const toneCache = schemeCache.get(tone);
|
|
4331
4404
|
toneCache.set(rootTheme, theme);
|
|
4332
4405
|
}
|
|
4333
|
-
|
|
4334
|
-
export { COLOR_CONFIG_AVATAR_COLORS, COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_INPUT_MODES, COLOR_CONFIG_INPUT_STATES, COLOR_CONFIG_STATES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_INPUT_MODES, THEME_COLOR_INPUT_STATES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, defaultTheme, getContrastRatio, getScopedTheme, getTheme_v2, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, is_v0, is_v2, mix, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, v0_v2, v2_v0 };
|
|
4406
|
+
export { COLOR_CONFIG_AVATAR_COLORS, COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_INPUT_MODES, COLOR_CONFIG_INPUT_STATES, COLOR_CONFIG_STATES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_INPUT_MODES, THEME_COLOR_INPUT_STATES, THEME_COLOR_SCHEMES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, getContrastRatio, getScopedTheme, getTheme_v2, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, is_v0, is_v2, mix, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, v0_v2, v2_v0 };
|
|
4335
4407
|
//# sourceMappingURL=theme.esm.js.map
|