@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.js
CHANGED
|
@@ -1166,6 +1166,9 @@ const defaultThemeConfig = {
|
|
|
1166
1166
|
_version: 2,
|
|
1167
1167
|
avatar: {
|
|
1168
1168
|
sizes: [{
|
|
1169
|
+
distance: -4,
|
|
1170
|
+
size: 19
|
|
1171
|
+
}, {
|
|
1169
1172
|
distance: -4,
|
|
1170
1173
|
size: 25
|
|
1171
1174
|
}, {
|
|
@@ -1403,35 +1406,42 @@ const defaultThemeFonts = {
|
|
|
1403
1406
|
sizes: [{
|
|
1404
1407
|
ascenderHeight: 2,
|
|
1405
1408
|
descenderHeight: 2,
|
|
1406
|
-
fontSize:
|
|
1409
|
+
fontSize: 8.1,
|
|
1410
|
+
iconSize: 13,
|
|
1411
|
+
lineHeight: 10,
|
|
1412
|
+
letterSpacing: 0.5
|
|
1413
|
+
}, {
|
|
1414
|
+
ascenderHeight: 2,
|
|
1415
|
+
descenderHeight: 2,
|
|
1416
|
+
fontSize: 9.5,
|
|
1407
1417
|
iconSize: 15,
|
|
1408
1418
|
lineHeight: 11,
|
|
1409
1419
|
letterSpacing: 0.5
|
|
1410
1420
|
}, {
|
|
1411
1421
|
ascenderHeight: 2,
|
|
1412
1422
|
descenderHeight: 2,
|
|
1413
|
-
fontSize:
|
|
1423
|
+
fontSize: 10.8,
|
|
1414
1424
|
iconSize: 17,
|
|
1415
1425
|
lineHeight: 12,
|
|
1416
1426
|
letterSpacing: 0.5
|
|
1417
1427
|
}, {
|
|
1418
1428
|
ascenderHeight: 2,
|
|
1419
1429
|
descenderHeight: 2,
|
|
1420
|
-
fontSize: 12.
|
|
1430
|
+
fontSize: 12.25,
|
|
1421
1431
|
iconSize: 19,
|
|
1422
1432
|
lineHeight: 13,
|
|
1423
1433
|
letterSpacing: 0.5
|
|
1424
1434
|
}, {
|
|
1425
1435
|
ascenderHeight: 2,
|
|
1426
1436
|
descenderHeight: 2,
|
|
1427
|
-
fontSize:
|
|
1437
|
+
fontSize: 13.6,
|
|
1428
1438
|
iconSize: 21,
|
|
1429
1439
|
lineHeight: 14,
|
|
1430
1440
|
letterSpacing: 0.5
|
|
1431
1441
|
}, {
|
|
1432
1442
|
ascenderHeight: 2,
|
|
1433
1443
|
descenderHeight: 2,
|
|
1434
|
-
fontSize: 15
|
|
1444
|
+
fontSize: 15,
|
|
1435
1445
|
iconSize: 23,
|
|
1436
1446
|
lineHeight: 15,
|
|
1437
1447
|
letterSpacing: 0.5
|
|
@@ -1911,13 +1921,10 @@ function inputStateThemeColor_v2_v0(t) {
|
|
|
1911
1921
|
placeholder: t.placeholder
|
|
1912
1922
|
};
|
|
1913
1923
|
}
|
|
1924
|
+
const THEME_COLOR_SCHEMES = ["light", "dark"];
|
|
1914
1925
|
const THEME_COLOR_BLEND_MODES = ["multiply", "screen"];
|
|
1915
|
-
const THEME_COLOR_CARD_TONES = ["transparent", "default", "primary",
|
|
1916
|
-
|
|
1917
|
-
"positive", "caution", "critical"];
|
|
1918
|
-
const THEME_COLOR_STATE_TONES = ["default", "primary",
|
|
1919
|
-
// todo: rename to `accent` in the next breaking major version
|
|
1920
|
-
"positive", "caution", "critical"];
|
|
1926
|
+
const THEME_COLOR_CARD_TONES = ["transparent", "default", "primary", "positive", "caution", "critical"];
|
|
1927
|
+
const THEME_COLOR_STATE_TONES = ["default", "primary", "positive", "caution", "critical"];
|
|
1921
1928
|
const THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"];
|
|
1922
1929
|
const THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"];
|
|
1923
1930
|
const THEME_COLOR_INPUT_MODES = ["default", "invalid"];
|
|
@@ -2095,6 +2102,18 @@ function isColorValue(str) {
|
|
|
2095
2102
|
function isColorOpacityValue(str) {
|
|
2096
2103
|
return str === "0" || /^0\.[0-9]+$/.test(str) || str === "1";
|
|
2097
2104
|
}
|
|
2105
|
+
function compileColorTokenValue(node) {
|
|
2106
|
+
let key = "";
|
|
2107
|
+
if (node.key === "black" || node.key === "white") {
|
|
2108
|
+
key = node.key;
|
|
2109
|
+
} else {
|
|
2110
|
+
key = "".concat(node.hue, "/").concat(node.tint);
|
|
2111
|
+
}
|
|
2112
|
+
if (node.opacity !== void 0) {
|
|
2113
|
+
key += "/".concat(node.opacity);
|
|
2114
|
+
}
|
|
2115
|
+
return key;
|
|
2116
|
+
}
|
|
2098
2117
|
const DEFAULT_COLOR_TOKEN_VALUE = ["500", "500"];
|
|
2099
2118
|
function resolveColorTokenValue(context) {
|
|
2100
2119
|
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_COLOR_TOKEN_VALUE;
|
|
@@ -2111,22 +2130,13 @@ function resolveColorTokenValue(context) {
|
|
|
2111
2130
|
hue: node.hue || hue
|
|
2112
2131
|
});
|
|
2113
2132
|
}
|
|
2114
|
-
function compileColorTokenValue(node) {
|
|
2115
|
-
let key = "";
|
|
2116
|
-
if (node.key === "black" || node.key === "white") {
|
|
2117
|
-
key = node.key;
|
|
2118
|
-
} else {
|
|
2119
|
-
key = "".concat(node.hue, "/").concat(node.tint);
|
|
2120
|
-
}
|
|
2121
|
-
if (node.opacity !== void 0) {
|
|
2122
|
-
key += "/".concat(node.opacity);
|
|
2123
|
-
}
|
|
2124
|
-
return key;
|
|
2125
|
-
}
|
|
2126
2133
|
const defaultColorTokens = {
|
|
2127
2134
|
base: {
|
|
2128
2135
|
"*": {
|
|
2129
2136
|
_blend: ["multiply", "screen"],
|
|
2137
|
+
accent: {
|
|
2138
|
+
fg: ["purple/600", "purple/400"]
|
|
2139
|
+
},
|
|
2130
2140
|
avatar: {
|
|
2131
2141
|
"*": {
|
|
2132
2142
|
_blend: ["screen", "multiply"],
|
|
@@ -2147,7 +2157,9 @@ const defaultColorTokens = {
|
|
|
2147
2157
|
badge: {
|
|
2148
2158
|
"*": {
|
|
2149
2159
|
bg: ["100", "900"],
|
|
2150
|
-
fg: ["600", "400"]
|
|
2160
|
+
fg: ["600", "400"],
|
|
2161
|
+
icon: ["500", "500"],
|
|
2162
|
+
dot: ["500", "500"]
|
|
2151
2163
|
},
|
|
2152
2164
|
positive: {
|
|
2153
2165
|
bg: ["200/0.6", "900"],
|
|
@@ -2162,7 +2174,7 @@ const defaultColorTokens = {
|
|
|
2162
2174
|
border: ["200", "800"],
|
|
2163
2175
|
code: {
|
|
2164
2176
|
bg: ["50", "950"],
|
|
2165
|
-
fg: ["
|
|
2177
|
+
fg: ["700", "300"]
|
|
2166
2178
|
},
|
|
2167
2179
|
fg: ["800", "200"],
|
|
2168
2180
|
focusRing: ["blue/500", "blue/500"],
|
|
@@ -2172,7 +2184,7 @@ const defaultColorTokens = {
|
|
|
2172
2184
|
border: ["200", "800"]
|
|
2173
2185
|
},
|
|
2174
2186
|
link: {
|
|
2175
|
-
fg: ["blue/
|
|
2187
|
+
fg: ["blue/700", "blue/300"]
|
|
2176
2188
|
},
|
|
2177
2189
|
muted: {
|
|
2178
2190
|
bg: ["50", "950"],
|
|
@@ -2229,8 +2241,10 @@ const defaultColorTokens = {
|
|
|
2229
2241
|
},
|
|
2230
2242
|
badge: {
|
|
2231
2243
|
"*": {
|
|
2232
|
-
|
|
2233
|
-
|
|
2244
|
+
bg: ["900", "100"],
|
|
2245
|
+
fg: ["400", "600"],
|
|
2246
|
+
dot: ["500", "500"],
|
|
2247
|
+
icon: ["500", "500"]
|
|
2234
2248
|
}
|
|
2235
2249
|
},
|
|
2236
2250
|
bg: ["500", "400"],
|
|
@@ -2242,8 +2256,8 @@ const defaultColorTokens = {
|
|
|
2242
2256
|
fg: ["white", "black"],
|
|
2243
2257
|
icon: ["200", "800"],
|
|
2244
2258
|
kbd: {
|
|
2245
|
-
bg: ["
|
|
2246
|
-
fg: ["
|
|
2259
|
+
bg: ["black", "white"],
|
|
2260
|
+
fg: ["200", "800"],
|
|
2247
2261
|
border: ["800", "200"]
|
|
2248
2262
|
},
|
|
2249
2263
|
link: {
|
|
@@ -2270,8 +2284,21 @@ const defaultColorTokens = {
|
|
|
2270
2284
|
},
|
|
2271
2285
|
disabled: {
|
|
2272
2286
|
_hue: "gray",
|
|
2287
|
+
badge: {
|
|
2288
|
+
"*": {
|
|
2289
|
+
bg: ["gray/700", "gray/300"],
|
|
2290
|
+
fg: ["white", "black"],
|
|
2291
|
+
dot: ["white", "black"],
|
|
2292
|
+
icon: ["white", "black"]
|
|
2293
|
+
}
|
|
2294
|
+
},
|
|
2273
2295
|
bg: ["200", "800"],
|
|
2274
|
-
icon: ["white", "black"]
|
|
2296
|
+
icon: ["white", "black"],
|
|
2297
|
+
kbd: {
|
|
2298
|
+
bg: ["black", "white"],
|
|
2299
|
+
fg: ["white", "black"],
|
|
2300
|
+
border: ["700", "300"]
|
|
2301
|
+
}
|
|
2275
2302
|
}
|
|
2276
2303
|
},
|
|
2277
2304
|
default: {
|
|
@@ -2321,12 +2348,29 @@ const defaultColorTokens = {
|
|
|
2321
2348
|
"*": {
|
|
2322
2349
|
"*": {
|
|
2323
2350
|
_blend: ["multiply", "screen"],
|
|
2351
|
+
accent: {
|
|
2352
|
+
fg: ["purple/700/0.6", "purple/400/0.8"]
|
|
2353
|
+
},
|
|
2354
|
+
badge: {
|
|
2355
|
+
"*": {
|
|
2356
|
+
bg: ["100", "900"],
|
|
2357
|
+
fg: ["600", "400"],
|
|
2358
|
+
dot: ["500", "500"],
|
|
2359
|
+
icon: ["500", "500"]
|
|
2360
|
+
}
|
|
2361
|
+
},
|
|
2324
2362
|
bg: ["50", "950"],
|
|
2363
|
+
border: ["100", "900"],
|
|
2364
|
+
code: {
|
|
2365
|
+
bg: ["500/0.1", "400/0.1"],
|
|
2366
|
+
fg: ["700/0.6", "400/0.6"]
|
|
2367
|
+
},
|
|
2325
2368
|
fg: ["700", "400"],
|
|
2326
2369
|
icon: ["600", "500"],
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
fg: ["
|
|
2370
|
+
kbd: {
|
|
2371
|
+
bg: ["white", "black"],
|
|
2372
|
+
fg: ["600", "400"],
|
|
2373
|
+
border: ["200", "800"]
|
|
2330
2374
|
},
|
|
2331
2375
|
link: {
|
|
2332
2376
|
fg: ["blue/700/0.6", "blue/400/0.8"]
|
|
@@ -2335,19 +2379,9 @@ const defaultColorTokens = {
|
|
|
2335
2379
|
bg: ["100", "950"],
|
|
2336
2380
|
fg: ["700/0.6", "400/0.6"]
|
|
2337
2381
|
},
|
|
2338
|
-
code: {
|
|
2339
|
-
bg: ["500/0.1", "400/0.1"],
|
|
2340
|
-
fg: ["700/0.6", "400/0.6"]
|
|
2341
|
-
},
|
|
2342
2382
|
skeleton: {
|
|
2343
2383
|
from: ["100", "900"],
|
|
2344
2384
|
to: ["100/0.5", "900/0.5"]
|
|
2345
|
-
},
|
|
2346
|
-
badge: {
|
|
2347
|
-
"*": {
|
|
2348
|
-
dot: ["300", "700"],
|
|
2349
|
-
icon: ["600", "400"]
|
|
2350
|
-
}
|
|
2351
2385
|
}
|
|
2352
2386
|
},
|
|
2353
2387
|
hovered: {
|
|
@@ -2364,21 +2398,35 @@ const defaultColorTokens = {
|
|
|
2364
2398
|
},
|
|
2365
2399
|
disabled: {
|
|
2366
2400
|
_hue: "gray",
|
|
2367
|
-
|
|
2368
|
-
|
|
2401
|
+
accent: {
|
|
2402
|
+
fg: ["200", "800"]
|
|
2403
|
+
},
|
|
2404
|
+
badge: {
|
|
2405
|
+
"*": {
|
|
2406
|
+
_hue: "gray",
|
|
2407
|
+
bg: ["50", "950"],
|
|
2408
|
+
fg: ["gray/200", "gray/800"],
|
|
2409
|
+
dot: ["gray/200", "gray/800"],
|
|
2410
|
+
icon: ["gray/200", "gray/800"]
|
|
2411
|
+
}
|
|
2412
|
+
},
|
|
2369
2413
|
border: ["100", "900"],
|
|
2370
|
-
|
|
2371
|
-
|
|
2414
|
+
code: {
|
|
2415
|
+
bg: ["50", "950"],
|
|
2416
|
+
fg: ["200", "800"]
|
|
2372
2417
|
},
|
|
2373
|
-
|
|
2374
|
-
|
|
2418
|
+
fg: ["200", "800"],
|
|
2419
|
+
icon: ["200", "800"],
|
|
2420
|
+
kbd: {
|
|
2421
|
+
bg: ["white", "black"],
|
|
2422
|
+
fg: ["200", "800"],
|
|
2423
|
+
border: ["100", "900"]
|
|
2375
2424
|
},
|
|
2376
2425
|
link: {
|
|
2377
|
-
fg: ["200
|
|
2426
|
+
fg: ["200", "800"]
|
|
2378
2427
|
},
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
fg: ["200/0.6", "900/0.6"]
|
|
2428
|
+
muted: {
|
|
2429
|
+
fg: ["200", "800"]
|
|
2382
2430
|
}
|
|
2383
2431
|
}
|
|
2384
2432
|
},
|
|
@@ -2397,33 +2445,40 @@ const defaultColorTokens = {
|
|
|
2397
2445
|
"*": {
|
|
2398
2446
|
"*": {
|
|
2399
2447
|
_blend: ["multiply", "screen"],
|
|
2448
|
+
accent: {
|
|
2449
|
+
fg: ["purple/700/0.7", "purple/300/0.7"]
|
|
2450
|
+
},
|
|
2451
|
+
badge: {
|
|
2452
|
+
"*": {
|
|
2453
|
+
bg: ["100", "900"],
|
|
2454
|
+
fg: ["600", "400"],
|
|
2455
|
+
dot: ["500", "500"],
|
|
2456
|
+
icon: ["500", "500"]
|
|
2457
|
+
}
|
|
2458
|
+
},
|
|
2400
2459
|
bg: ["white", "black"],
|
|
2401
|
-
fg: ["700", "300"],
|
|
2402
|
-
icon: ["700/0.7", "300/0.7"],
|
|
2403
2460
|
border: ["white/0", "black/0"],
|
|
2404
|
-
|
|
2461
|
+
code: {
|
|
2405
2462
|
bg: ["100", "950"],
|
|
2406
|
-
fg: ["
|
|
2463
|
+
fg: ["600", "300"]
|
|
2407
2464
|
},
|
|
2408
|
-
|
|
2409
|
-
|
|
2465
|
+
fg: ["700", "300"],
|
|
2466
|
+
icon: ["700/0.7", "300/0.7"],
|
|
2467
|
+
kbd: {
|
|
2468
|
+
bg: ["white", "black"],
|
|
2469
|
+
fg: ["600", "400"],
|
|
2470
|
+
border: ["200", "800"]
|
|
2410
2471
|
},
|
|
2411
2472
|
link: {
|
|
2412
2473
|
fg: ["blue/700/0.7", "blue/300/0.7"]
|
|
2413
2474
|
},
|
|
2414
|
-
|
|
2475
|
+
muted: {
|
|
2415
2476
|
bg: ["100", "950"],
|
|
2416
|
-
fg: ["
|
|
2477
|
+
fg: ["700/0.7", "300/0.7"]
|
|
2417
2478
|
},
|
|
2418
2479
|
skeleton: {
|
|
2419
2480
|
from: ["100", "900"],
|
|
2420
2481
|
to: ["100/0.5", "900/0.5"]
|
|
2421
|
-
},
|
|
2422
|
-
badge: {
|
|
2423
|
-
"*": {
|
|
2424
|
-
dot: ["300", "700"],
|
|
2425
|
-
icon: ["600", "400"]
|
|
2426
|
-
}
|
|
2427
2482
|
}
|
|
2428
2483
|
},
|
|
2429
2484
|
hovered: {
|
|
@@ -2443,19 +2498,33 @@ const defaultColorTokens = {
|
|
|
2443
2498
|
},
|
|
2444
2499
|
disabled: {
|
|
2445
2500
|
_hue: "gray",
|
|
2501
|
+
badge: {
|
|
2502
|
+
"*": {
|
|
2503
|
+
_hue: "gray",
|
|
2504
|
+
bg: ["50", "950"],
|
|
2505
|
+
fg: ["gray/200", "gray/800"],
|
|
2506
|
+
dot: ["gray/200", "gray/800"],
|
|
2507
|
+
icon: ["gray/200", "gray/800"]
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2446
2510
|
fg: ["200", "800"],
|
|
2447
2511
|
muted: {
|
|
2448
|
-
fg: ["200
|
|
2512
|
+
fg: ["200", "800"]
|
|
2449
2513
|
},
|
|
2450
2514
|
accent: {
|
|
2451
|
-
fg: ["200
|
|
2515
|
+
fg: ["200", "800"]
|
|
2516
|
+
},
|
|
2517
|
+
kbd: {
|
|
2518
|
+
bg: ["white", "black"],
|
|
2519
|
+
fg: ["200", "800"],
|
|
2520
|
+
border: ["100", "900"]
|
|
2452
2521
|
},
|
|
2453
2522
|
link: {
|
|
2454
|
-
fg: ["200
|
|
2523
|
+
fg: ["200", "800"]
|
|
2455
2524
|
},
|
|
2456
2525
|
code: {
|
|
2457
|
-
bg: ["50
|
|
2458
|
-
fg: ["200
|
|
2526
|
+
bg: ["50", "950"],
|
|
2527
|
+
fg: ["200", "800"]
|
|
2459
2528
|
}
|
|
2460
2529
|
}
|
|
2461
2530
|
}
|
|
@@ -2505,10 +2574,25 @@ const defaultColorTokens = {
|
|
|
2505
2574
|
_blend: ["screen", "multiply"],
|
|
2506
2575
|
bg: ["500", "400"],
|
|
2507
2576
|
fg: ["white", "black"]
|
|
2577
|
+
},
|
|
2578
|
+
yellow: {
|
|
2579
|
+
bg: ["600", "400"]
|
|
2580
|
+
},
|
|
2581
|
+
green: {
|
|
2582
|
+
bg: ["600", "400"]
|
|
2583
|
+
},
|
|
2584
|
+
cyan: {
|
|
2585
|
+
bg: ["600", "400"]
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
badge: {
|
|
2589
|
+
"*": {
|
|
2590
|
+
// _blend: ['multiply', 'screen'],
|
|
2591
|
+
bg: ["100", "900"],
|
|
2592
|
+
fg: ["600", "400"],
|
|
2593
|
+
dot: ["500", "500"],
|
|
2594
|
+
icon: ["500", "500"]
|
|
2508
2595
|
}
|
|
2509
|
-
// yellow: {bg: ['600', '400']},
|
|
2510
|
-
// green: {bg: ['600', '400']},
|
|
2511
|
-
// cyan: {bg: ['600', '400']},
|
|
2512
2596
|
},
|
|
2513
2597
|
border: ["200", "800"],
|
|
2514
2598
|
muted: {
|
|
@@ -2518,6 +2602,11 @@ const defaultColorTokens = {
|
|
|
2518
2602
|
accent: {
|
|
2519
2603
|
fg: ["purple/600", "purple/400"]
|
|
2520
2604
|
},
|
|
2605
|
+
kbd: {
|
|
2606
|
+
bg: ["white", "black"],
|
|
2607
|
+
fg: ["600", "400"],
|
|
2608
|
+
border: ["200", "800"]
|
|
2609
|
+
},
|
|
2521
2610
|
link: {
|
|
2522
2611
|
fg: ["blue/700", "blue/300"]
|
|
2523
2612
|
},
|
|
@@ -2528,21 +2617,6 @@ const defaultColorTokens = {
|
|
|
2528
2617
|
skeleton: {
|
|
2529
2618
|
from: ["100", "900"],
|
|
2530
2619
|
to: ["100/0.5", "900/0.5"]
|
|
2531
|
-
},
|
|
2532
|
-
badge: {
|
|
2533
|
-
"*": {
|
|
2534
|
-
// _blend: ['multiply', 'screen'],
|
|
2535
|
-
bg: ["100", "900"],
|
|
2536
|
-
fg: ["600", "200"],
|
|
2537
|
-
dot: ["300", "700"],
|
|
2538
|
-
icon: ["600", "400"]
|
|
2539
|
-
}
|
|
2540
|
-
},
|
|
2541
|
-
kbd: {
|
|
2542
|
-
// _blend: ['multiply', 'screen'],
|
|
2543
|
-
bg: ["white", "black"],
|
|
2544
|
-
fg: ["600", "400"],
|
|
2545
|
-
border: ["200", "800"]
|
|
2546
2620
|
}
|
|
2547
2621
|
},
|
|
2548
2622
|
hovered: {
|
|
@@ -3813,7 +3887,7 @@ function renderColorValue(str, options) {
|
|
|
3813
3887
|
try {
|
|
3814
3888
|
hex = mixThemeColor(hex, mixOptions);
|
|
3815
3889
|
} catch (err) {
|
|
3816
|
-
console.
|
|
3890
|
+
console.warn("could not blend", hex, mixOptions);
|
|
3817
3891
|
throw err;
|
|
3818
3892
|
}
|
|
3819
3893
|
if (hex === "#aN") {
|
|
@@ -4065,10 +4139,9 @@ function renderThemeColorBadgeColor(value, options) {
|
|
|
4065
4139
|
colorPalette
|
|
4066
4140
|
};
|
|
4067
4141
|
return {
|
|
4068
|
-
// _blend: blendMode,
|
|
4069
4142
|
bg,
|
|
4070
|
-
fg: renderColorValue(value.fg, colorOptions),
|
|
4071
4143
|
dot: renderColorValue(value.dot, colorOptions),
|
|
4144
|
+
fg: renderColorValue(value.fg, colorOptions),
|
|
4072
4145
|
icon: renderColorValue(value.icon, colorOptions)
|
|
4073
4146
|
};
|
|
4074
4147
|
}
|
|
@@ -4127,7 +4200,7 @@ function renderThemeColorState(value, options) {
|
|
|
4127
4200
|
blendMode
|
|
4128
4201
|
}),
|
|
4129
4202
|
badge: renderThemeColorBadge(value.badge, {
|
|
4130
|
-
baseBg,
|
|
4203
|
+
baseBg: bg,
|
|
4131
4204
|
colorPalette,
|
|
4132
4205
|
blendMode
|
|
4133
4206
|
}),
|
|
@@ -4335,7 +4408,6 @@ function _setCachedTheme(rootTheme, scheme, tone, theme) {
|
|
|
4335
4408
|
const toneCache = schemeCache.get(tone);
|
|
4336
4409
|
toneCache.set(rootTheme, theme);
|
|
4337
4410
|
}
|
|
4338
|
-
const defaultTheme = buildTheme();
|
|
4339
4411
|
exports.COLOR_CONFIG_AVATAR_COLORS = COLOR_CONFIG_AVATAR_COLORS;
|
|
4340
4412
|
exports.COLOR_CONFIG_BLEND_KEYS = COLOR_CONFIG_BLEND_KEYS;
|
|
4341
4413
|
exports.COLOR_CONFIG_CARD_KEYS = COLOR_CONFIG_CARD_KEYS;
|
|
@@ -4351,11 +4423,11 @@ exports.THEME_COLOR_BUTTON_MODES = THEME_COLOR_BUTTON_MODES;
|
|
|
4351
4423
|
exports.THEME_COLOR_CARD_TONES = THEME_COLOR_CARD_TONES;
|
|
4352
4424
|
exports.THEME_COLOR_INPUT_MODES = THEME_COLOR_INPUT_MODES;
|
|
4353
4425
|
exports.THEME_COLOR_INPUT_STATES = THEME_COLOR_INPUT_STATES;
|
|
4426
|
+
exports.THEME_COLOR_SCHEMES = THEME_COLOR_SCHEMES;
|
|
4354
4427
|
exports.THEME_COLOR_STATES = THEME_COLOR_STATES;
|
|
4355
4428
|
exports.THEME_COLOR_STATE_TONES = THEME_COLOR_STATE_TONES;
|
|
4356
4429
|
exports.buildTheme = buildTheme;
|
|
4357
4430
|
exports.createColorTheme = createColorTheme;
|
|
4358
|
-
exports.defaultTheme = defaultTheme;
|
|
4359
4431
|
exports.getContrastRatio = getContrastRatio;
|
|
4360
4432
|
exports.getScopedTheme = getScopedTheme;
|
|
4361
4433
|
exports.getTheme_v2 = getTheme_v2;
|