@sanity/ui 1.8.1 → 2.0.0-alpha.1
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.d.ts +40 -14
- package/dist/index.esm.js +377 -134
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +376 -133
- package/dist/index.js.map +1 -1
- package/package.json +34 -16
- package/src/components/autocomplete/autocomplete.tsx +2 -1
- package/src/components/dialog/dialog.tsx +3 -3
- package/src/components/hotkeys/hotkeys.tsx +2 -1
- package/src/components/menu/menuButton.tsx +2 -2
- package/src/components/menu/menuGroup.tsx +2 -2
- package/src/components/tab/tab.tsx +2 -1
- package/src/primitives/avatar/styles.ts +1 -1
- package/src/primitives/button/button.tsx +6 -7
- package/src/primitives/button/styles.ts +20 -3
- package/src/primitives/card/styles.ts +1 -1
- package/src/primitives/checkbox/checkbox.tsx +1 -0
- package/src/primitives/checkbox/styles.ts +47 -17
- package/src/primitives/kbd/kbd.tsx +6 -6
- package/src/primitives/popover/constants.ts +15 -1
- package/src/primitives/popover/popover.tsx +3 -1
- package/src/primitives/popover/popoverCard.tsx +2 -2
- package/src/primitives/radio/radio.tsx +1 -0
- package/src/primitives/radio/styles.ts +17 -4
- package/src/primitives/select/select.tsx +3 -2
- package/src/primitives/select/styles.ts +2 -1
- package/src/primitives/switch/__workshop__/props.tsx +4 -4
- package/src/primitives/switch/styles.ts +19 -12
- package/src/primitives/text/styles.ts +1 -0
- package/src/primitives/textInput/textInput.tsx +2 -1
- package/src/primitives/tooltip/constants.ts +16 -0
- package/src/primitives/tooltip/tooltip.tsx +5 -3
- package/src/primitives/types.ts +3 -2
- package/src/styles/colorVars/colorVarsStyle.ts +2 -0
- package/src/styles/focusRing/index.ts +3 -1
- package/src/styles/input/textInputStyle.ts +2 -1
- package/src/styles/radius/radiusStyle.ts +14 -4
- package/src/styles/radius/types.ts +3 -1
- package/src/theme/lib/theme/avatar.ts +3 -0
- package/src/theme/lib/theme/color/_generic/types.ts +1 -0
- package/src/theme/lib/theme/color/color.test.ts +1 -0
- package/src/theme/lib/theme/color/defaults.ts +8 -0
- package/src/theme/lib/theme/color/input/types.ts +1 -0
- package/src/theme/lib/theme/input.ts +11 -0
- package/src/theme/lib/theme/theme.ts +5 -4
- package/src/theme/studioTheme/color.ts +82 -70
- package/src/theme/studioTheme/fonts.ts +3 -3
- package/src/theme/studioTheme/theme.ts +17 -7
- package/src/theme/studioTheme/tints.ts +152 -0
- package/src/theme/types.ts +8 -0
- package/src/types/index.ts +1 -0
- package/src/types/radius.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -1256,6 +1256,7 @@ const defaultOpts = {
|
|
|
1256
1256
|
bg2: dark ? color.light : color.dark,
|
|
1257
1257
|
border: dark ? color.lighter : color.darker,
|
|
1258
1258
|
fg: dark ? color.darkest : color.lightest,
|
|
1259
|
+
iconColor: dark ? color.darkest : color.lightest,
|
|
1259
1260
|
muted: {
|
|
1260
1261
|
fg: black
|
|
1261
1262
|
},
|
|
@@ -1277,6 +1278,7 @@ const defaultOpts = {
|
|
|
1277
1278
|
bg2: color.base,
|
|
1278
1279
|
border: dark ? color.light : color.dark,
|
|
1279
1280
|
fg: dark ? color.darkest : color.lightest,
|
|
1281
|
+
iconColor: dark ? color.darkest : color.lightest,
|
|
1280
1282
|
muted: {
|
|
1281
1283
|
fg: black
|
|
1282
1284
|
},
|
|
@@ -1307,6 +1309,7 @@ const defaultOpts = {
|
|
|
1307
1309
|
bg2: dark ? color.darker : color.lighter,
|
|
1308
1310
|
border: dark ? color.lighter : color.darker,
|
|
1309
1311
|
fg: dark ? color.lightest : color.darkest,
|
|
1312
|
+
iconColor: dark ? color.lightest : color.darkest,
|
|
1310
1313
|
muted: {
|
|
1311
1314
|
fg: black
|
|
1312
1315
|
},
|
|
@@ -1328,6 +1331,7 @@ const defaultOpts = {
|
|
|
1328
1331
|
bg2: dark ? color.darkest : color.lightest,
|
|
1329
1332
|
border: dark ? color.darker : color.lighter,
|
|
1330
1333
|
fg: dark ? color.lighter : color.darker,
|
|
1334
|
+
iconColor: dark ? color.lighter : color.darker,
|
|
1331
1335
|
muted: {
|
|
1332
1336
|
fg: black
|
|
1333
1337
|
},
|
|
@@ -1358,6 +1362,7 @@ const defaultOpts = {
|
|
|
1358
1362
|
bg: "transparent",
|
|
1359
1363
|
bg2: "transparent",
|
|
1360
1364
|
fg: muted.enabled.fg,
|
|
1365
|
+
iconColor: muted.enabled.fg,
|
|
1361
1366
|
border: "transparent",
|
|
1362
1367
|
muted: {
|
|
1363
1368
|
fg: black
|
|
@@ -1378,6 +1383,7 @@ const defaultOpts = {
|
|
|
1378
1383
|
bg: muted.enabled.bg,
|
|
1379
1384
|
bg2: muted.enabled.bg,
|
|
1380
1385
|
fg: muted.hovered.fg,
|
|
1386
|
+
iconColor: muted.hovered.fg,
|
|
1381
1387
|
border: "transparent",
|
|
1382
1388
|
muted: {
|
|
1383
1389
|
fg: black
|
|
@@ -1410,6 +1416,7 @@ const defaultOpts = {
|
|
|
1410
1416
|
bg: black,
|
|
1411
1417
|
bg2: black,
|
|
1412
1418
|
fg: black,
|
|
1419
|
+
iconColor: black,
|
|
1413
1420
|
border: black,
|
|
1414
1421
|
muted: {
|
|
1415
1422
|
fg: black
|
|
@@ -1430,6 +1437,7 @@ const defaultOpts = {
|
|
|
1430
1437
|
input: () => {
|
|
1431
1438
|
return {
|
|
1432
1439
|
bg: black,
|
|
1440
|
+
bg2: black,
|
|
1433
1441
|
fg: black,
|
|
1434
1442
|
border: black,
|
|
1435
1443
|
placeholder: black
|
|
@@ -2170,11 +2178,115 @@ function screen(bg, fg) {
|
|
|
2170
2178
|
const hex = rgbToHex(screen$1(b, s));
|
|
2171
2179
|
return hex;
|
|
2172
2180
|
}
|
|
2181
|
+
const defaultTints = {
|
|
2182
|
+
light: {
|
|
2183
|
+
text_primary: "900",
|
|
2184
|
+
text_secondary: "600",
|
|
2185
|
+
text_inactive: "500",
|
|
2186
|
+
bg_base: color$1.white,
|
|
2187
|
+
bg_base_hover: "50",
|
|
2188
|
+
bg_base_active: "100",
|
|
2189
|
+
bg_accent: "500",
|
|
2190
|
+
bg_accent_hover: "600",
|
|
2191
|
+
bg_accent_active: "700",
|
|
2192
|
+
bg_tint: "50",
|
|
2193
|
+
icon_default: "500",
|
|
2194
|
+
icon_inverted: color$1.white,
|
|
2195
|
+
border_base: "100",
|
|
2196
|
+
border_accent: "500",
|
|
2197
|
+
border_accent_inverted: color$1.white
|
|
2198
|
+
},
|
|
2199
|
+
dark: {
|
|
2200
|
+
text_primary: "50",
|
|
2201
|
+
text_secondary: "300",
|
|
2202
|
+
text_inactive: "400",
|
|
2203
|
+
bg_base: color$1.black,
|
|
2204
|
+
bg_base_hover: "900",
|
|
2205
|
+
bg_base_active: "800",
|
|
2206
|
+
bg_accent: "500",
|
|
2207
|
+
bg_accent_hover: "400",
|
|
2208
|
+
bg_accent_active: "300",
|
|
2209
|
+
bg_tint: "900",
|
|
2210
|
+
icon_default: "300",
|
|
2211
|
+
icon_inverted: color$1.hues.gray[900],
|
|
2212
|
+
border_base: "800",
|
|
2213
|
+
border_accent: "300",
|
|
2214
|
+
border_accent_inverted: color$1.hues.gray[900]
|
|
2215
|
+
}
|
|
2216
|
+
};
|
|
2217
|
+
const colorTints = {
|
|
2218
|
+
light: {
|
|
2219
|
+
default: {
|
|
2220
|
+
...defaultTints.light,
|
|
2221
|
+
bg_accent: "900",
|
|
2222
|
+
bg_accent_hover: "950",
|
|
2223
|
+
bg_accent_active: color$1.black,
|
|
2224
|
+
border_accent: "600"
|
|
2225
|
+
},
|
|
2226
|
+
primary: {
|
|
2227
|
+
...defaultTints.light,
|
|
2228
|
+
bg_accent: "900",
|
|
2229
|
+
bg_accent_hover: "950",
|
|
2230
|
+
bg_accent_active: color$1.black,
|
|
2231
|
+
border_accent: "600"
|
|
2232
|
+
},
|
|
2233
|
+
positive: {
|
|
2234
|
+
...defaultTints.light,
|
|
2235
|
+
bg_base_hover: color$1.hues.gray[50],
|
|
2236
|
+
bg_base_active: "50",
|
|
2237
|
+
bg_accent: "400",
|
|
2238
|
+
bg_accent_hover: "500",
|
|
2239
|
+
bg_accent_active: "600",
|
|
2240
|
+
border_accent: "400"
|
|
2241
|
+
},
|
|
2242
|
+
transparent: defaultTints.light,
|
|
2243
|
+
caution: defaultTints.light,
|
|
2244
|
+
critical: defaultTints.light
|
|
2245
|
+
},
|
|
2246
|
+
dark: {
|
|
2247
|
+
default: {
|
|
2248
|
+
...defaultTints.dark,
|
|
2249
|
+
text_primary: color$1.white,
|
|
2250
|
+
bg_accent: color$1.white,
|
|
2251
|
+
bg_accent_hover: "50",
|
|
2252
|
+
bg_accent_active: "100"
|
|
2253
|
+
},
|
|
2254
|
+
primary: {
|
|
2255
|
+
...defaultTints.dark,
|
|
2256
|
+
text_primary: color$1.white,
|
|
2257
|
+
bg_accent: color$1.white,
|
|
2258
|
+
bg_accent_hover: "50",
|
|
2259
|
+
bg_accent_active: "100"
|
|
2260
|
+
},
|
|
2261
|
+
positive: {
|
|
2262
|
+
...defaultTints.dark,
|
|
2263
|
+
bg_base_hover: color$1.hues.gray[900],
|
|
2264
|
+
bg_base_active: "900",
|
|
2265
|
+
bg_accent: "400",
|
|
2266
|
+
bg_accent_hover: "300",
|
|
2267
|
+
bg_accent_active: "200",
|
|
2268
|
+
border_accent: "400"
|
|
2269
|
+
},
|
|
2270
|
+
transparent: defaultTints.dark,
|
|
2271
|
+
caution: defaultTints.dark,
|
|
2272
|
+
critical: defaultTints.dark
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
const getColorValue = (tints, dark, tone, key) => {
|
|
2276
|
+
const value = colorTints[dark ? "dark" : "light"][tone][key];
|
|
2277
|
+
if (typeof value === "string") {
|
|
2278
|
+
return tints[value];
|
|
2279
|
+
}
|
|
2280
|
+
return value;
|
|
2281
|
+
};
|
|
2282
|
+
const getColorHex = (tints, dark, tone, key) => {
|
|
2283
|
+
return getColorValue(tints, dark, tone, key).hex;
|
|
2284
|
+
};
|
|
2173
2285
|
const tones = {
|
|
2174
2286
|
default: color$1.hues.gray,
|
|
2175
2287
|
transparent: color$1.hues.gray,
|
|
2176
|
-
primary: color$1.hues.
|
|
2177
|
-
positive: color$1.hues.
|
|
2288
|
+
primary: color$1.hues.gray,
|
|
2289
|
+
positive: color$1.hues.cyan,
|
|
2178
2290
|
caution: color$1.hues.yellow,
|
|
2179
2291
|
critical: color$1.hues.red
|
|
2180
2292
|
};
|
|
@@ -2190,9 +2302,9 @@ const color = createColorTheme({
|
|
|
2190
2302
|
const skeletonFrom2 = dark ? tints2[900].hex : tints2[100].hex;
|
|
2191
2303
|
return {
|
|
2192
2304
|
fg: dark ? color$1.white.hex : color$1.black.hex,
|
|
2193
|
-
bg: dark
|
|
2194
|
-
border:
|
|
2195
|
-
focusRing:
|
|
2305
|
+
bg: getColorHex(tones["default"], dark, "default", "bg_base"),
|
|
2306
|
+
border: getColorHex(tones["default"], dark, "default", "border_base"),
|
|
2307
|
+
focusRing: getColorHex(tones["positive"], dark, "positive", "border_accent"),
|
|
2196
2308
|
shadow: {
|
|
2197
2309
|
outline: rgba(tints2[500].hex, 0.4),
|
|
2198
2310
|
umbra: dark ? rgba(tints2[950].hex, 0.4) : rgba(tints2[500].hex, 0.2),
|
|
@@ -2229,9 +2341,9 @@ const color = createColorTheme({
|
|
|
2229
2341
|
const skeletonFrom = tints[dark ? 800 : 200].hex;
|
|
2230
2342
|
return {
|
|
2231
2343
|
fg: tints[dark ? 100 : 900].hex,
|
|
2232
|
-
bg: tints
|
|
2233
|
-
border: tints
|
|
2234
|
-
focusRing: tints
|
|
2344
|
+
bg: getColorHex(tints, dark, name, "bg_base"),
|
|
2345
|
+
border: getColorHex(tints, dark, name, "border_base"),
|
|
2346
|
+
focusRing: getColorHex(tints, dark, name, "border_accent"),
|
|
2235
2347
|
shadow: {
|
|
2236
2348
|
outline: rgba(tints[500].hex, 0.4),
|
|
2237
2349
|
umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
|
|
@@ -2259,13 +2371,14 @@ const color = createColorTheme({
|
|
|
2259
2371
|
let tints = tones[tone === "default" ? name : tone] || defaultTints;
|
|
2260
2372
|
if (state === "disabled") {
|
|
2261
2373
|
tints = defaultTints;
|
|
2262
|
-
const bg2 =
|
|
2374
|
+
const bg2 = getColorHex(tones.default, dark, "default", "bg_tint");
|
|
2263
2375
|
const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
|
|
2264
2376
|
return {
|
|
2265
2377
|
bg: bg2,
|
|
2266
2378
|
bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
|
|
2267
|
-
border:
|
|
2268
|
-
fg:
|
|
2379
|
+
border: getColorHex(tones.default, dark, "default", "bg_base"),
|
|
2380
|
+
fg: getColorHex(tones.default, dark, "default", "text_inactive"),
|
|
2381
|
+
iconColor: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2269
2382
|
muted: {
|
|
2270
2383
|
fg: mix(base.bg, tints[dark ? 950 : 50].hex)
|
|
2271
2384
|
},
|
|
@@ -2286,13 +2399,14 @@ const color = createColorTheme({
|
|
|
2286
2399
|
};
|
|
2287
2400
|
}
|
|
2288
2401
|
if (state === "hovered") {
|
|
2289
|
-
const bg2 =
|
|
2402
|
+
const bg2 = getColorHex(tints, dark, tone, "bg_accent_hover");
|
|
2290
2403
|
const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
|
|
2291
2404
|
return {
|
|
2292
2405
|
bg: bg2,
|
|
2293
2406
|
bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
|
|
2294
|
-
border:
|
|
2295
|
-
fg:
|
|
2407
|
+
border: bg2,
|
|
2408
|
+
fg: getColorHex(tints, dark, "default", "bg_base"),
|
|
2409
|
+
iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
|
|
2296
2410
|
muted: {
|
|
2297
2411
|
fg: mix(base.bg, tints[dark ? 800 : 200].hex)
|
|
2298
2412
|
},
|
|
@@ -2313,13 +2427,14 @@ const color = createColorTheme({
|
|
|
2313
2427
|
};
|
|
2314
2428
|
}
|
|
2315
2429
|
if (state === "pressed") {
|
|
2316
|
-
const bg2 =
|
|
2317
|
-
const skeletonFrom2 = mix2(bg2, tints[dark ? 200 :
|
|
2430
|
+
const bg2 = getColorHex(tints, dark, tone, "bg_accent_active");
|
|
2431
|
+
const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 600].hex);
|
|
2318
2432
|
return {
|
|
2319
|
-
bg:
|
|
2433
|
+
bg: bg2,
|
|
2320
2434
|
bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
|
|
2321
|
-
border:
|
|
2322
|
-
fg:
|
|
2435
|
+
border: bg2,
|
|
2436
|
+
fg: getColorHex(tints, dark, "default", "bg_base"),
|
|
2437
|
+
iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
|
|
2323
2438
|
muted: {
|
|
2324
2439
|
fg: mix(base.bg, tints[dark ? 800 : 200].hex)
|
|
2325
2440
|
},
|
|
@@ -2348,8 +2463,9 @@ const color = createColorTheme({
|
|
|
2348
2463
|
return {
|
|
2349
2464
|
bg: bg2,
|
|
2350
2465
|
bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
|
|
2351
|
-
border:
|
|
2352
|
-
fg:
|
|
2466
|
+
border: bg2,
|
|
2467
|
+
fg: getColorHex(tints, dark, "default", "bg_base"),
|
|
2468
|
+
iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
|
|
2353
2469
|
muted: {
|
|
2354
2470
|
fg: mix(base.bg, tints[dark ? 800 : 200].hex)
|
|
2355
2471
|
},
|
|
@@ -2369,13 +2485,14 @@ const color = createColorTheme({
|
|
|
2369
2485
|
}
|
|
2370
2486
|
};
|
|
2371
2487
|
}
|
|
2372
|
-
const bg =
|
|
2488
|
+
const bg = getColorHex(tints, dark, tone, "bg_accent");
|
|
2373
2489
|
const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex);
|
|
2374
2490
|
return {
|
|
2375
2491
|
bg,
|
|
2376
2492
|
bg2: mix2(bg, tints[dark ? 50 : 950].hex),
|
|
2377
|
-
border:
|
|
2378
|
-
fg:
|
|
2493
|
+
border: bg,
|
|
2494
|
+
fg: getColorHex(tints, dark, "default", "bg_base"),
|
|
2495
|
+
iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
|
|
2379
2496
|
muted: {
|
|
2380
2497
|
fg: mix(base.bg, tints[dark ? 900 : 100].hex)
|
|
2381
2498
|
},
|
|
@@ -2414,20 +2531,21 @@ const color = createColorTheme({
|
|
|
2414
2531
|
return {
|
|
2415
2532
|
bg: bg2,
|
|
2416
2533
|
bg2: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2417
|
-
border:
|
|
2418
|
-
fg:
|
|
2534
|
+
border: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2535
|
+
fg: getColorHex(tones.default, dark, "default", "text_inactive"),
|
|
2536
|
+
iconColor: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2419
2537
|
muted: {
|
|
2420
|
-
fg:
|
|
2538
|
+
fg: getColorHex(tones.default, dark, "default", "text_inactive")
|
|
2421
2539
|
},
|
|
2422
2540
|
accent: {
|
|
2423
|
-
fg:
|
|
2541
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2424
2542
|
},
|
|
2425
2543
|
link: {
|
|
2426
|
-
fg:
|
|
2544
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2427
2545
|
},
|
|
2428
2546
|
code: {
|
|
2429
2547
|
bg: bg2,
|
|
2430
|
-
fg:
|
|
2548
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2431
2549
|
},
|
|
2432
2550
|
skeleton: {
|
|
2433
2551
|
from: rgba(skeletonFrom2, 0.5),
|
|
@@ -2436,15 +2554,16 @@ const color = createColorTheme({
|
|
|
2436
2554
|
};
|
|
2437
2555
|
}
|
|
2438
2556
|
if (state === "hovered") {
|
|
2439
|
-
const bg2 =
|
|
2557
|
+
const bg2 = getColorHex(tints, dark, name, "bg_base_hover");
|
|
2440
2558
|
const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
|
|
2441
2559
|
return {
|
|
2442
2560
|
bg: bg2,
|
|
2443
2561
|
bg2: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2444
2562
|
border: mix(bg2, tints[dark ? 900 : 100].hex),
|
|
2445
|
-
fg:
|
|
2563
|
+
fg: getColorHex(tints, dark, tone, "text_primary"),
|
|
2564
|
+
iconColor: getColorHex(tints, dark, name, "icon_default"),
|
|
2446
2565
|
muted: {
|
|
2447
|
-
fg:
|
|
2566
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2448
2567
|
},
|
|
2449
2568
|
accent: {
|
|
2450
2569
|
fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
|
|
@@ -2454,7 +2573,7 @@ const color = createColorTheme({
|
|
|
2454
2573
|
},
|
|
2455
2574
|
code: {
|
|
2456
2575
|
bg: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2457
|
-
fg:
|
|
2576
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2458
2577
|
},
|
|
2459
2578
|
skeleton: {
|
|
2460
2579
|
from: skeletonFrom2,
|
|
@@ -2466,15 +2585,16 @@ const color = createColorTheme({
|
|
|
2466
2585
|
if (isNeutral) {
|
|
2467
2586
|
tints = tones.primary;
|
|
2468
2587
|
}
|
|
2469
|
-
const bg2 =
|
|
2470
|
-
const skeletonFrom2 = mix(bg2, tints
|
|
2588
|
+
const bg2 = getColorHex(tints, dark, name, "bg_base_active");
|
|
2589
|
+
const skeletonFrom2 = mix(bg2, getColorHex(tints, dark, name, "bg_base_active"));
|
|
2471
2590
|
return {
|
|
2472
2591
|
bg: bg2,
|
|
2473
2592
|
bg2: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2474
|
-
border:
|
|
2475
|
-
fg:
|
|
2593
|
+
border: getColorHex(tints, dark, name, "border_base"),
|
|
2594
|
+
fg: getColorHex(tints, dark, tone, "text_primary"),
|
|
2595
|
+
iconColor: getColorHex(tints, dark, name, "icon_default"),
|
|
2476
2596
|
muted: {
|
|
2477
|
-
fg:
|
|
2597
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2478
2598
|
},
|
|
2479
2599
|
accent: {
|
|
2480
2600
|
fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
|
|
@@ -2484,7 +2604,7 @@ const color = createColorTheme({
|
|
|
2484
2604
|
},
|
|
2485
2605
|
code: {
|
|
2486
2606
|
bg: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2487
|
-
fg:
|
|
2607
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2488
2608
|
},
|
|
2489
2609
|
skeleton: {
|
|
2490
2610
|
from: skeletonFrom2,
|
|
@@ -2501,10 +2621,11 @@ const color = createColorTheme({
|
|
|
2501
2621
|
return {
|
|
2502
2622
|
bg: bg2,
|
|
2503
2623
|
bg2: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2504
|
-
border:
|
|
2505
|
-
fg:
|
|
2624
|
+
border: getColorHex(tints, dark, name, "border_base"),
|
|
2625
|
+
fg: getColorHex(tints, dark, tone, "text_primary"),
|
|
2626
|
+
iconColor: getColorHex(tints, dark, name, "icon_default"),
|
|
2506
2627
|
muted: {
|
|
2507
|
-
fg:
|
|
2628
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2508
2629
|
},
|
|
2509
2630
|
accent: {
|
|
2510
2631
|
fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
|
|
@@ -2514,7 +2635,7 @@ const color = createColorTheme({
|
|
|
2514
2635
|
},
|
|
2515
2636
|
code: {
|
|
2516
2637
|
bg: mix(bg2, tints[dark ? 950 : 50].hex),
|
|
2517
|
-
fg:
|
|
2638
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2518
2639
|
},
|
|
2519
2640
|
skeleton: {
|
|
2520
2641
|
from: skeletonFrom2,
|
|
@@ -2527,10 +2648,11 @@ const color = createColorTheme({
|
|
|
2527
2648
|
return {
|
|
2528
2649
|
bg,
|
|
2529
2650
|
bg2: mix(bg, tints[dark ? 950 : 50].hex),
|
|
2530
|
-
border: mix(bg, tints
|
|
2531
|
-
fg:
|
|
2651
|
+
border: mix(bg, getColorHex(tints, dark, name, "bg_base")),
|
|
2652
|
+
fg: getColorHex(tints, dark, tone, "text_primary"),
|
|
2653
|
+
iconColor: getColorHex(tints, dark, name, "icon_default"),
|
|
2532
2654
|
muted: {
|
|
2533
|
-
fg:
|
|
2655
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2534
2656
|
},
|
|
2535
2657
|
accent: {
|
|
2536
2658
|
fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
|
|
@@ -2540,7 +2662,7 @@ const color = createColorTheme({
|
|
|
2540
2662
|
},
|
|
2541
2663
|
code: {
|
|
2542
2664
|
bg: mix(base.bg, tints[dark ? 950 : 50].hex),
|
|
2543
|
-
fg:
|
|
2665
|
+
fg: getColorHex(tints, dark, tone, "text_secondary")
|
|
2544
2666
|
},
|
|
2545
2667
|
skeleton: {
|
|
2546
2668
|
from: skeletonFrom,
|
|
@@ -2581,12 +2703,11 @@ const color = createColorTheme({
|
|
|
2581
2703
|
}
|
|
2582
2704
|
if (mode === "ghost") {
|
|
2583
2705
|
return {
|
|
2584
|
-
...
|
|
2706
|
+
...muted,
|
|
2585
2707
|
enabled: {
|
|
2586
2708
|
...muted.enabled,
|
|
2587
2709
|
border: base.border
|
|
2588
|
-
}
|
|
2589
|
-
disabled: muted.disabled
|
|
2710
|
+
}
|
|
2590
2711
|
};
|
|
2591
2712
|
}
|
|
2592
2713
|
return solid;
|
|
@@ -2627,6 +2748,7 @@ const color = createColorTheme({
|
|
|
2627
2748
|
bg,
|
|
2628
2749
|
bg2: mix(bg, tints[dark ? 950 : 50].hex),
|
|
2629
2750
|
fg: base.fg,
|
|
2751
|
+
iconColor: getColorHex(tints, dark, name, "icon_default"),
|
|
2630
2752
|
border: base.border,
|
|
2631
2753
|
muted: {
|
|
2632
2754
|
fg: mix(base.bg, tints[dark ? 400 : 600].hex)
|
|
@@ -2659,40 +2781,45 @@ const color = createColorTheme({
|
|
|
2659
2781
|
const tints = tones.critical;
|
|
2660
2782
|
return {
|
|
2661
2783
|
bg: mix(base.bg, tints[dark ? 950 : 50].hex),
|
|
2784
|
+
bg2: getColorHex(tints, dark, "critical", "text_secondary"),
|
|
2662
2785
|
fg: mix(base.bg, tints[dark ? 400 : 600].hex),
|
|
2663
|
-
border:
|
|
2664
|
-
placeholder:
|
|
2786
|
+
border: getColorHex(tints, dark, "critical", "border_base"),
|
|
2787
|
+
placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
|
|
2665
2788
|
};
|
|
2666
2789
|
}
|
|
2667
2790
|
if (state === "hovered") {
|
|
2668
2791
|
return {
|
|
2669
2792
|
bg: base.bg,
|
|
2793
|
+
bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
|
|
2670
2794
|
fg: base.fg,
|
|
2671
2795
|
border: mix(base.bg, color$1.hues.gray[dark ? 700 : 300].hex),
|
|
2672
|
-
placeholder:
|
|
2796
|
+
placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
|
|
2673
2797
|
};
|
|
2674
2798
|
}
|
|
2675
2799
|
if (state === "disabled") {
|
|
2676
2800
|
return {
|
|
2677
|
-
bg:
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2801
|
+
bg: getColorHex(tones.default, dark, "default", "bg_tint"),
|
|
2802
|
+
bg2: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2803
|
+
fg: getColorHex(tones.default, dark, "default", "text_secondary"),
|
|
2804
|
+
border: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2805
|
+
placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
|
|
2681
2806
|
};
|
|
2682
2807
|
}
|
|
2683
2808
|
if (state === "readOnly") {
|
|
2684
2809
|
return {
|
|
2685
|
-
bg:
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2810
|
+
bg: getColorHex(tones.default, dark, "default", "bg_tint"),
|
|
2811
|
+
bg2: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2812
|
+
fg: getColorHex(tones.default, dark, "default", "text_secondary"),
|
|
2813
|
+
border: getColorHex(tones.default, dark, "default", "border_base"),
|
|
2814
|
+
placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
|
|
2689
2815
|
};
|
|
2690
2816
|
}
|
|
2691
2817
|
return {
|
|
2692
2818
|
bg: base.bg,
|
|
2819
|
+
bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
|
|
2693
2820
|
fg: base.fg,
|
|
2694
2821
|
border: base.border,
|
|
2695
|
-
placeholder:
|
|
2822
|
+
placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
|
|
2696
2823
|
};
|
|
2697
2824
|
},
|
|
2698
2825
|
selectable: _ref17 => {
|
|
@@ -2833,7 +2960,7 @@ const fonts = {
|
|
|
2833
2960
|
}]
|
|
2834
2961
|
},
|
|
2835
2962
|
heading: {
|
|
2836
|
-
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
2963
|
+
family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
2837
2964
|
weights: {
|
|
2838
2965
|
regular: 700,
|
|
2839
2966
|
medium: 800,
|
|
@@ -2885,7 +3012,7 @@ const fonts = {
|
|
|
2885
3012
|
}]
|
|
2886
3013
|
},
|
|
2887
3014
|
label: {
|
|
2888
|
-
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
|
|
3015
|
+
family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
|
|
2889
3016
|
weights: {
|
|
2890
3017
|
regular: 600,
|
|
2891
3018
|
medium: 700,
|
|
@@ -2930,7 +3057,7 @@ const fonts = {
|
|
|
2930
3057
|
}]
|
|
2931
3058
|
},
|
|
2932
3059
|
text: {
|
|
2933
|
-
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
3060
|
+
family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
2934
3061
|
weights: {
|
|
2935
3062
|
regular: 400,
|
|
2936
3063
|
medium: 500,
|
|
@@ -2986,17 +3113,27 @@ const studioTheme = {
|
|
|
2986
3113
|
}, {
|
|
2987
3114
|
distance: -9,
|
|
2988
3115
|
size: 55
|
|
2989
|
-
}]
|
|
3116
|
+
}],
|
|
3117
|
+
focusRing: {
|
|
3118
|
+
offset: 1,
|
|
3119
|
+
width: 1
|
|
3120
|
+
}
|
|
2990
3121
|
},
|
|
2991
3122
|
button: {
|
|
2992
|
-
textWeight: "medium"
|
|
3123
|
+
textWeight: "medium",
|
|
3124
|
+
focusRing: {
|
|
3125
|
+
offset: -1,
|
|
3126
|
+
width: 2
|
|
3127
|
+
}
|
|
3128
|
+
},
|
|
3129
|
+
card: {
|
|
3130
|
+
focusRing: {
|
|
3131
|
+
offset: -1,
|
|
3132
|
+
width: 1
|
|
3133
|
+
}
|
|
2993
3134
|
},
|
|
2994
3135
|
color,
|
|
2995
3136
|
container: [320, 640, 960, 1280, 1600, 1920],
|
|
2996
|
-
focusRing: {
|
|
2997
|
-
offset: 1,
|
|
2998
|
-
width: 2
|
|
2999
|
-
},
|
|
3000
3137
|
fonts,
|
|
3001
3138
|
media: [360, 600, 900, 1200, 1800, 2400],
|
|
3002
3139
|
radius: [0, 1, 3, 6, 9, 12, 21],
|
|
@@ -3024,21 +3161,45 @@ const studioTheme = {
|
|
|
3024
3161
|
space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
|
|
3025
3162
|
input: {
|
|
3026
3163
|
checkbox: {
|
|
3027
|
-
size: 17
|
|
3164
|
+
size: 17,
|
|
3165
|
+
focusRing: {
|
|
3166
|
+
offset: -1,
|
|
3167
|
+
width: 1
|
|
3168
|
+
}
|
|
3028
3169
|
},
|
|
3029
3170
|
radio: {
|
|
3030
3171
|
size: 17,
|
|
3031
|
-
markSize: 9
|
|
3172
|
+
markSize: 9,
|
|
3173
|
+
focusRing: {
|
|
3174
|
+
offset: -1,
|
|
3175
|
+
width: 1
|
|
3176
|
+
}
|
|
3032
3177
|
},
|
|
3033
3178
|
switch: {
|
|
3034
|
-
width:
|
|
3035
|
-
height:
|
|
3036
|
-
padding:
|
|
3179
|
+
width: 21,
|
|
3180
|
+
height: 13,
|
|
3181
|
+
padding: 2,
|
|
3037
3182
|
transitionDurationMs: 150,
|
|
3038
|
-
transitionTimingFunction: "ease-out"
|
|
3183
|
+
transitionTimingFunction: "ease-out",
|
|
3184
|
+
focusRing: {
|
|
3185
|
+
offset: 1,
|
|
3186
|
+
width: 1
|
|
3187
|
+
}
|
|
3039
3188
|
},
|
|
3040
3189
|
border: {
|
|
3041
3190
|
width: 1
|
|
3191
|
+
},
|
|
3192
|
+
select: {
|
|
3193
|
+
focusRing: {
|
|
3194
|
+
offset: -1,
|
|
3195
|
+
width: 1
|
|
3196
|
+
}
|
|
3197
|
+
},
|
|
3198
|
+
text: {
|
|
3199
|
+
focusRing: {
|
|
3200
|
+
offset: -1,
|
|
3201
|
+
width: 1
|
|
3202
|
+
}
|
|
3042
3203
|
}
|
|
3043
3204
|
}
|
|
3044
3205
|
// styles: {
|
|
@@ -3841,9 +4002,11 @@ function textInputRepresentationStyle(props) {
|
|
|
3841
4002
|
theme
|
|
3842
4003
|
} = props;
|
|
3843
4004
|
const {
|
|
3844
|
-
focusRing,
|
|
3845
4005
|
input
|
|
3846
4006
|
} = theme.sanity;
|
|
4007
|
+
const {
|
|
4008
|
+
focusRing
|
|
4009
|
+
} = input.text;
|
|
3847
4010
|
const color = theme.sanity.color.input;
|
|
3848
4011
|
return styled.css(_c$d || (_c$d = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
3849
4012
|
color: color.default.enabled.border,
|
|
@@ -3887,9 +4050,18 @@ function responsiveRadiusStyle(props) {
|
|
|
3887
4050
|
media,
|
|
3888
4051
|
radius
|
|
3889
4052
|
} = theme.sanity;
|
|
3890
|
-
return _responsive(media, props.$radius,
|
|
3891
|
-
borderRadius
|
|
3892
|
-
|
|
4053
|
+
return _responsive(media, props.$radius, value => {
|
|
4054
|
+
let borderRadius = 0;
|
|
4055
|
+
if (typeof value === "number") {
|
|
4056
|
+
borderRadius = rem(radius[value]);
|
|
4057
|
+
}
|
|
4058
|
+
if (value === "full") {
|
|
4059
|
+
borderRadius = "9999px";
|
|
4060
|
+
}
|
|
4061
|
+
return {
|
|
4062
|
+
borderRadius
|
|
4063
|
+
};
|
|
4064
|
+
});
|
|
3893
4065
|
}
|
|
3894
4066
|
function toBoxShadow(shadow, color) {
|
|
3895
4067
|
return "".concat(shadow.map(rem).join(" "), " ").concat(color);
|
|
@@ -3929,7 +4101,7 @@ function textBaseStyle(props) {
|
|
|
3929
4101
|
const {
|
|
3930
4102
|
weights
|
|
3931
4103
|
} = theme.sanity.fonts.text;
|
|
3932
|
-
return styled.css(_c$c || (_c$c = __template$C(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
|
|
4104
|
+
return styled.css(_c$c || (_c$c = __template$C(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
|
|
3933
4105
|
}
|
|
3934
4106
|
var __freeze$B = Object.freeze;
|
|
3935
4107
|
var __defProp$C = Object.defineProperty;
|
|
@@ -4022,7 +4194,7 @@ function avatarRootStyle(props) {
|
|
|
4022
4194
|
} = props;
|
|
4023
4195
|
const {
|
|
4024
4196
|
focusRing
|
|
4025
|
-
} = theme.sanity;
|
|
4197
|
+
} = theme.sanity.avatar;
|
|
4026
4198
|
return {
|
|
4027
4199
|
backgroundColor: $color,
|
|
4028
4200
|
position: "relative",
|
|
@@ -4573,8 +4745,10 @@ function _colorVarsStyle(base, color) {
|
|
|
4573
4745
|
"--card-shadow-penumbra-color": base.shadow.penumbra,
|
|
4574
4746
|
"--card-shadow-ambient-color": base.shadow.ambient,
|
|
4575
4747
|
"--card-focus-ring-color": base.focusRing,
|
|
4748
|
+
"--card-icon-color": color.iconColor,
|
|
4576
4749
|
// Card
|
|
4577
4750
|
"--card-bg-color": color.bg,
|
|
4751
|
+
"--card-bg2-color": color.bg2,
|
|
4578
4752
|
"--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
|
|
4579
4753
|
"--card-fg-color": color.fg,
|
|
4580
4754
|
"--card-border-color": color.border,
|
|
@@ -4605,6 +4779,13 @@ const buttonTheme = {
|
|
|
4605
4779
|
width: 1
|
|
4606
4780
|
}
|
|
4607
4781
|
};
|
|
4782
|
+
const defaultBoxShadow = "0px 2px 0px 0px rgba(112, 128, 155, 0.19);";
|
|
4783
|
+
function combineBoxShadow() {
|
|
4784
|
+
for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4785
|
+
boxShadows[_key] = arguments[_key];
|
|
4786
|
+
}
|
|
4787
|
+
return boxShadows.filter(Boolean).join(",");
|
|
4788
|
+
}
|
|
4608
4789
|
function buttonColorStyles(props) {
|
|
4609
4790
|
var _a2, _b;
|
|
4610
4791
|
const {
|
|
@@ -4613,7 +4794,8 @@ function buttonColorStyles(props) {
|
|
|
4613
4794
|
} = props;
|
|
4614
4795
|
const {
|
|
4615
4796
|
focusRing
|
|
4616
|
-
} = theme.sanity;
|
|
4797
|
+
} = theme.sanity.button;
|
|
4798
|
+
const shadow = props.$mode !== "bleed";
|
|
4617
4799
|
const base = theme.sanity.color.base;
|
|
4618
4800
|
const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
|
|
4619
4801
|
const color = mode[props.$tone] || mode.default;
|
|
@@ -4627,15 +4809,19 @@ function buttonColorStyles(props) {
|
|
|
4627
4809
|
boxShadow: focusRingBorderStyle(border),
|
|
4628
4810
|
'&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
|
|
4629
4811
|
"&:not([data-disabled='true'])": {
|
|
4812
|
+
boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
|
|
4630
4813
|
"&:focus": {
|
|
4631
4814
|
boxShadow: focusRingStyle({
|
|
4632
4815
|
base,
|
|
4633
|
-
border
|
|
4816
|
+
border: {
|
|
4817
|
+
width: 2,
|
|
4818
|
+
color: base.bg
|
|
4819
|
+
},
|
|
4634
4820
|
focusRing
|
|
4635
4821
|
})
|
|
4636
4822
|
},
|
|
4637
4823
|
"&:focus:not(:focus-visible)": {
|
|
4638
|
-
boxShadow: focusRingBorderStyle(border)
|
|
4824
|
+
boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
|
|
4639
4825
|
},
|
|
4640
4826
|
"@media (hover: hover)": {
|
|
4641
4827
|
"&:hover": _colorVarsStyle(base, color.hovered),
|
|
@@ -4658,7 +4844,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
4658
4844
|
const {
|
|
4659
4845
|
children,
|
|
4660
4846
|
disabled,
|
|
4661
|
-
fontSize,
|
|
4847
|
+
fontSize = 1,
|
|
4662
4848
|
icon,
|
|
4663
4849
|
iconRight,
|
|
4664
4850
|
justify: justifyProp = "center",
|
|
@@ -4678,6 +4864,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
4678
4864
|
textAlign,
|
|
4679
4865
|
tone = "default",
|
|
4680
4866
|
type = "button",
|
|
4867
|
+
muted = false,
|
|
4681
4868
|
...restProps
|
|
4682
4869
|
} = props;
|
|
4683
4870
|
const justify = useArrayProp(justifyProp);
|
|
@@ -4720,14 +4907,14 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
4720
4907
|
children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
|
|
4721
4908
|
as: "span",
|
|
4722
4909
|
justify,
|
|
4910
|
+
gap: space,
|
|
4723
4911
|
children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
|
|
4724
4912
|
size: fontSize,
|
|
4725
4913
|
children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
|
|
4726
4914
|
}), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
4727
4915
|
flex: iconRight ? 1 : void 0,
|
|
4728
|
-
marginLeft: icon ? space : void 0,
|
|
4729
|
-
marginRight: iconRight ? space : void 0,
|
|
4730
4916
|
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
4917
|
+
muted,
|
|
4731
4918
|
align: textAlign,
|
|
4732
4919
|
size: fontSize,
|
|
4733
4920
|
textOverflow: "ellipsis",
|
|
@@ -4772,7 +4959,7 @@ function cardColorStyle(props) {
|
|
|
4772
4959
|
} = props;
|
|
4773
4960
|
const {
|
|
4774
4961
|
focusRing
|
|
4775
|
-
} = theme.sanity;
|
|
4962
|
+
} = theme.sanity.card;
|
|
4776
4963
|
const {
|
|
4777
4964
|
base,
|
|
4778
4965
|
card,
|
|
@@ -4857,29 +5044,44 @@ function inputElementStyles(props) {
|
|
|
4857
5044
|
} = props;
|
|
4858
5045
|
const color = theme.sanity.color.input;
|
|
4859
5046
|
const {
|
|
4860
|
-
focusRing,
|
|
4861
5047
|
input,
|
|
4862
5048
|
radius
|
|
4863
5049
|
} = theme.sanity;
|
|
4864
|
-
|
|
5050
|
+
const {
|
|
5051
|
+
focusRing
|
|
5052
|
+
} = input.checkbox;
|
|
5053
|
+
return styled.css(_b$h || (_b$h = __template$s(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.2 !important;\n }\n }\n }\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
|
|
4865
5054
|
color: color.default.enabled.border,
|
|
4866
5055
|
width: input.border.width
|
|
4867
|
-
}), rem(radius[2]), color.default.enabled.bg,
|
|
5056
|
+
}), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
|
|
5057
|
+
color: color.default.enabled.bg2,
|
|
5058
|
+
width: input.border.width
|
|
5059
|
+
}), color.default.enabled.bg, focusRingStyle({
|
|
5060
|
+
focusRing
|
|
5061
|
+
}), focusRingStyle({
|
|
5062
|
+
focusRing: {
|
|
5063
|
+
width: 1,
|
|
5064
|
+
offset: 1
|
|
5065
|
+
}
|
|
5066
|
+
}), color.invalid.enabled.border, focusRingBorderStyle({
|
|
5067
|
+
width: input.border.width,
|
|
5068
|
+
color: color.invalid.enabled.bg2
|
|
5069
|
+
}), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
|
|
4868
5070
|
border: {
|
|
4869
5071
|
width: input.border.width,
|
|
4870
|
-
color: color.
|
|
5072
|
+
color: color.invalid.readOnly.bg2
|
|
4871
5073
|
},
|
|
4872
|
-
focusRing
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
}), color.default.
|
|
4877
|
-
width: input.border.width,
|
|
4878
|
-
color: color.default.readOnly.border
|
|
4879
|
-
}), color.default.readOnly.fg, color.default.disabled.bg, focusRingBorderStyle({
|
|
5074
|
+
focusRing: {
|
|
5075
|
+
width: 1,
|
|
5076
|
+
offset: 1
|
|
5077
|
+
}
|
|
5078
|
+
}), color.default.disabled.bg, focusRingBorderStyle({
|
|
4880
5079
|
width: input.border.width,
|
|
4881
5080
|
color: color.default.disabled.border
|
|
4882
|
-
}), color.default.disabled.fg
|
|
5081
|
+
}), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
|
|
5082
|
+
width: input.border.width,
|
|
5083
|
+
color: color.default.readOnly.border
|
|
5084
|
+
}), color.default.readOnly.fg, color.default.readOnly.bg2);
|
|
4883
5085
|
}
|
|
4884
5086
|
const Root$t = styled__default.default.div(checkboxBaseStyles);
|
|
4885
5087
|
const Input$5 = styled__default.default.input(inputElementStyles);
|
|
@@ -4907,6 +5109,7 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
4907
5109
|
style,
|
|
4908
5110
|
children: [/* @__PURE__ */jsxRuntime.jsx(Input$5, {
|
|
4909
5111
|
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
5112
|
+
"data-error": customValidity ? "" : void 0,
|
|
4910
5113
|
...restProps,
|
|
4911
5114
|
checked,
|
|
4912
5115
|
disabled: disabled || readOnly,
|
|
@@ -5241,7 +5444,7 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
|
|
|
5241
5444
|
}));
|
|
5242
5445
|
var _a$o;
|
|
5243
5446
|
function kbdStyle() {
|
|
5244
|
-
return styled.css(_a$o || (_a$o = __template$o(["\n background: var(--card-
|
|
5447
|
+
return styled.css(_a$o || (_a$o = __template$o(["\n background: var(--card-bg2-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
5245
5448
|
}
|
|
5246
5449
|
const Root$n = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
|
|
5247
5450
|
const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
@@ -5260,10 +5463,11 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
|
5260
5463
|
children: /* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
5261
5464
|
as: "span",
|
|
5262
5465
|
padding,
|
|
5263
|
-
children: /* @__PURE__ */jsxRuntime.jsx(
|
|
5466
|
+
children: /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
5264
5467
|
as: "span",
|
|
5265
5468
|
muted: true,
|
|
5266
5469
|
size: fontSize,
|
|
5470
|
+
weight: "medium",
|
|
5267
5471
|
children
|
|
5268
5472
|
})
|
|
5269
5473
|
})
|
|
@@ -5873,6 +6077,20 @@ const DEFAULT_POPOVER_PADDING = 4;
|
|
|
5873
6077
|
const DEFAULT_POPOVER_ARROW_WIDTH = 27;
|
|
5874
6078
|
const DEFAULT_POPOVER_ARROW_HEIGHT = 11;
|
|
5875
6079
|
const DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0];
|
|
6080
|
+
const DEFAULT_FALLBACK_PLACEMENTS$1 = {
|
|
6081
|
+
top: ["bottom", "left", "right"],
|
|
6082
|
+
"top-start": ["bottom-start", "left-start", "right-start"],
|
|
6083
|
+
"top-end": ["bottom-end", "left-end", "right-end"],
|
|
6084
|
+
bottom: ["top", "left", "right"],
|
|
6085
|
+
"bottom-start": ["top-start", "left-start", "right-start"],
|
|
6086
|
+
"bottom-end": ["top-end", "left-end", "right-end"],
|
|
6087
|
+
left: ["right", "top", "bottom"],
|
|
6088
|
+
"left-start": ["right-start", "top-start", "bottom-start"],
|
|
6089
|
+
"left-end": ["right-end", "top-end", "bottom-end"],
|
|
6090
|
+
right: ["left", "top", "bottom"],
|
|
6091
|
+
"right-start": ["left-start", "top-start", "bottom-start"],
|
|
6092
|
+
"right-end": ["left-end", "top-end", "bottom-end"]
|
|
6093
|
+
};
|
|
5876
6094
|
function size(options) {
|
|
5877
6095
|
const {
|
|
5878
6096
|
apply,
|
|
@@ -6072,7 +6290,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6072
6290
|
}));
|
|
6073
6291
|
PopoverCard.displayName = "PopoverCard";
|
|
6074
6292
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
6075
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
6293
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
6076
6294
|
const theme = useTheme();
|
|
6077
6295
|
const boundaryElementContext = useBoundaryElement();
|
|
6078
6296
|
const {
|
|
@@ -6083,9 +6301,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6083
6301
|
constrainSize = false,
|
|
6084
6302
|
content,
|
|
6085
6303
|
disabled,
|
|
6086
|
-
fallbackPlacements,
|
|
6304
|
+
fallbackPlacements = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS$1[(_a = props.placement) != null ? _a : "bottom"],
|
|
6087
6305
|
matchReferenceWidth,
|
|
6088
|
-
floatingBoundary = (
|
|
6306
|
+
floatingBoundary = (_c = props.boundaryElement) != null ? _c : boundaryElementContext.element,
|
|
6089
6307
|
open,
|
|
6090
6308
|
overflow = "hidden",
|
|
6091
6309
|
padding: paddingProp,
|
|
@@ -6093,17 +6311,17 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6093
6311
|
portal,
|
|
6094
6312
|
preventOverflow = true,
|
|
6095
6313
|
radius: radiusProp = 3,
|
|
6096
|
-
referenceBoundary = (
|
|
6314
|
+
referenceBoundary = (_d = props.boundaryElement) != null ? _d : boundaryElementContext.element,
|
|
6097
6315
|
referenceElement,
|
|
6098
6316
|
scheme,
|
|
6099
6317
|
shadow: shadowProp = 3,
|
|
6100
6318
|
tone = "inherit",
|
|
6101
6319
|
width: widthProp = "auto",
|
|
6102
|
-
zOffset: zOffsetProp = (
|
|
6320
|
+
zOffset: zOffsetProp = (_e = theme.sanity.layer) == null ? void 0 : _e.popover.zOffset,
|
|
6103
6321
|
updateRef,
|
|
6104
6322
|
...restProps
|
|
6105
6323
|
} = props;
|
|
6106
|
-
const boundarySize = (
|
|
6324
|
+
const boundarySize = (_f = useElementSize(boundaryElement)) == null ? void 0 : _f.border;
|
|
6107
6325
|
const padding = useArrayProp(paddingProp);
|
|
6108
6326
|
const radius = useArrayProp(radiusProp);
|
|
6109
6327
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -6222,9 +6440,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6222
6440
|
placement: placementProp,
|
|
6223
6441
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6224
6442
|
});
|
|
6225
|
-
const referenceHidden = (
|
|
6226
|
-
const arrowX = (
|
|
6227
|
-
const arrowY = (
|
|
6443
|
+
const referenceHidden = (_g = middlewareData.hide) == null ? void 0 : _g.referenceHidden;
|
|
6444
|
+
const arrowX = (_h = middlewareData.arrow) == null ? void 0 : _h.x;
|
|
6445
|
+
const arrowY = (_i = middlewareData.arrow) == null ? void 0 : _i.y;
|
|
6228
6446
|
const setArrow = react.useCallback(arrowEl => {
|
|
6229
6447
|
arrowRef.current = arrowEl;
|
|
6230
6448
|
}, []);
|
|
@@ -6311,15 +6529,17 @@ function inputElementStyle(props) {
|
|
|
6311
6529
|
theme
|
|
6312
6530
|
} = props;
|
|
6313
6531
|
const {
|
|
6314
|
-
focusRing,
|
|
6315
6532
|
input
|
|
6316
6533
|
} = theme.sanity;
|
|
6534
|
+
const {
|
|
6535
|
+
focusRing
|
|
6536
|
+
} = input.radio;
|
|
6317
6537
|
const color = theme.sanity.color.input;
|
|
6318
6538
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
6319
|
-
return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
|
|
6539
|
+
return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
|
|
6320
6540
|
color: color.default.enabled.border,
|
|
6321
6541
|
width: input.border.width
|
|
6322
|
-
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.
|
|
6542
|
+
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.bg2, focusRingStyle({
|
|
6323
6543
|
border: {
|
|
6324
6544
|
width: input.border.width,
|
|
6325
6545
|
color: color.default.enabled.border
|
|
@@ -6328,7 +6548,10 @@ function inputElementStyle(props) {
|
|
|
6328
6548
|
}), focusRingBorderStyle({
|
|
6329
6549
|
color: color.default.enabled.border,
|
|
6330
6550
|
width: input.border.width
|
|
6331
|
-
}), color.
|
|
6551
|
+
}), color.invalid.enabled.border, focusRingBorderStyle({
|
|
6552
|
+
width: input.border.width,
|
|
6553
|
+
color: color.invalid.enabled.bg2
|
|
6554
|
+
}), color.invalid.enabled.bg2, color.default.readOnly.border, color.default.readOnly.bg, color.default.readOnly.border, color.default.disabled.border, color.default.disabled.bg, color.default.disabled.border);
|
|
6332
6555
|
}
|
|
6333
6556
|
const Root$h = styled__default.default.div(radioBaseStyle);
|
|
6334
6557
|
const Input$4 = styled__default.default.input(inputElementStyle);
|
|
@@ -6349,6 +6572,7 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
|
|
|
6349
6572
|
style,
|
|
6350
6573
|
children: [/* @__PURE__ */jsxRuntime.jsx(Input$4, {
|
|
6351
6574
|
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
6575
|
+
"data-error": customValidity ? "" : void 0,
|
|
6352
6576
|
...restProps,
|
|
6353
6577
|
disabled: disabled || readOnly,
|
|
6354
6578
|
readOnly,
|
|
@@ -6378,9 +6602,11 @@ function inputColorStyle(props) {
|
|
|
6378
6602
|
theme
|
|
6379
6603
|
} = props;
|
|
6380
6604
|
const {
|
|
6381
|
-
focusRing,
|
|
6382
6605
|
input
|
|
6383
6606
|
} = theme.sanity;
|
|
6607
|
+
const {
|
|
6608
|
+
focusRing
|
|
6609
|
+
} = input.select;
|
|
6384
6610
|
const color = theme.sanity.color.input;
|
|
6385
6611
|
return styled.css(_c$7 || (_c$7 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
6386
6612
|
color: color.default.enabled.border,
|
|
@@ -6530,13 +6756,15 @@ function switchRepresentationStyles(props) {
|
|
|
6530
6756
|
theme
|
|
6531
6757
|
} = props;
|
|
6532
6758
|
const {
|
|
6533
|
-
focusRing,
|
|
6534
6759
|
input
|
|
6535
6760
|
} = theme.sanity;
|
|
6536
|
-
const
|
|
6537
|
-
|
|
6761
|
+
const {
|
|
6762
|
+
focusRing
|
|
6763
|
+
} = input.switch;
|
|
6764
|
+
const color = theme.sanity.color.input;
|
|
6765
|
+
return styled.css(_c$6 || (_c$6 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.border, color.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
|
|
6538
6766
|
focusRing
|
|
6539
|
-
}), color.
|
|
6767
|
+
}), color.default.enabled.bg, color.default.hovered.border, color.default.hovered.bg, color.default.enabled.bg, color.default.disabled.border, color.default.disabled.bg, color.default.readOnly.border, color.default.readOnly.bg);
|
|
6540
6768
|
}
|
|
6541
6769
|
function switchTrackStyles(props) {
|
|
6542
6770
|
const {
|
|
@@ -6562,7 +6790,7 @@ function switchThumbStyles(props) {
|
|
|
6562
6790
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
6563
6791
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
6564
6792
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
6565
|
-
return styled.css(_g || (_g = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
|
|
6793
|
+
return styled.css(_g || (_g = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
|
|
6566
6794
|
}
|
|
6567
6795
|
const Root$e = styled__default.default.span(switchBaseStyles);
|
|
6568
6796
|
const Input$2 = styled__default.default.input(switchInputStyles);
|
|
@@ -6846,6 +7074,20 @@ function useDelayedState(initialState) {
|
|
|
6846
7074
|
}, []);
|
|
6847
7075
|
return [state, onStateChange];
|
|
6848
7076
|
}
|
|
7077
|
+
const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
7078
|
+
top: ["bottom", "left", "right"],
|
|
7079
|
+
"top-start": ["bottom-start", "left-start", "right-start"],
|
|
7080
|
+
"top-end": ["bottom-end", "left-end", "right-end"],
|
|
7081
|
+
bottom: ["top", "left", "right"],
|
|
7082
|
+
"bottom-start": ["top-start", "left-start", "right-start"],
|
|
7083
|
+
"bottom-end": ["top-end", "left-end", "right-end"],
|
|
7084
|
+
left: ["right", "top", "bottom"],
|
|
7085
|
+
"left-start": ["right-start", "top-start", "bottom-start"],
|
|
7086
|
+
"left-end": ["right-end", "top-end", "bottom-end"],
|
|
7087
|
+
right: ["left", "top", "bottom"],
|
|
7088
|
+
"right-start": ["left-start", "top-start", "bottom-start"],
|
|
7089
|
+
"right-end": ["left-end", "top-end", "bottom-end"]
|
|
7090
|
+
};
|
|
6849
7091
|
var __freeze$f = Object.freeze;
|
|
6850
7092
|
var __defProp$f = Object.defineProperty;
|
|
6851
7093
|
var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
|
|
@@ -6917,7 +7159,7 @@ var __template$e = (cooked, raw) => __freeze$e(__defProp$e(cooked, "raw", {
|
|
|
6917
7159
|
var _a$e;
|
|
6918
7160
|
const Root$a = styled__default.default(Layer)(_a$e || (_a$e = __template$e(["\n pointer-events: none;\n"])));
|
|
6919
7161
|
const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
6920
|
-
var _a2, _b, _c;
|
|
7162
|
+
var _a2, _b, _c, _d, _e;
|
|
6921
7163
|
const boundaryElementContext = useBoundaryElement();
|
|
6922
7164
|
const theme = useTheme();
|
|
6923
7165
|
const {
|
|
@@ -6925,13 +7167,13 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6925
7167
|
children: childProp,
|
|
6926
7168
|
content,
|
|
6927
7169
|
disabled,
|
|
6928
|
-
fallbackPlacements: fallbackPlacementsProp,
|
|
6929
|
-
padding,
|
|
7170
|
+
fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
|
|
7171
|
+
padding = 3,
|
|
6930
7172
|
placement: placementProp = "bottom",
|
|
6931
7173
|
portal,
|
|
6932
7174
|
scheme,
|
|
6933
7175
|
shadow = 2,
|
|
6934
|
-
zOffset = (
|
|
7176
|
+
zOffset = (_c = theme.sanity.layer) == null ? void 0 : _c.tooltip.zOffset,
|
|
6935
7177
|
delay,
|
|
6936
7178
|
...restProps
|
|
6937
7179
|
} = props;
|
|
@@ -6991,8 +7233,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6991
7233
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6992
7234
|
});
|
|
6993
7235
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
6994
|
-
const arrowX = (
|
|
6995
|
-
const arrowY = (
|
|
7236
|
+
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
7237
|
+
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
6996
7238
|
const arrowStyle = react.useMemo(() => {
|
|
6997
7239
|
const style = {
|
|
6998
7240
|
left: arrowX !== null ? arrowX : void 0,
|
|
@@ -7092,7 +7334,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7092
7334
|
"data-ui": "Tooltip__card",
|
|
7093
7335
|
"data-placement": placement,
|
|
7094
7336
|
padding,
|
|
7095
|
-
radius:
|
|
7337
|
+
radius: 3,
|
|
7096
7338
|
scheme,
|
|
7097
7339
|
shadow,
|
|
7098
7340
|
children: [content, /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
|
|
@@ -8907,7 +9149,7 @@ const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
|
|
|
8907
9149
|
icon,
|
|
8908
9150
|
id,
|
|
8909
9151
|
focused,
|
|
8910
|
-
fontSize,
|
|
9152
|
+
fontSize = 1,
|
|
8911
9153
|
label,
|
|
8912
9154
|
onClick,
|
|
8913
9155
|
onFocus,
|
|
@@ -8947,6 +9189,7 @@ const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
|
|
|
8947
9189
|
onBlur: handleBlur,
|
|
8948
9190
|
onFocus: handleFocus,
|
|
8949
9191
|
padding,
|
|
9192
|
+
radius: "full",
|
|
8950
9193
|
ref: setRef,
|
|
8951
9194
|
role: "tab",
|
|
8952
9195
|
selected,
|