@sanity/ui 1.8.2 → 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.
Files changed (49) hide show
  1. package/dist/index.d.ts +40 -14
  2. package/dist/index.esm.js +335 -120
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +334 -119
  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 +5 -4
  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 -7
  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,17 +3100,27 @@ 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],
2983
- focusRing: {
2984
- offset: 1,
2985
- width: 2
2986
- },
2987
3124
  fonts,
2988
3125
  media: [360, 600, 900, 1200, 1800, 2400],
2989
3126
  radius: [0, 1, 3, 6, 9, 12, 21],
@@ -3011,21 +3148,45 @@ const studioTheme = {
3011
3148
  space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
3012
3149
  input: {
3013
3150
  checkbox: {
3014
- size: 17
3151
+ size: 17,
3152
+ focusRing: {
3153
+ offset: -1,
3154
+ width: 1
3155
+ }
3015
3156
  },
3016
3157
  radio: {
3017
3158
  size: 17,
3018
- markSize: 9
3159
+ markSize: 9,
3160
+ focusRing: {
3161
+ offset: -1,
3162
+ width: 1
3163
+ }
3019
3164
  },
3020
3165
  switch: {
3021
- width: 33,
3022
- height: 17,
3023
- padding: 4,
3166
+ width: 21,
3167
+ height: 13,
3168
+ padding: 2,
3024
3169
  transitionDurationMs: 150,
3025
- transitionTimingFunction: "ease-out"
3170
+ transitionTimingFunction: "ease-out",
3171
+ focusRing: {
3172
+ offset: 1,
3173
+ width: 1
3174
+ }
3026
3175
  },
3027
3176
  border: {
3028
3177
  width: 1
3178
+ },
3179
+ select: {
3180
+ focusRing: {
3181
+ offset: -1,
3182
+ width: 1
3183
+ }
3184
+ },
3185
+ text: {
3186
+ focusRing: {
3187
+ offset: -1,
3188
+ width: 1
3189
+ }
3029
3190
  }
3030
3191
  }
3031
3192
  // styles: {
@@ -3828,9 +3989,11 @@ function textInputRepresentationStyle(props) {
3828
3989
  theme
3829
3990
  } = props;
3830
3991
  const {
3831
- focusRing,
3832
3992
  input
3833
3993
  } = theme.sanity;
3994
+ const {
3995
+ focusRing
3996
+ } = input.text;
3834
3997
  const color = theme.sanity.color.input;
3835
3998
  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
3999
  color: color.default.enabled.border,
@@ -3874,9 +4037,18 @@ function responsiveRadiusStyle(props) {
3874
4037
  media,
3875
4038
  radius
3876
4039
  } = theme.sanity;
3877
- return _responsive(media, props.$radius, radiusIndex => ({
3878
- borderRadius: rem(radius[radiusIndex])
3879
- }));
4040
+ return _responsive(media, props.$radius, value => {
4041
+ let borderRadius = 0;
4042
+ if (typeof value === "number") {
4043
+ borderRadius = rem(radius[value]);
4044
+ }
4045
+ if (value === "full") {
4046
+ borderRadius = "9999px";
4047
+ }
4048
+ return {
4049
+ borderRadius
4050
+ };
4051
+ });
3880
4052
  }
3881
4053
  function toBoxShadow(shadow, color) {
3882
4054
  return "".concat(shadow.map(rem).join(" "), " ").concat(color);
@@ -3916,7 +4088,7 @@ function textBaseStyle(props) {
3916
4088
  const {
3917
4089
  weights
3918
4090
  } = 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);
4091
+ 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
4092
  }
3921
4093
  var __freeze$B = Object.freeze;
3922
4094
  var __defProp$C = Object.defineProperty;
@@ -4009,7 +4181,7 @@ function avatarRootStyle(props) {
4009
4181
  } = props;
