@react-spectrum/overlays 5.7.4 → 5.7.6
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.map +1 -1
- package/dist/OpenTransition.module.js.map +1 -1
- package/dist/Underlay.main.js.map +1 -1
- package/dist/Underlay.module.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -10
- package/src/OpenTransition.tsx +4 -4
- package/src/Underlay.tsx +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAID,6CAA6C;AAE7C,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,6EAA6E;AAC7E,KAAK;IAEL,+CAA+C;IAC/C,IAAI,QAAQ,GAAG,CAAC,SAAS,EACvB,OAAO,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAID,6CAA6C;AAE7C,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,6EAA6E;AAC7E,KAAK;IAEL,+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// TODO install @types/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 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n props\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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAID,6CAA6C;AAE7C,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,6EAA6E;AAC7E,KAAK;IAEL,+CAA+C;IAC/C,IAAI,QAAQ,GAAG,CAAC,SAAS,EACvB,OAAO,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAID,6CAA6C;AAE7C,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,6EAA6E;AAC7E,KAAK;IAEL,+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// TODO install @types/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 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n props\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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWM,SAAS,0CAAS,UAAC,MAAM,iBAAE,aAAa,EAAE,GAAG,YAA0B;IAC5E,qBACE,0DAAC;QAAI,eAAY;QAAY,GAAG,UAAU;QAAE,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG,qBAAqB;YAAC,WAAW;YAAQ,kCAAkC;QAAa;;AAE9K","sources":["packages/@react-spectrum/overlays/src/Underlay.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 {classNames} from '@react-spectrum/utils';\nimport React, {
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWM,SAAS,0CAAS,UAAC,MAAM,iBAAE,aAAa,EAAE,GAAG,YAA0B;IAC5E,qBACE,0DAAC;QAAI,eAAY;QAAY,GAAG,UAAU;QAAE,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG,qBAAqB;YAAC,WAAW;YAAQ,kCAAkC;QAAa;;AAE9K","sources":["packages/@react-spectrum/overlays/src/Underlay.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 {classNames} from '@react-spectrum/utils';\nimport React, {JSX} from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps): JSX.Element {\n return (\n <div data-testid=\"underlay\" {...otherProps} className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n"],"names":[],"version":3,"file":"Underlay.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWM,SAAS,0CAAS,UAAC,MAAM,iBAAE,aAAa,EAAE,GAAG,YAA0B;IAC5E,qBACE,gCAAC;QAAI,eAAY;QAAY,GAAG,UAAU;QAAE,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAa,GAAG,qBAAqB;YAAC,WAAW;YAAQ,kCAAkC;QAAa;;AAE9K","sources":["packages/@react-spectrum/overlays/src/Underlay.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 {classNames} from '@react-spectrum/utils';\nimport React, {
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWM,SAAS,0CAAS,UAAC,MAAM,iBAAE,aAAa,EAAE,GAAG,YAA0B;IAC5E,qBACE,gCAAC;QAAI,eAAY;QAAY,GAAG,UAAU;QAAE,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAa,GAAG,qBAAqB;YAAC,WAAW;YAAQ,kCAAkC;QAAa;;AAE9K","sources":["packages/@react-spectrum/overlays/src/Underlay.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 {classNames} from '@react-spectrum/utils';\nimport React, {JSX} from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps): JSX.Element {\n return (\n <div data-testid=\"underlay\" {...otherProps} className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n"],"names":[],"version":3,"file":"Underlay.module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import React, { JSX, JSXElementConstructor, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { OverlayProps } from "@react-types/overlays";
|
|
3
3
|
import { DOMRefValue, StyleProps } from "@react-types/shared";
|
|
4
4
|
import { AriaPopoverProps, AriaModalOverlayProps } from "@react-aria/overlays";
|
|
@@ -16,7 +16,7 @@ import { OverlayTriggerState } from "@react-stately/overlays";
|
|
|
16
16
|
* before removing from the DOM
|
|
17
17
|
* **note** hitting esc bypasses exit animation for anyone testing.
|
|
18
18
|
*/
|
|
19
|
-
export function OpenTransition(props: any):
|
|
19
|
+
export function OpenTransition(props: any): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[];
|
|
20
20
|
export const Overlay: React.ForwardRefExoticComponent<OverlayProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
|
|
21
21
|
interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, FocusWithinProps, StyleProps {
|
|
22
22
|
children: ReactNode;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAqBA;;;;;;;;;;;GAWG;AAEH,+BAEE,KAAK,KAAA,GACJ,
|
|
1
|
+
{"mappings":";;;;;;AAqBA;;;;;;;;;;;GAWG;AAEH,+BAEE,KAAK,KAAA,GACJ,IAAI,OAAO,GAAG,aAAa,GAAG,EAAE,MAAM,GAAG,sBAAsB,GAAG,CAAC,CAAC,EAAE,CAWxE;AC7BD,OAAO,MAAM,yGAwDX,CAAC;AEnDH,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,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/overlays",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.6",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": [
|
|
11
|
+
"./dist/types.d.ts",
|
|
12
|
+
"./src/index.ts"
|
|
13
|
+
],
|
|
10
14
|
"import": "./dist/import.mjs",
|
|
11
15
|
"require": "./dist/main.js"
|
|
12
16
|
},
|
|
@@ -36,13 +40,13 @@
|
|
|
36
40
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@react-aria/interactions": "^3.25.
|
|
40
|
-
"@react-aria/overlays": "^3.27.
|
|
41
|
-
"@react-aria/utils": "^3.
|
|
42
|
-
"@react-spectrum/utils": "^3.12.
|
|
43
|
-
"@react-stately/overlays": "^3.6.
|
|
44
|
-
"@react-types/overlays": "^3.8.
|
|
45
|
-
"@react-types/shared": "^3.
|
|
43
|
+
"@react-aria/interactions": "^3.25.2",
|
|
44
|
+
"@react-aria/overlays": "^3.27.2",
|
|
45
|
+
"@react-aria/utils": "^3.29.1",
|
|
46
|
+
"@react-spectrum/utils": "^3.12.6",
|
|
47
|
+
"@react-stately/overlays": "^3.6.17",
|
|
48
|
+
"@react-types/overlays": "^3.8.16",
|
|
49
|
+
"@react-types/shared": "^3.30.0",
|
|
46
50
|
"@swc/helpers": "^0.5.0",
|
|
47
51
|
"react-transition-group": "^4.4.5"
|
|
48
52
|
},
|
|
@@ -57,5 +61,5 @@
|
|
|
57
61
|
"publishConfig": {
|
|
58
62
|
"access": "public"
|
|
59
63
|
},
|
|
60
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "265b4d7f107905ee1c6e87a8af1613ab440a6849"
|
|
61
65
|
}
|
package/src/OpenTransition.tsx
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React, {
|
|
13
|
+
import React, {JSX, JSXElementConstructor, ReactElement} from 'react';
|
|
14
14
|
import {Transition} from 'react-transition-group';
|
|
15
15
|
// TODO install @types/react-transition-group
|
|
16
16
|
|
|
@@ -35,15 +35,15 @@ const OPEN_STATES = {
|
|
|
35
35
|
export function OpenTransition(
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
37
37
|
props
|
|
38
|
-
):
|
|
38
|
+
): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {
|
|
39
39
|
// Do not apply any transition if in chromatic.
|
|
40
40
|
if (process.env.CHROMATIC) {
|
|
41
|
-
return React.Children.map(props.children
|
|
41
|
+
return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<Transition timeout={{enter: 0, exit: 350}} {...props}>
|
|
46
|
-
{(state) => React.Children.map(props.children, child => child && React.cloneElement(child
|
|
46
|
+
{(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}
|
|
47
47
|
</Transition>
|
|
48
48
|
);
|
|
49
49
|
}
|
package/src/Underlay.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {classNames} from '@react-spectrum/utils';
|
|
14
|
-
import React, {
|
|
14
|
+
import React, {JSX} from 'react';
|
|
15
15
|
import underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';
|
|
16
16
|
|
|
17
17
|
interface UnderlayProps {
|
|
@@ -19,7 +19,7 @@ interface UnderlayProps {
|
|
|
19
19
|
isTransparent?: boolean
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps):
|
|
22
|
+
export function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps): JSX.Element {
|
|
23
23
|
return (
|
|
24
24
|
<div data-testid="underlay" {...otherProps} className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />
|
|
25
25
|
);
|