@react-spectrum/overlays 5.9.2 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/import.mjs +6 -6
  2. package/dist/main.js +10 -10
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +6 -6
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +6 -0
  7. package/package.json +13 -33
  8. package/src/index.ts +7 -5
  9. package/dist/Modal.main.js +0 -93
  10. package/dist/Modal.main.js.map +0 -1
  11. package/dist/Modal.mjs +0 -88
  12. package/dist/Modal.module.js +0 -88
  13. package/dist/Modal.module.js.map +0 -1
  14. package/dist/OpenTransition.main.js +0 -44
  15. package/dist/OpenTransition.main.js.map +0 -1
  16. package/dist/OpenTransition.mjs +0 -35
  17. package/dist/OpenTransition.module.js +0 -35
  18. package/dist/OpenTransition.module.js.map +0 -1
  19. package/dist/Overlay.main.js +0 -75
  20. package/dist/Overlay.main.js.map +0 -1
  21. package/dist/Overlay.mjs +0 -66
  22. package/dist/Overlay.module.js +0 -66
  23. package/dist/Overlay.module.js.map +0 -1
  24. package/dist/Popover.main.js +0 -206
  25. package/dist/Popover.main.js.map +0 -1
  26. package/dist/Popover.mjs +0 -201
  27. package/dist/Popover.module.js +0 -201
  28. package/dist/Popover.module.js.map +0 -1
  29. package/dist/Tray.main.js +0 -105
  30. package/dist/Tray.main.js.map +0 -1
  31. package/dist/Tray.mjs +0 -100
  32. package/dist/Tray.module.js +0 -100
  33. package/dist/Tray.module.js.map +0 -1
  34. package/dist/Underlay.main.js +0 -54
  35. package/dist/Underlay.main.js.map +0 -1
  36. package/dist/Underlay.mjs +0 -49
  37. package/dist/Underlay.module.js +0 -49
  38. package/dist/Underlay.module.js.map +0 -1
  39. package/dist/modal_vars_css.main.js +0 -59
  40. package/dist/modal_vars_css.main.js.map +0 -1
  41. package/dist/modal_vars_css.mjs +0 -61
  42. package/dist/modal_vars_css.module.js +0 -61
  43. package/dist/modal_vars_css.module.js.map +0 -1
  44. package/dist/overlays.c765f49e.css +0 -131
  45. package/dist/overlays.c765f49e.css.map +0 -1
  46. package/dist/overlays.ec5cd7e2.css +0 -210
  47. package/dist/overlays.ec5cd7e2.css.map +0 -1
  48. package/dist/overlays.ef39a1b9.css +0 -197
  49. package/dist/overlays.ef39a1b9.css.map +0 -1
  50. package/dist/overlays.f1e5a60e.css +0 -184
  51. package/dist/overlays.f1e5a60e.css.map +0 -1
  52. package/dist/overlays.f8d97b78.css +0 -12
  53. package/dist/overlays.f8d97b78.css.map +0 -1
  54. package/dist/overlays_css.main.js +0 -35
  55. package/dist/overlays_css.main.js.map +0 -1
  56. package/dist/overlays_css.mjs +0 -37
  57. package/dist/overlays_css.module.js +0 -37
  58. package/dist/overlays_css.module.js.map +0 -1
  59. package/dist/popover_vars_css.main.js +0 -83
  60. package/dist/popover_vars_css.main.js.map +0 -1
  61. package/dist/popover_vars_css.mjs +0 -85
  62. package/dist/popover_vars_css.module.js +0 -85
  63. package/dist/popover_vars_css.module.js.map +0 -1
  64. package/dist/tray_vars_css.main.js +0 -53
  65. package/dist/tray_vars_css.main.js.map +0 -1
  66. package/dist/tray_vars_css.mjs +0 -55
  67. package/dist/tray_vars_css.module.js +0 -55
  68. package/dist/tray_vars_css.module.js.map +0 -1
  69. package/dist/types.d.ts +0 -51
  70. package/dist/types.d.ts.map +0 -1
  71. package/dist/underlay_vars_css.main.js +0 -50
  72. package/dist/underlay_vars_css.main.js.map +0 -1
  73. package/dist/underlay_vars_css.mjs +0 -52
  74. package/dist/underlay_vars_css.module.js +0 -52
  75. package/dist/underlay_vars_css.module.js.map +0 -1
  76. package/src/Modal.tsx +0 -109
  77. package/src/OpenTransition.tsx +0 -47
  78. package/src/Overlay.tsx +0 -77
  79. package/src/Popover.tsx +0 -253
  80. package/src/Tray.tsx +0 -120
  81. package/src/Underlay.tsx +0 -43
  82. package/src/overlays.css +0 -32
