@react-stately/overlays 3.6.6-nightly.4555 → 3.6.6-nightly.4558

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/import.mjs CHANGED
@@ -1,17 +1,6 @@
1
- import {useCallback as $4oA3P$useCallback} from "react";
2
- import {useControlledState as $4oA3P$useControlledState} from "@react-stately/utils";
1
+ import {useOverlayTriggerState as $fc909762b330b746$export$61c6a8c84e605fb6} from "./useOverlayTriggerState.mjs";
3
2
 
4
3
  /*
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
4
  * Copyright 2020 Adobe. All rights reserved.
16
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
6
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -23,35 +12,6 @@ import {useControlledState as $4oA3P$useControlledState} from "@react-stately/ut
23
12
  * governing permissions and limitations under the License.
24
13
  */
25
14
 
26
- function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
27
- let [isOpen, setOpen] = (0, $4oA3P$useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
28
- const open = (0, $4oA3P$useCallback)(()=>{
29
- setOpen(true);
30
- }, [
31
- setOpen
32
- ]);
33
- const close = (0, $4oA3P$useCallback)(()=>{
34
- setOpen(false);
35
- }, [
36
- setOpen
37
- ]);
38
- const toggle = (0, $4oA3P$useCallback)(()=>{
39
- setOpen(!isOpen);
40
- }, [
41
- setOpen,
42
- isOpen
43
- ]);
44
- return {
45
- isOpen: isOpen,
46
- setOpen: setOpen,
47
- open: open,
48
- close: close,
49
- toggle: toggle
50
- };
51
- }
52
-
53
-
54
-
55
15
 
56
16
  export {$fc909762b330b746$export$61c6a8c84e605fb6 as useOverlayTriggerState};
57
17
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,23 +1,12 @@
1
- var $1rDpM$react = require("react");
2
- var $1rDpM$reactstatelyutils = require("@react-stately/utils");
1
+ var $5076d97fb6884665$exports = require("./useOverlayTriggerState.main.js");
3
2
 
4
3
 
5
4
  function $parcel$export(e, n, v, s) {
6
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
6
  }
8
7
 
9
- $parcel$export(module.exports, "useOverlayTriggerState", () => $5076d97fb6884665$export$61c6a8c84e605fb6);
8
+ $parcel$export(module.exports, "useOverlayTriggerState", () => $5076d97fb6884665$exports.useOverlayTriggerState);
10
9
  /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */ /*
21
10
  * Copyright 2020 Adobe. All rights reserved.
22
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
12
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -29,34 +18,5 @@ $parcel$export(module.exports, "useOverlayTriggerState", () => $5076d97fb6884665
29
18
  * governing permissions and limitations under the License.
30
19
  */
31
20
 
