@react-aria/overlays 3.26.0 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/DismissButton.main.js.map +1 -1
  2. package/dist/DismissButton.module.js.map +1 -1
  3. package/dist/Overlay.main.js +1 -1
  4. package/dist/Overlay.main.js.map +1 -1
  5. package/dist/Overlay.mjs +2 -2
  6. package/dist/Overlay.module.js +2 -2
  7. package/dist/Overlay.module.js.map +1 -1
  8. package/dist/PortalProvider.main.js +5 -5
  9. package/dist/PortalProvider.main.js.map +1 -1
  10. package/dist/PortalProvider.mjs +4 -4
  11. package/dist/PortalProvider.module.js +4 -4
  12. package/dist/PortalProvider.module.js.map +1 -1
  13. package/dist/ariaHideOutside.main.js.map +1 -1
  14. package/dist/ariaHideOutside.module.js.map +1 -1
  15. package/dist/import.mjs +2 -2
  16. package/dist/main.js +2 -2
  17. package/dist/main.js.map +1 -1
  18. package/dist/module.js +2 -2
  19. package/dist/module.js.map +1 -1
  20. package/dist/types.d.ts +19 -12
  21. package/dist/types.d.ts.map +1 -1
  22. package/dist/useCloseOnScroll.main.js.map +1 -1
  23. package/dist/useCloseOnScroll.module.js.map +1 -1
  24. package/dist/useModal.main.js +4 -0
  25. package/dist/useModal.main.js.map +1 -1
  26. package/dist/useModal.mjs +4 -0
  27. package/dist/useModal.module.js +4 -0
  28. package/dist/useModal.module.js.map +1 -1
  29. package/dist/usePopover.main.js +1 -1
  30. package/dist/usePopover.main.js.map +1 -1
  31. package/dist/usePopover.mjs +1 -1
  32. package/dist/usePopover.module.js +1 -1
  33. package/dist/usePopover.module.js.map +1 -1
  34. package/dist/usePreventScroll.main.js.map +1 -1
  35. package/dist/usePreventScroll.module.js.map +1 -1
  36. package/package.json +12 -12
  37. package/src/DismissButton.tsx +2 -2
  38. package/src/Overlay.tsx +5 -5
  39. package/src/PortalProvider.tsx +13 -6
  40. package/src/ariaHideOutside.ts +1 -1
  41. package/src/index.ts +2 -1
  42. package/src/useCloseOnScroll.ts +1 -1
  43. package/src/useModal.tsx +8 -2
  44. package/src/usePopover.ts +1 -1
  45. package/src/usePreventScroll.ts +1 -1
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,aAAC,SAAS,EAAE,GAAG,YAAW,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,SAAS,CAAA,GAAA,+BAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE1D,IAAI,UAAU;QACZ,IAAI,WACF;IAEJ;IAEA,qBACE,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QACE,GAAG,MAAM;QACV,UAAU;QACV,SAAS;QACT,OAAO;YAAC,OAAO;YAAG,QAAQ;QAAC;;AAGnC","sources":["packages/@react-aria/overlays/src/DismissButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {useLabels} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface DismissButtonProps extends AriaLabelingProps, DOMProps {\n /** Called when the dismiss button is activated. */\n onDismiss?: () => void\n}\n\n/**\n * A visually hidden button that can be used to allow screen reader\n * users to dismiss a modal or popup when there is no visual\n * affordance to do so.\n */\nexport function DismissButton(props: DismissButtonProps) {\n let {onDismiss, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');\n\n let labels = useLabels(otherProps, stringFormatter.format('dismiss'));\n\n let onClick = () => {\n if (onDismiss) {\n onDismiss();\n }\n };\n\n return (\n <VisuallyHidden>\n <button\n {...labels}\n tabIndex={-1}\n onClick={onClick}\n style={{width: 1, height: 1}} />\n </VisuallyHidden>\n );\n}\n"],"names":[],"version":3,"file":"DismissButton.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,aAAC,SAAS,EAAE,GAAG,YAAW,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,SAAS,CAAA,GAAA,+BAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE1D,IAAI,UAAU;QACZ,IAAI,WACF;IAEJ;IAEA,qBACE,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QACE,GAAG,MAAM;QACV,UAAU;QACV,SAAS;QACT,OAAO;YAAC,OAAO;YAAG,QAAQ;QAAC;;AAGnC","sources":["packages/@react-aria/overlays/src/DismissButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface DismissButtonProps extends AriaLabelingProps, DOMProps {\n /** Called when the dismiss button is activated. */\n onDismiss?: () => void\n}\n\n/**\n * A visually hidden button that can be used to allow screen reader\n * users to dismiss a modal or popup when there is no visual\n * affordance to do so.\n */\nexport function DismissButton(props: DismissButtonProps): ReactNode {\n let {onDismiss, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');\n\n let labels = useLabels(otherProps, stringFormatter.format('dismiss'));\n\n let onClick = () => {\n if (onDismiss) {\n onDismiss();\n }\n };\n\n return (\n <VisuallyHidden>\n <button\n {...labels}\n tabIndex={-1}\n onClick={onClick}\n style={{width: 1, height: 1}} />\n </VisuallyHidden>\n );\n}\n"],"names":[],"version":3,"file":"DismissButton.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,aAAC,SAAS,EAAE,GAAG,YAAW,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE1D,IAAI,UAAU;QACZ,IAAI,WACF;IAEJ;IAEA,qBACE,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QACE,GAAG,MAAM;QACV,UAAU;QACV,SAAS;QACT,OAAO;YAAC,OAAO;YAAG,QAAQ;QAAC;;AAGnC","sources":["packages/@react-aria/overlays/src/DismissButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {useLabels} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface DismissButtonProps extends AriaLabelingProps, DOMProps {\n /** Called when the dismiss button is activated. */\n onDismiss?: () => void\n}\n\n/**\n * A visually hidden button that can be used to allow screen reader\n * users to dismiss a modal or popup when there is no visual\n * affordance to do so.\n */\nexport function DismissButton(props: DismissButtonProps) {\n let {onDismiss, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');\n\n let labels = useLabels(otherProps, stringFormatter.format('dismiss'));\n\n let onClick = () => {\n if (onDismiss) {\n onDismiss();\n }\n };\n\n return (\n <VisuallyHidden>\n <button\n {...labels}\n tabIndex={-1}\n onClick={onClick}\n style={{width: 1, height: 1}} />\n </VisuallyHidden>\n );\n}\n"],"names":[],"version":3,"file":"DismissButton.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAc,KAAyB;IACrD,IAAI,aAAC,SAAS,EAAE,GAAG,YAAW,GAAG;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE1D,IAAI,UAAU;QACZ,IAAI,WACF;IAEJ;IAEA,qBACE,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QACE,GAAG,MAAM;QACV,UAAU;QACV,SAAS;QACT,OAAO;YAAC,OAAO;YAAG,QAAQ;QAAC;;AAGnC","sources":["packages/@react-aria/overlays/src/DismissButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\nexport interface DismissButtonProps extends AriaLabelingProps, DOMProps {\n /** Called when the dismiss button is activated. */\n onDismiss?: () => void\n}\n\n/**\n * A visually hidden button that can be used to allow screen reader\n * users to dismiss a modal or popup when there is no visual\n * affordance to do so.\n */\nexport function DismissButton(props: DismissButtonProps): ReactNode {\n let {onDismiss, ...otherProps} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/overlays');\n\n let labels = useLabels(otherProps, stringFormatter.format('dismiss'));\n\n let onClick = () => {\n if (onDismiss) {\n onDismiss();\n }\n };\n\n return (\n <VisuallyHidden>\n <button\n {...labels}\n tabIndex={-1}\n onClick={onClick}\n style={{width: 1, height: 1}} />\n </VisuallyHidden>\n );\n}\n"],"names":[],"version":3,"file":"DismissButton.module.js.map"}
@@ -46,7 +46,7 @@ function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
46
46
  contain,
47
47
  setContain
48
48
  ]);
49
- let { getContainer: getContainer } = (0, $d7347c25ab757295$exports.useUNSTABLE_PortalContext)();
49
+ let { getContainer: getContainer } = (0, $d7347c25ab757295$exports.useUNSAFE_PortalContext)();
50
50
  if (!props.portalContainer && getContainer) portalContainer = getContainer();
51
51
  if (!portalContainer) return null;
