@react-aria/switch 3.6.1 → 3.6.3

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,16 +1,6 @@
1
- import {useToggle as $7KNc0$useToggle} from "@react-aria/toggle";
1
+ import {useSwitch as $b418ec0c85c52f27$export$d853f7095ae95f88} from "./useSwitch.mjs";
2
2
 
3
3
  /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */ /*
14
4
  * Copyright 2020 Adobe. All rights reserved.
15
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
6
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -21,23 +11,6 @@ import {useToggle as $7KNc0$useToggle} from "@react-aria/toggle";
21
11
  * OF ANY KIND, either express or implied. See the License for the specific language
22
12
  * governing permissions and limitations under the License.
23
13
  */
24
- function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
25
- let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $7KNc0$useToggle)(props, state, ref);
26
- return {
27
- labelProps: labelProps,
28
- inputProps: {
29
- ...inputProps,
30
- role: "switch",
31
- checked: isSelected
32
- },
33
- isSelected: isSelected,
34
- isPressed: isPressed,
35
- isDisabled: isDisabled,
36
- isReadOnly: isReadOnly
37
- };
38
- }
39
-
40
-
41
14
 
42
15
 
43
16
  export {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};
package/dist/main.js CHANGED
@@ -1,22 +1,12 @@
1
- var $3VG2V$reactariatoggle = require("@react-aria/toggle");
1
+ var $e64bc6eb3aa7bd8d$exports = require("./useSwitch.main.js");
2
2
 
3
3
 
4
4
  function $parcel$export(e, n, v, s) {
5
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
6
  }
7
7
 
8
- $parcel$export(module.exports, "useSwitch", () => $e64bc6eb3aa7bd8d$export$d853f7095ae95f88);
8
+ $parcel$export(module.exports, "useSwitch", () => $e64bc6eb3aa7bd8d$exports.useSwitch);
9
9
  /*
10
- * Copyright 2020 Adobe. All rights reserved.
11
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License. You may obtain a copy
13
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software distributed under
16
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
- * OF ANY KIND, either express or implied. See the License for the specific language
18
- * governing permissions and limitations under the License.
19
- */ /*
20
10
  * Copyright 2020 Adobe. All rights reserved.
21
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
12
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -27,23 +17,6 @@ $parcel$export(module.exports, "useSwitch", () => $e64bc6eb3aa7bd8d$export$d853f
27
17
  * OF ANY KIND, either express or implied. See the License for the specific language
28
18
  * governing permissions and limitations under the License.
29
19
  */
30
- function $e64bc6eb3aa7bd8d$export$d853f7095ae95f88(props, state, ref) {
31
- let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $3VG2V$reactariatoggle.useToggle)(props, state, ref);
32
- return {
33
- labelProps: labelProps,
34
- inputProps: {
35
- ...inputProps,
36
- role: "switch",
37
- checked: isSelected
38
- },
39
- isSelected: isSelected,
40
- isPressed: isPressed,
41
- isDisabled: isDisabled,
42
- isReadOnly: isReadOnly
43
- };
44
- }
45
-
46
-
47
20
 
48
21
 
49
22
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;AA6BM,SAAS,0CAAU,KAAsB,EAAE,KAAkB,EAAE,GAAgC;IACpG,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAEtG,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,SAAS;QACX;oBACA;mBACA;oBACA;oBACA;IACF;AACF;;CD5CC","sources":["packages/@react-aria/switch/src/index.ts","packages/@react-aria/switch/src/useSwitch.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 */\nexport {useSwitch} from './useSwitch';\n\nexport type {AriaSwitchProps} from '@react-types/switch';\nexport type {SwitchAria} from './useSwitch';\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 {AriaSwitchProps} from '@react-types/switch';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the label wrapper element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Whether the switch is selected. */\n isSelected: boolean,\n /** Whether the switch is in a pressed state. */\n isPressed: boolean,\n /** Whether the switch is disabled. */\n isDisabled: boolean,\n /** Whether the switch is read only. */\n isReadOnly: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n * @param props - Props for the switch.\n * @param state - State for the switch, as returned by `useToggleState`.\n * @param ref - Ref to the HTML input element.\n */\nexport function useSwitch(props: AriaSwitchProps, state: ToggleState, ref: RefObject<HTMLInputElement>): SwitchAria {\n let {labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly} = useToggle(props, state, ref);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected\n },\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/switch/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 */\nexport {useSwitch} from './useSwitch';\n\nexport type {AriaSwitchProps} from '@react-types/switch';\nexport type {SwitchAria} from './useSwitch';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,16 +1,6 @@
1
- import {useToggle as $7KNc0$useToggle} from "@react-aria/toggle";
1
+ import {useSwitch as $b418ec0c85c52f27$export$d853f7095ae95f88} from "./useSwitch.module.js";
2
2
 
