@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,10 @@
1
1
  "use strict";
2
- var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), react = require("react"), styledComponents = require("styled-components"), css = require("@sanity/ui/css"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), useEffectEvent = require("use-effect-event"), reactDom = require("react-dom");
2
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), css = require("@sanity/ui/css"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), useEffectEvent = require("use-effect-event"), reactDom = require("react-dom");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
6
6
  var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs);
7
+ const studioTheme = theme.buildTheme();
7
8
  function getGlobalScope() {
8
9
  if (typeof globalThis < "u") return globalThis;
9
10
  if (typeof window < "u") return window;
@@ -100,14 +101,7 @@ function useTheme_v2() {
100
101
  let t1;
101
102
  return $[0] !== t0 ? (t1 = theme.getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
102
103
  }
103
- const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen, studioTheme = /* @__PURE__ */ (() => {
104
- let theme$1;
105
- return {
106
- get value() {
107
- return theme$1 || (theme$1 = theme.buildTheme()), theme$1;
108
- }
109
- };
110
- })(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
104
+ const EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
111
105
  card: {
112
106
  initial: {
113
107
  scale: 0.97,
@@ -737,7 +731,7 @@ const Spinner = react.forwardRef(function(props, ref) {
737
731
  Spinner.displayName = "ForwardRef(Spinner)";
738
732
  const Button = react.forwardRef(function(props, ref) {
739
733
  const {
740
- align = "center",
734
+ // align = 'center',
741
735
  as: As = "button",
742
736
  children,
743
737
  className,
@@ -774,7 +768,7 @@ const Button = react.forwardRef(function(props, ref) {
774
768
  type = "button",
775
769
  muted = !1,
776
770
  width,
777
- wrap,
771
+ // wrap,
778
772
  ...restProps
779
773
  } = props;
780
774
  return /* @__PURE__ */ jsxRuntime.jsxs(As, { "data-ui": "Button", ...restProps, className: css.composeClassNames(className, css.button({
@@ -822,9 +816,6 @@ const Button = react.forwardRef(function(props, ref) {
822
816
  {
823
817
  as: "span",
824
818
  flex: 1,
825
- gap,
826
- gapX,
827
- gapY,
828
819
  padding,
829
820
  paddingX,
830
821
  paddingY,
@@ -1154,7 +1145,7 @@ function compileCommands(cmds) {
1154
1145
  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(" ");
1155
1146
  }
1156
1147
  const Arrow = react.forwardRef(function(props, ref) {
1157
- const $ = reactCompilerRuntime.c(31);
1148
+ const $ = reactCompilerRuntime.c(30);
1158
1149
  let h, restProps, style, t0, w;
1159
1150
  $[0] !== props ? ({
1160
1151
  width: w,
@@ -1163,9 +1154,7 @@ const Arrow = react.forwardRef(function(props, ref) {
1163
1154
  style,
1164
1155
  ...restProps
1165
1156
  } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = style, $[4] = t0, $[5] = w) : (h = $[1], restProps = $[2], style = $[3], t0 = $[4], w = $[5]);
1166
- const radius = t0 === void 0 ? 0 : t0, {
1167
- card
1168
- } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2;
1157
+ const radius = t0 === void 0 ? 0 : t0, center = w / 2;
1169
1158
  let t1;
1170
1159
  const points = [{
1171
1160
  x: 0,
@@ -1198,24 +1187,25 @@ const Arrow = react.forwardRef(function(props, ref) {
1198
1187
  }, $[7] = style, $[8] = t3, $[9] = t4) : t4 = $[9];
1199
1188
  const t5 = t4, t6 = `0 0 ${w} ${w}`;
1200
1189
  let t7;
1201
- $[10] !== strokeWidth || $[11] !== w ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[10] = strokeWidth, $[11] = w, $[12] = t7) : t7 = $[12];
1190
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css._arrowStrokeMask(), $[10] = t7) : t7 = $[10];
1202
1191
  let t8;
1203
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css._arrowStroke(), $[13] = t8) : t8 = $[13];
1204
- const t9 = strokeWidth * 2;
1192
+ $[11] !== w ? (t8 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { className: t7, x: 0, width: w, height: w, fill: "white" }) }), $[11] = w, $[12] = t8) : t8 = $[12];
1193
+ let t9;
1194
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css._arrowStroke(), $[13] = t9) : t9 = $[13];
1205
1195
  let t10;
1206
- $[14] !== strokePath || $[15] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t8, d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t9 }), $[14] = strokePath, $[15] = t9, $[16] = t10) : t10 = $[16];
1196
+ $[14] !== strokePath ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t9, d: strokePath, mask: "url(#stroke-mask)" }), $[14] = strokePath, $[15] = t10) : t10 = $[15];
1207
1197
  let t11;
1208
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = css._arrowShape(), $[17] = t11) : t11 = $[17];
1198
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t11 = css._arrowShape(), $[16] = t11) : t11 = $[16];
1209
1199
  let t12;
1210
- $[18] !== fillPath ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t11, d: fillPath }), $[18] = fillPath, $[19] = t12) : t12 = $[19];
1200
+ $[17] !== fillPath ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("path", { className: t11, d: fillPath }), $[17] = fillPath, $[18] = t12) : t12 = $[18];
1211
1201
  let t13;
1212
- $[20] !== t10 || $[21] !== t12 || $[22] !== t6 || $[23] !== t7 || $[24] !== w ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t6, children: [
1213
- t7,
1202
+ $[19] !== t10 || $[20] !== t12 || $[21] !== t6 || $[22] !== t8 || $[23] !== w ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t6, children: [
1203
+ t8,
1214
1204
  t10,
1215
1205
  t12
1216
- ] }), $[20] = t10, $[21] = t12, $[22] = t6, $[23] = t7, $[24] = w, $[25] = t13) : t13 = $[25];
1206
+ ] }), $[19] = t10, $[20] = t12, $[21] = t6, $[22] = t8, $[23] = w, $[24] = t13) : t13 = $[24];
1217
1207
  let t14;
1218
- return $[26] !== ref || $[27] !== restProps || $[28] !== t13 || $[29] !== t5 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ...restProps, className: t2, ref, style: t5, children: t13 }), $[26] = ref, $[27] = restProps, $[28] = t13, $[29] = t5, $[30] = t14) : t14 = $[30], t14;
1208
+ return $[25] !== ref || $[26] !== restProps || $[27] !== t13 || $[28] !== t5 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ...restProps, className: t2, ref, style: t5, children: t13 }), $[25] = ref, $[26] = restProps, $[27] = t13, $[28] = t5, $[29] = t14) : t14 = $[29], t14;
1219
1209
  });
1220
1210
  Arrow.displayName = "ForwardRef(Arrow)";
1221
1211
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
@@ -1267,30 +1257,30 @@ function findMinBreakpoints(media2, width) {
1267
1257
  media2[i] <= width && ret.push(i);
1268
1258
  return ret;
1269
1259
  }
1270
- const ElementQuery = react.forwardRef(function(props, forwardedRef) {
1271
- const $ = reactCompilerRuntime.c(18), theme2 = useTheme_v2();
1272
- let _media, children, restProps;
1260
+ const defaultBreakpoints = Object.values(css.BREAKPOINTS), ElementQuery = react.forwardRef(function(props, forwardedRef) {
1261
+ const $ = reactCompilerRuntime.c(18);
1262
+ let children, mediaProp, restProps;
1273
1263
  $[0] !== props ? ({
1274
1264
  children,
1275
- media: _media,
1265
+ media: mediaProp,
1276
1266
  ...restProps
1277
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
1278
- const media2 = _media ?? theme2.media, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
1267
+ } = props, $[0] = props, $[1] = children, $[2] = mediaProp, $[3] = restProps) : (children = $[1], mediaProp = $[2], restProps = $[3]);
1268
+ const breakpoints = mediaProp ?? defaultBreakpoints, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
1279
1269
  let t0;
1280
1270
  t0 = elementSize?.border.width ?? window.innerWidth;
1281
1271
  const width = t0;
1282
1272
  let t1, t2;
1283
- if ($[4] !== media2 || $[5] !== width) {
1284
- const eq = findMaxBreakpoints(media2, width);
1285
- t2 = eq.length ? eq.join(" ") : void 0, $[4] = media2, $[5] = width, $[6] = t2;
1273
+ if ($[4] !== breakpoints || $[5] !== width) {
1274
+ const eq = findMaxBreakpoints(breakpoints, width);
1275
+ t2 = eq.length ? eq.join(" ") : void 0, $[4] = breakpoints, $[5] = width, $[6] = t2;
1286
1276
  } else
1287
1277
  t2 = $[6];
1288
1278
  t1 = t2;
1289
1279
  const max = t1;
1290
1280
  let t3, t4;
1291
- if ($[7] !== media2 || $[8] !== width) {
1292
- const eq_0 = findMinBreakpoints(media2, width);
1293
- t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media2, $[8] = width, $[9] = t4;
1281
+ if ($[7] !== breakpoints || $[8] !== width) {
1282
+ const eq_0 = findMinBreakpoints(breakpoints, width);
1283
+ t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = breakpoints, $[8] = width, $[9] = t4;
1294
1284
  } else
1295
1285
  t4 = $[9];
1296
1286
  t3 = t4;
@@ -1516,36 +1506,24 @@ const SrOnly = react.forwardRef(function(props, ref) {
1516
1506
  });
1517
1507
  SrOnly.displayName = "ForwardRef(SrOnly)";
1518
1508
  const VirtualList = react.forwardRef(function(props, forwardedRef) {
1519
- const $ = reactCompilerRuntime.c(56);
1520
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
1509
+ const $ = reactCompilerRuntime.c(55);
1510
+ let getItemKey, onChange, renderItem, restProps, t0, t1;
1521
1511
  $[0] !== props ? ({
1522
- as: t0,
1523
- gap: t1,
1512
+ gap: t0,
1524
1513
  getItemKey,
1525
- items: t2,
1514
+ items: t1,
1526
1515
  onChange,
1527
1516
  renderItem,
1528
1517
  ...restProps
1529
- } = 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]);
1530
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
1518
+ } = 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]);
1519
+ const gap = t0 === void 0 ? 0 : t0;
1520
+ let t2;
1521
+ $[7] !== t1 ? (t2 = t1 === void 0 ? [] : t1, $[7] = t1, $[8] = t2) : t2 = $[8];
1522
+ const items = t2, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
1531
1523
  let t3;
1532
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
1533
- const items = t3, {
1534
- space
1535
- } = useTheme_v2(), ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1);
1536
- let t4;
1537
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], react.useImperativeHandle(forwardedRef, t4);
1538
- let t5;
1539
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
1540
- if (!wrapperRef.current)
1541
- return;
1542
- const firstElement = wrapperRef.current.firstChild;
1543
- firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
1544
- }, $[11] = t5) : t5 = $[11];
1545
- let t6;
1546
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], react.useEffect(t5, t6);
1547
- let t7, t8;
1548
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
1524
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[9] = t3) : t3 = $[9], react.useImperativeHandle(forwardedRef, t3);
1525
+ let t4, t5;
1526
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => {
1549
1527
  if (!ref.current)
1550
1528
  return;
1551
1529
  const scrollEl = findScrollable(ref.current.parentNode);
@@ -1575,55 +1553,69 @@ const VirtualList = react.forwardRef(function(props, forwardedRef) {
1575
1553
  }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
1576
1554
  window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
1577
1555
  };
1578
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), react.useEffect(t7, t8);
1579
- 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;
1580
- let t10, t9;
1581
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
1582
- onChange && onChange({
1556
+ }, t5 = [], $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5);
1557
+ 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;
1558
+ let t6, t7;
1559
+ $[12] !== fromIndex || $[13] !== gapValue || $[14] !== itemHeight || $[15] !== onChange || $[16] !== scrollHeight || $[17] !== scrollTop || $[18] !== toIndex ? (t6 = () => {
1560
+ onChange?.({
1583
1561
  fromIndex,
1584
- gap: space[gap],
1562
+ gap: gapValue,
1585
1563
  itemHeight,
1586
1564
  scrollHeight,
1587
1565
  scrollTop,
1588
1566
  toIndex
1589
1567
  });
1590
- }, 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]), react.useEffect(t9, t10);
1591
- let t11;
1568
+ }, 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]), react.useEffect(t6, t7);
1569
+ let t8;
1592
1570
  bb0: {
1593
1571
  if (!renderItem || items.length === 0) {
1594
- t11 = null;
1572
+ t8 = null;
1595
1573
  break bb0;
1596
1574
  }
1597
1575
  if (itemHeight === -1) {
1598
- let t123;
1599
- $[26] !== items[0] || $[27] !== renderItem ? (t123 = renderItem(items[0]), $[26] = items[0], $[27] = renderItem, $[28] = t123) : t123 = $[28];
1600
- let t132;
1601
- $[29] !== t123 ? (t132 = [/* @__PURE__ */ jsxRuntime.jsx(Box, { insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t123 }, 0)], $[29] = t123, $[30] = t132) : t132 = $[30], t11 = t132;
1576
+ let t93;
1577
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t93 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[21] = t93) : t93 = $[21];
1578
+ let t102;
1579
+ $[22] !== items[0] || $[23] !== renderItem ? (t102 = renderItem(items[0]), $[22] = items[0], $[23] = renderItem, $[24] = t102) : t102 = $[24];
1580
+ let t112;
1581
+ $[25] !== t102 ? (t112 = /* @__PURE__ */ jsxRuntime.jsx(Box, { ref: t93, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t102 }, 0), $[25] = t102, $[26] = t112) : t112 = $[26];
1582
+ let t122;
1583
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t122 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[27] = t122) : t122 = $[27];
1584
+ const t13 = css.vars.space[gap];
1585
+ let t14;
1586
+ $[28] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t122, style: {
1587
+ height: t13
1588
+ } }), $[28] = t13, $[29] = t14) : t14 = $[29];
1589
+ let t15;
1590
+ $[30] !== t112 || $[31] !== t14 ? (t15 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1591
+ t112,
1592
+ t14
1593
+ ] })], $[30] = t112, $[31] = t14, $[32] = t15) : t15 = $[32], t8 = t15;
1602
1594
  break bb0;
