@sanity/ui 3.0.0-static.10 → 3.0.0-static.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.
Files changed (71) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +160 -207
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +161 -208
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +1 -3
  6. package/dist/_visual-editing.d.ts +1 -3
  7. package/dist/cli.js +1 -1
  8. package/dist/css.d.mts +115 -2
  9. package/dist/css.d.ts +115 -2
  10. package/dist/css.js +539 -402
  11. package/dist/css.js.map +1 -1
  12. package/dist/css.mjs +541 -404
  13. package/dist/css.mjs.map +1 -1
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +50 -17
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +45 -12
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/sanity-theme.css +1 -1
  21. package/dist/system.css +418 -182
  22. package/dist/theme.js +10 -11
  23. package/dist/theme.js.map +1 -1
  24. package/dist/theme.mjs +10 -11
  25. package/dist/theme.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/src/css/_resp.ts +0 -1
  28. package/src/css/aspects/font/font.style.ts +7 -66
  29. package/src/css/aspects/shadow/shadow.style.ts +16 -41
  30. package/src/css/compile/compilePalette.ts +4 -3
  31. package/src/css/compile/compileSystem.ts +0 -3
  32. package/src/css/compile/compileTheme_v3.ts +233 -219
  33. package/src/css/components/skeleton/skeleton.style.ts +8 -4
  34. package/src/css/constants.ts +9 -0
  35. package/src/css/index.ts +1 -0
  36. package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
  37. package/src/css/primitives/_arrow/_arrow.ts +4 -0
  38. package/src/css/primitives/_selectable/_selectable.style.ts +23 -23
  39. package/src/css/primitives/button/button.style.ts +48 -15
  40. package/src/css/primitives/card/card.style.ts +1 -1
  41. package/src/css/primitives/token/token.style.ts +37 -36
  42. package/src/css/responsiveRules.ts +12 -19
  43. package/src/css/types.ts +106 -3
  44. package/src/css/varNames.ts +101 -4
  45. package/src/css/vars.ts +52 -16
  46. package/src/theme/v3/buildTheme_v3.ts +1 -1
  47. package/src/theme/v3/{defaults.ts → defaultTokens.ts} +1 -2
  48. package/src/theme/v3/index.ts +1 -1
  49. package/src/theme/v3/resolveTokens.ts +9 -9
  50. package/src/ui/RootClassNames.tsx +41 -0
  51. package/src/ui/_compat/helpers.ts +72 -0
  52. package/src/ui/_compat/index.ts +2 -6
  53. package/src/ui/_compat/studioTheme.ts +7 -0
  54. package/src/ui/_compat/types.ts +0 -83
  55. package/src/ui/index.ts +1 -0
  56. package/src/ui/primitives/button/button.tsx +5 -6
  57. package/src/ui/primitives/popover/popover.tsx +25 -7
  58. package/src/ui/primitives/popover/popoverCard.tsx +46 -45
  59. package/src/ui/primitives/tooltip/tooltip.tsx +9 -2
  60. package/src/ui/primitives/tooltip/tooltipCard.tsx +1 -1
  61. package/src/ui/utils/arrow/arrow.tsx +3 -11
  62. package/src/ui/utils/elementQuery/elementQuery.tsx +10 -8
  63. package/src/ui/utils/virtualList/virtualList.tsx +37 -32
  64. package/src/css/components/breadcrumbs/rules.ts +0 -25
  65. package/src/css/components/dialog/rules.ts +0 -78
  66. package/src/css/components/skeleton/rules.ts +0 -113
  67. package/src/css/components/toast/rules.ts +0 -18
  68. package/src/css/components/tree/rules.ts +0 -168
  69. package/src/css/primitives/popover/rules.ts +0 -5
  70. package/src/css/primitives/spinner/rules.ts +0 -21
  71. package/src/css/primitives/token/rules.ts +0 -45
@@ -1,9 +1,9 @@
1
+ import { buildTheme, getScopedTheme, getTheme_v2 } from "@sanity/ui/theme";
1
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
3
  import { c } from "react-compiler-runtime";
3
- import { getScopedTheme, getTheme_v2, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, buildTheme } from "@sanity/ui/theme";
4
4
  import { createContext, useContext, useState, useEffect, useDebugValue, useSyncExternalStore, forwardRef, Children, isValidElement, cloneElement, createElement, useRef, useImperativeHandle, lazy, Suspense, memo, useMemo, useCallback, useId, useLayoutEffect } from "react";
5
5
  import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from "styled-components";
6
- import { composeClassNames, box, label, textOverflow, avatar, avatarArrow, avatarInitials, avatarImage, avatarCounter, avatarStack, text, badge, animatedSpinnerIcon, spinner, buttonLoadingBox, button, card, checkbox, checkboxInput, code, container, heading, kbd, _arrow, _arrowStroke, _arrowShape, srOnly, popoverCard, radio, select, _inputElement, selectPresentation, stack, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, _inputPresentation, textInput, tooltipCard, tooltip, menu, menuDivider, _selectable } from "@sanity/ui/css";
6
+ import { composeClassNames, box, label, textOverflow, avatar, avatarArrow, avatarInitials, avatarImage, avatarCounter, avatarStack, text, badge, animatedSpinnerIcon, spinner, buttonLoadingBox, button, card, checkbox, checkboxInput, code, container, heading, kbd, _arrow, _arrowStrokeMask, _arrowStroke, _arrowShape, BREAKPOINTS, srOnly, vars, popoverCard, radio, select, _inputElement, selectPresentation, stack, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, _inputPresentation, textInput, tooltipCard, tooltip, menu, menuDivider, _selectable } from "@sanity/ui/css";
7
7
  import ReactIs, { isValidElementType } from "react-is";
