@react-aria/overlays 3.17.0 → 3.18.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.
package/dist/module.js CHANGED
@@ -2,7 +2,7 @@ import $k7QOs$react, {useState as $k7QOs$useState, useCallback as $k7QOs$useCall
2
2
  import {useLayoutEffect as $k7QOs$useLayoutEffect, useResizeObserver as $k7QOs$useResizeObserver, clamp as $k7QOs$clamp, useId as $k7QOs$useId, isIOS as $k7QOs$isIOS, chain as $k7QOs$chain, getScrollParent as $k7QOs$getScrollParent, useLabels as $k7QOs$useLabels, mergeProps as $k7QOs$mergeProps} from "@react-aria/utils";
3
3
  import {useLocale as $k7QOs$useLocale, useLocalizedStringFormatter as $k7QOs$useLocalizedStringFormatter} from "@react-aria/i18n";
4
4
  import {isElementInChildOfActiveScope as $k7QOs$isElementInChildOfActiveScope, FocusScope as $k7QOs$FocusScope} from "@react-aria/focus";
5
- import {useInteractOutside as $k7QOs$useInteractOutside, useFocusWithin as $k7QOs$useFocusWithin} from "@react-aria/interactions";
5
+ import {useInteractOutside as $k7QOs$useInteractOutside, useFocusWithin as $k7QOs$useFocusWithin, ClearPressResponder as $k7QOs$ClearPressResponder} from "@react-aria/interactions";
6
6
  import $k7QOs$reactdom from "react-dom";
7
7
  import {useIsSSR as $k7QOs$useIsSSR} from "@react-aria/ssr";
8
8
  import {VisuallyHidden as $k7QOs$VisuallyHidden} from "@react-aria/visually-hidden";
@@ -82,7 +82,7 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
82
82
  scroll.top = documentElement.scrollTop || containerNode.scrollTop;
83
83
  scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
84
84
  } else {
85
- ({ width: width , height: height , top: top , left: left } = $edcf132a9284368a$var$getOffset(containerNode));
85
+ ({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode));
86
86
  scroll.top = containerNode.scrollTop;
87
87
  scroll.left = containerNode.scrollLeft;
88
88
  totalWidth = width;
@@ -106,15 +106,20 @@ function $edcf132a9284368a$var$getScroll(node) {
106
106
  height: node.scrollHeight
107
107
  };
108
108
  }
109
- function $edcf132a9284368a$var$getDelta(axis, offset, size, containerDimensions, padding) {
110
- let root = document.scrollingElement || document.documentElement;
111
- let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
112
- let containerScroll = isScrollPrevented ? 0 : containerDimensions.scroll[axis];
113
- let containerHeight = containerDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
109
+ function $edcf132a9284368a$var$getDelta(axis, offset, size, // The dimensions of the boundary element that the popover is
110
+ // positioned within (most of the time this is the <body>).
111
+ boundaryDimensions, // The dimensions of the containing block element that the popover is
112
+ // positioned relative to (e.g. parent with position: relative).
113
+ // Usually this is the same as the boundary element, but if the popover
114
+ // is portaled somewhere other than the body and has an ancestor with
115
+ // position: relative/absolute, it will be different.
116
+ containerDimensions, padding) {
117
+ let containerScroll = containerDimensions.scroll[axis];
118
+ let boundaryHeight = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
114
119
  let startEdgeOffset = offset - padding - containerScroll;
115
120
  let endEdgeOffset = offset + padding - containerScroll + size;
116
121
  if (startEdgeOffset < 0) return -startEdgeOffset;
117
- else if (endEdgeOffset > containerHeight) return Math.max(containerHeight - endEdgeOffset, -startEdgeOffset);
122
+ else if (endEdgeOffset > boundaryHeight) return Math.max(boundaryHeight - endEdgeOffset, -startEdgeOffset);
118
123
  else return 0;
119
124
  }
120
125
  function $edcf132a9284368a$var$getMargins(node) {
@@ -145,7 +150,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
145
150
  return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
146
151
  }
147
152
  function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
148
- let { placement: placement , crossPlacement: crossPlacement , axis: axis , crossAxis: crossAxis , size: size , crossSize: crossSize } = placementInfo;
153
+ let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
149
154
  let position = {};
150
155
  // button position
151
156
  position[crossAxis] = childOffset[crossAxis];
@@ -186,13 +191,13 @@ function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, contai
186
191
  ));
