@sanity/ui 3.0.0-static.13 → 3.0.0-static.15

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 (31) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +101 -106
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +101 -106
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/css.js.map +1 -1
  7. package/dist/css.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/src/css/aspects/margin/margin.style.ts +0 -3
  10. package/src/ui/primitives/popover/popover.tsx +7 -6
  11. package/src/ui/primitives/popover/{popoverCard.tsx → popoverLayer.tsx} +14 -28
  12. package/src/ui/primitives/tooltip/tooltip.tsx +21 -24
  13. package/src/ui/primitives/tooltip/{tooltipCard.tsx → tooltipLayer.tsx} +14 -27
  14. package/src/css/aspects/height/rules.ts +0 -7
  15. package/src/css/aspects/width/rules.ts +0 -8
  16. package/src/css/components/menu/rules.ts +0 -15
  17. package/src/css/primitives/avatar/rules.ts +0 -176
  18. package/src/css/primitives/button/rules.ts +0 -302
  19. package/src/css/primitives/checkbox/rules.ts +0 -152
  20. package/src/css/primitives/code/rules.ts +0 -96
  21. package/src/css/primitives/container/rules.ts +0 -8
  22. package/src/css/primitives/heading/rules.ts +0 -155
  23. package/src/css/primitives/kbd/rules.ts +0 -20
  24. package/src/css/primitives/label/rules.ts +0 -137
  25. package/src/css/primitives/radio/rules.ts +0 -121
  26. package/src/css/primitives/select/rules.ts +0 -22
  27. package/src/css/primitives/switch/rules.ts +0 -340
  28. package/src/css/primitives/text/rules.ts +0 -164
  29. package/src/css/primitives/textArea/rules.ts +0 -7
  30. package/src/css/primitives/textInput/rules.ts +0 -224
  31. package/src/css/primitives/tooltip/rules.ts +0 -19
@@ -1688,18 +1688,16 @@ function size(options) {
1688
1688
  }
1689
1689
  };
1690
1690
  }
