@sanity/ui 2.13.5 → 2.14.0

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.
@@ -3492,7 +3492,19 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).w
3492
3492
  ] }), $[48] = placement, $[49] = radius, $[50] = ref, $[51] = rootStyle2, $[52] = scheme, $[53] = shadow, $[54] = t11, $[55] = t12, $[56] = t8, $[57] = t9, $[58] = tone, $[59] = t13) : t13 = $[59], t13;
3493
3493
  }));
3494
3494
  PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
3495
- const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3495
+ const ViewportOverlay = () => {
3496
+ const $ = reactCompilerRuntime.c(2), {
3497
+ zIndex
3498
+ } = useLayer();
3499
+ let t0;
3500
+ return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
3501
+ height: "100vh",
3502
+ inset: 0,
3503
+ position: "fixed",
3504
+ width: "100vw",
3505
+ zIndex
3506
+ } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
3507
+ }, Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3496
3508
  const {
3497
3509
  container,
3498
3510
  layer
@@ -3508,6 +3520,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3508
3520
  fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
3509
3521
  matchReferenceWidth,
3510
3522
  floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
3523
+ modal,
3511
3524
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3512
3525
  onActivate,
3513
3526
  open,
@@ -3615,7 +3628,10 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
3615
3628
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
3616
3629
  }, [update, updateRef]), disabled)
3617
3630
  return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
3618
- const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.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 }) }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3631
+ const popover = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
3632
+ modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
3633
+ /* @__PURE__ */ jsxRuntime.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 })
3634
+ ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3619
3635
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3620
3636
  animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
3621
3637
  child