@react-aria/overlays 3.21.1 → 3.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DismissButton.main.js +51 -0
- package/dist/DismissButton.main.js.map +1 -0
- package/dist/DismissButton.mjs +46 -0
- package/dist/DismissButton.module.js +46 -0
- package/dist/DismissButton.module.js.map +1 -0
- package/dist/Overlay.main.js +73 -0
- package/dist/Overlay.main.js.map +1 -0
- package/dist/Overlay.mjs +63 -0
- package/dist/Overlay.module.js +63 -0
- package/dist/Overlay.module.js.map +1 -0
- package/dist/PortalProvider.main.js +41 -0
- package/dist/PortalProvider.main.js.map +1 -0
- package/dist/PortalProvider.mjs +31 -0
- package/dist/PortalProvider.module.js +31 -0
- package/dist/PortalProvider.module.js.map +1 -0
- package/dist/ariaHideOutside.main.js +121 -0
- package/dist/ariaHideOutside.main.js.map +1 -0
- package/dist/ariaHideOutside.mjs +116 -0
- package/dist/ariaHideOutside.module.js +116 -0
- package/dist/ariaHideOutside.module.js.map +1 -0
- package/dist/calculatePosition.main.js +355 -0
- package/dist/calculatePosition.main.js.map +1 -0
- package/dist/calculatePosition.mjs +350 -0
- package/dist/calculatePosition.module.js +350 -0
- package/dist/calculatePosition.module.js.map +1 -0
- package/dist/import.mjs +12 -1397
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/main.js +28 -1411
- package/dist/main.js.map +1 -1
- package/dist/module.js +12 -1397
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/useCloseOnScroll.main.js +46 -0
- package/dist/useCloseOnScroll.main.js.map +1 -0
- package/dist/useCloseOnScroll.mjs +40 -0
- package/dist/useCloseOnScroll.module.js +40 -0
- package/dist/useCloseOnScroll.module.js.map +1 -0
- package/dist/useModal.main.js +114 -0
- package/dist/useModal.main.js.map +1 -0
- package/dist/useModal.mjs +101 -0
- package/dist/useModal.module.js +101 -0
- package/dist/useModal.module.js.map +1 -0
- package/dist/useModalOverlay.main.js +55 -0
- package/dist/useModalOverlay.main.js.map +1 -0
- package/dist/useModalOverlay.mjs +50 -0
- package/dist/useModalOverlay.module.js +50 -0
- package/dist/useModalOverlay.module.js.map +1 -0
- package/dist/useOverlay.main.js +105 -0
- package/dist/useOverlay.main.js.map +1 -0
- package/dist/useOverlay.mjs +100 -0
- package/dist/useOverlay.module.js +100 -0
- package/dist/useOverlay.module.js.map +1 -0
- package/dist/useOverlayPosition.main.js +190 -0
- package/dist/useOverlayPosition.main.js.map +1 -0
- package/dist/useOverlayPosition.mjs +185 -0
- package/dist/useOverlayPosition.module.js +185 -0
- package/dist/useOverlayPosition.module.js.map +1 -0
- package/dist/useOverlayTrigger.main.js +54 -0
- package/dist/useOverlayTrigger.main.js.map +1 -0
- package/dist/useOverlayTrigger.mjs +49 -0
- package/dist/useOverlayTrigger.module.js +49 -0
- package/dist/useOverlayTrigger.module.js.map +1 -0
- package/dist/usePopover.main.js +66 -0
- package/dist/usePopover.main.js.map +1 -0
- package/dist/usePopover.mjs +61 -0
- package/dist/usePopover.module.js +61 -0
- package/dist/usePopover.module.js.map +1 -0
- package/dist/usePreventScroll.main.js +226 -0
- package/dist/usePreventScroll.main.js.map +1 -0
- package/dist/usePreventScroll.mjs +221 -0
- package/dist/usePreventScroll.module.js +221 -0
- package/dist/usePreventScroll.module.js.map +1 -0
- package/package.json +12 -12
- package/src/Overlay.tsx +6 -0
- package/src/PortalProvider.tsx +34 -0
- package/src/calculatePosition.ts +3 -3
- package/src/index.ts +1 -0
- package/src/useModalOverlay.ts +2 -2
- package/src/useOverlay.ts +1 -1
- package/src/useOverlayPosition.ts +8 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var $90f032faf016e1fb$exports = require("./intlStrings.main.js");
|
|
2
|
+
var $21EvL$react = require("react");
|
|
3
|
+
var $21EvL$reactariautils = require("@react-aria/utils");
|
|
4
|
+
var $21EvL$reactariai18n = require("@react-aria/i18n");
|
|
5
|
+
var $21EvL$reactariavisuallyhidden = require("@react-aria/visually-hidden");
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function $parcel$interopDefault(a) {
|
|
9
|
+
return a && a.__esModule ? a.default : a;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function $parcel$export(e, n, v, s) {
|
|
13
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$parcel$export(module.exports, "DismissButton", () => $f69bb3e6457495cc$export$2317d149ed6f78c4);
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
+
* governing permissions and limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
function $f69bb3e6457495cc$export$2317d149ed6f78c4(props) {
|
|
33
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
34
|
+
let stringFormatter = (0, $21EvL$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($90f032faf016e1fb$exports))), '@react-aria/overlays');
|
|
35
|
+
let labels = (0, $21EvL$reactariautils.useLabels)(otherProps, stringFormatter.format('dismiss'));
|
|
36
|
+
let onClick = ()=>{
|
|
37
|
+
if (onDismiss) onDismiss();
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($21EvL$react))).createElement((0, $21EvL$reactariavisuallyhidden.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($21EvL$react))).createElement("button", {
|
|
40
|
+
...labels,
|
|
41
|
+
tabIndex: -1,
|
|
42
|
+
onClick: onClick,
|
|
43
|
+
style: {
|
|
44
|
+
width: 1,
|
|
45
|
+
height: 1
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=DismissButton.main.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import $iYaQO$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
+
import $iYaQO$react from "react";
|
|
3
|
+
import {useLabels as $iYaQO$useLabels} from "@react-aria/utils";
|
|
4
|
+
import {useLocalizedStringFormatter as $iYaQO$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
|
+
import {VisuallyHidden as $iYaQO$VisuallyHidden} from "@react-aria/visually-hidden";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function $parcel$interopDefault(a) {
|
|
9
|
+
return a && a.__esModule ? a.default : a;
|
|
10
|
+
}
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
* governing permissions and limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
27
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
28
|
+
let stringFormatter = (0, $iYaQO$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iYaQO$intlStringsmodulejs))), '@react-aria/overlays');
|
|
29
|
+
let labels = (0, $iYaQO$useLabels)(otherProps, stringFormatter.format('dismiss'));
|
|
30
|
+
let onClick = ()=>{
|
|
31
|
+
if (onDismiss) onDismiss();
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/ (0, $iYaQO$react).createElement((0, $iYaQO$VisuallyHidden), null, /*#__PURE__*/ (0, $iYaQO$react).createElement("button", {
|
|
34
|
+
...labels,
|
|
35
|
+
tabIndex: -1,
|
|
36
|
+
onClick: onClick,
|
|
37
|
+
style: {
|
|
38
|
+
width: 1,
|
|
39
|
+
height: 1
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {$86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton};
|
|
46
|
+
//# sourceMappingURL=DismissButton.module.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import $iYaQO$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
+
import $iYaQO$react from "react";
|
|
3
|
+
import {useLabels as $iYaQO$useLabels} from "@react-aria/utils";
|
|
4
|
+
import {useLocalizedStringFormatter as $iYaQO$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
5
|
+
import {VisuallyHidden as $iYaQO$VisuallyHidden} from "@react-aria/visually-hidden";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function $parcel$interopDefault(a) {
|
|
9
|
+
return a && a.__esModule ? a.default : a;
|
|
10
|
+
}
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
* governing permissions and limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
27
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
28
|
+
let stringFormatter = (0, $iYaQO$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iYaQO$intlStringsmodulejs))), '@react-aria/overlays');
|
|
29
|
+
let labels = (0, $iYaQO$useLabels)(otherProps, stringFormatter.format('dismiss'));
|
|
30
|
+
let onClick = ()=>{
|
|
31
|
+
if (onDismiss) onDismiss();
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/ (0, $iYaQO$react).createElement((0, $iYaQO$VisuallyHidden), null, /*#__PURE__*/ (0, $iYaQO$react).createElement("button", {
|
|
34
|
+
...labels,
|
|
35
|
+
tabIndex: -1,
|
|
36
|
+
onClick: onClick,
|
|
37
|
+
style: {
|
|
38
|
+
width: 1,
|
|
39
|
+
height: 1
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {$86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton};
|
|
46
|
+
//# sourceMappingURL=DismissButton.module.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var $d7347c25ab757295$exports = require("./PortalProvider.main.js");
|
|
2
|
+
var $kxJqT$reactariainteractions = require("@react-aria/interactions");
|
|
3
|
+
var $kxJqT$reactariafocus = require("@react-aria/focus");
|
|
4
|
+
var $kxJqT$react = require("react");
|
|
5
|
+
var $kxJqT$reactdom = require("react-dom");
|
|
6
|
+
var $kxJqT$reactariassr = require("@react-aria/ssr");
|
|
7
|
+
var $kxJqT$reactariautils = require("@react-aria/utils");
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
function $parcel$interopDefault(a) {
|
|
11
|
+
return a && a.__esModule ? a.default : a;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function $parcel$export(e, n, v, s) {
|
|
15
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
$parcel$export(module.exports, "Overlay", () => $745edbb83ab4296f$export$c6fdb837b070b4ff);
|
|
19
|
+
$parcel$export(module.exports, "useOverlayFocusContain", () => $745edbb83ab4296f$export$14c98a7594375490);
|
|
20
|
+
/*
|
|
21
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
22
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
24
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
27
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
28
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
|
+
* governing permissions and limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const $745edbb83ab4296f$export$a2200b96afd16271 = /*#__PURE__*/ (0, ($parcel$interopDefault($kxJqT$react))).createContext(null);
|
|
38
|
+
function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
|
|
39
|
+
let isSSR = (0, $kxJqT$reactariassr.useIsSSR)();
|
|
40
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
41
|
+
let [contain, setContain] = (0, $kxJqT$react.useState)(false);
|
|
42
|
+
let contextValue = (0, $kxJqT$react.useMemo)(()=>({
|
|
43
|
+
contain: contain,
|
|
44
|
+
setContain: setContain
|
|
45
|
+
}), [
|
|
46
|
+
contain,
|
|
47
|
+
setContain
|
|
48
|
+
]);
|
|
49
|
+
let { getContainer: getContainer } = (0, $d7347c25ab757295$exports.useUNSTABLE_PortalContext)();
|
|
50
|
+
if (!props.portalContainer && getContainer) portalContainer = getContainer();
|
|
51
|
+
if (!portalContainer) return null;
|
|
52
|
+
let contents = props.children;
|
|
53
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, ($parcel$interopDefault($kxJqT$react))).createElement((0, $kxJqT$reactariafocus.FocusScope), {
|
|
54
|
+
restoreFocus: true,
|
|
55
|
+
contain: contain && !isExiting
|
|
56
|
+
}, contents);
|
|
57
|
+
contents = /*#__PURE__*/ (0, ($parcel$interopDefault($kxJqT$react))).createElement($745edbb83ab4296f$export$a2200b96afd16271.Provider, {
|
|
58
|
+
value: contextValue
|
|
59
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kxJqT$react))).createElement((0, $kxJqT$reactariainteractions.ClearPressResponder), null, contents));
|
|
60
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kxJqT$reactdom))).createPortal(contents, portalContainer);
|
|
61
|
+
}
|
|
62
|
+
function $745edbb83ab4296f$export$14c98a7594375490() {
|
|
63
|
+
let ctx = (0, $kxJqT$react.useContext)($745edbb83ab4296f$export$a2200b96afd16271);
|
|
64
|
+
let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
|
|
65
|
+
(0, $kxJqT$reactariautils.useLayoutEffect)(()=>{
|
|
66
|
+
setContain === null || setContain === void 0 ? void 0 : setContain(true);
|
|
67
|
+
}, [
|
|
68
|
+
setContain
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=Overlay.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA+BM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAC;AAM3C,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,WAAW,CAAC;OAC3C;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 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(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={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"}
|
package/dist/Overlay.mjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.mjs";
|
|
2
|
+
import {ClearPressResponder as $1CM7W$ClearPressResponder} from "@react-aria/interactions";
|
|
3
|
+
import {FocusScope as $1CM7W$FocusScope} from "@react-aria/focus";
|
|
4
|
+
import $1CM7W$react, {useState as $1CM7W$useState, useMemo as $1CM7W$useMemo, useContext as $1CM7W$useContext} from "react";
|
|
5
|
+
import $1CM7W$reactdom from "react-dom";
|
|
6
|
+
import {useIsSSR as $1CM7W$useIsSSR} from "@react-aria/ssr";
|
|
7
|
+
import {useLayoutEffect as $1CM7W$useLayoutEffect} from "@react-aria/utils";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $1CM7W$react).createContext(null);
|
|
27
|
+
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
28
|
+
let isSSR = (0, $1CM7W$useIsSSR)();
|
|
29
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
30
|
+
let [contain, setContain] = (0, $1CM7W$useState)(false);
|
|
31
|
+
let contextValue = (0, $1CM7W$useMemo)(()=>({
|
|
32
|
+
contain: contain,
|
|
33
|
+
setContain: setContain
|
|
34
|
+
}), [
|
|
35
|
+
contain,
|
|
36
|
+
setContain
|
|
37
|
+
]);
|
|
38
|
+
let { getContainer: getContainer } = (0, $96b38030c423d352$export$574e9b0fb070c3b0)();
|
|
39
|
+
if (!props.portalContainer && getContainer) portalContainer = getContainer();
|
|
40
|
+
if (!portalContainer) return null;
|
|
41
|
+
let contents = props.children;
|
|
42
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $1CM7W$react).createElement((0, $1CM7W$FocusScope), {
|
|
43
|
+
restoreFocus: true,
|
|
44
|
+
contain: contain && !isExiting
|
|
45
|
+
}, contents);
|
|
46
|
+
contents = /*#__PURE__*/ (0, $1CM7W$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
47
|
+
value: contextValue
|
|
48
|
+
}, /*#__PURE__*/ (0, $1CM7W$react).createElement((0, $1CM7W$ClearPressResponder), null, contents));
|
|
49
|
+
return /*#__PURE__*/ (0, $1CM7W$reactdom).createPortal(contents, portalContainer);
|
|
50
|
+
}
|
|
51
|
+
function $337b884510726a0d$export$14c98a7594375490() {
|
|
52
|
+
let ctx = (0, $1CM7W$useContext)($337b884510726a0d$export$a2200b96afd16271);
|
|
53
|
+
let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
|
|
54
|
+
(0, $1CM7W$useLayoutEffect)(()=>{
|
|
55
|
+
setContain === null || setContain === void 0 ? void 0 : setContain(true);
|
|
56
|
+
}, [
|
|
57
|
+
setContain
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export {$337b884510726a0d$export$a2200b96afd16271 as OverlayContext, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain};
|
|
63
|
+
//# sourceMappingURL=Overlay.module.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {useUNSTABLE_PortalContext as $96b38030c423d352$export$574e9b0fb070c3b0} from "./PortalProvider.module.js";
|
|
2
|
+
import {ClearPressResponder as $1CM7W$ClearPressResponder} from "@react-aria/interactions";
|
|
3
|
+
import {FocusScope as $1CM7W$FocusScope} from "@react-aria/focus";
|
|
4
|
+
import $1CM7W$react, {useState as $1CM7W$useState, useMemo as $1CM7W$useMemo, useContext as $1CM7W$useContext} from "react";
|
|
5
|
+
import $1CM7W$reactdom from "react-dom";
|
|
6
|
+
import {useIsSSR as $1CM7W$useIsSSR} from "@react-aria/ssr";
|
|
7
|
+
import {useLayoutEffect as $1CM7W$useLayoutEffect} from "@react-aria/utils";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $1CM7W$react).createContext(null);
|
|
27
|
+
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
28
|
+
let isSSR = (0, $1CM7W$useIsSSR)();
|
|
29
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
30
|
+
let [contain, setContain] = (0, $1CM7W$useState)(false);
|
|
31
|
+
let contextValue = (0, $1CM7W$useMemo)(()=>({
|
|
32
|
+
contain: contain,
|
|
33
|
+
setContain: setContain
|
|
34
|
+
}), [
|
|
35
|
+
contain,
|
|
36
|
+
setContain
|
|
37
|
+
]);
|
|
38
|
+
let { getContainer: getContainer } = (0, $96b38030c423d352$export$574e9b0fb070c3b0)();
|
|
39
|
+
if (!props.portalContainer && getContainer) portalContainer = getContainer();
|
|
40
|
+
if (!portalContainer) return null;
|
|
41
|
+
let contents = props.children;
|
|
42
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $1CM7W$react).createElement((0, $1CM7W$FocusScope), {
|
|
43
|
+
restoreFocus: true,
|
|
44
|
+
contain: contain && !isExiting
|
|
45
|
+
}, contents);
|
|
46
|
+
contents = /*#__PURE__*/ (0, $1CM7W$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
47
|
+
value: contextValue
|
|
48
|
+
}, /*#__PURE__*/ (0, $1CM7W$react).createElement((0, $1CM7W$ClearPressResponder), null, contents));
|
|
49
|
+
return /*#__PURE__*/ (0, $1CM7W$reactdom).createPortal(contents, portalContainer);
|
|
50
|
+
}
|
|
51
|
+
function $337b884510726a0d$export$14c98a7594375490() {
|
|
52
|
+
let ctx = (0, $1CM7W$useContext)($337b884510726a0d$export$a2200b96afd16271);
|
|
53
|
+
let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
|
|
54
|
+
(0, $1CM7W$useLayoutEffect)(()=>{
|
|
55
|
+
setContain === null || setContain === void 0 ? void 0 : setContain(true);
|
|
56
|
+
}, [
|
|
57
|
+
setContain
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export {$337b884510726a0d$export$a2200b96afd16271 as OverlayContext, $337b884510726a0d$export$c6fdb837b070b4ff as Overlay, $337b884510726a0d$export$14c98a7594375490 as useOverlayFocusContain};
|
|
63
|
+
//# sourceMappingURL=Overlay.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA+BM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAC;AAM3C,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,WAAW,CAAC;OAC3C;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 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(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={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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var $b2rU6$react = require("react");
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function $parcel$interopDefault(a) {
|
|
5
|
+
return a && a.__esModule ? a.default : a;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function $parcel$export(e, n, v, s) {
|
|
9
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$parcel$export(module.exports, "UNSTABLE_PortalProvider", () => $d7347c25ab757295$export$db995ea7163b4b67);
|
|
13
|
+
$parcel$export(module.exports, "useUNSTABLE_PortalContext", () => $d7347c25ab757295$export$574e9b0fb070c3b0);
|
|
14
|
+
/*
|
|
15
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
16
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
18
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
21
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
22
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
23
|
+
* governing permissions and limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
const $d7347c25ab757295$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $b2rU6$react.createContext)({});
|
|
26
|
+
function $d7347c25ab757295$export$db995ea7163b4b67(props) {
|
|
27
|
+
let { getContainer: getContainer } = props;
|
|
28
|
+
let { getContainer: ctxGetContainer } = $d7347c25ab757295$export$574e9b0fb070c3b0();
|
|
29
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($b2rU6$react))).createElement($d7347c25ab757295$export$60d741e20e0aa309.Provider, {
|
|
30
|
+
value: {
|
|
31
|
+
getContainer: getContainer === null ? null : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
|
|
32
|
+
}
|
|
33
|
+
}, props.children);
|
|
34
|
+
}
|
|
35
|
+
function $d7347c25ab757295$export$574e9b0fb070c3b0() {
|
|
36
|
+
var _useContext;
|
|
37
|
+
return (_useContext = (0, $b2rU6$react.useContext)($d7347c25ab757295$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=PortalProvider.main.js.map
|
|
@@ -0,0 +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,OAAO,yBAAA,0BAAA,eAAgB;QAAe;OACzG,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 ? null : 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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import $7yuSY$react, {createContext as $7yuSY$createContext, useContext as $7yuSY$useContext} from "react";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
const $96b38030c423d352$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $7yuSY$createContext)({});
|
|
15
|
+
function $96b38030c423d352$export$db995ea7163b4b67(props) {
|
|
16
|
+
let { getContainer: getContainer } = props;
|
|
17
|
+
let { getContainer: ctxGetContainer } = $96b38030c423d352$export$574e9b0fb070c3b0();
|
|
18
|
+
return /*#__PURE__*/ (0, $7yuSY$react).createElement($96b38030c423d352$export$60d741e20e0aa309.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
getContainer: getContainer === null ? null : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
|
|
21
|
+
}
|
|
22
|
+
}, props.children);
|
|
23
|
+
}
|
|
24
|
+
function $96b38030c423d352$export$574e9b0fb070c3b0() {
|
|
25
|
+
var _useContext;
|
|
26
|
+
return (_useContext = (0, $7yuSY$useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
|
|
31
|
+
//# sourceMappingURL=PortalProvider.module.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import $7yuSY$react, {createContext as $7yuSY$createContext, useContext as $7yuSY$useContext} from "react";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
const $96b38030c423d352$export$60d741e20e0aa309 = /*#__PURE__*/ (0, $7yuSY$createContext)({});
|
|
15
|
+
function $96b38030c423d352$export$db995ea7163b4b67(props) {
|
|
16
|
+
let { getContainer: getContainer } = props;
|
|
17
|
+
let { getContainer: ctxGetContainer } = $96b38030c423d352$export$574e9b0fb070c3b0();
|
|
18
|
+
return /*#__PURE__*/ (0, $7yuSY$react).createElement($96b38030c423d352$export$60d741e20e0aa309.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
getContainer: getContainer === null ? null : getContainer !== null && getContainer !== void 0 ? getContainer : ctxGetContainer
|
|
21
|
+
}
|
|
22
|
+
}, props.children);
|
|
23
|
+
}
|
|
24
|
+
function $96b38030c423d352$export$574e9b0fb070c3b0() {
|
|
25
|
+
var _useContext;
|
|
26
|
+
return (_useContext = (0, $7yuSY$useContext)($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export {$96b38030c423d352$export$60d741e20e0aa309 as PortalContext, $96b38030c423d352$export$db995ea7163b4b67 as UNSTABLE_PortalProvider, $96b38030c423d352$export$574e9b0fb070c3b0 as useUNSTABLE_PortalContext};
|
|
31
|
+
//# sourceMappingURL=PortalProvider.module.js.map
|
|
@@ -0,0 +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,OAAO,yBAAA,0BAAA,eAAgB;QAAe;OACzG,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 ? null : 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"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
$parcel$export(module.exports, "ariaHideOutside", () => $08ef1685902b6011$export$1c3ebcada18427bf);
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
9
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
* governing permissions and limitations under the License.
|
|
17
|
+
*/ // Keeps a ref count of all hidden elements. Added to when hiding an element, and
|
|
18
|
+
// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
|
|
19
|
+
let $08ef1685902b6011$var$refCountMap = new WeakMap();
|
|
20
|
+
let $08ef1685902b6011$var$observerStack = [];
|
|
21
|
+
function $08ef1685902b6011$export$1c3ebcada18427bf(targets, root = document.body) {
|
|
22
|
+
let visibleNodes = new Set(targets);
|
|
23
|
+
let hiddenNodes = new Set();
|
|
24
|
+
let walk = (root)=>{
|
|
25
|
+
// Keep live announcer and top layer elements (e.g. toasts) visible.
|
|
26
|
+
for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]'))visibleNodes.add(element);
|
|
27
|
+
let acceptNode = (node)=>{
|
|
28
|
+
// Skip this node and its children if it is one of the target nodes, or a live announcer.
|
|
29
|
+
// Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is
|
|
30
|
+
// made for elements with role="row" since VoiceOver on iOS has issues hiding elements with role="row".
|
|
31
|
+
// For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).
|
|
32
|
+
if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
|
|
33
|
+
// Skip this node but continue to children if one of the targets is inside the node.
|
|
34
|
+
for (let target of visibleNodes){
|
|
35
|
+
if (node.contains(target)) return NodeFilter.FILTER_SKIP;
|
|
36
|
+
}
|
|
37
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
38
|
+
};
|
|
39
|
+
let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
40
|
+
acceptNode: acceptNode
|
|
41
|
+
});
|
|
42
|
+
// TreeWalker does not include the root.
|
|
43
|
+
let acceptRoot = acceptNode(root);
|
|
44
|
+
if (acceptRoot === NodeFilter.FILTER_ACCEPT) hide(root);
|
|
45
|
+
if (acceptRoot !== NodeFilter.FILTER_REJECT) {
|
|
46
|
+
let node = walker.nextNode();
|
|
47
|
+
while(node != null){
|
|
48
|
+
hide(node);
|
|
49
|
+
node = walker.nextNode();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
let hide = (node)=>{
|
|
54
|
+
var _refCountMap_get;
|
|
55
|
+
let refCount = (_refCountMap_get = $08ef1685902b6011$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;
|
|
56
|
+
// If already aria-hidden, and the ref count is zero, then this element
|
|
57
|
+
// was already hidden and there's nothing for us to do.
|
|
58
|
+
if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) return;
|
|
59
|
+
if (refCount === 0) node.setAttribute('aria-hidden', 'true');
|
|
60
|
+
hiddenNodes.add(node);
|
|
61
|
+
$08ef1685902b6011$var$refCountMap.set(node, refCount + 1);
|
|
62
|
+
};
|
|
63
|
+
// If there is already a MutationObserver listening from a previous call,
|
|
64
|
+
// disconnect it so the new on takes over.
|
|
65
|
+
if ($08ef1685902b6011$var$observerStack.length) $08ef1685902b6011$var$observerStack[$08ef1685902b6011$var$observerStack.length - 1].disconnect();
|
|
66
|
+
walk(root);
|
|
67
|
+
let observer = new MutationObserver((changes)=>{
|
|
68
|
+
for (let change of changes){
|
|
69
|
+
if (change.type !== 'childList' || change.addedNodes.length === 0) continue;
|
|
70
|
+
// If the parent element of the added nodes is not within one of the targets,
|
|
71
|
+
// and not already inside a hidden node, hide all of the new children.
|
|
72
|
+
if (![
|
|
73
|
+
...visibleNodes,
|
|
74
|
+
...hiddenNodes
|
|
75
|
+
].some((node)=>node.contains(change.target))) {
|
|
76
|
+
for (let node of change.removedNodes)if (node instanceof Element) {
|
|
77
|
+
visibleNodes.delete(node);
|
|
78
|
+
hiddenNodes.delete(node);
|
|
79
|
+
}
|
|
80
|
+
for (let node of change.addedNodes){
|
|
81
|
+
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
|
|
82
|
+
else if (node instanceof Element) walk(node);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
observer.observe(root, {
|
|
88
|
+
childList: true,
|
|
89
|
+
subtree: true
|
|
90
|
+
});
|
|
91
|
+
let observerWrapper = {
|
|
92
|
+
observe () {
|
|
93
|
+
observer.observe(root, {
|
|
94
|
+
childList: true,
|
|
95
|
+
subtree: true
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
disconnect () {
|
|
99
|
+
observer.disconnect();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
$08ef1685902b6011$var$observerStack.push(observerWrapper);
|
|
103
|
+
return ()=>{
|
|
104
|
+
observer.disconnect();
|
|
105
|
+
for (let node of hiddenNodes){
|
|
106
|
+
let count = $08ef1685902b6011$var$refCountMap.get(node);
|
|
107
|
+
if (count === 1) {
|
|
108
|
+
node.removeAttribute('aria-hidden');
|
|
109
|
+
$08ef1685902b6011$var$refCountMap.delete(node);
|
|
110
|
+
} else $08ef1685902b6011$var$refCountMap.set(node, count - 1);
|
|
111
|
+
}
|
|
112
|
+
// Remove this observer from the stack, and start the previous one.
|
|
113
|
+
if (observerWrapper === $08ef1685902b6011$var$observerStack[$08ef1685902b6011$var$observerStack.length - 1]) {
|
|
114
|
+
$08ef1685902b6011$var$observerStack.pop();
|
|
115
|
+
if ($08ef1685902b6011$var$observerStack.length) $08ef1685902b6011$var$observerStack[$08ef1685902b6011$var$observerStack.length - 1].observe();
|
|
116
|
+
} else $08ef1685902b6011$var$observerStack.splice($08ef1685902b6011$var$observerStack.indexOf(observerWrapper), 1);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=ariaHideOutside.main.js.map
|