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

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,28 +3955,57 @@ 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(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
4011
  function getElementRef(element) {