1691
- const DEFAULT_POPOVER_CARD_ELEMENT = "div", MotionCard$1 = motion.create(Card);
1692
- function PopoverCard(props) {
1693
- const $ = c(68), t0 = props;
1694
- let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t1, t2, xProp, yProp;
1695
- $[0] !== t0 ? ({
1691
+ function PopoverLayer(props) {
1692
+ const $ = c(65);
1693
+ let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t0, xProp, yProp;
1694
+ $[0] !== props ? ({
1696
1695
  __unstable_margins: marginsProp,
1697
1696
  animate,
1698
1697
  arrow: arrow2,
1699
1698
  arrowRef,
1700
1699
  arrowX,
1701
1700
  arrowY,
1702
- as: t1,
1703
1701
  children,
1704
1702
  maxWidth,
1705
1703
  padding,
@@ -1712,61 +1710,59 @@ function PopoverCard(props) {
1712
1710
  shadow,
1713
1711
  strategy,
1714
1712
  style,
1715
- tone: t2,
1713
+ tone: t0,
1716
1714
  x: xProp,
1717
1715
  y: yProp,
1718
1716
  ...rest
1719
- } = t0, $[0] = t0, $[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] = rest, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = t1, $[21] = t2, $[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], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t1 = $[20], t2 = $[21], xProp = $[22], yProp = $[23]);
1720
- const as = t1 === void 0 ? DEFAULT_POPOVER_CARD_ELEMENT : t1, tone = t2 === void 0 ? "inherit" : t2, layer = useLayer();
1721
- let t3;
1722
- t3 = marginsProp || DEFAULT_POPOVER_MARGINS;
1723
- const margins = t3, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1717
+ } = 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] = rest, $[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], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
1718
+ const tone = t0 === void 0 ? "inherit" : t0;
1719
+ let t1;
1720
+ t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
1721
+ const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
1722
+ let t2;
1723
+ const t3 = animate ? "transform" : void 0;
1724
1724
  let t4;
1725
- const t5 = layer.zIndex ?? 100, t6 = animate ? "transform" : void 0;
1726
- let t7;
1727
- $[24] !== originX || $[25] !== originY || $[26] !== referenceWidth || $[27] !== strategy || $[28] !== style || $[29] !== t5 || $[30] !== t6 || $[31] !== x || $[32] !== y ? (t7 = {
1725
+ $[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t3 || $[28] !== x || $[29] !== y ? (t4 = {
1728
1726
  left: x,
1729
1727
  originX,
1730
1728
  originY,
1731
- position: strategy,
1732
1729
  top: y,
1733
1730
  width: referenceWidth,
1734
- zIndex: t5,
1735
- willChange: t6,
1731
+ willChange: t3,
1736
1732
  ...style
1737
- }, $[24] = originX, $[25] = originY, $[26] = referenceWidth, $[27] = strategy, $[28] = style, $[29] = t5, $[30] = t6, $[31] = x, $[32] = y, $[33] = t7) : t7 = $[33], t4 = t7;
1738
- const rootStyle = t4;
1733
+ }, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t3, $[28] = x, $[29] = y, $[30] = t4) : t4 = $[30], t2 = t4;
1734
+ const rootStyle = t2;
1735
+ let t5;
1736
+ const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
1739
1737
  let t8;
1740
- const t9 = arrowX !== null ? arrowX : void 0, t10 = arrowY !== null ? arrowY : void 0;
1741
- let t11;
1742
- $[34] !== t10 || $[35] !== t9 ? (t11 = {
1743
- left: t9,
1744
- top: t10,
1738
+ $[31] !== t6 || $[32] !== t7 ? (t8 = {
1739
+ left: t6,
1740
+ top: t7,
1745
1741
  right: void 0,
1746
1742
  bottom: void 0
1747
- }, $[34] = t10, $[35] = t9, $[36] = t11) : t11 = $[36], t8 = t11;
1748
- const arrowStyle = t8;
1743
+ }, $[31] = t6, $[32] = t7, $[33] = t8) : t8 = $[33], t5 = t8;
1744
+ const arrowStyle = t5;
1745
+ let t9;
1746
+ $[34] === Symbol.for("react.memo_cache_sentinel") ? (t9 = popoverCard(), $[34] = t9) : t9 = $[34];
1747
+ let t10;
1748
+ $[35] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t10) : t10 = $[36];
1749
+ let t11;
1750
+ $[37] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t11) : t11 = $[38];
1749
1751
  let t12;
1750
- $[37] === Symbol.for("react.memo_cache_sentinel") ? (t12 = popoverCard(), $[37] = t12) : t12 = $[37];
1752
+ $[39] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t12) : t12 = $[40];
1751
1753
  let t13;
1752
- $[38] !== animate ? (t13 = animate ? ["hidden", "initial"] : void 0, $[38] = animate, $[39] = t13) : t13 = $[39];
1754
+ $[41] !== children || $[42] !== padding ? (t13 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t13) : t13 = $[43];
1753
1755
  let t14;
1754
- $[40] !== animate ? (t14 = animate ? ["visible", "scaleIn"] : void 0, $[40] = animate, $[41] = t14) : t14 = $[41];
1756
+ $[44] !== maxWidth || $[45] !== overflow || $[46] !== t13 ? (t14 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t13 }), $[44] = maxWidth, $[45] = overflow, $[46] = t13, $[47] = t14) : t14 = $[47];
1755
1757
  let t15;
1756
- $[42] !== animate ? (t15 = animate ? ["hidden", "scaleOut"] : void 0, $[42] = animate, $[43] = t15) : t15 = $[43];
1758
+ $[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t15 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t15) : t15 = $[51];
1757
1759
  let t16;
1758
- $[44] !== children || $[45] !== padding ? (t16 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[44] = children, $[45] = padding, $[46] = t16) : t16 = $[46];
1759
- let t17;
1760
- $[47] !== maxWidth || $[48] !== overflow || $[49] !== t16 ? (t17 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t16 }), $[47] = maxWidth, $[48] = overflow, $[49] = t16, $[50] = t17) : t17 = $[50];
1761
- let t18;
1762
- $[51] !== arrow2 || $[52] !== arrowRef || $[53] !== arrowStyle ? (t18 = 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] = t18) : t18 = $[54];
1763
- let t19;
1764
- return $[55] !== as || $[56] !== placement || $[57] !== radius || $[58] !== rest || $[59] !== rootStyle || $[60] !== shadow || $[61] !== t13 || $[62] !== t14 || $[63] !== t15 || $[64] !== t17 || $[65] !== t18 || $[66] !== tone ? (t19 = /* @__PURE__ */ jsxs(MotionCard$1, { className: t12, "data-ui": "Popover", ...rest, as, "data-context-tone": tone, "data-placement": placement, direction: "column", display: "flex", radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t13, animate: t14, exit: t15, children: [
1765
- t17,
1766
- t18
1767
- ] }), $[55] = as, $[56] = placement, $[57] = radius, $[58] = rest, $[59] = rootStyle, $[60] = shadow, $[61] = t13, $[62] = t14, $[63] = t15, $[64] = t17, $[65] = t18, $[66] = tone, $[67] = t19) : t19 = $[67], t19;
1760
+ return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t10 || $[59] !== t11 || $[60] !== t12 || $[61] !== t14 || $[62] !== t15 || $[63] !== tone ? (t16 = /* @__PURE__ */ jsxs(Layer, { className: t9, "data-ui": "Popover", ...rest, as: motion.div, "data-context-tone": tone, "data-placement": placement, direction: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, children: [
1761
+ t14,
1762
+ t15
1763
+ ] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t10, $[59] = t11, $[60] = t12, $[61] = t14, $[62] = t15, $[63] = tone, $[64] = t16) : t16 = $[64], t16;
1768
1764
  }
1769
- PopoverCard.displayName = "PopoverCard";
1765
+ PopoverLayer.displayName = "PopoverCard";
1770
1766
  const DEFAULT_POPOVER_ELEMENT = "div";
1771
1767
  function ViewportOverlay() {
1772
1768
  const $ = c(2), {
@@ -1881,9 +1877,9 @@ function Popover(props) {
1881
1877
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
1882
1878
  }, [update, updateRef]), disabled)
1883
1879
  return childProp || /* @__PURE__ */ jsx(Fragment, {});
1884
- const popover = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
1880
+ const popover = /* @__PURE__ */ jsxs(Fragment, { children: [
1885
1881
  modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
1886
- /* @__PURE__ */ jsx(PopoverCard, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, x, y, children: content })
1882
+ /* @__PURE__ */ jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, x, y, zOffset, children: content })
1887
1883
  ] }), 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);
1888
1884
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1889
1885
  animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
@@ -2242,17 +2238,39 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
2242
2238
  right: ["right-end", "right-start", "left", "top", "bottom"],
2243
2239
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
2244
2240
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
2245
- }, DEFAULT_TOOLTIP_CARD_ELEMENT = "div", MotionCard = motion.create(Card);
2246
- function TooltipCard(props) {
2247
- const $ = c(53), t0 = props;
2248
- let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t1, t2;
2249
- $[0] !== t0 ? ({
2241
+ }, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2242
+ function TooltipDelayGroupProvider(props) {
2243
+ const $ = c(9), {
2244
+ children,
2245
+ delay
2246
+ } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
2247
+ let t0;
2248
+ const t1 = isGroupActive ? 1 : openDelay;
2249
+ let t2;
2250
+ $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
2251
+ setIsGroupActive,
2252
+ openTooltipId,
2253
+ setOpenTooltipId,
2254
+ openDelay: t1,
2255
+ closeDelay
2256
+ }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
2257
+ const value = t0;
2258
+ let t3;
2259
+ return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
2260
+ }
2261
+ TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
2262
+ function useTooltipDelayGroup() {
2263
+ return useContext(TooltipDelayGroupContext);
2264
+ }
2265
+ function TooltipLayer(props) {
2266
+ const $ = c(51);
2267
+ let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
2268
+ $[0] !== props ? ({
2250
2269
  animate,
2251
2270
  arrow: arrow2,
2252
2271
  arrowRef,
2253
2272
  arrowX,
2254
2273
  arrowY,
2255
- as: t1,
2256
2274
  children,
2257
2275
  originX,
2258
2276
  originY,
@@ -2262,72 +2280,48 @@ function TooltipCard(props) {
2262
2280
  scheme,
2263
2281
  shadow,
2264
2282
  style,
2265
- tone: t2,
2283
+ tone: t0,
2266
2284
  ...rest
2267
- } = t0, $[0] = t0, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = rest, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = t1, $[17] = t2) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t1 = $[16], t2 = $[17]);
2268
- const as = t1 === void 0 ? DEFAULT_TOOLTIP_CARD_ELEMENT : t1, tone = t2 === void 0 ? "inherit" : t2;
2285
+ } = 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] = rest, $[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], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
2286
+ const tone = t0 === void 0 ? "inherit" : t0;
2287
+ let t1;
2288
+ const t2 = animate ? "transform" : void 0;
2269
2289
  let t3;