package/dist/import.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import {Overlay as $70305dc5fb729c3b$export$c6fdb837b070b4ff} from "./Overlay.mjs";
2
- import {Popover as $17b503f7de08fecc$export$5b6b19405a83ff9d} from "./Popover.mjs";
3
- import {Modal as $842084dfa182af65$export$2b77a92f1a5ad772} from "./Modal.mjs";
4
- import {Tray as $1afc87f3d16a5a1c$export$4589ed81930b555c} from "./Tray.mjs";
5
- import {OpenTransition as $bc765a7a041310da$export$b847a40ee92eff38} from "./OpenTransition.mjs";
1
+ import {Overlay as $54c969fdbeac7d40$re_export$Overlay} from "@adobe/react-spectrum/private/overlays/Overlay";
2
+ import {Popover as $54c969fdbeac7d40$re_export$Popover} from "@adobe/react-spectrum/private/overlays/Popover";
3
+ import {Modal as $54c969fdbeac7d40$re_export$Modal} from "@adobe/react-spectrum/private/overlays/Modal";
4
+ import {Tray as $54c969fdbeac7d40$re_export$Tray} from "@adobe/react-spectrum/private/overlays/Tray";
5
+ import {OpenTransition as $54c969fdbeac7d40$re_export$OpenTransition} from "@adobe/react-spectrum/private/overlays/OpenTransition";
6
6
 