1603
1595
  }
1604
- let t122;
1605
- if ($[31] !== fromIndex || $[32] !== gap || $[33] !== getItemKey || $[34] !== itemHeight || $[35] !== items || $[36] !== renderItem || $[37] !== space || $[38] !== toIndex) {
1606
- let t132;
1607
- $[40] !== fromIndex || $[41] !== gap || $[42] !== getItemKey || $[43] !== itemHeight || $[44] !== renderItem || $[45] !== space ? (t132 = (item, _itemIndex) => {
1596
+ let t92;
1597
+ if ($[33] !== fromIndex || $[34] !== gapValue || $[35] !== getItemKey || $[36] !== itemHeight || $[37] !== items || $[38] !== renderItem || $[39] !== toIndex) {
1598
+ let t102;
1599
+ $[41] !== fromIndex || $[42] !== gapValue || $[43] !== getItemKey || $[44] !== itemHeight || $[45] !== renderItem ? (t102 = (item, _itemIndex) => {
1608
1600
  const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
1609
1601
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
1610
- top: itemIndex * (itemHeight + space[gap])
1602
+ top: itemIndex * (itemHeight + gapValue) - gapValue
1611
1603
  }, children: node }, key2);
1612
- }, $[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;
1604
+ }, $[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;
1613
1605
  } else
1614
- t122 = $[39];
1615
- t11 = t122;
1606
+ t92 = $[40];
1607
+ t8 = t92;
1616
1608
  }
1617
- const children = t11;
1618
- let t12, t13;
1619
- $[47] !== height ? (t13 = {
1609
+ const children = t8;
1610
+ let t9, t10;
1611
+ $[47] !== height ? (t10 = {
1620
1612
  height
1621
- }, $[47] = height, $[48] = t13) : t13 = $[48], t12 = t13;
1622
- const wrapperStyle = t12;
1623
- let t14;
1624
- $[49] !== children || $[50] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t14) : t14 = $[51];
1625
- let t15;
1626
- return $[52] !== as || $[53] !== restProps || $[54] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Box, { as, "data-ui": "VirtualList", ...restProps, position: "relative", ref, children: t14 }), $[52] = as, $[53] = restProps, $[54] = t14, $[55] = t15) : t15 = $[55], t15;
1613
+ }, $[47] = height, $[48] = t10) : t10 = $[48], t9 = t10;
1614
+ const wrapperStyle = t9;
1615
+ let t11;
1616
+ $[49] !== children || $[50] !== wrapperStyle ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t11) : t11 = $[51];
1617
+ let t12;
1618
+ return $[52] !== restProps || $[53] !== t11 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Box, { "data-ui": "VirtualList", ...restProps, position: "relative", ref, children: t11 }), $[52] = restProps, $[53] = t11, $[54] = t12) : t12 = $[54], t12;
1627
1619
  });
