@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.js CHANGED
@@ -1256,6 +1256,7 @@ const defaultOpts = {
1256
1256
  bg2: dark ? color.light : color.dark,
1257
1257
  border: dark ? color.lighter : color.darker,
1258
1258
  fg: dark ? color.darkest : color.lightest,
1259
+ iconColor: dark ? color.darkest : color.lightest,
1259
1260
  muted: {
1260
1261
  fg: black
1261
1262
  },
@@ -1277,6 +1278,7 @@ const defaultOpts = {
1277
1278
  bg2: color.base,
1278
1279
  border: dark ? color.light : color.dark,
1279
1280
  fg: dark ? color.darkest : color.lightest,
1281
+ iconColor: dark ? color.darkest : color.lightest,
1280
1282
  muted: {
1281
1283
  fg: black
1282
1284
  },
@@ -1307,6 +1309,7 @@ const defaultOpts = {
1307
1309
  bg2: dark ? color.darker : color.lighter,
1308
1310
  border: dark ? color.lighter : color.darker,
1309
1311
  fg: dark ? color.lightest : color.darkest,
1312
+ iconColor: dark ? color.lightest : color.darkest,
1310
1313
  muted: {
1311
1314
  fg: black
1312
1315
  },
@@ -1328,6 +1331,7 @@ const defaultOpts = {
1328
1331
  bg2: dark ? color.darkest : color.lightest,
1329
1332
  border: dark ? color.darker : color.lighter,
1330
1333
  fg: dark ? color.lighter : color.darker,
1334
+ iconColor: dark ? color.lighter : color.darker,
1331
1335
  muted: {
1332
1336
  fg: black
1333
1337
  },
@@ -1358,6 +1362,7 @@ const defaultOpts = {
1358
1362
  bg: "transparent",
1359
1363
  bg2: "transparent",
1360
1364
  fg: muted.enabled.fg,
1365
+ iconColor: muted.enabled.fg,
1361
1366
  border: "transparent",
1362
1367
  muted: {
1363
1368
  fg: black
@@ -1378,6 +1383,7 @@ const defaultOpts = {
1378
1383
  bg: muted.enabled.bg,
1379
1384
  bg2: muted.enabled.bg,
1380
1385
  fg: muted.hovered.fg,
1386
+ iconColor: muted.hovered.fg,
1381
1387
  border: "transparent",
1382
1388
  muted: {
1383
1389
  fg: black
@@ -1410,6 +1416,7 @@ const defaultOpts = {
1410
1416
  bg: black,
1411
1417
  bg2: black,
1412
1418
  fg: black,
1419
+ iconColor: black,
1413
1420
  border: black,
1414
1421
  muted: {
1415
1422
  fg: black
@@ -1430,6 +1437,7 @@ const defaultOpts = {
1430
1437
  input: () => {
1431
1438
  return {
1432
1439
  bg: black,
1440
+ bg2: black,
1433
1441
  fg: black,
1434
1442
  border: black,
1435
1443
  placeholder: black
@@ -2170,11 +2178,115 @@ function screen(bg, fg) {
2170
2178
  const hex = rgbToHex(screen$1(b, s));
2171
2179
  return hex;
2172
2180
  }
2181
+ const defaultTints = {
2182
+ light: {
2183
+ text_primary: "900",
2184
+ text_secondary: "600",
2185
+ text_inactive: "500",
2186
+ bg_base: color$1.white,
2187
+ bg_base_hover: "50",
2188
+ bg_base_active: "100",
2189
+ bg_accent: "500",
2190
+ bg_accent_hover: "600",
2191
+ bg_accent_active: "700",
2192
+ bg_tint: "50",
2193
+ icon_default: "500",
2194
+ icon_inverted: color$1.white,
2195
+ border_base: "100",
2196
+ border_accent: "500",
2197
+ border_accent_inverted: color$1.white
2198
+ },
2199
+ dark: {
2200
+ text_primary: "50",
2201
+ text_secondary: "300",
2202
+ text_inactive: "400",
2203
+ bg_base: color$1.black,
2204
+ bg_base_hover: "900",
2205
+ bg_base_active: "800",
2206
+ bg_accent: "500",
2207
+ bg_accent_hover: "400",
2208
+ bg_accent_active: "300",
2209
+ bg_tint: "900",
2210
+ icon_default: "300",
2211
+ icon_inverted: color$1.hues.gray[900],
2212
+ border_base: "800",
2213
+ border_accent: "300",
2214
+ border_accent_inverted: color$1.hues.gray[900]
2215
+ }
2216
+ };
2217
+ const colorTints = {
2218
+ light: {
2219
+ default: {
2220
+ ...defaultTints.light,
2221
+ bg_accent: "900",
2222
+ bg_accent_hover: "950",
2223
+ bg_accent_active: color$1.black,
2224
+ border_accent: "600"
2225
+ },
2226
+ primary: {
2227
+ ...defaultTints.light,
2228
+ bg_accent: "900",
2229
+ bg_accent_hover: "950",
2230
+ bg_accent_active: color$1.black,
2231
+ border_accent: "600"
2232
+ },
2233
+ positive: {
2234
+ ...defaultTints.light,
2235
+ bg_base_hover: color$1.hues.gray[50],
2236
+ bg_base_active: "50",
2237
+ bg_accent: "400",
2238
+ bg_accent_hover: "500",
2239
+ bg_accent_active: "600",
2240
+ border_accent: "400"
2241
+ },
2242
+ transparent: defaultTints.light,
2243
+ caution: defaultTints.light,
2244
+ critical: defaultTints.light
2245
+ },
2246
+ dark: {
2247
+ default: {
2248
+ ...defaultTints.dark,
2249
+ text_primary: color$1.white,
2250
+ bg_accent: color$1.white,
2251
+ bg_accent_hover: "50",
2252
+ bg_accent_active: "100"
2253
+ },
2254
+ primary: {
2255
+ ...defaultTints.dark,
2256
+ text_primary: color$1.white,
2257
+ bg_accent: color$1.white,
2258
+ bg_accent_hover: "50",
2259
+ bg_accent_active: "100"
2260
+ },
2261
+ positive: {
2262
+ ...defaultTints.dark,
2263
+ bg_base_hover: color$1.hues.gray[900],
2264
+ bg_base_active: "900",
2265
+ bg_accent: "400",
2266
+ bg_accent_hover: "300",
2267
+ bg_accent_active: "200",
2268
+ border_accent: "400"
2269
+ },
2270
+ transparent: defaultTints.dark,
2271
+ caution: defaultTints.dark,
2272
+ critical: defaultTints.dark
2273
+ }
2274
+ };
2275
+ const getColorValue = (tints, dark, tone, key) => {
2276
+ const value = colorTints[dark ? "dark" : "light"][tone][key];
2277
+ if (typeof value === "string") {
2278
+ return tints[value];
2279
+ }
2280
+ return value;
2281
+ };
2282
+ const getColorHex = (tints, dark, tone, key) => {
2283
+ return getColorValue(tints, dark, tone, key).hex;
2284
+ };
2173
2285
  const tones = {
2174
2286
  default: color$1.hues.gray,
2175
2287
  transparent: color$1.hues.gray,
2176
- primary: color$1.hues.blue,
2177
- positive: color$1.hues.green,
2288
+ primary: color$1.hues.gray,
2289
+ positive: color$1.hues.cyan,
2178
2290
  caution: color$1.hues.yellow,
2179
2291
  critical: color$1.hues.red
2180
2292
  };
@@ -2190,9 +2302,9 @@ const color = createColorTheme({
2190
2302
  const skeletonFrom2 = dark ? tints2[900].hex : tints2[100].hex;
2191
2303
  return {
2192
2304
  fg: dark ? color$1.white.hex : color$1.black.hex,
2193
- bg: dark ? color$1.black.hex : color$1.white.hex,
2194
- border: tints2[dark ? 800 : 200].hex,
2195
- focusRing: color$1.hues.blue[dark ? 500 : 500].hex,
2305
+ bg: getColorHex(tones["default"], dark, "default", "bg_base"),
2306
+ border: getColorHex(tones["default"], dark, "default", "border_base"),
2307
+ focusRing: getColorHex(tones["positive"], dark, "positive", "border_accent"),
2196
2308
  shadow: {
2197
2309
  outline: rgba(tints2[500].hex, 0.4),
2198
2310
  umbra: dark ? rgba(tints2[950].hex, 0.4) : rgba(tints2[500].hex, 0.2),
@@ -2229,9 +2341,9 @@ const color = createColorTheme({
2229
2341
  const skeletonFrom = tints[dark ? 800 : 200].hex;
2230
2342
  return {
2231
2343
  fg: tints[dark ? 100 : 900].hex,
2232
- bg: tints[dark ? 950 : 50].hex,
2233
- border: tints[dark ? 800 : 200].hex,
2234
- focusRing: tints[500].hex,
2344
+ bg: getColorHex(tints, dark, name, "bg_base"),
2345
+ border: getColorHex(tints, dark, name, "border_base"),
2346
+ focusRing: getColorHex(tints, dark, name, "border_accent"),
2235
2347
  shadow: {
2236
2348
  outline: rgba(tints[500].hex, 0.4),
2237
2349
  umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
@@ -2259,13 +2371,14 @@ const color = createColorTheme({
2259
2371
  let tints = tones[tone === "default" ? name : tone] || defaultTints;
2260
2372
  if (state === "disabled") {
2261
2373
  tints = defaultTints;
2262
- const bg2 = mix(base.bg, tints[dark ? 800 : 200].hex);
2374
+ const bg2 = getColorHex(tones.default, dark, "default", "bg_tint");
2263
2375
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2264
2376
  return {
2265
2377
  bg: bg2,
2266
2378
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2267
- border: mix(base.bg, tints[dark ? 800 : 200].hex),
2268
- fg: mix(base.bg, dark ? color$1.black.hex : color$1.white.hex),
2379
+ border: getColorHex(tones.default, dark, "default", "bg_base"),
2380
+ fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2381
+ iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2269
2382
  muted: {
2270
2383
  fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2271
2384
  },
@@ -2286,13 +2399,14 @@ const color = createColorTheme({
2286
2399
  };
2287
2400
  }
2288
2401
  if (state === "hovered") {
2289
- const bg2 = mix(base.bg, tints[dark ? 300 : 600].hex);
2402
+ const bg2 = getColorHex(tints, dark, tone, "bg_accent_hover");
2290
2403
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2291
2404
  return {
2292
2405
  bg: bg2,
2293
2406
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2294
- border: mix(base.bg, tints[dark ? 300 : 600].hex),
2295
- fg: mix(base.bg, dark ? color$1.black.hex : color$1.white.hex),
2407
+ border: bg2,
2408
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2409
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2296
2410
  muted: {
2297
2411
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2298
2412
  },
@@ -2313,13 +2427,14 @@ const color = createColorTheme({
2313
2427
  };
2314
2428
  }
2315
2429
  if (state === "pressed") {
2316
- const bg2 = mix(base.bg, tints[dark ? 200 : 800].hex);
2317
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2430
+ const bg2 = getColorHex(tints, dark, tone, "bg_accent_active");
2431
+ const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 600].hex);
2318
2432
  return {
2319
- bg: mix(base.bg, tints[dark ? 200 : 800].hex),
2433
+ bg: bg2,
2320
2434
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2321
- border: mix(base.bg, tints[dark ? 200 : 800].hex),
2322
- fg: mix(base.bg, dark ? color$1.black.hex : color$1.white.hex),
2435
+ border: bg2,
2436
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2437
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2323
2438
  muted: {
2324
2439
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2325
2440
  },
@@ -2348,8 +2463,9 @@ const color = createColorTheme({
2348
2463
  return {
2349
2464
  bg: bg2,
2350
2465
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2351
- border: mix(base.bg, tints[dark ? 200 : 800].hex),
2352
- fg: mix(base.bg, dark ? color$1.black.hex : color$1.white.hex),
2466
+ border: bg2,
2467
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2468
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2353
2469
  muted: {
2354
2470
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2355
2471
  },
@@ -2369,13 +2485,14 @@ const color = createColorTheme({
2369
2485
  }
2370
2486
  };
2371
2487
  }
2372
- const bg = mix(base.bg, tints[dark ? 400 : 500].hex);
2488
+ const bg = getColorHex(tints, dark, tone, "bg_accent");
2373
2489
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex);
2374
2490
  return {
2375
2491
  bg,
2376
2492
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
2377
- border: mix(base.bg, tints[dark ? 400 : 500].hex),
2378
- fg: mix(base.bg, dark ? color$1.black.hex : color$1.white.hex),
2493
+ border: bg,
2494
+ fg: getColorHex(tints, dark, "default", "bg_base"),
2495
+ iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2379
2496
  muted: {
2380
2497
  fg: mix(base.bg, tints[dark ? 900 : 100].hex)
2381
2498
  },
@@ -2414,20 +2531,21 @@ const color = createColorTheme({
2414
2531
  return {
2415
2532
  bg: bg2,
2416
2533
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2417
- border: mix(bg2, tints[dark ? 950 : 50].hex),
2418
- fg: mix(bg2, tints[dark ? 800 : 200].hex),
2534
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2535
+ fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2536
+ iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2419
2537
  muted: {
2420
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2538
+ fg: getColorHex(tones.default, dark, "default", "text_inactive")
2421
2539
  },
2422
2540
  accent: {
2423
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2541
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2424
2542
  },
2425
2543
  link: {
2426
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2544
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2427
2545
  },
2428
2546
  code: {
2429
2547
  bg: bg2,
2430
- fg: mix(bg2, tints[dark ? 900 : 100].hex)
2548
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2431
2549
  },
2432
2550
  skeleton: {
2433
2551
  from: rgba(skeletonFrom2, 0.5),
@@ -2436,15 +2554,16 @@ const color = createColorTheme({
2436
2554
  };
2437
2555
  }
2438
2556
  if (state === "hovered") {
2439
- const bg2 = mix(base.bg, tints[dark ? 950 : 50].hex);
2557
+ const bg2 = getColorHex(tints, dark, name, "bg_base_hover");
2440
2558
  const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2441
2559
  return {
2442
2560
  bg: bg2,
2443
2561
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2444
2562
  border: mix(bg2, tints[dark ? 900 : 100].hex),
2445
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2563
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2564
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2446
2565
  muted: {
2447
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2566
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2448
2567
  },
2449
2568
  accent: {
2450
2569
  fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
@@ -2454,7 +2573,7 @@ const color = createColorTheme({
2454
2573
  },
2455
2574
  code: {
2456
2575
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2457
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2576
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2458
2577
  },
2459
2578
  skeleton: {
2460
2579
  from: skeletonFrom2,
@@ -2466,15 +2585,16 @@ const color = createColorTheme({
2466
2585
  if (isNeutral) {
2467
2586
  tints = tones.primary;
2468
2587
  }
2469
- const bg2 = mix(base.bg, tints[dark ? 900 : 100].hex);
2470
- const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2588
+ const bg2 = getColorHex(tints, dark, name, "bg_base_active");
2589
+ const skeletonFrom2 = mix(bg2, getColorHex(tints, dark, name, "bg_base_active"));
2471
2590
  return {
2472
2591
  bg: bg2,
2473
2592
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2474
- border: mix(bg2, tints[dark ? 900 : 100].hex),
2475
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2593
+ border: getColorHex(tints, dark, name, "border_base"),
2594
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2595
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2476
2596
  muted: {
2477
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2597
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2478
2598
  },
2479
2599
  accent: {
2480
2600
  fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
@@ -2484,7 +2604,7 @@ const color = createColorTheme({
2484
2604
  },
2485
2605
  code: {
2486
2606
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2487
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2607
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2488
2608
  },
2489
2609
  skeleton: {
2490
2610
  from: skeletonFrom2,
@@ -2501,10 +2621,11 @@ const color = createColorTheme({
2501
2621
  return {
2502
2622
  bg: bg2,
2503
2623
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2504
- border: mix(bg2, tints[dark ? 900 : 100].hex),
2505
- fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2624
+ border: getColorHex(tints, dark, name, "border_base"),
2625
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2626
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2506
2627
  muted: {
2507
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2628
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2508
2629
  },
2509
2630
  accent: {
2510
2631
  fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
@@ -2514,7 +2635,7 @@ const color = createColorTheme({
2514
2635
  },
2515
2636
  code: {
2516
2637
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2517
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2638
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2518
2639
  },
2519
2640
  skeleton: {
2520
2641
  from: skeletonFrom2,
@@ -2527,10 +2648,11 @@ const color = createColorTheme({
2527
2648
  return {
2528
2649
  bg,
2529
2650
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
2530
- border: mix(bg, tints[dark ? 900 : 100].hex),
2531
- fg: mix(base.bg, tints[dark ? 300 : 700].hex),
2651
+ border: mix(bg, getColorHex(tints, dark, name, "bg_base")),
2652
+ fg: getColorHex(tints, dark, tone, "text_primary"),
2653
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2532
2654
  muted: {
2533
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2655
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2534
2656
  },
2535
2657
  accent: {
2536
2658
  fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
@@ -2540,7 +2662,7 @@ const color = createColorTheme({
2540
2662
  },
2541
2663
  code: {
2542
2664
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2543
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2665
+ fg: getColorHex(tints, dark, tone, "text_secondary")
2544
2666
  },
2545
2667
  skeleton: {
2546
2668
  from: skeletonFrom,
@@ -2581,12 +2703,11 @@ const color = createColorTheme({
2581
2703
  }
2582
2704
  if (mode === "ghost") {
2583
2705
  return {
2584
- ...solid,
2706
+ ...muted,
2585
2707
  enabled: {
2586
2708
  ...muted.enabled,
2587
2709
  border: base.border
2588
- },
2589
- disabled: muted.disabled
2710
+ }
2590
2711
  };
2591
2712
  }
2592
2713
  return solid;
@@ -2627,6 +2748,7 @@ const color = createColorTheme({
2627
2748
  bg,
2628
2749
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
2629
2750
  fg: base.fg,
2751
+ iconColor: getColorHex(tints, dark, name, "icon_default"),
2630
2752
  border: base.border,
2631
2753
  muted: {
2632
2754
  fg: mix(base.bg, tints[dark ? 400 : 600].hex)
@@ -2659,40 +2781,45 @@ const color = createColorTheme({
2659
2781
  const tints = tones.critical;
2660
2782
  return {
2661
2783
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2784
+ bg2: getColorHex(tints, dark, "critical", "text_secondary"),
2662
2785
  fg: mix(base.bg, tints[dark ? 400 : 600].hex),
2663
- border: mix(base.bg, tints[dark ? 800 : 200].hex),
2664
- placeholder: mix(base.bg, tints[dark ? 600 : 400].hex)
2786
+ border: getColorHex(tints, dark, "critical", "border_base"),
2787
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2665
2788
  };
2666
2789
  }
2667
2790
  if (state === "hovered") {
2668
2791
  return {
2669
2792
  bg: base.bg,
2793
+ bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2670
2794
  fg: base.fg,
2671
2795
  border: mix(base.bg, color$1.hues.gray[dark ? 700 : 300].hex),
2672
- placeholder: mix(base.bg, color$1.hues.gray[dark ? 600 : 400].hex)
2796
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2673
2797
  };
2674
2798
  }
2675
2799
  if (state === "disabled") {
2676
2800
  return {
2677
- bg: mix(base.bg, color$1.hues.gray[dark ? 950 : 50].hex),
2678
- fg: mix(base.bg, color$1.hues.gray[dark ? 700 : 300].hex),
2679
- border: mix(base.bg, color$1.hues.gray[dark ? 900 : 100].hex),
2680
- placeholder: mix(base.bg, color$1.hues.gray[dark ? 800 : 200].hex)
2801
+ bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2802
+ bg2: getColorHex(tones.default, dark, "default", "border_base"),
2803
+ fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2804
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2805
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2681
2806
  };
2682
2807
  }
2683
2808
  if (state === "readOnly") {
2684
2809
  return {
2685
- bg: mix(base.bg, color$1.hues.gray[dark ? 950 : 50].hex),
2686
- fg: mix(base.bg, color$1.hues.gray[dark ? 200 : 800].hex),
2687
- border: mix(base.bg, color$1.hues.gray[dark ? 800 : 200].hex),
2688
- placeholder: mix(base.bg, color$1.hues.gray[dark ? 600 : 400].hex)
2810
+ bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2811
+ bg2: getColorHex(tones.default, dark, "default", "border_base"),
2812
+ fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2813
+ border: getColorHex(tones.default, dark, "default", "border_base"),
2814
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2689
2815
  };
2690
2816
  }
2691
2817
  return {
2692
2818
  bg: base.bg,
2819
+ bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2693
2820
  fg: base.fg,
2694
2821
  border: base.border,
2695
- placeholder: mix(base.bg, color$1.hues.gray[dark ? 600 : 400].hex)
2822
+ placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2696
2823
  };
2697
2824
  },
2698
2825
  selectable: _ref17 => {
@@ -2833,7 +2960,7 @@ const fonts = {
2833
2960
  }]
2834
2961
  },
2835
2962
  heading: {
2836
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2963
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2837
2964
  weights: {
2838
2965
  regular: 700,
2839
2966
  medium: 800,
@@ -2885,7 +3012,7 @@ const fonts = {
2885
3012
  }]
2886
3013
  },
2887
3014
  label: {
2888
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
3015
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
2889
3016
  weights: {
2890
3017
  regular: 600,
2891
3018
  medium: 700,
@@ -2930,7 +3057,7 @@ const fonts = {
2930
3057
  }]
2931
3058
  },
2932
3059
  text: {
2933
- family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
3060
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
2934
3061
  weights: {
2935
3062
  regular: 400,
2936
3063
  medium: 500,
@@ -2986,10 +3113,24 @@ const studioTheme = {
2986
3113
  }, {
2987
3114
  distance: -9,
2988
3115
  size: 55
2989
- }]
3116
+ }],
3117
+ focusRing: {
3118
+ offset: 1,
3119
+ width: 1
3120
+ }
2990
3121
  },
2991
3122
  button: {
2992
- textWeight: "medium"
3123
+ textWeight: "medium",
3124
+ focusRing: {
3125
+ offset: -1,
3126
+ width: 2
3127
+ }
3128
+ },
3129
+ card: {
3130
+ focusRing: {
3131
+ offset: -1,
3132
+ width: 1
3133
+ }
2993
3134
  },
2994
3135
  color,
2995
3136
  container: [320, 640, 960, 1280, 1600, 1920],
@@ -3024,21 +3165,45 @@ const studioTheme = {
3024
3165
  space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
3025
3166
  input: {
3026
3167
  checkbox: {
3027
- size: 17
3168
+ size: 17,
3169
+ focusRing: {
3170
+ offset: -1,
3171
+ width: 1
3172
+ }
3028
3173
  },
3029
3174
  radio: {
3030
3175
  size: 17,
3031
- markSize: 9
3176
+ markSize: 9,
3177
+ focusRing: {
3178
+ offset: -1,
3179
+ width: 1
3180
+ }
3032
3181
  },
3033
3182
  switch: {
3034
- width: 33,
3035
- height: 17,
3036
- padding: 4,
3183
+ width: 21,
3184
+ height: 13,
3185
+ padding: 2,
3037
3186
  transitionDurationMs: 150,
3038
- transitionTimingFunction: "ease-out"
3187
+ transitionTimingFunction: "ease-out",
3188
+ focusRing: {
3189
+ offset: 1,
3190
+ width: 1
3191
+ }
3039
3192
  },
3040
3193
  border: {
3041
3194
  width: 1
3195
+ },
3196
+ select: {
3197
+ focusRing: {
3198
+ offset: -1,
3199
+ width: 1
3200
+ }
3201
+ },
3202
+ text: {
3203
+ focusRing: {
3204
+ offset: -1,
3205
+ width: 1
3206
+ }
3042
3207
  }
3043
3208
  }
3044
3209
  // styles: {
@@ -3841,9 +4006,11 @@ function textInputRepresentationStyle(props) {
3841
4006
  theme
3842
4007
  } = props;
3843
4008
  const {
3844
- focusRing,
3845
4009
  input
3846
4010
  } = theme.sanity;
4011
+ const {
4012
+ focusRing
4013
+ } = input.text;
3847
4014
  const color = theme.sanity.color.input;
3848
4015
  return styled.css(_c$d || (_c$d = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
3849
4016
  color: color.default.enabled.border,
@@ -3887,9 +4054,18 @@ function responsiveRadiusStyle(props) {
3887
4054
  media,
3888
4055
  radius
3889
4056
  } = theme.sanity;
3890
- return _responsive(media, props.$radius, radiusIndex => ({
3891
- borderRadius: rem(radius[radiusIndex])
3892
- }));
4057
+ return _responsive(media, props.$radius, value => {
4058
+ let borderRadius = 0;
4059
+ if (typeof value === "number") {
4060
+ borderRadius = rem(radius[value]);
4061
+ }
4062
+ if (value === "full") {
4063
+ borderRadius = "9999px";
4064
+ }
4065
+ return {
4066
+ borderRadius
4067
+ };
4068
+ });
3893
4069
  }
3894
4070
  function toBoxShadow(shadow, color) {
3895
4071
  return "".concat(shadow.map(rem).join(" "), " ").concat(color);
@@ -3929,7 +4105,7 @@ function textBaseStyle(props) {
3929
4105
  const {
3930
4106
  weights
3931
4107
  } = theme.sanity.fonts.text;
3932
- return styled.css(_c$c || (_c$c = __template$C(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
4108
+ return styled.css(_c$c || (_c$c = __template$C(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
3933
4109
  }
3934
4110
  var __freeze$B = Object.freeze;
3935
4111
  var __defProp$C = Object.defineProperty;
@@ -4022,7 +4198,7 @@ function avatarRootStyle(props) {
4022
4198
  } = props;
4023
4199
  const {
4024
4200
  focusRing
4025
- } = theme.sanity;
4201
+ } = theme.sanity.avatar;
4026
4202
  return {
4027
4203
  backgroundColor: $color,
4028
4204
  position: "relative",
@@ -4573,8 +4749,10 @@ function _colorVarsStyle(base, color) {
4573
4749
  "--card-shadow-penumbra-color": base.shadow.penumbra,
4574
4750
  "--card-shadow-ambient-color": base.shadow.ambient,
4575
4751
  "--card-focus-ring-color": base.focusRing,
4752
+ "--card-icon-color": color.iconColor,
4576
4753
  // Card
4577
4754
  "--card-bg-color": color.bg,
4755
+ "--card-bg2-color": color.bg2,
4578
4756
  "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
4579
4757
  "--card-fg-color": color.fg,
4580
4758
  "--card-border-color": color.border,
@@ -4605,6 +4783,13 @@ const buttonTheme = {
4605
4783
  width: 1
4606
4784
  }
4607
4785
  };
4786
+ const defaultBoxShadow = "0px 2px 0px 0px rgba(112, 128, 155, 0.19);";
4787
+ function combineBoxShadow() {
4788
+ for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
4789
+ boxShadows[_key] = arguments[_key];
4790
+ }
4791
+ return boxShadows.filter(Boolean).join(",");
4792
+ }
4608
4793
  function buttonColorStyles(props) {
4609
4794
  var _a2, _b;
4610
4795
  const {
@@ -4613,7 +4798,8 @@ function buttonColorStyles(props) {
4613
4798
  } = props;
4614
4799
  const {
4615
4800
  focusRing
4616
- } = theme.sanity;
4801
+ } = theme.sanity.button;
4802
+ const shadow = props.$mode !== "bleed";
4617
4803
  const base = theme.sanity.color.base;
4618
4804
  const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
4619
4805
  const color = mode[props.$tone] || mode.default;
@@ -4627,15 +4813,19 @@ function buttonColorStyles(props) {
4627
4813
  boxShadow: focusRingBorderStyle(border),
4628
4814
  '&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
4629
4815
  "&:not([data-disabled='true'])": {
4816
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
4630
4817
  "&:focus": {
4631
4818
  boxShadow: focusRingStyle({
4632
4819
  base,
4633
- border,
4820
+ border: {
4821
+ width: 2,
4822
+ color: base.bg
4823
+ },
4634
4824
  focusRing
4635
4825
  })
4636
4826
  },
4637
4827
  "&:focus:not(:focus-visible)": {
4638
- boxShadow: focusRingBorderStyle(border)
4828
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
4639
4829
  },
4640
4830
  "@media (hover: hover)": {
4641
4831
  "&:hover": _colorVarsStyle(base, color.hovered),
@@ -4658,7 +4848,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
4658
4848
  const {
4659
4849
  children,
4660
4850
  disabled,
4661
- fontSize,
4851
+ fontSize = 1,
4662
4852
  icon,
4663
4853
  iconRight,
4664
4854
  justify: justifyProp = "center",
@@ -4678,6 +4868,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
4678
4868
  textAlign,
4679
4869
  tone = "default",
4680
4870
  type = "button",
4871
+ muted = false,
4681
4872
  ...restProps
4682
4873
  } = props;
4683
4874
  const justify = useArrayProp(justifyProp);
@@ -4720,14 +4911,14 @@ const Button = react.forwardRef(function Button2(props, ref) {
4720
4911
  children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
4721
4912
  as: "span",
4722
4913
  justify,
4914
+ gap: space,
4723
4915
  children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
4724
4916
  size: fontSize,
4725
4917
  children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
4726
4918
  }), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
4727
4919
  flex: iconRight ? 1 : void 0,
4728
- marginLeft: icon ? space : void 0,
4729
- marginRight: iconRight ? space : void 0,
4730
4920
  children: /* @__PURE__ */jsxRuntime.jsx(Text, {
4921
+ muted,
4731
4922
  align: textAlign,
4732
4923
  size: fontSize,
4733
4924
  textOverflow: "ellipsis",
@@ -4772,7 +4963,7 @@ function cardColorStyle(props) {
4772
4963
  } = props;
4773
4964
  const {
4774
4965
  focusRing
4775
- } = theme.sanity;
4966
+ } = theme.sanity.card;
4776
4967
  const {
4777
4968
  base,
4778
4969
  card,
@@ -4857,29 +5048,44 @@ function inputElementStyles(props) {
4857
5048
  } = props;
4858
5049
  const color = theme.sanity.color.input;
4859
5050
  const {
4860
- focusRing,
4861
5051
  input,
4862
5052
  radius
4863
5053
  } = theme.sanity;
4864
- return styled.css(_b$h || (_b$h = __template$s(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 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({
5054
+ const {
5055
+ focusRing
5056
+ } = input.checkbox;
5057
+ return styled.css(_b$h || (_b$h = __template$s(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.2 !important;\n }\n }\n }\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
4865
5058
  color: color.default.enabled.border,
4866
5059
  width: input.border.width
4867
- }), rem(radius[2]), color.default.enabled.bg, focusRingStyle({
5060
+ }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
5061
+ color: color.default.enabled.bg2,
5062
+ width: input.border.width
5063
+ }), color.default.enabled.bg, focusRingStyle({
5064
+ focusRing
5065
+ }), focusRingStyle({
5066
+ focusRing: {
5067
+ width: 1,
5068
+ offset: 1
5069
+ }
5070
+ }), color.invalid.enabled.border, focusRingBorderStyle({
5071
+ width: input.border.width,
5072
+ color: color.invalid.enabled.bg2
5073
+ }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
4868
5074
  border: {
4869
5075
  width: input.border.width,
4870
- color: color.default.enabled.border
5076
+ color: color.invalid.readOnly.bg2
4871
5077
  },
4872
- focusRing
4873
- }), focusRingBorderStyle({
4874
- color: color.default.enabled.border,
4875
- width: input.border.width
4876
- }), color.default.readOnly.bg, focusRingBorderStyle({
4877
- width: input.border.width,
4878
- color: color.default.readOnly.border
4879
- }), color.default.readOnly.fg, color.default.disabled.bg, focusRingBorderStyle({
5078
+ focusRing: {
5079
+ width: 1,
5080
+ offset: 1
5081
+ }
5082
+ }), color.default.disabled.bg, focusRingBorderStyle({
4880
5083
  width: input.border.width,
4881
5084
  color: color.default.disabled.border
4882
- }), color.default.disabled.fg);
5085
+ }), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
5086
+ width: input.border.width,
5087
+ color: color.default.readOnly.border
5088
+ }), color.default.readOnly.fg, color.default.readOnly.bg2);
4883
5089
  }
4884
5090
  const Root$t = styled__default.default.div(checkboxBaseStyles);
4885
5091
  const Input$5 = styled__default.default.input(inputElementStyles);
@@ -4907,6 +5113,7 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
4907
5113
  style,
4908
5114
  children: [/* @__PURE__ */jsxRuntime.jsx(Input$5, {
4909
5115
  "data-read-only": !disabled && readOnly ? "" : void 0,
5116
+ "data-error": customValidity ? "" : void 0,
4910
5117
  ...restProps,
4911
5118
  checked,
4912
5119
  disabled: disabled || readOnly,
@@ -5241,7 +5448,7 @@ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5241
5448
  }));
5242
5449
  var _a$o;
5243
5450
  function kbdStyle() {
5244
- return styled.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 "])));
5451
+ return styled.css(_a$o || (_a$o = __template$o(["\n background: var(--card-bg2-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
5245
5452
  }
5246
5453
  const Root$n = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
5247
5454
  const KBD = react.forwardRef(function KBD2(props, ref) {
@@ -5260,10 +5467,11 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
5260
5467
  children: /* @__PURE__ */jsxRuntime.jsx(Box, {
5261
5468
  as: "span",
5262
5469
  padding,
5263
- children: /* @__PURE__ */jsxRuntime.jsx(Code, {
5470
+ children: /* @__PURE__ */jsxRuntime.jsx(Text, {
5264
5471
  as: "span",
5265
5472
  muted: true,
5266
5473
  size: fontSize,
5474
+ weight: "medium",
5267
5475
  children
5268
5476
  })
5269
5477
  })
@@ -6325,15 +6533,17 @@ function inputElementStyle(props) {
6325
6533
  theme
6326
6534
  } = props;
6327
6535
  const {
6328
- focusRing,
6329
6536
  input
6330
6537
  } = theme.sanity;
6538
+ const {
6539
+ focusRing
6540
+ } = input.radio;
6331
6541
  const color = theme.sanity.color.input;
6332
6542
  const dist = (input.radio.size - input.radio.markSize) / 2;
6333
- return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
6543
+ return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
6334
6544
  color: color.default.enabled.border,
6335
6545
  width: input.border.width
6336
- }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
6546
+ }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.bg2, focusRingStyle({
6337
6547
  border: {
6338
6548
  width: input.border.width,
6339
6549
  color: color.default.enabled.border
@@ -6342,7 +6552,10 @@ function inputElementStyle(props) {
6342
6552
  }), focusRingBorderStyle({
6343
6553
  color: color.default.enabled.border,
6344
6554
  width: input.border.width
6345
- }), color.default.readOnly.border, color.default.readOnly.bg, color.default.readOnly.fg, color.default.disabled.border, color.default.disabled.bg, color.default.disabled.fg);
6555
+ }), color.invalid.enabled.border, focusRingBorderStyle({
6556
+ width: input.border.width,
6557
+ color: color.invalid.enabled.bg2
6558
+ }), 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);
6346
6559
  }
6347
6560
  const Root$h = styled__default.default.div(radioBaseStyle);
6348
6561
  const Input$4 = styled__default.default.input(inputElementStyle);
@@ -6363,6 +6576,7 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
6363
6576
  style,
6364
6577
  children: [/* @__PURE__ */jsxRuntime.jsx(Input$4, {
6365
6578
  "data-read-only": !disabled && readOnly ? "" : void 0,
6579
+ "data-error": customValidity ? "" : void 0,
6366
6580
  ...restProps,
6367
6581
  disabled: disabled || readOnly,
6368
6582
  readOnly,
@@ -6392,9 +6606,11 @@ function inputColorStyle(props) {
6392
6606
  theme
6393
6607
  } = props;
6394
6608
  const {
6395
- focusRing,
6396
6609
  input
6397
6610
  } = theme.sanity;
6611
+ const {
6612
+ focusRing
6613
+ } = input.select;
6398
6614
  const color = theme.sanity.color.input;
6399
6615
  return styled.css(_c$7 || (_c$7 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
6400
6616
  color: color.default.enabled.border,
@@ -6544,13 +6760,15 @@ function switchRepresentationStyles(props) {
6544
6760
  theme
6545
6761
  } = props;
6546
6762
  const {
6547
- focusRing,
6548
6763
  input
6549
6764
  } = theme.sanity;
6550
- const color = theme.sanity.color.button.default;
6551
- return styled.css(_c$6 || (_c$6 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\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({
6765
+ const {
6766
+ focusRing
6767
+ } = input.switch;
6768
+ const color = theme.sanity.color.input;
6769
+ return styled.css(_c$6 || (_c$6 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.border, color.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
6552
6770
  focusRing
6553
- }), 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);
6771
+ }), 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);
6554
6772
  }
6555
6773
  function switchTrackStyles(props) {
6556
6774
  const {
@@ -6576,7 +6794,7 @@ function switchThumbStyles(props) {
6576
6794
  const checkedOffset = trackWidth - trackPadding * 2 - size;
6577
6795
  const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
6578
6796
  const checked = $indeterminate !== true && props.$checked === true;
6579
- return styled.css(_g || (_g = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
6797
+ return styled.css(_g || (_g = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
6580
6798
  }
6581
6799
  const Root$e = styled__default.default.span(switchBaseStyles);
6582
6800
  const Input$2 = styled__default.default.input(switchInputStyles);
@@ -6954,7 +7172,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
6954
7172
  content,
6955
7173
  disabled,
6956
7174
  fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
6957
- padding,
7175
+ padding = 3,
6958
7176
  placement: placementProp = "bottom",
6959
7177
  portal,
6960
7178
  scheme,
@@ -7120,7 +7338,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
7120
7338
  "data-ui": "Tooltip__card",
7121
7339
  "data-placement": placement,
7122
7340
  padding,
7123
- radius: 2,
7341
+ radius: 3,
7124
7342
  scheme,
7125
7343
  shadow,
7126
7344
  children: [content, /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
@@ -8935,7 +9153,7 @@ const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
8935
9153
  icon,
8936
9154
  id,
8937
9155
  focused,
8938
- fontSize,
9156
+ fontSize = 1,
8939
9157
  label,
8940
9158
  onClick,
8941
9159
  onFocus,
@@ -8975,6 +9193,7 @@ const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
8975
9193
  onBlur: handleBlur,
8976
9194
  onFocus: handleFocus,
8977
9195
  padding,
9196
+ radius: "full",
8978
9197
  ref: setRef,
8979
9198
  role: "tab",
8980
9199
  selected,