2270
- const t4 = animate ? "transform" : void 0;
2271
- let t5;
2272
- $[18] !== originX || $[19] !== originY || $[20] !== style || $[21] !== t4 ? (t5 = {
2290
+ $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
2273
2291
  originX,
2274
2292
  originY,
2275
- willChange: t4,
2293
+ willChange: t2,
2276
2294
  ...style
2277
- }, $[18] = originX, $[19] = originY, $[20] = style, $[21] = t4, $[22] = t5) : t5 = $[22], t3 = t5;
2278
- const rootStyle = t3;
2279
- let t6;
2280
- const t7 = arrowX !== null ? arrowX : void 0, t8 = arrowY !== null ? arrowY : void 0;
2281
- let t9;
2282
- $[23] !== t7 || $[24] !== t8 ? (t9 = {
2283
- left: t7,
2284
- top: t8,
2295
+ }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
2296
+ const rootStyle = t1;
2297
+ let t4;
2298
+ const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
2299
+ let t7;
2300
+ $[22] !== t5 || $[23] !== t6 ? (t7 = {
2301
+ left: t5,
2302
+ top: t6,
2285
2303
  right: void 0,
2286
2304
  bottom: void 0
2287
- }, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t6 = t9;
2288
- const arrowStyle = t6;
2305
+ }, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
2306
+ const arrowStyle = t4;
2307
+ let t8;
2308
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t8 = tooltipCard(), $[25] = t8) : t8 = $[25];
2309
+ const t9 = animate ? "" : void 0;
2289
2310
  let t10;
2290
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t10 = tooltipCard(), $[26] = t10) : t10 = $[26];
2291
- const t11 = animate ? "" : void 0;
2311
+ $[26] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t10) : t10 = $[27];
2312
+ let t11;
2313
+ $[28] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t11) : t11 = $[29];
2292
2314
  let t12;
2293
- $[27] !== animate ? (t12 = animate ? ["hidden", "initial"] : void 0, $[27] = animate, $[28] = t12) : t12 = $[28];
2315
+ $[30] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t12) : t12 = $[31];
2294
2316
  let t13;
2295
- $[29] !== animate ? (t13 = animate ? ["visible", "scaleIn"] : void 0, $[29] = animate, $[30] = t13) : t13 = $[30];
2317
+ $[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];
2296
2318
  let t14;
