@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.
@@ -3496,7 +3496,19 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3496
3496
  ] }), $[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;
3497
3497
  }));
3498
3498
  PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
3499
- const Popover = memo(forwardRef(function(props, forwardedRef) {
3499
+ const ViewportOverlay = () => {
3500
+ const $ = c(2), {
3501
+ zIndex
3502
+ } = useLayer();
3503
+ let t0;
3504
+ return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsx("div", { style: {
3505
+ height: "100vh",
3506
+ inset: 0,
3507
+ position: "fixed",
3508
+ width: "100vw",
3509
+ zIndex
3510
+ } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
3511
+ }, Popover = memo(forwardRef(function(props, forwardedRef) {
3500
3512
  const {
3501
3513
  container,
3502
3514
  layer
@@ -3512,6 +3524,7 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3512
3524
  fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
3513
3525
  matchReferenceWidth,
3514
3526
  floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
3527
+ modal,
3515
3528
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3516
3529
  onActivate,
3517
3530
  open,
@@ -3619,7 +3632,10 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3619
3632
  updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
3620
3633
  }, [update, updateRef]), disabled)
3621
3634
  return childProp || /* @__PURE__ */ jsx(Fragment, {});
3622
- const popover = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__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 }) }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3635
+ const popover = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
3636
+ modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
3637
+ /* @__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 })
3638
+ ] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3623
3639
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3624
3640
  animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
3625
3641
  child