4010
4182
  const {
4011
4183
  focusRing
4012
- } = theme.sanity;
4184
+ } = theme.sanity.avatar;
4013
4185
  return {
4014
4186
  backgroundColor: $color,
4015
4187
  position: "relative",
@@ -4560,8 +4732,10 @@ function _colorVarsStyle(base, color) {
4560
4732
  "--card-shadow-penumbra-color": base.shadow.penumbra,
4561
4733
  "--card-shadow-ambient-color": base.shadow.ambient,
4562
4734
  "--card-focus-ring-color": base.focusRing,
4735
+ "--card-icon-color": color.iconColor,
4563
4736
  // Card
4564
4737
  "--card-bg-color": color.bg,
4738
+ "--card-bg2-color": color.bg2,
4565
4739
  "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
4566
4740
  "--card-fg-color": color.fg,
4567
4741
  "--card-border-color": color.border,
@@ -4592,6 +4766,13 @@ const buttonTheme = {
4592
4766
  width: 1
4593
4767
  }
4594
4768
  };
4769
+ const defaultBoxShadow = "0px 2px 0px 0px rgba(112, 128, 155, 0.19);";
4770
+ function combineBoxShadow() {
4771
+ for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
4772
+ boxShadows[_key] = arguments[_key];
4773
+ }
4774
+ return boxShadows.filter(Boolean).join(",");
4775
+ }
4595
4776
  function buttonColorStyles(props) {
4596
4777
  var _a2, _b;
4597
4778
  const {
@@ -4600,7 +4781,8 @@ function buttonColorStyles(props) {
4600
4781
  } = props;
4601
4782
  const {
4602
4783
  focusRing
4603
- } = theme.sanity;
4784
+ } = theme.sanity.button;
4785
+ const shadow = props.$mode !== "bleed";
4604
4786
  const base = theme.sanity.color.base;
4605
4787
  const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
4606
4788
  const color = mode[props.$tone] || mode.default;
@@ -4614,15 +4796,19 @@ function buttonColorStyles(props) {
4614
4796
  boxShadow: focusRingBorderStyle(border),
4615
4797
  '&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
4616
4798
  "&:not([data-disabled='true'])": {
4799
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
4617
4800
  "&:focus": {
4618
4801
  boxShadow: focusRingStyle({
4619
4802
  base,
4620
- border,
4803
+ border: {
4804
+ width: 2,
4805
+ color: base.bg
4806
+ },
4621
4807
  focusRing
4622
4808
  })
4623
4809
  },
4624
4810
  "&:focus:not(:focus-visible)": {
4625
- boxShadow: focusRingBorderStyle(border)
4811
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
4626
4812
  },
4627
4813
  "@media (hover: hover)": {
4628
4814
  "&:hover": _colorVarsStyle(base, color.hovered),
@@ -4645,7 +4831,7 @@ const Button = forwardRef(function Button2(props, ref) {
4645
4831
  const {
4646
4832
  children,
4647
4833
  disabled,
4648
- fontSize,
4834
+ fontSize = 1,
4649
4835
  icon,
4650
4836
  iconRight,
4651
4837
  justify: justifyProp = "center",
@@ -4665,6 +4851,7 @@ const Button = forwardRef(function Button2(props, ref) {
4665
4851
  textAlign,
4666
4852
  tone = "default",
4667
4853
  type = "button",
4854
+ muted = false,
4668
4855
  ...restProps
4669
4856
  } = props;
4670
4857
  const justify = useArrayProp(justifyProp);
@@ -4707,14 +4894,14 @@ const Button = forwardRef(function Button2(props, ref) {
4707
4894
  children: /* @__PURE__ */jsxs(Flex, {
4708
4895
  as: "span",
4709
4896
  justify,
4897
+ gap: space,
4710
4898
  children: [icon && /* @__PURE__ */jsxs(Text, {
4711
4899
  size: fontSize,
4712
4900
  children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
4713
4901
  }), text && /* @__PURE__ */jsx(Box, {
4714
4902
  flex: iconRight ? 1 : void 0,
4715
- marginLeft: icon ? space : void 0,
4716
- marginRight: iconRight ? space : void 0,
4717
4903
  children: /* @__PURE__ */jsx(Text, {
4904
+ muted,
4718
4905
  align: textAlign,
4719
4906
  size: fontSize,
4720
4907
  textOverflow: "ellipsis",
@@ -4759,7 +4946,7 @@ function cardColorStyle(props) {
4759
4946
  } = props;
4760
4947
  const {
4761
4948
  focusRing
4762
- } = theme.sanity;
4949
+ } = theme.sanity.card;
4763
4950
  const {
4764
4951
  base,
4765
4952
  card,
@@ -4844,29 +5031,44 @@ function inputElementStyles(props) {
4844
5031
  } = props;
4845
5032
  const color = theme.sanity.color.input;
4846
5033
  const {
4847
- focusRing,
4848
5034
  input,
4849
5035
  radius
4850
5036
  } = 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({
5037
+ const {
5038
+ focusRing
5039
+ } = input.checkbox;
5040
+ 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
5041
  color: color.default.enabled.border,
4853
5042
  width: input.border.width
4854
- }), rem(radius[2]), color.default.enabled.bg, focusRingStyle({
5043
+ }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
5044
+ color: color.default.enabled.bg2,
5045
+ width: input.border.width
5046
+ }), color.default.enabled.bg, focusRingStyle({
5047
+ focusRing
5048
+ }), focusRingStyle({
5049
+ focusRing: {
5050
+ width: 1,
5051
+ offset: 1
5052
+ }
5053
+ }), color.invalid.enabled.border, focusRingBorderStyle({
5054
+ width: input.border.width,
5055
+ color: color.invalid.enabled.bg2
5056
+ }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
4855
5057
  border: {
4856
5058
  width: input.border.width,
4857
- color: color.default.enabled.border
5059
+ color: color.invalid.readOnly.bg2
4858
5060
  },
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({
5061
+ focusRing: {
5062
+ width: 1,
5063
+ offset: 1
5064
+ }
5065
+ }), color.default.disabled.bg, focusRingBorderStyle({
4867
5066
  width: input.border.width,
4868
5067
  color: color.default.disabled.border
4869
- }), color.default.disabled.fg);
5068
+ }), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
5069
+ width: input.border.width,
5070
+ color: color.default.readOnly.border
5071
+ }), color.default.readOnly.fg, color.default.readOnly.bg2);
4870
5072
  }
4871
5073
  const Root$t = styled.div(checkboxBaseStyles);
4872
5074
  const Input$5 = styled.input(inputElementStyles);
@@ -4894,6 +5096,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
4894
5096
  style,
4895
5097
  children: [/* @__PURE__ */jsx(Input$5, {
4896
5098
  "data-read-only": !disabled && readOnly ? "" : void 0,
5099
+ "data-error": customValidity ? "" : void 0,
4897
5100
  ...restProps,
4898
5101
  checked,
4899
5102
  disabled: disabled || readOnly,
@@ -5228,7 +5431,7 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5228
5431
  }));
5229
5432
  var _a$o;
5230
5433
  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 "])));
5434
+ 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
5435
  }
5233
5436
  const Root$n = styled.kbd(responsiveRadiusStyle, kbdStyle);
5234
5437
  const KBD = forwardRef(function KBD2(props, ref) {
@@ -5247,10 +5450,11 @@ const KBD = forwardRef(function KBD2(props, ref) {
5247
5450
  children: /* @__PURE__ */jsx(Box, {
5248
5451
  as: "span",
5249
5452
  padding,
5250
- children: /* @__PURE__ */jsx(Code, {
5453
+ children: /* @__PURE__ */jsx(Text, {
5251
5454
  as: "span",
5252
5455
  muted: true,
5253
5456
  size: fontSize,
5457
+ weight: "medium",
5254
5458
  children
5255
5459
  })
5256
5460
  })
@@ -6312,15 +6516,17 @@ function inputElementStyle(props) {
6312
6516
  theme
6313
6517
  } = props;
6314
6518
  const {
6315
- focusRing,
6316
6519
  input
6317
6520
  } = theme.sanity;
6521
+ const {
6522
+ focusRing
6523
+ } = input.radio;
6318
6524
  const color = theme.sanity.color.input;
6319
6525
  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({
6526
+ 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
6527
  color: color.default.enabled.border,
6322
6528
  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({
6529
+ }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.bg2, focusRingStyle({
6324
6530
  border: {
6325
6531
  width: input.border.width,
6326
6532
  color: color.default.enabled.border
@@ -6329,7 +6535,10 @@ function inputElementStyle(props) {
6329
6535
  }), focusRingBorderStyle({
6330
6536
  color: color.default.enabled.border,
6331
6537
  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);
6538
+ }), color.invalid.enabled.border, focusRingBorderStyle({
6539
+ width: input.border.width,
6540
+ color: color.invalid.enabled.bg2
6541
+ }), 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
6542
  }
6334
6543
  const Root$h = styled.div(radioBaseStyle);
6335
6544
  const Input$4 = styled.input(inputElementStyle);
@@ -6350,6 +6559,7 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
6350
6559
  style,
6351
6560
  children: [/* @__PURE__ */jsx(Input$4, {
6352
6561
  "data-read-only": !disabled && readOnly ? "" : void 0,
6562
+ "data-error": customValidity ? "" : void 0,
6353
6563
  ...restProps,
6354
6564
  disabled: disabled || readOnly,
6355
6565
  readOnly,
@@ -6379,9 +6589,11 @@ function inputColorStyle(props) {
6379
6589
  theme
6380
6590
  } = props;
6381
6591
  const {
6382
- focusRing,
6383
6592
  input
6384
6593
  } = theme.sanity;
6594
+ const {
6595
+ focusRing
6596
+ } = input.select;
6385
6597
  const color = theme.sanity.color.input;
6386
6598
  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
6599
  color: color.default.enabled.border,
@@ -6531,13 +6743,15 @@ function switchRepresentationStyles(props) {
6531
6743
  theme
6532
6744
  } = props;
6533
6745
  const {
6534
- focusRing,
6535
6746
  input
6536
6747
  } = 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({
6748
+ const {
6749
+ focusRing
6750
+ } = input.switch;
6751
+ const color = theme.sanity.color.input;
6752
+ 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
6753
  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);
6754
+ }), 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
6755
  }
6542
6756
  function switchTrackStyles(props) {
6543
6757
  const {
@@ -6563,7 +6777,7 @@ function switchThumbStyles(props) {
6563
6777
  const checkedOffset = trackWidth - trackPadding * 2 - size;
6564
6778
  const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
6565
6779
  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));
6780
+ 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
6781
  }
6568
6782
  const Root$e = styled.span(switchBaseStyles);
6569
6783
  const Input$2 = styled.input(switchInputStyles);
@@ -6941,7 +7155,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
6941
7155
  content,
6942
7156
  disabled,
6943
7157
  fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
6944
- padding,
7158
+ padding = 3,
6945
7159
  placement: placementProp = "bottom",
6946
7160
  portal,
6947
7161
  scheme,
@@ -7107,7 +7321,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
7107
7321
  "data-ui": "Tooltip__card",
7108
7322
  "data-placement": placement,
7109
7323
  padding,
7110
- radius: 2,
7324
+ radius: 3,
7111
7325
  scheme,
7112
7326
  shadow,
7113
7327
  children: [content, /* @__PURE__ */jsx(TooltipArrow, {
@@ -8922,7 +9136,7 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
8922
9136
  icon,
8923
9137
  id,
8924
9138
  focused,
8925
- fontSize,
9139
+ fontSize = 1,
8926
9140
  label,
8927
9141
  onClick,
8928
9142
  onFocus,
@@ -8962,6 +9176,7 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
8962
9176
  onBlur: handleBlur,
8963
9177
  onFocus: handleFocus,
8964
9178
  padding,
9179
+ radius: "full",
8965
9180
  ref: setRef,
8966
9181
  role: "tab",
8967
9182
  selected,