2297
- $[31] !== animate ? (t14 = animate ? ["hidden", "scaleOut"] : void 0, $[31] = animate, $[32] = t14) : t14 = $[32];
2298
- let t15;
2299
- $[33] !== arrow2 || $[34] !== arrowRef || $[35] !== arrowStyle ? (t15 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[33] = arrow2, $[34] = arrowRef, $[35] = arrowStyle, $[36] = t15) : t15 = $[36];
2300
- let t16;
2301
- return $[37] !== as || $[38] !== children || $[39] !== padding || $[40] !== placement || $[41] !== radius || $[42] !== rest || $[43] !== rootStyle || $[44] !== scheme || $[45] !== shadow || $[46] !== t11 || $[47] !== t12 || $[48] !== t13 || $[49] !== t14 || $[50] !== t15 || $[51] !== tone ? (t16 = /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...rest, as, className: t10, "data-animate": t11, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t12, animate: t13, exit: t14, tone, children: [
2302
- children,
2303
- t15
2304
- ] }), $[37] = as, $[38] = children, $[39] = padding, $[40] = placement, $[41] = radius, $[42] = rest, $[43] = rootStyle, $[44] = scheme, $[45] = shadow, $[46] = t11, $[47] = t12, $[48] = t13, $[49] = t14, $[50] = t15, $[51] = tone, $[52] = t16) : t16 = $[52], t16;
2305
- }
2306
- TooltipCard.displayName = "TooltipCard";
2307
- const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2308
- function TooltipDelayGroupProvider(props) {
2309
- const $ = c(9), {
2319
+ return $[36] !== children || $[37] !== padding || $[38] !== placement || $[39] !== radius || $[40] !== rest || $[41] !== rootStyle || $[42] !== scheme || $[43] !== shadow || $[44] !== t10 || $[45] !== t11 || $[46] !== t12 || $[47] !== t13 || $[48] !== t9 || $[49] !== tone ? (t14 = /* @__PURE__ */ jsxs(Layer, { "data-ui": "Tooltip__card", ...rest, as: motion.div, className: t8, "data-animate": t9, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, tone, children: [
2310
2320
  children,
2311
- delay
2312
- } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
2313
- let t0;
2314
- const t1 = isGroupActive ? 1 : openDelay;
2315
- let t2;
2316
- $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
2317
- setIsGroupActive,
2318
- openTooltipId,
2319
- setOpenTooltipId,
2320
- openDelay: t1,
2321
- closeDelay
2322
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
2323
- const value = t0;
2324
- let t3;
2325
- return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
2326
- }
2327
- TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
2328
- function useTooltipDelayGroup() {
2329
- return useContext(TooltipDelayGroupContext);
2321
+ t13
2322
+ ] }), $[36] = children, $[37] = padding, $[38] = placement, $[39] = radius, $[40] = rest, $[41] = rootStyle, $[42] = scheme, $[43] = shadow, $[44] = t10, $[45] = t11, $[46] = t12, $[47] = t13, $[48] = t9, $[49] = tone, $[50] = t14) : t14 = $[50], t14;
2330
2323
  }
2324
+ TooltipLayer.displayName = "TooltipLayer";
2331
2325
  const DEFAULT_TOOLTIP_ELEMENT = "div";
2332
2326
  function Tooltip(props) {
2333
2327
  const boundaryElementContext = useBoundaryElement(), {
@@ -2382,7 +2376,8 @@ function Tooltip(props) {
2382
2376
  whileElementsMounted: autoUpdate,
2383
2377
  elements: {
2384
2378
  reference: referenceElement
2385
- }
2379
+ },
2380
+ transform: !1
2386
2381
  }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
2387
2382
  setIsGroupActive,
2388
2383
  setOpenTooltipId
@@ -2446,10 +2441,10 @@ function Tooltip(props) {
2446
2441
  }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
2447
2442
  if (useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsx(Fragment, {});
2448
2443
  if (disabled) return child;
2449
- const node_0 = /* @__PURE__ */ jsx(Layer, { "data-ui": "Tooltip", className: composeClassNames(className, tooltip()), ref: setFloating, style: {
2444
+ const node_0 = /* @__PURE__ */ jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: composeClassNames(className, tooltip()), originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: {
2450
2445
  ...floatingStyles,
2451
2446
  maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
2452
- }, zOffset, children: /* @__PURE__ */ jsx(TooltipCard, { ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, tone, children: content }) }), 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);
2447
+ }, tone, zOffset, children: content }), 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);
2453
2448
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2454
2449
  animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
2455
2450
  child