Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-aria/overlays

Package Overview
Dependencies
Maintainers
1
Versions
799
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/overlays - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0-nightly.672

dist/main.js.map

766

dist/main.js

@@ -1,17 +0,23 @@

var _babelRuntimeHelpersObjectSpread = $parcel$interopDefault(require("@babel/runtime/helpers/objectSpread2"));
var {
VisuallyHidden
} = require("@react-aria/visually-hidden");
var _babelRuntimeHelpersSlicedToArray = $parcel$interopDefault(require("@babel/runtime/helpers/slicedToArray"));
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
var _domHelpersStyle = $parcel$interopDefault(require("dom-helpers/style"));
var _reactDom = $parcel$interopDefault(require("react-dom"));
var _domHelpersQueryOffset = $parcel$interopDefault(require("dom-helpers/query/offset"));
var {
useId
} = require("@react-aria/utils");
var _domHelpersQueryPosition = $parcel$interopDefault(require("dom-helpers/query/position"));
var {
useFocusWithin,
useInteractOutside
} = require("@react-aria/interactions");
var _domHelpersQueryScrollLeft = $parcel$interopDefault(require("dom-helpers/query/scrollLeft"));
var {
useLocale,
useMessageFormatter
} = require("@react-aria/i18n");
var _domHelpersQueryScrollTop = $parcel$interopDefault(require("dom-helpers/query/scrollTop"));
var _domHelpersOwnerDocument = $parcel$interopDefault(require("dom-helpers/ownerDocument"));
var _react2 = require("react");

@@ -21,21 +27,22 @@

var useEffect = _react2.useEffect;
var useState = _react2.useState;
var useContext = _react2.useContext;
var {
useCallback,
useEffect,
useState,
useContext
} = _react2;
var _temp = require("@react-aria/i18n");
var _domHelpersOwnerDocument = $parcel$interopDefault(require("dom-helpers/ownerDocument"));
var useLocale = _temp.useLocale;
var useMessageFormatter = _temp.useMessageFormatter;
var _domHelpersQueryScrollTop = $parcel$interopDefault(require("dom-helpers/query/scrollTop"));
var _temp2 = require("@react-aria/interactions");
var _domHelpersQueryScrollLeft = $parcel$interopDefault(require("dom-helpers/query/scrollLeft"));
var useFocusWithin = _temp2.useFocusWithin;
var useInteractOutside = _temp2.useInteractOutside;
var _domHelpersQueryPosition = $parcel$interopDefault(require("dom-helpers/query/position"));
var useId = require("@react-aria/utils").useId;
var _domHelpersQueryOffset = $parcel$interopDefault(require("dom-helpers/query/offset"));
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
var _domHelpersStyle = $parcel$interopDefault(require("dom-helpers/style"));
var VisuallyHidden = require("@react-aria/visually-hidden").VisuallyHidden;
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));

