@sanity/ui 2.9.0-canary.4 → 2.9.0-canary.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3757,8 +3757,8 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3757
3757
  will-change: opacity;
3758
3758
  }
3759
3759
  `, PopoverCard = react.memo(react.forwardRef(function(props, ref) {
3760
- const $ = reactCompilerRuntime.c(60);
3761
- let marginsProp, xProp, yProp, animate, originX, originY, strategy, style, width, arrowX, arrowY, restProps, padding, children, overflow, arrow, arrowRef, placement, radius, scheme, shadow, tone;
3760
+ const $ = reactCompilerRuntime.c(58);
3761
+ let marginsProp, xProp, yProp, animate, originX, originY, strategy, style, arrowX, arrowY, restProps, padding, children, overflow, arrow, arrowRef, placement, radius, scheme, shadow, tone;
3762
3762
  $[0] !== props ? ({
3763
3763
  __unstable_margins: marginsProp,
3764
3764
  animate,
@@ -3778,11 +3778,10 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3778
3778
  strategy,
3779
3779
  style,
3780
3780
  tone,
3781
- width,
3782
3781
  x: xProp,
3783
3782
  y: yProp,
3784
3783
  ...restProps
3785
- } = props, $[0] = props, $[1] = marginsProp, $[2] = xProp, $[3] = yProp, $[4] = animate, $[5] = originX, $[6] = originY, $[7] = strategy, $[8] = style, $[9] = width, $[10] = arrowX, $[11] = arrowY, $[12] = restProps, $[13] = padding, $[14] = children, $[15] = overflow, $[16] = arrow, $[17] = arrowRef, $[18] = placement, $[19] = radius, $[20] = scheme, $[21] = shadow, $[22] = tone) : (marginsProp = $[1], xProp = $[2], yProp = $[3], animate = $[4], originX = $[5], originY = $[6], strategy = $[7], style = $[8], width = $[9], arrowX = $[10], arrowY = $[11], restProps = $[12], padding = $[13], children = $[14], overflow = $[15], arrow = $[16], arrowRef = $[17], placement = $[18], radius = $[19], scheme = $[20], shadow = $[21], tone = $[22]);
3784
+ } = props, $[0] = props, $[1] = marginsProp, $[2] = xProp, $[3] = yProp, $[4] = animate, $[5] = originX, $[6] = originY, $[7] = strategy, $[8] = style, $[9] = arrowX, $[10] = arrowY, $[11] = restProps, $[12] = padding, $[13] = children, $[14] = overflow, $[15] = arrow, $[16] = arrowRef, $[17] = placement, $[18] = radius, $[19] = scheme, $[20] = shadow, $[21] = tone) : (marginsProp = $[1], xProp = $[2], yProp = $[3], animate = $[4], originX = $[5], originY = $[6], strategy = $[7], style = $[8], arrowX = $[9], arrowY = $[10], restProps = $[11], padding = $[12], children = $[13], overflow = $[14], arrow = $[15], arrowRef = $[16], placement = $[17], radius = $[18], scheme = $[19], shadow = $[20], tone = $[21]);
3786
3785
  const {
3787
3786
  zIndex
3788
3787
  } = useLayer();
@@ -3792,139 +3791,163 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
3792
3791
  let t1;
3793
3792
  const t2 = animate ? "transform" : void 0;
3794
3793
  let t3;
3795
- $[23] !== x || $[24] !== originX || $[25] !== originY || $[26] !== strategy || $[27] !== y || $[28] !== width || $[29] !== zIndex || $[30] !== t2 || $[31] !== style ? (t3 = {
3794
+ $[22] !== x || $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== y || $[27] !== zIndex || $[28] !== t2 || $[29] !== style ? (t3 = {
3796
3795
  left: x,
3797
3796
  originX,
3798
3797
  originY,
3799
3798
  position: strategy,
3800
3799
  top: y,
3801
- width,
3802
3800
  zIndex,
3803
3801
  willChange: t2,
3804
3802
  ...style
3805
- }, $[23] = x, $[24] = originX, $[25] = originY, $[26] = strategy, $[27] = y, $[28] = width, $[29] = zIndex, $[30] = t2, $[31] = style, $[32] = t3) : t3 = $[32], t1 = t3;
3803
+ }, $[22] = x, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = y, $[27] = zIndex, $[28] = t2, $[29] = style, $[30] = t3) : t3 = $[30], t1 = t3;
3806
3804
  const rootStyle2 = t1;
3807
3805
  let t4;
3808
3806
  const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
3809
3807
  let t7;
3810
- $[33] !== t5 || $[34] !== t6 ? (t7 = {
3808
+ $[31] !== t5 || $[32] !== t6 ? (t7 = {
3811
3809
  left: t5,
3812
3810
  top: t6,
3813
3811
  right: void 0,
3814
3812
  bottom: void 0
3815
- }, $[33] = t5, $[34] = t6, $[35] = t7) : t7 = $[35], t4 = t7;
3813
+ }, $[31] = t5, $[32] = t6, $[33] = t7) : t7 = $[33], t4 = t7;
3816
3814
  const arrowStyle = t4, t8 = restProps;
3817
3815
  let t9;
3818
- $[36] !== animate ? (t9 = animate ? POPOVER_MOTION_PROPS : {}, $[36] = animate, $[37] = t9) : t9 = $[37];
3816
+ $[34] !== animate ? (t9 = animate ? POPOVER_MOTION_PROPS : {}, $[34] = animate, $[35] = t9) : t9 = $[35];
3819
3817
  let t10;
3820
- $[38] !== padding || $[39] !== children ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[38] = padding, $[39] = children, $[40] = t10) : t10 = $[40];
3818
+ $[36] !== padding || $[37] !== children ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[36] = padding, $[37] = children, $[38] = t10) : t10 = $[38];
3821
3819
  let t11;
3822
- $[41] !== overflow || $[42] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, children: t10 }), $[41] = overflow, $[42] = t10, $[43] = t11) : t11 = $[43];
3820
+ $[39] !== overflow || $[40] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, children: t10 }), $[39] = overflow, $[40] = t10, $[41] = t11) : t11 = $[41];
3823
3821
  let t12;
3824
- $[44] !== arrow || $[45] !== arrowRef || $[46] !== arrowStyle ? (t12 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[44] = arrow, $[45] = arrowRef, $[46] = arrowStyle, $[47] = t12) : t12 = $[47];
3822
+ $[42] !== arrow || $[43] !== arrowRef || $[44] !== arrowStyle ? (t12 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[42] = arrow, $[43] = arrowRef, $[44] = arrowStyle, $[45] = t12) : t12 = $[45];
3825
3823
  let t13;
3826
- return $[48] !== t8 || $[49] !== placement || $[50] !== radius || $[51] !== ref || $[52] !== scheme || $[53] !== shadow || $[54] !== rootStyle2 || $[55] !== tone || $[56] !== t9 || $[57] !== t11 || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard$1, { "data-ui": "Popover", ...t8, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, ...t9, children: [
3824
+ return $[46] !== t8 || $[47] !== placement || $[48] !== radius || $[49] !== ref || $[50] !== scheme || $[51] !== shadow || $[52] !== rootStyle2 || $[53] !== tone || $[54] !== t9 || $[55] !== t11 || $[56] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard$1, { "data-ui": "Popover", ...t8, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, ...t9, children: [
3827
3825
  t11,
3828
3826
  t12
3829
- ] }), $[48] = t8, $[49] = placement, $[50] = radius, $[51] = ref, $[52] = scheme, $[53] = shadow, $[54] = rootStyle2, $[55] = tone, $[56] = t9, $[57] = t11, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
3827
+ ] }), $[46] = t8, $[47] = placement, $[48] = radius, $[49] = ref, $[50] = scheme, $[51] = shadow, $[52] = rootStyle2, $[53] = tone, $[54] = t9, $[55] = t11, $[56] = t12, $[57] = t13) : t13 = $[57], t13;
3830
3828
  }));
3831
3829
  PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
3832
3830
  const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3833
- const {
3831
+ const $ = reactCompilerRuntime.c(128), {
3834
3832
  container,
3835
3833
  layer
3836
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
3837
- __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
3838
- animate: _animate = !1,
3839
- arrow: arrowProp = !1,
3840
- boundaryElement: _boundaryElement,
3841
- children: childProp,
3842
- constrainSize = !1,
3843
- content,
3844
- disabled,
3845
- fallbackPlacements: _fallbackPlacements,
3846
- matchReferenceWidth,
3847
- floatingBoundary: _floatingBoundary,
3848
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3849
- onActivate,
3850
- open,
3851
- overflow = "hidden",
3852
- padding: paddingProp,
3853
- placement: placementProp = "bottom",
3854
- portal,
3855
- preventOverflow = !0,
3856
- radius: radiusProp = 3,
3857
- referenceBoundary: _referenceBoundary,
3858
- referenceElement,
3859
- scheme,
3860
- shadow: shadowProp = 3,
3861
- tone = "inherit",
3862
- width: widthProp = "auto",
3863
- zOffset: _zOffsetProp,
3864
- updateRef,
3865
- ...restProps
3866
- } = props, boundaryElement = _boundaryElement ?? boundaryElementContext.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), [arrowElement, setArrowElement] = react.useState(null), rootBoundary = "viewport";
3867
- react.useImperativeHandle(forwardedRef, () => ref.current);
3868
- const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
3869
- container,
3870
- mediaIndex,
3871
- width: widthArrayProp
3872
- }), widthRef = react.useRef(width);
3873
- react.useEffect(() => {
3874
- widthRef.current = width;
3875
- }, [width]);
3876
- const maxWidth = calcMaxWidth({
3877
- boundaryWidth,
3878
- currentWidth: width
3879
- }), maxWidthRef = react.useRef(maxWidth);
3880
- react.useEffect(() => {
3881
- maxWidthRef.current = maxWidth;
3882
- }, [maxWidth]);
3883
- const referenceWidthRef = react.useRef();
3884
- react.useLayoutEffect(() => {
3834
+ } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3835
+ let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, paddingProp, open, matchReferenceWidth, childProp, referenceElement, updateRef, disabled, restProps, scheme, content, portal;
3836
+ if ($[0] !== props) {
3837
+ const {
3838
+ __unstable_margins: t112,
3839
+ animate: t122,
3840
+ arrow: t132,
3841
+ boundaryElement: t142,
3842
+ children: t152,
3843
+ constrainSize: t162,
3844
+ content: t172,
3845
+ disabled: t182,
3846
+ fallbackPlacements: t192,
3847
+ matchReferenceWidth: t202,
3848
+ floatingBoundary: t212,
3849
+ onActivate,
3850
+ open: t222,
3851
+ overflow: t232,
3852
+ padding: t242,
3853
+ placement: t252,
3854
+ portal: t262,
3855
+ preventOverflow: t272,
3856
+ radius: t282,
3857
+ referenceBoundary: t292,
3858
+ referenceElement: t302,
3859
+ scheme: t312,
3860
+ shadow: t322,
3861
+ tone: t332,
3862
+ width: t342,
3863
+ zOffset: t352,
3864
+ updateRef: t362,
3865
+ ...t372
3866
+ } = props;
3867
+ t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142, childProp = t152, t3 = t162, content = t172, disabled = t182, _fallbackPlacements = t192, matchReferenceWidth = t202, _floatingBoundary = t212, open = t222, t4 = t232, paddingProp = t242, t5 = t252, portal = t262, t6 = t272, t7 = t282, _referenceBoundary = t292, referenceElement = t302, scheme = t312, t8 = t322, t9 = t332, t10 = t342, _zOffsetProp = t352, updateRef = t362, restProps = t372, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = t7, $[9] = t8, $[10] = t9, $[11] = t10, $[12] = _boundaryElement, $[13] = _fallbackPlacements, $[14] = _floatingBoundary, $[15] = _referenceBoundary, $[16] = _zOffsetProp, $[17] = paddingProp, $[18] = open, $[19] = matchReferenceWidth, $[20] = childProp, $[21] = referenceElement, $[22] = updateRef, $[23] = disabled, $[24] = restProps, $[25] = scheme, $[26] = content, $[27] = portal;
3868
+ } else
3869
+ t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _fallbackPlacements = $[13], _floatingBoundary = $[14], _referenceBoundary = $[15], _zOffsetProp = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], childProp = $[20], referenceElement = $[21], updateRef = $[22], disabled = $[23], restProps = $[24], scheme = $[25], content = $[26], portal = $[27];
3870
+ const margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, constrainSize = t3 === void 0 ? !1 : t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, preventOverflow = t6 === void 0 ? !0 : t6, radiusProp = t7 === void 0 ? 3 : t7, shadowProp = t8 === void 0 ? 3 : t8, tone = t9 === void 0 ? "inherit" : t9, widthProp = t10 === void 0 ? "auto" : t10, boundaryElement = _boundaryElement ?? boundaryElementContext.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), [arrowElement, setArrowElement] = react.useState(null);
3871
+ let t11;
3872
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => ref.current, $[28] = t11) : t11 = $[28], react.useImperativeHandle(forwardedRef, t11);
3873
+ const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0;
3874
+ let t12, t13;
3875
+ $[29] !== open || $[30] !== constrainSize || $[31] !== matchReferenceWidth || $[32] !== container || $[33] !== mediaIndex || $[34] !== widthArrayProp || $[35] !== boundaryWidth ? (t12 = () => {
3885
3876
  const floatingElement = ref.current;
3886
- if (!open || !floatingElement) return;
3887
- const referenceWidth = referenceWidthRef.current;
3888
- matchReferenceWidth ? referenceWidthRef.current !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3889
- }, [width, matchReferenceWidth, maxWidth, open]);
3890
- const middleware = react.useMemo(() => {
3891
- const ret = [];
3892
- return (constrainSize || preventOverflow) && ret.push(reactDom$1.flip({
3893
- boundary: floatingBoundary || void 0,
3894
- fallbackPlacements,
3895
- padding: DEFAULT_POPOVER_PADDING,
3896
- rootBoundary
3897
- })), ret.push(reactDom$1.offset({
3898
- mainAxis: DEFAULT_POPOVER_DISTANCE
3899
- })), (constrainSize || matchReferenceWidth) && ret.push(size({
3900
- apply({
3877
+ if (!open || !floatingElement || constrainSize || matchReferenceWidth)
3878
+ return;
3879
+ const currentWidth = calcCurrentWidth({
3880
+ container,
3881
+ mediaIndex,
3882
+ width: widthArrayProp
3883
+ }), maxWidth = calcMaxWidth({
3884
+ boundaryWidth,
3885
+ currentWidth
3886
+ });
3887
+ currentWidth !== void 0 && (floatingElement.style.width = `${currentWidth}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3888
+ }, t13 = [boundaryWidth, constrainSize, container, matchReferenceWidth, mediaIndex, open, widthArrayProp], $[29] = open, $[30] = constrainSize, $[31] = matchReferenceWidth, $[32] = container, $[33] = mediaIndex, $[34] = widthArrayProp, $[35] = boundaryWidth, $[36] = t12, $[37] = t13) : (t12 = $[36], t13 = $[37]), react.useLayoutEffect(t12, t13);
3889
+ let t14;
3890
+ $[38] !== constrainSize || $[39] !== preventOverflow || $[40] !== floatingBoundary || $[41] !== fallbackPlacements ? (t14 = (constrainSize || preventOverflow) && reactDom$1.flip({
3891
+ boundary: floatingBoundary || void 0,
3892
+ fallbackPlacements,
3893
+ padding: DEFAULT_POPOVER_PADDING,
3894
+ rootBoundary: "viewport"
3895
+ }), $[38] = constrainSize, $[39] = preventOverflow, $[40] = floatingBoundary, $[41] = fallbackPlacements, $[42] = t14) : t14 = $[42];
3896
+ let t15;
3897
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t15 = reactDom$1.offset({
3898
+ mainAxis: DEFAULT_POPOVER_DISTANCE
3899
+ }), $[43] = t15) : t15 = $[43];
3900
+ let t16;
3901
+ $[44] !== constrainSize || $[45] !== matchReferenceWidth || $[46] !== container || $[47] !== mediaIndex || $[48] !== widthArrayProp || $[49] !== boundaryWidth || $[50] !== floatingBoundary || $[51] !== margins ? (t16 = (constrainSize || matchReferenceWidth) && size({
3902
+ apply(t172) {
3903
+ const {
3901
3904
  availableWidth,
3902
3905
  availableHeight,
3903
3906
  elements,
3904
- referenceWidth: referenceWidth_0
3905
- }) {
3906
- referenceWidthRef.current = referenceWidth_0;
3907
- const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
3908
- matchReferenceWidth ? elements.floating.style.width = `${referenceWidth_0}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, _maxWidth ?? 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
3909
- },
3910
- boundaryElement: floatingBoundary || void 0,
3911
- constrainSize,
3912
- margins,
3913
- matchReferenceWidth,
3914
- padding: DEFAULT_POPOVER_PADDING
3915
- })), preventOverflow && ret.push(reactDom$1.shift({
3916
- boundary: floatingBoundary || void 0,
3917
- rootBoundary,
3918
- padding: DEFAULT_POPOVER_PADDING
3919
- })), arrowProp && ret.push(reactDom$1.arrow({
3920
- element: arrowElement,
3921
- padding: DEFAULT_POPOVER_PADDING
3922
- })), animate && ret.push(origin), ret.push(reactDom$1.hide({
3923
- boundary: referenceBoundary || void 0,
3924
- padding: DEFAULT_POPOVER_PADDING,
3925
- strategy: "referenceHidden"
3926
- })), ret;
3927
- }, [animate, arrowElement, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
3907
+ referenceWidth
3908
+ } = t172, currentWidth_0 = calcCurrentWidth({
3909
+ container,
3910
+ mediaIndex,
3911
+ width: widthArrayProp
3912
+ }), maxWidth_0 = calcMaxWidth({
3913
+ boundaryWidth,
3914
+ currentWidth: currentWidth_0
3915
+ });
3916
+ matchReferenceWidth ? elements.floating.style.width = `${referenceWidth}px` : currentWidth_0 !== void 0 && (elements.floating.style.width = `${currentWidth_0}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, maxWidth_0 ?? 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
3917
+ },
3918
+ boundaryElement: floatingBoundary || void 0,
3919
+ constrainSize,
3920
+ margins,
3921
+ matchReferenceWidth,
3922
+ padding: DEFAULT_POPOVER_PADDING
3923
+ }), $[44] = constrainSize, $[45] = matchReferenceWidth, $[46] = container, $[47] = mediaIndex, $[48] = widthArrayProp, $[49] = boundaryWidth, $[50] = floatingBoundary, $[51] = margins, $[52] = t16) : t16 = $[52];
3924
+ let t17;
3925
+ $[53] !== preventOverflow || $[54] !== floatingBoundary ? (t17 = preventOverflow && reactDom$1.shift({
3926
+ boundary: floatingBoundary || void 0,
3927
+ rootBoundary: "viewport",
3928
+ padding: DEFAULT_POPOVER_PADDING
3929
+ }), $[53] = preventOverflow, $[54] = floatingBoundary, $[55] = t17) : t17 = $[55];
3930
+ let t18;
3931
+ $[56] !== arrowProp || $[57] !== arrowElement ? (t18 = arrowProp && reactDom$1.arrow({
3932
+ element: arrowElement,
3933
+ padding: DEFAULT_POPOVER_PADDING
3934
+ }), $[56] = arrowProp, $[57] = arrowElement, $[58] = t18) : t18 = $[58];
3935
+ const t19 = animate && origin, t20 = referenceBoundary || void 0;
3936
+ let t21;
3937
+ $[59] !== t20 ? (t21 = reactDom$1.hide({
3938
+ boundary: t20,
3939
+ padding: DEFAULT_POPOVER_PADDING,
3940
+ strategy: "referenceHidden"
3941
+ }), $[59] = t20, $[60] = t21) : t21 = $[60];
3942
+ let t22;
3943
+ $[61] !== t14 || $[62] !== t16 || $[63] !== t17 || $[64] !== t18 || $[65] !== t19 || $[66] !== t21 ? (t22 = [t14, t15, t16, t17, t18, t19, t21], $[61] = t14, $[62] = t16, $[63] = t17, $[64] = t18, $[65] = t19, $[66] = t21, $[67] = t22) : t22 = $[67];
3944
+ let t23;
3945
+ $[68] !== t22 || $[69] !== placementProp ? (t23 = {
3946
+ middleware: t22,
3947
+ placement: placementProp,
3948
+ whileElementsMounted: reactDom$1.autoUpdate
3949
+ }, $[68] = t22, $[69] = placementProp, $[70] = t23) : t23 = $[70];
3950
+ const {
3928
3951
  x,
3929
3952
  y,
3930
3953
  middlewareData,
@@ -3932,31 +3955,60 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3932
3955
  refs,
3933
3956
  strategy,
3934
3957
  update
3935
- } = reactDom$1.useFloating({
3936
- middleware,
3937
- placement: placementProp,
3938
- whileElementsMounted: reactDom$1.autoUpdate
3939
- }), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setFloating = react.useCallback((node) => {
3958
+ } = reactDom$1.useFloating(t23), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
3959
+ let t24;
3960
+ $[71] !== refs ? (t24 = (node) => {
3940
3961
  ref.current = node, refs.setFloating(node);
3941
- }, [refs]), [childElement, setChildElement] = react.useState(null), setReference = react.useCallback((node_0) => {
3962
+ }, $[71] = refs, $[72] = t24) : t24 = $[72];
3963
+ const setFloating = t24, [childElement, setChildElement] = react.useState(null);
3964
+ let t25;
3965
+ $[73] !== refs ? (t25 = (node_0) => {
3942
3966
  refs.setReference(node_0), setChildElement(node_0);
3943
- }, [refs]);
3944
- react.useImperativeHandle(getElementRef(childProp), () => childElement, [childElement]);
3945
- const child = react.useMemo(() => !childProp || referenceElement ? null : react.cloneElement(childProp, {
3946
- ref: setReference
3947
- }), [childProp, referenceElement, setReference]);
3948
- if (react.useImperativeHandle(updateRef, () => update, [update]), react.useEffect(() => {
3967
+ }, $[73] = refs, $[74] = t25) : t25 = $[74];
3968
+ const setReference = t25, t26 = childProp;
3969
+ let t27;
3970
+ $[75] !== t26 ? (t27 = getElementRef$1(t26), $[75] = t26, $[76] = t27) : t27 = $[76];
3971
+ let t28, t29;
3972
+ $[77] !== childElement ? (t28 = () => childElement, t29 = [childElement], $[77] = childElement, $[78] = t28, $[79] = t29) : (t28 = $[78], t29 = $[79]), react.useImperativeHandle(t27, t28, t29);
3973
+ let t30;
3974
+ bb0: {
3975
+ if (!childProp || referenceElement) {
3976
+ t30 = null;
3977
+ break bb0;
3978
+ }
3979
+ let t312;
3980
+ $[80] !== setReference || $[81] !== childProp ? (t312 = react.cloneElement(childProp, {
3981
+ ref: setReference
3982
+ }), $[80] = setReference, $[81] = childProp, $[82] = t312) : t312 = $[82], t30 = t312;
3983
+ }
3984
+ const child = t30;
3985
+ let t31, t32;
3986
+ $[83] !== update ? (t31 = () => update, t32 = [update], $[83] = update, $[84] = t31, $[85] = t32) : (t31 = $[84], t32 = $[85]), react.useImperativeHandle(updateRef, t31, t32);
3987
+ let t33, t34;
3988
+ if ($[86] !== child || $[87] !== refs || $[88] !== referenceElement ? (t33 = () => {
3949
3989
  child || refs.setReference(referenceElement || null);
3950
- }, [referenceElement, refs, child]), disabled)
3951
- return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
3952
- const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrowElement, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidthRef.current : width, x, y, children: content }) }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3953
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3954
- animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
3990
+ }, t34 = [referenceElement, refs, child], $[86] = child, $[87] = refs, $[88] = referenceElement, $[89] = t33, $[90] = t34) : (t33 = $[89], t34 = $[90]), react.useEffect(t33, t34), disabled) {
3991
+ let t352;
3992
+ return $[91] !== childProp ? (t352 = childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[91] = childProp, $[92] = t352) : t352 = $[92], t352;
3993
+ }
3994
+ let t35;
3995
+ $[93] !== restProps || $[94] !== margins || $[95] !== animate || $[96] !== arrowProp || $[97] !== arrowX || $[98] !== arrowY || $[99] !== referenceHidden || $[100] !== overflow || $[101] !== padding || $[102] !== placement || $[103] !== radius || $[104] !== setFloating || $[105] !== scheme || $[106] !== shadow || $[107] !== originX || $[108] !== originY || $[109] !== strategy || $[110] !== tone || $[111] !== x || $[112] !== y || $[113] !== content ? (t35 = /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrowElement, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, x, y, children: content }), $[93] = restProps, $[94] = margins, $[95] = animate, $[96] = arrowProp, $[97] = arrowX, $[98] = arrowY, $[99] = referenceHidden, $[100] = overflow, $[101] = padding, $[102] = placement, $[103] = radius, $[104] = setFloating, $[105] = scheme, $[106] = shadow, $[107] = originX, $[108] = originY, $[109] = strategy, $[110] = tone, $[111] = x, $[112] = y, $[113] = content, $[114] = t35) : t35 = $[114];
3996
+ let t36;
3997
+ $[115] !== zOffset || $[116] !== t35 ? (t36 = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: t35 }), $[115] = zOffset, $[116] = t35, $[117] = t36) : t36 = $[117];
3998
+ const popover = t36;
3999
+ let t37;
4000
+ $[118] !== open || $[119] !== portal || $[120] !== popover ? (t37 = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[118] = open, $[119] = portal, $[120] = popover, $[121] = t37) : t37 = $[121];
4001
+ const children = t37;
4002
+ let t38;
4003
+ $[122] !== animate || $[123] !== children ? (t38 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[122] = animate, $[123] = children, $[124] = t38) : t38 = $[124];
4004
+ let t39;
4005
+ return $[125] !== t38 || $[126] !== child ? (t39 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4006
+ t38,
3955
4007
  child
3956
- ] });
4008
+ ] }), $[125] = t38, $[126] = child, $[127] = t39) : t39 = $[127], t39;
3957
4009
  }));
3958
4010
  Popover.displayName = "Memo(ForwardRef(Popover))";
3959
- function getElementRef(element) {
4011
+ function getElementRef$1(element) {
3960
4012
  if (!element) return null;
3961
4013
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
3962
4014
  return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
@@ -4790,55 +4842,80 @@ TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4790
4842
  const Root$a = styledComponents.styled(Layer)`
4791
4843
  pointer-events: none;
4792
4844
  `, Tooltip = react.forwardRef(function(props, forwardedRef) {
4793
- const boundaryElementContext = useBoundaryElement(), {
4845
+ const $ = reactCompilerRuntime.c(142), boundaryElementContext = useBoundaryElement(), {
4794
4846
  layer
4795
- } = useTheme_v2(), {
4796
- animate: _animate = !1,
4797
- arrow: arrowProp = !1,
4847
+ } = useTheme_v2();
4848
+ let t0, t1, t2, t3, t4, t5, _boundaryElement, _fallbackPlacementsProp, _zOffset, portalProp, delay, childProp, disabled, content, restProps, scheme;
4849
+ $[0] !== props ? ({
4850
+ animate: t0,
4851
+ arrow: t1,
4798
4852
  boundaryElement: _boundaryElement,
4799
4853
  children: childProp,
4800
4854
  content,
4801
4855
  disabled,
4802
4856
  fallbackPlacements: _fallbackPlacementsProp,
4803
- padding = 2,
4804
- placement: placementProp = "bottom",
4857
+ padding: t2,
4858
+ placement: t3,
4805
4859
  portal: portalProp,
4806
- radius = 2,
4860
+ radius: t4,
4807
4861
  scheme,
4808
- shadow = 2,
4862
+ shadow: t5,
4809
4863
  zOffset: _zOffset,
4810
4864
  delay,
4811
4865
  ...restProps
4812
- } = props, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, 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);
4813
- react.useImperativeHandle(forwardedRef, () => ref.current);
4814
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = react.useMemo(() => {
4815
- const ret = [];
4816
- return ret.push(reactDom$1.flip({
4817
- boundary: boundaryElement || void 0,
4866
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = _boundaryElement, $[8] = _fallbackPlacementsProp, $[9] = _zOffset, $[10] = portalProp, $[11] = delay, $[12] = childProp, $[13] = disabled, $[14] = content, $[15] = restProps, $[16] = scheme) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], _boundaryElement = $[7], _fallbackPlacementsProp = $[8], _zOffset = $[9], portalProp = $[10], delay = $[11], childProp = $[12], disabled = $[13], content = $[14], restProps = $[15], scheme = $[16]);
4867
+ const _animate = t0 === void 0 ? !1 : t0, arrowProp = t1 === void 0 ? !1 : t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), [arrowElement, setArrowElement] = react.useState(null), [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
4868
+ let t6;
4869
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[17] = t6) : t6 = $[17], react.useImperativeHandle(forwardedRef, t6);
4870
+ const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
4871
+ let t7, ret;
4872
+ if ($[18] !== boundaryElement || $[19] !== fallbackPlacements || $[20] !== arrowProp || $[21] !== arrowElement || $[22] !== animate) {
4873
+ ret = [];
4874
+ const t82 = boundaryElement || void 0;
4875
+ let t92;
4876
+ $[24] !== t82 || $[25] !== fallbackPlacements ? (t92 = reactDom$1.flip({
4877
+ boundary: t82,
4818
4878
  fallbackPlacements,
4819
4879
  padding: DEFAULT_TOOLTIP_PADDING,
4820
- rootBoundary
4821
- })), ret.push(reactDom$1.offset({
4880
+ rootBoundary: "viewport"
4881
+ }), $[24] = t82, $[25] = fallbackPlacements, $[26] = t92) : t92 = $[26], ret.push(t92);
4882
+ let t102;
4883
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t102 = reactDom$1.offset({
4822
4884
  mainAxis: DEFAULT_TOOLTIP_DISTANCE
4823
- })), ret.push(reactDom$1.shift({
4824
- boundary: boundaryElement || void 0,
4825
- rootBoundary,
4826
- padding: DEFAULT_TOOLTIP_PADDING
4827
- })), arrowProp && ret.push(reactDom$1.arrow({
4828
- element: arrowRef,
4885
+ }), $[27] = t102) : t102 = $[27], ret.push(t102);
4886
+ const t112 = boundaryElement || void 0;
4887
+ let t122;
4888
+ if ($[28] !== t112 ? (t122 = reactDom$1.shift({
4889
+ boundary: t112,
4890
+ rootBoundary: "viewport",
4829
4891
  padding: DEFAULT_TOOLTIP_PADDING
4830
- })), animate && ret.push(origin), ret;
4831
- }, [animate, arrowProp, boundaryElement, fallbackPlacements]), {
4892
+ }), $[28] = t112, $[29] = t122) : t122 = $[29], ret.push(t122), arrowProp) {
4893
+ let t132;
4894
+ $[30] !== arrowElement ? (t132 = reactDom$1.arrow({
4895
+ element: arrowElement,
4896
+ padding: DEFAULT_TOOLTIP_PADDING
4897
+ }), $[30] = arrowElement, $[31] = t132) : t132 = $[31], ret.push(t132);
4898
+ }
4899
+ animate && ret.push(origin), $[18] = boundaryElement, $[19] = fallbackPlacements, $[20] = arrowProp, $[21] = arrowElement, $[22] = animate, $[23] = ret;
4900
+ } else
4901
+ ret = $[23];
4902
+ t7 = ret;
4903
+ const middleware = t7;
4904
+ let t8;
4905
+ $[32] !== middleware || $[33] !== placementProp ? (t8 = {
4906
+ middleware,
4907
+ placement: placementProp,
4908
+ whileElementsMounted: reactDom$1.autoUpdate
4909
+ }, $[32] = middleware, $[33] = placementProp, $[34] = t8) : t8 = $[34];
4910
+ const {
4832
4911
  floatingStyles,
4833
4912
  placement,
4834
4913
  middlewareData,
4835
4914
  refs,
4836
4915
  update
4837
- } = reactDom$1.useFloating({
4838
- middleware,
4839
- placement: placementProp,
4840
- whileElementsMounted: reactDom$1.autoUpdate
4841
- }), 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(), showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback((open, immediate) => {
4916
+ } = reactDom$1.useFloating(t8), 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(), showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp;
4917
+ let t9;
4918
+ $[35] !== isInsideGroup || $[36] !== openDelay || $[37] !== delayGroupContext || $[38] !== tooltipId || $[39] !== closeDelay || $[40] !== setIsOpen ? (t9 = (open, immediate) => {
4842
4919
  if (isInsideGroup)
4843
4920
  if (open) {
4844
4921
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4849,67 +4926,133 @@ const Root$a = styledComponents.styled(Layer)`
4849
4926
  }
4850
4927
  else
4851
4928
  setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
4852
- }, [isInsideGroup, delayGroupContext, openDelay, tooltipId, closeDelay, setIsOpen]), handleBlur = react.useCallback((e) => {
4929
+ }, $[35] = isInsideGroup, $[36] = openDelay, $[37] = delayGroupContext, $[38] = tooltipId, $[39] = closeDelay, $[40] = setIsOpen, $[41] = t9) : t9 = $[41];
4930
+ const handleIsOpenChange = t9;
4931
+ let t10;
4932
+ $[42] !== handleIsOpenChange || $[43] !== childProp ? (t10 = (e) => {
4853
4933
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
4854
- }, [childProp?.props, handleIsOpenChange]), handleClick = react.useCallback((e_0) => {
4934
+ }, $[42] = handleIsOpenChange, $[43] = childProp, $[44] = t10) : t10 = $[44];
4935
+ const handleBlur = t10;
4936
+ let t11;
4937
+ $[45] !== handleIsOpenChange || $[46] !== childProp ? (t11 = (e_0) => {
4855
4938
  handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
4856
- }, [childProp?.props, handleIsOpenChange]), handleContextMenu = react.useCallback((e_1) => {
4939
+ }, $[45] = handleIsOpenChange, $[46] = childProp, $[47] = t11) : t11 = $[47];
4940
+ const handleClick = t11;
4941
+ let t12;
4942
+ $[48] !== handleIsOpenChange || $[49] !== childProp ? (t12 = (e_1) => {
4857
4943
  handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
4858
- }, [childProp?.props, handleIsOpenChange]), handleFocus = react.useCallback((e_2) => {
4944
+ }, $[48] = handleIsOpenChange, $[49] = childProp, $[50] = t12) : t12 = $[50];
4945
+ const handleContextMenu = t12;
4946
+ let t13;
4947
+ $[51] !== handleIsOpenChange || $[52] !== childProp ? (t13 = (e_2) => {
4859
4948
  handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
4860
- }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = react.useCallback((e_3) => {
4949
+ }, $[51] = handleIsOpenChange, $[52] = childProp, $[53] = t13) : t13 = $[53];
4950
+ const handleFocus = t13;
4951
+ let t14;
4952
+ $[54] !== handleIsOpenChange || $[55] !== childProp ? (t14 = (e_3) => {
4861
4953
  handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
4862
- }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = react.useCallback((e_4) => {
4954
+ }, $[54] = handleIsOpenChange, $[55] = childProp, $[56] = t14) : t14 = $[56];
4955
+ const handleMouseEnter = t14;
4956
+ let t15;
4957
+ $[57] !== handleIsOpenChange || $[58] !== childProp ? (t15 = (e_4) => {
4863
4958
  handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
4864
- }, [childProp?.props, handleIsOpenChange]);
4865
- useCloseOnMouseLeave({
4959
+ }, $[57] = handleIsOpenChange, $[58] = childProp, $[59] = t15) : t15 = $[59];
4960
+ const handleMouseLeave = t15;
4961
+ let t16;
4962
+ $[60] !== handleIsOpenChange || $[61] !== referenceElement || $[62] !== showTooltip ? (t16 = {
4866
4963
  handleIsOpenChange,
4867
4964
  referenceElement,
4868
4965
  showTooltip
4869
- }), react.useEffect(() => {
4966
+ }, $[60] = handleIsOpenChange, $[61] = referenceElement, $[62] = showTooltip, $[63] = t16) : t16 = $[63], useCloseOnMouseLeave(t16);
4967
+ let t17, t18;
4968
+ $[64] !== disabled || $[65] !== showTooltip || $[66] !== handleIsOpenChange ? (t17 = () => {
4870
4969
  disabled && showTooltip && handleIsOpenChange(!1);
4871
- }, [disabled, handleIsOpenChange, showTooltip]), react.useEffect(() => {
4970
+ }, t18 = [disabled, handleIsOpenChange, showTooltip], $[64] = disabled, $[65] = showTooltip, $[66] = handleIsOpenChange, $[67] = t17, $[68] = t18) : (t17 = $[67], t18 = $[68]), react.useEffect(t17, t18);
4971
+ let t19, t20;
4972
+ $[69] !== content || $[70] !== showTooltip || $[71] !== handleIsOpenChange ? (t19 = () => {
4872
4973
  !content && showTooltip && handleIsOpenChange(!1);
4873
- }, [content, handleIsOpenChange, showTooltip]), react.useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]), react.useEffect(() => {
4874
- if (!showTooltip) return;
4875
- function handleWindowKeyDown(event) {
4974
+ }, t20 = [content, handleIsOpenChange, showTooltip], $[69] = content, $[70] = showTooltip, $[71] = handleIsOpenChange, $[72] = t19, $[73] = t20) : (t19 = $[72], t20 = $[73]), react.useEffect(t19, t20);
4975
+ let t21, t22;
4976
+ $[74] !== refs || $[75] !== referenceElement ? (t21 = () => refs.setReference(referenceElement), t22 = [referenceElement, refs], $[74] = refs, $[75] = referenceElement, $[76] = t21, $[77] = t22) : (t21 = $[76], t22 = $[77]), react.useEffect(t21, t22);
4977
+ let t23, t24;
4978
+ $[78] !== showTooltip || $[79] !== handleIsOpenChange ? (t23 = () => {
4979
+ if (!showTooltip)
4980
+ return;
4981
+ const handleWindowKeyDown = function(event) {
4876
4982
  event.key === "Escape" && handleIsOpenChange(!1, !0);
4877
- }
4983
+ };
4878
4984
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
4879
4985
  window.removeEventListener("keydown", handleWindowKeyDown);
4880
4986
  };
4881
- }, [handleIsOpenChange, showTooltip]), react.useLayoutEffect(() => {
4987
+ }, t24 = [handleIsOpenChange, showTooltip], $[78] = showTooltip, $[79] = handleIsOpenChange, $[80] = t23, $[81] = t24) : (t23 = $[80], t24 = $[81]), react.useEffect(t23, t24);
4988
+ let t25, t26;
4989
+ $[82] !== boundaryElement || $[83] !== portalElement ? (t25 = () => {
4882
4990
  const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
4883
4991
  setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
4884
- }, [boundaryElement, portalElement]);
4885
- const setArrow = react.useCallback((arrowEl) => {
4886
- arrowRef.current = arrowEl, update();
4887
- }, [update]), setFloating = react.useCallback((node) => {
4992
+ }, t26 = [boundaryElement, portalElement], $[82] = boundaryElement, $[83] = portalElement, $[84] = t25, $[85] = t26) : (t25 = $[84], t26 = $[85]), react.useLayoutEffect(t25, t26);
4993
+ let t27;
4994
+ $[86] !== update ? (t27 = (arrowEl) => {
4995
+ setArrowElement(arrowEl), update();
4996
+ }, $[86] = update, $[87] = t27) : t27 = $[87];
4997
+ const setArrow = t27;
4998
+ let t28;
4999
+ $[88] !== refs ? (t28 = (node) => {
4888
5000
  ref.current = node, refs.setFloating(node);
4889
- }, [refs]), childRef = react.useRef(null);
4890
- react.useImperativeHandle(childProp?.ref, () => childRef.current);
4891
- const child = react.useMemo(() => childProp ? react.cloneElement(childProp, {
4892
- onBlur: handleBlur,
4893
- onFocus: handleFocus,
4894
- onMouseEnter: handleMouseEnter,
4895
- onMouseLeave: handleMouseLeave,
4896
- onClick: handleClick,
4897
- onContextMenu: handleContextMenu,
4898
- ref: childRef
4899
- }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
4900
- if (react.useEffect(() => {
5001
+ }, $[88] = refs, $[89] = t28) : t28 = $[89];
5002
+ const setFloating = t28, childRef = react.useRef(null), [childElement, setChildElement] = react.useState(null), t29 = childProp;
5003
+ let t30;
5004
+ $[90] !== t29 ? (t30 = getElementRef(t29), $[90] = t29, $[91] = t30) : t30 = $[91];
5005
+ let t31, t32;
5006
+ $[92] !== childElement ? (t31 = () => childElement, t32 = [childElement], $[92] = childElement, $[93] = t31, $[94] = t32) : (t31 = $[93], t32 = $[94]), react.useImperativeHandle(t30, t31, t32);
5007
+ let t33;
5008
+ bb0: {
5009
+ if (!childProp) {
5010
+ t33 = null;
5011
+ break bb0;
5012
+ }
5013
+ let t342;
5014
+ $[95] !== handleBlur || $[96] !== handleFocus || $[97] !== handleMouseEnter || $[98] !== handleMouseLeave || $[99] !== handleClick || $[100] !== handleContextMenu || $[101] !== childProp ? (t342 = react.cloneElement(childProp, {
5015
+ onBlur: handleBlur,
5016
+ onFocus: handleFocus,
5017
+ onMouseEnter: handleMouseEnter,
5018
+ onMouseLeave: handleMouseLeave,
5019
+ onClick: handleClick,
5020
+ onContextMenu: handleContextMenu,
5021
+ ref: setChildElement
5022
+ }), $[95] = handleBlur, $[96] = handleFocus, $[97] = handleMouseEnter, $[98] = handleMouseLeave, $[99] = handleClick, $[100] = handleContextMenu, $[101] = childProp, $[102] = t342) : t342 = $[102], t33 = t342;
5023
+ }
5024
+ const child = t33;
5025
+ let t34, t35;
5026
+ if ($[103] !== child ? (t34 = () => {
4901
5027
  if (child)
4902
5028
  return setReferenceElement(childRef.current), () => setReferenceElement(null);
4903
- }, [child]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4904
- if (disabled) return child;
4905
- const tooltip = /* @__PURE__ */ jsxRuntime.jsx(Root$a, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: {
5029
+ }, t35 = [child], $[103] = child, $[104] = t34, $[105] = t35) : (t34 = $[104], t35 = $[105]), react.useEffect(t34, t35), !child) {
5030
+ let t362;
5031
+ return $[106] === Symbol.for("react.memo_cache_sentinel") ? (t362 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[106] = t362) : t362 = $[106], t362;
5032
+ }
5033
+ if (disabled)
5034
+ return child;
5035
+ const t36 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
5036
+ let t37;
5037
+ $[107] !== floatingStyles || $[108] !== t36 ? (t37 = {
4906
5038
  ...floatingStyles,
4907
- maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
4908
- }, zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }) }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip);
4909
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4910
- animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
5039
+ maxWidth: t36
5040
+ }, $[107] = floatingStyles, $[108] = t36, $[109] = t37) : t37 = $[109];
5041
+ let t38;
5042
+ $[110] !== restProps || $[111] !== animate || $[112] !== arrowProp || $[113] !== setArrow || $[114] !== arrowX || $[115] !== arrowY || $[116] !== originX || $[117] !== originY || $[118] !== padding || $[119] !== placement || $[120] !== radius || $[121] !== setFloating || $[122] !== scheme || $[123] !== shadow || $[124] !== content ? (t38 = /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }), $[110] = restProps, $[111] = animate, $[112] = arrowProp, $[113] = setArrow, $[114] = arrowX, $[115] = arrowY, $[116] = originX, $[117] = originY, $[118] = padding, $[119] = placement, $[120] = radius, $[121] = setFloating, $[122] = scheme, $[123] = shadow, $[124] = content, $[125] = t38) : t38 = $[125];
5043
+ let t39;
5044
+ $[126] !== restProps || $[127] !== setFloating || $[128] !== t37 || $[129] !== zOffset || $[130] !== t38 ? (t39 = /* @__PURE__ */ jsxRuntime.jsx(Root$a, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t37, zOffset, children: t38 }), $[126] = restProps, $[127] = setFloating, $[128] = t37, $[129] = zOffset, $[130] = t38, $[131] = t39) : t39 = $[131];
5045
+ const tooltip = t39;
5046
+ let t40;
5047
+ $[132] !== showTooltip || $[133] !== portalProp || $[134] !== tooltip ? (t40 = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[132] = showTooltip, $[133] = portalProp, $[134] = tooltip, $[135] = t40) : t40 = $[135];
5048
+ const children = t40;
5049
+ let t41;
5050
+ $[136] !== animate || $[137] !== children ? (t41 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[136] = animate, $[137] = children, $[138] = t41) : t41 = $[138];
5051
+ let t42;
5052
+ return $[139] !== t41 || $[140] !== child ? (t42 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5053
+ t41,
4911
5054
  child
4912
- ] });
5055
+ ] }), $[139] = t41, $[140] = child, $[141] = t42) : t42 = $[141], t42;
4913
5056
  });
4914
5057
  Tooltip.displayName = "ForwardRef(Tooltip)";
4915
5058
  function useCloseOnMouseLeave(t0) {
@@ -4933,6 +5076,11 @@ function useCloseOnMouseLeave(t0) {
4933
5076
  return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
4934
5077
  }, t3 = [onMouseMove, showTooltip], $[3] = showTooltip, $[4] = onMouseMove, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
4935
5078
  }
5079
+ function getElementRef(element) {
5080
+ if (!element) return null;
5081
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
5082
+ return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
5083
+ }
4936
5084
  const Root$9 = styledComponents.styled.div`
4937
5085
  line-height: 0;
4938
5086
  `, ListBox = styledComponents.styled(Box)`