3
3
  /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */ /*
14
4
  * Copyright 2020 Adobe. All rights reserved.
15
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
6
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -21,23 +11,6 @@ import {useToggle as $7KNc0$useToggle} from "@react-aria/toggle";
21
11
  * OF ANY KIND, either express or implied. See the License for the specific language
22
12
  * governing permissions and limitations under the License.
23
13
  */
24
- function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
25
- let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $7KNc0$useToggle)(props, state, ref);
26
- return {
27
- labelProps: labelProps,
28
- inputProps: {
29
- ...inputProps,
30
- role: "switch",
31
- checked: isSelected
32
- },
33
- isSelected: isSelected,
34
- isPressed: isPressed,
35
- isDisabled: isDisabled,
36
- isReadOnly: isReadOnly
37
- };
38
- }
39
-
40
-
41
14
 
42
15
 
43
16
  export {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;AA6BM,SAAS,0CAAU,KAAsB,EAAE,KAAkB,EAAE,GAAgC;IACpG,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,OAAO,OAAO;IAEtG,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,SAAS;QACX;oBACA;mBACA;oBACA;oBACA;IACF;AACF;;CD5CC","sources":["packages/@react-aria/switch/src/index.ts","packages/@react-aria/switch/src/useSwitch.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 */\nexport {useSwitch} from './useSwitch';\n\nexport type {AriaSwitchProps} from '@react-types/switch';\nexport type {SwitchAria} from './useSwitch';\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 {AriaSwitchProps} from '@react-types/switch';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the label wrapper element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Whether the switch is selected. */\n isSelected: boolean,\n /** Whether the switch is in a pressed state. */\n isPressed: boolean,\n /** Whether the switch is disabled. */\n isDisabled: boolean,\n /** Whether the switch is read only. */\n isReadOnly: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n * @param props - Props for the switch.\n * @param state - State for the switch, as returned by `useToggleState`.\n * @param ref - Ref to the HTML input element.\n */\nexport function useSwitch(props: AriaSwitchProps, state: ToggleState, ref: RefObject<HTMLInputElement>): SwitchAria {\n let {labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly} = useToggle(props, state, ref);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected\n },\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/switch/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 */\nexport {useSwitch} from './useSwitch';\n\nexport type {AriaSwitchProps} from '@react-types/switch';\nexport type {SwitchAria} from './useSwitch';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,37 @@
1
+ var $eAK08$reactariatoggle = require("@react-aria/toggle");
2
+
3
+
4
+ function $parcel$export(e, n, v, s) {
5
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
+ }
7
+
8
+ $parcel$export(module.exports, "useSwitch", () => $e64bc6eb3aa7bd8d$export$d853f7095ae95f88);
9
+ /*
10
+ * Copyright 2020 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+ function $e64bc6eb3aa7bd8d$export$d853f7095ae95f88(props, state, ref) {
21
+ let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $eAK08$reactariatoggle.useToggle)(props, state, ref);
22
+ return {
23
+ labelProps: labelProps,
24
+ inputProps: {
25
+ ...inputProps,
26
+ role: "switch",
27
+ checked: isSelected
28
+ },
29
+ isSelected: isSelected,
30
+ isPressed: isPressed,
31
+ isDisabled: isDisabled,
32
+ isReadOnly: isReadOnly
33
+ };
34
+ }
35
+
36
+
37
+ //# sourceMappingURL=useSwitch.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,0CAAU,KAAsB,EAAE,KAAkB,EAAE,GAAgC;IACpG,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAEtG,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,SAAS;QACX;oBACA;mBACA;oBACA;oBACA;IACF;AACF","sources":["packages/@react-aria/switch/src/useSwitch.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 {AriaSwitchProps} from '@react-types/switch';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the label wrapper element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Whether the switch is selected. */\n isSelected: boolean,\n /** Whether the switch is in a pressed state. */\n isPressed: boolean,\n /** Whether the switch is disabled. */\n isDisabled: boolean,\n /** Whether the switch is read only. */\n isReadOnly: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n * @param props - Props for the switch.\n * @param state - State for the switch, as returned by `useToggleState`.\n * @param ref - Ref to the HTML input element.\n */\nexport function useSwitch(props: AriaSwitchProps, state: ToggleState, ref: RefObject<HTMLInputElement>): SwitchAria {\n let {labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly} = useToggle(props, state, ref);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected\n },\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly\n };\n}\n"],"names":[],"version":3,"file":"useSwitch.main.js.map"}
@@ -0,0 +1,32 @@
1
+ import {useToggle as $ifSyJ$useToggle} from "@react-aria/toggle";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
15
+ let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $ifSyJ$useToggle)(props, state, ref);
16
+ return {
17
+ labelProps: labelProps,
18
+ inputProps: {
19
+ ...inputProps,
20
+ role: "switch",
21
+ checked: isSelected
22
+ },
23
+ isSelected: isSelected,
24
+ isPressed: isPressed,
25
+ isDisabled: isDisabled,
26
+ isReadOnly: isReadOnly
27
+ };
28
+ }
29
+
30
+
31
+ export {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};
32
+ //# sourceMappingURL=useSwitch.mjs.map
@@ -0,0 +1,32 @@
1
+ import {useToggle as $ifSyJ$useToggle} from "@react-aria/toggle";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
15
+ let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled, isReadOnly: isReadOnly } = (0, $ifSyJ$useToggle)(props, state, ref);
16
+ return {
17
+ labelProps: labelProps,
18
+ inputProps: {
19
+ ...inputProps,
20
+ role: "switch",
21
+ checked: isSelected
22
+ },
23
+ isSelected: isSelected,
24
+ isPressed: isPressed,
25
+ isDisabled: isDisabled,
26
+ isReadOnly: isReadOnly
27
+ };
28
+ }
29
+
30
+
31
+ export {$b418ec0c85c52f27$export$d853f7095ae95f88 as useSwitch};
32
+ //# sourceMappingURL=useSwitch.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,0CAAU,KAAsB,EAAE,KAAkB,EAAE,GAAgC;IACpG,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,OAAO,OAAO;IAEtG,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,MAAM;YACN,SAAS;QACX;oBACA;mBACA;oBACA;oBACA;IACF;AACF","sources":["packages/@react-aria/switch/src/useSwitch.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 {AriaSwitchProps} from '@react-types/switch';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the label wrapper element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Whether the switch is selected. */\n isSelected: boolean,\n /** Whether the switch is in a pressed state. */\n isPressed: boolean,\n /** Whether the switch is disabled. */\n isDisabled: boolean,\n /** Whether the switch is read only. */\n isReadOnly: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n * @param props - Props for the switch.\n * @param state - State for the switch, as returned by `useToggleState`.\n * @param ref - Ref to the HTML input element.\n */\nexport function useSwitch(props: AriaSwitchProps, state: ToggleState, ref: RefObject<HTMLInputElement>): SwitchAria {\n let {labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly} = useToggle(props, state, ref);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected\n },\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly\n };\n}\n"],"names":[],"version":3,"file":"useSwitch.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/switch",
3
- "version": "3.6.1",
3
+ "version": "3.6.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,9 +22,9 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/toggle": "^3.10.1",
26
- "@react-stately/toggle": "^3.7.1",
27
- "@react-types/switch": "^3.5.0",
25
+ "@react-aria/toggle": "^3.10.3",
26
+ "@react-stately/toggle": "^3.7.3",
27
+ "@react-types/switch": "^3.5.2",
28
28
  "@swc/helpers": "^0.5.0"
29
29
  },
30
30
  "peerDependencies": {
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "f040ff62678e6a31375b96c05396df0bae660350"
36
+ "gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
37
37
  }