@sanity/ui 2.0.0-alpha.1 → 2.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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 { black as black$1, hues, white as white$1 } from '@sanity/color';
5
+ import { white as white$1, black as black$1, hues } 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';
@@ -721,7 +721,7 @@ var ResizeObserverController = function () {
721
721
  };
722
722
  return ResizeObserverController;
723
723
  }();
724
- var ResizeObserver = function () {
724
+ var ResizeObserver$1 = function () {
725
725
  function ResizeObserver(callback) {
726
726
  if (arguments.length === 0) {
727
727
  throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
@@ -757,7 +757,7 @@ var ResizeObserver = function () {
757
757
  };
758
758
  return ResizeObserver;
759
759
  }();
760
- const _ResizeObserver = typeof document !== "undefined" && typeof window !== "undefined" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver;
760
+ const _ResizeObserver = typeof document !== "undefined" && typeof window !== "undefined" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver$1;
761
761
  const _elementSizeObserver = _createElementSizeObserver();
762
762
  function _createElementRectValueListener() {
763
763
  return {
@@ -874,6 +874,15 @@ function hexToRgb(hex) {
874
874
  b: parseInt(hex.slice(5, 7), 16)
875
875
  };
876
876
  }
877
+ function rgbaToRGBA(rgba) {
878
+ const values = rgba.replace(/rgba\(|\)/g, "").split(",");
879
+ return {
880
+ r: parseInt(values[0]),
881
+ g: parseInt(values[1]),
882
+ b: parseInt(values[2]),
883
+ a: parseFloat(values[3])
884
+ };
885
+ }
877
886
  function rgbToHex(_ref2) {
878
887
  let {
879
888
  r,
@@ -991,6 +1000,9 @@ function parseColor(color) {
991
1000
  if (color.startsWith("hsl(")) {
992
1001
  return hslToRgb(parseHsl(color));
993
1002
  }
1003
+ if (color.startsWith("rgba(")) {
1004
+ return rgbaToRGBA(color);
1005
+ }
994
1006
  throw new Error('parseColor: unexpected color format: "'.concat(color, '"'));
995
1007
  }
996
1008
  function rgba(color, a) {
@@ -2157,123 +2169,25 @@ function multiply(bg, fg) {
2157
2169
  const b = parseColor(bg);
2158
2170
  const s = parseColor(fg);
2159
2171
  const hex = rgbToHex(multiply$1(b, s));
2172
+ if (s.a) {
2173
+ return rgba(hex, s.a);
2174
+ }
2160
2175
  return hex;
2161
2176
  }
2162
2177
  function screen(bg, fg) {
2163
2178
  const b = parseColor(bg);
2164
2179
  const s = parseColor(fg);
2165
2180
  const hex = rgbToHex(screen$1(b, s));
2181
+ if (s.a) {
2182
+ return rgba(hex, s.a);
2183
+ }
2166
2184
  return hex;
2167
2185
  }
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
- };
2272
2186
  const tones = {
2273
2187
  default: hues.gray,
2274
2188
  transparent: hues.gray,
2275
- primary: hues.gray,
2276
- positive: hues.cyan,
2189
+ primary: hues.blue,
2190
+ positive: hues.green,
2277
2191
  caution: hues.yellow,
2278
2192
  critical: hues.red
2279
2193
  };
@@ -2289,9 +2203,9 @@ const color = createColorTheme({
2289
2203
  const skeletonFrom2 = dark ? tints2[900].hex : tints2[100].hex;
2290
2204
  return {
2291
2205
  fg: dark ? white$1.hex : black$1.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"),
2206
+ bg: dark ? black$1.hex : white$1.hex,
2207
+ border: tints2[dark ? 800 : 200].hex,
2208
+ focusRing: hues.blue[dark ? 500 : 500].hex,
2295
2209
  shadow: {
2296
2210
  outline: rgba(tints2[500].hex, 0.4),
2297
2211
  umbra: dark ? rgba(tints2[950].hex, 0.4) : rgba(tints2[500].hex, 0.2),
@@ -2328,9 +2242,9 @@ const color = createColorTheme({
2328
2242
  const skeletonFrom = tints[dark ? 800 : 200].hex;
2329
2243
  return {
2330
2244
  fg: tints[dark ? 100 : 900].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"),
2245
+ bg: tints[dark ? 950 : 50].hex,
2246
+ border: tints[dark ? 800 : 200].hex,
2247
+ focusRing: tints[500].hex,
2334
2248
  shadow: {
2335
2249
  outline: rgba(tints[500].hex, 0.4),
2336
2250
  umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
@@ -2358,14 +2272,15 @@ const color = createColorTheme({
2358
2272
  let tints = tones[tone === "default" ? name : tone] || defaultTints;
2359
2273
  if (state === "disabled") {
2360
2274
  tints = defaultTints;
2361
- const bg2 = getColorHex(tones.default, dark, "default", "bg_tint");
2275
+ const bg2 = mix(base.bg, tints[dark ? 800 : 200].hex);
2362
2276
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2363
2277
  return {
2364
2278
  bg: bg2,
2365
2279
  bg2: mix2(bg2, tints[dark ? 50 : 950].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"),
2280
+ border: mix(base.bg, tints[dark ? 800 : 200].hex),
2281
+ iconColor: "",
2282
+ // Add color
2283
+ fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2369
2284
  muted: {
2370
2285
  fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2371
2286
  },
@@ -2386,14 +2301,15 @@ const color = createColorTheme({
2386
2301
  };
2387
2302
  }
2388
2303
  if (state === "hovered") {
2389
- const bg2 = getColorHex(tints, dark, tone, "bg_accent_hover");
2304
+ const bg2 = mix(base.bg, tints[dark ? 300 : 600].hex);
2390
2305
  const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2391
2306
  return {
2392
2307
  bg: bg2,
2393
2308
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2394
- border: bg2,
2395
- fg: getColorHex(tints, dark, "default", "bg_base"),
2396
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2309
+ border: mix(base.bg, tints[dark ? 300 : 600].hex),
2310
+ fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2311
+ iconColor: "",
2312
+ // Add color
2397
2313
  muted: {
2398
2314
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2399
2315
  },
@@ -2414,14 +2330,15 @@ const color = createColorTheme({
2414
2330
  };
2415
2331
  }
2416
2332
  if (state === "pressed") {
2417
- const bg2 = getColorHex(tints, dark, tone, "bg_accent_active");
2418
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 600].hex);
2333
+ const bg2 = mix(base.bg, tints[dark ? 200 : 800].hex);
2334
+ const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2419
2335
  return {
2420
- bg: bg2,
2336
+ bg: mix(base.bg, tints[dark ? 200 : 800].hex),
2421
2337
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2422
- border: bg2,
2423
- fg: getColorHex(tints, dark, "default", "bg_base"),
2424
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2338
+ iconColor: "",
2339
+ // Add color
2340
+ border: mix(base.bg, tints[dark ? 200 : 800].hex),
2341
+ fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2425
2342
  muted: {
2426
2343
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2427
2344
  },
@@ -2450,9 +2367,10 @@ const color = createColorTheme({
2450
2367
  return {
2451
2368
  bg: bg2,
2452
2369
  bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2453
- border: bg2,
2454
- fg: getColorHex(tints, dark, "default", "bg_base"),
2455
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2370
+ border: mix(base.bg, tints[dark ? 200 : 800].hex),
2371
+ fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2372
+ iconColor: "",
2373
+ // Add color
2456
2374
  muted: {
2457
2375
  fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2458
2376
  },
@@ -2472,14 +2390,15 @@ const color = createColorTheme({
2472
2390
  }
2473
2391
  };
2474
2392
  }
2475
- const bg = getColorHex(tints, dark, tone, "bg_accent");
2393
+ const bg = mix(base.bg, tints[dark ? 400 : 500].hex);
2476
2394
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex);
2477
2395
  return {
2478
2396
  bg,
2479
2397
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
2480
- border: bg,
2481
- fg: getColorHex(tints, dark, "default", "bg_base"),
2482
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2398
+ border: mix(base.bg, tints[dark ? 400 : 500].hex),
2399
+ iconColor: "",
2400
+ // Add color
2401
+ fg: mix(base.bg, dark ? black$1.hex : white$1.hex),
2483
2402
  muted: {
2484
2403
  fg: mix(base.bg, tints[dark ? 900 : 100].hex)
2485
2404
  },
@@ -2518,21 +2437,22 @@ const color = createColorTheme({
2518
2437
  return {
2519
2438
  bg: bg2,
2520
2439
  bg2: mix(bg2, tints[dark ? 950 : 50].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"),
2440
+ border: mix(bg2, tints[dark ? 950 : 50].hex),
2441
+ iconColor: "",
2442
+ // Add color
2443
+ fg: mix(bg2, tints[dark ? 800 : 200].hex),
2524
2444
  muted: {
2525
- fg: getColorHex(tones.default, dark, "default", "text_inactive")
2445
+ fg: mix(bg2, tints[dark ? 900 : 100].hex)
2526
2446
  },
2527
2447
  accent: {
2528
- fg: getColorHex(tints, dark, tone, "text_secondary")
2448
+ fg: mix(bg2, tints[dark ? 900 : 100].hex)
2529
2449
  },
2530
2450
  link: {
2531
- fg: getColorHex(tints, dark, tone, "text_secondary")
2451
+ fg: mix(bg2, tints[dark ? 900 : 100].hex)
2532
2452
  },
2533
2453
  code: {
2534
2454
  bg: bg2,
2535
- fg: getColorHex(tints, dark, tone, "text_secondary")
2455
+ fg: mix(bg2, tints[dark ? 900 : 100].hex)
2536
2456
  },
2537
2457
  skeleton: {
2538
2458
  from: rgba(skeletonFrom2, 0.5),
@@ -2541,16 +2461,17 @@ const color = createColorTheme({
2541
2461
  };
2542
2462
  }
2543
2463
  if (state === "hovered") {
2544
- const bg2 = getColorHex(tints, dark, name, "bg_base_hover");
2464
+ const bg2 = mix(base.bg, tints[dark ? 950 : 50].hex);
2545
2465
  const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2546
2466
  return {
2547
2467
  bg: bg2,
2548
2468
  bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2549
2469
  border: mix(bg2, tints[dark ? 900 : 100].hex),
2550
- fg: getColorHex(tints, dark, tone, "text_primary"),
2551
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2470
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2471
+ iconColor: "",
2472
+ // Add color
2552
2473
  muted: {
2553
- fg: getColorHex(tints, dark, tone, "text_secondary")
2474
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2554
2475
  },
2555
2476
  accent: {
2556
2477
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex)
@@ -2560,7 +2481,7 @@ const color = createColorTheme({
2560
2481
  },
2561
2482
  code: {
2562
2483
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2563
- fg: getColorHex(tints, dark, tone, "text_secondary")
2484
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2564
2485
  },
2565
2486
  skeleton: {
2566
2487
  from: skeletonFrom2,
@@ -2572,16 +2493,17 @@ const color = createColorTheme({
2572
2493
  if (isNeutral) {
2573
2494
  tints = tones.primary;
2574
2495
  }
2575
- const bg2 = getColorHex(tints, dark, name, "bg_base_active");
2576
- const skeletonFrom2 = mix(bg2, getColorHex(tints, dark, name, "bg_base_active"));
2496
+ const bg2 = mix(base.bg, tints[dark ? 900 : 100].hex);
2497
+ const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2577
2498
  return {
2578
2499
  bg: bg2,
2579
2500
  bg2: mix(bg2, tints[dark ? 950 : 50].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"),
2501
+ border: mix(bg2, tints[dark ? 900 : 100].hex),
2502
+ iconColor: "",
2503
+ // Add color
2504
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2583
2505
  muted: {
2584
- fg: getColorHex(tints, dark, tone, "text_secondary")
2506
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2585
2507
  },
2586
2508
  accent: {
2587
2509
  fg: mix(bg2, hues.red[dark ? 400 : 500].hex)
@@ -2591,7 +2513,7 @@ const color = createColorTheme({
2591
2513
  },
2592
2514
  code: {
2593
2515
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2594
- fg: getColorHex(tints, dark, tone, "text_secondary")
2516
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2595
2517
  },
2596
2518
  skeleton: {
2597
2519
  from: skeletonFrom2,
@@ -2608,11 +2530,12 @@ const color = createColorTheme({
2608
2530
  return {
2609
2531
  bg: bg2,
2610
2532
  bg2: mix(bg2, tints[dark ? 950 : 50].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"),
2533
+ border: mix(bg2, tints[dark ? 900 : 100].hex),
2534
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
2535
+ iconColor: "",
2536
+ // Add color
2614
2537
  muted: {
2615
- fg: getColorHex(tints, dark, tone, "text_secondary")
2538
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2616
2539
  },
2617
2540
  accent: {
2618
2541
  fg: mix(bg2, hues.red[dark ? 400 : 500].hex)
@@ -2622,7 +2545,7 @@ const color = createColorTheme({
2622
2545
  },
2623
2546
  code: {
2624
2547
  bg: mix(bg2, tints[dark ? 950 : 50].hex),
2625
- fg: getColorHex(tints, dark, tone, "text_secondary")
2548
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2626
2549
  },
2627
2550
  skeleton: {
2628
2551
  from: skeletonFrom2,
@@ -2635,11 +2558,12 @@ const color = createColorTheme({
2635
2558
  return {
2636
2559
  bg,
2637
2560
  bg2: mix(bg, tints[dark ? 950 : 50].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"),
2561
+ border: mix(bg, tints[dark ? 900 : 100].hex),
2562
+ fg: mix(base.bg, tints[dark ? 300 : 700].hex),
2563
+ iconColor: "",
2564
+ // Add color
2641
2565
  muted: {
2642
- fg: getColorHex(tints, dark, tone, "text_secondary")
2566
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2643
2567
  },
2644
2568
  accent: {
2645
2569
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex)
@@ -2649,7 +2573,7 @@ const color = createColorTheme({
2649
2573
  },
2650
2574
  code: {
2651
2575
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2652
- fg: getColorHex(tints, dark, tone, "text_secondary")
2576
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2653
2577
  },
2654
2578
  skeleton: {
2655
2579
  from: skeletonFrom,
@@ -2690,11 +2614,12 @@ const color = createColorTheme({
2690
2614
  }
2691
2615
  if (mode === "ghost") {
2692
2616
  return {
2693
- ...muted,
2617
+ ...solid,
2694
2618
  enabled: {
2695
2619
  ...muted.enabled,
2696
2620
  border: base.border
2697
- }
2621
+ },
2622
+ disabled: muted.disabled
2698
2623
  };
2699
2624
  }
2700
2625
  return solid;
@@ -2735,8 +2660,9 @@ const color = createColorTheme({
2735
2660
  bg,
2736
2661
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
2737
2662
  fg: base.fg,
2738
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2739
2663
  border: base.border,
2664
+ iconColor: "",
2665
+ // Add color
2740
2666
  muted: {
2741
2667
  fg: mix(base.bg, tints[dark ? 400 : 600].hex)
2742
2668
  },
@@ -2768,45 +2694,50 @@ const color = createColorTheme({
2768
2694
  const tints = tones.critical;
2769
2695
  return {
2770
2696
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2771
- bg2: getColorHex(tints, dark, "critical", "text_secondary"),
2697
+ bg2: "",
2698
+ // Add color
2772
2699
  fg: mix(base.bg, tints[dark ? 400 : 600].hex),
2773
- border: getColorHex(tints, dark, "critical", "border_base"),
2774
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2700
+ border: mix(base.bg, tints[dark ? 800 : 200].hex),
2701
+ placeholder: mix(base.bg, tints[dark ? 600 : 400].hex)
2775
2702
  };
2776
2703
  }
2777
2704
  if (state === "hovered") {
2778
2705
  return {
2779
2706
  bg: base.bg,
2780
- bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2707
+ bg2: "",
2708
+ // Add color
2781
2709
  fg: base.fg,
2782
2710
  border: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
2783
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2711
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2784
2712
  };
2785
2713
  }
2786
2714
  if (state === "disabled") {
2787
2715
  return {
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")
2716
+ bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
2717
+ bg2: "",
2718
+ // Add color
2719
+ fg: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
2720
+ border: mix(base.bg, hues.gray[dark ? 900 : 100].hex),
2721
+ placeholder: mix(base.bg, hues.gray[dark ? 800 : 200].hex)
2793
2722
  };
2794
2723
  }
2795
2724
  if (state === "readOnly") {
2796
2725
  return {
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")
2726
+ bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
2727
+ bg2: "",
2728
+ // Add color
2729
+ fg: mix(base.bg, hues.gray[dark ? 200 : 800].hex),
2730
+ border: mix(base.bg, hues.gray[dark ? 800 : 200].hex),
2731
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2802
2732
  };
2803
2733
  }
2804
2734
  return {
2805
2735
  bg: base.bg,
2806
- bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2736
+ bg2: "",
2737
+ // Add color
2807
2738
  fg: base.fg,
2808
2739
  border: base.border,
2809
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2740
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex)
2810
2741
  };
2811
2742
  },
2812
2743
  selectable: _ref17 => {
@@ -3121,6 +3052,10 @@ const studioTheme = {
3121
3052
  },
3122
3053
  color,
3123
3054
  container: [320, 640, 960, 1280, 1600, 1920],
3055
+ focusRing: {
3056
+ offset: 1,
3057
+ width: 2
3058
+ },
3124
3059
  fonts,
3125
3060
  media: [360, 600, 900, 1200, 1800, 2400],
3126
3061
  radius: [0, 1, 3, 6, 9, 12, 21],
@@ -3129,9 +3064,9 @@ const studioTheme = {
3129
3064
  penumbra: [0, 0, 0, 0],
3130
3065
  ambient: [0, 0, 0, 0]
3131
3066
  }, {
3132
- umbra: [0, 3, 5, -1],
3067
+ umbra: [0, 3, 5, -2],
3133
3068
  penumbra: [0, 6, 10, 0],
3134
- ambient: [0, 1, 18, 0]
3069
+ ambient: [0, 1, 18, 1]
3135
3070
  }, {
3136
3071
  umbra: [0, 7, 8, -4],
3137
3072
  penumbra: [0, 12, 17, 2],
@@ -4577,64 +4512,6 @@ const Box = forwardRef(function Box2(props, ref) {
4577
4512
  children: props.children
4578
4513
  });
4579
4514
  });
4580
- var __freeze$y = Object.freeze;
4581
- var __defProp$z = Object.defineProperty;
4582
- var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
4583
- value: __freeze$y(raw || cooked.slice())
4584
- }));
4585
- var _a$y, _b$k, _c$b;
4586
- function labelBaseStyle(props) {
4587
- const {
4588
- $accent,
4589
- $muted,
4590
- theme
4591
- } = props;
4592
- const {
4593
- fonts
4594
- } = theme.sanity;
4595
- return css(_c$b || (_c$b = __template$y(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\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$y || (_a$y = __template$y(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$k || (_b$k = __template$y(["\n color: var(--card-muted-fg-color);\n "]))), fonts.code.family);
4596
- }
4597
- var __freeze$x = Object.freeze;
4598
- var __defProp$y = Object.defineProperty;
4599
- var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
4600
- value: __freeze$x(raw || cooked.slice())
4601
- }));
4602
- var _a$x;
4603
- const Root$z = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
4604
- const SpanWithTextOverflow$1 = styled.span(_a$x || (_a$x = __template$x(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
4605
- const Label = forwardRef(function Label2(props, ref) {
4606
- const {
4607
- accent,
4608
- align,
4609
- children: childrenProp,
4610
- muted = false,
4611
- size = 2,
4612
- textOverflow,
4613
- weight,
4614
- ...restProps
4615
- } = props;
4616
- let children = childrenProp;
4617
- if (textOverflow === "ellipsis") {
4618
- children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
4619
- children
4620
- });
4621
- } else {
4622
- children = /* @__PURE__ */jsx("span", {
4623
- children
4624
- });
4625
- }
4626
- return /* @__PURE__ */jsx(Root$z, {
4627
- "data-ui": "Label",
4628
- ...restProps,
4629
- $accent: accent,
4630
- $align: useArrayProp(align),
4631
- $muted: muted,
4632
- $size: useArrayProp(size),
4633
- $weight: weight,
4634
- ref,
4635
- children
4636
- });
4637
- });
4638
4515
  function badgeStyle(props) {
4639
4516
  const {
4640
4517
  $mode,
@@ -4653,18 +4530,18 @@ function badgeStyle(props) {
4653
4530
  }
4654
4531
  };
4655
4532
  }
4656
- const Root$y = styled(Box)(responsiveRadiusStyle, badgeStyle);
4533
+ const Root$z = styled(Box)(responsiveRadiusStyle, badgeStyle);
4657
4534
  const Badge = forwardRef(function Badge2(props, ref) {
4658
4535
  const {
4659
4536
  children,
4660
- fontSize,
4537
+ fontSize = 1,
4661
4538
  mode = "default",
4662
4539
  padding = 1,
4663
4540
  radius = 2,
4664
4541
  tone = "default",
4665
4542
  ...restProps
4666
4543
  } = props;
4667
- return /* @__PURE__ */jsx(Root$y, {
4544
+ return /* @__PURE__ */jsx(Root$z, {
4668
4545
  "data-ui": "Badge",
4669
4546
  ...restProps,
4670
4547
  $mode: mode,
@@ -4672,13 +4549,14 @@ const Badge = forwardRef(function Badge2(props, ref) {
4672
4549
  $radius: useArrayProp(radius),
4673
4550
  padding: useArrayProp(padding),
4674
4551
  ref,
4675
- children: /* @__PURE__ */jsx(Label, {
4552
+ children: /* @__PURE__ */jsx(Text, {
4676
4553
  size: fontSize,
4554
+ weight: "medium",
4677
4555
  children
4678
4556
  })
4679
4557
  });
4680
4558
  });
4681
- const Root$x = styled(Box)(flexItemStyle, responsiveFlexStyle);
4559
+ const Root$y = styled(Box)(flexItemStyle, responsiveFlexStyle);
4682
4560
  const Flex = forwardRef(function Flex2(props, ref) {
4683
4561
  const {
4684
4562
  align,
@@ -4692,7 +4570,7 @@ const Flex = forwardRef(function Flex2(props, ref) {
4692
4570
  return (
4693
4571
  // @ts-expect-error -- some dollar prefixed typings aren't inferred correctly https://github.com/styled-components/styled-components/issues/4062
4694
4572
  /* @__PURE__ */
4695
- jsx(Root$x, {
4573
+ jsx(Root$y, {
4696
4574
  "data-ui": "Flex",
4697
4575
  ...restProps,
4698
4576
  $align: useArrayProp(align),
@@ -4705,16 +4583,16 @@ const Flex = forwardRef(function Flex2(props, ref) {
4705
4583
  })
4706
4584
  );
4707
4585
  });
4708
- var __freeze$w = Object.freeze;
4709
- var __defProp$x = Object.defineProperty;
4710
- var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
4711
- value: __freeze$w(raw || cooked.slice())
4586
+ var __freeze$y = Object.freeze;
4587
+ var __defProp$z = Object.defineProperty;
4588
+ var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
4589
+ value: __freeze$y(raw || cooked.slice())
4712
4590
  }));
4713
- var _a$w, _b$j;
4714
- const rotate$1 = keyframes(_a$w || (_a$w = __template$w(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
4715
- const Root$w = styled(Text)(_b$j || (_b$j = __template$w(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
4591
+ var _a$y, _b$k;
4592
+ const rotate$1 = keyframes(_a$y || (_a$y = __template$y(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
4593
+ const Root$x = styled(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
4716
4594
  const Spinner = forwardRef(function Spinner2(props, ref) {
4717
- return /* @__PURE__ */jsx(Root$w, {
4595
+ return /* @__PURE__ */jsx(Root$x, {
4718
4596
  "data-ui": "Spinner",
4719
4597
  ...props,
4720
4598
  ref,
@@ -4752,14 +4630,14 @@ function _colorVarsStyle(base, color) {
4752
4630
  "--card-hairline-hard-color": color.border
4753
4631
  };
4754
4632
  }
4755
- var __freeze$v = Object.freeze;
4756
- var __defProp$w = Object.defineProperty;
4757
- var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
4758
- value: __freeze$v(raw || cooked.slice())
4633
+ var __freeze$x = Object.freeze;
4634
+ var __defProp$y = Object.defineProperty;
4635
+ var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
4636
+ value: __freeze$x(raw || cooked.slice())
4759
4637
  }));
4760
- var _a$v;
4638
+ var _a$x;
4761
4639
  function buttonBaseStyles() {
4762
- return css(_a$v || (_a$v = __template$v(["\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])));
4640
+ return css(_a$x || (_a$x = __template$x(["\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])));
4763
4641
  }
4764
4642
  const buttonTheme = {
4765
4643
  border: {
@@ -4819,14 +4697,14 @@ function buttonColorStyles(props) {
4819
4697
  }
4820
4698
  }, (_b = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.button) == null ? void 0 : _b.root].filter(Boolean);
4821
4699
  }
4822
- var __freeze$u = Object.freeze;
4823
- var __defProp$v = Object.defineProperty;
4824
- var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
4825
- value: __freeze$u(raw || cooked.slice())
4700
+ var __freeze$w = Object.freeze;
4701
+ var __defProp$x = Object.defineProperty;
4702
+ var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
4703
+ value: __freeze$w(raw || cooked.slice())
4826
4704
  }));
4827
- var _a$u;
4828
- const Root$v = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
4829
- const LoadingBox = styled.div(_a$u || (_a$u = __template$u(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
4705
+ var _a$w;
4706
+ const Root$w = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
4707
+ const LoadingBox = styled.div(_a$w || (_a$w = __template$w(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
4830
4708
  const Button = forwardRef(function Button2(props, ref) {
4831
4709
  const {
4832
4710
  children,
@@ -4875,7 +4753,7 @@ const Button = forwardRef(function Button2(props, ref) {
4875
4753
  paddingLeft,
4876
4754
  paddingRight
4877
4755
  }), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
4878
- return /* @__PURE__ */jsxs(Root$v, {
4756
+ return /* @__PURE__ */jsxs(Root$w, {
4879
4757
  "data-ui": "Button",
4880
4758
  ...restProps,
4881
4759
  $mode: mode,
@@ -4920,12 +4798,12 @@ const Button = forwardRef(function Button2(props, ref) {
4920
4798
  })]
4921
4799
  });
4922
4800
  });
4923
- var __freeze$t = Object.freeze;
4924
- var __defProp$u = Object.defineProperty;
4925
- var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
4926
- value: __freeze$t(raw || cooked.slice())
4801
+ var __freeze$v = Object.freeze;
4802
+ var __defProp$w = Object.defineProperty;
4803
+ var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
4804
+ value: __freeze$v(raw || cooked.slice())
4927
4805
  }));
4928
- var _a$t, _b$i, _c$a;
4806
+ var _a$v, _b$j, _c$b;
4929
4807
  function cardStyle(props) {
4930
4808
  return [cardBaseStyle(props), cardColorStyle(props)];
4931
4809
  }
@@ -4935,7 +4813,7 @@ function cardBaseStyle(props) {
4935
4813
  theme
4936
4814
  } = props;
4937
4815
  const space = theme.sanity.space;
4938
- return css(_b$i || (_b$i = __template$t(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && css(_a$t || (_a$t = __template$t(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
4816
+ return css(_b$j || (_b$j = __template$v(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && css(_a$v || (_a$v = __template$v(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
4939
4817
  }
4940
4818
  function cardColorStyle(props) {
4941
4819
  var _a2, _b2;
@@ -4956,7 +4834,7 @@ function cardColorStyle(props) {
4956
4834
  width: 0,
4957
4835
  color: "var(--card-border-color)"
4958
4836
  };
4959
- return css(_c$a || (_c$a = __template$t(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), dark ? "dark" : "light", _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
4837
+ return css(_c$b || (_c$b = __template$v(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), dark ? "dark" : "light", _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
4960
4838
  base,
4961
4839
  border,
4962
4840
  focusRing
@@ -4966,7 +4844,7 @@ function cardColorStyle(props) {
4966
4844
  focusRing
4967
4845
  }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
4968
4846
  }
4969
- const Root$u = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
4847
+ const Root$v = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
4970
4848
  const Card = forwardRef(function Card2(props, ref) {
4971
4849
  const {
4972
4850
  __unstable_checkered: checkered = false,
@@ -4991,7 +4869,7 @@ const Card = forwardRef(function Card2(props, ref) {
4991
4869
  return /* @__PURE__ */jsx(ThemeColorProvider, {
4992
4870
  scheme,
4993
4871
  tone,
4994
- children: /* @__PURE__ */jsx(Root$u, {
4872
+ children: /* @__PURE__ */jsx(Root$v, {
4995
4873
  "data-as": typeof as === "string" ? as : void 0,
4996
4874
  "data-scheme": rootTheme.scheme,
4997
4875
  "data-ui": "Card",
@@ -5016,14 +4894,14 @@ const Card = forwardRef(function Card2(props, ref) {
5016
4894
  })
5017
4895
  });
5018
4896
  });
5019
- var __freeze$s = Object.freeze;
5020
- var __defProp$t = Object.defineProperty;
5021
- var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
5022
- value: __freeze$s(raw || cooked.slice())
4897
+ var __freeze$u = Object.freeze;
4898
+ var __defProp$v = Object.defineProperty;
4899
+ var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
4900
+ value: __freeze$u(raw || cooked.slice())
5023
4901
  }));
5024
- var _a$s, _b$h;
4902
+ var _a$u, _b$i;
5025
4903
  function checkboxBaseStyles() {
5026
- return css(_a$s || (_a$s = __template$s(["\n position: relative;\n display: inline-block;\n "])));
4904
+ return css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
5027
4905
  }
5028
4906
  function inputElementStyles(props) {
5029
4907
  const {
@@ -5037,7 +4915,7 @@ function inputElementStyles(props) {
5037
4915
  const {
5038
4916
  focusRing
5039
4917
  } = 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({
4918
+ return css(_b$i || (_b$i = __template$u(["\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({
5041
4919
  color: color.default.enabled.border,
5042
4920
  width: input.border.width
5043
4921
  }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
@@ -5070,7 +4948,7 @@ function inputElementStyles(props) {
5070
4948
  color: color.default.readOnly.border
5071
4949
  }), color.default.readOnly.fg, color.default.readOnly.bg2);
5072
4950
  }
5073
- const Root$t = styled.div(checkboxBaseStyles);
4951
+ const Root$u = styled.div(checkboxBaseStyles);
5074
4952
  const Input$5 = styled.input(inputElementStyles);
5075
4953
  const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
5076
4954
  const {
@@ -5090,7 +4968,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
5090
4968
  ref.current.indeterminate = indeterminate || false;
5091
4969
  }
5092
4970
  }, [indeterminate, ref]);
5093
- return /* @__PURE__ */jsxs(Root$t, {
4971
+ return /* @__PURE__ */jsxs(Root$u, {
5094
4972
  className,
5095
4973
  "data-ui": "Checkbox",
5096
4974
  style,
@@ -5108,12 +4986,12 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
5108
4986
  })]
5109
4987
  });
5110
4988
  });
5111
- var __freeze$r = Object.freeze;
5112
- var __defProp$s = Object.defineProperty;
5113
- var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
5114
- value: __freeze$r(raw || cooked.slice())
4989
+ var __freeze$t = Object.freeze;
4990
+ var __defProp$u = Object.defineProperty;
4991
+ var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
4992
+ value: __freeze$t(raw || cooked.slice())
5115
4993
  }));
5116
- var _a$r;
4994
+ var _a$t;
5117
4995
  function codeSyntaxHighlightingStyle(_ref20) {
5118
4996
  let {
5119
4997
  theme
@@ -5231,9 +5109,9 @@ function codeSyntaxHighlightingStyle(_ref20) {
5231
5109
  };
5232
5110
  }
5233
5111
  function codeBaseStyle() {
5234
- return css(_a$r || (_a$r = __template$r(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ", "\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\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 "])), codeSyntaxHighlightingStyle);
5112
+ return css(_a$t || (_a$t = __template$t(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ", "\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\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 "])), codeSyntaxHighlightingStyle);
5235
5113
  }
5236
- const Root$s = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
5114
+ const Root$t = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
5237
5115
  const Code = forwardRef(function Code2(props, ref) {
5238
5116
  const {
5239
5117
  children,
@@ -5244,7 +5122,7 @@ const Code = forwardRef(function Code2(props, ref) {
5244
5122
  } = props;
5245
5123
  const language = typeof languageProp === "string" ? languageProp : void 0;
5246
5124
  const registered = language ? Refractor.hasLanguage(language) : false;
5247
- return /* @__PURE__ */jsxs(Root$s, {
5125
+ return /* @__PURE__ */jsxs(Root$t, {
5248
5126
  "data-ui": "Code",
5249
5127
  ...restProps,
5250
5128
  $size: useArrayProp(size),
@@ -5278,14 +5156,14 @@ function responsiveContainerWidthStyle(props) {
5278
5156
  maxWidth: val === "auto" ? "none" : rem(container[val])
5279
5157
  }));
5280
5158
  }
5281
- const Root$r = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
5159
+ const Root$s = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
5282
5160
  const Container = forwardRef(function Container2(props, ref) {
5283
5161
  const {
5284
5162
  as,
5285
5163
  width = 2,
5286
5164
  ...restProps
5287
5165
  } = props;
5288
- return /* @__PURE__ */jsx(Root$r, {
5166
+ return /* @__PURE__ */jsx(Root$s, {
5289
5167
  "data-ui": "Container",
5290
5168
  ...restProps,
5291
5169
  $width: useArrayProp(width),
@@ -5293,7 +5171,7 @@ const Container = forwardRef(function Container2(props, ref) {
5293
5171
  ref
5294
5172
  });
5295
5173
  });
5296
- const Root$q = styled(Box)(responsiveGridStyle);
5174
+ const Root$r = styled(Box)(responsiveGridStyle);
5297
5175
  const Grid = forwardRef(function Grid2(props, ref) {
5298
5176
  const {
5299
5177
  as,
@@ -5308,7 +5186,7 @@ const Grid = forwardRef(function Grid2(props, ref) {
5308
5186
  children,
5309
5187
  ...restProps
5310
5188
  } = props;
5311
- return /* @__PURE__ */jsx(Root$q, {
5189
+ return /* @__PURE__ */jsx(Root$r, {
5312
5190
  "data-as": typeof as === "string" ? as : void 0,
5313
5191
  "data-ui": "Grid",
5314
5192
  ...restProps,
@@ -5325,28 +5203,28 @@ const Grid = forwardRef(function Grid2(props, ref) {
5325
5203
  children
5326
5204
  });
5327
5205
  });
5328
- var __freeze$q = Object.freeze;
5329
- var __defProp$r = Object.defineProperty;
5330
- var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
5331
- value: __freeze$q(raw || cooked.slice())
5206
+ var __freeze$s = Object.freeze;
5207
+ var __defProp$t = Object.defineProperty;
5208
+ var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
5209
+ value: __freeze$s(raw || cooked.slice())
5332
5210
  }));
5333
- var _a$q, _b$g, _c$9;
5211
+ var _a$s, _b$h, _c$a;
5334
5212
  function headingBaseStyle(props) {
5335
5213
  const {
5336
5214
  $accent,
5337
5215
  $muted,
5338
5216
  theme
5339
5217
  } = props;
5340
- return css(_c$9 || (_c$9 = __template$q(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\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 & 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$q || (_a$q = __template$q(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$g || (_b$g = __template$q(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family);
5218
+ return css(_c$a || (_c$a = __template$s(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\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 & 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$s || (_a$s = __template$s(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$h || (_b$h = __template$s(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family);
5341
5219
  }
5342
- var __freeze$p = Object.freeze;
5343
- var __defProp$q = Object.defineProperty;
5344
- var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
5345
- value: __freeze$p(raw || cooked.slice())
5220
+ var __freeze$r = Object.freeze;
5221
+ var __defProp$s = Object.defineProperty;
5222
+ var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
5223
+ value: __freeze$r(raw || cooked.slice())
5346
5224
  }));
5347
- var _a$p;
5348
- const Root$p = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
5349
- const SpanWithTextOverflow = styled.span(_a$p || (_a$p = __template$p(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
5225
+ var _a$r;
5226
+ const Root$q = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
5227
+ const SpanWithTextOverflow$1 = styled.span(_a$r || (_a$r = __template$r(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
5350
5228
  const Heading = forwardRef(function Heading2(props, ref) {
5351
5229
  const {
5352
5230
  accent = false,
@@ -5360,11 +5238,11 @@ const Heading = forwardRef(function Heading2(props, ref) {
5360
5238
  } = props;
5361
5239
  let children = childrenProp;
5362
5240
  if (textOverflow === "ellipsis") {
5363
- children = /* @__PURE__ */jsx(SpanWithTextOverflow, {
5241
+ children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
5364
5242
  children
5365
5243
  });
5366
5244
  }
5367
- return /* @__PURE__ */jsx(Root$p, {
5245
+ return /* @__PURE__ */jsx(Root$q, {
5368
5246
  "data-ui": "Heading",
5369
5247
  ...restProps,
5370
5248
  $accent: accent,
@@ -5404,7 +5282,7 @@ function inlineSpaceStyle(props) {
5404
5282
  };
5405
5283
  });
5406
5284
  }
5407
- const Root$o = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
5285
+ const Root$p = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
5408
5286
  const Inline = forwardRef(function Inline2(props, ref) {
5409
5287
  const {
5410
5288
  as,
@@ -5415,7 +5293,7 @@ const Inline = forwardRef(function Inline2(props, ref) {
5415
5293
  const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsx("div", {
5416
5294
  children: child
5417
5295
  }, idx)), [childrenProp]);
5418
- return /* @__PURE__ */jsx(Root$o, {
5296
+ return /* @__PURE__ */jsx(Root$p, {
5419
5297
  "data-ui": "Inline",
5420
5298
  ...restProps,
5421
5299
  $space: useArrayProp(space),
@@ -5424,16 +5302,16 @@ const Inline = forwardRef(function Inline2(props, ref) {
5424
5302
  children
5425
5303
  });
5426
5304
  });
5427
- var __freeze$o = Object.freeze;
5428
- var __defProp$p = Object.defineProperty;
5429
- var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5430
- value: __freeze$o(raw || cooked.slice())
5305
+ var __freeze$q = Object.freeze;
5306
+ var __defProp$r = Object.defineProperty;
5307
+ var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
5308
+ value: __freeze$q(raw || cooked.slice())
5431
5309
  }));
5432
- var _a$o;
5310
+ var _a$q;
5433
5311
  function kbdStyle() {
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 "])));
5312
+ return css(_a$q || (_a$q = __template$q(["\n background: var(--card-bg2-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
5435
5313
  }
5436
- const Root$n = styled.kbd(responsiveRadiusStyle, kbdStyle);
5314
+ const Root$o = styled.kbd(responsiveRadiusStyle, kbdStyle);
5437
5315
  const KBD = forwardRef(function KBD2(props, ref) {
5438
5316
  const {
5439
5317
  children,
@@ -5442,7 +5320,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
5442
5320
  radius = 2,
5443
5321
  ...restProps
5444
5322
  } = props;
5445
- return /* @__PURE__ */jsx(Root$n, {
5323
+ return /* @__PURE__ */jsx(Root$o, {
5446
5324
  "data-ui": "KBD",
5447
5325
  ...restProps,
5448
5326
  $radius: useArrayProp(radius),
@@ -5460,6 +5338,64 @@ const KBD = forwardRef(function KBD2(props, ref) {
5460
5338
  })
5461
5339
  });
5462
5340
  });
5341
+ var __freeze$p = Object.freeze;
5342
+ var __defProp$q = Object.defineProperty;
5343
+ var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
5344
+ value: __freeze$p(raw || cooked.slice())
5345
+ }));
5346
+ var _a$p, _b$g, _c$9;
5347
+ function labelBaseStyle(props) {
5348
+ const {
5349
+ $accent,
5350
+ $muted,
5351
+ theme
5352
+ } = props;
5353
+ const {
5354
+ fonts
5355
+ } = theme.sanity;
5356
+ return css(_c$9 || (_c$9 = __template$p(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\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$p || (_a$p = __template$p(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$g || (_b$g = __template$p(["\n color: var(--card-muted-fg-color);\n "]))), fonts.code.family);
5357
+ }
5358
+ var __freeze$o = Object.freeze;
5359
+ var __defProp$p = Object.defineProperty;
5360
+ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5361
+ value: __freeze$o(raw || cooked.slice())
5362
+ }));
5363
+ var _a$o;
5364
+ const Root$n = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
5365
+ const SpanWithTextOverflow = styled.span(_a$o || (_a$o = __template$o(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
5366
+ const Label = forwardRef(function Label2(props, ref) {
5367
+ const {
5368
+ accent,
5369
+ align,
5370
+ children: childrenProp,
5371
+ muted = false,
5372
+ size = 2,
5373
+ textOverflow,
5374
+ weight,
5375
+ ...restProps
5376
+ } = props;
5377
+ let children = childrenProp;
5378
+ if (textOverflow === "ellipsis") {
5379
+ children = /* @__PURE__ */jsx(SpanWithTextOverflow, {
5380
+ children
5381
+ });
5382
+ } else {
5383
+ children = /* @__PURE__ */jsx("span", {
5384
+ children
5385
+ });
5386
+ }
5387
+ return /* @__PURE__ */jsx(Root$n, {
5388
+ "data-ui": "Label",
5389
+ ...restProps,
5390
+ $accent: accent,
5391
+ $align: useArrayProp(align),
5392
+ $muted: muted,
5393
+ $size: useArrayProp(size),
5394
+ $weight: weight,
5395
+ ref,
5396
+ children
5397
+ });
5398
+ });
5463
5399
  const key$7 = Symbol.for("@sanity/ui/context/boundaryElement");
5464
5400
  globalScope[key$7] = globalScope[key$7] || createContext(null);
5465
5401
  const BoundaryElementContext = globalScope[key$7];
@@ -6838,7 +6774,7 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
6838
6774
  disabled = false,
6839
6775
  fontSize = 2,
6840
6776
  padding = 3,
6841
- radius = 1,
6777
+ radius = 2,
6842
6778
  weight,
6843
6779
  ...restProps
6844
6780
  } = props;
@@ -6912,7 +6848,7 @@ const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
6912
6848
  onClear,
6913
6849
  padding: paddingProp = 3,
6914
6850
  prefix,
6915
- radius: radiusProp = 1,
6851
+ radius: radiusProp = 2,
6916
6852
  readOnly,
6917
6853
  space: spaceProp = 3,
6918
6854
  suffix,
@@ -7949,6 +7885,7 @@ const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
7949
7885
  }, itemIndex))
7950
7886
  });
7951
7887
  });
7888
+ const BORDER_OFFSET_X = 12;
7952
7889
  function dialogStyle(_ref24) {
7953
7890
  let {
7954
7891
  theme
@@ -8003,9 +7940,9 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
8003
7940
  const DialogContainer = styled(Container)(_a$b || (_a$b = __template$b(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
8004
7941
  const DialogCardRoot = styled(Card)(_b$6 || (_b$6 = __template$b(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n overflow: clip;\n"])));
8005
7942
  const DialogLayout = styled(Flex)(_c$2 || (_c$2 = __template$b(["\n flex: 1;\n min-height: 0;\n width: 100%;\n"])));
8006
- const DialogHeader = styled(Card)(_d$1 || (_d$1 = __template$b(["\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-bottom: 1px solid var(--card-hairline-soft-color);\n }\n"])));
7943
+ const DialogHeader = styled(Box)(_d$1 || (_d$1 = __template$b(["\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n bottom: -1px;\n border-bottom: 1px solid var(--card-border-color);\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, props => props.$isContentScrollable && props.$hasScrolledFromTop ? 1 : 0);
8007
7944
  const DialogContent = styled(Box)(_e || (_e = __template$b(["\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n"])));
8008
- const DialogFooter = styled(Box)(_f || (_f = __template$b(["\n position: relative;\n z-index: 3;\n border-top: 1px solid var(--card-hairline-soft-color);\n"])));
7945
+ const DialogFooter = styled(Box)(_f || (_f = __template$b(["\n position: relative;\n z-index: 3;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n top: -1px;\n border-top: 1px solid var(--card-border-color);\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, props => props.$isContentScrollable && !props.$hasScrolledToBottom ? 1 : 0);
8009
7946
  const DialogCard = forwardRef(function DialogCard2(props, ref) {
8010
7947
  var _a2;
8011
7948
  const {
@@ -8040,6 +7977,9 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
8040
7977
  const labelId = "".concat(id, "_label");
8041
7978
  const showCloseButton = Boolean(onClose) && hideCloseButton === false;
8042
7979
  const showHeader = Boolean(header) || showCloseButton;
7980
+ const [isContentScrollable, setIsContentScrollable] = useState(false);
7981
+ const [hasScrolledFromTop, setHasScrolledFromTop] = useState(false);
7982
+ const [hasScrolledToBottom, setHasScrolledToBottom] = useState(false);
8043
7983
  useEffect(() => {
8044
7984
  if (!autoFocus) return;
8045
7985
  if (forwardedRef.current) {
@@ -8074,6 +8014,22 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
8074
8014
  localContentRef.current = el;
8075
8015
  if (typeof contentRef === "function") contentRef(el);else if (contentRef) contentRef.current = el;
8076
8016
  }, [contentRef]);
8017
+ const handleContentUpdate = useCallback(() => {
8018
+ if (localContentRef.current) {
8019
+ setIsContentScrollable(localContentRef.current.clientHeight < localContentRef.current.scrollHeight);
8020
+ setHasScrolledFromTop(localContentRef.current.scrollTop > 0);
8021
+ setHasScrolledToBottom(localContentRef.current.scrollTop >= localContentRef.current.scrollHeight - localContentRef.current.clientHeight);
8022
+ }
8023
+ }, []);
8024
+ useEffect(() => {
8025
+ const resizeObserver = new ResizeObserver(handleContentUpdate);
8026
+ if (localContentRef.current) {
8027
+ resizeObserver.observe(localContentRef.current);
8028
+ }
8029
+ return () => {
8030
+ resizeObserver.disconnect();
8031
+ };
8032
+ }, [contentRef, handleContentUpdate]);
8077
8033
  return /* @__PURE__ */jsx(DialogContainer, {
8078
8034
  "data-ui": "DialogCard",
8079
8035
  width,
@@ -8085,33 +8041,38 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
8085
8041
  children: /* @__PURE__ */jsxs(DialogLayout, {
8086
8042
  direction: "column",
8087
8043
  children: [showHeader && /* @__PURE__ */jsx(DialogHeader, {
8044
+ $isContentScrollable: isContentScrollable,
8045
+ $hasScrolledFromTop: hasScrolledFromTop,
8046
+ padding: 3,
8088
8047
  children: /* @__PURE__ */jsxs(Flex, {
8048
+ align: "center",
8089
8049
  children: [/* @__PURE__ */jsx(Box, {
8090
8050
  flex: 1,
8091
- padding: 4,
8051
+ padding: 3,
8092
8052
  children: header && /* @__PURE__ */jsx(Text, {
8093
8053
  id: labelId,
8094
- weight: "semibold",
8054
+ size: 1,
8055
+ weight: "medium",
8095
8056
  children: header
8096
8057
  })
8097
- }), showCloseButton && /* @__PURE__ */jsx(Box, {
8098
- padding: 2,
8099
- children: /* @__PURE__ */jsx(Button, {
8100
- "aria-label": "Close dialog",
8101
- disabled: !onClose,
8102
- icon: CloseIcon,
8103
- mode: "bleed",
8104
- onClick: onClose,
8105
- padding: 3
8106
- })
8058
+ }), showCloseButton && /* @__PURE__ */jsx(Button, {
8059
+ "aria-label": "Close dialog",
8060
+ disabled: !onClose,
8061
+ icon: CloseIcon,
8062
+ mode: "bleed",
8063
+ onClick: onClose,
8064
+ padding: 3
8107
8065
  })]
8108
8066
  })
8109
8067
  }), /* @__PURE__ */jsx(DialogContent, {
8110
8068
  flex: 1,
8111
8069
  ref: setContentRef,
8112
8070
  tabIndex: -1,
8071
+ onScroll: handleContentUpdate,
8113
8072
  children
8114
8073
  }), footer && /* @__PURE__ */jsx(DialogFooter, {
8074
+ $isContentScrollable: isContentScrollable,
8075
+ $hasScrolledToBottom: hasScrolledToBottom,
8115
8076
  children: footer
8116
8077
  })]
8117
8078
  })
@@ -8744,7 +8705,7 @@ function selectableColorStyle(props) {
8744
8705
  selectable
8745
8706
  } = theme.sanity.color;
8746
8707
  const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
8747
- return css(_b$4 || (_b$4 = __template$7(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
8708
+ return css(_b$4 || (_b$4 = __template$7(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
8748
8709
  }
8749
8710
  const Selectable = styled(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
8750
8711
  function useMenu() {
@@ -8761,7 +8722,7 @@ function MenuGroup(props) {
8761
8722
  const {
8762
8723
  as = "button",
8763
8724
  children,
8764
- fontSize,
8725
+ fontSize = 1,
8765
8726
  icon,
8766
8727
  onClick,
8767
8728
  padding = 3,
@@ -8773,6 +8734,9 @@ function MenuGroup(props) {
8773
8734
  ...restProps
8774
8735
  } = props;
8775
8736
  const menu = useMenu();
8737
+ const {
8738
+ scheme
8739
+ } = useRootTheme();
8776
8740
  const {
8777
8741
  activeElement,
8778
8742
  mount,
@@ -8861,34 +8825,31 @@ function MenuGroup(props) {
8861
8825
  "data-selected": !withinMenu && active ? "" : void 0,
8862
8826
  $radius: useArrayProp(radius),
8863
8827
  $tone: tone,
8828
+ $scheme: scheme,
8864
8829
  onClick: handleClick,
8865
8830
  onKeyDown: handleKeyDown,
8866
8831
  onMouseEnter: handleMouseEnter,
8867
8832
  ref: setRootElement,
8868
8833
  tabIndex: -1,
8869
8834
  type: as === "button" ? "button" : void 0,
8870
- children: /* @__PURE__ */jsx(Box, {
8835
+ children: /* @__PURE__ */jsxs(Flex, {
8836
+ gap: space,
8871
8837
  padding,
8872
- children: /* @__PURE__ */jsxs(Flex, {
8873
- children: [icon && /* @__PURE__ */jsxs(Text, {
8838
+ children: [icon && /* @__PURE__ */jsxs(Text, {
8839
+ size: fontSize,
8840
+ children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
8841
+ }), /* @__PURE__ */jsx(Box, {
8842
+ flex: 1,
8843
+ children: /* @__PURE__ */jsx(Text, {
8874
8844
  size: fontSize,
8875
- children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
8876
- }), /* @__PURE__ */jsx(Box, {
8877
- flex: 1,
8878
- marginLeft: icon ? space : void 0,
8879
- children: /* @__PURE__ */jsx(Text, {
8880
- size: fontSize,
8881
- textOverflow: "ellipsis",
8882
- children: text
8883
- })
8884
- }), /* @__PURE__ */jsx(Box, {
8885
- marginLeft: space,
8886
- children: /* @__PURE__ */jsx(Text, {
8887
- size: fontSize,
8888
- children: /* @__PURE__ */jsx(ChevronRightIcon, {})
8889
- })
8890
- })]
8891
- })
8845
+ textOverflow: "ellipsis",
8846
+ weight: "medium",
8847
+ children: text
8848
+ })
8849
+ }), /* @__PURE__ */jsx(Text, {
8850
+ size: fontSize,
8851
+ children: /* @__PURE__ */jsx(ChevronRightIcon, {})
8852
+ })]
8892
8853
  })
8893
8854
  })
8894
8855
  });
@@ -8898,7 +8859,7 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
8898
8859
  as = "button",
8899
8860
  children,
8900
8861
  disabled,
8901
- fontSize = 2,
8862
+ fontSize = 1,
8902
8863
  hotkeys,
8903
8864
  icon,
8904
8865
  iconRight,
@@ -8918,6 +8879,9 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
8918
8879
  tone = "default",
8919
8880
  ...restProps
8920
8881
  } = props;
8882
+ const {
8883
+ scheme
8884
+ } = useRootTheme();
8921
8885
  const menu = useMenu();
8922
8886
  const {
8923
8887
  activeElement,
@@ -8958,7 +8922,8 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
8958
8922
  forwardedAs: as,
8959
8923
  $radius: useArrayProp(radius),
8960
8924
  $padding: useArrayProp(0),
8961
- $tone: tone,
8925
+ $tone: disabled ? "default" : tone,
8926
+ $scheme: scheme,
8962
8927
  disabled,
8963
8928
  onClick: handleClick,
8964
8929
  onMouseEnter: onItemMouseEnter,
@@ -8967,38 +8932,33 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
8967
8932
  role: "menuitem",
8968
8933
  tabIndex: -1,
8969
8934
  type: as === "button" ? "button" : void 0,
8970
- children: [(icon || text || iconRight) && /* @__PURE__ */jsx(Box, {
8935
+ children: [(icon || text || iconRight) && /* @__PURE__ */jsxs(Flex, {
8971
8936
  as: "span",
8937
+ gap: space,
8938
+ align: "center",
8972
8939
  ...paddingProps,
8973
- children: /* @__PURE__ */jsxs(Flex, {
8974
- as: "span",
8975
- children: [icon && /* @__PURE__ */jsxs(Text, {
8976
- size: fontSize,
8977
- children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
8978
- }), text && /* @__PURE__ */jsx(Box, {
8979
- flex: 1,
8980
- marginLeft: icon ? space : void 0,
8981
- marginRight: iconRight ? space : void 0,
8982
- children: /* @__PURE__ */jsx(Text, {
8983
- size: fontSize,
8984
- textOverflow: "ellipsis",
8985
- children: text
8986
- })
8987
- }), hotkeys && /* @__PURE__ */jsx(Box, {
8988
- marginLeft: space,
8989
- style: {
8990
- marginTop: -4,
8991
- marginBottom: -4
8992
- },
8993
- children: /* @__PURE__ */jsx(Hotkeys, {
8994
- fontSize,
8995
- keys: hotkeys
8996
- })
8997
- }), iconRight && /* @__PURE__ */jsxs(Text, {
8940
+ children: [icon && /* @__PURE__ */jsxs(Text, {
8941
+ size: fontSize,
8942
+ children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
8943
+ }), text && /* @__PURE__ */jsx(Box, {
8944
+ flex: 1,
8945
+ children: /* @__PURE__ */jsx(Text, {
8998
8946
  size: fontSize,
8999
- children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
9000
- })]
9001
- })
8947
+ textOverflow: "ellipsis",
8948
+ weight: "medium",
8949
+ children: text
8950
+ })
8951
+ }), hotkeys && /* @__PURE__ */jsx(Hotkeys, {
8952
+ fontSize,
8953
+ keys: hotkeys,
8954
+ style: {
8955
+ marginTop: -4,
8956
+ marginBottom: -4
8957
+ }
8958
+ }), iconRight && /* @__PURE__ */jsxs(Text, {
8959
+ size: fontSize,
8960
+ children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
8961
+ })]
9002
8962
  }), children && /* @__PURE__ */jsx(Box, {
9003
8963
  as: "span",
9004
8964
  ...paddingProps,
@@ -9911,5 +9871,5 @@ const TreeItem = memo(function TreeItem2(props) {
9911
9871
  })]
9912
9872
  });
9913
9873
  });
9914
- export { Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply$1 as multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen$1 as screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useToast, useTooltipDelayGroup, useTree };
9874
+ export { Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply$1 as multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen$1 as screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useToast, useTooltipDelayGroup, useTree };
9915
9875
  //# sourceMappingURL=index.esm.js.map