1628
1620
  VirtualList.displayName = "ForwardRef(VirtualList)";
1629
1621
  function findScrollable(parentNode) {
@@ -1688,8 +1680,8 @@ function size(options) {
1688
1680
  };
1689
1681
  }
1690
1682
  const MotionCard$1 = framerMotion.motion.create(Card), PopoverCard = react.memo(react.forwardRef(function(props, ref) {
1691
- const $ = reactCompilerRuntime.c(74);
1692
- let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, restProps, scheme, shadow, strategy, style, tone, xProp, yProp;
1683
+ const $ = reactCompilerRuntime.c(67);
1684
+ let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, restProps, shadow, strategy, style, t0, xProp, yProp;
1693
1685
  $[0] !== props ? ({
1694
1686
  __unstable_margins: marginsProp,
1695
1687
  animate,
@@ -1706,66 +1698,63 @@ const MotionCard$1 = framerMotion.motion.create(Card), PopoverCard = react.memo(
1706
1698
  overflow,
1707
1699
  radius,
1708
1700
  referenceWidth,
1709
- scheme,
1710
1701
  shadow,
1711
1702
  strategy,
1712
1703
  style,
1713
- tone,
1704
+ tone: t0,
1714
1705
  x: xProp,
1715
1706
  y: yProp,
1716
1707
  ...restProps
1717
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[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], arrow = $[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]);
1718
- const card = useCard(), layer = useLayer();
1719
- let t0;
1720
- t0 = marginsProp || DEFAULT_POPOVER_MARGINS;
1721
- const margins = t0, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1708
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[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], arrow = $[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]);
1709
+ const tone = t0 === void 0 ? "inherit" : t0, layer = useLayer();
1722
1710
  let t1;
1723
- const t2 = layer.zIndex ?? 100, t3 = animate ? "transform" : void 0;
1724
- let t4;
1725
- $[24] !== originX || $[25] !== originY || $[26] !== referenceWidth || $[27] !== strategy || $[28] !== style || $[29] !== t2 || $[30] !== t3 || $[31] !== x || $[32] !== y ? (t4 = {
1711
+ t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
1712
+ const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1713
+ let t2;
1714
+ const t3 = layer.zIndex ?? 100, t4 = animate ? "transform" : void 0;
1715
+ let t5;
1716
+ $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== strategy || $[27] !== style || $[28] !== t3 || $[29] !== t4 || $[30] !== x || $[31] !== y ? (t5 = {
1726
1717
  left: x,
1727
1718
  originX,
1728
1719
  originY,
1729
1720
  position: strategy,
1730
1721
  top: y,
1731
1722
  width: referenceWidth,
1732
- zIndex: t2,
1733
- willChange: t3,
1723
+ zIndex: t3,
1724
+ willChange: t4,
1734
1725
  ...style
1735
- }, $[24] = originX, $[25] = originY, $[26] = referenceWidth, $[27] = strategy, $[28] = style, $[29] = t2, $[30] = t3, $[31] = x, $[32] = y, $[33] = t4) : t4 = $[33], t1 = t4;
1736
- const rootStyle = t1;
1737
- let t5;
1738
- const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
1739
- let t8;
1740
- $[34] !== t6 || $[35] !== t7 ? (t8 = {
1741
- left: t6,
1742
- top: t7,
1726
+ }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = strategy, $[27] = style, $[28] = t3, $[29] = t4, $[30] = x, $[31] = y, $[32] = t5) : t5 = $[32], t2 = t5;
1727
+ const rootStyle = t2;
1728
+ let t6;
1729
+ const t7 = arrowX !== null ? arrowX : void 0, t8 = arrowY !== null ? arrowY : void 0;
1730
+ let t9;
1731
+ $[33] !== t7 || $[34] !== t8 ? (t9 = {
1732
+ left: t7,
1733
+ top: t8,
1743
1734
  right: void 0,
1744
1735
  bottom: void 0
1745
- }, $[34] = t6, $[35] = t7, $[36] = t8) : t8 = $[36], t5 = t8;
1746
- const arrowStyle = t5, t9 = card?.tone ?? "transparent", t10 = card?.scheme ?? "light";
1747
- let t11;
1748
- $[37] === Symbol.for("react.memo_cache_sentinel") ? (t11 = css.popoverCard(), $[37] = t11) : t11 = $[37];
1749
- const t12 = restProps, t13 = card?.tone ?? "transparent";
1736
+ }, $[33] = t7, $[34] = t8, $[35] = t9) : t9 = $[35], t6 = t9;
1737
+ const arrowStyle = t6;
1738
+ let t10;
1739
+ $[36] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.popoverCard(), $[36] = t10) : t10 = $[36];
1740
+ const t11 = restProps;
1741
+ let t12;
1742
+ $[37] !== animate ? (t12 = animate ? ["hidden", "initial"] : void 0, $[37] = animate, $[38] = t12) : t12 = $[38];
1743
+ let t13;
1744
+ $[39] !== animate ? (t13 = animate ? ["visible", "scaleIn"] : void 0, $[39] = animate, $[40] = t13) : t13 = $[40];
1750
1745
  let t14;
1751
- $[38] !== animate ? (t14 = animate ? ["hidden", "initial"] : void 0, $[38] = animate, $[39] = t14) : t14 = $[39];
1746
+ $[41] !== animate ? (t14 = animate ? ["hidden", "scaleOut"] : void 0, $[41] = animate, $[42] = t14) : t14 = $[42];
1752
1747
  let t15;
1753
- $[40] !== animate ? (t15 = animate ? ["visible", "scaleIn"] : void 0, $[40] = animate, $[41] = t15) : t15 = $[41];
1748
+ $[43] !== children || $[44] !== padding ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[43] = children, $[44] = padding, $[45] = t15) : t15 = $[45];
1754
1749
  let t16;
1755
- $[42] !== animate ? (t16 = animate ? ["hidden", "scaleOut"] : void 0, $[42] = animate, $[43] = t16) : t16 = $[43];
1750
+ $[46] !== maxWidth || $[47] !== overflow || $[48] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t15 }), $[46] = maxWidth, $[47] = overflow, $[48] = t15, $[49] = t16) : t16 = $[49];
1756
1751
  let t17;