8
8
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
9
9
  import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
@@ -11,6 +11,7 @@ import { motion, AnimatePresence } from "framer-motion";
11
11
  import { ResizeObserver } from "@juggle/resize-observer";
12
12
  import { useEffectEvent } from "use-effect-event";
13
13
  import { createPortal } from "react-dom";
14
+ const studioTheme = buildTheme();
14
15
  function getGlobalScope() {
15
16
  if (typeof globalThis < "u") return globalThis;
16
17
  if (typeof window < "u") return window;
@@ -107,14 +108,7 @@ function useTheme_v2() {
107
108
  let t1;
108
109
  return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
109
110
  }
110
- const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1, studioTheme = /* @__PURE__ */ (() => {
111
- let theme;
112
- return {
113
- get value() {
114
- return theme || (theme = buildTheme()), theme;
115
- }
116
- };
117
- })(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
111
+ const EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
118
112
  card: {
119
113
  initial: {
120
114
  scale: 0.97,
@@ -744,7 +738,7 @@ const Spinner = forwardRef(function(props, ref) {
744
738
  Spinner.displayName = "ForwardRef(Spinner)";
745
739
  const Button = forwardRef(function(props, ref) {
746
740
  const {
747
- align = "center",
741
+ // align = 'center',
748
742
  as: As = "button",
749
743
  children,
750
744
  className,
@@ -781,7 +775,7 @@ const Button = forwardRef(function(props, ref) {
781
775
  type = "button",
782
776
  muted = !1,
783
777
  width,
784
- wrap,
778
+ // wrap,
785
779
  ...restProps
786
780
  } = props;
787
781
  return /* @__PURE__ */ jsxs(As, { "data-ui": "Button", ...restProps, className: composeClassNames(className, button({
@@ -829,9 +823,6 @@ const Button = forwardRef(function(props, ref) {
829
823
  {
830
824
  as: "span",
831
825
  flex: 1,
832
- gap,
833
- gapX,
834
- gapY,
835
826
  padding,
836
827
  paddingX,
837
828
  paddingY,
@@ -1159,7 +1150,7 @@ function compileCommands(cmds) {
1159
1150
  return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
1160
1151
  }
1161
1152
  const Arrow = forwardRef(function(props, ref) {
1162
- const $ = c(31);
1153
+ const $ = c(30);
1163
1154
  let h, restProps, style, t0, w;
1164
1155
  $[0] !== props ? ({
1165
1156
  width: w,
@@ -1168,9 +1159,7 @@ const Arrow = forwardRef(function(props, ref) {
1168
1159
  style,
1169
1160
  ...restProps
1170
1161
  } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = style, $[4] = t0, $[5] = w) : (h = $[1], restProps = $[2], style = $[3], t0 = $[4], w = $[5]);
1171
- const radius = t0 === void 0 ? 0 : t0, {
1172
- card: card2
1173
- } = useTheme_v2(), strokeWidth = card2.shadow.outline, center = w / 2;
1162
+ const radius = t0 === void 0 ? 0 : t0, center = w / 2;
1174
1163
  let t1;
1175
1164
  const points = [{
1176
1165
  x: 0,
@@ -1203,24 +1192,25 @@ const Arrow = forwardRef(function(props, ref) {
1203
1192
  }, $[7] = style, $[8] = t3, $[9] = t4) : t4 = $[9];
1204
1193
  const t5 = t4, t6 = `0 0 ${w} ${w}`;
1205
1194
  let t7;
1206
- $[10] !== strokeWidth || $[11] !== w ? (t7 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[10] = strokeWidth, $[11] = w, $[12] = t7) : t7 = $[12];
1195
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t7 = _arrowStrokeMask(), $[10] = t7) : t7 = $[10];
1207
1196
  let t8;
1208
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowStroke(), $[13] = t8) : t8 = $[13];
1209
- const t9 = strokeWidth * 2;
1197
+ $[11] !== w ? (t8 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t7, x: 0, width: w, height: w, fill: "white" }) }), $[11] = w, $[12] = t8) : t8 = $[12];
1198
+ let t9;
1199
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t9 = _arrowStroke(), $[13] = t9) : t9 = $[13];
1210
1200
  let t10;
1211
- $[14] !== strokePath || $[15] !== t9 ? (t10 = /* @__PURE__ */ jsx("path", { className: t8, d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t9 }), $[14] = strokePath, $[15] = t9, $[16] = t10) : t10 = $[16];
1201
+ $[14] !== strokePath ? (t10 = /* @__PURE__ */ jsx("path", { className: t9, d: strokePath, mask: "url(#stroke-mask)" }), $[14] = strokePath, $[15] = t10) : t10 = $[15];
1212
1202
  let t11;
1213
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = _arrowShape(), $[17] = t11) : t11 = $[17];
1203
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t11 = _arrowShape(), $[16] = t11) : t11 = $[16];
1214
1204
  let t12;
1215
- $[18] !== fillPath ? (t12 = /* @__PURE__ */ jsx("path", { className: t11, d: fillPath }), $[18] = fillPath, $[19] = t12) : t12 = $[19];
1205
+ $[17] !== fillPath ? (t12 = /* @__PURE__ */ jsx("path", { className: t11, d: fillPath }), $[17] = fillPath, $[18] = t12) : t12 = $[18];
1216
1206
  let t13;
1217
- $[20] !== t10 || $[21] !== t12 || $[22] !== t6 || $[23] !== t7 || $[24] !== w ? (t13 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t6, children: [
1218
- t7,
1207
+ $[19] !== t10 || $[20] !== t12 || $[21] !== t6 || $[22] !== t8 || $[23] !== w ? (t13 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t6, children: [
1208
+ t8,
1219
1209
  t10,
1220
1210
  t12
1221
- ] }), $[20] = t10, $[21] = t12, $[22] = t6, $[23] = t7, $[24] = w, $[25] = t13) : t13 = $[25];
1211
+ ] }), $[19] = t10, $[20] = t12, $[21] = t6, $[22] = t8, $[23] = w, $[24] = t13) : t13 = $[24];
1222
1212
  let t14;
1223
- return $[26] !== ref || $[27] !== restProps || $[28] !== t13 || $[29] !== t5 ? (t14 = /* @__PURE__ */ jsx("div", { ...restProps, className: t2, ref, style: t5, children: t13 }), $[26] = ref, $[27] = restProps, $[28] = t13, $[29] = t5, $[30] = t14) : t14 = $[30], t14;
1213
+ return $[25] !== ref || $[26] !== restProps || $[27] !== t13 || $[28] !== t5 ? (t14 = /* @__PURE__ */ jsx("div", { ...restProps, className: t2, ref, style: t5, children: t13 }), $[25] = ref, $[26] = restProps, $[27] = t13, $[28] = t5, $[29] = t14) : t14 = $[29], t14;
1224
1214
  });
1225
1215
  Arrow.displayName = "ForwardRef(Arrow)";
1226
1216
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
@@ -1272,30 +1262,30 @@ function findMinBreakpoints(media2, width) {
1272
1262
  media2[i] <= width && ret.push(i);
1273
1263
  return ret;
1274
1264
  }
1275
- const ElementQuery = forwardRef(function(props, forwardedRef) {
1276
- const $ = c(18), theme = useTheme_v2();
1277
- let _media, children, restProps;
1265
+ const defaultBreakpoints = Object.values(BREAKPOINTS), ElementQuery = forwardRef(function(props, forwardedRef) {
1266
+ const $ = c(18);
1267
+ let children, mediaProp, restProps;
1278
1268
  $[0] !== props ? ({
1279
1269
  children,
1280
- media: _media,
1270
+ media: mediaProp,
1281
1271
  ...restProps
1282
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
1283
- const media2 = _media ?? theme.media, [element, setElement] = useState(null), elementSize = useElementSize(element);
1272
+ } = props, $[0] = props, $[1] = children, $[2] = mediaProp, $[3] = restProps) : (children = $[1], mediaProp = $[2], restProps = $[3]);
1273
+ const breakpoints = mediaProp ?? defaultBreakpoints, [element, setElement] = useState(null), elementSize = useElementSize(element);
1284
1274
  let t0;
1285
1275
  t0 = elementSize?.border.width ?? window.innerWidth;
1286
1276
  const width = t0;
1287
1277
  let t1, t2;
1288
- if ($[4] !== media2 || $[5] !== width) {
1289
- const eq = findMaxBreakpoints(media2, width);
1290
- t2 = eq.length ? eq.join(" ") : void 0, $[4] = media2, $[5] = width, $[6] = t2;
1278
+ if ($[4] !== breakpoints || $[5] !== width) {
1279
+ const eq = findMaxBreakpoints(breakpoints, width);
1280
+ t2 = eq.length ? eq.join(" ") : void 0, $[4] = breakpoints, $[5] = width, $[6] = t2;
1291
1281
  } else
1292
1282
  t2 = $[6];
1293
1283
  t1 = t2;
1294
1284
  const max = t1;
1295
1285
  let t3, t4;
1296
- if ($[7] !== media2 || $[8] !== width) {
1297
- const eq_0 = findMinBreakpoints(media2, width);
1298
- t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media2, $[8] = width, $[9] = t4;
1286
+ if ($[7] !== breakpoints || $[8] !== width) {
1287
+ const eq_0 = findMinBreakpoints(breakpoints, width);
1288
+ t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = breakpoints, $[8] = width, $[9] = t4;
1299
1289
  } else
1300
1290
  t4 = $[9];
1301
1291
  t3 = t4;
@@ -1521,36 +1511,24 @@ const SrOnly = forwardRef(function(props, ref) {
1521
1511
  });
1522
1512
  SrOnly.displayName = "ForwardRef(SrOnly)";
1523
1513
  const VirtualList = forwardRef(function(props, forwardedRef) {
1524
- const $ = c(56);
1525
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
1514
+ const $ = c(55);
1515
+ let getItemKey, onChange, renderItem, restProps, t0, t1;
1526
1516
  $[0] !== props ? ({
1527
- as: t0,
1528
- gap: t1,
1517
+ gap: t0,
1529
1518
  getItemKey,
1530
- items: t2,
1519
+ items: t1,
1531
1520
  onChange,
1532
1521
  renderItem,
1533
1522
  ...restProps
1534
- } = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]);
1535
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
1523
+ } = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6]);
1524
+ const gap = t0 === void 0 ? 0 : t0;
1525
+ let t2;
1526
+ $[7] !== t1 ? (t2 = t1 === void 0 ? [] : t1, $[7] = t1, $[8] = t2) : t2 = $[8];
1527
+ const items = t2, ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1), [gapValue, setGapValue] = useState(0);
1536
1528
  let t3;
1537
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
1538
- const items = t3, {
1539
- space
1540
- } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1);
1541
- let t4;
1542
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4);
1543
- let t5;
1544
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
1545
- if (!wrapperRef.current)
1546
- return;
1547
- const firstElement = wrapperRef.current.firstChild;
1548
- firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
1549
- }, $[11] = t5) : t5 = $[11];
1550
- let t6;
1551
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], useEffect(t5, t6);
1552
- let t7, t8;
1553
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
1529
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[9] = t3) : t3 = $[9], useImperativeHandle(forwardedRef, t3);
1530
+ let t4, t5;
1531
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => {
1554
1532
  if (!ref.current)
1555
1533
  return;
1556
1534
  const scrollEl = findScrollable(ref.current.parentNode);
@@ -1580,55 +1558,69 @@ const VirtualList = forwardRef(function(props, forwardedRef) {
1580
1558
  }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
1581
1559
  window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
1582
1560
  };
1583
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
1584
- const len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
1585
- let t10, t9;
1586
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
1587
- onChange && onChange({
1561
+ }, t5 = [], $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5);
1562
+ const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
1563
+ let t6, t7;
1564
+ $[12] !== fromIndex || $[13] !== gapValue || $[14] !== itemHeight || $[15] !== onChange || $[16] !== scrollHeight || $[17] !== scrollTop || $[18] !== toIndex ? (t6 = () => {
1565
+ onChange?.({
1588
1566
  fromIndex,
1589
- gap: space[gap],
1567
+ gap: gapValue,
1590
1568
  itemHeight,
1591
1569
  scrollHeight,
1592
1570
  scrollTop,
1593
1571
  toIndex
1594
1572
  });
1595
- }, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), useEffect(t9, t10);
1596
- let t11;
1573
+ }, t7 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[12] = fromIndex, $[13] = gapValue, $[14] = itemHeight, $[15] = onChange, $[16] = scrollHeight, $[17] = scrollTop, $[18] = toIndex, $[19] = t6, $[20] = t7) : (t6 = $[19], t7 = $[20]), useEffect(t6, t7);
1574
+ let t8;
1597
1575
  bb0: {
1598
1576
  if (!renderItem || items.length === 0) {
1599
- t11 = null;
1577
+ t8 = null;
1600
1578
  break bb0;
1601
1579
  }
1602
1580
  if (itemHeight === -1) {
1603
- let t123;
1604
- $[26] !== items[0] || $[27] !== renderItem ? (t123 = renderItem(items[0]), $[26] = items[0], $[27] = renderItem, $[28] = t123) : t123 = $[28];
1605
- let t132;
1606
- $[29] !== t123 ? (t132 = [/* @__PURE__ */ jsx(Box, { insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t123 }, 0)], $[29] = t123, $[30] = t132) : t132 = $[30], t11 = t132;
1581
+ let t93;
1582
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t93 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[21] = t93) : t93 = $[21];
1583
+ let t102;
1584
+ $[22] !== items[0] || $[23] !== renderItem ? (t102 = renderItem(items[0]), $[22] = items[0], $[23] = renderItem, $[24] = t102) : t102 = $[24];
1585
+ let t112;
1586
+ $[25] !== t102 ? (t112 = /* @__PURE__ */ jsx(Box, { ref: t93, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t102 }, 0), $[25] = t102, $[26] = t112) : t112 = $[26];
1587
+ let t122;
1588
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t122 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[27] = t122) : t122 = $[27];
1589
+ const t13 = vars.space[gap];
1590
+ let t14;
1591
+ $[28] !== t13 ? (t14 = /* @__PURE__ */ jsx("div", { ref: t122, style: {
1592
+ height: t13
1593
+ } }), $[28] = t13, $[29] = t14) : t14 = $[29];
1594
+ let t15;
1595
+ $[30] !== t112 || $[31] !== t14 ? (t15 = [/* @__PURE__ */ jsxs(Fragment, { children: [
1596
+ t112,
1597
+ t14
1598
+ ] })], $[30] = t112, $[31] = t14, $[32] = t15) : t15 = $[32], t8 = t15;
1607
1599
  break bb0;
1608
1600
  }
1609
- let t122;
1610
- if ($[31] !== fromIndex || $[32] !== gap || $[33] !== getItemKey || $[34] !== itemHeight || $[35] !== items || $[36] !== renderItem || $[37] !== space || $[38] !== toIndex) {
1611
- let t132;
1612
- $[40] !== fromIndex || $[41] !== gap || $[42] !== getItemKey || $[43] !== itemHeight || $[44] !== renderItem || $[45] !== space ? (t132 = (item, _itemIndex) => {
1601
+ let t92;
1602
+ if ($[33] !== fromIndex || $[34] !== gapValue || $[35] !== getItemKey || $[36] !== itemHeight || $[37] !== items || $[38] !== renderItem || $[39] !== toIndex) {
1603
+ let t102;
1604
+ $[41] !== fromIndex || $[42] !== gapValue || $[43] !== getItemKey || $[44] !== itemHeight || $[45] !== renderItem ? (t102 = (item, _itemIndex) => {
1613
1605
  const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
1614
1606
  return /* @__PURE__ */ jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
1615
- top: itemIndex * (itemHeight + space[gap])
1607
+ top: itemIndex * (itemHeight + gapValue) - gapValue
1616
1608
  }, children: node }, key2);
1617
- }, $[40] = fromIndex, $[41] = gap, $[42] = getItemKey, $[43] = itemHeight, $[44] = renderItem, $[45] = space, $[46] = t132) : t132 = $[46], t122 = items.slice(fromIndex, toIndex).map(t132), $[31] = fromIndex, $[32] = gap, $[33] = getItemKey, $[34] = itemHeight, $[35] = items, $[36] = renderItem, $[37] = space, $[38] = toIndex, $[39] = t122;
1609
+ }, $[41] = fromIndex, $[42] = gapValue, $[43] = getItemKey, $[44] = itemHeight, $[45] = renderItem, $[46] = t102) : t102 = $[46], t92 = items.slice(fromIndex, toIndex).map(t102), $[33] = fromIndex, $[34] = gapValue, $[35] = getItemKey, $[36] = itemHeight, $[37] = items, $[38] = renderItem, $[39] = toIndex, $[40] = t92;
1618
1610
  } else
1619
- t122 = $[39];
1620
- t11 = t122;
1611
+ t92 = $[40];
1612
+ t8 = t92;
1621
1613
  }
1622
- const children = t11;
1623
- let t12, t13;
1624
- $[47] !== height ? (t13 = {
1614
+ const children = t8;
1615
+ let t9, t10;
1616
+ $[47] !== height ? (t10 = {
1625
1617
  height
1626
- }, $[47] = height, $[48] = t13) : t13 = $[48], t12 = t13;
1627
- const wrapperStyle = t12;
1628
- let t14;
1629
- $[49] !== children || $[50] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t14) : t14 = $[51];
1630
- let t15;
1631
- return $[52] !== as || $[53] !== restProps || $[54] !== t14 ? (t15 = /* @__PURE__ */ jsx(Box, { as, "data-ui": "VirtualList", ...restProps, position: "relative", ref, children: t14 }), $[52] = as, $[53] = restProps, $[54] = t14, $[55] = t15) : t15 = $[55], t15;
1618
+ }, $[47] = height, $[48] = t10) : t10 = $[48], t9 = t10;
1619
+ const wrapperStyle = t9;
1620
+ let t11;
1621
+ $[49] !== children || $[50] !== wrapperStyle ? (t11 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t11) : t11 = $[51];
1622
+ let t12;
1623
+ return $[52] !== restProps || $[53] !== t11 ? (t12 = /* @__PURE__ */ jsx(Box, { "data-ui": "VirtualList", ...restProps, position: "relative", ref, children: t11 }), $[52] = restProps, $[53] = t11, $[54] = t12) : t12 = $[54], t12;
1632
1624
  });