187
192
  }
188
193
  function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
189
- let { placement: placement , axis: axis , size: size } = placementInfo;
194
+ let { placement: placement, axis: axis, size: size } = placementInfo;
190
195
  if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
191
196
  return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
192
197
  }
193
- function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
198
+ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
194
199
  let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
195
- let { size: size , crossAxis: crossAxis , crossSize: crossSize , placement: placement , crossPlacement: crossPlacement } = placementInfo;
200
+ let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
196
201
  let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
197
202
  let normalizedOffset = offset;
198
203
  let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
@@ -208,13 +213,13 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
208
213
  normalizedOffset = offset;
209
214
  }
210
215
  }
211
- let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
216
+ let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
212
217
  position[crossAxis] += delta;
213
218
  let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
214
219
  if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
215
220
  overlaySize.height = Math.min(overlaySize.height, maxHeight);
216
221
  position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
217
- delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
222
+ delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
218
223
  position[crossAxis] += delta;
219
224
  let arrowPosition = {};
220
225
  // All values are transformed so that 0 is at the top/left of the overlay depending on the orientation
@@ -238,14 +243,14 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
238
243
  };
239
244
  }
240
245
  function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
241
- let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight , arrowSize: arrowSize = 0 , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
246
+ let { placement: placement, targetNode: targetNode, overlayNode: overlayNode, scrollNode: scrollNode, padding: padding, shouldFlip: shouldFlip, boundaryElement: boundaryElement, offset: offset, crossOffset: crossOffset, maxHeight: maxHeight, arrowSize: arrowSize = 0, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
242
247
  let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
243
248
  let isViewportContainer = container === document.documentElement;
244
249
  const containerPositionStyle = window.getComputedStyle(container).position;
245
250
  let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
246
251
  let childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
247
252
  if (!isViewportContainer) {
248
- let { marginTop: marginTop , marginLeft: marginLeft } = window.getComputedStyle(targetNode);
253
+ let { marginTop: marginTop, marginLeft: marginLeft } = window.getComputedStyle(targetNode);
249
254
  childOffset.top += parseInt(marginTop, 10) || 0;
250
255
  childOffset.left += parseInt(marginLeft, 10) || 0;
251
256
  }
@@ -255,12 +260,13 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
255
260
  overlaySize.height += margins.top + margins.bottom;
256
261
  let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
257
262
  let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
263
+ let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
258
264
  let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
259
- return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
265
+ return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
260
266
  }