1757
- $[44] !== children || $[45] !== padding ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[44] = children, $[45] = padding, $[46] = t17) : t17 = $[46];
1752
+ $[50] !== arrow || $[51] !== arrowRef || $[52] !== arrowStyle ? (t17 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[50] = arrow, $[51] = arrowRef, $[52] = arrowStyle, $[53] = t17) : t17 = $[53];
1758
1753
  let t18;
1759
- $[47] !== maxWidth || $[48] !== overflow || $[49] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t17 }), $[47] = maxWidth, $[48] = overflow, $[49] = t17, $[50] = t18) : t18 = $[50];
1760
- let t19;
1761
- $[51] !== arrow || $[52] !== arrowRef || $[53] !== arrowStyle ? (t19 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[51] = arrow, $[52] = arrowRef, $[53] = arrowStyle, $[54] = t19) : t19 = $[54];
1762
- let t20;
1763
- $[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__ */ jsxRuntime.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: [
1764
- t18,
1765
- t19
1766
- ] }), $[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];
1767
- let t21;
1768
- return $[70] !== t10 || $[71] !== t20 || $[72] !== t9 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: t9, scheme: t10, children: t20 }), $[70] = t10, $[71] = t20, $[72] = t9, $[73] = t21) : t21 = $[73], t21;
1754
+ 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__ */ jsxRuntime.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: [
1755
+ t16,
1756
+ t17
1757
+ ] }), $[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;
1769
1758
  }));