32
- function $5076d97fb6884665$export$61c6a8c84e605fb6(props) {
33
- let [isOpen, setOpen] = (0, $1rDpM$reactstatelyutils.useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
34
- const open = (0, $1rDpM$react.useCallback)(()=>{
35
- setOpen(true);
36
- }, [
37
- setOpen
38
- ]);
39
- const close = (0, $1rDpM$react.useCallback)(()=>{
40
- setOpen(false);
41
- }, [
42
- setOpen
43
- ]);
44
- const toggle = (0, $1rDpM$react.useCallback)(()=>{
45
- setOpen(!isOpen);
46
- }, [
47
- setOpen,
48
- isOpen
49
- ]);
50
- return {
51
- isOpen: isOpen,
52
- setOpen: setOpen,
53
- open: open,
54
- close: close,
55
- toggle: toggle
56
- };
57
- }
58
-
59
-
60
-
61
21
 
62
22
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAuBM,SAAS,0CAAuB,KAA0B;IAC/D,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAA,GAAA,2CAAiB,EAAE,MAAM,MAAM,EAAE,MAAM,WAAW,IAAI,OAAO,MAAM,YAAY;IAEvG,MAAM,OAAO,CAAA,GAAA,wBAAU,EAAE;QACvB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,QAAQ,CAAA,GAAA,wBAAU,EAAE;QACxB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,SAAS,CAAA,GAAA,wBAAU,EAAE;QACzB,QAAQ,CAAC;IACX,GAAG;QAAC;QAAS;KAAO;IAEpB,OAAO;gBACL;iBACA;cACA;eACA;gBACA;IACF;AACF;;CD7CC","sources":["packages/@react-stately/overlays/src/index.ts","packages/@react-stately/overlays/src/useOverlayTriggerState.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\nexport {useOverlayTriggerState} from './useOverlayTriggerState';\n\nexport type {OverlayTriggerProps} from '@react-types/overlays';\nexport type {OverlayTriggerState} from './useOverlayTriggerState';\n","/*\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 {OverlayTriggerProps} from '@react-types/overlays';\nimport {useCallback} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface OverlayTriggerState {\n /** Whether the overlay is currently open. */\n readonly isOpen: boolean,\n /** Sets whether the overlay is open. */\n setOpen(isOpen: boolean): void,\n /** Opens the overlay. */\n open(): void,\n /** Closes the overlay. */\n close(): void,\n /** Toggles the overlay's visibility. */\n toggle(): void\n}\n\n/**\n * Manages state for an overlay trigger. Tracks whether the overlay is open, and provides\n * methods to toggle this state.\n */\nexport function useOverlayTriggerState(props: OverlayTriggerProps): OverlayTriggerState {\n let [isOpen, setOpen] = useControlledState(props.isOpen, props.defaultOpen || false, props.onOpenChange);\n\n const open = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [setOpen, isOpen]);\n\n return {\n isOpen,\n setOpen,\n open,\n close,\n toggle\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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\nexport {useOverlayTriggerState} from './useOverlayTriggerState';\n\nexport type {OverlayTriggerProps} from '@react-types/overlays';\nexport type {OverlayTriggerState} from './useOverlayTriggerState';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,17 +1,6 @@
1
- import {useCallback as $4oA3P$useCallback} from "react";
2
- import {useControlledState as $4oA3P$useControlledState} from "@react-stately/utils";
1
+ import {useOverlayTriggerState as $fc909762b330b746$export$61c6a8c84e605fb6} from "./useOverlayTriggerState.module.js";
3
2
 
4
3
  /*
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
4
  * Copyright 2020 Adobe. All rights reserved.
16
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
6
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -23,35 +12,6 @@ import {useControlledState as $4oA3P$useControlledState} from "@react-stately/ut
23
12
  * governing permissions and limitations under the License.
24
13
  */
25
14
 
26
- function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
27
- let [isOpen, setOpen] = (0, $4oA3P$useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
28
- const open = (0, $4oA3P$useCallback)(()=>{
29
- setOpen(true);
30
- }, [
31
- setOpen
32
- ]);
33
- const close = (0, $4oA3P$useCallback)(()=>{
34
- setOpen(false);
35
- }, [
36
- setOpen
37
- ]);
38
- const toggle = (0, $4oA3P$useCallback)(()=>{
39
- setOpen(!isOpen);
40
- }, [
41
- setOpen,
42
- isOpen
43
- ]);
44
- return {
45
- isOpen: isOpen,
46
- setOpen: setOpen,
47
- open: open,
48
- close: close,
49
- toggle: toggle
50
- };
51
- }
52
-
53
-
54
-
55
15
 
56
16
  export {$fc909762b330b746$export$61c6a8c84e605fb6 as useOverlayTriggerState};
57
17
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAuBM,SAAS,0CAAuB,KAA0B;IAC/D,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,MAAM,EAAE,MAAM,WAAW,IAAI,OAAO,MAAM,YAAY;IAEvG,MAAM,OAAO,CAAA,GAAA,kBAAU,EAAE;QACvB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,QAAQ,CAAA,GAAA,kBAAU,EAAE;QACxB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,SAAS,CAAA,GAAA,kBAAU,EAAE;QACzB,QAAQ,CAAC;IACX,GAAG;QAAC;QAAS;KAAO;IAEpB,OAAO;gBACL;iBACA;cACA;eACA;gBACA;IACF;AACF;;CD7CC","sources":["packages/@react-stately/overlays/src/index.ts","packages/@react-stately/overlays/src/useOverlayTriggerState.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\nexport {useOverlayTriggerState} from './useOverlayTriggerState';\n\nexport type {OverlayTriggerProps} from '@react-types/overlays';\nexport type {OverlayTriggerState} from './useOverlayTriggerState';\n","/*\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 {OverlayTriggerProps} from '@react-types/overlays';\nimport {useCallback} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface OverlayTriggerState {\n /** Whether the overlay is currently open. */\n readonly isOpen: boolean,\n /** Sets whether the overlay is open. */\n setOpen(isOpen: boolean): void,\n /** Opens the overlay. */\n open(): void,\n /** Closes the overlay. */\n close(): void,\n /** Toggles the overlay's visibility. */\n toggle(): void\n}\n\n/**\n * Manages state for an overlay trigger. Tracks whether the overlay is open, and provides\n * methods to toggle this state.\n */\nexport function useOverlayTriggerState(props: OverlayTriggerProps): OverlayTriggerState {\n let [isOpen, setOpen] = useControlledState(props.isOpen, props.defaultOpen || false, props.onOpenChange);\n\n const open = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [setOpen, isOpen]);\n\n return {\n isOpen,\n setOpen,\n open,\n close,\n toggle\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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\nexport {useOverlayTriggerState} from './useOverlayTriggerState';\n\nexport type {OverlayTriggerProps} from '@react-types/overlays';\nexport type {OverlayTriggerState} from './useOverlayTriggerState';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,50 @@
1
+ var $62yjz$react = require("react");
2
+ var $62yjz$reactstatelyutils = require("@react-stately/utils");
3
+
4
+
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
+ }
8
+
9
+ $parcel$export(module.exports, "useOverlayTriggerState", () => $5076d97fb6884665$export$61c6a8c84e605fb6);
10
+ /*
11
+ * Copyright 2020 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */
21
+
22
+ function $5076d97fb6884665$export$61c6a8c84e605fb6(props) {
23
+ let [isOpen, setOpen] = (0, $62yjz$reactstatelyutils.useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
24
+ const open = (0, $62yjz$react.useCallback)(()=>{
25
+ setOpen(true);
26
+ }, [
27
+ setOpen
28
+ ]);
29
+ const close = (0, $62yjz$react.useCallback)(()=>{
30
+ setOpen(false);
31
+ }, [
32
+ setOpen
33
+ ]);
34
+ const toggle = (0, $62yjz$react.useCallback)(()=>{
35
+ setOpen(!isOpen);
36
+ }, [
37
+ setOpen,
38
+ isOpen
39
+ ]);
40
+ return {
41
+ isOpen: isOpen,
42
+ setOpen: setOpen,
43
+ open: open,
44
+ close: close,
45
+ toggle: toggle
46
+ };
47
+ }
48
+
49
+
50
+ //# sourceMappingURL=useOverlayTriggerState.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAuBM,SAAS,0CAAuB,KAA0B;IAC/D,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAA,GAAA,2CAAiB,EAAE,MAAM,MAAM,EAAE,MAAM,WAAW,IAAI,OAAO,MAAM,YAAY;IAEvG,MAAM,OAAO,CAAA,GAAA,wBAAU,EAAE;QACvB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,QAAQ,CAAA,GAAA,wBAAU,EAAE;QACxB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,SAAS,CAAA,GAAA,wBAAU,EAAE;QACzB,QAAQ,CAAC;IACX,GAAG;QAAC;QAAS;KAAO;IAEpB,OAAO;gBACL;iBACA;cACA;eACA;gBACA;IACF;AACF","sources":["packages/@react-stately/overlays/src/useOverlayTriggerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {OverlayTriggerProps} from '@react-types/overlays';\nimport {useCallback} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface OverlayTriggerState {\n /** Whether the overlay is currently open. */\n readonly isOpen: boolean,\n /** Sets whether the overlay is open. */\n setOpen(isOpen: boolean): void,\n /** Opens the overlay. */\n open(): void,\n /** Closes the overlay. */\n close(): void,\n /** Toggles the overlay's visibility. */\n toggle(): void\n}\n\n/**\n * Manages state for an overlay trigger. Tracks whether the overlay is open, and provides\n * methods to toggle this state.\n */\nexport function useOverlayTriggerState(props: OverlayTriggerProps): OverlayTriggerState {\n let [isOpen, setOpen] = useControlledState(props.isOpen, props.defaultOpen || false, props.onOpenChange);\n\n const open = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [setOpen, isOpen]);\n\n return {\n isOpen,\n setOpen,\n open,\n close,\n toggle\n };\n}\n"],"names":[],"version":3,"file":"useOverlayTriggerState.main.js.map"}
@@ -0,0 +1,45 @@
1
+ import {useCallback as $hnMvi$useCallback} from "react";
2
+ import {useControlledState as $hnMvi$useControlledState} from "@react-stately/utils";
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
+ function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
17
+ let [isOpen, setOpen] = (0, $hnMvi$useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
18
+ const open = (0, $hnMvi$useCallback)(()=>{
19
+ setOpen(true);
20
+ }, [
21
+ setOpen
22
+ ]);
23
+ const close = (0, $hnMvi$useCallback)(()=>{
24
+ setOpen(false);
25
+ }, [
26
+ setOpen
27
+ ]);
28
+ const toggle = (0, $hnMvi$useCallback)(()=>{
29
+ setOpen(!isOpen);
30
+ }, [
31
+ setOpen,
32
+ isOpen
33
+ ]);
34
+ return {
35
+ isOpen: isOpen,
36
+ setOpen: setOpen,
37
+ open: open,
38
+ close: close,
39
+ toggle: toggle
40
+ };
41
+ }
42
+
43
+
44
+ export {$fc909762b330b746$export$61c6a8c84e605fb6 as useOverlayTriggerState};
45
+ //# sourceMappingURL=useOverlayTriggerState.mjs.map
@@ -0,0 +1,45 @@
1
+ import {useCallback as $hnMvi$useCallback} from "react";
2
+ import {useControlledState as $hnMvi$useControlledState} from "@react-stately/utils";
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
+ function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
17
+ let [isOpen, setOpen] = (0, $hnMvi$useControlledState)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
18
+ const open = (0, $hnMvi$useCallback)(()=>{
19
+ setOpen(true);
20
+ }, [
21
+ setOpen
22
+ ]);
23
+ const close = (0, $hnMvi$useCallback)(()=>{
24
+ setOpen(false);
25
+ }, [
26
+ setOpen
27
+ ]);
28
+ const toggle = (0, $hnMvi$useCallback)(()=>{
29
+ setOpen(!isOpen);
30
+ }, [
31
+ setOpen,
32
+ isOpen
33
+ ]);
34
+ return {
35
+ isOpen: isOpen,
36
+ setOpen: setOpen,
37
+ open: open,
38
+ close: close,
39
+ toggle: toggle
40
+ };
41
+ }
42
+
43
+
44
+ export {$fc909762b330b746$export$61c6a8c84e605fb6 as useOverlayTriggerState};
45
+ //# sourceMappingURL=useOverlayTriggerState.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAuBM,SAAS,0CAAuB,KAA0B;IAC/D,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,MAAM,EAAE,MAAM,WAAW,IAAI,OAAO,MAAM,YAAY;IAEvG,MAAM,OAAO,CAAA,GAAA,kBAAU,EAAE;QACvB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,QAAQ,CAAA,GAAA,kBAAU,EAAE;QACxB,QAAQ;IACV,GAAG;QAAC;KAAQ;IAEZ,MAAM,SAAS,CAAA,GAAA,kBAAU,EAAE;QACzB,QAAQ,CAAC;IACX,GAAG;QAAC;QAAS;KAAO;IAEpB,OAAO;gBACL;iBACA;cACA;eACA;gBACA;IACF;AACF","sources":["packages/@react-stately/overlays/src/useOverlayTriggerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {OverlayTriggerProps} from '@react-types/overlays';\nimport {useCallback} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface OverlayTriggerState {\n /** Whether the overlay is currently open. */\n readonly isOpen: boolean,\n /** Sets whether the overlay is open. */\n setOpen(isOpen: boolean): void,\n /** Opens the overlay. */\n open(): void,\n /** Closes the overlay. */\n close(): void,\n /** Toggles the overlay's visibility. */\n toggle(): void\n}\n\n/**\n * Manages state for an overlay trigger. Tracks whether the overlay is open, and provides\n * methods to toggle this state.\n */\nexport function useOverlayTriggerState(props: OverlayTriggerProps): OverlayTriggerState {\n let [isOpen, setOpen] = useControlledState(props.isOpen, props.defaultOpen || false, props.onOpenChange);\n\n const open = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [setOpen, isOpen]);\n\n return {\n isOpen,\n setOpen,\n open,\n close,\n toggle\n };\n}\n"],"names":[],"version":3,"file":"useOverlayTriggerState.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/overlays",
3
- "version": "3.6.6-nightly.4555+81162ea39",
3
+ "version": "3.6.6-nightly.4558+c5e4b3701",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,8 +22,8 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-stately/utils": "3.0.0-nightly.2843+81162ea39",
26
- "@react-types/overlays": "3.8.6-nightly.4555+81162ea39",
25
+ "@react-stately/utils": "3.0.0-nightly.2846+c5e4b3701",
26
+ "@react-types/overlays": "3.8.6-nightly.4558+c5e4b3701",
27
27
  "@swc/helpers": "^0.5.0"
28
28
  },
29
29
  "peerDependencies": {
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "81162ea392926d06ec3d25c228e6f9b6b5479d59"
35
+ "gitHead": "c5e4b3701fdb89eb551f1b3697ac253f06ef68fa"
36
36
  }