1633
1625
  VirtualList.displayName = "ForwardRef(VirtualList)";
1634
1626
  function findScrollable(parentNode) {
@@ -1693,8 +1685,8 @@ function size(options) {
1693
1685
  };
1694
1686
  }
1695
1687
  const MotionCard$1 = motion.create(Card), PopoverCard = memo(forwardRef(function(props, ref) {
1696
- const $ = c(74);
1697
- let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, restProps, scheme, shadow, strategy, style, tone, xProp, yProp;
1688
+ const $ = c(67);
1689
+ let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, restProps, shadow, strategy, style, t0, xProp, yProp;
1698
1690
  $[0] !== props ? ({
1699
1691
  __unstable_margins: marginsProp,
1700
1692
  animate,
@@ -1711,66 +1703,63 @@ const MotionCard$1 = motion.create(Card), PopoverCard = memo(forwardRef(function
1711
1703
  overflow,
1712
1704
  radius,
1713
1705
  referenceWidth,
1714
- scheme,
1715
1706
  shadow,
1716
1707
  strategy,
1717
1708
  style,
1718
- tone,
1709
+ tone: t0,
1719
1710
  x: xProp,
1720
1711
  y: yProp,
1721
1712
  ...restProps
1722
- } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = maxWidth, $[9] = originX, $[10] = originY, $[11] = overflow, $[12] = padding, $[13] = placement, $[14] = radius, $[15] = referenceWidth, $[16] = restProps, $[17] = scheme, $[18] = shadow, $[19] = strategy, $[20] = style, $[21] = tone, $[22] = xProp, $[23] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], maxWidth = $[8], originX = $[9], originY = $[10], overflow = $[11], padding = $[12], placement = $[13], radius = $[14], referenceWidth = $[15], restProps = $[16], scheme = $[17], shadow = $[18], strategy = $[19], style = $[20], tone = $[21], xProp = $[22], yProp = $[23]);
1723
- const card2 = useCard(), layer = useLayer();
1724
- let t0;
1725
- t0 = marginsProp || DEFAULT_POPOVER_MARGINS;
1726
- const margins = t0, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1713
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = maxWidth, $[9] = originX, $[10] = originY, $[11] = overflow, $[12] = padding, $[13] = placement, $[14] = radius, $[15] = referenceWidth, $[16] = restProps, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = t0, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], maxWidth = $[8], originX = $[9], originY = $[10], overflow = $[11], padding = $[12], placement = $[13], radius = $[14], referenceWidth = $[15], restProps = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
1714
+ const tone = t0 === void 0 ? "inherit" : t0, layer = useLayer();
1727
1715
  let t1;
1728
- const t2 = layer.zIndex ?? 100, t3 = animate ? "transform" : void 0;
1729
- let t4;
1730
- $[24] !== originX || $[25] !== originY || $[26] !== referenceWidth || $[27] !== strategy || $[28] !== style || $[29] !== t2 || $[30] !== t3 || $[31] !== x || $[32] !== y ? (t4 = {
1716
+ t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
1717
+ const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1718
+ let t2;
1719
+ const t3 = layer.zIndex ?? 100, t4 = animate ? "transform" : void 0;
1720
+ let t5;
1721
+ $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== strategy || $[27] !== style || $[28] !== t3 || $[29] !== t4 || $[30] !== x || $[31] !== y ? (t5 = {
1731
1722
  left: x,
1732
1723
  originX,
1733
1724
  originY,
1734
1725
  position: strategy,
1735
1726
  top: y,
1736
1727
  width: referenceWidth,
1737
- zIndex: t2,
1738
- willChange: t3,
1728
+ zIndex: t3,
1729
+ willChange: t4,
1739
1730
  ...style
1740
- }, $[24] = originX, $[25] = originY, $[26] = referenceWidth, $[27] = strategy, $[28] = style, $[29] = t2, $[30] = t3, $[31] = x, $[32] = y, $[33] = t4) : t4 = $[33], t1 = t4;
1741
- const rootStyle = t1;
1742
- let t5;
1743
- const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
1744
- let t8;
1745
- $[34] !== t6 || $[35] !== t7 ? (t8 = {
1746
- left: t6,
1747
- top: t7,
1731
+ }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = strategy, $[27] = style, $[28] = t3, $[29] = t4, $[30] = x, $[31] = y, $[32] = t5) : t5 = $[32], t2 = t5;
1732
+ const rootStyle = t2;
1733
+ let t6;
1734
+ const t7 = arrowX !== null ? arrowX : void 0, t8 = arrowY !== null ? arrowY : void 0;
1735
+ let t9;
1736
+ $[33] !== t7 || $[34] !== t8 ? (t9 = {
1737
+ left: t7,
1738
+ top: t8,
1748
1739
  right: void 0,
1749
1740
  bottom: void 0
1750
- }, $[34] = t6, $[35] = t7, $[36] = t8) : t8 = $[36], t5 = t8;
1751
- const arrowStyle = t5, t9 = card2?.tone ?? "transparent", t10 = card2?.scheme ?? "light";
1752
- let t11;
1753
- $[37] === Symbol.for("react.memo_cache_sentinel") ? (t11 = popoverCard(), $[37] = t11) : t11 = $[37];
1754
- const t12 = restProps, t13 = card2?.tone ?? "transparent";
1741
+ }, $[33] = t7, $[34] = t8, $[35] = t9) : t9 = $[35], t6 = t9;
1742
+ const arrowStyle = t6;
1743
+ let t10;
1744
+ $[36] === Symbol.for("react.memo_cache_sentinel") ? (t10 = popoverCard(), $[36] = t10) : t10 = $[36];
1745
+ const t11 = restProps;
1746
+ let t12;
1747
+ $[37] !== animate ? (t12 = animate ? ["hidden", "initial"] : void 0, $[37] = animate, $[38] = t12) : t12 = $[38];
1748
+ let t13;
1749
+ $[39] !== animate ? (t13 = animate ? ["visible", "scaleIn"] : void 0, $[39] = animate, $[40] = t13) : t13 = $[40];
1755
1750
  let t14;
1756
- $[38] !== animate ? (t14 = animate ? ["hidden", "initial"] : void 0, $[38] = animate, $[39] = t14) : t14 = $[39];
1751
+ $[41] !== animate ? (t14 = animate ? ["hidden", "scaleOut"] : void 0, $[41] = animate, $[42] = t14) : t14 = $[42];
1757
1752
  let t15;
1758
- $[40] !== animate ? (t15 = animate ? ["visible", "scaleIn"] : void 0, $[40] = animate, $[41] = t15) : t15 = $[41];
1753
+ $[43] !== children || $[44] !== padding ? (t15 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[43] = children, $[44] = padding, $[45] = t15) : t15 = $[45];
1759
1754
  let t16;
1760
- $[42] !== animate ? (t16 = animate ? ["hidden", "scaleOut"] : void 0, $[42] = animate, $[43] = t16) : t16 = $[43];
1755
+ $[46] !== maxWidth || $[47] !== overflow || $[48] !== t15 ? (t16 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t15 }), $[46] = maxWidth, $[47] = overflow, $[48] = t15, $[49] = t16) : t16 = $[49];
1761
1756
  let t17;
1762
- $[44] !== children || $[45] !== padding ? (t17 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[44] = children, $[45] = padding, $[46] = t17) : t17 = $[46];
1757
+ $[50] !== arrow2 || $[51] !== arrowRef || $[52] !== arrowStyle ? (t17 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[50] = arrow2, $[51] = arrowRef, $[52] = arrowStyle, $[53] = t17) : t17 = $[53];
1763
1758
  let t18;
1764
- $[47] !== maxWidth || $[48] !== overflow || $[49] !== t17 ? (t18 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t17 }), $[47] = maxWidth, $[48] = overflow, $[49] = t17, $[50] = t18) : t18 = $[50];
1765
- let t19;
1766
- $[51] !== arrow2 || $[52] !== arrowRef || $[53] !== arrowStyle ? (t19 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[51] = arrow2, $[52] = arrowRef, $[53] = arrowStyle, $[54] = t19) : t19 = $[54];
1767
- let t20;
1768
- $[55] !== placement || $[56] !== radius || $[57] !== ref || $[58] !== rootStyle || $[59] !== scheme || $[60] !== shadow || $[61] !== t12 || $[62] !== t13 || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t18 || $[67] !== t19 || $[68] !== tone ? (t20 = /* @__PURE__ */ jsxs(MotionCard$1, { className: t11, "data-ui": "Popover", ...t12, "data-context-tone": t13, "data-placement": placement, direction: "column", display: "flex", radius, ref, scheme, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t14, animate: t15, exit: t16, children: [
1769
- t18,
1770
- t19
1771
- ] }), $[55] = placement, $[56] = radius, $[57] = ref, $[58] = rootStyle, $[59] = scheme, $[60] = shadow, $[61] = t12, $[62] = t13, $[63] = t14, $[64] = t15, $[65] = t16, $[66] = t18, $[67] = t19, $[68] = tone, $[69] = t20) : t20 = $[69];
1772
- let t21;
1773
- return $[70] !== t10 || $[71] !== t20 || $[72] !== t9 ? (t21 = /* @__PURE__ */ jsx(CardProvider, { tone: t9, scheme: t10, children: t20 }), $[70] = t10, $[71] = t20, $[72] = t9, $[73] = t21) : t21 = $[73], t21;
1759
+ return $[54] !== placement || $[55] !== radius || $[56] !== ref || $[57] !== rootStyle || $[58] !== shadow || $[59] !== t11 || $[60] !== t12 || $[61] !== t13 || $[62] !== t14 || $[63] !== t16 || $[64] !== t17 || $[65] !== tone ? (t18 = /* @__PURE__ */ jsxs(MotionCard$1, { className: t10, "data-ui": "Popover", ...t11, "data-context-tone": tone, "data-placement": placement, direction: "column", display: "flex", radius, ref, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t12, animate: t13, exit: t14, children: [
1760
+ t16,
1761
+ t17
1762
+ ] }), $[54] = placement, $[55] = radius, $[56] = ref, $[57] = rootStyle, $[58] = shadow, $[59] = t11, $[60] = t12, $[61] = t13, $[62] = t14, $[63] = t16, $[64] = t17, $[65] = tone, $[66] = t18) : t18 = $[66], t18;
1774
1763
  }));