1770
1759
  PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
1771
1760
  const ViewportOverlay = () => {
@@ -1774,10 +1763,10 @@ const ViewportOverlay = () => {
1774
1763
  } = useLayer();
1775
1764
  let t0;
1776
1765
  return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
1777
- height: "100vh",
1778
- inset: 0,
1779
1766
  position: "fixed",
1767
+ inset: 0,
1780
1768
  width: "100vw",
1769
+ height: "100vh",
1781
1770
  zIndex
1782
1771
  } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
1783
1772
  }, Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
@@ -1810,11 +1799,10 @@ const ViewportOverlay = () => {
1810
1799
  shadow = 3,
1811
1800
  tone = "inherit",
1812
1801
  width: widthProp = "auto",
1813
- // zOffset: zOffsetProp = layer.popover.zOffset,
1814
1802
  zOffset: zOffsetProp = Z_OFFSETS.popover,
1815
1803
  updateRef,
1816
1804
  ...restProps
1817
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
1805
+ } = props, card = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
1818
1806
  react.useImperativeHandle(forwardedRef, () => ref.current);
1819
1807
  const referenceWidthRef = react.useRef(void 0), middleware = react.useMemo(() => {
1820
1808
  const ret = [];
@@ -1881,35 +1869,8 @@ const ViewportOverlay = () => {
1881
1869
  return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1882
1870
  const popover = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
1883
1871
  modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
1884
- /* @__PURE__ */ jsxRuntime.jsx(
1885
- PopoverCard,
1886
- {
1887
- ...restProps,
1888
- __unstable_margins: margins,
1889
- animate,
1890
- arrow: arrowProp,
1891
- arrowRef: setArrow,
1892
- arrowX,
1893
- arrowY,
1894
- hidden: referenceHidden,
1895
- maxWidth: widthProp,
1896
- overflow,
1897
- padding,
1898
- placement,
1899
- radius,
1900
- ref: setFloating,
1901
- scheme,
1902
- shadow,
1903
- originX,
1904
- originY,
1905
- strategy,
1906
- tone,
1907
- x,
1908
- y,
1909
- children: content
1910
- }
1911
- )
1912
- ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
1872
+ /* @__PURE__ */ jsxRuntime.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 })
1873
+ ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: tone === "inherit" ? card?.tone ?? "default" : tone, scheme: scheme ?? "light", children: popover }) }) : popover);
1913
1874
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1914
1875
  animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
