@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.
- package/dist/_chunks-cjs/_visual-editing.js +101 -106
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +101 -106
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/css.js.map +1 -1
- package/dist/css.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/aspects/margin/margin.style.ts +0 -3
- package/src/ui/primitives/popover/popover.tsx +7 -6
- package/src/ui/primitives/popover/{popoverCard.tsx → popoverLayer.tsx} +14 -28
- package/src/ui/primitives/tooltip/tooltip.tsx +21 -24
- package/src/ui/primitives/tooltip/{tooltipCard.tsx → tooltipLayer.tsx} +14 -27
- package/src/css/aspects/height/rules.ts +0 -7
- package/src/css/aspects/width/rules.ts +0 -8
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/primitives/avatar/rules.ts +0 -176
- package/src/css/primitives/button/rules.ts +0 -302
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/select/rules.ts +0 -22
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/tooltip/rules.ts +0 -19
|
@@ -1679,18 +1679,16 @@ function size(options) {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
};
|
|
1681
1681
|
}
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
$[0] !== t0 ? ({
|
|
1682
|
+
function PopoverLayer(props) {
|
|
1683
|
+
const $ = reactCompilerRuntime.c(65);
|
|
1684
|
+
let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, maxWidth, originX, originY, overflow, padding, placement, radius, referenceWidth, rest, shadow, strategy, style, t0, xProp, yProp;
|
|
1685
|
+
$[0] !== props ? ({
|
|
1687
1686
|
__unstable_margins: marginsProp,
|
|
1688
1687
|
animate,
|
|
1689
1688
|
arrow,
|
|
1690
1689
|
arrowRef,
|
|
1691
1690
|
arrowX,
|
|
1692
1691
|
arrowY,
|
|
1693
|
-
as: t1,
|
|
1694
1692
|
children,
|
|
1695
1693
|
maxWidth,
|
|
1696
1694
|
padding,
|
|
@@ -1703,61 +1701,59 @@ function PopoverCard(props) {
|
|
|
1703
1701
|
shadow,
|
|
1704
1702
|
strategy,
|
|
1705
1703
|
style,
|
|
1706
|
-
tone:
|
|
1704
|
+
tone: t0,
|
|
1707
1705
|
x: xProp,
|
|
1708
1706
|
y: yProp,
|
|
1709
1707
|
...rest
|
|
1710
|
-
} =
|
|
1711
|
-
const
|
|
1712
|
-
let
|
|
1713
|
-
|
|
1714
|
-
const margins =
|
|
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] = rest, $[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], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
|
|
1709
|
+
const tone = t0 === void 0 ? "inherit" : t0;
|
|
1710
|
+
let t1;
|
|
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 = animate ? "transform" : void 0;
|
|
1715
1715
|
let t4;
|
|
1716
|
-
|
|
1717
|
-
let t7;
|
|
1718
|
-
$[24] !== originX || $[25] !== originY || $[26] !== referenceWidth || $[27] !== strategy || $[28] !== style || $[29] !== t5 || $[30] !== t6 || $[31] !== x || $[32] !== y ? (t7 = {
|
|
1716
|
+
$[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t3 || $[28] !== x || $[29] !== y ? (t4 = {
|
|
1719
1717
|
left: x,
|
|
1720
1718
|
originX,
|
|
1721
1719
|
originY,
|
|
1722
|
-
position: strategy,
|
|
1723
1720
|
top: y,
|
|
1724
1721
|
width: referenceWidth,
|
|
1725
|
-
|
|
1726
|
-
willChange: t6,
|
|
1722
|
+
willChange: t3,
|
|
1727
1723
|
...style
|
|
1728
|
-
}, $[
|
|
1729
|
-
const rootStyle =
|
|
1724
|
+
}, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t3, $[28] = x, $[29] = y, $[30] = t4) : t4 = $[30], t2 = t4;
|
|
1725
|
+
const rootStyle = t2;
|
|
1726
|
+
let t5;
|
|
1727
|
+
const t6 = arrowX !== null ? arrowX : void 0, t7 = arrowY !== null ? arrowY : void 0;
|
|
1730
1728
|
let t8;
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
left: t9,
|
|
1735
|
-
top: t10,
|
|
1729
|
+
$[31] !== t6 || $[32] !== t7 ? (t8 = {
|
|
1730
|
+
left: t6,
|
|
1731
|
+
top: t7,
|
|
1736
1732
|
right: void 0,
|
|
1737
1733
|
bottom: void 0
|
|
1738
|
-
}, $[
|
|
1739
|
-
const arrowStyle =
|
|
1734
|
+
}, $[31] = t6, $[32] = t7, $[33] = t8) : t8 = $[33], t5 = t8;
|
|
1735
|
+
const arrowStyle = t5;
|
|
1736
|
+
let t9;
|
|
1737
|
+
$[34] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.popoverCard(), $[34] = t9) : t9 = $[34];
|
|
1738
|
+
let t10;
|
|
1739
|
+
$[35] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t10) : t10 = $[36];
|
|
1740
|
+
let t11;
|
|
1741
|
+
$[37] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t11) : t11 = $[38];
|
|
1740
1742
|
let t12;
|
|
1741
|
-
$[
|
|
1743
|
+
$[39] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t12) : t12 = $[40];
|
|
1742
1744
|
let t13;
|
|
1743
|
-
$[
|
|
1745
|
+
$[41] !== children || $[42] !== padding ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t13) : t13 = $[43];
|
|
1744
1746
|
let t14;
|
|
1745
|
-
$[
|
|
1747
|
+
$[44] !== maxWidth || $[45] !== overflow || $[46] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t13 }), $[44] = maxWidth, $[45] = overflow, $[46] = t13, $[47] = t14) : t14 = $[47];
|
|
1746
1748
|
let t15;
|
|
1747
|
-
$[
|
|
1749
|
+
$[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t15 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t15) : t15 = $[51];
|
|
1748
1750
|
let t16;
|
|
1749
|
-
$[
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
$[51] !== arrow || $[52] !== arrowRef || $[53] !== arrowStyle ? (t18 = 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] = t18) : t18 = $[54];
|
|
1754
|
-
let t19;
|
|
1755
|
-
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__ */ jsxRuntime.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: [
|
|
1756
|
-
t17,
|
|
1757
|
-
t18
|
|
1758
|
-
] }), $[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;
|
|
1751
|
+
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__ */ jsxRuntime.jsxs(Layer, { className: t9, "data-ui": "Popover", ...rest, as: framerMotion.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: [
|
|
1752
|
+
t14,
|
|
1753
|
+
t15
|
|
1754
|
+
] }), $[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;
|
|
1759
1755
|
}
|
|
1760
|
-
|
|
1756
|
+
PopoverLayer.displayName = "PopoverCard";
|
|
1761
1757
|
const DEFAULT_POPOVER_ELEMENT = "div";
|
|
1762
1758
|
function ViewportOverlay() {
|
|
1763
1759
|
const $ = reactCompilerRuntime.c(2), {
|
|
@@ -1872,9 +1868,9 @@ function Popover(props) {
|
|
|
1872
1868
|
updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
|
|
1873
1869
|
}, [update, updateRef]), disabled)
|
|
1874
1870
|
return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1875
|
-
const popover = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1871
|
+
const popover = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1876
1872
|
modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
|
|
1877
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1873
|
+
/* @__PURE__ */ jsxRuntime.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 })
|
|
1878
1874
|
] }), 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);
|
|
1879
1875
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1880
1876
|
animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
|
|
@@ -2233,17 +2229,39 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
2233
2229
|
right: ["right-end", "right-start", "left", "top", "bottom"],
|
|
2234
2230
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
2235
2231
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
2236
|
-
},
|
|
2237
|
-
function
|
|
2238
|
-
const $ = reactCompilerRuntime.c(
|
|
2239
|
-
|
|
2240
|
-
|
|
2232
|
+
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
|
|
2233
|
+
function TooltipDelayGroupProvider(props) {
|
|
2234
|
+
const $ = reactCompilerRuntime.c(9), {
|
|
2235
|
+
children,
|
|
2236
|
+
delay
|
|
2237
|
+
} = 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;
|
|
2238
|
+
let t0;
|
|
2239
|
+
const t1 = isGroupActive ? 1 : openDelay;
|
|
2240
|
+
let t2;
|
|
2241
|
+
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
|
|
2242
|
+
setIsGroupActive,
|
|
2243
|
+
openTooltipId,
|
|
2244
|
+
setOpenTooltipId,
|
|
2245
|
+
openDelay: t1,
|
|
2246
|
+
closeDelay
|
|
2247
|
+
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
|
|
2248
|
+
const value = t0;
|
|
2249
|
+
let t3;
|
|
2250
|
+
return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
|
|
2251
|
+
}
|
|
2252
|
+
TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
2253
|
+
function useTooltipDelayGroup() {
|
|
2254
|
+
return react.useContext(TooltipDelayGroupContext);
|
|
2255
|
+
}
|
|
2256
|
+
function TooltipLayer(props) {
|
|
2257
|
+
const $ = reactCompilerRuntime.c(51);
|
|
2258
|
+
let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
|
|
2259
|
+
$[0] !== props ? ({
|
|
2241
2260
|
animate,
|
|
2242
2261
|
arrow,
|
|
2243
2262
|
arrowRef,
|
|
2244
2263
|
arrowX,
|
|
2245
2264
|
arrowY,
|
|
2246
|
-
as: t1,
|
|
2247
2265
|
children,
|
|
2248
2266
|
originX,
|
|
2249
2267
|
originY,
|
|
@@ -2253,72 +2271,48 @@ function TooltipCard(props) {
|
|
|
2253
2271
|
scheme,
|
|
2254
2272
|
shadow,
|
|
2255
2273
|
style,
|
|
2256
|
-
tone:
|
|
2274
|
+
tone: t0,
|
|
2257
2275
|
...rest
|
|
2258
|
-
} =
|
|
2259
|
-
const
|
|
2276
|
+
} = 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] = rest, $[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], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
|
|
2277
|
+
const tone = t0 === void 0 ? "inherit" : t0;
|
|
2278
|
+
let t1;
|
|
2279
|
+
const t2 = animate ? "transform" : void 0;
|
|
2260
2280
|
let t3;
|
|
2261
|
-
|
|
2262
|
-
let t5;
|
|
2263
|
-
$[18] !== originX || $[19] !== originY || $[20] !== style || $[21] !== t4 ? (t5 = {
|
|
2281
|
+
$[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
|
|
2264
2282
|
originX,
|
|
2265
2283
|
originY,
|
|
2266
|
-
willChange:
|
|
2284
|
+
willChange: t2,
|
|
2267
2285
|
...style
|
|
2268
|
-
}, $[
|
|
2269
|
-
const rootStyle =
|
|
2270
|
-
let
|
|
2271
|
-
const
|
|
2272
|
-
let
|
|
2273
|
-
$[
|
|
2274
|
-
left:
|
|
2275
|
-
top:
|
|
2286
|
+
}, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t2, $[21] = t3) : t3 = $[21], t1 = t3;
|
|
2287
|
+
const rootStyle = t1;
|
|
2288
|
+
let t4;
|
|
2289
|
+
const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
|
|
2290
|
+
let t7;
|
|
2291
|
+
$[22] !== t5 || $[23] !== t6 ? (t7 = {
|
|
2292
|
+
left: t5,
|
|
2293
|
+
top: t6,
|
|
2276
2294
|
right: void 0,
|
|
2277
2295
|
bottom: void 0
|
|
2278
|
-
}, $[
|
|
2279
|
-
const arrowStyle =
|
|
2296
|
+
}, $[22] = t5, $[23] = t6, $[24] = t7) : t7 = $[24], t4 = t7;
|
|
2297
|
+
const arrowStyle = t4;
|
|
2298
|
+
let t8;
|
|
2299
|
+
$[25] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css.tooltipCard(), $[25] = t8) : t8 = $[25];
|
|
2300
|
+
const t9 = animate ? "" : void 0;
|
|
2280
2301
|
let t10;
|
|
2281
|
-
$[26]
|
|
2282
|
-
|
|
2302
|
+
$[26] !== animate ? (t10 = animate ? ["hidden", "initial"] : void 0, $[26] = animate, $[27] = t10) : t10 = $[27];
|
|
2303
|
+
let t11;
|
|
2304
|
+
$[28] !== animate ? (t11 = animate ? ["visible", "scaleIn"] : void 0, $[28] = animate, $[29] = t11) : t11 = $[29];
|
|
2283
2305
|
let t12;
|
|
2284
|
-
$[
|
|
2306
|
+
$[30] !== animate ? (t12 = animate ? ["hidden", "scaleOut"] : void 0, $[30] = animate, $[31] = t12) : t12 = $[31];
|
|
2285
2307
|
let t13;
|
|
2286
|
-
$[
|
|
2308
|
+
$[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];
|
|
2287
2309
|
let t14;
|
|
2288
|
-
$[
|
|
2289
|
-
let t15;
|
|
2290
|
-
$[33] !== arrow || $[34] !== arrowRef || $[35] !== arrowStyle ? (t15 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[33] = arrow, $[34] = arrowRef, $[35] = arrowStyle, $[36] = t15) : t15 = $[36];
|
|
2291
|
-
let t16;
|
|
2292
|
-
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__ */ jsxRuntime.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: [
|
|
2293
|
-
children,
|
|
2294
|
-
t15
|
|
2295
|
-
] }), $[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;
|
|
2296
|
-
}
|
|
2297
|
-
TooltipCard.displayName = "TooltipCard";
|
|
2298
|
-
const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
|
|
2299
|
-
function TooltipDelayGroupProvider(props) {
|
|
2300
|
-
const $ = reactCompilerRuntime.c(9), {
|
|
2310
|
+
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__ */ jsxRuntime.jsxs(Layer, { "data-ui": "Tooltip__card", ...rest, as: framerMotion.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: [
|
|
2301
2311
|
children,
|
|
2302
|
-
|
|
2303
|
-
} =
|
|
2304
|
-
let t0;
|
|
2305
|
-
const t1 = isGroupActive ? 1 : openDelay;
|
|
2306
|
-
let t2;
|
|
2307
|
-
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
|
|
2308
|
-
setIsGroupActive,
|
|
2309
|
-
openTooltipId,
|
|
2310
|
-
setOpenTooltipId,
|
|
2311
|
-
openDelay: t1,
|
|
2312
|
-
closeDelay
|
|
2313
|
-
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
|
|
2314
|
-
const value = t0;
|
|
2315
|
-
let t3;
|
|
2316
|
-
return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
|
|
2317
|
-
}
|
|
2318
|
-
TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
2319
|
-
function useTooltipDelayGroup() {
|
|
2320
|
-
return react.useContext(TooltipDelayGroupContext);
|
|
2312
|
+
t13
|
|
2313
|
+
] }), $[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;
|
|
2321
2314
|
}
|
|
2315
|
+
TooltipLayer.displayName = "TooltipLayer";
|
|
2322
2316
|
const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
2323
2317
|
function Tooltip(props) {
|
|
2324
2318
|
const boundaryElementContext = useBoundaryElement(), {
|
|
@@ -2373,7 +2367,8 @@ function Tooltip(props) {
|
|
|
2373
2367
|
whileElementsMounted: reactDom$1.autoUpdate,
|
|
2374
2368
|
elements: {
|
|
2375
2369
|
reference: referenceElement
|
|
2376
|
-
}
|
|
2370
|
+
},
|
|
2371
|
+
transform: !1
|
|
2377
2372
|
}), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
|
|
2378
2373
|
setIsGroupActive,
|
|
2379
2374
|
setOpenTooltipId
|
|
@@ -2437,10 +2432,10 @@ function Tooltip(props) {
|
|
|
2437
2432
|
}) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
|
|
2438
2433
|
if (react.useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2439
2434
|
if (disabled) return child;
|
|
2440
|
-
const node_0 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2435
|
+
const node_0 = /* @__PURE__ */ jsxRuntime.jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: css.composeClassNames(className, css.tooltip()), originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: {
|
|
2441
2436
|
...floatingStyles,
|
|
2442
2437
|
maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
|
|
2443
|
-
},
|
|
2438
|
+
}, tone, zOffset, children: content }), 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);
|
|
2444
2439
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2445
2440
|
animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
|
|
2446
2441
|
child
|