52
52
  let contents = props.children;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmCM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAuF;AAMjI,SAAS,0CAAQ,KAAmB;IACzC,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,aAAE,SAAS,EAAC,GAAG;IAClE,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IACrC,IAAI,eAAe,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;qBAAC;wBAAS;QAAU,CAAA,GAAI;QAAC;QAAS;KAAW;IAE/E,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,mDAAwB;IAC7C,IAAK,CAAC,MAAM,eAAe,IAAI,cAC7B,kBAAkB;IAGpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,WAAW,MAAM,QAAQ;IAC7B,IAAI,CAAC,MAAM,sBAAsB,EAC/B,yBACE,0DAAC,CAAA,GAAA,gCAAS;QAAE,cAAA;QAAa,SAAS,AAAC,CAAA,MAAM,kBAAkB,IAAI,OAAM,KAAM,CAAC;OACzE;IAKP,yBACE,0DAAC,0CAAe,QAAQ;QAAC,OAAO;qBAC9B,0DAAC,CAAA,GAAA,gDAAkB,SAChB;IAKP,qBAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAGO,SAAS;IACd,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,aAAa,gBAAA,0BAAA,IAAK,UAAU;IAChC,CAAA,GAAA,qCAAc,EAAE;QACd,uBAAA,iCAAA,WAAa;IACf,GAAG;QAAC;KAAW;AACjB","sources":["packages/@react-aria/overlays/src/Overlay.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ClearPressResponder} from '@react-aria/interactions';\nimport {FocusScope} from '@react-aria/focus';\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport interface OverlayProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element,\n /** The overlay to render in the portal. */\n children: ReactNode,\n /**\n * Disables default focus management for the overlay, including containment and restoration.\n * This option should be used very carefully. When focus management is disabled, you must\n * implement focus containment and restoration to ensure the overlay is keyboard accessible.\n */\n disableFocusManagement?: boolean,\n /**\n * Whether to contain focus within the overlay.\n */\n shouldContainFocus?: boolean,\n /**\n * Whether the overlay is currently performing an exit animation. When true,\n * focus is allowed to move outside.\n */\n isExiting?: boolean\n}\n\nexport const OverlayContext = React.createContext<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null>(null);\n\n/**\n * A container which renders an overlay such as a popover or modal in a portal,\n * and provides a focus scope for the child elements.\n */\nexport function Overlay(props: OverlayProps) {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, isExiting} = props;\n let [contain, setContain] = useState(false);\n let contextValue = useMemo(() => ({contain, setContain}), [contain, setContain]);\n\n let {getContainer} = useUNSTABLE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = props.children;\n if (!props.disableFocusManagement) {\n contents = (\n <FocusScope restoreFocus contain={(props.shouldContainFocus || contain) && !isExiting}>\n {contents}\n </FocusScope>\n );\n }\n\n contents = (\n <OverlayContext.Provider value={contextValue}>\n <ClearPressResponder>\n {contents}\n </ClearPressResponder>\n </OverlayContext.Provider>\n );\n\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\n/** @private */\nexport function useOverlayFocusContain() {\n let ctx = useContext(OverlayContext);\n let setContain = ctx?.setContain;\n useLayoutEffect(() => {\n setContain?.(true);\n }, [setContain]);\n}\n"],"names":[],"version":3,"file":"Overlay.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmCM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAuF;AAMjI,SAAS,0CAAQ,KAAmB;IACzC,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,aAAE,SAAS,EAAC,GAAG;IAClE,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IACrC,IAAI,eAAe,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;qBAAC;wBAAS;QAAU,CAAA,GAAI;QAAC;QAAS;KAAW;IAE/E,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,iDAAsB;IAC3C,IAAI,CAAC,MAAM,eAAe,IAAI,cAC5B,kBAAkB;IAGpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,WAAW,MAAM,QAAQ;IAC7B,IAAI,CAAC,MAAM,sBAAsB,EAC/B,yBACE,0DAAC,CAAA,GAAA,gCAAS;QAAE,cAAA;QAAa,SAAS,AAAC,CAAA,MAAM,kBAAkB,IAAI,OAAM,KAAM,CAAC;OACzE;IAKP,yBACE,0DAAC,0CAAe,QAAQ;QAAC,OAAO;qBAC9B,0DAAC,CAAA,GAAA,gDAAkB,SAChB;IAKP,qBAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAGO,SAAS;IACd,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,aAAa,gBAAA,0BAAA,IAAK,UAAU;IAChC,CAAA,GAAA,qCAAc,EAAE;QACd,uBAAA,iCAAA,WAAa;IACf,GAAG;QAAC;KAAW;AACjB","sources":["packages/@react-aria/overlays/src/Overlay.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ClearPressResponder} from '@react-aria/interactions';\nimport {FocusScope} from '@react-aria/focus';\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useUNSAFE_PortalContext} from './PortalProvider';\n\nexport interface OverlayProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element,\n /** The overlay to render in the portal. */\n children: ReactNode,\n /**\n * Disables default focus management for the overlay, including containment and restoration.\n * This option should be used very carefully. When focus management is disabled, you must\n * implement focus containment and restoration to ensure the overlay is keyboard accessible.\n */\n disableFocusManagement?: boolean,\n /**\n * Whether to contain focus within the overlay.\n */\n shouldContainFocus?: boolean,\n /**\n * Whether the overlay is currently performing an exit animation. When true,\n * focus is allowed to move outside.\n */\n isExiting?: boolean\n}\n\nexport const OverlayContext = React.createContext<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null>(null);\n\n/**\n * A container which renders an overlay such as a popover or modal in a portal,\n * and provides a focus scope for the child elements.\n */\nexport function Overlay(props: OverlayProps): ReactNode | null {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, isExiting} = props;\n let [contain, setContain] = useState(false);\n let contextValue = useMemo(() => ({contain, setContain}), [contain, setContain]);\n\n let {getContainer} = useUNSAFE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = props.children;\n if (!props.disableFocusManagement) {\n contents = (\n <FocusScope restoreFocus contain={(props.shouldContainFocus || contain) && !isExiting}>\n {contents}\n </FocusScope>\n );\n }\n\n contents = (\n <OverlayContext.Provider value={contextValue}>\n <ClearPressResponder>\n {contents}\n </ClearPressResponder>\n </OverlayContext.Provider>\n );\n\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\n/** @private */\nexport function useOverlayFocusContain(): void {\n let ctx = useContext(OverlayContext);\n let setContain = ctx?.setContain;\n useLayoutEffect(() => {\n setContain?.(true);\n }, [setContain]);\n}\n"],"names":[],"version":3,"file":"Overlay.main.js.map"}
package/dist/Overlay.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.mjs";
1
+ import {useUNSAFE_PortalContext as $96b38030c423d352$export$9fc1347d4195ccb3} from "./PortalProvider.mjs";
2
2
  import {ClearPressResponder as $1CM7W$ClearPressResponder} from "@react-aria/interactions";
3
3
  import {FocusScope as $1CM7W$FocusScope} from "@react-aria/focus";
4
4
  import $1CM7W$react, {useState as $1CM7W$useState, useMemo as $1CM7W$useMemo, useContext as $1CM7W$useContext} from "react";
@@ -35,7 +35,7 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
35
35
  contain,
36
36
  setContain
37
37
  ]);
38
- let { getContainer: getContainer } = (0, $96b38030c423d352$export$574e9b0fb070c3b0)();
38
+ let { getContainer: getContainer } = (0, $96b38030c423d352$export$9fc1347d4195ccb3)();
39
39
  if (!props.portalContainer && getContainer) portalContainer = getContainer();
40
40
  if (!portalContainer) return null;
41
41
  let contents = props.children;
@@ -1,4 +1,4 @@
1
- import {useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.module.js";
1
+ import {useUNSAFE_PortalContext as $96b38030c423d352$export$9fc1347d4195ccb3} from "./PortalProvider.module.js";
2
2
  import {ClearPressResponder as $1CM7W$ClearPressResponder} from "@react-aria/interactions";
3
3
  import {FocusScope as $1CM7W$FocusScope} from "@react-aria/focus";
4
4
  import $1CM7W$react, {useState as $1CM7W$useState, useMemo as $1CM7W$useMemo, useContext as $1CM7W$useContext} from "react";
@@ -35,7 +35,7 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
35
35
  contain,
36
36
  setContain
37
37
  ]);
38
- let { getContainer: getContainer } = (0, $96b38030c423d352$export$574e9b0fb070c3b0)();
38
+ let { getContainer: getContainer } = (0, $96b38030c423d352$export$9fc1347d4195ccb3)();
39
39
  if (!props.portalContainer && getContainer) portalContainer = getContainer();
40
40
  if (!portalContainer) return null;
41
41
  let contents = props.children;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmCM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAuF;AAMjI,SAAS,0CAAQ,KAAmB;IACzC,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,aAAE,SAAS,EAAC,GAAG;IAClE,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE;IACrC,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;qBAAC;wBAAS;QAAU,CAAA,GAAI;QAAC;QAAS;KAAW;IAE/E,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAwB;IAC7C,IAAK,CAAC,MAAM,eAAe,IAAI,cAC7B,kBAAkB;IAGpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,WAAW,MAAM,QAAQ;IAC7B,IAAI,CAAC,MAAM,sBAAsB,EAC/B,yBACE,gCAAC,CAAA,GAAA,iBAAS;QAAE,cAAA;QAAa,SAAS,AAAC,CAAA,MAAM,kBAAkB,IAAI,OAAM,KAAM,CAAC;OACzE;IAKP,yBACE,gCAAC,0CAAe,QAAQ;QAAC,OAAO;qBAC9B,gCAAC,CAAA,GAAA,0BAAkB,SAChB;IAKP,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAGO,SAAS;IACd,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,aAAa,gBAAA,0BAAA,IAAK,UAAU;IAChC,CAAA,GAAA,sBAAc,EAAE;QACd,uBAAA,iCAAA,WAAa;IACf,GAAG;QAAC;KAAW;AACjB","sources":["packages/@react-aria/overlays/src/Overlay.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ClearPressResponder} from '@react-aria/interactions';\nimport {FocusScope} from '@react-aria/focus';\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport interface OverlayProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element,\n /** The overlay to render in the portal. */\n children: ReactNode,\n /**\n * Disables default focus management for the overlay, including containment and restoration.\n * This option should be used very carefully. When focus management is disabled, you must\n * implement focus containment and restoration to ensure the overlay is keyboard accessible.\n */\n disableFocusManagement?: boolean,\n /**\n * Whether to contain focus within the overlay.\n */\n shouldContainFocus?: boolean,\n /**\n * Whether the overlay is currently performing an exit animation. When true,\n * focus is allowed to move outside.\n */\n isExiting?: boolean\n}\n\nexport const OverlayContext = React.createContext<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null>(null);\n\n/**\n * A container which renders an overlay such as a popover or modal in a portal,\n * and provides a focus scope for the child elements.\n */\nexport function Overlay(props: OverlayProps) {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, isExiting} = props;\n let [contain, setContain] = useState(false);\n let contextValue = useMemo(() => ({contain, setContain}), [contain, setContain]);\n\n let {getContainer} = useUNSTABLE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = props.children;\n if (!props.disableFocusManagement) {\n contents = (\n <FocusScope restoreFocus contain={(props.shouldContainFocus || contain) && !isExiting}>\n {contents}\n </FocusScope>\n );\n }\n\n contents = (\n <OverlayContext.Provider value={contextValue}>\n <ClearPressResponder>\n {contents}\n </ClearPressResponder>\n </OverlayContext.Provider>\n );\n\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\n/** @private */\nexport function useOverlayFocusContain() {\n let ctx = useContext(OverlayContext);\n let setContain = ctx?.setContain;\n useLayoutEffect(() => {\n setContain?.(true);\n }, [setContain]);\n}\n"],"names":[],"version":3,"file":"Overlay.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAmCM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAuF;AAMjI,SAAS,0CAAQ,KAAmB;IACzC,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,aAAE,SAAS,EAAC,GAAG;IAClE,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE;IACrC,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;qBAAC;wBAAS;QAAU,CAAA,GAAI;QAAC;QAAS;KAAW;IAE/E,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAsB;IAC3C,IAAI,CAAC,MAAM,eAAe,IAAI,cAC5B,kBAAkB;IAGpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,WAAW,MAAM,QAAQ;IAC7B,IAAI,CAAC,MAAM,sBAAsB,EAC/B,yBACE,gCAAC,CAAA,GAAA,iBAAS;QAAE,cAAA;QAAa,SAAS,AAAC,CAAA,MAAM,kBAAkB,IAAI,OAAM,KAAM,CAAC;OACzE;IAKP,yBACE,gCAAC,0CAAe,QAAQ;QAAC,OAAO;qBAC9B,gCAAC,CAAA,GAAA,0BAAkB,SAChB;IAKP,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAGO,SAAS;IACd,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,aAAa,gBAAA,0BAAA,IAAK,UAAU;IAChC,CAAA,GAAA,sBAAc,EAAE;QACd,uBAAA,iCAAA,WAAa;IACf,GAAG;QAAC;KAAW;AACjB","sources":["packages/@react-aria/overlays/src/Overlay.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ClearPressResponder} from '@react-aria/interactions';\nimport {FocusScope} from '@react-aria/focus';\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useUNSAFE_PortalContext} from './PortalProvider';\n\nexport interface OverlayProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element,\n /** The overlay to render in the portal. */\n children: ReactNode,\n /**\n * Disables default focus management for the overlay, including containment and restoration.\n * This option should be used very carefully. When focus management is disabled, you must\n * implement focus containment and restoration to ensure the overlay is keyboard accessible.\n */\n disableFocusManagement?: boolean,\n /**\n * Whether to contain focus within the overlay.\n */\n shouldContainFocus?: boolean,\n /**\n * Whether the overlay is currently performing an exit animation. When true,\n * focus is allowed to move outside.\n */\n isExiting?: boolean\n}\n\nexport const OverlayContext = React.createContext<{contain: boolean, setContain: React.Dispatch<React.SetStateAction<boolean>>} | null>(null);\n\n/**\n * A container which renders an overlay such as a popover or modal in a portal,\n * and provides a focus scope for the child elements.\n */\nexport function Overlay(props: OverlayProps): ReactNode | null {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, isExiting} = props;\n let [contain, setContain] = useState(false);\n let contextValue = useMemo(() => ({contain, setContain}), [contain, setContain]);\n\n let {getContainer} = useUNSAFE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = props.children;\n if (!props.disableFocusManagement) {\n contents = (\n <FocusScope restoreFocus contain={(props.shouldContainFocus || contain) && !isExiting}>\n {contents}\n </FocusScope>\n );\n }\n\n contents = (\n <OverlayContext.Provider value={contextValue}>\n <ClearPressResponder>\n {contents}\n </ClearPressResponder>\n </OverlayContext.Provider>\n );\n\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\n/** @private */\nexport function useOverlayFocusContain(): void {\n let ctx = useContext(OverlayContext);\n let setContain = ctx?.setContain;\n useLayoutEffect(() => {\n setContain?.(true);\n }, [setContain]);\n}\n"],"names":[],"version":3,"file":"Overlay.module.js.map"}
