@sanity/ui 1.8.2 → 2.0.0-alpha.2

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +42 -11
  2. package/dist/index.esm.js +335 -116
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +334 -115
  5. package/dist/index.js.map +1 -1
  6. package/package.json +34 -16
  7. package/src/components/autocomplete/autocomplete.tsx +2 -1
  8. package/src/components/dialog/dialog.tsx +3 -3
  9. package/src/components/hotkeys/hotkeys.tsx +2 -1
  10. package/src/components/menu/menuButton.tsx +2 -2
  11. package/src/components/menu/menuGroup.tsx +2 -2
  12. package/src/components/tab/tab.tsx +2 -1
  13. package/src/primitives/avatar/styles.ts +1 -1
  14. package/src/primitives/button/button.tsx +6 -7
  15. package/src/primitives/button/styles.ts +20 -3
  16. package/src/primitives/card/styles.ts +1 -1
  17. package/src/primitives/checkbox/checkbox.tsx +1 -0
  18. package/src/primitives/checkbox/styles.ts +47 -17
  19. package/src/primitives/kbd/kbd.tsx +6 -6
  20. package/src/primitives/popover/popoverCard.tsx +2 -2
  21. package/src/primitives/radio/radio.tsx +1 -0
  22. package/src/primitives/radio/styles.ts +17 -4
  23. package/src/primitives/select/select.tsx +3 -2
  24. package/src/primitives/select/styles.ts +2 -1
  25. package/src/primitives/switch/__workshop__/props.tsx +4 -4
  26. package/src/primitives/switch/styles.ts +19 -12
  27. package/src/primitives/text/styles.ts +1 -0
  28. package/src/primitives/textInput/textInput.tsx +2 -1
  29. package/src/primitives/tooltip/tooltip.tsx +2 -2
  30. package/src/primitives/types.ts +3 -2
  31. package/src/styles/colorVars/colorVarsStyle.ts +2 -0
  32. package/src/styles/focusRing/index.ts +3 -1
  33. package/src/styles/input/textInputStyle.ts +2 -1
  34. package/src/styles/radius/radiusStyle.ts +14 -4
  35. package/src/styles/radius/types.ts +3 -1
  36. package/src/theme/lib/theme/avatar.ts +3 -0
  37. package/src/theme/lib/theme/color/_generic/types.ts +1 -0
  38. package/src/theme/lib/theme/color/color.test.ts +1 -0
  39. package/src/theme/lib/theme/color/defaults.ts +8 -0
  40. package/src/theme/lib/theme/color/input/types.ts +1 -0
  41. package/src/theme/lib/theme/input.ts +11 -0
  42. package/src/theme/lib/theme/theme.ts +7 -1
  43. package/src/theme/studioTheme/color.ts +82 -70
  44. package/src/theme/studioTheme/fonts.ts +3 -3
  45. package/src/theme/studioTheme/theme.ts +17 -3
  46. package/src/theme/studioTheme/tints.ts +152 -0
  47. package/src/theme/types.ts +8 -0
  48. package/src/types/index.ts +1 -0
  49. package/src/types/radius.ts +4 -0
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useCallback, cloneElement, isValidElement, createElement, Component, memo, useReducer, Children, Fragment as Fragment$1, startTransition } from 'react';
3
3
  import ReactIs, { isElement as isElement$1, isFragment, isValidElementType } from 'react-is';
4
4
  import styled, { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, keyframes } from 'styled-components';
5
- import { white as white$1, black as black$1, hues } from '@sanity/color';
5
+ import { black as black$1, hues, white as white$1 } from '@sanity/color';
6
6
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, SelectIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon } from '@sanity/icons';
7
7
  import Refractor from 'react-refractor';
8
8
  import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate, size as size$2 } from '@floating-ui/react-dom';