1775
1764
  PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
1776
1765
  const ViewportOverlay = () => {
@@ -1779,10 +1768,10 @@ const ViewportOverlay = () => {
1779
1768
  } = useLayer();
1780
1769
  let t0;
1781
1770
  return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsx("div", { style: {
1782
- height: "100vh",
1783
- inset: 0,
1784
1771
  position: "fixed",
1772
+ inset: 0,
1785
1773
  width: "100vw",
1774
+ height: "100vh",
1786
1775
  zIndex
1787
1776
  } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
1788
1777
  }, Popover = memo(forwardRef(function(props, forwardedRef) {
@@ -1815,11 +1804,10 @@ const ViewportOverlay = () => {
1815
1804
  shadow = 3,
1816
1805
  tone = "inherit",
1817
1806
  width: widthProp = "auto",
1818
- // zOffset: zOffsetProp = layer.popover.zOffset,
1819
1807
  zOffset: zOffsetProp = Z_OFFSETS.popover,
1820
1808
  updateRef,
1821
1809
  ...restProps
1822
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
1810
+ } = props, card2 = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
1823
1811
  useImperativeHandle(forwardedRef, () => ref.current);
1824
1812
  const referenceWidthRef = useRef(void 0), middleware = useMemo(() => {
1825
1813
  const ret = [];
@@ -1886,35 +1874,8 @@ const ViewportOverlay = () => {
1886
1874
  return childProp || /* @__PURE__ */ jsx(Fragment, {});
1887
1875
  const popover = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
1888
1876
  modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
1889
- /* @__PURE__ */ jsx(
1890
- PopoverCard,
1891
- {
1892
- ...restProps,
1893
- __unstable_margins: margins,
1894
- animate,
1895
- arrow: arrowProp,
1896
- arrowRef: setArrow,
1897
- arrowX,
1898
- arrowY,
1899
- hidden: referenceHidden,
1900
- maxWidth: widthProp,
1901
- overflow,
1902
- padding,
1903
- placement,
1904
- radius,
1905
- ref: setFloating,
1906
- scheme,
1907
- shadow,
1908
- originX,
1909
- originY,
1910
- strategy,
1911
- tone,
1912
- x,
1913
- y,
1914
- children: content
1915
- }
1916
- )
1917
- ] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
1877
+ /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, x, y, children: content })
1878
+ ] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: /* @__PURE__ */ jsx(CardProvider, { tone: tone === "inherit" ? card2?.tone ?? "default" : tone, scheme: scheme ?? "light", children: popover }) }) : popover);
1918
1879
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1919
1880
  animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
1920
1881
  child
@@ -2251,7 +2212,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
2251
2212
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
2252
2213
  }, MotionCard = motion.create(Card), TooltipCard = memo(forwardRef(function(props, ref) {
2253
2214
  const $ = c(52);
2254
- let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style, tone;
2215
+ let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style, t0;
2255
2216
  $[0] !== props ? ({
2256
2217
  animate,
2257
2218
  arrow: arrow2,
@@ -2267,44 +2228,45 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
2267
2228
  scheme,
2268
2229
  shadow,
2269
2230
  style,
2270
- tone,
2231
+ tone: t0,
2271
2232
  ...restProps
2272
- } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = tone) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15], tone = $[16]);
2273
- let t0;
2274
- const t1 = animate ? "transform" : void 0;
2275
- let t2;
2276
- $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t1 ? (t2 = {
2233
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = t0) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
2234
+ const tone = t0 === void 0 ? "inherit" : t0;
2235
+ let t1;
2236
+ const t2 = animate ? "transform" : void 0;
2237
+ let t3;
2238
+ $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
2277
2239
  originX,
2278
2240
  originY,
2279
- willChange: t1,
2241
+ willChange: t2,
2280
2242
  ...style
2281
- }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t1, $[21] = t2) : t2 = $[21], t0 = t2;
2282
- const rootStyle = t0;
2283
- let t3;
2284
- const t4 = arrowX !== null ? arrowX : void 0, t5 = arrowY !== null ? arrowY : void 0;
2285
- let t6;
2286
- $[22] !== t4 || $[23] !== t5 ? (t6 = {
2287
- left: t4,
2288
- top: t5,
2243
+ }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
2244
+ const rootStyle = t1;
2245
+ let t4;
2246
+ const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
2247
+ let t7;
2248
+ $[22] !== t5 || $[23] !== t6 ? (t7 = {
2249
+ left: t5,
2250
+ top: t6,
2289
2251
  right: void 0,
2290
2252
  bottom: void 0
2291
- }, $[22] = t4, $[23] = t5, $[24] = t6) : t6 = $[24], t3 = t6;
2292
- const arrowStyle = t3, t7 = animate ? "" : void 0;
2293
- let t8;
2294
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t8 = tooltipCard(), $[25] = t8) : t8 = $[25];
2253
+ }, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
2254
+ const arrowStyle = t4, t8 = animate ? "" : void 0;
2295
2255
  let t9;