1915
1876
  child
@@ -2246,7 +2207,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
2246
2207
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
2247
2208
  }, MotionCard = framerMotion.motion.create(Card), TooltipCard = react.memo(react.forwardRef(function(props, ref) {
2248
2209
  const $ = reactCompilerRuntime.c(52);
2249
- let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style, tone;
2210
+ let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style, t0;
2250
2211
  $[0] !== props ? ({
2251
2212
  animate,
2252
2213
  arrow,
@@ -2262,44 +2223,45 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
2262
2223
  scheme,
2263
2224
  shadow,
2264
2225
  style,
2265
- tone,
2226
+ tone: t0,
2266
2227
  ...restProps
2267
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[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], arrow = $[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]);
2268
- let t0;
2269
- const t1 = animate ? "transform" : void 0;
2270
- let t2;
2271
- $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t1 ? (t2 = {
2228
+ } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[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], arrow = $[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]);
2229
+ const tone = t0 === void 0 ? "inherit" : t0;
2230
+ let t1;
2231
+ const t2 = animate ? "transform" : void 0;
2232
+ let t3;
2233
+ $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
2272
2234
  originX,
2273
2235
  originY,
2274
- willChange: t1,
2236
+ willChange: t2,
2275
2237
  ...style
2276
- }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t1, $[21] = t2) : t2 = $[21], t0 = t2;
2277
- const rootStyle = t0;
2278
- let t3;
2279
- const t4 = arrowX !== null ? arrowX : void 0, t5 = arrowY !== null ? arrowY : void 0;
2280
- let t6;
2281
- $[22] !== t4 || $[23] !== t5 ? (t6 = {
2282
- left: t4,
2283
- top: t5,
2238
+ }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
2239
+ const rootStyle = t1;
2240
+ let t4;
2241
+ const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
2242
+ let t7;
2243
+ $[22] !== t5 || $[23] !== t6 ? (t7 = {
2244
+ left: t5,
2245
+ top: t6,
2284
2246
  right: void 0,
2285
2247
  bottom: void 0
2286
- }, $[22] = t4, $[23] = t5, $[24] = t6) : t6 = $[24], t3 = t6;
2287
- const arrowStyle = t3, t7 = animate ? "" : void 0;
2288
- let t8;
2289
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css.tooltipCard(), $[25] = t8) : t8 = $[25];
2248
+ }, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
2249
+ const arrowStyle = t4, t8 = animate ? "" : void 0;
2290
2250
  let t9;
2291
- $[26] !== animate ? (t9 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t9) : t9 = $[27];
2251
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.tooltipCard(), $[25] = t9) : t9 = $[25];
2292
2252
  let t10;