261
267
  function $edcf132a9284368a$var$getOffset(node) {
262
- let { top: top , left: left , width: width , height: height } = node.getBoundingClientRect();
263
- let { scrollTop: scrollTop , scrollLeft: scrollLeft , clientTop: clientTop , clientLeft: clientLeft } = document.documentElement;
268
+ let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
269
+ let { scrollTop: scrollTop, scrollLeft: scrollLeft, clientTop: clientTop, clientLeft: clientLeft } = document.documentElement;
264
270
  return {
265
271
  top: top + scrollTop - clientTop,
266
272
  left: left + scrollLeft - clientLeft,
@@ -272,7 +278,7 @@ function $edcf132a9284368a$var$getPosition(node, parent) {
272
278
  let style = window.getComputedStyle(node);
273
279
  let offset;
274
280
  if (style.position === "fixed") {
275
- let { top: top , left: left , width: width , height: height } = node.getBoundingClientRect();
281
+ let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
276
282
  offset = {
277
283
  top: top,
278
284
  left: left,
@@ -337,7 +343,7 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
337
343
  */
338
344
  const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
339
345
  function $dd149f63282afbbf$export$18fc8428861184da(opts) {
340
- let { triggerRef: triggerRef , isOpen: isOpen , onClose: onClose } = opts;
346
+ let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
341
347
  (0, $k7QOs$useEffect)(()=>{
342
348
  if (!isOpen || onClose === null) return;
343
349
  let onScroll = (e)=>{
@@ -365,8 +371,8 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
365
371
  // @ts-ignore
366
372
  let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
367
373
  function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
368
- let { direction: direction } = (0, $k7QOs$useLocale)();
369
- let { arrowSize: arrowSize = 0 , targetRef: targetRef , overlayRef: overlayRef , scrollRef: scrollRef = overlayRef , placement: placement = "bottom" , containerPadding: containerPadding = 12 , shouldFlip: shouldFlip = true , boundaryElement: boundaryElement = typeof document !== "undefined" ? document.body : null , offset: offset = 0 , crossOffset: crossOffset = 0 , shouldUpdatePosition: shouldUpdatePosition = true , isOpen: isOpen = true , onClose: onClose , maxHeight: maxHeight , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
374
+ let { direction: direction } = (0, $k7QOs$useLocale)();
375
+ let { arrowSize: arrowSize = 0, targetRef: targetRef, overlayRef: overlayRef, scrollRef: scrollRef = overlayRef, placement: placement = "bottom", containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== "undefined" ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
370
376
  let [position, setPosition] = (0, $k7QOs$useState)({
371
377
  position: {},
372
378
  arrowOffsetLeft: undefined,
@@ -512,7 +518,7 @@ function $2a41e45df1593e64$var$translateRTL(position, direction) {
512
518
 
513
519
  const $a11501f3d1d39e6c$var$visibleOverlays = [];
514
520
  function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
515
- let { onClose: onClose , shouldCloseOnBlur: shouldCloseOnBlur , isOpen: isOpen , isDismissable: isDismissable = false , isKeyboardDismissDisabled: isKeyboardDismissDisabled = false , shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
521
+ let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
516
522
  // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
517
523
  (0, $k7QOs$useEffect)(()=>{
518
524
  if (isOpen) $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
@@ -559,7 +565,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
559
565
  onInteractOutside: isDismissable ? onInteractOutside : null,
560
566
  onInteractOutsideStart: onInteractOutsideStart
561
567
  });
562
- let { focusWithinProps: focusWithinProps } = (0, $k7QOs$useFocusWithin)({
568
+ let { focusWithinProps: focusWithinProps } = (0, $k7QOs$useFocusWithin)({
563
569
  isDisabled: !shouldCloseOnBlur,
564
570
  onBlurWithin: (e)=>{
565
571
  // Do not close if relatedTarget is null, which means focus is lost to the body.
@@ -605,8 +611,8 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
605
611
 
606
612
 
607
613
  function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
608
- let { type: type } = props;
609
- let { isOpen: isOpen } = state;
614
+ let { type: type } = props;
615
+ let { isOpen: isOpen } = state;
610
616
  // Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
611
617
  // without forcing users to pass onClose.
612
618
  (0, $k7QOs$useEffect)(()=>{
@@ -663,7 +669,7 @@ const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
663
669
  let $49c51c25361d4cd2$var$preventScrollCount = 0;
664
670
  let $49c51c25361d4cd2$var$restore;
665
671
  function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
666
- let { isDisabled: isDisabled } = options;
672
+ let { isDisabled: isDisabled } = options;
667
673
  (0, $k7QOs$useLayoutEffect)(()=>{
668
674
  if (isDisabled) return;
669
675
  $49c51c25361d4cd2$var$preventScrollCount++;
@@ -856,7 +862,7 @@ function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
856
862
 
857
863
  const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
858
864
  function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
859
- let { children: children } = props;
865
+ let { children: children } = props;
860
866
  let parent = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
861
867
  let [modalCount, setModalCount] = (0, $k7QOs$useState)(0);
862
868
  let context = (0, $k7QOs$useMemo)(()=>({
@@ -889,7 +895,7 @@ function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
889
895
  /**
890
896
  * Creates a root node that will be aria-hidden if there are other modals open.
891
897
  */ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
892
- let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
898
+ let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
893
899
  return /*#__PURE__*/ (0, $k7QOs$react).createElement("div", {
894
900
  "data-overlay-container": true,
895
901
  ...props,
@@ -901,7 +907,7 @@ function $f57aed4a881a3485$export$bf688221f59024e5(props) {
901
907
  }
902
908
  function $f57aed4a881a3485$export$b47c3594eab58386(props) {
903
909
  let isSSR = (0, $k7QOs$useIsSSR)();
904
- let { portalContainer: portalContainer = isSSR ? null : document.body , ...rest } = props;
910
+ let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
905
911
  (0, $k7QOs$react).useEffect(()=>{
906
912
  if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
907
913
  }, [
@@ -1194,7 +1200,7 @@ $a2f21f5f14f60553$exports = {
1194
1200
 
1195
1201
 
1196
1202
  function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
1197
- let { onDismiss: onDismiss , ...otherProps } = props;
1203
+ let { onDismiss: onDismiss, ...otherProps } = props;
1198
1204
  let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($a2f21f5f14f60553$exports))));
1199
1205
  let labels = (0, $k7QOs$useLabels)(otherProps, stringFormatter.format("dismiss"));
1200
1206
  let onClick = ()=>{
@@ -1338,15 +1344,15 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
1338
1344
 
1339
1345
 
1340
1346
  function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1341
- let { triggerRef: triggerRef , popoverRef: popoverRef , isNonModal: isNonModal , isKeyboardDismissDisabled: isKeyboardDismissDisabled , ...otherProps } = props;
1342
- let { overlayProps: overlayProps , underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1347
+ let { triggerRef: triggerRef, popoverRef: popoverRef, isNonModal: isNonModal, isKeyboardDismissDisabled: isKeyboardDismissDisabled, ...otherProps } = props;
1348
+ let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1343
1349
  isOpen: state.isOpen,
1344
1350
  onClose: state.close,
1345
1351
  shouldCloseOnBlur: true,
1346
1352
  isDismissable: !isNonModal,
1347
1353
  isKeyboardDismissDisabled: isKeyboardDismissDisabled
1348
1354
  }, popoverRef);
1349
- let { overlayProps: positionProps , arrowProps: arrowProps , placement: placement } = (0, $2a41e45df1593e64$export$d39e1813b3bdd0e1)({
1355
+ let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement } = (0, $2a41e45df1593e64$export$d39e1813b3bdd0e1)({
1350
1356
  ...otherProps,
1351
1357
  targetRef: triggerRef,
1352
1358
  overlayRef: popoverRef,
@@ -1403,10 +1409,11 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1403
1409
 
1404
1410
 
1405
1411
 
1412
+
1406
1413
  const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
1407
1414
  function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
1408
1415
  let isSSR = (0, $k7QOs$useIsSSR)();
1409
- let { portalContainer: portalContainer = isSSR ? null : document.body , isExiting: isExiting } = props;
1416
+ let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
1410
1417
  let [contain, setContain] = (0, $k7QOs$useState)(false);
1411
1418
  let contextValue = (0, $k7QOs$useMemo)(()=>({
1412
1419
  contain: contain,
@@ -1416,16 +1423,14 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
1416
1423
  setContain
1417
1424
  ]);
1418
1425
  if (!portalContainer) return null;
1419
- let contents;
1420
- if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1421
- value: contextValue
1422
- }, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
1426
+ let contents = props.children;
1427
+ if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
1423
1428
  restoreFocus: true,
1424
1429
  contain: contain && !isExiting
1425
- }, props.children));
1426
- else contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1430
+ }, contents);
1431
+ contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1427
1432
  value: contextValue
1428
- }, props.children);
1433
+ }, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$ClearPressResponder), null, contents));
1429
1434
  return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
1430
1435
  }
1431
1436
  function $337b884510726a0d$export$14c98a7594375490() {
@@ -1441,7 +1446,7 @@ function $337b884510726a0d$export$14c98a7594375490() {
1441
1446
 
1442
1447
 
1443
1448
  function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
1444
- let { overlayProps: overlayProps , underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1449
+ let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1445
1450
  ...props,
1446
1451
  isOpen: state.isOpen,
1447
1452
  onClose: state.close