7
7
  /*
8
8
  * Copyright 2020 Adobe. All rights reserved.
@@ -22,5 +22,5 @@ import {OpenTransition as $bc765a7a041310da$export$b847a40ee92eff38} from "./Ope
22
22
 
23
23
 
24
24
 
25
- export {$70305dc5fb729c3b$export$c6fdb837b070b4ff as Overlay, $17b503f7de08fecc$export$5b6b19405a83ff9d as Popover, $842084dfa182af65$export$2b77a92f1a5ad772 as Modal, $1afc87f3d16a5a1c$export$4589ed81930b555c as Tray, $bc765a7a041310da$export$b847a40ee92eff38 as OpenTransition};
25
+ export {$54c969fdbeac7d40$re_export$Overlay as Overlay, $54c969fdbeac7d40$re_export$Popover as Popover, $54c969fdbeac7d40$re_export$Modal as Modal, $54c969fdbeac7d40$re_export$Tray as Tray, $54c969fdbeac7d40$re_export$OpenTransition as OpenTransition};
26
26
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,19 +1,19 @@
1
- var $2aebdc186fd41e87$exports = require("./Overlay.main.js");
2
- var $f02bba55a62f20dd$exports = require("./Popover.main.js");
3
- var $fc75a6aa7a2b905b$exports = require("./Modal.main.js");
4
- var $6b386deda21be662$exports = require("./Tray.main.js");
5
- var $13f51cdc44d228b9$exports = require("./OpenTransition.main.js");
1
+ var $buS3z$adobereactspectrumprivateoverlaysOverlay = require("@adobe/react-spectrum/private/overlays/Overlay");
2
+ var $buS3z$adobereactspectrumprivateoverlaysPopover = require("@adobe/react-spectrum/private/overlays/Popover");
3
+ var $buS3z$adobereactspectrumprivateoverlaysModal = require("@adobe/react-spectrum/private/overlays/Modal");
4
+ var $buS3z$adobereactspectrumprivateoverlaysTray = require("@adobe/react-spectrum/private/overlays/Tray");
5
+ var $buS3z$adobereactspectrumprivateoverlaysOpenTransition = require("@adobe/react-spectrum/private/overlays/OpenTransition");
6
6
 
7
7
 
8
8
  function $parcel$export(e, n, v, s) {
9
9
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
10
  }
11
11
 
12
- $parcel$export(module.exports, "Overlay", () => $2aebdc186fd41e87$exports.Overlay);
13
- $parcel$export(module.exports, "Popover", () => $f02bba55a62f20dd$exports.Popover);
14
- $parcel$export(module.exports, "Modal", () => $fc75a6aa7a2b905b$exports.Modal);
15
- $parcel$export(module.exports, "Tray", () => $6b386deda21be662$exports.Tray);
16
- $parcel$export(module.exports, "OpenTransition", () => $13f51cdc44d228b9$exports.OpenTransition);
12
+ $parcel$export(module.exports, "Overlay", function () { return $buS3z$adobereactspectrumprivateoverlaysOverlay.Overlay; });
13
+ $parcel$export(module.exports, "Popover", function () { return $buS3z$adobereactspectrumprivateoverlaysPopover.Popover; });
14
+ $parcel$export(module.exports, "Modal", function () { return $buS3z$adobereactspectrumprivateoverlaysModal.Modal; });
15
+ $parcel$export(module.exports, "Tray", function () { return $buS3z$adobereactspectrumprivateoverlaysTray.Tray; });
16
+ $parcel$export(module.exports, "OpenTransition", function () { return $buS3z$adobereactspectrumprivateoverlaysOpenTransition.OpenTransition; });
17
17
  /*
18
18
  * Copyright 2020 Adobe. All rights reserved.
19
19
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\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":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from '@adobe/react-spectrum/private/overlays/Overlay';\n\nexport {Popover} from '@adobe/react-spectrum/private/overlays/Popover';\nexport {Modal} from '@adobe/react-spectrum/private/overlays/Modal';\nexport {Tray} from '@adobe/react-spectrum/private/overlays/Tray';\nexport {OpenTransition} from '@adobe/react-spectrum/private/overlays/OpenTransition';\nexport type {OverlayProps} from '@adobe/react-spectrum/private/overlays/Overlay';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,8 +1,8 @@
1
- import {Overlay as $70305dc5fb729c3b$export$c6fdb837b070b4ff} from "./Overlay.module.js";
2
- import {Popover as $17b503f7de08fecc$export$5b6b19405a83ff9d} from "./Popover.module.js";
3
- import {Modal as $842084dfa182af65$export$2b77a92f1a5ad772} from "./Modal.module.js";
4
- import {Tray as $1afc87f3d16a5a1c$export$4589ed81930b555c} from "./Tray.module.js";
5
- import {OpenTransition as $bc765a7a041310da$export$b847a40ee92eff38} from "./OpenTransition.module.js";
1
+ import {Overlay as $54c969fdbeac7d40$re_export$Overlay} from "@adobe/react-spectrum/private/overlays/Overlay";
2
+ import {Popover as $54c969fdbeac7d40$re_export$Popover} from "@adobe/react-spectrum/private/overlays/Popover";
3
+ import {Modal as $54c969fdbeac7d40$re_export$Modal} from "@adobe/react-spectrum/private/overlays/Modal";
4
+ import {Tray as $54c969fdbeac7d40$re_export$Tray} from "@adobe/react-spectrum/private/overlays/Tray";
5
+ import {OpenTransition as $54c969fdbeac7d40$re_export$OpenTransition} from "@adobe/react-spectrum/private/overlays/OpenTransition";
6
6
 
7
7
  /*
8
8
  * Copyright 2020 Adobe. All rights reserved.
@@ -22,5 +22,5 @@ import {OpenTransition as $bc765a7a041310da$export$b847a40ee92eff38} from "./Ope
22
22
 
23
23
 
24
24
 
25
- export {$70305dc5fb729c3b$export$c6fdb837b070b4ff as Overlay, $17b503f7de08fecc$export$5b6b19405a83ff9d as Popover, $842084dfa182af65$export$2b77a92f1a5ad772 as Modal, $1afc87f3d16a5a1c$export$4589ed81930b555c as Tray, $bc765a7a041310da$export$b847a40ee92eff38 as OpenTransition};
25
+ export {$54c969fdbeac7d40$re_export$Overlay as Overlay, $54c969fdbeac7d40$re_export$Popover as Popover, $54c969fdbeac7d40$re_export$Modal as Modal, $54c969fdbeac7d40$re_export$Tray as Tray, $54c969fdbeac7d40$re_export$OpenTransition as OpenTransition};
26
26
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\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":"module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from '@adobe/react-spectrum/private/overlays/Overlay';\n\nexport {Popover} from '@adobe/react-spectrum/private/overlays/Popover';\nexport {Modal} from '@adobe/react-spectrum/private/overlays/Modal';\nexport {Tray} from '@adobe/react-spectrum/private/overlays/Tray';\nexport {OpenTransition} from '@adobe/react-spectrum/private/overlays/OpenTransition';\nexport type {OverlayProps} from '@adobe/react-spectrum/private/overlays/Overlay';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,6 @@
1
+ export { Overlay } from '@adobe/react-spectrum/private/overlays/Overlay';
2
+ export { Popover } from '@adobe/react-spectrum/private/overlays/Popover';
3
+ export { Modal } from '@adobe/react-spectrum/private/overlays/Modal';
4
+ export { Tray } from '@adobe/react-spectrum/private/overlays/Tray';
5
+ export { OpenTransition } from '@adobe/react-spectrum/private/overlays/OpenTransition';
6
+ export type { OverlayProps } from '@adobe/react-spectrum/private/overlays/Overlay';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/overlays",
3
- "version": "5.9.2",
3
+ "version": "5.10.0",
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
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,42 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/interactions": "^3.27.0",
44
- "@react-aria/overlays": "^3.31.1",
45
- "@react-aria/utils": "^3.33.0",
46
- "@react-spectrum/utils": "^3.12.11",
47
- "@react-stately/overlays": "^3.6.22",
48
- "@react-types/overlays": "^3.9.3",
49
- "@react-types/shared": "^3.33.0",
50
- "@swc/helpers": "^0.5.0",
51
- "react-transition-group": "^4.4.5"
52
- },
53
- "devDependencies": {
54
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
34
+ "@adobe/react-spectrum": "3.47.0",
35
+ "@swc/helpers": "^0.5.0"
55
36
  },
56
37
  "peerDependencies": {
57
- "@react-spectrum/provider": "^3.0.0",
58
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
59
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
60
40
  },
61
41
  "publishConfig": {
62
42
  "access": "public"
63
43
  },
64
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
65
45
  }
package/src/index.ts CHANGED
@@ -12,8 +12,10 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {Overlay} from './Overlay';
16
- export {Popover} from './Popover';
17
- export {Modal} from './Modal';
18
- export {Tray} from './Tray';
19
- export {OpenTransition} from './OpenTransition';
15
+ export {Overlay} from '@adobe/react-spectrum/private/overlays/Overlay';
16
+
17
+ export {Popover} from '@adobe/react-spectrum/private/overlays/Popover';
18
+ export {Modal} from '@adobe/react-spectrum/private/overlays/Modal';
19
+ export {Tray} from '@adobe/react-spectrum/private/overlays/Tray';
20
+ export {OpenTransition} from '@adobe/react-spectrum/private/overlays/OpenTransition';
21
+ export type {OverlayProps} from '@adobe/react-spectrum/private/overlays/Overlay';
@@ -1,93 +0,0 @@
1
- require("./overlays.ef39a1b9.css");
2
- var $86571b803f942ff3$exports = require("./modal_vars_css.main.js");
3
- var $2aebdc186fd41e87$exports = require("./Overlay.main.js");
4
- require("./overlays.f8d97b78.css");
5
- var $e9a663ccb19ed1b0$exports = require("./overlays_css.main.js");
6
- var $b900e75089bdd9cd$exports = require("./Underlay.main.js");
7
- var $aM0tW$reactariaoverlays = require("@react-aria/overlays");
8
- var $aM0tW$reactspectrumutils = require("@react-spectrum/utils");
9
- var $aM0tW$react = require("react");
10
- var $aM0tW$reactariautils = require("@react-aria/utils");
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
-
17
- function $parcel$export(e, n, v, s) {
18
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
- }
20
-
21
- $parcel$export(module.exports, "Modal", () => $fc75a6aa7a2b905b$export$2b77a92f1a5ad772);
22
- /*
23
- * Copyright 2020 Adobe. All rights reserved.
24
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
25
- * you may not use this file except in compliance with the License. You may obtain a copy
26
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
27
- *
28
- * Unless required by applicable law or agreed to in writing, software distributed under
29
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
30
- * OF ANY KIND, either express or implied. See the License for the specific language
31
- * governing permissions and limitations under the License.
32
- */
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
- const $fc75a6aa7a2b905b$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $aM0tW$react.forwardRef)(function Modal(props, ref) {
41
- let { children: children, state: state, ...otherProps } = props;
42
- let domRef = (0, $aM0tW$reactspectrumutils.useDOMRef)(ref);
43
- let wrapperRef = (0, $aM0tW$react.useRef)(null);
44
- return /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement((0, $2aebdc186fd41e87$exports.Overlay), {
45
- ...otherProps,
46
- isOpen: state.isOpen,
47
- nodeRef: wrapperRef
48
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement($fc75a6aa7a2b905b$var$ModalWrapper, {
49
- ...props,
50
- wrapperRef: wrapperRef,
51
- ref: domRef
52
- }, children));
53
- });
54
- let $fc75a6aa7a2b905b$var$typeMap = {
55
- fullscreen: 'fullscreen',
56
- fullscreenTakeover: 'fullscreenTakeover'
57
- };
58
- let $fc75a6aa7a2b905b$var$ModalWrapper = /*#__PURE__*/ (0, $aM0tW$react.forwardRef)(function(props, ref) {
59
- let { type: type, children: children, state: state, isOpen: isOpen, wrapperRef: wrapperRef } = props;
60
- let typeVariant = type != null ? $fc75a6aa7a2b905b$var$typeMap[type] : undefined;
61
- let { styleProps: styleProps } = (0, $aM0tW$reactspectrumutils.useStyleProps)(props);
62
- let objRef = (0, $aM0tW$reactariautils.useObjectRef)(ref);
63
- let { modalProps: modalProps, underlayProps: underlayProps } = (0, $aM0tW$reactariaoverlays.useModalOverlay)(props, state, objRef);
64
- let wrapperClassName = (0, $aM0tW$reactspectrumutils.classNames)((0, ($parcel$interopDefault($86571b803f942ff3$exports))), 'spectrum-Modal-wrapper', (0, $aM0tW$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e9a663ccb19ed1b0$exports))), 'spectrum-Modal-wrapper', 'react-spectrum-Modal-wrapper'));
65
- let modalClassName = (0, $aM0tW$reactspectrumutils.classNames)((0, ($parcel$interopDefault($86571b803f942ff3$exports))), 'spectrum-Modal', {
66
- 'is-open': isOpen
67
- }, (0, $aM0tW$reactspectrumutils.classNames)((0, ($parcel$interopDefault($e9a663ccb19ed1b0$exports))), 'spectrum-Modal', 'react-spectrum-Modal'), {
68
- [`spectrum-Modal--${typeVariant}`]: typeVariant
69
- }, styleProps.className);
70
- let viewport = (0, $aM0tW$reactariautils.useViewportSize)();
71
- let style = {
72
- '--spectrum-visual-viewport-height': viewport.height + 'px'
73
- };
74
- // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
75
- return /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement("div", {
76
- ref: wrapperRef
77
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement((0, $b900e75089bdd9cd$exports.Underlay), {
78
- ...underlayProps,
79
- isOpen: isOpen
80
- }), /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement("div", {
81
- className: wrapperClassName,
82
- style: style
83
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($aM0tW$react))).createElement("div", {
84
- ...styleProps,
85
- ...modalProps,
86
- ref: objRef,
87
- className: modalClassName,
88
- "data-testid": "modal"
89
- }, children)));
90
- });
91
-
92
-
93
- //# sourceMappingURL=Modal.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA0BM,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE,SAAS,MAAM,KAAiB,EAAE,GAA2B;IAC3F,IAAI,YAAC,QAAQ,SAAE,KAAK,EAAE,GAAG,YAAW,GAAG;IACvC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IAExC,qBACE,0DAAC,CAAA,GAAA,iCAAM;QAAG,GAAG,UAAU;QAAE,QAAQ,MAAM,MAAM;QAAE,SAAS;qBACtD,0DAAC;QAAc,GAAG,KAAK;QAAE,YAAY;QAAY,KAAK;OACnD;AAIT;AAEA,IAAI,gCAAU;IACZ,YAAY;IACZ,oBAAoB;AACtB;AAEA,IAAI,mDAAe,CAAA,GAAA,uBAAS,EAAE,SAAU,KAAwB,EAAE,GAAwC;IACxG,IAAI,QAAC,IAAI,YAAE,QAAQ,SAAE,KAAK,UAAE,MAAM,cAAE,UAAU,EAAC,GAAG;IAClD,IAAI,cAAc,QAAQ,OAAO,6BAAO,CAAC,KAAK,GAAG;IACjD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,kCAAW,EAAE;IAC1B,IAAI,cAAC,UAAU,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,wCAAc,EAAE,OAAO,OAAO;IAEhE,IAAI,mBAAmB,CAAA,GAAA,oCAAS,EAC9B,CAAA,GAAA,mDAAU,GACV,0BACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAa,GACb,0BACA;IAIJ,IAAI,iBAAiB,CAAA,GAAA,oCAAS,EAC5B,CAAA,GAAA,mDAAU,GACV,kBACA;QACE,WAAW;IACb,GACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAa,GACb,kBACA,yBAEF;QAAC,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAE;IAAW,GAChD,WAAW,SAAS;IAGtB,IAAI,WAAW,CAAA,GAAA,qCAAc;IAC7B,IAAI,QAAa;QACf,qCAAqC,SAAS,MAAM,GAAG;IACzD;IAEA,4LAA4L;IAC5L,qBACE,0DAAC;QAAI,KAAK;qBACR,0DAAC,CAAA,GAAA,kCAAO;QAAG,GAAG,aAAa;QAAE,QAAQ;sBACrC,0DAAC;QAAI,WAAW;QAAkB,OAAO;qBACvC,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WAAW;QACX,eAAY;OACX;AAKX","sources":["packages/@react-spectrum/overlays/src/Modal.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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, RefObject, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {ForwardedRef, forwardRef, ReactNode, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useObjectRef, useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: RefObject<HTMLDivElement | null>,\n children: ReactNode\n}\n\nexport const Modal = forwardRef(function Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n});\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: ForwardedRef<HTMLDivElement | null>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = type != null ? typeMap[type] : undefined;\n let {styleProps} = useStyleProps(props);\n let objRef = useObjectRef(ref);\n let {modalProps, underlayProps} = useModalOverlay(props, state, objRef);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={objRef}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Modal.main.js.map"}
package/dist/Modal.mjs DELETED
@@ -1,88 +0,0 @@
1
- import "./overlays.ef39a1b9.css";
2
- import $e9TuM$modal_vars_cssmodulejs from "./modal_vars_css.mjs";
3
- import {Overlay as $70305dc5fb729c3b$export$c6fdb837b070b4ff} from "./Overlay.mjs";
4
- import "./overlays.f8d97b78.css";
5
- import $e9TuM$overlays_cssmodulejs from "./overlays_css.mjs";
6
- import {Underlay as $76a452f4e3df11be$export$f360afc887607b02} from "./Underlay.mjs";
7
- import {useModalOverlay as $e9TuM$useModalOverlay} from "@react-aria/overlays";
8
- import {useDOMRef as $e9TuM$useDOMRef, useStyleProps as $e9TuM$useStyleProps, classNames as $e9TuM$classNames} from "@react-spectrum/utils";
9
- import $e9TuM$react, {forwardRef as $e9TuM$forwardRef, useRef as $e9TuM$useRef} from "react";
10
- import {useObjectRef as $e9TuM$useObjectRef, useViewportSize as $e9TuM$useViewportSize} from "@react-aria/utils";
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- const $842084dfa182af65$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $e9TuM$forwardRef)(function Modal(props, ref) {
35
- let { children: children, state: state, ...otherProps } = props;
36
- let domRef = (0, $e9TuM$useDOMRef)(ref);
37
- let wrapperRef = (0, $e9TuM$useRef)(null);
38
- return /*#__PURE__*/ (0, $e9TuM$react).createElement((0, $70305dc5fb729c3b$export$c6fdb837b070b4ff), {
39
- ...otherProps,
40
- isOpen: state.isOpen,
41
- nodeRef: wrapperRef
42
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement($842084dfa182af65$var$ModalWrapper, {
43
- ...props,
44
- wrapperRef: wrapperRef,
45
- ref: domRef
46
- }, children));
47
- });
48
- let $842084dfa182af65$var$typeMap = {
49
- fullscreen: 'fullscreen',
50
- fullscreenTakeover: 'fullscreenTakeover'
51
- };
52
- let $842084dfa182af65$var$ModalWrapper = /*#__PURE__*/ (0, $e9TuM$forwardRef)(function(props, ref) {
53
- let { type: type, children: children, state: state, isOpen: isOpen, wrapperRef: wrapperRef } = props;
54
- let typeVariant = type != null ? $842084dfa182af65$var$typeMap[type] : undefined;
55
- let { styleProps: styleProps } = (0, $e9TuM$useStyleProps)(props);
56
- let objRef = (0, $e9TuM$useObjectRef)(ref);
57
- let { modalProps: modalProps, underlayProps: underlayProps } = (0, $e9TuM$useModalOverlay)(props, state, objRef);
58
- let wrapperClassName = (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$modal_vars_cssmodulejs))), 'spectrum-Modal-wrapper', (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$overlays_cssmodulejs))), 'spectrum-Modal-wrapper', 'react-spectrum-Modal-wrapper'));
59
- let modalClassName = (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$modal_vars_cssmodulejs))), 'spectrum-Modal', {
60
- 'is-open': isOpen
61
- }, (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$overlays_cssmodulejs))), 'spectrum-Modal', 'react-spectrum-Modal'), {
62
- [`spectrum-Modal--${typeVariant}`]: typeVariant
63
- }, styleProps.className);
64
- let viewport = (0, $e9TuM$useViewportSize)();
65
- let style = {
66
- '--spectrum-visual-viewport-height': viewport.height + 'px'
67
- };
68
- // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
69
- return /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
70
- ref: wrapperRef
71
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement((0, $76a452f4e3df11be$export$f360afc887607b02), {
72
- ...underlayProps,
73
- isOpen: isOpen
74
- }), /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
75
- className: wrapperClassName,
76
- style: style
77
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
78
- ...styleProps,
79
- ...modalProps,
80
- ref: objRef,
81
- className: modalClassName,
82
- "data-testid": "modal"
83
- }, children)));
84
- });
85
-
86
-
87
- export {$842084dfa182af65$export$2b77a92f1a5ad772 as Modal};
88
- //# sourceMappingURL=Modal.module.js.map
@@ -1,88 +0,0 @@
1
- import "./overlays.ef39a1b9.css";
2
- import $e9TuM$modal_vars_cssmodulejs from "./modal_vars_css.module.js";
3
- import {Overlay as $70305dc5fb729c3b$export$c6fdb837b070b4ff} from "./Overlay.module.js";
4
- import "./overlays.f8d97b78.css";
5
- import $e9TuM$overlays_cssmodulejs from "./overlays_css.module.js";
6
- import {Underlay as $76a452f4e3df11be$export$f360afc887607b02} from "./Underlay.module.js";
7
- import {useModalOverlay as $e9TuM$useModalOverlay} from "@react-aria/overlays";
8
- import {useDOMRef as $e9TuM$useDOMRef, useStyleProps as $e9TuM$useStyleProps, classNames as $e9TuM$classNames} from "@react-spectrum/utils";
9
- import $e9TuM$react, {forwardRef as $e9TuM$forwardRef, useRef as $e9TuM$useRef} from "react";
10
- import {useObjectRef as $e9TuM$useObjectRef, useViewportSize as $e9TuM$useViewportSize} from "@react-aria/utils";
11
-
12
-
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- const $842084dfa182af65$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $e9TuM$forwardRef)(function Modal(props, ref) {
35
- let { children: children, state: state, ...otherProps } = props;
36
- let domRef = (0, $e9TuM$useDOMRef)(ref);
37
- let wrapperRef = (0, $e9TuM$useRef)(null);
38
- return /*#__PURE__*/ (0, $e9TuM$react).createElement((0, $70305dc5fb729c3b$export$c6fdb837b070b4ff), {
39
- ...otherProps,
40
- isOpen: state.isOpen,
41
- nodeRef: wrapperRef
42
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement($842084dfa182af65$var$ModalWrapper, {
43
- ...props,
44
- wrapperRef: wrapperRef,
45
- ref: domRef
46
- }, children));
47
- });
48
- let $842084dfa182af65$var$typeMap = {
49
- fullscreen: 'fullscreen',
50
- fullscreenTakeover: 'fullscreenTakeover'
51
- };
52
- let $842084dfa182af65$var$ModalWrapper = /*#__PURE__*/ (0, $e9TuM$forwardRef)(function(props, ref) {
53
- let { type: type, children: children, state: state, isOpen: isOpen, wrapperRef: wrapperRef } = props;
54
- let typeVariant = type != null ? $842084dfa182af65$var$typeMap[type] : undefined;
55
- let { styleProps: styleProps } = (0, $e9TuM$useStyleProps)(props);
56
- let objRef = (0, $e9TuM$useObjectRef)(ref);
57
- let { modalProps: modalProps, underlayProps: underlayProps } = (0, $e9TuM$useModalOverlay)(props, state, objRef);
58
- let wrapperClassName = (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$modal_vars_cssmodulejs))), 'spectrum-Modal-wrapper', (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$overlays_cssmodulejs))), 'spectrum-Modal-wrapper', 'react-spectrum-Modal-wrapper'));
59
- let modalClassName = (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$modal_vars_cssmodulejs))), 'spectrum-Modal', {
60
- 'is-open': isOpen
61
- }, (0, $e9TuM$classNames)((0, ($parcel$interopDefault($e9TuM$overlays_cssmodulejs))), 'spectrum-Modal', 'react-spectrum-Modal'), {
62
- [`spectrum-Modal--${typeVariant}`]: typeVariant
63
- }, styleProps.className);
64
- let viewport = (0, $e9TuM$useViewportSize)();
65
- let style = {
66
- '--spectrum-visual-viewport-height': viewport.height + 'px'
67
- };
68
- // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
69
- return /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
70
- ref: wrapperRef
71
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement((0, $76a452f4e3df11be$export$f360afc887607b02), {
72
- ...underlayProps,
73
- isOpen: isOpen
74
- }), /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
75
- className: wrapperClassName,
76
- style: style
77
- }, /*#__PURE__*/ (0, $e9TuM$react).createElement("div", {
78
- ...styleProps,
79
- ...modalProps,
80
- ref: objRef,
81
- className: modalClassName,
82
- "data-testid": "modal"
83
- }, children)));
84
- });
85
-
86
-
87
- export {$842084dfa182af65$export$2b77a92f1a5ad772 as Modal};
88
- //# sourceMappingURL=Modal.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA0BM,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE,SAAS,MAAM,KAAiB,EAAE,GAA2B;IAC3F,IAAI,YAAC,QAAQ,SAAE,KAAK,EAAE,GAAG,YAAW,GAAG;IACvC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IAExC,qBACE,gCAAC,CAAA,GAAA,yCAAM;QAAG,GAAG,UAAU;QAAE,QAAQ,MAAM,MAAM;QAAE,SAAS;qBACtD,gCAAC;QAAc,GAAG,KAAK;QAAE,YAAY;QAAY,KAAK;OACnD;AAIT;AAEA,IAAI,gCAAU;IACZ,YAAY;IACZ,oBAAoB;AACtB;AAEA,IAAI,mDAAe,CAAA,GAAA,iBAAS,EAAE,SAAU,KAAwB,EAAE,GAAwC;IACxG,IAAI,QAAC,IAAI,YAAE,QAAQ,SAAE,KAAK,UAAE,MAAM,cAAE,UAAU,EAAC,GAAG;IAClD,IAAI,cAAc,QAAQ,OAAO,6BAAO,CAAC,KAAK,GAAG;IACjD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE;IAC1B,IAAI,cAAC,UAAU,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,OAAO;IAEhE,IAAI,mBAAmB,CAAA,GAAA,iBAAS,EAC9B,CAAA,GAAA,uDAAU,GACV,0BACA,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,qDAAa,GACb,0BACA;IAIJ,IAAI,iBAAiB,CAAA,GAAA,iBAAS,EAC5B,CAAA,GAAA,uDAAU,GACV,kBACA;QACE,WAAW;IACb,GACA,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,qDAAa,GACb,kBACA,yBAEF;QAAC,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAE;IAAW,GAChD,WAAW,SAAS;IAGtB,IAAI,WAAW,CAAA,GAAA,sBAAc;IAC7B,IAAI,QAAa;QACf,qCAAqC,SAAS,MAAM,GAAG;IACzD;IAEA,4LAA4L;IAC5L,qBACE,gCAAC;QAAI,KAAK;qBACR,gCAAC,CAAA,GAAA,yCAAO;QAAG,GAAG,aAAa;QAAE,QAAQ;sBACrC,gCAAC;QAAI,WAAW;QAAkB,OAAO;qBACvC,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WAAW;QACX,eAAY;OACX;AAKX","sources":["packages/@react-spectrum/overlays/src/Modal.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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, RefObject, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {ForwardedRef, forwardRef, ReactNode, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useObjectRef, useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: RefObject<HTMLDivElement | null>,\n children: ReactNode\n}\n\nexport const Modal = forwardRef(function Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n});\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: ForwardedRef<HTMLDivElement | null>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = type != null ? typeMap[type] : undefined;\n let {styleProps} = useStyleProps(props);\n let objRef = useObjectRef(ref);\n let {modalProps, underlayProps} = useModalOverlay(props, state, objRef);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={objRef}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Modal.module.js.map"}
@@ -1,44 +0,0 @@
1
- var $3kGU5$react = require("react");
2
- var $3kGU5$reacttransitiongroup = require("react-transition-group");
3
-
4
-
5
- function $parcel$interopDefault(a) {
6
- return a && a.__esModule ? a.default : a;
7
- }
8
-
9
- function $parcel$export(e, n, v, s) {
10
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11
- }
12
-
13
- $parcel$export(module.exports, "OpenTransition", () => $13f51cdc44d228b9$export$b847a40ee92eff38);
14
- /*
15
- * Copyright 2020 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
-
26
- const $13f51cdc44d228b9$var$OPEN_STATES = {
27
- entering: false,
28
- entered: true
29
- };
30
- function $13f51cdc44d228b9$export$b847a40ee92eff38(props) {
31
- var child;
32
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3kGU5$react))).createElement((0, $3kGU5$reacttransitiongroup.Transition), {
33
- timeout: {
34
- enter: 0,
35
- exit: 350
36
- },
37
- ...props
38
- }, (state)=>(0, ($parcel$interopDefault($3kGU5$react))).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, ($parcel$interopDefault($3kGU5$react))).cloneElement(child, {
39
- isOpen: !!$13f51cdc44d228b9$var$OPEN_STATES[state]
40
- })));
41
- }
42
-
43
-
44
- //# sourceMappingURL=OpenTransition.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKD,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CACd,KAAU;QAIkC;IAG5C,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 (typeof process !== 'undefined' && 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,35 +0,0 @@
1
- import $8XmPE$react from "react";
2
- import {Transition as $8XmPE$Transition} from "react-transition-group";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- const $bc765a7a041310da$var$OPEN_STATES = {
17
- entering: false,
18
- entered: true
19
- };
20
- function $bc765a7a041310da$export$b847a40ee92eff38(props) {
21
- var child;
22
- return /*#__PURE__*/ (0, $8XmPE$react).createElement((0, $8XmPE$Transition), {
23
- timeout: {
24
- enter: 0,
25
- exit: 350
26
- },
27
- ...props
28
- }, (state)=>(0, $8XmPE$react).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, $8XmPE$react).cloneElement(child, {
29
- isOpen: !!$bc765a7a041310da$var$OPEN_STATES[state]
30
- })));
31
- }
32
-
33
-
34
- export {$bc765a7a041310da$export$b847a40ee92eff38 as OpenTransition};
35
- //# sourceMappingURL=OpenTransition.module.js.map
@@ -1,35 +0,0 @@
1
- import $8XmPE$react from "react";
2
- import {Transition as $8XmPE$Transition} from "react-transition-group";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- const $bc765a7a041310da$var$OPEN_STATES = {
17
- entering: false,
18
- entered: true
19
- };
20
- function $bc765a7a041310da$export$b847a40ee92eff38(props) {
21
- var child;
22
- return /*#__PURE__*/ (0, $8XmPE$react).createElement((0, $8XmPE$Transition), {
23
- timeout: {
24
- enter: 0,
25
- exit: 350
26
- },
27
- ...props
28
- }, (state)=>(0, $8XmPE$react).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, $8XmPE$react).cloneElement(child, {
29
- isOpen: !!$bc765a7a041310da$var$OPEN_STATES[state]
30
- })));
31
- }
32
-
33
-
34
- export {$bc765a7a041310da$export$b847a40ee92eff38 as OpenTransition};
35
- //# sourceMappingURL=OpenTransition.module.js.map