2293
- $[28] !== animate ? (t10 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t10) : t10 = $[29];
2253
+ $[26] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t10) : t10 = $[27];
2294
2254
  let t11;
2295
- $[30] !== animate ? (t11 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t11) : t11 = $[31];
2255
+ $[28] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t11) : t11 = $[29];
2296
2256
  let t12;
2297
- $[32] !== arrow || $[33] !== arrowRef || $[34] !== arrowStyle ? (t12 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[32] = arrow, $[33] = arrowRef, $[34] = arrowStyle, $[35] = t12) : t12 = $[35];
2257
+ $[30] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t12) : t12 = $[31];
2298
2258
  let t13;
2299
- 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__ */ jsxRuntime.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: [
2259
+ $[32] !== arrow || $[33] !== arrowRef || $[34] !== arrowStyle ? (t13 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[32] = arrow, $[33] = arrowRef, $[34] = arrowStyle, $[35] = t13) : t13 = $[35];
2260
+ let t14;
2261
+ 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__ */ jsxRuntime.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: [
2300
2262
  children,
2301
- t12
2302
- ] }), $[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;
2263
+ t13
2264
+ ] }), $[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;
2303
2265
  }));
2304
2266
  TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
2305
2267
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
@@ -2344,9 +2306,9 @@ const Tooltip = react.forwardRef(function(props, forwardedRef) {
2344
2306
  scheme,
2345
2307
  shadow = 2,
2346
2308
  zOffset = Z_OFFSETS.tooltip,
2347
- tone,
2309
+ tone = "inherit",
2348
2310
  ...restProps
2349
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
2311
+ } = props, card = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
2350
2312
  react.useImperativeHandle(forwardedRef, () => ref.current);
2351
2313
  const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = react.useMemo(() => {
2352
2314
  const ret = [];
@@ -2454,7 +2416,7 @@ const Tooltip = react.forwardRef(function(props, forwardedRef) {
2454
2416
  zOffset,
2455
2417
  children: /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, tone, children: content })
2456
2418
  }
2457
- ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: node_0 }) : node_0);
2419
+ ), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: tone === "inherit" ? card?.tone ?? "default" : tone, scheme: scheme ?? "light", children: node_0 }) }) : node_0);
2458
2420
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2459
2421
  animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
2460
2422
  child
@@ -3100,10 +3062,7 @@ exports._getArrayProp = _getArrayProp;
3100
3062
  exports._isEnterToClickElement = _isEnterToClickElement;
3101
3063
  exports._isScrollable = _isScrollable;
3102
3064
  exports.containsOrEqualsElement = containsOrEqualsElement;
3103
- exports.createColorTheme = createColorTheme;
3104
3065
  exports.createGlobalScopedContext = createGlobalScopedContext;
3105
- exports.hexToRgb = hexToRgb;
3106
- exports.hslToRgb = hslToRgb;
3107
3066
  exports.isHTMLAnchorElement = isHTMLAnchorElement;
3108
3067
  exports.isHTMLButtonElement = isHTMLButtonElement;
3109
3068
  exports.isHTMLElement = isHTMLElement;
@@ -3111,12 +3070,6 @@ exports.isHTMLInputElement = isHTMLInputElement;
3111
3070
  exports.isHTMLSelectElement = isHTMLSelectElement;
3112
3071
  exports.isHTMLTextAreaElement = isHTMLTextAreaElement;
3113
3072
  exports.isRecord = isRecord;
3114
- exports.multiply = multiply;
3115
- exports.parseColor = parseColor;
3116
- exports.rgbToHex = rgbToHex;
3117
- exports.rgbToHsl = rgbToHsl;
3118
- exports.rgba = rgba;
3119
- exports.screen = screen;
3120
3073
  exports.studioTheme = studioTheme;
3121
3074
  exports.useArrayProp = useArrayProp;
3122
3075
  exports.useBoundaryElement = useBoundaryElement;