@@ -46,3 +53,3 @@ function $parcel$interopDefault(a) {

var $c71210c8e671eacb38d16acaa9713c$var$AXIS = {
const $c13020473a0fe27b1a1c4797269d1704$var$AXIS = {
top: 'top',

@@ -53,3 +60,3 @@ bottom: 'top',

};
var $c71210c8e671eacb38d16acaa9713c$var$FLIPPED_DIRECTION = {
const $c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION = {
top: 'bottom',

@@ -60,31 +67,31 @@ bottom: 'top',

};
var $c71210c8e671eacb38d16acaa9713c$var$CROSS_AXIS = {
const $c13020473a0fe27b1a1c4797269d1704$var$CROSS_AXIS = {
top: 'left',
left: 'top'
};
var $c71210c8e671eacb38d16acaa9713c$var$AXIS_SIZE = {
const $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE = {
top: 'height',
left: 'width'
};
var $c71210c8e671eacb38d16acaa9713c$var$PARSED_PLACEMENT_CACHE = {};
const $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE = {};
function $c71210c8e671eacb38d16acaa9713c$var$getContainerDimensions(containerNode) {
var width = 0,
function $c13020473a0fe27b1a1c4797269d1704$var$getContainerDimensions(containerNode) {
let width = 0,
height = 0,
top = 0,
left = 0;
var scroll = {};
let scroll = {};
if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
scroll.top = _domHelpersQueryScrollTop(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollTop(containerNode);
scroll.left = _domHelpersQueryScrollLeft(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollLeft(containerNode);
} else {
var _getOffset = _domHelpersQueryOffset(containerNode);
width = _getOffset.width;
height = _getOffset.height;
top = _getOffset.top;
left = _getOffset.left;
({
width,
height,
top,
left
} = _domHelpersQueryOffset(containerNode));
scroll.top = _domHelpersQueryScrollTop(containerNode);

@@ -95,11 +102,11 @@ scroll.left = _domHelpersQueryScrollLeft(containerNode);

return {
width: width,
height: height,
scroll: scroll,
top: top,
left: left
width,
height,
scroll,
top,
left
};
}
function $c71210c8e671eacb38d16acaa9713c$var$getScroll(node) {
function $c13020473a0fe27b1a1c4797269d1704$var$getScroll(node) {
return {

@@ -113,7 +120,7 @@ top: node.scrollTop,

function $c71210c8e671eacb38d16acaa9713c$var$getDelta(axis, offset, size, containerDimensions, padding) {
var containerScroll = containerDimensions.scroll[axis];
var containerHeight = containerDimensions[$c71210c8e671eacb38d16acaa9713c$var$AXIS_SIZE[axis]];
var startEdgeOffset = offset - padding - containerScroll;
var endEdgeOffset = offset + padding - containerScroll + size;
function $c13020473a0fe27b1a1c4797269d1704$var$getDelta(axis, offset, size, containerDimensions, padding) {
let containerScroll = containerDimensions.scroll[axis];
let containerHeight = containerDimensions[$c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[axis]];
let startEdgeOffset = offset - padding - containerScroll;
let endEdgeOffset = offset + padding - containerScroll + size;

@@ -129,4 +136,4 @@ if (startEdgeOffset < 0) {

function $c71210c8e671eacb38d16acaa9713c$var$getMargins(node) {
var style = window.getComputedStyle(node);
function $c13020473a0fe27b1a1c4797269d1704$var$getMargins(node) {
let style = window.getComputedStyle(node);
return {

@@ -140,40 +147,38 @@ top: parseInt(style.marginTop, 10) || 0,

function $c71210c8e671eacb38d16acaa9713c$var$parsePlacement(input) {
if ($c71210c8e671eacb38d16acaa9713c$var$PARSED_PLACEMENT_CACHE[input]) {
return $c71210c8e671eacb38d16acaa9713c$var$PARSED_PLACEMENT_CACHE[input];
function $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement(input) {
if ($c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input]) {
return $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input];
}
var _input$split = input.split(' '),
_input$split2 = _babelRuntimeHelpersSlicedToArray(_input$split, 2),
placement = _input$split2[0],
crossPlacement = _input$split2[1];
let [placement, crossPlacement] = input.split(' ');
let axis = $c13020473a0fe27b1a1c4797269d1704$var$AXIS[placement] || 'right';
let crossAxis = $c13020473a0fe27b1a1c4797269d1704$var$CROSS_AXIS[axis];
var axis = $c71210c8e671eacb38d16acaa9713c$var$AXIS[placement] || 'right';
var crossAxis = $c71210c8e671eacb38d16acaa9713c$var$CROSS_AXIS[axis];
if (!$c71210c8e671eacb38d16acaa9713c$var$AXIS[crossPlacement]) {
if (!$c13020473a0fe27b1a1c4797269d1704$var$AXIS[crossPlacement]) {
crossPlacement = 'center';
}
var size = $c71210c8e671eacb38d16acaa9713c$var$AXIS_SIZE[axis];
var crossSize = $c71210c8e671eacb38d16acaa9713c$var$AXIS_SIZE[crossAxis];
$c71210c8e671eacb38d16acaa9713c$var$PARSED_PLACEMENT_CACHE[input] = {
placement: placement,
crossPlacement: crossPlacement,
axis: axis,
crossAxis: crossAxis,
size: size,
crossSize: crossSize
let size = $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[axis];
let crossSize = $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[crossAxis];
$c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input] = {
placement,
crossPlacement,
axis,
crossAxis,
size,
crossSize
};
return $c71210c8e671eacb38d16acaa9713c$var$PARSED_PLACEMENT_CACHE[input];
return $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input];
}
function $c71210c8e671eacb38d16acaa9713c$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset) {
var placement = placementInfo.placement,
crossPlacement = placementInfo.crossPlacement,
axis = placementInfo.axis,
crossAxis = placementInfo.crossAxis,
size = placementInfo.size,
crossSize = placementInfo.crossSize;
var position = {};
function $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset) {
let {
placement,
crossPlacement,
axis,
crossAxis,
size,
crossSize
} = placementInfo;
let position = {};
position[crossAxis] = childOffset[crossAxis] + crossOffset;

@@ -189,3 +194,3 @@

if (childOffset[crossSize] < overlaySize[crossSize]) {
var positionForPositiveSideOverflow = Math.min(position[crossAxis], childOffset[crossAxis]);
let positionForPositiveSideOverflow = Math.min(position[crossAxis], childOffset[crossAxis]);
position[crossAxis] = Math.max(positionForPositiveSideOverflow, childOffset[crossAxis] - overlaySize[crossSize] + childOffset[crossSize]);

@@ -196,3 +201,3 @@ } // Floor these so the position isn't placed on a partial pixel, only whole pixels. Shouldn't matter if it was floored or ceiled, so chose one.

if (placement === axis) {
position[$c71210c8e671eacb38d16acaa9713c$var$FLIPPED_DIRECTION[axis]] = Math.floor(boundaryDimensions[size] - childOffset[axis] - offset);
position[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] = Math.floor(boundaryDimensions[size] - childOffset[axis] + offset);
} else {

@@ -205,34 +210,37 @@ position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);

function $c71210c8e671eacb38d16acaa9713c$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
function $c13020473a0fe27b1a1c4797269d1704$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top + containerOffsetWithBoundary.top - position.top - margins.top - margins.bottom - padding) : Math.max(0, childOffset.top - boundaryDimensions.top - boundaryDimensions.scroll.top - containerOffsetWithBoundary.top - margins.top - margins.bottom - padding);
}
function $c71210c8e671eacb38d16acaa9713c$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
var placement = placementInfo.placement,
axis = placementInfo.axis,
size = placementInfo.size;
function $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
let {
placement,
axis,
size
} = placementInfo;
if (placement === axis) {
return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$c71210c8e671eacb38d16acaa9713c$var$FLIPPED_DIRECTION[axis]] - padding);
return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] - padding);
}
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$c71210c8e671eacb38d16acaa9713c$var$FLIPPED_DIRECTION[axis]] - padding);
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] - padding);
}
function $c71210c8e671eacb38d16acaa9713c$export$calculatePositionInternal(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset) {
var placementInfo = $c71210c8e671eacb38d16acaa9713c$var$parsePlacement(placementInput);
var _placementInfo = placementInfo,
size = _placementInfo.size,
crossAxis = _placementInfo.crossAxis,
crossSize = _placementInfo.crossSize,
placement = _placementInfo.placement,
crossPlacement = _placementInfo.crossPlacement;
var position = $c71210c8e671eacb38d16acaa9713c$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset);
var normalizedOffset = offset;
var space = $c71210c8e671eacb38d16acaa9713c$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo); // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
function $c13020473a0fe27b1a1c4797269d1704$export$calculatePositionInternal(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset) {
let placementInfo = $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement(placementInput);
let {
size,
crossAxis,
crossSize,
placement,
crossPlacement
} = placementInfo;
let position = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset);
let normalizedOffset = offset;
let space = $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo); // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
if (flip && scrollSize[size] > space) {
var flippedPlacementInfo = $c71210c8e671eacb38d16acaa9713c$var$parsePlacement("".concat($c71210c8e671eacb38d16acaa9713c$var$FLIPPED_DIRECTION[placement], " ").concat(crossPlacement));
var flippedPosition = $c71210c8e671eacb38d16acaa9713c$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, -1 * offset, crossOffset);
var flippedSpace = $c71210c8e671eacb38d16acaa9713c$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo); // If the available space for the flipped position is greater than the original available space, flip.
let flippedPlacementInfo = $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement($c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[placement] + " " + crossPlacement);
let flippedPosition = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset);
let flippedSpace = $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo); // If the available space for the flipped position is greater than the original available space, flip.

@@ -242,17 +250,17 @@ if (flippedSpace > space) {

position = flippedPosition;
normalizedOffset = -1 * offset;
normalizedOffset = offset;
}
}
var delta = $c71210c8e671eacb38d16acaa9713c$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
let delta = $c13020473a0fe27b1a1c4797269d1704$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position[crossAxis] += delta;
var maxHeight = $c71210c8e671eacb38d16acaa9713c$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
let maxHeight = $c13020473a0fe27b1a1c4797269d1704$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
overlaySize.height = Math.min(overlaySize.height, maxHeight);
position = $c71210c8e671eacb38d16acaa9713c$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset);
delta = $c71210c8e671eacb38d16acaa9713c$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset);
delta = $c13020473a0fe27b1a1c4797269d1704$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position[crossAxis] += delta;
var arrowPosition = {};
let arrowPosition = {};
arrowPosition[crossAxis] = childOffset[crossSize] > overlaySize[crossSize] ? null : childOffset[crossAxis] - position[crossAxis] + childOffset[crossSize] / 2;
return {
position: position,
position,
maxHeight: maxHeight,

@@ -264,17 +272,23 @@ arrowOffsetLeft: arrowPosition.left,

}
/**
* Determines where to place the overlay with regards to the target and the position of an optional indicator.
*/
function $c71210c8e671eacb38d16acaa9713c$export$calculatePosition(opts) {
var placement = opts.placement,
targetNode = opts.targetNode,
overlayNode = opts.overlayNode,
scrollNode = opts.scrollNode,
padding = opts.padding,
shouldFlip = opts.shouldFlip,
boundaryElement = opts.boundaryElement,
offset = opts.offset,
crossOffset = opts.crossOffset;
var container = overlayNode.offsetParent || document.body;
var isBodyContainer = container.tagName === 'BODY';
var childOffset = isBodyContainer ? _domHelpersQueryOffset(targetNode) : _domHelpersQueryPosition(targetNode, container);
function $c13020473a0fe27b1a1c4797269d1704$export$calculatePosition(opts) {
let {
placement,
targetNode,
overlayNode,
scrollNode,
padding,
shouldFlip,
boundaryElement,
offset,
crossOffset
} = opts;
let container = overlayNode.offsetParent || document.body;
let isBodyContainer = container.tagName === 'BODY';
let childOffset = isBodyContainer ? _domHelpersQueryOffset(targetNode) : _domHelpersQueryPosition(targetNode, container);
if (!isBodyContainer) {

@@ -285,39 +299,35 @@ childOffset.top += parseInt(_domHelpersStyle(targetNode, 'marginTop'), 10) || 0;

var overlaySize = _domHelpersQueryOffset(overlayNode);
let overlaySize = _domHelpersQueryOffset(overlayNode);
var margins = $c71210c8e671eacb38d16acaa9713c$var$getMargins(overlayNode);
let margins = $c13020473a0fe27b1a1c4797269d1704$var$getMargins(overlayNode);
overlaySize.width += margins.left + margins.right;
overlaySize.height += margins.top + margins.bottom;
var scrollSize = $c71210c8e671eacb38d16acaa9713c$var$getScroll(scrollNode);
var boundaryDimensions = $c71210c8e671eacb38d16acaa9713c$var$getContainerDimensions(boundaryElement);
var containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? _domHelpersQueryOffset(container) : _domHelpersQueryPosition(container, boundaryElement);
return $c71210c8e671eacb38d16acaa9713c$export$calculatePositionInternal(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset);
let scrollSize = $c13020473a0fe27b1a1c4797269d1704$var$getScroll(scrollNode);
let boundaryDimensions = $c13020473a0fe27b1a1c4797269d1704$var$getContainerDimensions(boundaryElement);
let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? _domHelpersQueryOffset(container) : _domHelpersQueryPosition(container, boundaryElement);
return $c13020473a0fe27b1a1c4797269d1704$export$calculatePositionInternal(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset);
}
/**
* Handles positioning overlays like popovers and menus relative to a trigger
* element, and updating the position when the window resizes.
*/
function useOverlayPosition(props) {
var _useLocale = useLocale(),
direction = _useLocale.direction;
var targetRef = props.targetRef,
overlayRef = props.overlayRef,
_props$scrollRef = props.scrollRef,
scrollRef = _props$scrollRef === void 0 ? overlayRef : _props$scrollRef,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
_props$containerPaddi = props.containerPadding,
containerPadding = _props$containerPaddi === void 0 ? 12 : _props$containerPaddi,
_props$shouldFlip = props.shouldFlip,
shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip,
_props$boundaryElemen = props.boundaryElement,
boundaryElement = _props$boundaryElemen === void 0 ? document.body : _props$boundaryElemen,
_props$offset = props.offset,
offset = _props$offset === void 0 ? 0 : _props$offset,
_props$crossOffset = props.crossOffset,
crossOffset = _props$crossOffset === void 0 ? 0 : _props$crossOffset,
_props$shouldUpdatePo = props.shouldUpdatePosition,
shouldUpdatePosition = _props$shouldUpdatePo === void 0 ? true : _props$shouldUpdatePo,
_props$isOpen = props.isOpen,
isOpen = _props$isOpen === void 0 ? true : _props$isOpen;
var _useState = useState({
let {
direction
} = useLocale();
let {
targetRef,
overlayRef,
scrollRef = overlayRef,
placement = 'bottom',
containerPadding = 12,
shouldFlip = true,
boundaryElement = typeof document !== 'undefined' ? document.body : null,
offset = 0,
crossOffset = 0,
shouldUpdatePosition = true,
isOpen = true
} = props;
let [position, setPosition] = useState({
position: {},

@@ -328,16 +338,11 @@ arrowOffsetLeft: undefined,

placement: undefined
}),
_useState2 = _babelRuntimeHelpersSlicedToArray(_useState, 2),
position = _useState2[0],
setPosition = _useState2[1];
var deps = [shouldUpdatePosition, placement, overlayRef.current, targetRef.current, scrollRef.current, containerPadding, shouldFlip, boundaryElement, offset, crossOffset, isOpen, direction];
var updatePosition = function updatePosition() {
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current) {
});
let deps = [shouldUpdatePosition, placement, overlayRef.current, targetRef.current, scrollRef.current, containerPadding, shouldFlip, boundaryElement, offset, crossOffset, isOpen, direction];
let updatePosition = useCallback(() => {
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) {
return;
}
setPosition($c71210c8e671eacb38d16acaa9713c$export$calculatePosition({
placement: $bbbcb442362e3abca1b1d54b0282db6$var$translateRTL(placement, direction),
setPosition($c13020473a0fe27b1a1c4797269d1704$export$calculatePosition({
placement: $adfbd034e9bc71c1$var$translateRTL(placement, direction),
overlayNode: overlayRef.current,

@@ -347,16 +352,15 @@ targetNode: targetRef.current,

padding: containerPadding,
shouldFlip: shouldFlip,
boundaryElement: boundaryElement,
offset: offset,
crossOffset: crossOffset
shouldFlip,
boundaryElement,
offset,
crossOffset
}));
}; // Update position when anything changes
}, deps); // Update position when anything changes
useEffect(updatePosition, deps); // Update position on window resize
$bbbcb442362e3abca1b1d54b0282db6$var$useResize(updatePosition);
$adfbd034e9bc71c1$var$useResize(updatePosition);
return {
overlayProps: {
style: _babelRuntimeHelpersObjectSpread({
style: _babelRuntimeHelpersExtends({
position: 'absolute',

@@ -374,3 +378,4 @@ zIndex: 100000

}
}
},
updatePosition
};

@@ -381,6 +386,6 @@ }

function $bbbcb442362e3abca1b1d54b0282db6$var$useResize(onResize) {
useEffect(function () {
function $adfbd034e9bc71c1$var$useResize(onResize) {
useEffect(() => {
window.addEventListener('resize', onResize, false);
return function () {
return () => {
window.removeEventListener('resize', onResize, false);

@@ -391,3 +396,3 @@ };

function $bbbcb442362e3abca1b1d54b0282db6$var$translateRTL(position, direction) {
function $adfbd034e9bc71c1$var$translateRTL(position, direction) {
if (direction === 'rtl') {

@@ -400,22 +405,29 @@ return position.replace('start', 'right').replace('end', 'left');

var $c8bcdeb24249303262637ef18287e$var$visibleOverlays = [];
const $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays = [];
/**
* Provides the behavior for overlays such as dialogs, popovers, and menus.
* Hides the overlay when the user interacts outside it, when the Escape key is pressed,
* or optionally, on blur. Only the top-most overlay will close at once.
*/
function useOverlay(props) {
var ref = props.ref,
onClose = props.onClose,
shouldCloseOnBlur = props.shouldCloseOnBlur,
isOpen = props.isOpen,
_props$isDismissable = props.isDismissable,
isDismissable = _props$isDismissable === void 0 ? false : _props$isDismissable; // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
function useOverlay(props, ref) {
let {
onClose,
shouldCloseOnBlur,
isOpen,
isDismissable = false,
isKeyboardDismissDisabled = false,
shouldCloseOnInteractOutside
} = props; // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
useEffect(function () {
useEffect(() => {
if (isOpen) {
$c8bcdeb24249303262637ef18287e$var$visibleOverlays.push(ref);
$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.push(ref);
}
return function () {
var index = $c8bcdeb24249303262637ef18287e$var$visibleOverlays.indexOf(ref);
return () => {
let index = $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.indexOf(ref);
if (index >= 0) {
$c8bcdeb24249303262637ef18287e$var$visibleOverlays.splice(index, 1);
$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.splice(index, 1);
}

@@ -425,11 +437,17 @@ };

var onHide = function onHide() {
if ($c8bcdeb24249303262637ef18287e$var$visibleOverlays[$c8bcdeb24249303262637ef18287e$var$visibleOverlays.length - 1] === ref && onClose) {
let onHide = () => {
if ($a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays[$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.length - 1] === ref && onClose) {
onClose();
}
};
let onInteractOutside = e => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
onHide();
}
}; // Handle the escape key
var onKeyDown = function onKeyDown(e) {
if (e.key === 'Escape') {
let onKeyDown = e => {
if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
e.preventDefault();

@@ -442,17 +460,18 @@ onHide();

useInteractOutside({
ref: ref,
onInteractOutside: isDismissable ? onHide : null
ref,
onInteractOutside: isDismissable ? onInteractOutside : null
});
var _useFocusWithin = useFocusWithin({
let {
focusWithinProps
} = useFocusWithin({
isDisabled: !shouldCloseOnBlur,
onBlurWithin: function onBlurWithin() {
onClose();
onBlurWithin: e => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) {
onClose();
}
}
}),
focusWithinProps = _useFocusWithin.focusWithinProps;
});
return {
overlayProps: _babelRuntimeHelpersObjectSpread({
onKeyDown: onKeyDown
overlayProps: _babelRuntimeHelpersExtends({
onKeyDown
}, focusWithinProps)

@@ -464,10 +483,16 @@ };

function useOverlayTrigger(props) {
var ref = props.ref,
type = props.type,
onClose = props.onClose,
isOpen = props.isOpen; // When scrolling a parent scrollable region of the trigger (other than the body),
/**
* Handles the behavior and accessibility for an overlay trigger, e.g. a button
* that opens a popover, menu, or other overlay that is positioned relative to the trigger.
*/
function useOverlayTrigger(props, state, ref) {
let {
type
} = props;
let {
isOpen
} = state; // When scrolling a parent scrollable region of the trigger (other than the body),
// we hide the popover. Otherwise, its position would be incorrect.
useEffect(function () {
useEffect(() => {
if (!isOpen) {

@@ -477,5 +502,5 @@ return;

var onScroll = function onScroll(e) {
let onScroll = e => {
// Ignore if scrolling an scrollable region outside the trigger's tree.
var target = e.target;
let target = e.target;

@@ -486,17 +511,15 @@ if (!ref.current || !target.contains(ref.current)) {

if (onClose) {
onClose();
}
state.close();
};
window.addEventListener('scroll', onScroll, true);
return function () {
return () => {
window.removeEventListener('scroll', onScroll, true);
};
}, [isOpen, onClose, ref]); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
}, [isOpen, ref]); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
// https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
// However, we only add it for menus for now because screen readers often
// However, we only add it for menus for now because screen readers often
// announce it as a menu even for other values.
var ariaHasPopup = undefined;
let ariaHasPopup = undefined;

@@ -509,3 +532,3 @@ if (type === 'menu') {

var overlayId = useId();
let overlayId = useId();
return {

@@ -525,10 +548,14 @@ triggerProps: {

/**
* Prevents scrolling on the document body on mount, and
* restores it on unmount. Also ensures that content does not
* shift due to the scrollbars disappearing.
*/
function usePreventScroll() {
// Add overflow: hidden to the body on mount, and restore on unmount.
useEffect(function () {
var overflow = document.body.style.overflow;
var paddingRight = document.body.style.paddingRight;
useEffect(() => {
let overflow = document.body.style.overflow;
let paddingRight = document.body.style.paddingRight;
document.body.style.paddingRight = window.innerWidth - document.documentElement.clientWidth + 'px';
document.body.style.overflow = 'hidden';
return function () {
return () => {
document.body.style.overflow = overflow;

@@ -542,28 +569,26 @@ document.body.style.paddingRight = paddingRight;

var $ba69ad1f216584417ad7a03be330d7$var$Context = _react.createContext(null); // Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
// trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
// This is done recursively so that all parent providers are incremented and decremented.
// If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
// subtree from screen readers. This is done using React context in order to account for things
// like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
// TODO: maybe move this?
const $c5f9596976ab8bd94c5879001549a3e$var$Context = _react.createContext(null);
/**
* Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
* trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
* This is done recursively so that all parent providers are incremented and decremented.
* If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
* subtree from screen readers. This is done using React context in order to account for things
* like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
*/
function ModalProvider(props) {
var children = props.children;
var parent = useContext($ba69ad1f216584417ad7a03be330d7$var$Context);
let {
children
} = props;
let parent = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);
let [modalCount, setModalCount] = useState(parent ? parent.modalCount : 0);
let context = {
parent,
modalCount,
var _useState = useState(parent ? parent.modalCount : 0),
_useState2 = _babelRuntimeHelpersSlicedToArray(_useState, 2),
modalCount = _useState2[0],
setModalCount = _useState2[1];
addModal() {
setModalCount(count => count + 1);
var context = {
parent: parent,
modalCount: modalCount,
addModal: function addModal() {
setModalCount(function (count) {
return count + 1;
});
if (parent) {

@@ -573,7 +598,6 @@ parent.addModal();

},
removeModal: function removeModal() {
setModalCount(function (count) {
return count - 1;
});
removeModal() {
setModalCount(count => count - 1);
if (parent) {

@@ -583,7 +607,7 @@ parent.removeModal();

}
};
return (/*#__PURE__*/_react.createElement($ba69ad1f216584417ad7a03be330d7$var$Context.Provider, {
value: context
}, children)
);
return /*#__PURE__*/_react.createElement($c5f9596976ab8bd94c5879001549a3e$var$Context.Provider, {
value: context
}, children);
}

@@ -593,4 +617,8 @@

/**
* Used to determine if the tree should be aria-hidden based on how many
* modals are open.
*/
function useModalProvider() {
var context = useContext($ba69ad1f216584417ad7a03be330d7$var$Context);
let context = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);
return {

@@ -602,8 +630,56 @@ modalProviderProps: {

}
/**
* Creates a root node that will be aria-hidden if there are other modals open.
*/
exports.useModalProvider = useModalProvider;
function $c5f9596976ab8bd94c5879001549a3e$var$OverlayContainerDOM(props) {
let {
modalProviderProps
} = useModalProvider();
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, props, modalProviderProps));
}
/**
* An OverlayProvider acts as a container for the top-level application.
* Any application that uses modal dialogs or other overlays should
* be wrapped in a `<OverlayProvider>`. This is used to ensure that
* the main content of the application is hidden from screen readers
* if a modal or other overlay is opened. Only the top-most modal or
* overlay should be accessible at once.
*/
function OverlayProvider(props) {
return /*#__PURE__*/_react.createElement(ModalProvider, null, /*#__PURE__*/_react.createElement($c5f9596976ab8bd94c5879001549a3e$var$OverlayContainerDOM, props));
}
/**
* A container for overlays like modals and popovers. Renders the overlay
* into a Portal which is placed at the end of the document body.
* Also ensures that the overlay is hidden from screen readers if a
* nested modal is opened. Only the top-most modal or overlay should
* be accessible at once.
*/
exports.OverlayProvider = OverlayProvider;
function OverlayContainer(props) {
let contents = /*#__PURE__*/_react.createElement(OverlayProvider, props);
return _reactDom.createPortal(contents, document.body);
}
exports.OverlayContainer = OverlayContainer;
/**
* Hides content outside the current `<OverlayContainer>` from screen readers
* on mount and restores it on unmount. Typically used by modal dialogs and
* other types of overlays to ensure that only the top-most modal is
* accessible at once.
*/
function useModal() {
// Add aria-hidden to all parent providers on mount, and restore on unmount.
var context = useContext($ba69ad1f216584417ad7a03be330d7$var$Context);
let context = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);

@@ -614,3 +690,3 @@ if (!context) {

useEffect(function () {
useEffect(() => {
if (!context || !context.parent) {

@@ -623,3 +699,3 @@ return;

context.parent.addModal();
return function () {
return () => {
if (context && context.parent) {

@@ -630,8 +706,109 @@ context.parent.removeModal();

}, [context, context.parent]);
return {
modalProps: {
'data-ismodal': true
}
};
}
exports.useModal = useModal;
// ASSET: /Users/govett/dev/react-spectrum/packages/@react-aria/overlays/intl/en-US.json
var $e6ccb56748e38458ac53f3f41e894$exports = {};
$e6ccb56748e38458ac53f3f41e894$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ar-AE.json
var $a8bb21dadcfaad10bb0a0bcf2b281764$exports = {};
$a8bb21dadcfaad10bb0a0bcf2b281764$exports = JSON.parse("{\"dismiss\":\"تجاهل\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/bg-BG.json
var $dafefe57ee4fa5270277199b63666456$exports = {};
$dafefe57ee4fa5270277199b63666456$exports = JSON.parse("{\"dismiss\":\"Отхвърляне\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/cs-CZ.json
var $c2158ac3aac63d05c0787f91c5e6$exports = {};
$c2158ac3aac63d05c0787f91c5e6$exports = JSON.parse("{\"dismiss\":\"Odstranit\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/da-DK.json
var $f7aea96abdaae1eb301c63fe67ff9fa$exports = {};
$f7aea96abdaae1eb301c63fe67ff9fa$exports = JSON.parse("{\"dismiss\":\"Luk\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/de-DE.json
var $f3491c664171e6b5e47db3baca390e$exports = {};
$f3491c664171e6b5e47db3baca390e$exports = JSON.parse("{\"dismiss\":\"Schließen\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/el-GR.json
var $da631def8a53d3d7ca63b5a989a2$exports = {};
$da631def8a53d3d7ca63b5a989a2$exports = JSON.parse("{\"dismiss\":\"Απόρριψη\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/en-US.json
var $fb4c477a38a74b935d35db24ae7$exports = {};
$fb4c477a38a74b935d35db24ae7$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/es-ES.json
var $b6fd69f9d5c0d1736b0ffb60159dbd4$exports = {};
$b6fd69f9d5c0d1736b0ffb60159dbd4$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/et-EE.json
var $ba5713ed42715892c62c91f4a61185db$exports = {};
$ba5713ed42715892c62c91f4a61185db$exports = JSON.parse("{\"dismiss\":\"Lõpeta\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/fi-FI.json
var $d425c7f620a7cd6fec958b2d805b4748$exports = {};
$d425c7f620a7cd6fec958b2d805b4748$exports = JSON.parse("{\"dismiss\":\"Hylkää\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/fr-FR.json
var $a53b9b9e4ee3c32689ca1c9d37$exports = {};
$a53b9b9e4ee3c32689ca1c9d37$exports = JSON.parse("{\"dismiss\":\"Rejeter\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/he-IL.json
var $c53806192c6b46eb32dc82efae908cb$exports = {};
$c53806192c6b46eb32dc82efae908cb$exports = JSON.parse("{\"dismiss\":\"התעלם\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/hr-HR.json
var $cbbca9d8ba35e50d9d74ddc492ac95d5$exports = {};
$cbbca9d8ba35e50d9d74ddc492ac95d5$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/hu-HU.json
var $b6e1f06770a0ad8a02049cb304d$exports = {};
$b6e1f06770a0ad8a02049cb304d$exports = JSON.parse("{\"dismiss\":\"Elutasítás\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/it-IT.json
var $b6c1d31d04e4e80df25d89ebefb38d6c$exports = {};
$b6c1d31d04e4e80df25d89ebefb38d6c$exports = JSON.parse("{\"dismiss\":\"Ignora\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ja-JP.json
var $a858c6dc87cf51add44cd600186b$exports = {};
$a858c6dc87cf51add44cd600186b$exports = JSON.parse("{\"dismiss\":\"閉じる\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ko-KR.json
var $bce3a6596f5d6bce7af4e1cdfe714b9$exports = {};
$bce3a6596f5d6bce7af4e1cdfe714b9$exports = JSON.parse("{\"dismiss\":\"무시\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/lt-LT.json
var $a80424d4da258b90efdca51671420e98$exports = {};
$a80424d4da258b90efdca51671420e98$exports = JSON.parse("{\"dismiss\":\"Atmesti\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/lv-LV.json
var $b7b9bc8c0cfc6eec9fa971e7b25cd656$exports = {};
$b7b9bc8c0cfc6eec9fa971e7b25cd656$exports = JSON.parse("{\"dismiss\":\"Nerādīt\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/nb-NO.json
var $e985758bae9fabb24500c21a0a00b725$exports = {};
$e985758bae9fabb24500c21a0a00b725$exports = JSON.parse("{\"dismiss\":\"Lukk\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/nl-NL.json
var $f05d419963f6daeda3bc9dbbe3cc02bd$exports = {};
$f05d419963f6daeda3bc9dbbe3cc02bd$exports = JSON.parse("{\"dismiss\":\"Negeren\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/pl-PL.json
var $c8fa3e85daf6d04ed07583e629c87ce4$exports = {};
$c8fa3e85daf6d04ed07583e629c87ce4$exports = JSON.parse("{\"dismiss\":\"Zignoruj\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/pt-BR.json
var $f06e8ad24001ed35ea808810226a15$exports = {};
$f06e8ad24001ed35ea808810226a15$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ro-RO.json
var $a20ad400f1086b2bea7f9791d7257ad$exports = {};
$a20ad400f1086b2bea7f9791d7257ad$exports = JSON.parse("{\"dismiss\":\"Revocare\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ru-RU.json
var $fc28441a9133071c2297a09b6b420dd$exports = {};
$fc28441a9133071c2297a09b6b420dd$exports = JSON.parse("{\"dismiss\":\"Пропустить\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sk-SK.json
var $a91ecad4479ad50b50aa177a2506dc$exports = {};
$a91ecad4479ad50b50aa177a2506dc$exports = JSON.parse("{\"dismiss\":\"Zrušiť\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sl-SI.json
var $f9693ead50748c9beb107ad23956eb9$exports = {};
$f9693ead50748c9beb107ad23956eb9$exports = JSON.parse("{\"dismiss\":\"Opusti\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sr-SP.json
var $b5e22101ce830f7d95581df69464b$exports = {};
$b5e22101ce830f7d95581df69464b$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sv-SE.json
var $c0b006e739315f2d0109fd704d505d4d$exports = {};
$c0b006e739315f2d0109fd704d505d4d$exports = JSON.parse("{\"dismiss\":\"Avvisa\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/tr-TR.json
var $b2fcb8208d40a3677791cb274f5c23$exports = {};
$b2fcb8208d40a3677791cb274f5c23$exports = JSON.parse("{\"dismiss\":\"Kapat\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/uk-UA.json
var $bedf08a338a4a9658a5b3265b7ba64$exports = {};
$bedf08a338a4a9658a5b3265b7ba64$exports = JSON.parse("{\"dismiss\":\"Скасувати\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/zh-CN.json
var $b49f1939211bfd9e1f4f626061efad44$exports = {};
$b49f1939211bfd9e1f4f626061efad44$exports = JSON.parse("{\"dismiss\":\"取消\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/zh-TW.json
var $a878720d2a5fd83cfd5a0f74b64957e$exports = {};
$a878720d2a5fd83cfd5a0f74b64957e$exports = JSON.parse("{\"dismiss\":\"關閉\"}");

@@ -650,11 +827,50 @@ /*

// @ts-ignore
var $dc1d75ab9958d677be46b941d9a53f2$var$intlMessages = {
"en-US": _babelRuntimeHelpersInteropRequireDefault($e6ccb56748e38458ac53f3f41e894$exports).default
const $e0a65de2c0deb9a27bf483be129a43c1$var$intlMessages = {
"ar-AE": _babelRuntimeHelpersInteropRequireDefault($a8bb21dadcfaad10bb0a0bcf2b281764$exports).default,
"bg-BG": _babelRuntimeHelpersInteropRequireDefault($dafefe57ee4fa5270277199b63666456$exports).default,
"cs-CZ": _babelRuntimeHelpersInteropRequireDefault($c2158ac3aac63d05c0787f91c5e6$exports).default,
"da-DK": _babelRuntimeHelpersInteropRequireDefault($f7aea96abdaae1eb301c63fe67ff9fa$exports).default,
"de-DE": _babelRuntimeHelpersInteropRequireDefault($f3491c664171e6b5e47db3baca390e$exports).default,
"el-GR": _babelRuntimeHelpersInteropRequireDefault($da631def8a53d3d7ca63b5a989a2$exports).default,
"en-US": _babelRuntimeHelpersInteropRequireDefault($fb4c477a38a74b935d35db24ae7$exports).default,
"es-ES": _babelRuntimeHelpersInteropRequireDefault($b6fd69f9d5c0d1736b0ffb60159dbd4$exports).default,
"et-EE": _babelRuntimeHelpersInteropRequireDefault($ba5713ed42715892c62c91f4a61185db$exports).default,
"fi-FI": _babelRuntimeHelpersInteropRequireDefault($d425c7f620a7cd6fec958b2d805b4748$exports).default,
"fr-FR": _babelRuntimeHelpersInteropRequireDefault($a53b9b9e4ee3c32689ca1c9d37$exports).default,
"he-IL": _babelRuntimeHelpersInteropRequireDefault($c53806192c6b46eb32dc82efae908cb$exports).default,
"hr-HR": _babelRuntimeHelpersInteropRequireDefault($cbbca9d8ba35e50d9d74ddc492ac95d5$exports).default,
"hu-HU": _babelRuntimeHelpersInteropRequireDefault($b6e1f06770a0ad8a02049cb304d$exports).default,
"it-IT": _babelRuntimeHelpersInteropRequireDefault($b6c1d31d04e4e80df25d89ebefb38d6c$exports).default,
"ja-JP": _babelRuntimeHelpersInteropRequireDefault($a858c6dc87cf51add44cd600186b$exports).default,
"ko-KR": _babelRuntimeHelpersInteropRequireDefault($bce3a6596f5d6bce7af4e1cdfe714b9$exports).default,
"lt-LT": _babelRuntimeHelpersInteropRequireDefault($a80424d4da258b90efdca51671420e98$exports).default,
"lv-LV": _babelRuntimeHelpersInteropRequireDefault($b7b9bc8c0cfc6eec9fa971e7b25cd656$exports).default,
"nb-NO": _babelRuntimeHelpersInteropRequireDefault($e985758bae9fabb24500c21a0a00b725$exports).default,
"nl-NL": _babelRuntimeHelpersInteropRequireDefault($f05d419963f6daeda3bc9dbbe3cc02bd$exports).default,
"pl-PL": _babelRuntimeHelpersInteropRequireDefault($c8fa3e85daf6d04ed07583e629c87ce4$exports).default,
"pt-BR": _babelRuntimeHelpersInteropRequireDefault($f06e8ad24001ed35ea808810226a15$exports).default,
"ro-RO": _babelRuntimeHelpersInteropRequireDefault($a20ad400f1086b2bea7f9791d7257ad$exports).default,
"ru-RU": _babelRuntimeHelpersInteropRequireDefault($fc28441a9133071c2297a09b6b420dd$exports).default,
"sk-SK": _babelRuntimeHelpersInteropRequireDefault($a91ecad4479ad50b50aa177a2506dc$exports).default,
"sl-SI": _babelRuntimeHelpersInteropRequireDefault($f9693ead50748c9beb107ad23956eb9$exports).default,
"sr-SP": _babelRuntimeHelpersInteropRequireDefault($b5e22101ce830f7d95581df69464b$exports).default,
"sv-SE": _babelRuntimeHelpersInteropRequireDefault($c0b006e739315f2d0109fd704d505d4d$exports).default,
"tr-TR": _babelRuntimeHelpersInteropRequireDefault($b2fcb8208d40a3677791cb274f5c23$exports).default,
"uk-UA": _babelRuntimeHelpersInteropRequireDefault($bedf08a338a4a9658a5b3265b7ba64$exports).default,
"zh-CN": _babelRuntimeHelpersInteropRequireDefault($b49f1939211bfd9e1f4f626061efad44$exports).default,
"zh-TW": _babelRuntimeHelpersInteropRequireDefault($a878720d2a5fd83cfd5a0f74b64957e$exports).default
};
/**
* A visually hidden button that can be used to allow screen reader
* users to dismiss a modal or popup when there is no visual
* affordance to do so.
*/
function DismissButton(props) {
var onDismiss = props.onDismiss;
var formatMessage = useMessageFormatter($dc1d75ab9958d677be46b941d9a53f2$var$intlMessages);
let {
onDismiss
} = props;
let formatMessage = useMessageFormatter($e0a65de2c0deb9a27bf483be129a43c1$var$intlMessages);
var onClick = function onClick() {
let onClick = () => {
if (onDismiss) {

@@ -665,10 +881,10 @@ onDismiss();

return (/*#__PURE__*/_react.createElement(VisuallyHidden, null, /*#__PURE__*/_react.createElement("button", {
tabIndex: -1,
"aria-label": formatMessage('dismiss'),
onClick: onClick
}))
);
return /*#__PURE__*/_react.createElement(VisuallyHidden, null, /*#__PURE__*/_react.createElement("button", {
tabIndex: -1,
"aria-label": formatMessage('dismiss'),
onClick: onClick
}));
}
exports.DismissButton = DismissButton;
exports.DismissButton = DismissButton;
//# sourceMappingURL=main.js.map

@@ -1,15 +0,16 @@

import _babelRuntimeHelpersEsmObjectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { VisuallyHidden } from "@react-aria/visually-hidden";
import _babelRuntimeHelpersEsmInteropRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault";
import _reactDom from "react-dom";
import { useId } from "@react-aria/utils";
import { useFocusWithin, useInteractOutside } from "@react-aria/interactions";
import { useLocale, useMessageFormatter } from "@react-aria/i18n";
import _react, { useCallback, useEffect, useState, useContext } from "react";
import _domHelpersOwnerDocument from "dom-helpers/ownerDocument";
import _domHelpersQueryScrollTop from "dom-helpers/query/scrollTop";
import _domHelpersQueryScrollLeft from "dom-helpers/query/scrollLeft";
import _domHelpersQueryPosition from "dom-helpers/query/position";
import _domHelpersQueryOffset from "dom-helpers/query/offset";
import _domHelpersStyle from "dom-helpers/style";
import _domHelpersQueryOffset from "dom-helpers/query/offset";
import _domHelpersQueryPosition from "dom-helpers/query/position";
import _domHelpersQueryScrollLeft from "dom-helpers/query/scrollLeft";
import _domHelpersQueryScrollTop from "dom-helpers/query/scrollTop";
import _domHelpersOwnerDocument from "dom-helpers/ownerDocument";
import _react, { useEffect, useState, useContext } from "react";
import { useLocale, useMessageFormatter } from "@react-aria/i18n";
import { useFocusWithin, useInteractOutside } from "@react-aria/interactions";
import { useId } from "@react-aria/utils";
import _babelRuntimeHelpersEsmInteropRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault";
import { VisuallyHidden } from "@react-aria/visually-hidden";
const $a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS = {
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
const $d45e305fb90d49e7c81f49bb4afe323b$var$AXIS = {
top: 'top',

@@ -20,3 +21,3 @@ bottom: 'top',

};
const $a7a15b8408ba1e3bb5fd405f8090c511$var$FLIPPED_DIRECTION = {
const $d45e305fb90d49e7c81f49bb4afe323b$var$FLIPPED_DIRECTION = {
top: 'bottom',

@@ -27,13 +28,13 @@ bottom: 'top',

};
const $a7a15b8408ba1e3bb5fd405f8090c511$var$CROSS_AXIS = {
const $d45e305fb90d49e7c81f49bb4afe323b$var$CROSS_AXIS = {
top: 'left',
left: 'top'
};
const $a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS_SIZE = {
const $d45e305fb90d49e7c81f49bb4afe323b$var$AXIS_SIZE = {
top: 'height',
left: 'width'
};
const $a7a15b8408ba1e3bb5fd405f8090c511$var$PARSED_PLACEMENT_CACHE = {};
const $d45e305fb90d49e7c81f49bb4afe323b$var$PARSED_PLACEMENT_CACHE = {};
function $a7a15b8408ba1e3bb5fd405f8090c511$var$getContainerDimensions(containerNode) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getContainerDimensions(containerNode) {
let width = 0,

@@ -46,4 +47,4 @@ height = 0,

if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
scroll.top = _domHelpersQueryScrollTop(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollTop(containerNode);

@@ -71,3 +72,3 @@ scroll.left = _domHelpersQueryScrollLeft(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollLeft(containerNode);

function $a7a15b8408ba1e3bb5fd405f8090c511$var$getScroll(node) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getScroll(node) {
return {

@@ -81,5 +82,5 @@ top: node.scrollTop,

function $a7a15b8408ba1e3bb5fd405f8090c511$var$getDelta(axis, offset, size, containerDimensions, padding) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getDelta(axis, offset, size, containerDimensions, padding) {
let containerScroll = containerDimensions.scroll[axis];
let containerHeight = containerDimensions[$a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS_SIZE[axis]];
let containerHeight = containerDimensions[$d45e305fb90d49e7c81f49bb4afe323b$var$AXIS_SIZE[axis]];
let startEdgeOffset = offset - padding - containerScroll;

@@ -97,3 +98,3 @@ let endEdgeOffset = offset + padding - containerScroll + size;

function $a7a15b8408ba1e3bb5fd405f8090c511$var$getMargins(node) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getMargins(node) {
let style = window.getComputedStyle(node);

@@ -108,18 +109,18 @@ return {

function $a7a15b8408ba1e3bb5fd405f8090c511$var$parsePlacement(input) {
if ($a7a15b8408ba1e3bb5fd405f8090c511$var$PARSED_PLACEMENT_CACHE[input]) {
return $a7a15b8408ba1e3bb5fd405f8090c511$var$PARSED_PLACEMENT_CACHE[input];
function $d45e305fb90d49e7c81f49bb4afe323b$var$parsePlacement(input) {
if ($d45e305fb90d49e7c81f49bb4afe323b$var$PARSED_PLACEMENT_CACHE[input]) {
return $d45e305fb90d49e7c81f49bb4afe323b$var$PARSED_PLACEMENT_CACHE[input];
}
let [placement, crossPlacement] = input.split(' ');
let axis = $a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS[placement] || 'right';
let crossAxis = $a7a15b8408ba1e3bb5fd405f8090c511$var$CROSS_AXIS[axis];
let axis = $d45e305fb90d49e7c81f49bb4afe323b$var$AXIS[placement] || 'right';
let crossAxis = $d45e305fb90d49e7c81f49bb4afe323b$var$CROSS_AXIS[axis];
if (!$a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS[crossPlacement]) {
if (!$d45e305fb90d49e7c81f49bb4afe323b$var$AXIS[crossPlacement]) {
crossPlacement = 'center';
}
let size = $a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS_SIZE[axis];
let crossSize = $a7a15b8408ba1e3bb5fd405f8090c511$var$AXIS_SIZE[crossAxis];
$a7a15b8408ba1e3bb5fd405f8090c511$var$PARSED_PLACEMENT_CACHE[input] = {
let size = $d45e305fb90d49e7c81f49bb4afe323b$var$AXIS_SIZE[axis];
let crossSize = $d45e305fb90d49e7c81f49bb4afe323b$var$AXIS_SIZE[crossAxis];
$d45e305fb90d49e7c81f49bb4afe323b$var$PARSED_PLACEMENT_CACHE[input] = {
placement,

@@ -132,6 +133,6 @@ crossPlacement,

};
return $a7a15b8408ba1e3bb5fd405f8090c511$var$PARSED_PLACEMENT_CACHE[input];
return $d45e305fb90d49e7c81f49bb4afe323b$var$PARSED_PLACEMENT_CACHE[input];
}
function $a7a15b8408ba1e3bb5fd405f8090c511$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset) {
let {

@@ -162,3 +163,3 @@ placement,

if (placement === axis) {
position[$a7a15b8408ba1e3bb5fd405f8090c511$var$FLIPPED_DIRECTION[axis]] = Math.floor(boundaryDimensions[size] - childOffset[axis] - offset);
position[$d45e305fb90d49e7c81f49bb4afe323b$var$FLIPPED_DIRECTION[axis]] = Math.floor(boundaryDimensions[size] - childOffset[axis] + offset);
} else {

@@ -171,7 +172,7 @@ position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);

function $a7a15b8408ba1e3bb5fd405f8090c511$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top + containerOffsetWithBoundary.top - position.top - margins.top - margins.bottom - padding) : Math.max(0, childOffset.top - boundaryDimensions.top - boundaryDimensions.scroll.top - containerOffsetWithBoundary.top - margins.top - margins.bottom - padding);
}
function $a7a15b8408ba1e3bb5fd405f8090c511$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
function $d45e305fb90d49e7c81f49bb4afe323b$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
let {

@@ -184,10 +185,10 @@ placement,

if (placement === axis) {
return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$a7a15b8408ba1e3bb5fd405f8090c511$var$FLIPPED_DIRECTION[axis]] - padding);
return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$d45e305fb90d49e7c81f49bb4afe323b$var$FLIPPED_DIRECTION[axis]] - padding);
}
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$a7a15b8408ba1e3bb5fd405f8090c511$var$FLIPPED_DIRECTION[axis]] - padding);
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$d45e305fb90d49e7c81f49bb4afe323b$var$FLIPPED_DIRECTION[axis]] - padding);
}
function $a7a15b8408ba1e3bb5fd405f8090c511$export$calculatePositionInternal(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset) {
let placementInfo = $a7a15b8408ba1e3bb5fd405f8090c511$var$parsePlacement(placementInput);
function $d45e305fb90d49e7c81f49bb4afe323b$export$calculatePositionInternal(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset) {
let placementInfo = $d45e305fb90d49e7c81f49bb4afe323b$var$parsePlacement(placementInput);
let {

@@ -200,10 +201,10 @@ size,

} = placementInfo;
let position = $a7a15b8408ba1e3bb5fd405f8090c511$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset);
let position = $d45e305fb90d49e7c81f49bb4afe323b$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset);
let normalizedOffset = offset;
let space = $a7a15b8408ba1e3bb5fd405f8090c511$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo); // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
let space = $d45e305fb90d49e7c81f49bb4afe323b$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo); // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
if (flip && scrollSize[size] > space) {
let flippedPlacementInfo = $a7a15b8408ba1e3bb5fd405f8090c511$var$parsePlacement("".concat($a7a15b8408ba1e3bb5fd405f8090c511$var$FLIPPED_DIRECTION[placement], " ").concat(crossPlacement));
let flippedPosition = $a7a15b8408ba1e3bb5fd405f8090c511$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, -1 * offset, crossOffset);
let flippedSpace = $a7a15b8408ba1e3bb5fd405f8090c511$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo); // If the available space for the flipped position is greater than the original available space, flip.
let flippedPlacementInfo = $d45e305fb90d49e7c81f49bb4afe323b$var$parsePlacement($d45e305fb90d49e7c81f49bb4afe323b$var$FLIPPED_DIRECTION[placement] + " " + crossPlacement);
let flippedPosition = $d45e305fb90d49e7c81f49bb4afe323b$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset);
let flippedSpace = $d45e305fb90d49e7c81f49bb4afe323b$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo); // If the available space for the flipped position is greater than the original available space, flip.

@@ -213,12 +214,12 @@ if (flippedSpace > space) {

position = flippedPosition;
normalizedOffset = -1 * offset;
normalizedOffset = offset;
}
}
let delta = $a7a15b8408ba1e3bb5fd405f8090c511$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
let delta = $d45e305fb90d49e7c81f49bb4afe323b$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position[crossAxis] += delta;
let maxHeight = $a7a15b8408ba1e3bb5fd405f8090c511$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
let maxHeight = $d45e305fb90d49e7c81f49bb4afe323b$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
overlaySize.height = Math.min(overlaySize.height, maxHeight);
position = $a7a15b8408ba1e3bb5fd405f8090c511$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset);
delta = $a7a15b8408ba1e3bb5fd405f8090c511$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position = $d45e305fb90d49e7c81f49bb4afe323b$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset);
delta = $d45e305fb90d49e7c81f49bb4afe323b$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
position[crossAxis] += delta;

@@ -235,4 +236,8 @@ let arrowPosition = {};

}
/**
* Determines where to place the overlay with regards to the target and the position of an optional indicator.
*/
function $a7a15b8408ba1e3bb5fd405f8090c511$export$calculatePosition(opts) {
function $d45e305fb90d49e7c81f49bb4afe323b$export$calculatePosition(opts) {
let {

@@ -260,11 +265,15 @@ placement,

let margins = $a7a15b8408ba1e3bb5fd405f8090c511$var$getMargins(overlayNode);
let margins = $d45e305fb90d49e7c81f49bb4afe323b$var$getMargins(overlayNode);
overlaySize.width += margins.left + margins.right;
overlaySize.height += margins.top + margins.bottom;
let scrollSize = $a7a15b8408ba1e3bb5fd405f8090c511$var$getScroll(scrollNode);
let boundaryDimensions = $a7a15b8408ba1e3bb5fd405f8090c511$var$getContainerDimensions(boundaryElement);
let scrollSize = $d45e305fb90d49e7c81f49bb4afe323b$var$getScroll(scrollNode);
let boundaryDimensions = $d45e305fb90d49e7c81f49bb4afe323b$var$getContainerDimensions(boundaryElement);
let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? _domHelpersQueryOffset(container) : _domHelpersQueryPosition(container, boundaryElement);
return $a7a15b8408ba1e3bb5fd405f8090c511$export$calculatePositionInternal(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset);
return $d45e305fb90d49e7c81f49bb4afe323b$export$calculatePositionInternal(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset);
}
/**
* Handles positioning overlays like popovers and menus relative to a trigger
* element, and updating the position when the window resizes.
*/
export function useOverlayPosition(props) {

@@ -281,3 +290,3 @@ let {

shouldFlip = true,
boundaryElement = document.body,
boundaryElement = typeof document !== 'undefined' ? document.body : null,
offset = 0,

@@ -296,10 +305,9 @@ crossOffset = 0,

let deps = [shouldUpdatePosition, placement, overlayRef.current, targetRef.current, scrollRef.current, containerPadding, shouldFlip, boundaryElement, offset, crossOffset, isOpen, direction];
let updatePosition = () => {
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current) {
let updatePosition = useCallback(() => {
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) {
return;
}
setPosition($a7a15b8408ba1e3bb5fd405f8090c511$export$calculatePosition({
placement: $c9ef3c3b0f65fb04532747ca520480bd$var$translateRTL(placement, direction),
setPosition($d45e305fb90d49e7c81f49bb4afe323b$export$calculatePosition({
placement: $ae841ee9d3f76b31663cf0594adb0fc$var$translateRTL(placement, direction),
overlayNode: overlayRef.current,

@@ -314,11 +322,10 @@ targetNode: targetRef.current,

}));
}; // Update position when anything changes
}, deps); // Update position when anything changes
useEffect(updatePosition, deps); // Update position on window resize
$c9ef3c3b0f65fb04532747ca520480bd$var$useResize(updatePosition);
$ae841ee9d3f76b31663cf0594adb0fc$var$useResize(updatePosition);
return {
overlayProps: {
style: _babelRuntimeHelpersEsmObjectSpread({
style: _babelRuntimeHelpersEsmExtends({
position: 'absolute',

@@ -336,7 +343,8 @@ zIndex: 100000

}
}
},
updatePosition
};
}
function $c9ef3c3b0f65fb04532747ca520480bd$var$useResize(onResize) {
function $ae841ee9d3f76b31663cf0594adb0fc$var$useResize(onResize) {
useEffect(() => {

@@ -350,3 +358,3 @@ window.addEventListener('resize', onResize, false);

function $c9ef3c3b0f65fb04532747ca520480bd$var$translateRTL(position, direction) {
function $ae841ee9d3f76b31663cf0594adb0fc$var$translateRTL(position, direction) {
if (direction === 'rtl') {

@@ -359,10 +367,17 @@ return position.replace('start', 'right').replace('end', 'left');

const $b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays = [];
export function useOverlay(props) {
const $e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays = [];
/**
* Provides the behavior for overlays such as dialogs, popovers, and menus.
* Hides the overlay when the user interacts outside it, when the Escape key is pressed,
* or optionally, on blur. Only the top-most overlay will close at once.
*/
export function useOverlay(props, ref) {
let {
ref,
onClose,
shouldCloseOnBlur,
isOpen,
isDismissable = false
isDismissable = false,
isKeyboardDismissDisabled = false,
shouldCloseOnInteractOutside
} = props; // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.

@@ -372,10 +387,10 @@

if (isOpen) {
$b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays.push(ref);
$e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays.push(ref);
}
return () => {
let index = $b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays.indexOf(ref);
let index = $e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays.indexOf(ref);
if (index >= 0) {
$b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays.splice(index, 1);
$e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays.splice(index, 1);
}

@@ -386,5 +401,11 @@ };

let onHide = () => {
if ($b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays[$b2a5d64f455c1cea3e640329611b5019$var$visibleOverlays.length - 1] === ref && onClose) {
if ($e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays[$e4d5b842fe0e1058e95712442330b88c$var$visibleOverlays.length - 1] === ref && onClose) {
onClose();
}
};
let onInteractOutside = e => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
onHide();
}
}; // Handle the escape key

@@ -394,3 +415,3 @@

let onKeyDown = e => {
if (e.key === 'Escape') {
if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
e.preventDefault();

@@ -404,3 +425,3 @@ onHide();

ref,
onInteractOutside: isDismissable ? onHide : null
onInteractOutside: isDismissable ? onInteractOutside : null
});

@@ -411,8 +432,10 @@ let {

isDisabled: !shouldCloseOnBlur,
onBlurWithin: () => {
onClose();
onBlurWithin: e => {
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) {
onClose();
}
}
});
return {
overlayProps: _babelRuntimeHelpersEsmObjectSpread({
overlayProps: _babelRuntimeHelpersEsmExtends({
onKeyDown

@@ -422,9 +445,14 @@ }, focusWithinProps)

}
export function useOverlayTrigger(props) {
/**
* Handles the behavior and accessibility for an overlay trigger, e.g. a button
* that opens a popover, menu, or other overlay that is positioned relative to the trigger.
*/
export function useOverlayTrigger(props, state, ref) {
let {
ref,
type,
onClose,
type
} = props;
let {
isOpen
} = props; // When scrolling a parent scrollable region of the trigger (other than the body),
} = state; // When scrolling a parent scrollable region of the trigger (other than the body),
// we hide the popover. Otherwise, its position would be incorrect.

@@ -445,5 +473,3 @@

if (onClose) {
onClose();
}
state.close();
};

@@ -455,5 +481,5 @@

};
}, [isOpen, onClose, ref]); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
}, [isOpen, ref]); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
// https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
// However, we only add it for menus for now because screen readers often
// However, we only add it for menus for now because screen readers often
// announce it as a menu even for other values.

@@ -481,4 +507,9 @@

}
/**
* Prevents scrolling on the document body on mount, and
* restores it on unmount. Also ensures that content does not
* shift due to the scrollbars disappearing.
*/
export function usePreventScroll() {
// Add overflow: hidden to the body on mount, and restore on unmount.
useEffect(() => {

@@ -496,7 +527,11 @@ let overflow = document.body.style.overflow;

const $ecb46f23eb4e6d44c8f5586824df633$var$Context = _react.createContext(null); // Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
// This is done recursively so that all parent providers are incremented and decremented.
// If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
// like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
// TODO: maybe move this?
const $b876e5ac9c98db373bf726bce3d604e$var$Context = _react.createContext(null);
/**
* Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
* trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
* This is done recursively so that all parent providers are incremented and decremented.
* If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
* subtree from screen readers. This is done using React context in order to account for things
* like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
*/

@@ -508,3 +543,3 @@

} = props;
let parent = useContext($ecb46f23eb4e6d44c8f5586824df633$var$Context);
let parent = useContext($b876e5ac9c98db373bf726bce3d604e$var$Context);
let [modalCount, setModalCount] = useState(parent ? parent.modalCount : 0);

@@ -532,9 +567,13 @@ let context = {

};
return (/*#__PURE__*/_react.createElement($ecb46f23eb4e6d44c8f5586824df633$var$Context.Provider, {
value: context
}, children)
);
return /*#__PURE__*/_react.createElement($b876e5ac9c98db373bf726bce3d604e$var$Context.Provider, {
value: context
}, children);
}
/**
* Used to determine if the tree should be aria-hidden based on how many
* modals are open.
*/
export function useModalProvider() {
let context = useContext($ecb46f23eb4e6d44c8f5586824df633$var$Context);
let context = useContext($b876e5ac9c98db373bf726bce3d604e$var$Context);
return {

@@ -546,5 +585,48 @@ modalProviderProps: {

}
/**
* Creates a root node that will be aria-hidden if there are other modals open.
*/
function $b876e5ac9c98db373bf726bce3d604e$var$OverlayContainerDOM(props) {
let {
modalProviderProps
} = useModalProvider();
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, props, modalProviderProps));
}
/**
* An OverlayProvider acts as a container for the top-level application.
* Any application that uses modal dialogs or other overlays should
* be wrapped in a `<OverlayProvider>`. This is used to ensure that
* the main content of the application is hidden from screen readers
* if a modal or other overlay is opened. Only the top-most modal or
* overlay should be accessible at once.
*/
export function OverlayProvider(props) {
return /*#__PURE__*/_react.createElement(ModalProvider, null, /*#__PURE__*/_react.createElement($b876e5ac9c98db373bf726bce3d604e$var$OverlayContainerDOM, props));
}
/**
* A container for overlays like modals and popovers. Renders the overlay
* into a Portal which is placed at the end of the document body.
* Also ensures that the overlay is hidden from screen readers if a
* nested modal is opened. Only the top-most modal or overlay should
* be accessible at once.
*/
export function OverlayContainer(props) {
let contents = /*#__PURE__*/_react.createElement(OverlayProvider, props);
return _reactDom.createPortal(contents, document.body);
}
/**
* Hides content outside the current `<OverlayContainer>` from screen readers
* on mount and restores it on unmount. Typically used by modal dialogs and
* other types of overlays to ensure that only the top-most modal is
* accessible at once.
*/
export function useModal() {
// Add aria-hidden to all parent providers on mount, and restore on unmount.
let context = useContext($ecb46f23eb4e6d44c8f5586824df633$var$Context);
let context = useContext($b876e5ac9c98db373bf726bce3d604e$var$Context);

@@ -569,6 +651,107 @@ if (!context) {

}, [context, context.parent]);
return {
modalProps: {
'data-ismodal': true
}
};
}
// ASSET: /Users/govett/dev/react-spectrum/packages/@react-aria/overlays/intl/en-US.json
var $a5782fa3d68797eace1f6521053f5a2$exports = {};
$a5782fa3d68797eace1f6521053f5a2$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ar-AE.json
var $e325a364098e05bf51160d06dcffdbe$exports = {};
$e325a364098e05bf51160d06dcffdbe$exports = JSON.parse("{\"dismiss\":\"تجاهل\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/bg-BG.json
var $ab088cc547d59c1be83369f8351a064$exports = {};
$ab088cc547d59c1be83369f8351a064$exports = JSON.parse("{\"dismiss\":\"Отхвърляне\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/cs-CZ.json
var $cec67ea16ca47059e10ca5e77187d8c2$exports = {};
$cec67ea16ca47059e10ca5e77187d8c2$exports = JSON.parse("{\"dismiss\":\"Odstranit\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/da-DK.json
var $d962fe1ed718c5ca37da1414136036f8$exports = {};
$d962fe1ed718c5ca37da1414136036f8$exports = JSON.parse("{\"dismiss\":\"Luk\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/de-DE.json
var $c5167dda40dde69038848f007e5$exports = {};
$c5167dda40dde69038848f007e5$exports = JSON.parse("{\"dismiss\":\"Schließen\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/el-GR.json
var $ecdd1ac0020e47f58a9ed51b5fb$exports = {};
$ecdd1ac0020e47f58a9ed51b5fb$exports = JSON.parse("{\"dismiss\":\"Απόρριψη\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/en-US.json
var $f33e30a89f4dff807f90ebe8c$exports = {};
$f33e30a89f4dff807f90ebe8c$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/es-ES.json
var $ba353e2c61dcc5141af4537eeb3ef85c$exports = {};
$ba353e2c61dcc5141af4537eeb3ef85c$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/et-EE.json
var $dd3e8aaecbf1f2c2c0f9d51aacfd$exports = {};
$dd3e8aaecbf1f2c2c0f9d51aacfd$exports = JSON.parse("{\"dismiss\":\"Lõpeta\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/fi-FI.json
var $f730aaed9f4652842b2a8f94a4a$exports = {};
$f730aaed9f4652842b2a8f94a4a$exports = JSON.parse("{\"dismiss\":\"Hylkää\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/fr-FR.json
var $e76b22aab4e46b7806205b4af9ca3$exports = {};
$e76b22aab4e46b7806205b4af9ca3$exports = JSON.parse("{\"dismiss\":\"Rejeter\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/he-IL.json
var $c33ffdd5a9931bfc82c1c9b55e98de2f$exports = {};
$c33ffdd5a9931bfc82c1c9b55e98de2f$exports = JSON.parse("{\"dismiss\":\"התעלם\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/hr-HR.json
var $d64cb70d4ce170f599f4df5adf4e9898$exports = {};
$d64cb70d4ce170f599f4df5adf4e9898$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/hu-HU.json
var $c05270a6513a8b6d8a6552a35a162$exports = {};
$c05270a6513a8b6d8a6552a35a162$exports = JSON.parse("{\"dismiss\":\"Elutasítás\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/it-IT.json
var $df915df637af1f3c14c8376c69dfd$exports = {};
$df915df637af1f3c14c8376c69dfd$exports = JSON.parse("{\"dismiss\":\"Ignora\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ja-JP.json
var $e8bf1e6480d2c65d558c3537ec0d59ce$exports = {};
$e8bf1e6480d2c65d558c3537ec0d59ce$exports = JSON.parse("{\"dismiss\":\"閉じる\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ko-KR.json
var $e06e93e1c9472a7e2fc5b26a87ea7$exports = {};
$e06e93e1c9472a7e2fc5b26a87ea7$exports = JSON.parse("{\"dismiss\":\"무시\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/lt-LT.json
var $fef82498418eab30c69349263b64e050$exports = {};
$fef82498418eab30c69349263b64e050$exports = JSON.parse("{\"dismiss\":\"Atmesti\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/lv-LV.json
var $c4df2502cb7b65c6578bcb8a165f6fc$exports = {};
$c4df2502cb7b65c6578bcb8a165f6fc$exports = JSON.parse("{\"dismiss\":\"Nerādīt\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/nb-NO.json
var $b50f4e499c19f4d55113139bba$exports = {};
$b50f4e499c19f4d55113139bba$exports = JSON.parse("{\"dismiss\":\"Lukk\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/nl-NL.json
var $e45d2f0079f29e4f5c6469cca7c$exports = {};
$e45d2f0079f29e4f5c6469cca7c$exports = JSON.parse("{\"dismiss\":\"Negeren\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/pl-PL.json
var $fcb5bfa87b2378a249bd7fb591ec22c2$exports = {};
$fcb5bfa87b2378a249bd7fb591ec22c2$exports = JSON.parse("{\"dismiss\":\"Zignoruj\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/pt-BR.json
var $edae5c6f18c937cf0015f2aa266d9fea$exports = {};
$edae5c6f18c937cf0015f2aa266d9fea$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ro-RO.json
var $df1162b231d383d942e0fdb2bbf$exports = {};
$df1162b231d383d942e0fdb2bbf$exports = JSON.parse("{\"dismiss\":\"Revocare\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/ru-RU.json
var $fa17537bfd201c57fa41fd31dbd9f074$exports = {};
$fa17537bfd201c57fa41fd31dbd9f074$exports = JSON.parse("{\"dismiss\":\"Пропустить\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sk-SK.json
var $c30db5bcff54a9e266ee7379a6cb8$exports = {};
$c30db5bcff54a9e266ee7379a6cb8$exports = JSON.parse("{\"dismiss\":\"Zrušiť\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sl-SI.json
var $c86d8cad7c0045ad51a1fea185411a61$exports = {};
$c86d8cad7c0045ad51a1fea185411a61$exports = JSON.parse("{\"dismiss\":\"Opusti\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sr-SP.json
var $c610b0b50ebc0061e6c42c420a2e1be$exports = {};
$c610b0b50ebc0061e6c42c420a2e1be$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/sv-SE.json
var $c298c5c92c55ce8d8289d8cc18ea512$exports = {};
$c298c5c92c55ce8d8289d8cc18ea512$exports = JSON.parse("{\"dismiss\":\"Avvisa\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/tr-TR.json
var $f438196d9674b9d180ea6e74d7$exports = {};
$f438196d9674b9d180ea6e74d7$exports = JSON.parse("{\"dismiss\":\"Kapat\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/uk-UA.json
var $fa842ebaf07187d5bc74e0fa6c4679b$exports = {};
$fa842ebaf07187d5bc74e0fa6c4679b$exports = JSON.parse("{\"dismiss\":\"Скасувати\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/zh-CN.json
var $cdcbe39f22ae1814551e7f30dcfc8$exports = {};
$cdcbe39f22ae1814551e7f30dcfc8$exports = JSON.parse("{\"dismiss\":\"取消\"}");
// ASSET: /home/circleci/react-spectrum/packages/@react-aria/overlays/intl/zh-TW.json
var $a8c729d90cde82a4eb34bebfb46a6$exports = {};
$a8c729d90cde82a4eb34bebfb46a6$exports = JSON.parse("{\"dismiss\":\"關閉\"}");

@@ -587,5 +770,43 @@ /*

// @ts-ignore
const $a8d78eb517ca4cfc6a6a116b05a$var$intlMessages = {
"en-US": _babelRuntimeHelpersEsmInteropRequireDefault($a5782fa3d68797eace1f6521053f5a2$exports).default
const $c94f95b3263b356bb2e58a3832a84$var$intlMessages = {
"ar-AE": _babelRuntimeHelpersEsmInteropRequireDefault($e325a364098e05bf51160d06dcffdbe$exports).default,
"bg-BG": _babelRuntimeHelpersEsmInteropRequireDefault($ab088cc547d59c1be83369f8351a064$exports).default,
"cs-CZ": _babelRuntimeHelpersEsmInteropRequireDefault($cec67ea16ca47059e10ca5e77187d8c2$exports).default,
"da-DK": _babelRuntimeHelpersEsmInteropRequireDefault($d962fe1ed718c5ca37da1414136036f8$exports).default,
"de-DE": _babelRuntimeHelpersEsmInteropRequireDefault($c5167dda40dde69038848f007e5$exports).default,
"el-GR": _babelRuntimeHelpersEsmInteropRequireDefault($ecdd1ac0020e47f58a9ed51b5fb$exports).default,
"en-US": _babelRuntimeHelpersEsmInteropRequireDefault($f33e30a89f4dff807f90ebe8c$exports).default,
"es-ES": _babelRuntimeHelpersEsmInteropRequireDefault($ba353e2c61dcc5141af4537eeb3ef85c$exports).default,
"et-EE": _babelRuntimeHelpersEsmInteropRequireDefault($dd3e8aaecbf1f2c2c0f9d51aacfd$exports).default,
"fi-FI": _babelRuntimeHelpersEsmInteropRequireDefault($f730aaed9f4652842b2a8f94a4a$exports).default,
"fr-FR": _babelRuntimeHelpersEsmInteropRequireDefault($e76b22aab4e46b7806205b4af9ca3$exports).default,
"he-IL": _babelRuntimeHelpersEsmInteropRequireDefault($c33ffdd5a9931bfc82c1c9b55e98de2f$exports).default,
"hr-HR": _babelRuntimeHelpersEsmInteropRequireDefault($d64cb70d4ce170f599f4df5adf4e9898$exports).default,
"hu-HU": _babelRuntimeHelpersEsmInteropRequireDefault($c05270a6513a8b6d8a6552a35a162$exports).default,
"it-IT": _babelRuntimeHelpersEsmInteropRequireDefault($df915df637af1f3c14c8376c69dfd$exports).default,
"ja-JP": _babelRuntimeHelpersEsmInteropRequireDefault($e8bf1e6480d2c65d558c3537ec0d59ce$exports).default,
"ko-KR": _babelRuntimeHelpersEsmInteropRequireDefault($e06e93e1c9472a7e2fc5b26a87ea7$exports).default,
"lt-LT": _babelRuntimeHelpersEsmInteropRequireDefault($fef82498418eab30c69349263b64e050$exports).default,
"lv-LV": _babelRuntimeHelpersEsmInteropRequireDefault($c4df2502cb7b65c6578bcb8a165f6fc$exports).default,
"nb-NO": _babelRuntimeHelpersEsmInteropRequireDefault($b50f4e499c19f4d55113139bba$exports).default,
"nl-NL": _babelRuntimeHelpersEsmInteropRequireDefault($e45d2f0079f29e4f5c6469cca7c$exports).default,
"pl-PL": _babelRuntimeHelpersEsmInteropRequireDefault($fcb5bfa87b2378a249bd7fb591ec22c2$exports).default,
"pt-BR": _babelRuntimeHelpersEsmInteropRequireDefault($edae5c6f18c937cf0015f2aa266d9fea$exports).default,
"ro-RO": _babelRuntimeHelpersEsmInteropRequireDefault($df1162b231d383d942e0fdb2bbf$exports).default,
"ru-RU": _babelRuntimeHelpersEsmInteropRequireDefault($fa17537bfd201c57fa41fd31dbd9f074$exports).default,
"sk-SK": _babelRuntimeHelpersEsmInteropRequireDefault($c30db5bcff54a9e266ee7379a6cb8$exports).default,
"sl-SI": _babelRuntimeHelpersEsmInteropRequireDefault($c86d8cad7c0045ad51a1fea185411a61$exports).default,
"sr-SP": _babelRuntimeHelpersEsmInteropRequireDefault($c610b0b50ebc0061e6c42c420a2e1be$exports).default,
"sv-SE": _babelRuntimeHelpersEsmInteropRequireDefault($c298c5c92c55ce8d8289d8cc18ea512$exports).default,
"tr-TR": _babelRuntimeHelpersEsmInteropRequireDefault($f438196d9674b9d180ea6e74d7$exports).default,
"uk-UA": _babelRuntimeHelpersEsmInteropRequireDefault($fa842ebaf07187d5bc74e0fa6c4679b$exports).default,
"zh-CN": _babelRuntimeHelpersEsmInteropRequireDefault($cdcbe39f22ae1814551e7f30dcfc8$exports).default,
"zh-TW": _babelRuntimeHelpersEsmInteropRequireDefault($a8c729d90cde82a4eb34bebfb46a6$exports).default
};
/**
* A visually hidden button that can be used to allow screen reader
* users to dismiss a modal or popup when there is no visual
* affordance to do so.
*/
export function DismissButton(props) {

@@ -595,3 +816,3 @@ let {

} = props;
let formatMessage = useMessageFormatter($a8d78eb517ca4cfc6a6a116b05a$var$intlMessages);
let formatMessage = useMessageFormatter($c94f95b3263b356bb2e58a3832a84$var$intlMessages);

@@ -604,8 +825,8 @@ let onClick = () => {

return (/*#__PURE__*/_react.createElement(VisuallyHidden, null, /*#__PURE__*/_react.createElement("button", {
tabIndex: -1,
"aria-label": formatMessage('dismiss'),
onClick: onClick
}))
);
}
return /*#__PURE__*/_react.createElement(VisuallyHidden, null, /*#__PURE__*/_react.createElement("button", {
tabIndex: -1,
"aria-label": formatMessage('dismiss'),
onClick: onClick
}));
}
//# sourceMappingURL=module.js.map

@@ -1,61 +0,167 @@

import { HTMLAttributes, RefObject, AriaAttributes, ReactNode } from "react";
import { Placement, PlacementAxis } from "@react-types/overlays";
export interface PositionProps {
placement?: Placement;
containerPadding?: number;
offset?: number;
crossOffset?: number;
shouldFlip?: boolean;
import React, { HTMLAttributes, RefObject, AriaAttributes, ReactNode } from "react";
import { PlacementAxis, PositionProps } from "@react-types/overlays";
import { AriaButtonProps } from "@react-types/button";
import { OverlayTriggerState } from "@react-stately/overlays";
interface AriaPositionProps extends PositionProps {
/**
* Element that that serves as the positioning boundary.
* @default document.body
*/
boundaryElement?: HTMLElement;
isOpen?: boolean;
}
interface AriaPositionProps extends PositionProps {
/**
* The ref for the element which the overlay positions itself with respect to.
*/
targetRef: RefObject<HTMLElement>;
/**
* The ref for the overlay element.
*/
overlayRef: RefObject<HTMLElement>;
/**
* A ref for the scrollable region within the overlay.
* @default overlayRef
*/
scrollRef?: RefObject<HTMLElement>;
/**
* Whether the overlay should update its position automatically.
* @default true
*/
shouldUpdatePosition?: boolean;
}
interface PositionAria {
/** Props for the overlay container element. */
overlayProps: HTMLAttributes<Element>;
/** Props for the overlay tip arrow if any. */
arrowProps: HTMLAttributes<Element>;
/** Placement of the overlay with respect to the overlay trigger. */
placement: PlacementAxis;
/** Updates the position of the overlay. */
updatePosition(): void;
}
/**
* Handles positioning overlays like popovers and menus relative to a trigger
* element, and updating the position when the window resizes.
*/
export function useOverlayPosition(props: AriaPositionProps): PositionAria;
interface OverlayProps {
ref: RefObject<HTMLElement | null>;
/** Whether the overlay is currently open. */
isOpen?: boolean;
/** Handler that is called when the overlay should close. */
onClose?: () => void;
isOpen?: boolean;
/**
* Whether to close the overlay when the user interacts outside it.
* @default false
*/
isDismissable?: boolean;
/** Whether the overlay should close when focus is lost or moves outside it. */
shouldCloseOnBlur?: boolean;
/**
* Whether pressing the escape key to close the overlay should be disabled.
* @default false
*/
isKeyboardDismissDisabled?: boolean;
/**
* When user interacts with the argument element outside of the overlay ref,
* return true if onClose should be called. This gives you a chance to filter
* out interaction with elements that should not dismiss the overlay.
* By default, onClose will always be called on interaction outside the overlay ref.
*/
shouldCloseOnInteractOutside?: (element: HTMLElement) => boolean;
}
interface OverlayAria {
/** Props to apply to the overlay container element. */
overlayProps: HTMLAttributes<HTMLElement>;
}
export function useOverlay(props: OverlayProps): OverlayAria;
/**
* Provides the behavior for overlays such as dialogs, popovers, and menus.
* Hides the overlay when the user interacts outside it, when the Escape key is pressed,
* or optionally, on blur. Only the top-most overlay will close at once.
*/
export function useOverlay(props: OverlayProps, ref: RefObject<HTMLElement>): OverlayAria;
interface OverlayTriggerProps {
ref: RefObject<HTMLElement | null>;
/** Type of overlay that is opened by the trigger. */
type: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
onClose?: () => void;
isOpen?: boolean;
}
interface OverlayTriggerAria {
triggerProps: HTMLAttributes<HTMLElement>;
/** Props for the trigger element. */
triggerProps: AriaButtonProps;
/** Props for the overlay container element. */
overlayProps: HTMLAttributes<HTMLElement>;
}
export function useOverlayTrigger(props: OverlayTriggerProps): OverlayTriggerAria;
/**
* Handles the behavior and accessibility for an overlay trigger, e.g. a button
* that opens a popover, menu, or other overlay that is positioned relative to the trigger.
*/
export function useOverlayTrigger(props: OverlayTriggerProps, state: OverlayTriggerState, ref: RefObject<HTMLElement>): OverlayTriggerAria;
/**
* Prevents scrolling on the document body on mount, and
* restores it on unmount. Also ensures that content does not
* shift due to the scrollbars disappearing.
*/
export function usePreventScroll(): void;
interface ModalProviderProps {
interface ModalProviderProps extends HTMLAttributes<HTMLElement> {
children: ReactNode;
}
/**
* Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
* trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
* This is done recursively so that all parent providers are incremented and decremented.
* If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
* subtree from screen readers. This is done using React context in order to account for things
* like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
*/
export function ModalProvider(props: ModalProviderProps): JSX.Element;
interface ModalProviderAria {
/**
* Props to be spread on the container element.
*/
modalProviderProps: AriaAttributes;
}
/**
* Used to determine if the tree should be aria-hidden based on how many
* modals are open.
*/
export function useModalProvider(): ModalProviderAria;
export function useModal(): void;
/**
* An OverlayProvider acts as a container for the top-level application.
* Any application that uses modal dialogs or other overlays should
* be wrapped in a `<OverlayProvider>`. This is used to ensure that
* the main content of the application is hidden from screen readers
* if a modal or other overlay is opened. Only the top-most modal or
* overlay should be accessible at once.
*/
export function OverlayProvider(props: ModalProviderProps): JSX.Element;
/**
* A container for overlays like modals and popovers. Renders the overlay
* into a Portal which is placed at the end of the document body.
* Also ensures that the overlay is hidden from screen readers if a
* nested modal is opened. Only the top-most modal or overlay should
* be accessible at once.
*/
export function OverlayContainer(props: ModalProviderProps): React.ReactPortal;
interface ModalAriaProps extends HTMLAttributes<HTMLElement> {
/** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */
'data-ismodal': boolean;
}
interface ModalAria {
/** Props for the modal content element. */
modalProps: ModalAriaProps;
}
/**
* Hides content outside the current `<OverlayContainer>` from screen readers
* on mount and restores it on unmount. Typically used by modal dialogs and
* other types of overlays to ensure that only the top-most modal is
* accessible at once.
*/
export function useModal(): ModalAria;
interface DismissButtonProps {
/** Called when the dismiss button is activated. */
onDismiss?: () => void;
}
/**
* A visually hidden button that can be used to allow screen reader
* users to dismiss a modal or popup when there is no visual
* affordance to do so.
*/
export function DismissButton(props: DismissButtonProps): JSX.Element;
//# sourceMappingURL=types.d.ts.map
{
"name": "@react-aria/overlays",
"version": "3.0.0-alpha.1",
"version": "3.0.0-nightly.672+9853bacb",
"description": "Spectrum UI components in React",

@@ -11,3 +11,4 @@ "license": "Apache-2.0",

"files": [
"dist"
"dist",
"src"
],

@@ -17,15 +18,18 @@ "sideEffects": false,

"type": "git",
"url": "https://github.com/adobe-private/react-spectrum-v3"
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@babel/runtime": "^7.6.2",
"@react-aria/i18n": "^3.0.0-rc.2",
"@react-aria/interactions": "^3.0.0-rc.2",
"@react-aria/utils": "^3.0.0-rc.2",
"@react-aria/visually-hidden": "^3.0.0-alpha.1",
"@react-types/overlays": "^3.0.0-alpha.1",
"@react-aria/i18n": "3.0.0-nightly.672+9853bacb",
"@react-aria/interactions": "3.0.0-nightly.672+9853bacb",
"@react-aria/utils": "3.0.0-nightly.672+9853bacb",
"@react-aria/visually-hidden": "3.0.0-nightly.672+9853bacb",
"@react-stately/overlays": "3.1.1-nightly.2350+9853bacb",
"@react-types/button": "3.2.1-nightly.2350+9853bacb",
"@react-types/overlays": "3.2.1-nightly.2350+9853bacb",
"dom-helpers": "^3.3.1"
},
"peerDependencies": {
"react": "^16.8.0"
"react": "^16.8.0",
"react-dom": "^16.8.0"
},

@@ -35,3 +39,3 @@ "publishConfig": {

},
"gitHead": "207e6ee9076905c96638a7f81a367758872e1410"
"gitHead": "9853bacb98dd37c64faf573e5cb1a6493e2e6f08"
}
# @react-aria/overlays
This package is part of [react-spectrum](https://github.com/adobe-private/react-spectrum-v3). See the repo for more details.
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc