@react-aria/overlays 3.15.0 → 3.16.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/import.mjs CHANGED
@@ -67,7 +67,7 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
67
67
  };
68
68
  const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
69
69
  // @ts-ignore
70
- let $edcf132a9284368a$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
70
+ let $edcf132a9284368a$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
71
71
  function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
72
72
  let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
73
73
  let scroll = {};
@@ -236,7 +236,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
236
236
  };
237
237
  }
238
238
  function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
239
- let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight , arrowSize: arrowSize , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
239
+ 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;
240
240
  let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
241
241
  let isViewportContainer = container === document.documentElement;
242
242
  const containerPositionStyle = window.getComputedStyle(container).position;
@@ -361,7 +361,7 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
361
361
 
362
362
 
363
363
  // @ts-ignore
364
- let $2a41e45df1593e64$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
364
+ let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
365
365
  function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
366
366
  let { direction: direction } = (0, $k7QOs$useLocale)();
367
367
  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;
@@ -469,6 +469,8 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
469
469
  },
470
470
  placement: position.placement,
471
471
  arrowProps: {
472
+ "aria-hidden": "true",
473
+ role: "presentation",
472
474
  style: {
473
475
  left: position.arrowOffsetLeft,
474
476
  top: position.arrowOffsetTop
@@ -636,7 +638,7 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
636
638
  * governing permissions and limitations under the License.
637
639
  */
638
640
  // @ts-ignore
639
- const $49c51c25361d4cd2$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
641
+ const $49c51c25361d4cd2$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
640
642
  // HTML input types that do not cause the software keyboard to appear.
641
643
  const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
642
644
  "checkbox",
@@ -1396,7 +1398,7 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1396
1398
  const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
1397
1399
  function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
1398
1400
  let isSSR = (0, $k7QOs$useIsSSR)();
1399
- let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
1401
+ let { portalContainer: portalContainer = isSSR ? null : document.body , isExiting: isExiting } = props;
1400
1402
  let [contain, setContain] = (0, $k7QOs$useState)(false);
1401
1403
  let contextValue = (0, $k7QOs$useMemo)(()=>({
1402
1404
  contain: contain,
@@ -1411,7 +1413,7 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
1411
1413
  value: contextValue
1412
1414
  }, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
1413
1415
  restoreFocus: true,
1414
- contain: contain
1416
+ contain: contain && !isExiting
1415
1417
  }, props.children));
1416
1418
  else contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1417
1419
  value: contextValue
package/dist/main.js CHANGED
@@ -86,7 +86,7 @@ const $5935ba4d7da2c103$var$TOTAL_SIZE = {
86
86
  };
87
87
  const $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE = {};
88
88
  // @ts-ignore
89
- let $5935ba4d7da2c103$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
89
+ let $5935ba4d7da2c103$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
90
90
  function $5935ba4d7da2c103$var$getContainerDimensions(containerNode) {
91
91
  let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
92
92
  let scroll = {};
@@ -255,7 +255,7 @@ function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset,
255
255
  };
256
256
  }
257
257
  function $5935ba4d7da2c103$export$b3ceb0cbf1056d98(opts) {
258
- let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight , arrowSize: arrowSize , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
258
+ 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;
259
259
  let container = overlayNode instanceof HTMLElement ? $5935ba4d7da2c103$var$getContainingBlock(overlayNode) : document.documentElement;
260
260
  let isViewportContainer = container === document.documentElement;
261
261
  const containerPositionStyle = window.getComputedStyle(container).position;
@@ -380,7 +380,7 @@ function $9a8aa1b0b336ea3a$export$18fc8428861184da(opts) {
380
380
 
381
381
 
382
382
  // @ts-ignore
383
- let $cd94b4896dd97759$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
383
+ let $cd94b4896dd97759$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
384
384
  function $cd94b4896dd97759$export$d39e1813b3bdd0e1(props) {
385
385
  let { direction: direction } = (0, $6Zb2x$reactariai18n.useLocale)();
386
386
  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;
@@ -488,6 +488,8 @@ function $cd94b4896dd97759$export$d39e1813b3bdd0e1(props) {
488
488
  },
489
489
  placement: position.placement,
490
490
  arrowProps: {
491
+ "aria-hidden": "true",
492
+ role: "presentation",
491
493
  style: {
492
494
  left: position.arrowOffsetLeft,
493
495
  top: position.arrowOffsetTop
@@ -655,7 +657,7 @@ function $b4878eb6316f670a$export$f9d5c8beee7d008d(props, state, ref) {
655
657
  * governing permissions and limitations under the License.
656
658
  */
657
659
  // @ts-ignore
658
- const $5c2f5cd01815d369$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
660
+ const $5c2f5cd01815d369$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
659
661
  // HTML input types that do not cause the software keyboard to appear.
660
662
  const $5c2f5cd01815d369$var$nonTextInputTypes = new Set([
661
663
  "checkbox",
@@ -1415,7 +1417,7 @@ function $6c2dfcdee3e15e20$export$542a6fd13ac93354(props, state) {
1415
1417
  const $745edbb83ab4296f$export$a2200b96afd16271 = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createContext(null);
1416
1418
  function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
1417
1419
  let isSSR = (0, $6Zb2x$reactariassr.useIsSSR)();
1418
- let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
1420
+ let { portalContainer: portalContainer = isSSR ? null : document.body , isExiting: isExiting } = props;
1419
1421
  let [contain, setContain] = (0, $6Zb2x$react.useState)(false);
1420
1422
  let contextValue = (0, $6Zb2x$react.useMemo)(()=>({
1421
1423
  contain: contain,
@@ -1430,7 +1432,7 @@ function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
1430
1432
  value: contextValue
1431
1433
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement((0, $6Zb2x$reactariafocus.FocusScope), {
1432
1434
  restoreFocus: true,
1433
- contain: contain
1435
+ contain: contain && !isExiting
1434
1436
  }, props.children));
1435
1437
  else contents = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement($745edbb83ab4296f$export$a2200b96afd16271.Provider, {
1436
1438
  value: contextValue