2296
- $[26] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t9) : t9 = $[27];
2256
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t9 = tooltipCard(), $[25] = t9) : t9 = $[25];
2297
2257
  let t10;
2298
- $[28] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t10) : t10 = $[29];
2258
+ $[26] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t10) : t10 = $[27];
2299
2259
  let t11;
2300
- $[30] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t11) : t11 = $[31];
2260
+ $[28] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t11) : t11 = $[29];
2301
2261
  let t12;
2302
- $[32] !== arrow2 || $[33] !== arrowRef || $[34] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[32] = arrow2, $[33] = arrowRef, $[34] = arrowStyle, $[35] = t12) : t12 = $[35];
2262
+ $[30] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t12) : t12 = $[31];
2303
2263
  let t13;
2304
- return $[36] !== children || $[37] !== padding || $[38] !== placement || $[39] !== radius || $[40] !== ref || $[41] !== restProps || $[42] !== rootStyle || $[43] !== scheme || $[44] !== shadow || $[45] !== t10 || $[46] !== t11 || $[47] !== t12 || $[48] !== t7 || $[49] !== t9 || $[50] !== tone ? (t13 = /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...restProps, "data-animate": t7, className: t8, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, tone, children: [
2264
+ $[32] !== arrow2 || $[33] !== arrowRef || $[34] !== arrowStyle ? (t13 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[32] = arrow2, $[33] = arrowRef, $[34] = arrowStyle, $[35] = t13) : t13 = $[35];
2265
+ let t14;
2266
+ return $[36] !== children || $[37] !== padding || $[38] !== placement || $[39] !== radius || $[40] !== ref || $[41] !== restProps || $[42] !== rootStyle || $[43] !== scheme || $[44] !== shadow || $[45] !== t10 || $[46] !== t11 || $[47] !== t12 || $[48] !== t13 || $[49] !== t8 || $[50] !== tone ? (t14 = /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...restProps, "data-animate": t8, className: t9, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, tone, children: [
2305
2267
  children,
2306
- t12
2307
- ] }), $[36] = children, $[37] = padding, $[38] = placement, $[39] = radius, $[40] = ref, $[41] = restProps, $[42] = rootStyle, $[43] = scheme, $[44] = shadow, $[45] = t10, $[46] = t11, $[47] = t12, $[48] = t7, $[49] = t9, $[50] = tone, $[51] = t13) : t13 = $[51], t13;
2268
+ t13
2269
+ ] }), $[36] = children, $[37] = padding, $[38] = placement, $[39] = radius, $[40] = ref, $[41] = restProps, $[42] = rootStyle, $[43] = scheme, $[44] = shadow, $[45] = t10, $[46] = t11, $[47] = t12, $[48] = t13, $[49] = t8, $[50] = tone, $[51] = t14) : t14 = $[51], t14;
2308
2270
  }));