@@ -9,8 +9,8 @@ function $parcel$export(e, n, v, s) {
9
9
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
10
  }
11
11
 
12
- $parcel$export(module.exports, "UNSTABLE_PortalProvider", () => $d7347c25ab757295$export$db995ea7163b4b67);
13
- $parcel$export(module.exports, "useUNSTABLE_PortalContext", () => $d7347c25ab757295$export$574e9b0fb070c3b0);
12
+ $parcel$export(module.exports, "UNSAFE_PortalProvider", () => $d7347c25ab757295$export$78efe591171d7d45);
13
+ $parcel$export(module.exports, "useUNSAFE_PortalContext", () => $d7347c25ab757295$export$9fc1347d4195ccb3);
14
14
  /*
15
15
  * Copyright 2024 Adobe. All rights reserved.
16
16
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -23,16 +23,16 @@ $parcel$export(module.exports, "useUNSTABLE_PortalContext", () => $d7347c25ab757
23
23
  * governing permissions and limitations under the License.
24
24
  */
25
25
  const $d7347c25ab757295$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $b2rU6$react.createContext)({});
26
- function $d7347c25ab757295$export$db995ea7163b4b67(props) {
26
+ function $d7347c25ab757295$export$78efe591171d7d45(props) {
27
27
  let { getContainer: getContainer } = props;
28
- let { getContainer: ctxGetContainer } = $d7347c25ab757295$export$574e9b0fb070c3b0();
28
+ let { getContainer: ctxGetContainer } = $d7347c25ab757295$export$9fc1347d4195ccb3();
29
29
  return /*#__PURE__*/ (0, ($parcel$interopDefault($b2rU6$react))).createElement($d7347c25ab757295$export$60d741e20e0aa309.Provider, {
30
30
  value: {
31
31
  getContainer: getContainer === null ? undefined : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
32
32
  }
33
33
  }, props.children);
34
34
  }
35
- function $d7347c25ab757295$export$574e9b0fb070c3b0() {
35
+ function $d7347c25ab757295$export$9fc1347d4195ccb3() {
36
36
  var _useContext;
37
37
  return (_useContext = (0, $b2rU6$react.useContext)($d7347c25ab757295$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
38
38
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AASM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAuB,CAAC;AAE1D,SAAS,0CAAwB,KAAkD;IACxF,IAAI,gBAAC,YAAY,EAAC,GAAG;IACrB,IAAI,EAAC,cAAc,eAAe,EAAC,GAAG;IACtC,qBACE,0DAAC,0CAAc,QAAQ;QAAC,OAAO;YAAC,cAAc,iBAAiB,OAAO,YAAY,yBAAA,0BAAA,eAAgB;QAAe;OAC9G,MAAM,QAAQ;AAGrB;AAEO,SAAS;QACP;IAAP,OAAO,CAAA,cAAA,CAAA,GAAA,uBAAS,EAAE,wDAAX,yBAAA,cAA6B,CAAC;AACvC","sources":["packages/@react-aria/overlays/src/PortalProvider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {createContext, ReactNode, useContext} from 'react';\n\nexport interface PortalProviderProps {\n /* Should return the element where we should portal to. Can clear the context by passing null. */\n getContainer?: () => HTMLElement | null\n}\n\nexport const PortalContext = createContext<PortalProviderProps>({});\n\nexport function UNSTABLE_PortalProvider(props: PortalProviderProps & {children: ReactNode}) {\n let {getContainer} = props;\n let {getContainer: ctxGetContainer} = useUNSTABLE_PortalContext();\n return (\n <PortalContext.Provider value={{getContainer: getContainer === null ? undefined : getContainer ?? ctxGetContainer}}>\n {props.children}\n </PortalContext.Provider>\n );\n}\n\nexport function useUNSTABLE_PortalContext() {\n return useContext(PortalContext) ?? {};\n}\n"],"names":[],"version":3,"file":"PortalProvider.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA8B,CAAC;AAKjE,SAAS,0CAAsB,KAA0B;IAC9D,IAAI,gBAAC,YAAY,EAAC,GAAG;IACrB,IAAI,EAAC,cAAc,eAAe,EAAC,GAAG;IACtC,qBACE,0DAAC,0CAAc,QAAQ;QAAC,OAAO;YAAC,cAAc,iBAAiB,OAAO,YAAY,yBAAA,0BAAA,eAAgB;QAAe;OAC9G,MAAM,QAAQ;AAGrB;AAEO,SAAS;QACP;IAAP,OAAO,CAAA,cAAA,CAAA,GAAA,uBAAS,EAAE,wDAAX,yBAAA,cAA6B,CAAC;AACvC","sources":["packages/@react-aria/overlays/src/PortalProvider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {createContext, ReactNode, useContext} from 'react';\n\nexport interface PortalProviderProps {\n /** Should return the element where we should portal to. Can clear the context by passing null. */\n getContainer?: () => HTMLElement | null,\n /** The content of the PortalProvider. Should contain all children that want to portal their overlays to the element returned by the provided `getContainer()`. */\n children: ReactNode\n}\n\nexport interface PortalProviderContextValue extends Omit<PortalProviderProps, 'children'>{};\n\nexport const PortalContext = createContext<PortalProviderContextValue>({});\n\n/**\n * Sets the portal container for all overlay elements rendered by its children.\n */\nexport function UNSAFE_PortalProvider(props: PortalProviderProps): ReactNode {\n let {getContainer} = props;\n let {getContainer: ctxGetContainer} = useUNSAFE_PortalContext();\n return (\n <PortalContext.Provider value={{getContainer: getContainer === null ? undefined : getContainer ?? ctxGetContainer}}>\n {props.children}\n </PortalContext.Provider>\n );\n}\n\nexport function useUNSAFE_PortalContext(): PortalProviderContextValue {\n return useContext(PortalContext) ?? {};\n}\n"],"names":[],"version":3,"file":"PortalProvider.main.js.map"}
@@ -12,20 +12,20 @@ import $7yuSY$react, {createContext as $7yuSY$createContext, useContext as $7yuS
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
  const $96b38030c423d352$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $7yuSY$createContext)({});
15
- function $96b38030c423d352$export$db995ea7163b4b67(props) {
15
+ function $96b38030c423d352$export$78efe591171d7d45(props) {
16
16
  let { getContainer: getContainer } = props;
17
- let { getContainer: ctxGetContainer } = $96b38030c423d352$export$574e9b0fb070c3b0();
17
+ let { getContainer: ctxGetContainer } = $96b38030c423d352$export$9fc1347d4195ccb3();
18
18
  return /*#__PURE__*/ (0, $7yuSY$react).createElement($96b38030c423d352$export$60d741e20e0aa309.Provider, {
19
19
  value: {
20
20
  getContainer: getContainer === null ? undefined : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
21
21
  }
22
22
  }, props.children);
23
23
  }
24
- function $96b38030c423d352$export$574e9b0fb070c3b0() {
24
+ function $96b38030c423d352$export$9fc1347d4195ccb3() {
25
25
  var _useContext;
26
26
  return (_useContext = (0, $7yuSY$useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
27
27
  }
28
28
 
29
29
 
30
- export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
30
+ export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$78efe591171d7d45 as UNSAFE_PortalProvider, $96b38030c423d352$export$9fc1347d4195ccb3 as useUNSAFE_PortalContext};
31
31
  //# sourceMappingURL=PortalProvider.module.js.map
@@ -12,20 +12,20 @@ import $7yuSY$react, {createContext as $7yuSY$createContext, useContext as $7yuS
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
  const $96b38030c423d352$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $7yuSY$createContext)({});
15
- function $96b38030c423d352$export$db995ea7163b4b67(props) {
15
+ function $96b38030c423d352$export$78efe591171d7d45(props) {
16
16
  let { getContainer: getContainer } = props;
17
- let { getContainer: ctxGetContainer } = $96b38030c423d352$export$574e9b0fb070c3b0();
17
+ let { getContainer: ctxGetContainer } = $96b38030c423d352$export$9fc1347d4195ccb3();
18
18
  return /*#__PURE__*/ (0, $7yuSY$react).createElement($96b38030c423d352$export$60d741e20e0aa309.Provider, {
19
19
  value: {
20
20
  getContainer: getContainer === null ? undefined : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
21
21
  }
22
22
  }, props.children);
23
23
  }
24
- function $96b38030c423d352$export$574e9b0fb070c3b0() {
24
+ function $96b38030c423d352$export$9fc1347d4195ccb3() {
25
25
  var _useContext;
26
26
  return (_useContext = (0, $7yuSY$useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
27
27
  }
28
28
 
29
29
 
30
- export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
30
+ export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$78efe591171d7d45 as UNSAFE_PortalProvider, $96b38030c423d352$export$9fc1347d4195ccb3 as useUNSAFE_PortalContext};
31
31
  //# sourceMappingURL=PortalProvider.module.js.map
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AASM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAuB,CAAC;AAE1D,SAAS,0CAAwB,KAAkD;IACxF,IAAI,gBAAC,YAAY,EAAC,GAAG;IACrB,IAAI,EAAC,cAAc,eAAe,EAAC,GAAG;IACtC,qBACE,gCAAC,0CAAc,QAAQ;QAAC,OAAO;YAAC,cAAc,iBAAiB,OAAO,YAAY,yBAAA,0BAAA,eAAgB;QAAe;OAC9G,MAAM,QAAQ;AAGrB;AAEO,SAAS;QACP;IAAP,OAAO,CAAA,cAAA,CAAA,GAAA,iBAAS,EAAE,wDAAX,yBAAA,cAA6B,CAAC;AACvC","sources":["packages/@react-aria/overlays/src/PortalProvider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {createContext, ReactNode, useContext} from 'react';\n\nexport interface PortalProviderProps {\n /* Should return the element where we should portal to. Can clear the context by passing null. */\n getContainer?: () => HTMLElement | null\n}\n\nexport const PortalContext = createContext<PortalProviderProps>({});\n\nexport function UNSTABLE_PortalProvider(props: PortalProviderProps & {children: ReactNode}) {\n let {getContainer} = props;\n let {getContainer: ctxGetContainer} = useUNSTABLE_PortalContext();\n return (\n <PortalContext.Provider value={{getContainer: getContainer === null ? undefined : getContainer ?? ctxGetContainer}}>\n {props.children}\n </PortalContext.Provider>\n );\n}\n\nexport function useUNSTABLE_PortalContext() {\n return useContext(PortalContext) ?? {};\n}\n"],"names":[],"version":3,"file":"PortalProvider.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA8B,CAAC;AAKjE,SAAS,0CAAsB,KAA0B;IAC9D,IAAI,gBAAC,YAAY,EAAC,GAAG;IACrB,IAAI,EAAC,cAAc,eAAe,EAAC,GAAG;IACtC,qBACE,gCAAC,0CAAc,QAAQ;QAAC,OAAO;YAAC,cAAc,iBAAiB,OAAO,YAAY,yBAAA,0BAAA,eAAgB;QAAe;OAC9G,MAAM,QAAQ;AAGrB;AAEO,SAAS;QACP;IAAP,OAAO,CAAA,cAAA,CAAA,GAAA,iBAAS,EAAE,wDAAX,yBAAA,cAA6B,CAAC;AACvC","sources":["packages/@react-aria/overlays/src/PortalProvider.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {createContext, ReactNode, useContext} from 'react';\n\nexport interface PortalProviderProps {\n /** Should return the element where we should portal to. Can clear the context by passing null. */\n getContainer?: () => HTMLElement | null,\n /** The content of the PortalProvider. Should contain all children that want to portal their overlays to the element returned by the provided `getContainer()`. */\n children: ReactNode\n}\n\nexport interface PortalProviderContextValue extends Omit<PortalProviderProps, 'children'>{};\n\nexport const PortalContext = createContext<PortalProviderContextValue>({});\n\n/**\n * Sets the portal container for all overlay elements rendered by its children.\n */\nexport function UNSAFE_PortalProvider(props: PortalProviderProps): ReactNode {\n let {getContainer} = props;\n let {getContainer: ctxGetContainer} = useUNSAFE_PortalContext();\n return (\n <PortalContext.Provider value={{getContainer: getContainer === null ? undefined : getContainer ?? ctxGetContainer}}>\n {props.children}\n </PortalContext.Provider>\n );\n}\n\nexport function useUNSAFE_PortalContext(): PortalProviderCont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,KAAK,IAAI,QAAQ,YAAa;YAC5B,IAAI,QAAQ,kCAAY,GAAG,CAAC;YAC5B,IAAI,SAAS,MACX;YAEF,IAAI,UAAU,GAAG;gBACf,KAAK,eAAe,CAAC;gBACrB,kCAAY,MAAM,CAAC;YACrB,OACE,kCAAY,GAAG,CAAC,MAAM,QAAQ;QAElC;QAEA,mEAAmE;QACnE,IAAI,oBAAoB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,EAAE;YAC/D,oCAAc,GAAG;YACjB,IAAI,oCAAc,MAAM,EACtB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,CAAC,OAAO;QAEnD,OACE,oCAAc,MAAM,CAAC,oCAAc,OAAO,CAAC,kBAAkB;IAEjE;AACF;AAEO,SAAS,0CAAY,OAAgB;IAC1C,IAAI,WAAW,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE;IACtD,IAAI,YAAY,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU;QACnD,SAAS,YAAY,CAAC,GAAG,CAAC;QAC1B,OAAO;YACL,SAAS,YAAY,CAAC,MAAM,CAAC;QAC/B;IACF;AACF","sources":["packages/@react-aria/overlays/src/ariaHideOutside.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Keeps a ref count of all hidden elements. Added to when hiding an element, and\n// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.\nlet refCountMap = new WeakMap<Element, number>();\ninterface ObserverWrapper {\n visibleNodes: Set<Element>,\n hiddenNodes: Set<Element>,\n observe: () => void,\n disconnect: () => void\n}\nlet observerStack: Array<ObserverWrapper> = [];\n\n/**\n * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,\n * and returns a function to revert these changes. In addition, changes to the DOM are watched\n * and new elements outside the targets are automatically hidden.\n * @param targets - The elements that should remain visible.\n * @param root - Nothing will be hidden above this element.\n * @returns - A function to restore all hidden elements.\n */\nexport function ariaHideOutside(targets: Element[], root = document.body) {\n let visibleNodes = new Set<Element>(targets);\n let hiddenNodes = new Set<Element>();\n\n let walk = (root: Element) => {\n // Keep live announcer and top layer elements (e.g. toasts) visible.\n for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]')) {\n visibleNodes.add(element);\n }\n\n let acceptNode = (node: Element) => {\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is\n // made for elements with role=\"row\" since VoiceOver on iOS has issues hiding elements with role=\"row\".\n // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).\n if (\n visibleNodes.has(node) ||\n (node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row')\n ) {\n return NodeFilter.FILTER_REJECT;\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n for (let target of visibleNodes) {\n if (node.contains(target)) {\n return NodeFilter.FILTER_SKIP;\n }\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {acceptNode}\n );\n\n // TreeWalker does not include the root.\n let acceptRoot = acceptNode(root);\n if (acceptRoot === NodeFilter.FILTER_ACCEPT) {\n hide(root);\n }\n\n if (acceptRoot !== NodeFilter.FILTER_REJECT) {\n let node = walker.nextNode() as Element;\n while (node != null) {\n hide(node);\n node = walker.nextNode() as Element;\n }\n }\n };\n\n let hide = (node: Element) => {\n let refCount = refCountMap.get(node) ?? 0;\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) {\n return;\n }\n\n if (refCount === 0) {\n node.setAttribute('aria-hidden', 'true');\n }\n\n hiddenNodes.add(node);\n refCountMap.set(node, refCount + 1);\n };\n\n // If there is already a MutationObserver listening from a previous call,\n // disconnect it so the new on takes over.\n if (observerStack.length) {\n observerStack[observerStack.length - 1].disconnect();\n }\n\n walk(root);\n\n let observer = new MutationObserver(changes => {\n for (let change of changes) {\n if (change.type !== 'childList' || change.addedNodes.length === 0) {\n continue;\n }\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some(node => node.contains(change.target))) {\n for (let node of change.removedNodes) {\n if (node instanceof Element) {\n visibleNodes.delete(node);\n hiddenNodes.delete(node);\n }\n }\n\n for (let node of change.addedNodes) {\n if (\n (node instanceof HTMLElement || node instanceof SVGElement) &&\n (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')\n ) {\n visibleNodes.add(node);\n } else if (node instanceof Element) {\n walk(node);\n }\n }\n }\n }\n });\n\n observer.observe(root, {childList: true, subtree: true});\n\n let observerWrapper: ObserverWrapper = {\n visibleNodes,\n hiddenNodes,\n observe() {\n observer.observe(root, {childList: true, subtree: true});\n },\n disconnect() {\n observer.disconnect();\n }\n };\n\n observerStack.push(observerWrapper);\n\n return () => {\n observer.disconnect();\n\n for (let node of hiddenNodes) {\n let count = refCountMap.get(node);\n if (count == null) {\n continue;\n }\n if (count === 1) {\n node.removeAttribute('aria-hidden');\n refCountMap.delete(node);\n } else {\n refCountMap.set(node, count - 1);\n }\n }\n\n // Remove this observer from the stack, and start the previous one.\n if (observerWrapper === observerStack[observerStack.length - 1]) {\n observerStack.pop();\n if (observerStack.length) {\n observerStack[observerStack.length - 1].observe();\n }\n } else {\n observerStack.splice(observerStack.indexOf(observerWrapper), 1);\n }\n };\n}\n\nexport function keepVisible(element: Element) {\n let observer = observerStack[observerStack.length - 1];\n if (observer && !observer.visibleNodes.has(element)) {\n observer.visibleNodes.add(element);\n return () => {\n observer.visibleNodes.delete(element);\n };\n }\n}\n"],"names":[],"version":3,"file":"ariaHideOutside.main.js.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC,GAED,iFAAiF;AACjF,uFAAuF;AACvF,IAAI,oCAAc,IAAI;AAOtB,IAAI,sCAAwC,EAAE;AAUvC,SAAS,0CAAgB,OAAkB,EAAE,OAAO,SAAS,IAAI;IACtE,IAAI,eAAe,IAAI,IAAa;IACpC,IAAI,cAAc,IAAI;IAEtB,IAAI,OAAO,CAAC;QACV,oEAAoE;QACpE,KAAK,IAAI,WAAW,KAAK,gBAAgB,CAAC,sDACxC,aAAa,GAAG,CAAC;QAGnB,IAAI,aAAa,CAAC;YAChB,yFAAyF;YACzF,2FAA2F;YAC3F,uGAAuG;YACvG,2GAA2G;YAC3G,IACE,aAAa,GAAG,CAAC,SAChB,KAAK,aAAa,IAAI,YAAY,GAAG,CAAC,KAAK,aAAa,KAAK,KAAK,aAAa,CAAC,YAAY,CAAC,YAAY,OAE1G,OAAO,WAAW,aAAa;YAGjC,oFAAoF;YACpF,KAAK,IAAI,UAAU,aAAc;gBAC/B,IAAI,KAAK,QAAQ,CAAC,SAChB,OAAO,WAAW,WAAW;YAEjC;YAEA,OAAO,WAAW,aAAa;QACjC;QAEA,IAAI,SAAS,SAAS,gBAAgB,CACpC,MACA,WAAW,YAAY,EACvB;wBAAC;QAAU;QAGb,wCAAwC;QACxC,IAAI,aAAa,WAAW;QAC5B,IAAI,eAAe,WAAW,aAAa,EACzC,KAAK;QAGP,IAAI,eAAe,WAAW,aAAa,EAAE;YAC3C,IAAI,OAAO,OAAO,QAAQ;YAC1B,MAAO,QAAQ,KAAM;gBACnB,KAAK;gBACL,OAAO,OAAO,QAAQ;YACxB;QACF;IACF;IAEA,IAAI,OAAO,CAAC;YACK;QAAf,IAAI,WAAW,CAAA,mBAAA,kCAAY,GAAG,CAAC,mBAAhB,8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C;IAEnB,OAAO;QACL,SAAS,UAAU;QAEnB,KAAK,IAAI,QAAQ,YAAa;YAC5B,IAAI,QAAQ,kCAAY,GAAG,CAAC;YAC5B,IAAI,SAAS,MACX;YAEF,IAAI,UAAU,GAAG;gBACf,KAAK,eAAe,CAAC;gBACrB,kCAAY,MAAM,CAAC;YACrB,OACE,kCAAY,GAAG,CAAC,MAAM,QAAQ;QAElC;QAEA,mEAAmE;QACnE,IAAI,oBAAoB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,EAAE;YAC/D,oCAAc,GAAG;YACjB,IAAI,oCAAc,MAAM,EACtB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,CAAC,OAAO;QAEnD,OACE,oCAAc,MAAM,CAAC,oCAAc,OAAO,CAAC,kBAAkB;IAEjE;AACF;AAEO,SAAS,0CAAY,OAAgB;IAC1C,IAAI,WAAW,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE;IACtD,IAAI,YAAY,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU;QACnD,SAAS,YAAY,CAAC,GAAG,CAAC;QAC1B,OAAO;YACL,SAAS,YAAY,CAAC,MAAM,CAAC;QAC/B;IACF;AACF","sources":["packages/@react-aria/overlays/src/ariaHideOutside.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Keeps a ref count of all hidden elements. Added to when hiding an element, and\n// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.\nlet refCountMap = new WeakMap<Element, number>();\ninterface ObserverWrapper {\n visibleNodes: Set<Element>,\n hiddenNodes: Set<Element>,\n observe: () => void,\n disconnect: () => void\n}\nlet observerStack: Array<ObserverWrapper> = [];\n\n/**\n * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,\n * and returns a function to revert these changes. In addition, changes to the DOM are watched\n * and new elements outside the targets are automatically hidden.\n * @param targets - The elements that should remain visible.\n * @param root - Nothing will be hidden above this element.\n * @returns - A function to restore all hidden elements.\n */\nexport function ariaHideOutside(targets: Element[], root = document.body) {\n let visibleNodes = new Set<Element>(targets);\n let hiddenNodes = new Set<Element>();\n\n let walk = (root: Element) => {\n // Keep live announcer and top layer elements (e.g. toasts) visible.\n for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]')) {\n visibleNodes.add(element);\n }\n\n let acceptNode = (node: Element) => {\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is\n // made for elements with role=\"row\" since VoiceOver on iOS has issues hiding elements with role=\"row\".\n // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).\n if (\n visibleNodes.has(node) ||\n (node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row')\n ) {\n return NodeFilter.FILTER_REJECT;\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n for (let target of visibleNodes) {\n if (node.contains(target)) {\n return NodeFilter.FILTER_SKIP;\n }\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {acceptNode}\n );\n\n // TreeWalker does not include the root.\n let acceptRoot = acceptNode(root);\n if (acceptRoot === NodeFilter.FILTER_ACCEPT) {\n hide(root);\n }\n\n if (acceptRoot !== NodeFilter.FILTER_REJECT) {\n let node = walker.nextNode() as Element;\n while (node != null) {\n hide(node);\n node = walker.nextNode() as Element;\n }\n }\n };\n\n let hide = (node: Element) => {\n let refCount = refCountMap.get(node) ?? 0;\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) {\n return;\n }\n\n if (refCount === 0) {\n node.setAttribute('aria-hidden', 'true');\n }\n\n hiddenNodes.add(node);\n refCountMap.set(node, refCount + 1);\n };\n\n // If there is already a MutationObserver listening from a previous call,\n // disconnect it so the new on takes over.\n if (observerStack.length) {\n observerStack[observerStack.length - 1].disconnect();\n }\n\n walk(root);\n\n let observer = new MutationObserver(changes => {\n for (let change of changes) {\n if (change.type !== 'childList' || change.addedNodes.length === 0) {\n continue;\n }\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some(node => node.contains(change.target))) {\n for (let node of change.removedNodes) {\n if (node instanceof Element) {\n visibleNodes.delete(node);\n hiddenNodes.delete(node);\n }\n }\n\n for (let node of change.addedNodes) {\n if (\n (node instanceof HTMLElement || node instanceof SVGElement) &&\n (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')\n ) {\n visibleNodes.add(node);\n } else if (node instanceof Element) {\n walk(node);\n }\n }\n }\n }\n });\n\n observer.observe(root, {childList: true, subtree: true});\n\n let observerWrapper: ObserverWrapper = {\n visibleNodes,\n hiddenNodes,\n observe() {\n observer.observe(root, {childList: true, subtree: true});\n },\n disconnect() {\n observer.disconnect();\n }\n };\n\n observerStack.push(observerWrapper);\n\n return (): void => {\n observer.disconnect();\n\n for (let node of hiddenNodes) {\n let count = refCountMap.get(node);\n if (count == null) {\n continue;\n }\n if (count === 1) {\n node.removeAttribute('aria-hidden');\n refCountMap.delete(node);\n } else {\n refCountMap.set(node, count - 1);\n }\n }\n\n // Remove this observer from the stack, and start the previous one.\n if (observerWrapper === observerStack[observerStack.length - 1]) {\n observerStack.pop();\n if (observerStack.length) {\n observerStack[observerStack.length - 1].observe();\n }\n } else {\n observerStack.splice(observerStack.indexOf(observerWrapper), 1);\n }\n };\n}\n\nexport function keepVisible(element: Element) {\n let observer = observerStack[observerStack.length - 1];\n if (observer && !observer.visibleNodes.has(element)) {\n observer.visibleNodes.add(element);\n return () => {\n observer.visibleNodes.delete(element);\n };\n }\n}\n"],"names":[],"version":3,"file":"ariaHideOutside.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAED,iFAAiF;AACjF,uFAAuF;AACvF,IAAI,oCAAc,IAAI;AAOtB,IAAI,sCAAwC,EAAE;AAUvC,SAAS,0CAAgB,OAAkB,EAAE,OAAO,SAAS,IAAI;IACtE,IAAI,eAAe,IAAI,IAAa;IACpC,IAAI,cAAc,IAAI;IAEtB,IAAI,OAAO,CAAC;QACV,oEAAoE;QACpE,KAAK,IAAI,WAAW,KAAK,gBAAgB,CAAC,sDACxC,aAAa,GAAG,CAAC;QAGnB,IAAI,aAAa,CAAC;YAChB,yFAAyF;YACzF,2FAA2F;YAC3F,uGAAuG;YACvG,2GAA2G;YAC3G,IACE,aAAa,GAAG,CAAC,SAChB,KAAK,aAAa,IAAI,YAAY,GAAG,CAAC,KAAK,aAAa,KAAK,KAAK,aAAa,CAAC,YAAY,CAAC,YAAY,OAE1G,OAAO,WAAW,aAAa;YAGjC,oFAAoF;YACpF,KAAK,IAAI,UAAU,aAAc;gBAC/B,IAAI,KAAK,QAAQ,CAAC,SAChB,OAAO,WAAW,WAAW;YAEjC;YAEA,OAAO,WAAW,aAAa;QACjC;QAEA,IAAI,SAAS,SAAS,gBAAgB,CACpC,MACA,WAAW,YAAY,EACvB;wBAAC;QAAU;QAGb,wCAAwC;QACxC,IAAI,aAAa,WAAW;QAC5B,IAAI,eAAe,WAAW,aAAa,EACzC,KAAK;QAGP,IAAI,eAAe,WAAW,aAAa,EAAE;YAC3C,IAAI,OAAO,OAAO,QAAQ;YAC1B,MAAO,QAAQ,KAAM;gBACnB,KAAK;gBACL,OAAO,OAAO,QAAQ;YACxB;QACF;IACF;IAEA,IAAI,OAAO,CAAC;YACK;QAAf,IAAI,W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,SAAS,UAAU;QACrB;IACF;IAEA,oCAAc,IAAI,CAAC;IAEnB,OAAO;QACL,SAAS,UAAU;QAEnB,KAAK,IAAI,QAAQ,YAAa;YAC5B,IAAI,QAAQ,kCAAY,GAAG,CAAC;YAC5B,IAAI,SAAS,MACX;YAEF,IAAI,UAAU,GAAG;gBACf,KAAK,eAAe,CAAC;gBACrB,kCAAY,MAAM,CAAC;YACrB,OACE,kCAAY,GAAG,CAAC,MAAM,QAAQ;QAElC;QAEA,mEAAmE;QACnE,IAAI,oBAAoB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,EAAE;YAC/D,oCAAc,GAAG;YACjB,IAAI,oCAAc,MAAM,EACtB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,CAAC,OAAO;QAEnD,OACE,oCAAc,MAAM,CAAC,oCAAc,OAAO,CAAC,kBAAkB;IAEjE;AACF;AAEO,SAAS,0CAAY,OAAgB;IAC1C,IAAI,WAAW,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE;IACtD,IAAI,YAAY,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU;QACnD,SAAS,YAAY,CAAC,GAAG,CAAC;QAC1B,OAAO;YACL,SAAS,YAAY,CAAC,MAAM,CAAC;QAC/B;IACF;AACF","sources":["packages/@react-aria/overlays/src/ariaHideOutside.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Keeps a ref count of all hidden elements. Added to when hiding an element, and\n// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.\nlet refCountMap = new WeakMap<Element, number>();\ninterface ObserverWrapper {\n visibleNodes: Set<Element>,\n hiddenNodes: Set<Element>,\n observe: () => void,\n disconnect: () => void\n}\nlet observerStack: Array<ObserverWrapper> = [];\n\n/**\n * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,\n * and returns a function to revert these changes. In addition, changes to the DOM are watched\n * and new elements outside the targets are automatically hidden.\n * @param targets - The elements that should remain visible.\n * @param root - Nothing will be hidden above this element.\n * @returns - A function to restore all hidden elements.\n */\nexport function ariaHideOutside(targets: Element[], root = document.body) {\n let visibleNodes = new Set<Element>(targets);\n let hiddenNodes = new Set<Element>();\n\n let walk = (root: Element) => {\n // Keep live announcer and top layer elements (e.g. toasts) visible.\n for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]')) {\n visibleNodes.add(element);\n }\n\n let acceptNode = (node: Element) => {\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is\n // made for elements with role=\"row\" since VoiceOver on iOS has issues hiding elements with role=\"row\".\n // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).\n if (\n visibleNodes.has(node) ||\n (node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row')\n ) {\n return NodeFilter.FILTER_REJECT;\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n for (let target of visibleNodes) {\n if (node.contains(target)) {\n return NodeFilter.FILTER_SKIP;\n }\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {acceptNode}\n );\n\n // TreeWalker does not include the root.\n let acceptRoot = acceptNode(root);\n if (acceptRoot === NodeFilter.FILTER_ACCEPT) {\n hide(root);\n }\n\n if (acceptRoot !== NodeFilter.FILTER_REJECT) {\n let node = walker.nextNode() as Element;\n while (node != null) {\n hide(node);\n node = walker.nextNode() as Element;\n }\n }\n };\n\n let hide = (node: Element) => {\n let refCount = refCountMap.get(node) ?? 0;\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) {\n return;\n }\n\n if (refCount === 0) {\n node.setAttribute('aria-hidden', 'true');\n }\n\n hiddenNodes.add(node);\n refCountMap.set(node, refCount + 1);\n };\n\n // If there is already a MutationObserver listening from a previous call,\n // disconnect it so the new on takes over.\n if (observerStack.length) {\n observerStack[observerStack.length - 1].disconnect();\n }\n\n walk(root);\n\n let observer = new MutationObserver(changes => {\n for (let change of changes) {\n if (change.type !== 'childList' || change.addedNodes.length === 0) {\n continue;\n }\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some(node => node.contains(change.target))) {\n for (let node of change.removedNodes) {\n if (node instanceof Element) {\n visibleNodes.delete(node);\n hiddenNodes.delete(node);\n }\n }\n\n for (let node of change.addedNodes) {\n if (\n (node instanceof HTMLElement || node instanceof SVGElement) &&\n (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')\n ) {\n visibleNodes.add(node);\n } else if (node instanceof Element) {\n walk(node);\n }\n }\n }\n }\n });\n\n observer.observe(root, {childList: true, subtree: true});\n\n let observerWrapper: ObserverWrapper = {\n visibleNodes,\n hiddenNodes,\n observe() {\n observer.observe(root, {childList: true, subtree: true});\n },\n disconnect() {\n observer.disconnect();\n }\n };\n\n observerStack.push(observerWrapper);\n\n return () => {\n observer.disconnect();\n\n for (let node of hiddenNodes) {\n let count = refCountMap.get(node);\n if (count == null) {\n continue;\n }\n if (count === 1) {\n node.removeAttribute('aria-hidden');\n refCountMap.delete(node);\n } else {\n refCountMap.set(node, count - 1);\n }\n }\n\n // Remove this observer from the stack, and start the previous one.\n if (observerWrapper === observerStack[observerStack.length - 1]) {\n observerStack.pop();\n if (observerStack.length) {\n observerStack[observerStack.length - 1].observe();\n }\n } else {\n observerStack.splice(observerStack.indexOf(observerWrapper), 1);\n }\n };\n}\n\nexport function keepVisible(element: Element) {\n let observer = observerStack[observerStack.length - 1];\n if (observer && !observer.visibleNodes.has(element)) {\n observer.visibleNodes.add(element);\n return () => {\n observer.visibleNodes.delete(element);\n };\n }\n}\n"],"names":[],"version":3,"file":"ariaHideOutside.module.js.map"}
1
+ {"mappings":"AAAA;;;;;;;;;;CAUC,GAED,iFAAiF;AACjF,uFAAuF;AACvF,IAAI,oCAAc,IAAI;AAOtB,IAAI,sCAAwC,EAAE;AAUvC,SAAS,0CAAgB,OAAkB,EAAE,OAAO,SAAS,IAAI;IACtE,IAAI,eAAe,IAAI,IAAa;IACpC,IAAI,cAAc,IAAI;IAEtB,IAAI,OAAO,CAAC;QACV,oEAAoE;QACpE,KAAK,IAAI,WAAW,KAAK,gBAAgB,CAAC,sDACxC,aAAa,GAAG,CAAC;QAGnB,IAAI,aAAa,CAAC;YAChB,yFAAyF;YACzF,2FAA2F;YAC3F,uGAAuG;YACvG,2GAA2G;YAC3G,IACE,aAAa,GAAG,CAAC,SAChB,KAAK,aAAa,IAAI,YAAY,GAAG,CAAC,KAAK,aAAa,KAAK,KAAK,aAAa,CAAC,YAAY,CAAC,YAAY,OAE1G,OAAO,WAAW,aAAa;YAGjC,oFAAoF;YACpF,KAAK,IAAI,UAAU,aAAc;gBAC/B,IAAI,KAAK,QAAQ,CAAC,SAChB,OAAO,WAAW,WAAW;YAEjC;YAEA,OAAO,WAAW,aAAa;QACjC;QAEA,IAAI,SAAS,SAAS,gBAAgB,CACpC,MACA,WAAW,YAAY,EACvB;wBAAC;QAAU;QAGb,wCAAwC;QACxC,IAAI,aAAa,WAAW;QAC5B,IAAI,eAAe,WAAW,aAAa,EACzC,KAAK;QAGP,IAAI,eAAe,WAAW,aAAa,EAAE;YAC3C,IAAI,OAAO,OAAO,QAAQ;YAC1B,MAAO,QAAQ,KAAM;gBACnB,KAAK;gBACL,OAAO,OAAO,QAAQ;YACxB;QACF;IACF;IAEA,IAAI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AAM,SAAS;YAAI;QACxD;QACA;YACE,SAAS,UAAU;QACrB;IACF;IAEA,oCAAc,IAAI,CAAC;IAEnB,OAAO;QACL,SAAS,UAAU;QAEnB,KAAK,IAAI,QAAQ,YAAa;YAC5B,IAAI,QAAQ,kCAAY,GAAG,CAAC;YAC5B,IAAI,SAAS,MACX;YAEF,IAAI,UAAU,GAAG;gBACf,KAAK,eAAe,CAAC;gBACrB,kCAAY,MAAM,CAAC;YACrB,OACE,kCAAY,GAAG,CAAC,MAAM,QAAQ;QAElC;QAEA,mEAAmE;QACnE,IAAI,oBAAoB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,EAAE;YAC/D,oCAAc,GAAG;YACjB,IAAI,oCAAc,MAAM,EACtB,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE,CAAC,OAAO;QAEnD,OACE,oCAAc,MAAM,CAAC,oCAAc,OAAO,CAAC,kBAAkB;IAEjE;AACF;AAEO,SAAS,0CAAY,OAAgB;IAC1C,IAAI,WAAW,mCAAa,CAAC,oCAAc,MAAM,GAAG,EAAE;IACtD,IAAI,YAAY,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC,UAAU;QACnD,SAAS,YAAY,CAAC,GAAG,CAAC;QAC1B,OAAO;YACL,SAAS,YAAY,CAAC,MAAM,CAAC;QAC/B;IACF;AACF","sources":["packages/@react-aria/overlays/src/ariaHideOutside.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Keeps a ref count of all hidden elements. Added to when hiding an element, and\n// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.\nlet refCountMap = new WeakMap<Element, number>();\ninterface ObserverWrapper {\n visibleNodes: Set<Element>,\n hiddenNodes: Set<Element>,\n observe: () => void,\n disconnect: () => void\n}\nlet observerStack: Array<ObserverWrapper> = [];\n\n/**\n * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,\n * and returns a function to revert these changes. In addition, changes to the DOM are watched\n * and new elements outside the targets are automatically hidden.\n * @param targets - The elements that should remain visible.\n * @param root - Nothing will be hidden above this element.\n * @returns - A function to restore all hidden elements.\n */\nexport function ariaHideOutside(targets: Element[], root = document.body) {\n let visibleNodes = new Set<Element>(targets);\n let hiddenNodes = new Set<Element>();\n\n let walk = (root: Element) => {\n // Keep live announcer and top layer elements (e.g. toasts) visible.\n for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]')) {\n visibleNodes.add(element);\n }\n\n let acceptNode = (node: Element) => {\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is\n // made for elements with role=\"row\" since VoiceOver on iOS has issues hiding elements with role=\"row\".\n // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).\n if (\n visibleNodes.has(node) ||\n (node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row')\n ) {\n return NodeFilter.FILTER_REJECT;\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n for (let target of visibleNodes) {\n if (node.contains(target)) {\n return NodeFilter.FILTER_SKIP;\n }\n }\n\n return NodeFilter.FILTER_ACCEPT;\n };\n\n let walker = document.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n {acceptNode}\n );\n\n // TreeWalker does not include the root.\n let acceptRoot = acceptNode(root);\n if (acceptRoot === NodeFilter.FILTER_ACCEPT) {\n hide(root);\n }\n\n if (acceptRoot !== NodeFilter.FILTER_REJECT) {\n let node = walker.nextNode() as Element;\n while (node != null) {\n hide(node);\n node = walker.nextNode() as Element;\n }\n }\n };\n\n let hide = (node: Element) => {\n let refCount = refCountMap.get(node) ?? 0;\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) {\n return;\n }\n\n if (refCount === 0) {\n node.setAttribute('aria-hidden', 'true');\n }\n\n hiddenNodes.add(node);\n refCountMap.set(node, refCount + 1);\n };\n\n // If there is already a MutationObserver listening from a previous call,\n // disconnect it so the new on takes over.\n if (observerStack.length) {\n observerStack[observerStack.length - 1].disconnect();\n }\n\n walk(root);\n\n let observer = new MutationObserver(changes => {\n for (let change of changes) {\n if (change.type !== 'childList' || change.addedNodes.length === 0) {\n continue;\n }\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some(node => node.contains(change.target))) {\n for (let node of change.removedNodes) {\n if (node instanceof Element) {\n visibleNodes.delete(node);\n hiddenNodes.delete(node);\n }\n }\n\n for (let node of change.addedNodes) {\n if (\n (node instanceof HTMLElement || node instanceof SVGElement) &&\n (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')\n ) {\n visibleNodes.add(node);\n } else if (node instanceof Element) {\n walk(node);\n }\n }\n }\n }\n });\n\n observer.observe(root, {childList: true, subtree: true});\n\n let observerWrapper: ObserverWrapper = {\n visibleNodes,\n hiddenNodes,\n observe() {\n observer.observe(root, {childList: true, subtree: true});\n },\n disconnect() {\n observer.disconnect();\n }\n };\n\n observerStack.push(observerWrapper);\n\n return (): void => {\n observer.disconnect();\n\n for (let node of hiddenNodes) {\n let count = refCountMap.get(node);\n if (count == null) {\n continue;\n }\n if (count === 1) {\n node.removeAttribute('aria-hidden');\n refCountMap.delete(node);\n } else {\n refCountMap.set(node, count - 1);\n }\n }\n\n // Remove this observer from the stack, and start the previous one.\n if (observerWrapper === observerStack[observerStack.length - 1]) {\n observerStack.pop();\n if (observerStack.length) {\n observerStack[observerStack.length - 1].observe();\n }\n } else {\n observerStack.splice(observerStack.indexOf(observerWrapper), 1);\n }\n };\n}\n\nexport function keepVisible(element: Element) {\n let observer = observerStack[observerStack.length - 1];\n if (observer && !observer.visibleNodes.has(element)) {\n observer.visibleNodes.add(element);\n return () => {\n observer.visibleNodes.delete(element);\n };\n }\n}\n"],"names":[],"version":3,"file":"ariaHideOutside.module.js.map"}
package/dist/import.mjs CHANGED
@@ -8,7 +8,7 @@ import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ar
8
8
  import {usePopover as $f2f8a6077418541e$export$542a6fd13ac93354} from "./usePopover.mjs";
9
9
  import {useModalOverlay as $8ac8429251c45e4b$export$dbc0f175b25fb0fb} from "./useModalOverlay.mjs";
10
10
  import {Overlay as $337b884510726a0d$export$c6fdb837b070b4ff, useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.mjs";
11
- import {UNSTABLE_PortalProvider as $96b38030c423d352$export$db995ea7163b4b67, useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.mjs";
11
+ import {UNSAFE_PortalProvider as $96b38030c423d352$export$78efe591171d7d45, useUNSAFE_PortalContext as $96b38030c423d352$export$9fc1347d4195ccb3} from "./PortalProvider.mjs";
12
12
 
13
13
  /*
14
14
  * Copyright 2020 Adobe. All rights reserved.
@@ -33,5 +33,5 @@ import {UNSTABLE_PortalProvider as $96b38030c423d352$export$db995ea7163b4b67, us
33
33
 
34
34
 
35
35
 
36
- export {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $f2f8a6077418541e$export$542a6fd13ac93354 as usePopover, $8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
36
+ export {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $f2f8a6077418541e$export$542a6fd13ac93354 as usePopover, $8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain, $96b38030c423d352$export$78efe591171d7d45 as UNSAFE_PortalProvider, $96b38030c423d352$export$9fc1347d4195ccb3 as useUNSAFE_PortalContext};
37
37
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -30,8 +30,8 @@ $parcel$export(module.exports, "usePopover", () => $6c2dfcdee3e15e20$exports.use
30
30
  $parcel$export(module.exports, "useModalOverlay", () => $11b7e0b04b421e95$exports.useModalOverlay);
31
31
  $parcel$export(module.exports, "Overlay", () => $745edbb83ab4296f$exports.Overlay);
32
32
  $parcel$export(module.exports, "useOverlayFocusContain", () => $745edbb83ab4296f$exports.useOverlayFocusContain);
33
- $parcel$export(module.exports, "UNSTABLE_PortalProvider", () => $d7347c25ab757295$exports.UNSTABLE_PortalProvider);
34
- $parcel$export(module.exports, "useUNSTABLE_PortalContext", () => $d7347c25ab757295$exports.useUNSTABLE_PortalContext);
33
+ $parcel$export(module.exports, "UNSAFE_PortalProvider", () => $d7347c25ab757295$exports.UNSAFE_PortalProvider);
34
+ $parcel$export(module.exports, "useUNSAFE_PortalContext", () => $d7347c25ab757295$exports.useUNSAFE_PortalContext);
35
35
  /*
36
36
  * Copyright 2020 Adobe. All rights reserved.
37
37
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSTABLE_PortalProvider, useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSAFE_PortalProvider, useUNSAFE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\nexport type {PortalProviderProps, PortalProviderContextValue} from './PortalProvider';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -8,7 +8,7 @@ import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ar
8
8
  import {usePopover as $f2f8a6077418541e$export$542a6fd13ac93354} from "./usePopover.module.js";
9
9
  import {useModalOverlay as $8ac8429251c45e4b$export$dbc0f175b25fb0fb} from "./useModalOverlay.module.js";
10
10
  import {Overlay as $337b884510726a0d$export$c6fdb837b070b4ff, useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.module.js";
11
- import {UNSTABLE_PortalProvider as $96b38030c423d352$export$db995ea7163b4b67, useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.module.js";
11
+ import {UNSAFE_PortalProvider as $96b38030c423d352$export$78efe591171d7d45, useUNSAFE_PortalContext as $96b38030c423d352$export$9fc1347d4195ccb3} from "./PortalProvider.module.js";
12
12
 
13
13
  /*
14
14
  * Copyright 2020 Adobe. All rights reserved.
@@ -33,5 +33,5 @@ import {UNSTABLE_PortalProvider as $96b38030c423d352$export$db995ea7163b4b67, us
33
33
 
34
34
 
35
35
 
36
- export {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $f2f8a6077418541e$export$542a6fd13ac93354 as usePopover, $8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
36
+ export {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $f2f8a6077418541e$export$542a6fd13ac93354 as usePopover, $8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain, $96b38030c423d352$export$78efe591171d7d45 as UNSAFE_PortalProvider, $96b38030c423d352$export$9fc1347d4195ccb3 as useUNSAFE_PortalContext};
37
37
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSTABLE_PortalProvider, useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSAFE_PortalProvider, useUNSAFE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\nexport type {PortalProviderProps, PortalProviderContextValue} from './PortalProvider';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -2,7 +2,7 @@ import { DOMAttributes, RefObject, DOMProps, AriaLabelingProps } from "@react-ty
2
2
  import { PlacementAxis, PositionProps } from "@react-types/overlays";
3
3
  import { AriaButtonProps } from "@react-types/button";
4
4
  import { OverlayTriggerState } from "@react-stately/overlays";
5
- import React, { AriaAttributes, ReactNode } from "react";
5
+ import React, { ReactNode, AriaAttributes } from "react";
6
6
  export interface AriaPositionProps extends PositionProps {
7
7
  /**
8
8
  * Cross size of the overlay arrow in pixels.
@@ -122,6 +122,19 @@ interface PreventScrollOptions {
122
122
  * shift due to the scrollbars disappearing.
123
123
  */
124
124
  export function usePreventScroll(options?: PreventScrollOptions): void;
125
+ export interface PortalProviderProps {
126
+ /** Should return the element where we should portal to. Can clear the context by passing null. */
127
+ getContainer?: () => HTMLElement | null;
128
+ /** The content of the PortalProvider. Should contain all children that want to portal their overlays to the element returned by the provided `getContainer()`. */
129
+ children: ReactNode;
130
+ }
131
+ export interface PortalProviderContextValue extends Omit<PortalProviderProps, 'children'> {
132
+ }
133
+ /**
134
+ * Sets the portal container for all overlay elements rendered by its children.
135
+ */
136
+ export function UNSAFE_PortalProvider(props: PortalProviderProps): ReactNode;
137
+ export function useUNSAFE_PortalContext(): PortalProviderContextValue;
125
138
  export interface ModalProviderProps extends DOMAttributes {
126
139
  children: ReactNode;
127
140
  }
@@ -133,7 +146,7 @@ export interface ModalProviderProps extends DOMAttributes {
133
146
  * subtree from screen readers. This is done using React context in order to account for things
134
147
  * like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
135
148
  */
136
- export function ModalProvider(props: ModalProviderProps): React.JSX.Element;
149
+ export function ModalProvider(props: ModalProviderProps): ReactNode;
137
150
  export interface ModalProviderAria {
138
151
  /**
139
152
  * Props to be spread on the container element.
@@ -153,11 +166,12 @@ export function useModalProvider(): ModalProviderAria;
153
166
  * if a modal or other overlay is opened. Only the top-most modal or
154
167
  * overlay should be accessible at once.
155
168
  */
156
- export function OverlayProvider(props: ModalProviderProps): React.JSX.Element;
169
+ export function OverlayProvider(props: ModalProviderProps): ReactNode;
157
170
  export interface OverlayContainerProps extends ModalProviderProps {
158
171
  /**
159
172
  * The container element in which the overlay portal will be placed.
160
173
  * @default document.body
174
+ * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.
161
175
  */
162
176
  portalContainer?: Element;
163
177
  }
@@ -196,7 +210,7 @@ export interface DismissButtonProps extends AriaLabelingProps, DOMProps {
196
210
  * users to dismiss a modal or popup when there is no visual
197
211
  * affordance to do so.
198
212
  */
199
- export function DismissButton(props: DismissButtonProps): React.JSX.Element;
213
+ export function DismissButton(props: DismissButtonProps): ReactNode;
200
214
  /**
201
215
  * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,
202
216
  * and returns a function to revert these changes. In addition, changes to the DOM are watched
@@ -262,13 +276,6 @@ export interface PopoverAria {
262
276
  * A popover is an overlay element positioned relative to a trigger.
263
277
  */
264
278
  export function usePopover(props: AriaPopoverProps, state: OverlayTriggerState): PopoverAria;
265
- interface PortalProviderProps {
266
- getContainer?: () => HTMLElement | null;
267
- }
268
- export function UNSTABLE_PortalProvider(props: PortalProviderProps & {
269
- children: ReactNode;
270
- }): React.JSX.Element;
271
- export function useUNSTABLE_PortalContext(): PortalProviderProps;
272
279
  export interface OverlayProps {
273
280
  /**
274
281
  * The container element in which the overlay portal will be placed.
@@ -297,7 +304,7 @@ export interface OverlayProps {
297
304
  * A container which renders an overlay such as a popover or modal in a portal,
298
305
  * and provides a focus scope for the child elements.
299
306
  */
300
- export function Overlay(props: OverlayProps): React.ReactPortal | null;
307
+ export function Overlay(props: OverlayProps): ReactNode | null;
301
308
  /** @private */
302
309
  export function useOverlayFocusContain(): void;
303
310
  export interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {
@@ -1 +1 @@
1
- {"mappings":";;;;;AEoBA,kCAAmC,SAAQ,aAAa;IACtD;;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AW,GAAG,IAAI,CAAA;CACxC;AAID,wCAAwC,KAAK,EAAE,mBAAmB,GAAG;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,qBAQzF;AAED,iEAEC;ACbD;IACE;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAID;;;GAGG;AACH,wBAAwB,KAAK,EAAE,YAAY,4BAiC1C;AAED,eAAe;AACf,+CAMC;ACxED,sCAAuC,SAAQ,IAAI,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IACnG;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED;IACE,mCAAmC;IACnC,UAAU,EAAE,aAAa,CAAC;IAC1B,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED;;;GAGG;AACH,gCAAgC,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,gBAAgB,CAuB9I;ACrCD,YAAY,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC","sources":["packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/calculatePosition.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useCloseOnScroll.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlayPosition.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlay.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlayTrigger.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/usePreventScroll.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useModal.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/DismissButton.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/ariaHideOutside.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/usePopover.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/PortalProvider.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/Overlay.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useModalOverlay.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/index.ts","packages/@react-aria/overlays/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSTABLE_PortalProvider, useUNSTABLE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;AEoBA,kCAAmC,SAAQ,aAAa;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACtC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;IACE,+CAA+C;IAC/C,YAAY,EAAE,aAAa,CAAC;IAC5B,8CAA8C;IAC9C,UAAU,EAAE,aAAa,CAAC;IAC1B,oEAAoE;IACpE,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,2CAA2C;IAC3C,cAAc,IAAI,IAAI,CAAA;CACvB;AASD;;;GAGG;AACH,mCAAmC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAsNzE;AC1RD;IACE,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,4DAA4D;IAC5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AAa,CAAC;IAC1B,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED;;;GAGG;AACH,gCAAgC,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,gBAAgB,CAuB9I;ACrCD,YAAY,EAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC","sources":["packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/calculatePosition.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useCloseOnScroll.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlayPosition.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlay.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useOverlayTrigger.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/usePreventScroll.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/PortalProvider.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useModal.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/DismissButton.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/ariaHideOutside.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/usePopover.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/Overlay.tsx","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/useModalOverlay.ts","packages/@react-aria/overlays/src/packages/@react-aria/overlays/src/index.ts","packages/@react-aria/overlays/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useOverlayPosition} from './useOverlayPosition';\nexport {useOverlay} from './useOverlay';\nexport {useOverlayTrigger} from './useOverlayTrigger';\nexport {usePreventScroll} from './usePreventScroll';\nexport {ModalProvider, useModalProvider, OverlayProvider, OverlayContainer, useModal} from './useModal';\nexport {DismissButton} from './DismissButton';\nexport {ariaHideOutside} from './ariaHideOutside';\nexport {usePopover} from './usePopover';\nexport {useModalOverlay} from './useModalOverlay';\nexport {Overlay, useOverlayFocusContain} from './Overlay';\nexport {UNSAFE_PortalProvider, useUNSAFE_PortalContext} from './PortalProvider';\n\nexport type {AriaPositionProps, PositionAria} from './useOverlayPosition';\nexport type {AriaOverlayProps, OverlayAria} from './useOverlay';\nexport type {OverlayTriggerAria, OverlayTriggerProps} from './useOverlayTrigger';\nexport type {AriaModalOptions, ModalAria, ModalProviderAria, ModalProviderProps, OverlayContainerProps} from './useModal';\nexport type {DismissButtonProps} from './DismissButton';\nexport type {AriaPopoverProps, PopoverAria} from './usePopover';\nexport type {AriaModalOverlayProps, ModalOverlayAria} from './useModalOverlay';\nexport type {OverlayProps} from './Overlay';\nexport type {Placement, PlacementAxis, PositionProps} from '@react-types/overlays';\nexport type {PortalProviderProps, PortalProviderContextValue} from './PortalProvider';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,MAAM,4CAA2C,IAAI;AASrD,SAAS,0CAAiB,IAA0B;IACzD,IAAI,cAAC,UAAU,UAAE,MAAM,WAAE,OAAO,EAAC,GAAG;IAEpC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAC,UAAU,YAAY,MACzB;QAGF,IAAI,WAAW,CAAC;YACd,uEAAuE;YACvE,IAAI,SAAS,EAAE,MAAM;YACrB,gFAAgF;YAChF,IAAI,CAAC,WAAW,OAAO,IAAK,AAAC,kBAAkB,QAAS,CAAC,OAAO,QAAQ,CAAC,WAAW,OAAO,GACzF;YAGF,8FAA8F;YAC9F,4FAA4F;YAC5F,2GAA2G;YAC3G,IAAI,EAAE,MAAM,YAAY,oBAAoB,EAAE,MAAM,YAAY,qBAC9D;YAGF,IAAI,iBAAiB,WAAW,0CAAW,GAAG,CAAC,WAAW,OAAO;YACjE,IAAI,gBACF;QAEJ;QAEA,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;QAAQ;QAAS;KAAW;AAClC","sources":["packages/@react-aria/overlays/src/useCloseOnScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\n\n// This behavior moved from useOverlayTrigger to useOverlayPosition.\n// For backward compatibility, where useOverlayTrigger handled hiding the popover on close,\n// it sets a close function here mapped from the trigger element. This way we can avoid\n// forcing users to pass an onClose function to useOverlayPosition which could be considered\n// a breaking change.\nexport const onCloseMap: WeakMap<Element, () => void> = new WeakMap();\n\ninterface CloseOnScrollOptions {\n triggerRef: RefObject<Element | null>,\n isOpen?: boolean,\n onClose?: (() => void) | null\n}\n\n/** @private */\nexport function useCloseOnScroll(opts: CloseOnScrollOptions) {\n let {triggerRef, isOpen, onClose} = opts;\n\n useEffect(() => {\n if (!isOpen || onClose === null) {\n return;\n }\n\n let onScroll = (e: Event) => {\n // Ignore if scrolling an scrollable region outside the trigger's tree.\n let target = e.target;\n // window is not a Node and doesn't have contain, but window contains everything\n if (!triggerRef.current || ((target instanceof Node) && !target.contains(triggerRef.current))) {\n return;\n }\n\n // Ignore scroll events on any input or textarea as the cursor position can cause it to scroll\n // such as in a combobox. Clicking the dropdown button places focus on the input, and if the\n // text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.\n if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {\n return;\n }\n\n let onCloseHandler = onClose || onCloseMap.get(triggerRef.current);\n if (onCloseHandler) {\n onCloseHandler();\n }\n };\n\n window.addEventListener('scroll', onScroll, true);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n };\n }, [isOpen, onClose, triggerRef]);\n}\n"],"names":[],"version":3,"file":"useCloseOnScroll.main.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,MAAM,4CAA2C,IAAI;AASrD,SAAS,0CAAiB,IAA0B;IACzD,IAAI,cAAC,UAAU,UAAE,MAAM,WAAE,OAAO,EAAC,GAAG;IAEpC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAC,UAAU,YAAY,MACzB;QAGF,IAAI,WAAW,CAAC;YACd,uEAAuE;YACvE,IAAI,SAAS,EAAE,MAAM;YACrB,gFAAgF;YAChF,IAAI,CAAC,WAAW,OAAO,IAAK,AAAC,kBAAkB,QAAS,CAAC,OAAO,QAAQ,CAAC,WAAW,OAAO,GACzF;YAGF,8FAA8F;YAC9F,4FAA4F;YAC5F,2GAA2G;YAC3G,IAAI,EAAE,MAAM,YAAY,oBAAoB,EAAE,MAAM,YAAY,qBAC9D;YAGF,IAAI,iBAAiB,WAAW,0CAAW,GAAG,CAAC,WAAW,OAAO;YACjE,IAAI,gBACF;QAEJ;QAEA,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;QAAQ;QAAS;KAAW;AAClC","sources":["packages/@react-aria/overlays/src/useCloseOnScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\n\n// This behavior moved from useOverlayTrigger to useOverlayPosition.\n// For backward compatibility, where useOverlayTrigger handled hiding the popover on close,\n// it sets a close function here mapped from the trigger element. This way we can avoid\n// forcing users to pass an onClose function to useOverlayPosition which could be considered\n// a breaking change.\nexport const onCloseMap: WeakMap<Element, () => void> = new WeakMap();\n\ninterface CloseOnScrollOptions {\n triggerRef: RefObject<Element | null>,\n isOpen?: boolean,\n onClose?: (() => void) | null\n}\n\n/** @private */\nexport function useCloseOnScroll(opts: CloseOnScrollOptions): void {\n let {triggerRef, isOpen, onClose} = opts;\n\n useEffect(() => {\n if (!isOpen || onClose === null) {\n return;\n }\n\n let onScroll = (e: Event) => {\n // Ignore if scrolling an scrollable region outside the trigger's tree.\n let target = e.target;\n // window is not a Node and doesn't have contain, but window contains everything\n if (!triggerRef.current || ((target instanceof Node) && !target.contains(triggerRef.current))) {\n return;\n }\n\n // Ignore scroll events on any input or textarea as the cursor position can cause it to scroll\n // such as in a combobox. Clicking the dropdown button places focus on the input, and if the\n // text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.\n if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {\n return;\n }\n\n let onCloseHandler = onClose || onCloseMap.get(triggerRef.current);\n if (onCloseHandler) {\n onCloseHandler();\n }\n };\n\n window.addEventListener('scroll', onScroll, true);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n };\n }, [isOpen, onClose, triggerRef]);\n}\n"],"names":[],"version":3,"file":"useCloseOnScroll.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,MAAM,4CAA2C,IAAI;AASrD,SAAS,0CAAiB,IAA0B;IACzD,IAAI,cAAC,UAAU,UAAE,MAAM,WAAE,OAAO,EAAC,GAAG;IAEpC,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,UAAU,YAAY,MACzB;QAGF,IAAI,WAAW,CAAC;YACd,uEAAuE;YACvE,IAAI,SAAS,EAAE,MAAM;YACrB,gFAAgF;YAChF,IAAI,CAAC,WAAW,OAAO,IAAK,AAAC,kBAAkB,QAAS,CAAC,OAAO,QAAQ,CAAC,WAAW,OAAO,GACzF;YAGF,8FAA8F;YAC9F,4FAA4F;YAC5F,2GAA2G;YAC3G,IAAI,EAAE,MAAM,YAAY,oBAAoB,EAAE,MAAM,YAAY,qBAC9D;YAGF,IAAI,iBAAiB,WAAW,0CAAW,GAAG,CAAC,WAAW,OAAO;YACjE,IAAI,gBACF;QAEJ;QAEA,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;QAAQ;QAAS;KAAW;AAClC","sources":["packages/@react-aria/overlays/src/useCloseOnScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\n\n// This behavior moved from useOverlayTrigger to useOverlayPosition.\n// For backward compatibility, where useOverlayTrigger handled hiding the popover on close,\n// it sets a close function here mapped from the trigger element. This way we can avoid\n// forcing users to pass an onClose function to useOverlayPosition which could be considered\n// a breaking change.\nexport const onCloseMap: WeakMap<Element, () => void> = new WeakMap();\n\ninterface CloseOnScrollOptions {\n triggerRef: RefObject<Element | null>,\n isOpen?: boolean,\n onClose?: (() => void) | null\n}\n\n/** @private */\nexport function useCloseOnScroll(opts: CloseOnScrollOptions) {\n let {triggerRef, isOpen, onClose} = opts;\n\n useEffect(() => {\n if (!isOpen || onClose === null) {\n return;\n }\n\n let onScroll = (e: Event) => {\n // Ignore if scrolling an scrollable region outside the trigger's tree.\n let target = e.target;\n // window is not a Node and doesn't have contain, but window contains everything\n if (!triggerRef.current || ((target instanceof Node) && !target.contains(triggerRef.current))) {\n return;\n }\n\n // Ignore scroll events on any input or textarea as the cursor position can cause it to scroll\n // such as in a combobox. Clicking the dropdown button places focus on the input, and if the\n // text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.\n if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {\n return;\n }\n\n let onCloseHandler = onClose || onCloseMap.get(triggerRef.current);\n if (onCloseHandler) {\n onCloseHandler();\n }\n };\n\n window.addEventListener('scroll', onScroll, true);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n };\n }, [isOpen, onClose, triggerRef]);\n}\n"],"names":[],"version":3,"file":"useCloseOnScroll.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,MAAM,4CAA2C,IAAI;AASrD,SAAS,0CAAiB,IAA0B;IACzD,IAAI,cAAC,UAAU,UAAE,MAAM,WAAE,OAAO,EAAC,GAAG;IAEpC,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,UAAU,YAAY,MACzB;QAGF,IAAI,WAAW,CAAC;YACd,uEAAuE;YACvE,IAAI,SAAS,EAAE,MAAM;YACrB,gFAAgF;YAChF,IAAI,CAAC,WAAW,OAAO,IAAK,AAAC,kBAAkB,QAAS,CAAC,OAAO,QAAQ,CAAC,WAAW,OAAO,GACzF;YAGF,8FAA8F;YAC9F,4FAA4F;YAC5F,2GAA2G;YAC3G,IAAI,EAAE,MAAM,YAAY,oBAAoB,EAAE,MAAM,YAAY,qBAC9D;YAGF,IAAI,iBAAiB,WAAW,0CAAW,GAAG,CAAC,WAAW,OAAO;YACjE,IAAI,gBACF;QAEJ;QAEA,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;QAAQ;QAAS;KAAW;AAClC","sources":["packages/@react-aria/overlays/src/useCloseOnScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\n\n// This behavior moved from useOverlayTrigger to useOverlayPosition.\n// For backward compatibility, where useOverlayTrigger handled hiding the popover on close,\n// it sets a close function here mapped from the trigger element. This way we can avoid\n// forcing users to pass an onClose function to useOverlayPosition which could be considered\n// a breaking change.\nexport const onCloseMap: WeakMap<Element, () => void> = new WeakMap();\n\ninterface CloseOnScrollOptions {\n triggerRef: RefObject<Element | null>,\n isOpen?: boolean,\n onClose?: (() => void) | null\n}\n\n/** @private */\nexport function useCloseOnScroll(opts: CloseOnScrollOptions): void {\n let {triggerRef, isOpen, onClose} = opts;\n\n useEffect(() => {\n if (!isOpen || onClose === null) {\n return;\n }\n\n let onScroll = (e: Event) => {\n // Ignore if scrolling an scrollable region outside the trigger's tree.\n let target = e.target;\n // window is not a Node and doesn't have contain, but window contains everything\n if (!triggerRef.current || ((target instanceof Node) && !target.contains(triggerRef.current))) {\n return;\n }\n\n // Ignore scroll events on any input or textarea as the cursor position can cause it to scroll\n // such as in a combobox. Clicking the dropdown button places focus on the input, and if the\n // text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.\n if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {\n return;\n }\n\n let onCloseHandler = onClose || onCloseMap.get(triggerRef.current);\n if (onCloseHandler) {\n onCloseHandler();\n }\n };\n\n window.addEventListener('scroll', onScroll, true);\n return () => {\n window.removeEventListener('scroll', onScroll, true);\n };\n }, [isOpen, onClose, triggerRef]);\n}\n"],"names":[],"version":3,"file":"useCloseOnScroll.module.js.map"}