@sanity/ui 2.3.6-canary.4 → 2.3.6-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.
@@ -3974,11 +3974,11 @@ const MotionCard$1 = styled(motion(Card))`
3974
3974
  PopoverCard.displayName = "PopoverCard";
3975
3975
  const Popover = memo(forwardRef(function(props, forwardedRef) {
3976
3976
  var _a, _b, _c2, _d, _e, _f, _g, _h, _i;
3977
- const $ = c(99), {
3977
+ const $ = c(100), {
3978
3978
  container,
3979
3979
  layer
3980
3980
  } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3981
- let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _referenceBoundary, _floatingBoundary, _fallbackPlacements, _zOffset, paddingProp, open, matchReferenceWidth, updateRef, children, referenceElement, disabled, restProps, scheme, content, portal;
3981
+ let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _referenceBoundary, _floatingBoundary, _fallbackPlacements, _zOffset, paddingProp, open, matchReferenceWidth, updateRef, _children, referenceElement, disabled, restProps, scheme, content, portal;
3982
3982
  if ($[0] !== props) {
3983
3983
  const {
3984
3984
  __unstable_margins: t112,
@@ -4010,9 +4010,9 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
4010
4010
  updateRef: t362,
4011
4011
  ...t37
4012
4012
  } = props;
4013
- t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142, children = 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, _zOffset = t352, updateRef = t362, restProps = t37, $[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] = _referenceBoundary, $[14] = _floatingBoundary, $[15] = _fallbackPlacements, $[16] = _zOffset, $[17] = paddingProp, $[18] = open, $[19] = matchReferenceWidth, $[20] = updateRef, $[21] = children, $[22] = referenceElement, $[23] = disabled, $[24] = restProps, $[25] = scheme, $[26] = content, $[27] = portal;
4013
+ t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142, _children = 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, _zOffset = t352, updateRef = t362, restProps = t37, $[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] = _referenceBoundary, $[14] = _floatingBoundary, $[15] = _fallbackPlacements, $[16] = _zOffset, $[17] = paddingProp, $[18] = open, $[19] = matchReferenceWidth, $[20] = updateRef, $[21] = _children, $[22] = referenceElement, $[23] = disabled, $[24] = restProps, $[25] = scheme, $[26] = content, $[27] = portal;
4014
4014
  } else
4015
- t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _referenceBoundary = $[13], _floatingBoundary = $[14], _fallbackPlacements = $[15], _zOffset = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], updateRef = $[20], children = $[21], referenceElement = $[22], disabled = $[23], restProps = $[24], scheme = $[25], content = $[26], portal = $[27];
4015
+ t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _referenceBoundary = $[13], _floatingBoundary = $[14], _fallbackPlacements = $[15], _zOffset = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], updateRef = $[20], _children = $[21], referenceElement = $[22], disabled = $[23], restProps = $[24], scheme = $[25], content = $[26], portal = $[27];
4016
4016
  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 != null ? _boundaryElement : boundaryElementContext.element, referenceBoundary = (_a = _referenceBoundary != null ? _referenceBoundary : props.boundaryElement) != null ? _a : boundaryElementContext.element, floatingBoundary = (_b = _floatingBoundary != null ? _floatingBoundary : props.boundaryElement) != null ? _b : boundaryElementContext.element, fallbackPlacements = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS$1[(_c2 = props.placement) != null ? _c2 : "bottom"], zOffsetProp = _zOffset != null ? _zOffset : layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border;
4017
4017
  let t11, t12;
4018
4018
  $[28] !== paddingProp ? (t12 = _getArrayProp(paddingProp), $[28] = paddingProp, $[29] = t12) : t12 = $[29], t11 = t12;
@@ -4129,34 +4129,45 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
4129
4129
  let t26, t27;
4130
4130
  $[48] !== update ? (t26 = () => update, t27 = [update], $[48] = update, $[49] = t26, $[50] = t27) : (t26 = $[49], t27 = $[50]), useImperativeHandle(updateRef, t26, t27);
4131
4131
  let t28, t29;
4132
- if ($[51] !== children || $[52] !== refs || $[53] !== referenceElement ? (t28 = () => {
4133
- children || refs.setReference(referenceElement || null);
4134
- }, t29 = [children, referenceElement, refs], $[51] = children, $[52] = refs, $[53] = referenceElement, $[54] = t28, $[55] = t29) : (t28 = $[54], t29 = $[55]), useEffect(t28, t29), disabled) {
4135
- let t302;
4136
- return $[56] !== children ? (t302 = children || /* @__PURE__ */ jsx(Fragment, {}), $[56] = children, $[57] = t302) : t302 = $[57], t302;
4137
- }
4132
+ $[51] !== _children || $[52] !== refs || $[53] !== referenceElement ? (t28 = () => {
4133
+ _children || refs.setReference(referenceElement || null);
4134
+ }, t29 = [_children, referenceElement, refs], $[51] = _children, $[52] = refs, $[53] = referenceElement, $[54] = t28, $[55] = t29) : (t28 = $[54], t29 = $[55]), useEffect(t28, t29);
4138
4135
  let t30;
4139
- $[58] !== restProps || $[59] !== margins || $[60] !== animate || $[61] !== arrowProp || $[62] !== setArrow || $[63] !== arrowX || $[64] !== arrowY || $[65] !== referenceHidden || $[66] !== overflow || $[67] !== padding || $[68] !== placement || $[69] !== radius || $[70] !== setFloating || $[71] !== scheme || $[72] !== shadow || $[73] !== originX || $[74] !== originY || $[75] !== strategy || $[76] !== tone || $[77] !== x || $[78] !== y || $[79] !== content ? (t30 = /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, 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 }), $[58] = restProps, $[59] = margins, $[60] = animate, $[61] = arrowProp, $[62] = setArrow, $[63] = arrowX, $[64] = arrowY, $[65] = referenceHidden, $[66] = overflow, $[67] = padding, $[68] = placement, $[69] = radius, $[70] = setFloating, $[71] = scheme, $[72] = shadow, $[73] = originX, $[74] = originY, $[75] = strategy, $[76] = tone, $[77] = x, $[78] = y, $[79] = content, $[80] = t30) : t30 = $[80];
4136
+ bb0: {
4137
+ if (!_children || referenceElement) {
4138
+ t30 = null;
4139
+ break bb0;
4140
+ }
4141
+ let t312;
4142
+ $[56] !== refs ? (t312 = (node_0) => {
4143
+ logDeprecatedWarning(), refs.setReference(node_0);
4144
+ }, $[56] = refs, $[57] = t312) : t312 = $[57];
4145
+ let t322;
4146
+ $[58] !== t312 || $[59] !== _children ? (t322 = cloneElement(_children, {
4147
+ ref: t312
4148
+ }), $[58] = t312, $[59] = _children, $[60] = t322) : t322 = $[60], t30 = t322;
4149
+ }
4150
+ const children = t30;
4151
+ if (disabled) {
4152
+ let t312;
4153
+ return $[61] !== _children ? (t312 = _children || /* @__PURE__ */ jsx(Fragment, {}), $[61] = _children, $[62] = t312) : t312 = $[62], t312;
4154
+ }
4140
4155
  let t31;
4141
- $[81] !== zOffset || $[82] !== t30 ? (t31 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t30 }), $[81] = zOffset, $[82] = t30, $[83] = t31) : t31 = $[83];
4142
- const popover = t31;
4156
+ $[63] !== restProps || $[64] !== margins || $[65] !== animate || $[66] !== arrowProp || $[67] !== setArrow || $[68] !== arrowX || $[69] !== arrowY || $[70] !== referenceHidden || $[71] !== overflow || $[72] !== padding || $[73] !== placement || $[74] !== radius || $[75] !== setFloating || $[76] !== scheme || $[77] !== shadow || $[78] !== originX || $[79] !== originY || $[80] !== strategy || $[81] !== tone || $[82] !== x || $[83] !== y || $[84] !== content ? (t31 = /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, 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 }), $[63] = restProps, $[64] = margins, $[65] = animate, $[66] = arrowProp, $[67] = setArrow, $[68] = arrowX, $[69] = arrowY, $[70] = referenceHidden, $[71] = overflow, $[72] = padding, $[73] = placement, $[74] = radius, $[75] = setFloating, $[76] = scheme, $[77] = shadow, $[78] = originX, $[79] = originY, $[80] = strategy, $[81] = tone, $[82] = x, $[83] = y, $[84] = content, $[85] = t31) : t31 = $[85];
4143
4157
  let t32;
4144
- $[84] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (children_0) => /* @__PURE__ */ jsx(AnimatePresence, { children: children_0 }), $[84] = t32) : t32 = $[84];
4158
+ $[86] !== zOffset || $[87] !== t31 ? (t32 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t31 }), $[86] = zOffset, $[87] = t31, $[88] = t32) : t32 = $[88];
4159
+ const popover = t32;
4145
4160
  let t33;
4146
- $[85] !== open || $[86] !== portal || $[87] !== popover ? (t33 = open && /* @__PURE__ */ jsx(ConditionalWrapper, { condition: !!portal, wrapper: (children_1) => /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children_1 }), children: popover }), $[85] = open, $[86] = portal, $[87] = popover, $[88] = t33) : t33 = $[88];
4161
+ $[89] === Symbol.for("react.memo_cache_sentinel") ? (t33 = (children_0) => /* @__PURE__ */ jsx(AnimatePresence, { children: children_0 }), $[89] = t33) : t33 = $[89];
4147
4162
  let t34;
4148
- $[89] !== animate || $[90] !== t33 ? (t34 = /* @__PURE__ */ jsx(ConditionalWrapper, { condition: animate, wrapper: t32, children: t33 }), $[89] = animate, $[90] = t33, $[91] = t34) : t34 = $[91];
4163
+ $[90] !== open || $[91] !== portal || $[92] !== popover ? (t34 = open && /* @__PURE__ */ jsx(ConditionalWrapper, { condition: !!portal, wrapper: (children_1) => /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children_1 }), children: popover }), $[90] = open, $[91] = portal, $[92] = popover, $[93] = t34) : t34 = $[93];
4149
4164
  let t35;
4150
- $[92] !== children || $[93] !== referenceElement || $[94] !== refs ? (t35 = children && !referenceElement && /* @__PURE__ */ jsx("div", { ref: (node_0) => {
4151
- logDeprecatedWarning(), refs.setReference(node_0);
4152
- }, style: {
4153
- display: "contents"
4154
- }, children }), $[92] = children, $[93] = referenceElement, $[94] = refs, $[95] = t35) : t35 = $[95];
4165
+ $[94] !== animate || $[95] !== t34 ? (t35 = /* @__PURE__ */ jsx(ConditionalWrapper, { condition: animate, wrapper: t33, children: t34 }), $[94] = animate, $[95] = t34, $[96] = t35) : t35 = $[96];
4155
4166
  let t36;
4156
- return $[96] !== t34 || $[97] !== t35 ? (t36 = /* @__PURE__ */ jsxs(Fragment, { children: [
4157
- t34,
4158
- t35
4159
- ] }), $[96] = t34, $[97] = t35, $[98] = t36) : t36 = $[98], t36;
4167
+ return $[97] !== t35 || $[98] !== children ? (t36 = /* @__PURE__ */ jsxs(Fragment, { children: [
4168
+ t35,
4169
+ children
4170
+ ] }), $[97] = t35, $[98] = children, $[99] = t36) : t36 = $[99], t36;
4160
4171
  }));
4161
4172
  Popover.displayName = "Popover";
4162
4173
  let didWarn = !1;
@@ -6056,8 +6067,9 @@ const Root$5 = styled(Box)`
6056
6067
  let t16;
6057
6068
  return $[55] !== value || $[56] !== t15 ? (t16 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t15 }), $[55] = value, $[56] = t15, $[57] = t16) : t16 = $[57], t16;
6058
6069
  }), MenuButton = forwardRef(function(props, forwardedRef) {
6059
- const {
6060
- __unstable_disableRestoreFocusOnClose: disableRestoreFocusOnClose = !1,
6070
+ var _a;
6071
+ const $ = c(63), {
6072
+ __unstable_disableRestoreFocusOnClose: t0,
6061
6073
  boundaryElement: deprecated_boundaryElement,
6062
6074
  button: buttonProp,
6063
6075
  id,
@@ -6066,23 +6078,38 @@ const Root$5 = styled(Box)`
6066
6078
  onOpen,
6067
6079
  placement: deprecated_placement,
6068
6080
  popoverScheme: deprecated_popoverScheme,
6069
- portal: deprecated_portal = !0,
6081
+ portal: t1,
6070
6082
  popover,
6071
6083
  popoverRadius: deprecated_popoverRadius,
6072
6084
  preventOverflow: deprecated_preventOverflow
6073
- } = props, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null), [menuElements, setChildMenuElements] = useState([]), openRef = useRef(open);
6074
- useEffect(() => {
6085
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
6086
+ let t2;
6087
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
6088
+ const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
6089
+ let t3, t4;
6090
+ $[1] !== onOpen || $[2] !== open ? (t3 = () => {
6075
6091
  onOpen && open && !openRef.current && onOpen();
6076
- }, [onOpen, open]), useEffect(() => {
6092
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
6093
+ let t5, t6;
6094
+ $[5] !== onClose || $[6] !== open ? (t5 = () => {
6077
6095
  onClose && !open && openRef.current && onClose();
6078
- }, [onClose, open]), useEffect(() => {
6096
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
6097
+ let t7, t8;
6098
+ $[9] !== open ? (t7 = () => {
6079
6099
  openRef.current = open;
6080
- }, [open]);
6081
- const handleButtonClick = useCallback(() => {
6100
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
6101
+ let t9;
6102
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
6082
6103
  setOpen((v) => !v), setShouldFocus(null);
6083
- }, []), handleMouseDown = useCallback((event) => {
6104
+ }, $[12] = t9) : t9 = $[12];
6105
+ const handleButtonClick = t9;
6106
+ let t10;
6107
+ $[13] !== open ? (t10 = (event) => {
6084
6108
  open && event.preventDefault();
6085
- }, [open]), handleButtonKeyDown = useCallback((event_0) => {
6109
+ }, $[13] = open, $[14] = t10) : t10 = $[14];
6110
+ const handleMouseDown = t10;
6111
+ let t11;
6112
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
6086
6113
  if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
6087
6114
  event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
6088
6115
  return;
@@ -6091,7 +6118,10 @@ const Root$5 = styled(Box)`
6091
6118
  event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
6092
6119
  return;
6093
6120
  }
6094
- }, []), handleMenuClickOutside = useCallback((event_1) => {
6121
+ }, $[15] = t11) : t11 = $[15];
6122
+ const handleButtonKeyDown = t11;
6123
+ let t12;
6124
+ $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
6095
6125
  const target = event_1.target;
6096
6126
  if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
6097
6127
  for (const el of menuElements)
@@ -6099,9 +6129,15 @@ const Root$5 = styled(Box)`
6099
6129
  return;
6100
6130
  setOpen(!1);
6101
6131
  }
6102
- }, [buttonElement, menuElements]), handleMenuEscape = useCallback(() => {
6132
+ }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
6133
+ const handleMenuClickOutside = t12;
6134
+ let t13;
6135
+ $[19] !== disableRestoreFocusOnClose || $[20] !== buttonElement ? (t13 = () => {
6103
6136
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
6104
- }, [buttonElement, disableRestoreFocusOnClose]), handleBlur = useCallback((event_2) => {
6137
+ }, $[19] = disableRestoreFocusOnClose, $[20] = buttonElement, $[21] = t13) : t13 = $[21];
6138
+ const handleMenuEscape = t13;
6139
+ let t14;
6140
+ $[22] !== menuElements ? (t14 = (event_2) => {
6105
6141
  const target_0 = event_2.relatedTarget;
6106
6142
  if (target_0 instanceof Node) {
6107
6143
  for (const el_0 of menuElements)
@@ -6109,11 +6145,20 @@ const Root$5 = styled(Box)`
6109
6145
  return;
6110
6146
  setOpen(!1);
6111
6147
  }
6112
- }, [menuElements]), handleItemClick = useCallback(() => {
6148
+ }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
6149
+ const handleBlur = t14;
6150
+ let t15;
6151
+ $[24] !== disableRestoreFocusOnClose || $[25] !== buttonElement ? (t15 = () => {
6113
6152
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
6114
- }, [buttonElement, disableRestoreFocusOnClose]), registerElement = useCallback((el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => {
6153
+ }, $[24] = disableRestoreFocusOnClose, $[25] = buttonElement, $[26] = t15) : t15 = $[26];
6154
+ const handleItemClick = t15;
6155
+ let t16;
6156
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => {
6115
6157
  setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1));
6116
- }), []), menuProps = useMemo(() => ({
6158
+ }), $[27] = t16) : t16 = $[27];
6159
+ const registerElement = t16;
6160
+ let t17;
6161
+ $[28] !== menuProp || $[29] !== id || $[30] !== handleBlur || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== handleItemClick || $[34] !== buttonElement || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
6117
6162
  "aria-labelledby": id,
6118
6163
  onBlurCapture: handleBlur,
6119
6164
  onClickOutside: handleMenuClickOutside,
@@ -6122,25 +6167,27 @@ const Root$5 = styled(Box)`
6122
6167
  originElement: buttonElement,
6123
6168
  registerElement,
6124
6169
  shouldFocus
6125
- }), [buttonElement, handleMenuClickOutside, handleMenuEscape, handleItemClick, id, handleBlur, registerElement, shouldFocus]), menu = menuProp && cloneElement(menuProp, menuProps), ref = useRef(null), button = useMemo(() => {
6126
- var _a;
6127
- return buttonProp && cloneElement(buttonProp, {
6128
- "data-ui": "MenuButton",
6129
- id,
6130
- onClick: handleButtonClick,
6131
- onKeyDown: handleButtonKeyDown,
6132
- onMouseDown: handleMouseDown,
6133
- "aria-haspopup": !0,
6134
- "aria-expanded": open,
6135
- ref,
6136
- selected: (_a = buttonProp.props.selected) != null ? _a : open
6137
- });
6138
- }, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open]);
6139
- useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
6140
- if (button)
6141
- return setButtonElement(ref.current), () => setButtonElement(null);
6142
- }, [button]);
6143
- const popoverProps = useMemo(() => ({
6170
+ }), $[28] = menuProp, $[29] = id, $[30] = handleBlur, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = handleItemClick, $[34] = buttonElement, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
6171
+ const menu = t17;
6172
+ let t18, t19;
6173
+ $[37] !== buttonProp || $[38] !== open || $[39] !== id || $[40] !== handleMouseDown ? (t19 = buttonProp && cloneElement(buttonProp, {
6174
+ "data-ui": "MenuButton",
6175
+ id,
6176
+ onClick: handleButtonClick,
6177
+ onKeyDown: handleButtonKeyDown,
6178
+ onMouseDown: handleMouseDown,
6179
+ "aria-haspopup": !0,
6180
+ "aria-expanded": open,
6181
+ ref: setButtonElement,
6182
+ selected: (_a = buttonProp.props.selected) != null ? _a : open
6183
+ }), $[37] = buttonProp, $[38] = open, $[39] = id, $[40] = handleMouseDown, $[41] = t19) : t19 = $[41], t18 = t19;
6184
+ const button = t18;
6185
+ let t20, t21;
6186
+ $[42] !== buttonElement ? (t20 = () => buttonElement, t21 = [buttonElement], $[42] = buttonElement, $[43] = t20, $[44] = t21) : (t20 = $[43], t21 = $[44]), useImperativeHandle(forwardedRef, t20, t21);
6187
+ let t22, t23;
6188
+ $[45] !== popover ? (t23 = popover || {}, $[45] = popover, $[46] = t23) : t23 = $[46];
6189
+ let t24;
6190
+ $[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_portal || $[50] !== deprecated_preventOverflow || $[51] !== deprecated_popoverRadius || $[52] !== deprecated_popoverScheme || $[53] !== t23 ? (t24 = {
6144
6191
  boundaryElement: deprecated_boundaryElement,
6145
6192
  overflow: "auto",
6146
6193
  placement: deprecated_placement,
@@ -6148,9 +6195,16 @@ const Root$5 = styled(Box)`
6148
6195
  preventOverflow: deprecated_preventOverflow,
