@react-aria/switch 3.1.1 → 3.1.5

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/main.js CHANGED
@@ -1,35 +1,43 @@
1
- var {
2
- useToggle
3
- } = require("@react-aria/toggle");
1
+ var $lu29G$reactariatoggle = require("@react-aria/toggle");
4
2
 
5
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
3
+ function $parcel$exportWildcard(dest, source) {
4
+ Object.keys(source).forEach(function(key) {
5
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
6
+ return;
7
+ }
6
8
 
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
+ Object.defineProperty(dest, key, {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return source[key];
13
+ }
14
+ });
15
+ });
16
+
17
+ return dest;
18
+ }
19
+ function $parcel$export(e, n, v, s) {
20
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
21
  }
22
+ var $cf111c4345e32a06$exports = {};
23
+
24
+ $parcel$export($cf111c4345e32a06$exports, "useSwitch", () => $cf111c4345e32a06$export$d853f7095ae95f88);
10
25
 
11
- /**
12
- * Provides the behavior and accessibility implementation for a switch component.
13
- * A switch is similar to a checkbox, but represents on/off values as opposed to selection.
14
- * @param props - Props for the switch.
15
- * @param state - State for the switch, as returned by `useToggleState`.
16
- * @param ref - Ref to the HTML input element.
17
- */
18
- function useSwitch(props, state, ref) {
19
- let {
20
- inputProps
21
- } = useToggle(props, state, ref);
22
- let {
23
- isSelected
24
- } = state;
25
- return {
26
- inputProps: _babelRuntimeHelpersExtends({}, inputProps, {
27
- role: 'switch',
28
- checked: isSelected,
29
- 'aria-checked': isSelected
30
- })
31
- };
26
+ function $cf111c4345e32a06$export$d853f7095ae95f88(props, state, ref) {
27
+ let { inputProps: inputProps } = $lu29G$reactariatoggle.useToggle(props, state, ref);
28
+ let { isSelected: isSelected } = state;
29
+ return {
30
+ inputProps: {
31
+ ...inputProps,
32
+ role: 'switch',
33
+ checked: isSelected,
34
+ 'aria-checked': isSelected
35
+ }
36
+ };
32
37
  }
33
38
 
34
- exports.useSwitch = useSwitch;
39
+
40
+ $parcel$exportWildcard(module.exports, $cf111c4345e32a06$exports);
41
+
42
+
35
43
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACoBD;;;;;;;AAOO,SAASG,SAAT,CAAmBC,KAAnB,EAA2CC,KAA3C,EAA+DC,GAA/D,EAA6G;AAClH,MAAI;AAACC,IAAAA;AAAD,MAAeC,SAAS,CAACJ,KAAD,EAAQC,KAAR,EAAeC,GAAf,CAA5B;AACA,MAAI;AAACG,IAAAA;AAAD,MAAeJ,KAAnB;AAEA,SAAO;AACLE,IAAAA,UAAU,kCACLA,UADK;AAERG,MAAAA,IAAI,EAAE,QAFE;AAGRC,MAAAA,OAAO,EAAEF,UAHD;AAIR,sBAAgBA;AAJR;AADL,GAAP;AAQD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/switch/src/useSwitch.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\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 {inputProps} = useToggle(props, state, ref);\n let {isSelected} = state;\n\n return {\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected,\n 'aria-checked': isSelected\n }\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","useSwitch","props","state","ref","inputProps","useToggle","isSelected","role","checked"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;SC6BgB,yCAAS,CAAC,KAAsB,EAAE,KAAkB,EAAE,GAAgC,EAAc,CAAC;IACnH,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,gCAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG;IAC9C,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,KAAK;IAExB,MAAM,CAAC,CAAC;QACN,UAAU,EAAE,CAAC;eACR,UAAU;YACb,IAAI,EAAE,CAAQ;YACd,OAAO,EAAE,UAAU;YACnB,CAAc,eAAE,UAAU;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","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 */\n\nexport * 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, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\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 {inputProps} = useToggle(props, state, ref);\n let {isSelected} = state;\n\n return {\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected,\n 'aria-checked': isSelected\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,26 +1,27 @@
1
- import { useToggle } from "@react-aria/toggle";
2
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
1
+ import {useToggle as $eHRm8$useToggle} from "@react-aria/toggle";
3
2
 
4
- /**
5
- * Provides the behavior and accessibility implementation for a switch component.
6
- * A switch is similar to a checkbox, but represents on/off values as opposed to selection.
7
- * @param props - Props for the switch.
8
- * @param state - State for the switch, as returned by `useToggleState`.
9
- * @param ref - Ref to the HTML input element.
10
- */
11
- export function useSwitch(props, state, ref) {
12
- let {
13
- inputProps
14
- } = useToggle(props, state, ref);
15
- let {
16
- isSelected
17
- } = state;
18
- return {
19
- inputProps: _babelRuntimeHelpersEsmExtends({}, inputProps, {
20
- role: 'switch',
21
- checked: isSelected,
22
- 'aria-checked': isSelected
23
- })
24
- };
3
+ function $parcel$export(e, n, v, s) {
4
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
25
5
  }
6
+ var $122358c88747068d$exports = {};
7
+
8
+ $parcel$export($122358c88747068d$exports, "useSwitch", () => $122358c88747068d$export$d853f7095ae95f88);
9
+
10
+ function $122358c88747068d$export$d853f7095ae95f88(props, state, ref) {
11
+ let { inputProps: inputProps } = $eHRm8$useToggle(props, state, ref);
12
+ let { isSelected: isSelected } = state;
13
+ return {
14
+ inputProps: {
15
+ ...inputProps,
16
+ role: 'switch',
17
+ checked: isSelected,
18
+ 'aria-checked': isSelected
19
+ }
20
+ };
21
+ }
22
+
23
+
24
+
25
+
26
+ export {$122358c88747068d$export$d853f7095ae95f88 as useSwitch};
26
27
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAsBA;;;;;;;OAOO,SAASA,SAAT,CAAmBC,KAAnB,EAA2CC,KAA3C,EAA+DC,GAA/D,EAA6G;AAClH,MAAI;AAACC,IAAAA;AAAD,MAAeC,SAAS,CAACJ,KAAD,EAAQC,KAAR,EAAeC,GAAf,CAA5B;AACA,MAAI;AAACG,IAAAA;AAAD,MAAeJ,KAAnB;AAEA,SAAO;AACLE,IAAAA,UAAU,qCACLA,UADK;AAERG,MAAAA,IAAI,EAAE,QAFE;AAGRC,MAAAA,OAAO,EAAEF,UAHD;AAIR,sBAAgBA;AAJR;AADL,GAAP;AAQD","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, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\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 {inputProps} = useToggle(props, state, ref);\n let {isSelected} = state;\n\n return {\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected,\n 'aria-checked': isSelected\n }\n };\n}\n"],"names":["useSwitch","props","state","ref","inputProps","useToggle","isSelected","role","checked"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;SC6BgB,yCAAS,CAAC,KAAsB,EAAE,KAAkB,EAAE,GAAgC,EAAc,CAAC;IACnH,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,gBAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG;IAC9C,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,KAAK;IAExB,MAAM,CAAC,CAAC;QACN,UAAU,EAAE,CAAC;eACR,UAAU;YACb,IAAI,EAAE,CAAQ;YACd,OAAO,EAAE,UAAU;YACnB,CAAc,eAAE,UAAU;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","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 */\n\nexport * 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, RefObject} from 'react';\nimport {ToggleState} from '@react-stately/toggle';\nimport {useToggle} from '@react-aria/toggle';\n\nexport interface SwitchAria {\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>\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 {inputProps} = useToggle(props, state, ref);\n let {isSelected} = state;\n\n return {\n inputProps: {\n ...inputProps,\n role: 'switch',\n checked: isSelected,\n 'aria-checked': isSelected\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":"A;A;A;AAiBA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAA;CAClD;AAED;A;A;A;A;A;GAMG;AACH,0BAA0B,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,UAAU,CAYlH","sources":["./packages/@react-aria/switch/src/packages/@react-aria/switch/src/useSwitch.ts","./packages/@react-aria/switch/src/packages/@react-aria/switch/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AAiBA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAA;CAClD;AAED;;;;;;GAMG;AACH,0BAA0B,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,UAAU,CAYlH","sources":["packages/@react-aria/switch/src/packages/@react-aria/switch/src/useSwitch.ts","packages/@react-aria/switch/src/packages/@react-aria/switch/src/index.ts","packages/@react-aria/switch/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useSwitch';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/switch",
3
- "version": "3.1.1",
3
+ "version": "3.1.5",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/toggle": "^3.1.1",
22
- "@react-stately/toggle": "^3.2.1",
23
- "@react-types/switch": "^3.1.1"
21
+ "@react-aria/toggle": "^3.2.1",
22
+ "@react-stately/toggle": "^3.2.5",
23
+ "@react-types/switch": "^3.1.4"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -28,5 +28,5 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "0778f71a3c13e1e24388a23b6d525e3b9f5b98f1"
31
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
32
32
  }