@react-spectrum/overlays 5.7.7 → 5.8.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/OpenTransition.main.js +1 -3
- package/dist/OpenTransition.main.js.map +1 -1
- package/dist/OpenTransition.mjs +1 -3
- package/dist/OpenTransition.module.js +1 -3
- package/dist/OpenTransition.module.js.map +1 -1
- package/dist/Overlay.main.js +2 -1
- package/dist/Overlay.main.js.map +1 -1
- package/dist/Overlay.mjs +2 -1
- package/dist/Overlay.module.js +2 -1
- package/dist/Overlay.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/OpenTransition.tsx +1 -3
- package/src/Overlay.tsx +2 -1
|
@@ -23,13 +23,11 @@ $parcel$export(module.exports, "OpenTransition", () => $13f51cdc44d228b9$export$
|
|
|
23
23
|
* governing permissions and limitations under the License.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
// TODO install @types/react-transition-group
|
|
27
26
|
const $13f51cdc44d228b9$var$OPEN_STATES = {
|
|
28
27
|
entering: false,
|
|
29
28
|
entered: true
|
|
30
29
|
};
|
|
31
|
-
function $13f51cdc44d228b9$export$b847a40ee92eff38(
|
|
32
|
-
props) {
|
|
30
|
+
function $13f51cdc44d228b9$export$b847a40ee92eff38(props) {
|
|
33
31
|
// Do not apply any transition if in chromatic.
|
|
34
32
|
if (process.env.CHROMATIC) return (0, ($parcel$interopDefault($3kGU5$react))).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, ($parcel$interopDefault($3kGU5$react))).cloneElement(child, {
|
|
35
33
|
isOpen: props.in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKD,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,KAAU;IAEV,+CAA+C;IAC/C,IAAI,QAAQ,GAAG,CAAC,SAAS,EACvB,OAAO,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS,uBAAS,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,OAAO;YAAC,QAAQ,MAAM,EAAE;QAAA;IAGzG,qBACE,0DAAC,CAAA,GAAA,sCAAS;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS,uBAAS,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,OAAO;gBAAC,QAAQ,CAAC,CAAC,iCAAW,CAAC,MAAM;YAAA;AAG9H","sources":["packages/@react-spectrum/overlays/src/OpenTransition.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 React, {JSX, JSXElementConstructor, ReactElement} from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(\n props: any\n): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n"],"names":[],"version":3,"file":"OpenTransition.main.js.map"}
|
package/dist/OpenTransition.mjs
CHANGED
|
@@ -13,13 +13,11 @@ import {Transition as $8XmPE$Transition} from "react-transition-group";
|
|
|
13
13
|
* governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
// TODO install @types/react-transition-group
|
|
17
16
|
const $bc765a7a041310da$var$OPEN_STATES = {
|
|
18
17
|
entering: false,
|
|
19
18
|
entered: true
|
|
20
19
|
};
|
|
21
|
-
function $bc765a7a041310da$export$b847a40ee92eff38(
|
|
22
|
-
props) {
|
|
20
|
+
function $bc765a7a041310da$export$b847a40ee92eff38(props) {
|
|
23
21
|
// Do not apply any transition if in chromatic.
|
|
24
22
|
if (process.env.CHROMATIC) return (0, $8XmPE$react).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, $8XmPE$react).cloneElement(child, {
|
|
25
23
|
isOpen: props.in
|
|
@@ -13,13 +13,11 @@ import {Transition as $8XmPE$Transition} from "react-transition-group";
|
|
|
13
13
|
* governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
// TODO install @types/react-transition-group
|
|
17
16
|
const $bc765a7a041310da$var$OPEN_STATES = {
|
|
18
17
|
entering: false,
|
|
19
18
|
entered: true
|
|
20
19
|
};
|
|
21
|
-
function $bc765a7a041310da$export$b847a40ee92eff38(
|
|
22
|
-
props) {
|
|
20
|
+
function $bc765a7a041310da$export$b847a40ee92eff38(props) {
|
|
23
21
|
// Do not apply any transition if in chromatic.
|
|
24
22
|
if (process.env.CHROMATIC) return (0, $8XmPE$react).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, $8XmPE$react).cloneElement(child, {
|
|
25
23
|
isOpen: props.in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKD,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,KAAU;IAEV,+CAA+C;IAC/C,IAAI,QAAQ,GAAG,CAAC,SAAS,EACvB,OAAO,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS,uBAAS,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO;YAAC,QAAQ,MAAM,EAAE;QAAA;IAGzG,qBACE,gCAAC,CAAA,GAAA,iBAAS;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS,uBAAS,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO;gBAAC,QAAQ,CAAC,CAAC,iCAAW,CAAC,MAAM;YAAA;AAG9H","sources":["packages/@react-spectrum/overlays/src/OpenTransition.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 React, {JSX, JSXElementConstructor, ReactElement} from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(\n props: any\n): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n"],"names":[],"version":3,"file":"OpenTransition.module.js.map"}
|
package/dist/Overlay.main.js
CHANGED
|
@@ -28,7 +28,7 @@ $parcel$export(module.exports, "Overlay", () => $2aebdc186fd41e87$export$c6fdb83
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
const $2aebdc186fd41e87$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, ($parcel$interopDefault($5XfZ1$react))).forwardRef(function Overlay(props, ref) {
|
|
31
|
-
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
31
|
+
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, shouldContainFocus: shouldContainFocus, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
32
32
|
let [exited, setExited] = (0, $5XfZ1$react.useState)(!isOpen);
|
|
33
33
|
let handleEntered = (0, $5XfZ1$react.useCallback)(()=>{
|
|
34
34
|
setExited(false);
|
|
@@ -49,6 +49,7 @@ const $2aebdc186fd41e87$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, ($parcel$int
|
|
|
49
49
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5XfZ1$react))).createElement((0, $5XfZ1$reactariaoverlays.Overlay), {
|
|
50
50
|
portalContainer: container,
|
|
51
51
|
disableFocusManagement: disableFocusManagement,
|
|
52
|
+
shouldContainFocus: shouldContainFocus,
|
|
52
53
|
isExiting: !isOpen
|
|
53
54
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5XfZ1$react))).createElement((0, $5XfZ1$reactspectrumprovider.Provider), {
|
|
54
55
|
ref: ref,
|
package/dist/Overlay.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AASM,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,QAAQ,KAAmB,EAAE,GAA2B;IACvG,IAAI,YACF,QAAQ,UACR,MAAM,0BACN,sBAAsB,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AASM,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,QAAQ,KAAmB,EAAE,GAA2B;IACvG,IAAI,YACF,QAAQ,UACR,MAAM,0BACN,sBAAsB,sBACtB,kBAAkB,aAClB,SAAS,WACT,OAAO,cACP,UAAU,aACV,SAAS,UACT,MAAM,aACN,SAAS,YACT,QAAQ,WACR,OAAO,EACR,GAAG;IAEJ,IAAI,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,qBAAO,EAAE,CAAC;IAEpC,IAAI,gBAAgB,CAAA,GAAA,wBAAU,EAAE;QAC9B,UAAU;QACV,IAAI,WACF;IAEJ,GAAG;QAAC;KAAU;IAEd,IAAI,eAAe,CAAA,GAAA,wBAAU,EAAE;QAC7B,UAAU;QACV,IAAI,UACF;IAEJ,GAAG;QAAC;KAAS;IAEb,4DAA4D;IAC5D,IAAI,eAAe,UAAU,CAAC;IAC9B,IAAI,CAAC,cACH,qDAAqD;IACrD,OAAO;IAGT,qBACE,0DAAC,CAAA,GAAA,gCAAe;QAAE,iBAAiB;QAAW,wBAAwB;QAAwB,oBAAoB;QAAoB,WAAW,CAAC;qBAChJ,0DAAC,CAAA,GAAA,qCAAO;QAAE,KAAK;QAAK,cAAc;YAAC,YAAY;YAAe,WAAW;QAAS;QAAG,YAAY;qBAC/F,0DAAC,CAAA,GAAA,wCAAa;QACZ,IAAI;QACJ,QAAA;QACA,QAAQ;QACR,WAAW;QACX,UAAU;QACV,SAAS;QACT,YAAY;QACZ,WAAW;QACX,SAAS;OACR;AAKX","sources":["packages/@react-spectrum/overlays/src/Overlay.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 {DOMRef} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nexport const Overlay = React.forwardRef(function Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n isOpen,\n disableFocusManagement,\n shouldContainFocus,\n container,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n nodeRef\n } = props;\n\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} shouldContainFocus={shouldContainFocus} isExiting={!isOpen}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n});\n"],"names":[],"version":3,"file":"Overlay.main.js.map"}
|
package/dist/Overlay.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import {Overlay as $eIXW5$Overlay} from "@react-aria/overlays";
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
const $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $eIXW5$react).forwardRef(function Overlay(props, ref) {
|
|
21
|
-
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
21
|
+
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, shouldContainFocus: shouldContainFocus, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
22
22
|
let [exited, setExited] = (0, $eIXW5$useState)(!isOpen);
|
|
23
23
|
let handleEntered = (0, $eIXW5$useCallback)(()=>{
|
|
24
24
|
setExited(false);
|
|
@@ -39,6 +39,7 @@ const $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $eIXW5$react
|
|
|
39
39
|
return /*#__PURE__*/ (0, $eIXW5$react).createElement((0, $eIXW5$Overlay), {
|
|
40
40
|
portalContainer: container,
|
|
41
41
|
disableFocusManagement: disableFocusManagement,
|
|
42
|
+
shouldContainFocus: shouldContainFocus,
|
|
42
43
|
isExiting: !isOpen
|
|
43
44
|
}, /*#__PURE__*/ (0, $eIXW5$react).createElement((0, $eIXW5$Provider), {
|
|
44
45
|
ref: ref,
|
package/dist/Overlay.module.js
CHANGED
|
@@ -18,7 +18,7 @@ import {Overlay as $eIXW5$Overlay} from "@react-aria/overlays";
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
const $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $eIXW5$react).forwardRef(function Overlay(props, ref) {
|
|
21
|
-
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
21
|
+
let { children: children, isOpen: isOpen, disableFocusManagement: disableFocusManagement, shouldContainFocus: shouldContainFocus, container: container, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, nodeRef: nodeRef } = props;
|
|
22
22
|
let [exited, setExited] = (0, $eIXW5$useState)(!isOpen);
|
|
23
23
|
let handleEntered = (0, $eIXW5$useCallback)(()=>{
|
|
24
24
|
setExited(false);
|
|
@@ -39,6 +39,7 @@ const $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $eIXW5$react
|
|
|
39
39
|
return /*#__PURE__*/ (0, $eIXW5$react).createElement((0, $eIXW5$Overlay), {
|
|
40
40
|
portalContainer: container,
|
|
41
41
|
disableFocusManagement: disableFocusManagement,
|
|
42
|
+
shouldContainFocus: shouldContainFocus,
|
|
42
43
|
isExiting: !isOpen
|
|
43
44
|
}, /*#__PURE__*/ (0, $eIXW5$react).createElement((0, $eIXW5$Provider), {
|
|
44
45
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AASM,MAAM,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,QAAQ,KAAmB,EAAE,GAA2B;IACvG,IAAI,YACF,QAAQ,UACR,MAAM,0BACN,sBAAsB,
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AASM,MAAM,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,QAAQ,KAAmB,EAAE,GAA2B;IACvG,IAAI,YACF,QAAQ,UACR,MAAM,0BACN,sBAAsB,sBACtB,kBAAkB,aAClB,SAAS,WACT,OAAO,cACP,UAAU,aACV,SAAS,UACT,MAAM,aACN,SAAS,YACT,QAAQ,WACR,OAAO,EACR,GAAG;IAEJ,IAAI,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IAEpC,IAAI,gBAAgB,CAAA,GAAA,kBAAU,EAAE;QAC9B,UAAU;QACV,IAAI,WACF;IAEJ,GAAG;QAAC;KAAU;IAEd,IAAI,eAAe,CAAA,GAAA,kBAAU,EAAE;QAC7B,UAAU;QACV,IAAI,UACF;IAEJ,GAAG;QAAC;KAAS;IAEb,4DAA4D;IAC5D,IAAI,eAAe,UAAU,CAAC;IAC9B,IAAI,CAAC,cACH,qDAAqD;IACrD,OAAO;IAGT,qBACE,gCAAC,CAAA,GAAA,cAAe;QAAE,iBAAiB;QAAW,wBAAwB;QAAwB,oBAAoB;QAAoB,WAAW,CAAC;qBAChJ,gCAAC,CAAA,GAAA,eAAO;QAAE,KAAK;QAAK,cAAc;YAAC,YAAY;YAAe,WAAW;QAAS;QAAG,YAAY;qBAC/F,gCAAC,CAAA,GAAA,yCAAa;QACZ,IAAI;QACJ,QAAA;QACA,QAAQ;QACR,WAAW;QACX,UAAU;QACV,SAAS;QACT,YAAY;QACZ,WAAW;QACX,SAAS;OACR;AAKX","sources":["packages/@react-spectrum/overlays/src/Overlay.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 {DOMRef} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nexport const Overlay = React.forwardRef(function Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n isOpen,\n disableFocusManagement,\n shouldContainFocus,\n container,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n nodeRef\n } = props;\n\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} shouldContainFocus={shouldContainFocus} isExiting={!isOpen}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n});\n"],"names":[],"version":3,"file":"Overlay.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAoBA;;;;;;;;;;;GAWG;AAEH,+BACE,KAAK,EAAE,GAAG,GACT,IAAI,OAAO,GAAG,aAAa,GAAG,EAAE,MAAM,GAAG,sBAAsB,GAAG,CAAC,CAAC,EAAE,CAWxE;AC3BD,OAAO,MAAM,yGAyDX,CAAC;AEpDH,sBAAuB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,EAAE,gBAAgB,EAAE,UAAU;IAC7G,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;CAClC;AA8BD,OAAO,MAAM,yGAgBX,CAAC;AC7DH,oBAAqB,SAAQ,qBAAqB,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,oBAAoB,CAAC;IAClH,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,oBAAoB,CAAA;CACrD;AAQD,OAAO,MAAM,qGAYX,CAAC;ACxBH,mBAAoB,SAAQ,qBAAqB,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,oBAAoB,CAAC;IACjH,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAOD,OAAO,MAAM,mGAYX,CAAC","sources":["packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Modal.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Tray.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":[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 */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/overlays",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@react-aria/interactions": "^3.25.
|
|
44
|
-
"@react-aria/overlays": "^3.
|
|
45
|
-
"@react-aria/utils": "^3.
|
|
46
|
-
"@react-spectrum/utils": "^3.12.
|
|
47
|
-
"@react-stately/overlays": "^3.6.
|
|
48
|
-
"@react-types/overlays": "^3.
|
|
49
|
-
"@react-types/shared": "^3.
|
|
43
|
+
"@react-aria/interactions": "^3.25.5",
|
|
44
|
+
"@react-aria/overlays": "^3.29.0",
|
|
45
|
+
"@react-aria/utils": "^3.30.1",
|
|
46
|
+
"@react-spectrum/utils": "^3.12.8",
|
|
47
|
+
"@react-stately/overlays": "^3.6.19",
|
|
48
|
+
"@react-types/overlays": "^3.9.1",
|
|
49
|
+
"@react-types/shared": "^3.32.0",
|
|
50
50
|
"@swc/helpers": "^0.5.0",
|
|
51
51
|
"react-transition-group": "^4.4.5"
|
|
52
52
|
},
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
|
|
65
65
|
}
|
package/src/OpenTransition.tsx
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
import React, {JSX, JSXElementConstructor, ReactElement} from 'react';
|
|
14
14
|
import {Transition} from 'react-transition-group';
|
|
15
|
-
// TODO install @types/react-transition-group
|
|
16
15
|
|
|
17
16
|
const OPEN_STATES = {
|
|
18
17
|
entering: false,
|
|
@@ -33,8 +32,7 @@ const OPEN_STATES = {
|
|
|
33
32
|
*/
|
|
34
33
|
|
|
35
34
|
export function OpenTransition(
|
|
36
|
-
|
|
37
|
-
props
|
|
35
|
+
props: any
|
|
38
36
|
): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {
|
|
39
37
|
// Do not apply any transition if in chromatic.
|
|
40
38
|
if (process.env.CHROMATIC) {
|
package/src/Overlay.tsx
CHANGED
|
@@ -22,6 +22,7 @@ export const Overlay = React.forwardRef(function Overlay(props: OverlayProps, re
|
|
|
22
22
|
children,
|
|
23
23
|
isOpen,
|
|
24
24
|
disableFocusManagement,
|
|
25
|
+
shouldContainFocus,
|
|
25
26
|
container,
|
|
26
27
|
onEnter,
|
|
27
28
|
onEntering,
|
|
@@ -56,7 +57,7 @@ export const Overlay = React.forwardRef(function Overlay(props: OverlayProps, re
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
|
-
<ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} isExiting={!isOpen}>
|
|
60
|
+
<ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} shouldContainFocus={shouldContainFocus} isExiting={!isOpen}>
|
|
60
61
|
<Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>
|
|
61
62
|
<OpenTransition
|
|
62
63
|
in={isOpen}
|