6149
6196
  radius: deprecated_popoverRadius,
6150
6197
  scheme: deprecated_popoverScheme,
6151
- ...popover || {}
6152
- }), [deprecated_boundaryElement, deprecated_placement, deprecated_popoverRadius, deprecated_popoverScheme, deprecated_portal, deprecated_preventOverflow, popover]);
6153
- return /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsx(Fragment, {}) });
6198
+ ...t23
6199
+ }, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_portal, $[50] = deprecated_preventOverflow, $[51] = deprecated_popoverRadius, $[52] = deprecated_popoverScheme, $[53] = t23, $[54] = t24) : t24 = $[54], t22 = t24;
6200
+ const popoverProps = t22;
6201
+ let t25;
6202
+ $[55] !== buttonElement || $[56] !== popoverProps || $[57] !== menu || $[58] !== open ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", referenceElement: buttonElement, ...popoverProps, content: menu, open }), $[55] = buttonElement, $[56] = popoverProps, $[57] = menu, $[58] = open, $[59] = t25) : t25 = $[59];
6203
+ let t26;
6204
+ return $[60] !== t25 || $[61] !== button ? (t26 = /* @__PURE__ */ jsxs(Fragment, { children: [
6205
+ t25,
6206
+ button
6207
+ ] }), $[60] = t25, $[61] = button, $[62] = t26) : t26 = $[62], t26;
6154
6208
  }), MenuDivider = styled.hr`
6155
6209
  height: 1px;
6156
6210
  border: 0;