2309
2271
  TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
2310
2272
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
@@ -2349,9 +2311,9 @@ const Tooltip = forwardRef(function(props, forwardedRef) {
2349
2311
  scheme,
2350
2312
  shadow = 2,
2351
2313
  zOffset = Z_OFFSETS.tooltip,
2352
- tone,
2314
+ tone = "inherit",
2353
2315
  ...restProps
2354
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
2316
+ } = props, card2 = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
2355
2317
  useImperativeHandle(forwardedRef, () => ref.current);
2356
2318
  const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMemo(() => {
2357
2319
  const ret = [];
@@ -2459,7 +2421,7 @@ const Tooltip = forwardRef(function(props, forwardedRef) {
2459
2421
  zOffset,
2460
2422
  children: /* @__PURE__ */ jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, tone, children: content })
2461
2423
  }
2462
- ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: node_0 }) : node_0);
2424
+ ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: /* @__PURE__ */ jsx(CardProvider, { tone: tone === "inherit" ? card2?.tone ?? "default" : tone, scheme: scheme ?? "light", children: node_0 }) }) : node_0);
2463
2425
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2464
2426
  animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
2465
2427
  child
@@ -3106,10 +3068,7 @@ export {
3106
3068
  _isEnterToClickElement,
3107
3069
  _isScrollable,
3108
3070
  containsOrEqualsElement,
3109
- createColorTheme,
3110
3071
  createGlobalScopedContext,
3111
- hexToRgb,
3112
- hslToRgb,
3113
3072
  isHTMLAnchorElement,
3114
3073
  isHTMLButtonElement,
3115
3074
  isHTMLElement,
@@ -3117,12 +3076,6 @@ export {
3117
3076
  isHTMLSelectElement,
3118
3077
  isHTMLTextAreaElement,
3119
3078
  isRecord,
3120
- multiply,
3121
- parseColor,
3122
- rgbToHex,
3123
- rgbToHsl,
3124
- rgba,
3125
- screen,
3126
3079
  studioTheme,
3127
3080
  useArrayProp,
3128
3081
  useBoundaryElement,