@@ -1243,6 +1243,7 @@ const defaultOpts = {
1243
1243
  bg2: dark ? color.light : color.dark,
1244
1244
  border: dark ? color.lighter : color.darker,
1245
1245
  fg: dark ? color.darkest : color.lightest,
1246
+ iconColor: dark ? color.darkest : color.lightest,
1246
1247
  muted: {
1247
1248
  fg: black
1248
1249
  },
@@ -1264,6 +1265,7 @@ const defaultOpts = {
1264
1265
  bg2: color.base,
1265
1266
  border: dark ? color.light : color.dark,
1266
1267
  fg: dark ? color.darkest : color.lightest,
1268
+ iconColor: dark ? color.darkest : color.lightest,
1267
1269
  muted: {
1268
1270
  fg: black
1269
1271
  },
@@ -1294,6 +1296,7 @@ const defaultOpts = {
1294
1296
  bg2: dark ? color.darker : color.lighter,
1295
1297
  border: dark ? color.lighter : color.darker,
1296
1298
  fg: dark ? color.lightest : color.darkest,
1299
+ iconColor: dark ? color.lightest : color.darkest,
1297
1300
  muted: {
1298
1301
  fg: black
1299
1302
  },
@@ -1315,6 +1318,7 @@ const defaultOpts = {
1315
1318
  bg2: dark ? color.darkest : color.lightest,
1316
1319
  border: dark ? color.darker : color.lighter,
1317
1320
  fg: dark ? color.lighter : color.darker,
1321
+ iconColor: dark ? color.lighter : color.darker,
1318
1322
  muted: {
1319
1323
  fg: black
1320
1324
  },
@@ -1345,6 +1349,7 @@ const defaultOpts = {
1345
1349
  bg: "transparent",
1346
1350
  bg2: "transparent",
1347
1351
  fg: muted.enabled.fg,
1352
+ iconColor: muted.enabled.fg,
1348
1353
  border: "transparent",
1349
1354
  muted: {
1350
1355
  fg: black
@@ -1365,6 +1370,7 @@ const defaultOpts = {
1365
1370
  bg: muted.enabled.bg,
1366
1371
  bg2: muted.enabled.bg,
1367
1372
  fg: muted.hovered.fg,
1373
+ iconColor: muted.hovered.fg,
1368
1374
  border: "transparent",
1369
1375
  muted: {
1370
1376
  fg: black
@@ -1397,6 +1403,7 @@ const defaultOpts = {
1397
1403
  bg: black,
1398
1404
  bg2: black,
1399
1405
  fg: black,
1406
+ iconColor: black,
1400
1407
  border: black,
1401
1408
  muted: {
1402
1409
  fg: black
@@ -1417,6 +1424,7 @@ const defaultOpts = {
1417
1424
  input: () => {
1418
1425
  return {
1419
1426
  bg: black,
1427
+ bg2: black,
1420
1428
  fg: black,
1421
1429
  border: black,
1422
1430
  placeholder: black
@@ -2157,11 +2165,115 @@ function screen(bg, fg) {
2157
2165
  const hex = rgbToHex(screen$1(b, s));
2158
2166
  return hex;
2159
2167
  }
2168
+ const defaultTints = {
2169
+ light: {
2170
+ text_primary: "900",
2171
+ text_secondary: "600",
2172
+ text_inactive: "500",
2173
+ bg_base: white$1,
2174
+ bg_base_hover: "50",
2175
+ bg_base_active: "100",
2176
+ bg_accent: "500",
2177
+ bg_accent_hover: "600",
2178
+ bg_accent_active: "700",
2179
+ bg_tint: "50",
2180
+ icon_default: "500",
2181
+ icon_inverted: white$1,
2182
+ border_base: "100",
2183
+ border_accent: "500",
2184
+ border_accent_inverted: white$1
2185
+ },
2186
+ dark: {
2187
+ text_primary: "50",
2188
+ text_secondary: "300",
2189
+ text_inactive: "400",
2190
+ bg_base: black$1,
2191
+ bg_base_hover: "900",
2192
+ bg_base_active: "800",
2193
+ bg_accent: "500",
2194
+ bg_accent_hover: "400",
2195
+ bg_accent_active: "300",
2196
+ bg_tint: "900",
2197
+ icon_default: "300",
2198
+ icon_inverted: hues.gray[900],
2199
+ border_base: "800",
2200
+ border_accent: "300",
2201
+ border_accent_inverted: hues.gray[900]
2202
+ }
2203
+ };
2204
+ const colorTints = {
2205
+ light: {
2206
+ default: {
2207
+ ...defaultTints.light,
2208
+ bg_accent: "900",
2209
+ bg_accent_hover: "950",
2210
+ bg_accent_active: black$1,
2211
+ border_accent: "600"
2212
+ },
2213
+ primary: {
2214
+ ...defaultTints.light,
2215
+ bg_accent: "900",
2216
+ bg_accent_hover: "950",
2217
+ bg_accent_active: black$1,
2218
+ border_accent: "600"
2219
+ },
2220
+ positive: {
2221
+ ...defaultTints.light,
2222
+ bg_base_hover: hues.gray[50],
2223
+ bg_base_active: "50",
2224
+ bg_accent: "400",
2225
+ bg_accent_hover: "500",
2226
+ bg_accent_active: "600",
2227
+ border_accent: "400"
2228
+ },
2229
+ transparent: defaultTints.light,
2230
+ caution: defaultTints.light,
2231
+ critical: defaultTints.light
2232
+ },
2233
+ dark: {
2234
+ default: {
2235
+ ...defaultTints.dark,
2236
+ text_primary: white$1,
2237
+ bg_accent: white$1,
2238
+ bg_accent_hover: "50",
2239
+ bg_accent_active: "100"
2240
+ },
2241
+ primary: {
2242
+ ...defaultTints.dark,
2243
+ text_primary: white$1,
2244
+ bg_accent: white$1,
2245
+ bg_accent_hover: "50",
2246
+ bg_accent_active: "100"
2247
+ },
2248
+ positive: {
2249
+ ...defaultTints.dark,
2250
+ bg_base_hover: hues.gray[900],
2251
+ bg_base_active: "900",
2252
+ bg_accent: "400",
2253
+ bg_accent_hover: "300",
2254
+ bg_accent_active: "200",
2255
+ border_accent: "400"
2256
+ },
2257
+ transparent: defaultTints.dark,
2258
+ caution: defaultTints.dark,
2259
+ critical: defaultTints.dark
2260
+ }
2261
+ };
2262
+ const getColorValue = (tints, dark, tone, key) => {
2263
+ const value = colorTints[dark ? "dark" : "light"][tone][key];
2264
+ if (typeof value === "string") {
2265
+ return tints[value];
2266
+ }
2267
+ return value;
2268
+ };
2269
+ const getColorHex = (tints, dark, tone, key) => {
2270
+ return getColorValue(tints, dark, tone, key).hex;
2271
+ };
2160
2272
  const tones = {
2161
2273
  default: hues.gray,
2162
2274
  transparent: hues.gray,
2163
- primary: hues.blue,
2164
- positive: hues.green,
2275
+ primary: hues.gray,
2276
+ positive: hues.cyan,
2165
2277
  caution: hues.yellow,
2166
2278
  critical: hues.red
2167
2279
  };
@@ -2177,9 +2289,9 @@ const color = createColorTheme({
2177
2289
  const skeletonFrom2 = dark ? tints2[900].hex : tints2[100].hex;
2178
2290
  return {
2179
2291
  fg: dark ? white$1.hex : black$1.hex,
2180
- bg: dark ? black$1.hex : white$1.hex,
2181
- border: tints2[dark ? 800 : 200].hex,
2182
- focusRing: hues.blue[dark ? 500 : 500].hex,
2292
+ bg: getColorHex(tones["default"], dark, "default", "bg_base"),
2293
+ border: getColorHex(tones["default"], dark, "default", "border_base"),
2294
+ focusRing: getColorHex(tones["positive"], dark, "positive", "border_accent"),
2183
2295
  shadow: {
2184
2296
  outline: rgba(tints2[500].hex, 0.4),
2185
2297
  umbra: dark ? rgba(tints2[950].hex, 0.4) : rgba(tints2[500].hex, 0.2),
@@ -2216,9 +2328,9 @@ const color = createColorTheme({
2216
2328
  const skeletonFrom = tints[dark ? 800 : 200].hex;
2217
2329
  return {
2218
2330
  fg: tints[dark ? 100 : 900].hex,
2219
- bg: tints[dark ? 950 : 50].hex,
2220
- border: tints[dark ? 800 : 200].hex,
2221
- focusRing: tints[500].hex,
2331
+ bg: getColorHex(tints, dark, name, "bg_base"),
2332
+ border: getColorHex(tints, dark, name, "border_base"),
2333
+ focusRing: getColorHex(tints, dark, name, "border_accent"),
2222
2334
  shadow: {
2223
2335
  outline: rgba(tints[500].hex, 0.4),
2224
2336
  umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
@@ -2246,13 +2358,14 @@ const color = createColorTheme({
2246
2358
  let tints = tones[tone === "default" ? name : tone] || defaultTints;
2247
2359
  if (state === "disabled") {
2248
2360
  tints = defaultTints;
2249
- const bg2 = mix(base.bg, tints[dark ? 800 : 200].hex);
2361
+ const bg2 = getColorHex(tones.default, dark, "default", "bg_tint");
2250
2362
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2251
2363
  return {
2252
2364
  bg: bg2,
2253
2365
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2254
- border: mix(base.bg, tints[dark ? 800 : 200].hex),
2255
- fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2366
+ border: getColorHex(tones.default, dark, "default", "bg_base"),
2367
+ fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2368
+ iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2256
2369
  muted: {
2257
2370
  fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2258
2371
  },
@@ -2273,13 +2386,14 @@ const color = createColorTheme({
2273
2386
  };
2274
2387
  }
2275
2388
  if (state === "hovered") {
2276
- const bg2 = mix(base.bg, tints[dark ? 300 : 600].hex);
2389
+ const bg2 = getColorHex(tints, dark, tone, "bg_accent_hover");
2277
2390
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2278
2391
  return {
2279
2392
  bg: bg2,
2280
2393
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2281
- border: mix(base.bg, tints[dark ? 300 : 600].hex),
2282
- fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2394
+ border: bg2,
2395
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2396
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2283
2397
  muted: {
2284
2398
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2285
2399
  },
@@ -2300,13 +2414,14 @@ const color = createColorTheme({
2300
2414
  };
2301
2415
  }
2302
2416
  if (state === "pressed") {
2303
- const bg2 = mix(base.bg, tints[dark ? 200 : 800].hex);
2304
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2417
+ const bg2 = getColorHex(tints, dark, tone, "bg_accent_active");
2418
+ const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 600].hex);
2305
2419
  return {
2306
- bg: mix(base.bg, tints[dark ? 200 : 800].hex),
2420
+ bg: bg2,
2307
2421
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2308
- border: mix(base.bg, tints[dark ? 200 : 800].hex),
2309
- fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2422
+ border: bg2,
2423
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2424
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2310
2425
  muted: {
2311
2426
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2312
2427
  },
@@ -2335,8 +2450,9 @@ const color = createColorTheme({
2335
2450
  return {
2336
2451
  bg: bg2,
2337
2452
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2338
- border: mix(base.bg, tints[dark ? 200 : 800].hex),
2339
- fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2453
+ border: bg2,
2454
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2455
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2340
2456
  muted: {
2341
2457
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2342
2458
  },
@@ -2356,13 +2472,14 @@ const color = createColorTheme({
2356
2472
  }
2357
2473
  };
2358
2474
  }
2359
- const bg = mix(base.bg, tints[dark ? 400 : 500].hex);
2475
+ const bg = getColorHex(tints, dark, tone, "bg_accent");
2360
2476
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex);
2361
2477
  return {
2362
2478
  bg,
2363
2479
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
2364
- border: mix(base.bg, tints[dark ? 400 : 500].hex),
2365
- fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2480
+ border: bg,
2481
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2482
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2366
2483
  muted: {
2367
2484
  fg: mix(base.bg, tints[dark ? 900 : 100].hex)
2368
2485
  },
@@ -2401,20 +2518,21 @@ const color = createColorTheme({
2401
2518
  return {
2402
2519
  bg: bg2,
2403
2520
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2404
- border: mix(bg2, tints[dark ? 950 : 50].hex),
2405
- fg: mix(bg2, tints[dark ? 800 : 200].hex),
2521
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2522
+ fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2523
+ iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2406
2524
  muted: {
2407
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2525
+ fg: getColorHex(tones.default, dark, "default", "text_inactive")
2408
2526
  },
2409
2527
  accent: {
2410
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2528
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2411
2529
  },
2412
2530
  link: {
2413
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2531
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2414
2532
  },
2415
2533
  code: {
2416
2534
  bg: bg2,
2417
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2535
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2418
2536
  },
2419
2537
  skeleton: {
2420
2538
  from: rgba(skeletonFrom2, 0.5),
@@ -2423,15 +2541,16 @@ const color = createColorTheme({
2423
2541
  };
2424
2542
  }
2425
2543
  if (state === "hovered") {
2426
- const bg2 = mix(base.bg, tints[dark ? 950 : 50].hex);
2544
+ const bg2 = getColorHex(tints, dark, name, "bg_base_hover");
2427
2545
  const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2428
2546
  return {
2429
2547
  bg: bg2,
2430
2548
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2431
2549
  border: mix(bg2, tints[dark ? 900 : 100].hex),
2432
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2550
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2551
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2433
2552
  muted: {
2434
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2553
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2435
2554
  },
2436
2555
  accent: {
2437
2556
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex)
@@ -2441,7 +2560,7 @@ const color = createColorTheme({
2441
2560
  },
2442
2561
  code: {
2443
2562
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2444
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2563
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2445
2564
  },
2446
2565
  skeleton: {
2447
2566
  from: skeletonFrom2,
@@ -2453,15 +2572,16 @@ const color = createColorTheme({
2453
2572
  if (isNeutral) {
2454
2573
  tints = tones.primary;
2455
2574
  }
2456
- const bg2 = mix(base.bg, tints[dark ? 900 : 100].hex);
2457
- const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2575
+ const bg2 = getColorHex(tints, dark, name, "bg_base_active");
2576
+ const skeletonFrom2 = mix(bg2, getColorHex(tints, dark, name, "bg_base_active"));
2458
2577
  return {
2459
2578
  bg: bg2,
2460
2579
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2461
- border: mix(bg2, tints[dark ? 900 : 100].hex),
2462
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2580
+ border: getColorHex(tints, dark, name, "border_base"),
2581
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2582
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2463
2583
  muted: {
2464
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2584
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2465
2585
  },
2466
2586
  accent: {
2467
2587
  fg: mix(bg2, hues.red[dark ? 400 : 500].hex)
@@ -2471,7 +2591,7 @@ const color = createColorTheme({
2471
2591
  },
2472
2592
  code: {
2473
2593
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2474
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2594
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2475
2595
  },
2476
2596
  skeleton: {
2477
2597
  from: skeletonFrom2,
@@ -2488,10 +2608,11 @@ const color = createColorTheme({
2488
2608
  return {
2489
2609
  bg: bg2,
2490
2610
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2491
- border: mix(bg2, tints[dark ? 900 : 100].hex),
2492
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2611
+ border: getColorHex(tints, dark, name, "border_base"),
2612
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2613
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2493
2614
  muted: {
2494
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2615
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2495
2616
  },
2496
2617
  accent: {
2497
2618
  fg: mix(bg2, hues.red[dark ? 400 : 500].hex)
@@ -2501,7 +2622,7 @@ const color = createColorTheme({
2501
2622
  },
2502
2623
  code: {
2503
2624
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2504
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2625
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2505
2626
  },
2506
2627
  skeleton: {
2507
2628
  from: skeletonFrom2,
@@ -2514,10 +2635,11 @@ const color = createColorTheme({
2514
2635
  return {
2515
2636
  bg,
2516
2637
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
2517
- border: mix(bg, tints[dark ? 900 : 100].hex),
2518
- fg: mix(base.bg, tints[dark ? 300 : 700].hex),
2638
+ border: mix(bg, getColorHex(tints, dark, name, "bg_base")),
2639
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2640
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2519
2641
  muted: {
2520
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2642
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2521
2643
  },
2522
2644
  accent: {
2523
2645
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex)
@@ -2527,7 +2649,7 @@ const color = createColorTheme({
2527
2649
  },
2528
2650
  code: {
2529
2651
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2530
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2652
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2531
2653
  },
2532
2654
  skeleton: {
2533
2655
  from: skeletonFrom,
@@ -2568,12 +2690,11 @@ const color = createColorTheme({
2568
2690
  }
2569
2691
  if (mode === "ghost") {
2570
2692
  return {
2571
- ...solid,
2693
+ ...muted,
2572
2694
  enabled: {
2573
2695
  ...muted.enabled,
2574
2696
  border: base.border
2575
- },
2576
- disabled: muted.disabled
2697
+ }
2577
2698
  };
2578
2699
  }
2579
2700
  return solid;
@@ -2614,6 +2735,7 @@ const color = createColorTheme({
2614
2735
  bg,
2615
2736
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
2616
2737
  fg: base.fg,
2738
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2617
2739
  border: base.border,
2618
2740
  muted: {
2619
2741
  fg: mix(base.bg, tints[dark ? 400 : 600].hex)
@@ -2646,40 +2768,45 @@ const color = createColorTheme({
2646
2768
  const tints = tones.critical;
2647
2769
  return {
2648
2770
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2771
+ bg2: getColorHex(tints, dark, "critical", "text_secondary"),
2649
2772
  fg: mix(base.bg, tints[dark ? 400 : 600].hex),
2650
- border: mix(base.bg, tints[dark ? 800 : 200].hex),
2651
- placeholder: mix(base.bg, tints[dark ? 600 : 400].hex)
2773
+ border: getColorHex(tints, dark, "critical", "border_base"),
2774
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2652
2775
  };
2653
2776
  }
2654
2777
  if (state === "hovered") {
2655
2778
  return {
2656
2779
  bg: base.bg,
2780
+ bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2657
2781
  fg: base.fg,
2658
2782
  border: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
2659
- placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2783
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2660
2784
  };
2661
2785
  }
2662
2786
  if (state === "disabled") {
2663
2787
  return {
2664
- bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
2665
- fg: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
2666
- border: mix(base.bg, hues.gray[dark ? 900 : 100].hex),
2667
- placeholder: mix(base.bg, hues.gray[dark ? 800 : 200].hex)
2788
+ bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2789
+ bg2: getColorHex(tones.default, dark, "default", "border_base"),
2790
+ fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2791
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2792
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2668
2793
  };
2669
2794
  }
2670
2795
  if (state === "readOnly") {
2671
2796
  return {
2672
- bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
2673
- fg: mix(base.bg, hues.gray[dark ? 200 : 800].hex),
2674
- border: mix(base.bg, hues.gray[dark ? 800 : 200].hex),
2675
- placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2797
+ bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2798
+ bg2: getColorHex(tones.default, dark, "default", "border_base"),
2799
+ fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2800
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2801
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2676
2802
  };
2677
2803
  }
2678
2804
  return {
2679
2805
  bg: base.bg,
2806
+ bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2680
2807
  fg: base.fg,
2681
2808
  border: base.border,
2682
- placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2809
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2683
2810
  };
2684
2811
  },
2685
2812
  selectable: _ref17 => {
@@ -2820,7 +2947,7 @@ const fonts = {
2820
2947
  }]
2821
2948
  },
2822
2949
  heading: {
2823
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2950
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2824
2951
  weights: {
2825
2952
  regular: 700,
2826
2953
  medium: 800,
@@ -2872,7 +2999,7 @@ const fonts = {
2872
2999
  }]
2873
3000
  },
2874
3001
  label: {
2875
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
3002
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
2876
3003
  weights: {
2877
3004
  regular: 600,
2878
3005
  medium: 700,
@@ -2917,7 +3044,7 @@ const fonts = {
2917
3044
  }]
2918
3045
  },
2919
3046
  text: {
2920
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
3047
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2921
3048
  weights: {
2922
3049
  regular: 400,
2923
3050
  medium: 500,
@@ -2973,10 +3100,24 @@ const studioTheme = {
2973
3100
  }, {
2974
3101
  distance: -9,
2975
3102
  size: 55
2976
- }]
3103
+ }],
3104
+ focusRing: {
3105
+ offset: 1,
3106
+ width: 1
3107
+ }
2977
3108
  },
2978
3109
  button: {
2979
- textWeight: "medium"
3110
+ textWeight: "medium",
3111
+ focusRing: {
3112
+ offset: -1,
3113
+ width: 2
3114
+ }
3115
+ },
3116
+ card: {
3117
+ focusRing: {
3118
+ offset: -1,
3119
+ width: 1
3120
+ }
2980
3121
  },
2981
3122
  color,
2982
3123
  container: [320, 640, 960, 1280, 1600, 1920],
@@ -3011,21 +3152,45 @@ const studioTheme = {
3011
3152
  space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
3012
3153
  input: {
3013
3154
  checkbox: {
3014
- size: 17
3155
+ size: 17,
3156
+ focusRing: {
3157
+ offset: -1,
3158
+ width: 1
3159
+ }
3015
3160
  },
3016
3161
  radio: {
3017
3162
  size: 17,
3018
- markSize: 9
3163
+ markSize: 9,
3164
+ focusRing: {
3165
+ offset: -1,
3166
+ width: 1
3167
+ }
3019
3168
  },
3020
3169
  switch: {
3021
- width: 33,
3022
- height: 17,
3023
- padding: 4,
3170
+ width: 21,
3171
+ height: 13,
3172
+ padding: 2,
3024
3173
  transitionDurationMs: 150,
3025
- transitionTimingFunction: "ease-out"
3174
+ transitionTimingFunction: "ease-out",
3175
+ focusRing: {
3176
+ offset: 1,
3177
+ width: 1
3178
+ }
3026
3179
  },
3027
3180
  border: {
3028
3181
  width: 1
3182
+ },
3183
+ select: {
3184
+ focusRing: {
3185
+ offset: -1,
3186
+ width: 1
3187
+ }
3188
+ },
3189
+ text: {
3190
+ focusRing: {
3191
+ offset: -1,
3192
+ width: 1
3193
+ }
3029
3194
  }
3030
3195
  }
3031
3196
  // styles: {
@@ -3828,9 +3993,11 @@ function textInputRepresentationStyle(props) {
3828
3993
  theme
3829
3994
  } = props;
3830
3995
  const {
3831
- focusRing,
3832
3996
  input
3833
3997
  } = theme.sanity;
3998
+ const {
3999
+ focusRing
4000
+ } = input.text;
3834
4001
  const color = theme.sanity.color.input;
3835
4002
  return 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({
3836
4003
  color: color.default.enabled.border,
@@ -3874,9 +4041,18 @@ function responsiveRadiusStyle(props) {
3874
4041
  media,
3875
4042
  radius
3876
4043
  } = theme.sanity;
3877
- return _responsive(media, props.$radius, radiusIndex => ({
3878
- borderRadius: rem(radius[radiusIndex])
3879
- }));
4044
+ return _responsive(media, props.$radius, value => {
4045
+ let borderRadius = 0;
4046
+ if (typeof value === "number") {
4047
+ borderRadius = rem(radius[value]);
4048
+ }
4049
+ if (value === "full") {
4050
+ borderRadius = "9999px";
4051
+ }
4052
+ return {
4053
+ borderRadius
4054
+ };
4055
+ });
3880
4056
  }
3881
4057
  function toBoxShadow(shadow, color) {
3882
4058
  return "".concat(shadow.map(rem).join(" "), " ").concat(color);
@@ -3916,7 +4092,7 @@ function textBaseStyle(props) {
3916
4092
  const {
3917
4093
  weights
3918
4094
  } = theme.sanity.fonts.text;
3919
- return 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 && css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
4095
+ return 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 && css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
3920
4096
  }
3921
4097
  var __freeze$B = Object.freeze;
3922
4098
  var __defProp$C = Object.defineProperty;
@@ -4009,7 +4185,7 @@ function avatarRootStyle(props) {
4009
4185
  } = props;
4010
4186
  const {
4011
4187
  focusRing
4012
- } = theme.sanity;
4188
+ } = theme.sanity.avatar;
4013
4189
  return {
4014
4190
  backgroundColor: $color,
4015
4191
  position: "relative",
@@ -4560,8 +4736,10 @@ function _colorVarsStyle(base, color) {
4560
4736
  "--card-shadow-penumbra-color": base.shadow.penumbra,
4561
4737
  "--card-shadow-ambient-color": base.shadow.ambient,
4562
4738
  "--card-focus-ring-color": base.focusRing,
4739
+ "--card-icon-color": color.iconColor,
4563
4740
  // Card
4564
4741
  "--card-bg-color": color.bg,
4742
+ "--card-bg2-color": color.bg2,
4565
4743
  "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
4566
4744
  "--card-fg-color": color.fg,
4567
4745
  "--card-border-color": color.border,
@@ -4592,6 +4770,13 @@ const buttonTheme = {
4592
4770
  width: 1
4593
4771
  }
4594
4772
  };
4773
+ const defaultBoxShadow = "0px 2px 0px 0px rgba(112, 128, 155, 0.19);";
4774
+ function combineBoxShadow() {
4775
+ for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
4776
+ boxShadows[_key] = arguments[_key];
4777
+ }
4778
+ return boxShadows.filter(Boolean).join(",");
4779
+ }
4595
4780
  function buttonColorStyles(props) {
4596
4781
  var _a2, _b;
4597
4782
  const {
@@ -4600,7 +4785,8 @@ function buttonColorStyles(props) {
4600
4785
  } = props;
4601
4786
  const {
4602
4787
  focusRing
4603
- } = theme.sanity;
4788
+ } = theme.sanity.button;
4789
+ const shadow = props.$mode !== "bleed";
4604
4790
  const base = theme.sanity.color.base;
4605
4791
  const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
4606
4792
  const color = mode[props.$tone] || mode.default;
@@ -4614,15 +4800,19 @@ function buttonColorStyles(props) {
4614
4800
  boxShadow: focusRingBorderStyle(border),
4615
4801
  '&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
4616
4802
  "&:not([data-disabled='true'])": {
4803
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
4617
4804
  "&:focus": {
4618
4805
  boxShadow: focusRingStyle({
4619
4806
  base,
4620
- border,
4807
+ border: {
4808
+ width: 2,
4809
+ color: base.bg
4810
+ },
4621
4811
  focusRing
4622
4812
  })
4623
4813
  },
4624
4814
  "&:focus:not(:focus-visible)": {
4625
- boxShadow: focusRingBorderStyle(border)
4815
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
4626
4816
  },
4627
4817
  "@media (hover: hover)": {
4628
4818
  "&:hover": _colorVarsStyle(base, color.hovered),
@@ -4645,7 +4835,7 @@ const Button = forwardRef(function Button2(props, ref) {
4645
4835
  const {
4646
4836
  children,
4647
4837
  disabled,
4648
- fontSize,
4838
+ fontSize = 1,
4649
4839
  icon,
4650
4840
  iconRight,
4651
4841
  justify: justifyProp = "center",
@@ -4665,6 +4855,7 @@ const Button = forwardRef(function Button2(props, ref) {
4665
4855
  textAlign,
4666
4856
  tone = "default",
4667
4857
  type = "button",
4858
+ muted = false,
4668
4859
  ...restProps
4669
4860
  } = props;
4670
4861
  const justify = useArrayProp(justifyProp);
@@ -4707,14 +4898,14 @@ const Button = forwardRef(function Button2(props, ref) {
4707
4898
  children: /* @__PURE__ */jsxs(Flex, {
4708
4899
  as: "span",
4709
4900
  justify,
4901
+ gap: space,
4710
4902
  children: [icon && /* @__PURE__ */jsxs(Text, {
4711
4903
  size: fontSize,
4712
4904
  children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
4713
4905
  }), text && /* @__PURE__ */jsx(Box, {
4714
4906
  flex: iconRight ? 1 : void 0,
4715
- marginLeft: icon ? space : void 0,
4716
- marginRight: iconRight ? space : void 0,
4717
4907
  children: /* @__PURE__ */jsx(Text, {
4908
+ muted,
4718
4909
  align: textAlign,
4719
4910
  size: fontSize,
4720
4911
  textOverflow: "ellipsis",
@@ -4759,7 +4950,7 @@ function cardColorStyle(props) {
4759
4950
  } = props;
4760
4951
  const {
4761
4952
  focusRing
4762
- } = theme.sanity;
4953
+ } = theme.sanity.card;
4763
4954
  const {
4764
4955
  base,
4765
4956
  card,
@@ -4844,29 +5035,44 @@ function inputElementStyles(props) {
4844
5035
  } = props;
4845
5036
  const color = theme.sanity.color.input;
4846
5037
  const {
4847
- focusRing,
4848
5038
  input,
4849
5039
  radius
4850
5040
  } = theme.sanity;
4851
- return 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: 2 !important;\n }\n }\n }\n\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 > svg:first-child {\n opacity: 1;\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &:not([data-read-only]):disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
5041
+ const {
5042
+ focusRing
5043
+ } = input.checkbox;
5044
+ return 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({
4852
5045
  color: color.default.enabled.border,
4853
5046
  width: input.border.width
4854
- }), rem(radius[2]), color.default.enabled.bg, focusRingStyle({
5047
+ }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
5048
+ color: color.default.enabled.bg2,
5049
+ width: input.border.width
5050
+ }), color.default.enabled.bg, focusRingStyle({
5051
+ focusRing
5052
+ }), focusRingStyle({
5053
+ focusRing: {
5054
+ width: 1,
5055
+ offset: 1
5056
+ }
5057
+ }), color.invalid.enabled.border, focusRingBorderStyle({
5058
+ width: input.border.width,
5059
+ color: color.invalid.enabled.bg2
5060
+ }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
4855
5061
  border: {
4856
5062
  width: input.border.width,
4857
- color: color.default.enabled.border
5063
+ color: color.invalid.readOnly.bg2
4858
5064
  },
4859
- focusRing
4860
- }), focusRingBorderStyle({
4861
- color: color.default.enabled.border,
4862
- width: input.border.width
4863
- }), color.default.readOnly.bg, focusRingBorderStyle({
4864
- width: input.border.width,
4865
- color: color.default.readOnly.border
4866
- }), color.default.readOnly.fg, color.default.disabled.bg, focusRingBorderStyle({
5065
+ focusRing: {
5066
+ width: 1,
5067
+ offset: 1
5068
+ }
5069
+ }), color.default.disabled.bg, focusRingBorderStyle({
4867
5070
  width: input.border.width,
4868
5071
  color: color.default.disabled.border
4869
- }), color.default.disabled.fg);
5072
+ }), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
5073
+ width: input.border.width,
5074
+ color: color.default.readOnly.border
5075
+ }), color.default.readOnly.fg, color.default.readOnly.bg2);
4870
5076
  }
4871
5077
  const Root$t = styled.div(checkboxBaseStyles);
4872
5078
  const Input$5 = styled.input(inputElementStyles);
@@ -4894,6 +5100,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
4894
5100
  style,
4895
5101
  children: [/* @__PURE__ */jsx(Input$5, {
4896
5102
  "data-read-only": !disabled && readOnly ? "" : void 0,
5103
+ "data-error": customValidity ? "" : void 0,
4897
5104
  ...restProps,
4898
5105
  checked,
4899
5106
  disabled: disabled || readOnly,
@@ -5228,7 +5435,7 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5228
5435
  }));
5229
5436
  var _a$o;
5230
5437
  function kbdStyle() {
5231
- return css(_a$o || (_a$o = __template$o(["\n background: var(--card-bg-color);\n font: inherit;\n box-shadow: inset 0 0 0 1px var(--card-hairline-hard-color);\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
5438
+ return 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 "])));
5232
5439
  }
5233
5440
  const Root$n = styled.kbd(responsiveRadiusStyle, kbdStyle);
5234
5441
  const KBD = forwardRef(function KBD2(props, ref) {
@@ -5247,10 +5454,11 @@ const KBD = forwardRef(function KBD2(props, ref) {
5247
5454
  children: /* @__PURE__ */jsx(Box, {
5248
5455
  as: "span",
5249
5456
  padding,
5250
- children: /* @__PURE__ */jsx(Code, {
5457
+ children: /* @__PURE__ */jsx(Text, {
5251
5458
  as: "span",
5252
5459
  muted: true,
5253
5460
  size: fontSize,
5461
+ weight: "medium",
5254
5462
  children
5255
5463
  })
5256
5464
  })
@@ -6312,15 +6520,17 @@ function inputElementStyle(props) {
6312
6520
  theme
6313
6521
  } = props;
6314
6522
  const {
6315
- focusRing,
6316
6523
  input
6317
6524
  } = theme.sanity;
6525
+ const {
6526
+ focusRing
6527
+ } = input.radio;
6318
6528
  const color = theme.sanity.color.input;
6319
6529
  const dist = (input.radio.size - input.radio.markSize) / 2;
6320
- return 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({
6530
+ return 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({
6321
6531
  color: color.default.enabled.border,
6322
6532
  width: input.border.width
6323
- }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
6533
+ }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.bg2, focusRingStyle({
6324
6534
  border: {
6325
6535
  width: input.border.width,
6326
6536
  color: color.default.enabled.border
@@ -6329,7 +6539,10 @@ function inputElementStyle(props) {
6329
6539
  }), focusRingBorderStyle({
6330
6540
  color: color.default.enabled.border,
6331
6541
  width: input.border.width
6332
- }), color.default.readOnly.border, color.default.readOnly.bg, color.default.readOnly.fg, color.default.disabled.border, color.default.disabled.bg, color.default.disabled.fg);
6542
+ }), color.invalid.enabled.border, focusRingBorderStyle({
6543
+ width: input.border.width,
6544
+ color: color.invalid.enabled.bg2
6545
+ }), 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);
6333
6546
  }
6334
6547
  const Root$h = styled.div(radioBaseStyle);
6335
6548
  const Input$4 = styled.input(inputElementStyle);
@@ -6350,6 +6563,7 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
6350
6563
  style,
6351
6564
  children: [/* @__PURE__ */jsx(Input$4, {
6352
6565
  "data-read-only": !disabled && readOnly ? "" : void 0,
6566
+ "data-error": customValidity ? "" : void 0,
6353
6567
  ...restProps,
6354
6568
  disabled: disabled || readOnly,
6355
6569
  readOnly,
@@ -6379,9 +6593,11 @@ function inputColorStyle(props) {
6379
6593
  theme
6380
6594
  } = props;
6381
6595
  const {
6382
- focusRing,
6383
6596
  input
6384
6597
  } = theme.sanity;
6598
+ const {
6599
+ focusRing
6600
+ } = input.select;
6385
6601
  const color = theme.sanity.color.input;
6386
6602
  return 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({
6387
6603
  color: color.default.enabled.border,
@@ -6531,13 +6747,15 @@ function switchRepresentationStyles(props) {
6531
6747
  theme
6532
6748
  } = props;
6533
6749
  const {
6534
- focusRing,
6535
6750
  input
6536
6751
  } = theme.sanity;
6537
- const color = theme.sanity.color.button.default;
6538
- return 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: ", ";\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: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
6752
+ const {
6753
+ focusRing
6754
+ } = input.switch;
6755
+ const color = theme.sanity.color.input;
6756
+ return 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({
6539
6757
  focusRing
6540
- }), color.positive.enabled.bg, color.positive.enabled.fg, color.default.hovered.bg, color.default.hovered.fg, color.positive.hovered.bg, color.positive.hovered.fg, color.default.disabled.bg, color.default.disabled.fg);
6758
+ }), 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);
6541
6759
  }
6542
6760
  function switchTrackStyles(props) {
6543
6761
  const {
@@ -6563,7 +6781,7 @@ function switchThumbStyles(props) {
6563
6781
  const checkedOffset = trackWidth - trackPadding * 2 - size;
6564
6782
  const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
6565
6783
  const checked = $indeterminate !== true && props.$checked === true;
6566
- return 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 && css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
6784
+ return 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 && css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
6567
6785
  }
6568
6786
  const Root$e = styled.span(switchBaseStyles);
6569
6787
  const Input$2 = styled.input(switchInputStyles);
@@ -6941,7 +7159,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
6941
7159
  content,
6942
7160
  disabled,
6943
7161
  fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
6944
- padding,
7162
+ padding = 3,
6945
7163
  placement: placementProp = "bottom",
6946
7164
  portal,
6947
7165
  scheme,
@@ -7107,7 +7325,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
7107
7325
  "data-ui": "Tooltip__card",
7108
7326
  "data-placement": placement,
7109
7327
  padding,
7110
- radius: 2,
7328
+ radius: 3,
7111
7329
  scheme,
7112
7330
  shadow,
7113
7331
  children: [content, /* @__PURE__ */jsx(TooltipArrow, {
@@ -8922,7 +9140,7 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
8922
9140
  icon,
8923
9141
  id,
8924
9142
  focused,
8925
- fontSize,
9143
+ fontSize = 1,
8926
9144
  label,
8927
9145
  onClick,
8928
9146
  onFocus,
@@ -8962,6 +9180,7 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
8962
9180
  onBlur: handleBlur,
8963
9181
  onFocus: handleFocus,
8964
9182
  padding,
9183
+ radius: "full",
8965
9184
  ref: setRef,
8966
9185
  role: "tab",
8967
9186
  selected,