@react-spectrum/switch 3.5.3 → 3.5.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.
@@ -0,0 +1,78 @@
1
+ require("./vars.f7257b6a.css");
2
+ var $faeb9d1b92049ba7$exports = require("./toggle_vars_css.main.js");
3
+ var $3aWe4$reactspectrumutils = require("@react-spectrum/utils");
4
+ var $3aWe4$reactariafocus = require("@react-aria/focus");
5
+ var $3aWe4$react = require("react");
6
+ var $3aWe4$reactariainteractions = require("@react-aria/interactions");
7
+ var $3aWe4$reactspectrumprovider = require("@react-spectrum/provider");
8
+ var $3aWe4$reactariaswitch = require("@react-aria/switch");
9
+ var $3aWe4$reactstatelytoggle = require("@react-stately/toggle");
10
+
11
+
12
+ function $parcel$interopDefault(a) {
13
+ return a && a.__esModule ? a.default : a;
14
+ }
15
+
16
+ function $parcel$export(e, n, v, s) {
17
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
18
+ }
19
+
20
+ $parcel$export(module.exports, "Switch", () => $e216104aee091306$export$b5d5cf8927ab7262);
21
+ /*
22
+ * Copyright 2020 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ function $e216104aee091306$var$Switch(props, ref) {
40
+ props = (0, $3aWe4$reactspectrumprovider.useProviderProps)(props);
41
+ let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
42
+ let { styleProps: styleProps } = (0, $3aWe4$reactspectrumutils.useStyleProps)(otherProps);
43
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3aWe4$reactariainteractions.useHover)({
44
+ isDisabled: isDisabled
45
+ });
46
+ let inputRef = (0, $3aWe4$react.useRef)(null);
47
+ let domRef = (0, $3aWe4$reactspectrumutils.useFocusableRef)(ref, inputRef);
48
+ let state = (0, $3aWe4$reactstatelytoggle.useToggleState)(props);
49
+ let { inputProps: inputProps } = (0, $3aWe4$reactariaswitch.useSwitch)(props, state, inputRef);
50
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($3aWe4$react))).createElement("label", {
51
+ ...styleProps,
52
+ ...hoverProps,
53
+ ref: domRef,
54
+ className: (0, $3aWe4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($faeb9d1b92049ba7$exports))), 'spectrum-ToggleSwitch', {
55
+ 'spectrum-ToggleSwitch--quiet': !isEmphasized,
56
+ 'is-disabled': isDisabled,
57
+ 'is-hovered': isHovered
58
+ }, styleProps.className)
59
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($3aWe4$react))).createElement((0, $3aWe4$reactariafocus.FocusRing), {
60
+ focusRingClass: (0, $3aWe4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($faeb9d1b92049ba7$exports))), 'focus-ring'),
61
+ autoFocus: autoFocus
62
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($3aWe4$react))).createElement("input", {
63
+ ...inputProps,
64
+ ref: inputRef,
65
+ className: (0, $3aWe4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($faeb9d1b92049ba7$exports))), 'spectrum-ToggleSwitch-input')
66
+ })), /*#__PURE__*/ (0, ($parcel$interopDefault($3aWe4$react))).createElement("span", {
67
+ className: (0, $3aWe4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($faeb9d1b92049ba7$exports))), 'spectrum-ToggleSwitch-switch')
68
+ }), children && /*#__PURE__*/ (0, ($parcel$interopDefault($3aWe4$react))).createElement("span", {
69
+ className: (0, $3aWe4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($faeb9d1b92049ba7$exports))), 'spectrum-ToggleSwitch-label')
70
+ }, children));
71
+ }
72
+ /**
73
+ * Switches allow users to turn an individual option on or off.
74
+ * They are usually used to activate or deactivate a specific setting.
75
+ */ const $e216104aee091306$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $3aWe4$react.forwardRef)($e216104aee091306$var$Switch);
76
+
77
+
78
+ //# sourceMappingURL=Switch.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaD,SAAS,6BAAO,KAA0B,EAAE,GAAmC;IAC7E,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,gBACF,eAAe,mBACf,aAAa,kBACb,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,QAAQ,CAAA,GAAA,wCAAa,EAAE;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAG3C,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,yBACA;YACE,gCAAgC,CAAC;YACjC,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAAe,WAAW;qBACtE,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;uBAElC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACnC,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAU,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/switch/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumSwitchProps} from '@react-types/switch';\nimport styles from '@adobe/spectrum-css-temp/components/toggle/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSwitch} from '@react-aria/switch';\nimport {useToggleState} from '@react-stately/toggle';\n\nfunction Switch(props: SpectrumSwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n props = useProviderProps(props);\n let {\n isEmphasized = false,\n isDisabled = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let state = useToggleState(props);\n let {inputProps} = useSwitch(props, state, inputRef);\n\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ToggleSwitch',\n {\n 'spectrum-ToggleSwitch--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-ToggleSwitch-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-ToggleSwitch-switch')} />\n {children && (\n <span className={classNames(styles, 'spectrum-ToggleSwitch-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nconst _Switch = forwardRef(Switch);\nexport {_Switch as Switch};\n"],"names":[],"version":3,"file":"Switch.main.js.map"}
@@ -0,0 +1,73 @@
1
+ import "./vars.f7257b6a.css";
2
+ import $cEq2J$toggle_vars_cssmodulejs from "./toggle_vars_css.mjs";
3
+ import {useStyleProps as $cEq2J$useStyleProps, useFocusableRef as $cEq2J$useFocusableRef, classNames as $cEq2J$classNames} from "@react-spectrum/utils";
4
+ import {FocusRing as $cEq2J$FocusRing} from "@react-aria/focus";
5
+ import $cEq2J$react, {useRef as $cEq2J$useRef, forwardRef as $cEq2J$forwardRef} from "react";
6
+ import {useHover as $cEq2J$useHover} from "@react-aria/interactions";
7
+ import {useProviderProps as $cEq2J$useProviderProps} from "@react-spectrum/provider";
8
+ import {useSwitch as $cEq2J$useSwitch} from "@react-aria/switch";
9
+ import {useToggleState as $cEq2J$useToggleState} from "@react-stately/toggle";
10
+
11
+
12
+ function $parcel$interopDefault(a) {
13
+ return a && a.__esModule ? a.default : a;
14
+ }
15
+ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ function $8341c396cee1c5fc$var$Switch(props, ref) {
34
+ props = (0, $cEq2J$useProviderProps)(props);
35
+ let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
36
+ let { styleProps: styleProps } = (0, $cEq2J$useStyleProps)(otherProps);
37
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $cEq2J$useHover)({
38
+ isDisabled: isDisabled
39
+ });
40
+ let inputRef = (0, $cEq2J$useRef)(null);
41
+ let domRef = (0, $cEq2J$useFocusableRef)(ref, inputRef);
42
+ let state = (0, $cEq2J$useToggleState)(props);
43
+ let { inputProps: inputProps } = (0, $cEq2J$useSwitch)(props, state, inputRef);
44
+ return /*#__PURE__*/ (0, $cEq2J$react).createElement("label", {
45
+ ...styleProps,
46
+ ...hoverProps,
47
+ ref: domRef,
48
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch', {
49
+ 'spectrum-ToggleSwitch--quiet': !isEmphasized,
50
+ 'is-disabled': isDisabled,
51
+ 'is-hovered': isHovered
52
+ }, styleProps.className)
53
+ }, /*#__PURE__*/ (0, $cEq2J$react).createElement((0, $cEq2J$FocusRing), {
54
+ focusRingClass: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'focus-ring'),
55
+ autoFocus: autoFocus
56
+ }, /*#__PURE__*/ (0, $cEq2J$react).createElement("input", {
57
+ ...inputProps,
58
+ ref: inputRef,
59
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-input')
60
+ })), /*#__PURE__*/ (0, $cEq2J$react).createElement("span", {
61
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-switch')
62
+ }), children && /*#__PURE__*/ (0, $cEq2J$react).createElement("span", {
63
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-label')
64
+ }, children));
65
+ }
66
+ /**
67
+ * Switches allow users to turn an individual option on or off.
68
+ * They are usually used to activate or deactivate a specific setting.
69
+ */ const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $cEq2J$forwardRef)($8341c396cee1c5fc$var$Switch);
70
+
71
+
72
+ export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
73
+ //# sourceMappingURL=Switch.module.js.map
@@ -0,0 +1,73 @@
1
+ import "./vars.f7257b6a.css";
2
+ import $cEq2J$toggle_vars_cssmodulejs from "./toggle_vars_css.module.js";
3
+ import {useStyleProps as $cEq2J$useStyleProps, useFocusableRef as $cEq2J$useFocusableRef, classNames as $cEq2J$classNames} from "@react-spectrum/utils";
4
+ import {FocusRing as $cEq2J$FocusRing} from "@react-aria/focus";
5
+ import $cEq2J$react, {useRef as $cEq2J$useRef, forwardRef as $cEq2J$forwardRef} from "react";
6
+ import {useHover as $cEq2J$useHover} from "@react-aria/interactions";
7
+ import {useProviderProps as $cEq2J$useProviderProps} from "@react-spectrum/provider";
8
+ import {useSwitch as $cEq2J$useSwitch} from "@react-aria/switch";
9
+ import {useToggleState as $cEq2J$useToggleState} from "@react-stately/toggle";
10
+
11
+
12
+ function $parcel$interopDefault(a) {
13
+ return a && a.__esModule ? a.default : a;
14
+ }
15
+ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ function $8341c396cee1c5fc$var$Switch(props, ref) {
34
+ props = (0, $cEq2J$useProviderProps)(props);
35
+ let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
36
+ let { styleProps: styleProps } = (0, $cEq2J$useStyleProps)(otherProps);
37
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $cEq2J$useHover)({
38
+ isDisabled: isDisabled
39
+ });
40
+ let inputRef = (0, $cEq2J$useRef)(null);
41
+ let domRef = (0, $cEq2J$useFocusableRef)(ref, inputRef);
42
+ let state = (0, $cEq2J$useToggleState)(props);
43
+ let { inputProps: inputProps } = (0, $cEq2J$useSwitch)(props, state, inputRef);
44
+ return /*#__PURE__*/ (0, $cEq2J$react).createElement("label", {
45
+ ...styleProps,
46
+ ...hoverProps,
47
+ ref: domRef,
48
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch', {
49
+ 'spectrum-ToggleSwitch--quiet': !isEmphasized,
50
+ 'is-disabled': isDisabled,
51
+ 'is-hovered': isHovered
52
+ }, styleProps.className)
53
+ }, /*#__PURE__*/ (0, $cEq2J$react).createElement((0, $cEq2J$FocusRing), {
54
+ focusRingClass: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'focus-ring'),
55
+ autoFocus: autoFocus
56
+ }, /*#__PURE__*/ (0, $cEq2J$react).createElement("input", {
57
+ ...inputProps,
58
+ ref: inputRef,
59
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-input')
60
+ })), /*#__PURE__*/ (0, $cEq2J$react).createElement("span", {
61
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-switch')
62
+ }), children && /*#__PURE__*/ (0, $cEq2J$react).createElement("span", {
63
+ className: (0, $cEq2J$classNames)((0, ($parcel$interopDefault($cEq2J$toggle_vars_cssmodulejs))), 'spectrum-ToggleSwitch-label')
64
+ }, children));
65
+ }
66
+ /**
67
+ * Switches allow users to turn an individual option on or off.
68
+ * They are usually used to activate or deactivate a specific setting.
69
+ */ const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $cEq2J$forwardRef)($8341c396cee1c5fc$var$Switch);
70
+
71
+
72
+ export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
73
+ //# sourceMappingURL=Switch.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaD,SAAS,6BAAO,KAA0B,EAAE,GAAmC;IAC7E,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,gBACF,eAAe,mBACf,aAAa,kBACb,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAClC,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,OAAO,OAAO;IAG3C,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,yBACA;YACE,gCAAgC,CAAC;YACjC,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;uBAElC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QACnC,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAU,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/switch/src/Switch.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumSwitchProps} from '@react-types/switch';\nimport styles from '@adobe/spectrum-css-temp/components/toggle/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSwitch} from '@react-aria/switch';\nimport {useToggleState} from '@react-stately/toggle';\n\nfunction Switch(props: SpectrumSwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n props = useProviderProps(props);\n let {\n isEmphasized = false,\n isDisabled = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let state = useToggleState(props);\n let {inputProps} = useSwitch(props, state, inputRef);\n\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ToggleSwitch',\n {\n 'spectrum-ToggleSwitch--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-ToggleSwitch-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-ToggleSwitch-switch')} />\n {children && (\n <span className={classNames(styles, 'spectrum-ToggleSwitch-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nconst _Switch = forwardRef(Switch);\nexport {_Switch as Switch};\n"],"names":[],"version":3,"file":"Switch.module.js.map"}
package/dist/import.mjs CHANGED
@@ -1,20 +1,5 @@
1
- import "./main.css";
2
- import {useStyleProps as $8Tpjb$useStyleProps, useFocusableRef as $8Tpjb$useFocusableRef, classNames as $8Tpjb$classNames} from "@react-spectrum/utils";
3
- import {FocusRing as $8Tpjb$FocusRing} from "@react-aria/focus";
4
- import $8Tpjb$react, {useRef as $8Tpjb$useRef, forwardRef as $8Tpjb$forwardRef} from "react";
5
- import {useHover as $8Tpjb$useHover} from "@react-aria/interactions";
6
- import {useProviderProps as $8Tpjb$useProviderProps} from "@react-spectrum/provider";
7
- import {useSwitch as $8Tpjb$useSwitch} from "@react-aria/switch";
8
- import {useToggleState as $8Tpjb$useToggleState} from "@react-stately/toggle";
1
+ import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.mjs";
9
2
 
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
-
15
- function $parcel$export(e, n, v, s) {
16
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
- }
18
3
  /*
19
4
  * Copyright 2020 Adobe. All rights reserved.
20
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -26,101 +11,6 @@ function $parcel$export(e, n, v, s) {
26
11
  * OF ANY KIND, either express or implied. See the License for the specific language
27
12
  * governing permissions and limitations under the License.
28
13
  */ /// <reference types="css-module-types" />
29
- /*
30
- * Copyright 2020 Adobe. All rights reserved.
31
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
32
- * you may not use this file except in compliance with the License. You may obtain a copy
33
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
34
- *
35
- * Unless required by applicable law or agreed to in writing, software distributed under
36
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
37
- * OF ANY KIND, either express or implied. See the License for the specific language
38
- * governing permissions and limitations under the License.
39
- */
40
-
41
-
42
- var $dfcff93ab25bb9b3$exports = {};
43
-
44
- $parcel$export($dfcff93ab25bb9b3$exports, "focus-ring", () => $dfcff93ab25bb9b3$export$f39a09f249340e2a, (v) => $dfcff93ab25bb9b3$export$f39a09f249340e2a = v);
45
- $parcel$export($dfcff93ab25bb9b3$exports, "i18nFontFamily", () => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514, (v) => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = v);
46
- $parcel$export($dfcff93ab25bb9b3$exports, "is-hovered", () => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7, (v) => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = v);
47
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing-ring", () => $dfcff93ab25bb9b3$export$4109102f950813a6, (v) => $dfcff93ab25bb9b3$export$4109102f950813a6 = v);
48
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing", () => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd, (v) => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = v);
49
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing--quiet", () => $dfcff93ab25bb9b3$export$2927016961429360, (v) => $dfcff93ab25bb9b3$export$2927016961429360 = v);
50
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch", () => $dfcff93ab25bb9b3$export$89a9162656c0c38c, (v) => $dfcff93ab25bb9b3$export$89a9162656c0c38c = v);
51
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--ab", () => $dfcff93ab25bb9b3$export$dc5a33fddabf5882, (v) => $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = v);
52
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--quiet", () => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4, (v) => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = v);
53
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-input", () => $dfcff93ab25bb9b3$export$38df7ea4ffef819a, (v) => $dfcff93ab25bb9b3$export$38df7ea4ffef819a = v);
54
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-label", () => $dfcff93ab25bb9b3$export$8f1a69021a3897b2, (v) => $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = v);
55
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-switch", () => $dfcff93ab25bb9b3$export$b82d06d1b520a22f, (v) => $dfcff93ab25bb9b3$export$b82d06d1b520a22f = v);
56
- var $dfcff93ab25bb9b3$export$f39a09f249340e2a;
57
- var $dfcff93ab25bb9b3$export$8c4ee2c50c22c514;
58
- var $dfcff93ab25bb9b3$export$b8813cd5d7824ce7;
59
- var $dfcff93ab25bb9b3$export$4109102f950813a6;
60
- var $dfcff93ab25bb9b3$export$24c7f46a6e3605dd;
61
- var $dfcff93ab25bb9b3$export$2927016961429360;
62
- var $dfcff93ab25bb9b3$export$89a9162656c0c38c;
63
- var $dfcff93ab25bb9b3$export$dc5a33fddabf5882;
64
- var $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4;
65
- var $dfcff93ab25bb9b3$export$38df7ea4ffef819a;
66
- var $dfcff93ab25bb9b3$export$8f1a69021a3897b2;
67
- var $dfcff93ab25bb9b3$export$b82d06d1b520a22f;
68
- $dfcff93ab25bb9b3$export$f39a09f249340e2a = `XHynUq_focus-ring`;
69
- $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
70
- $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
71
- $dfcff93ab25bb9b3$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
72
- $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
73
- $dfcff93ab25bb9b3$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
74
- $dfcff93ab25bb9b3$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
75
- $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
76
- $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
77
- $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
78
- $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
79
- $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
80
-
81
-
82
-
83
-
84
-
85
-
86
- function $8341c396cee1c5fc$var$Switch(props, ref) {
87
- props = (0, $8Tpjb$useProviderProps)(props);
88
- let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
89
- let { styleProps: styleProps } = (0, $8Tpjb$useStyleProps)(otherProps);
90
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $8Tpjb$useHover)({
91
- isDisabled: isDisabled
92
- });
93
- let inputRef = (0, $8Tpjb$useRef)(null);
94
- let domRef = (0, $8Tpjb$useFocusableRef)(ref, inputRef);
95
- let state = (0, $8Tpjb$useToggleState)(props);
96
- let { inputProps: inputProps } = (0, $8Tpjb$useSwitch)(props, state, inputRef);
97
- return /*#__PURE__*/ (0, $8Tpjb$react).createElement("label", {
98
- ...styleProps,
99
- ...hoverProps,
100
- ref: domRef,
101
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch", {
102
- "spectrum-ToggleSwitch--quiet": !isEmphasized,
103
- "is-disabled": isDisabled,
104
- "is-hovered": isHovered
105
- }, styleProps.className)
106
- }, /*#__PURE__*/ (0, $8Tpjb$react).createElement((0, $8Tpjb$FocusRing), {
107
- focusRingClass: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "focus-ring"),
108
- autoFocus: autoFocus
109
- }, /*#__PURE__*/ (0, $8Tpjb$react).createElement("input", {
110
- ...inputProps,
111
- ref: inputRef,
112
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-input")
113
- })), /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
114
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-switch")
115
- }), children && /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
116
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-label")
117
- }, children));
118
- }
119
- /**
120
- * Switches allow users to turn an individual option on or off.
121
- * They are usually used to activate or deactivate a specific setting.
122
- */ const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $8Tpjb$forwardRef)($8341c396cee1c5fc$var$Switch);
123
-
124
14
 
125
15
 
126
16
 
package/dist/main.js CHANGED
@@ -1,22 +1,11 @@
1
- require("./main.css");
2
- var $3fKzX$reactspectrumutils = require("@react-spectrum/utils");
3
- var $3fKzX$reactariafocus = require("@react-aria/focus");
4
- var $3fKzX$react = require("react");
5
- var $3fKzX$reactariainteractions = require("@react-aria/interactions");
6
- var $3fKzX$reactspectrumprovider = require("@react-spectrum/provider");
7
- var $3fKzX$reactariaswitch = require("@react-aria/switch");
8
- var $3fKzX$reactstatelytoggle = require("@react-stately/toggle");
1
+ var $e216104aee091306$exports = require("./Switch.main.js");
9
2
 
10
3
 
11
4
  function $parcel$export(e, n, v, s) {
12
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
6
  }
14
7
 
15
- function $parcel$interopDefault(a) {
16
- return a && a.__esModule ? a.default : a;
17
- }
18
-
19
- $parcel$export(module.exports, "Switch", () => $e216104aee091306$export$b5d5cf8927ab7262);
8
+ $parcel$export(module.exports, "Switch", () => $e216104aee091306$exports.Switch);
20
9
  /*
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");
@@ -28,101 +17,6 @@ $parcel$export(module.exports, "Switch", () => $e216104aee091306$export$b5d5cf89
28
17
  * OF ANY KIND, either express or implied. See the License for the specific language
29
18
  * governing permissions and limitations under the License.
30
19
  */ /// <reference types="css-module-types" />
31
- /*
32
- * Copyright 2020 Adobe. All rights reserved.
33
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
34
- * you may not use this file except in compliance with the License. You may obtain a copy
35
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
36
- *
37
- * Unless required by applicable law or agreed to in writing, software distributed under
38
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
- * OF ANY KIND, either express or implied. See the License for the specific language
40
- * governing permissions and limitations under the License.
41
- */
42
-
43
-
44
- var $faeb9d1b92049ba7$exports = {};
45
-
46
- $parcel$export($faeb9d1b92049ba7$exports, "focus-ring", () => $faeb9d1b92049ba7$export$f39a09f249340e2a, (v) => $faeb9d1b92049ba7$export$f39a09f249340e2a = v);
47
- $parcel$export($faeb9d1b92049ba7$exports, "i18nFontFamily", () => $faeb9d1b92049ba7$export$8c4ee2c50c22c514, (v) => $faeb9d1b92049ba7$export$8c4ee2c50c22c514 = v);
48
- $parcel$export($faeb9d1b92049ba7$exports, "is-hovered", () => $faeb9d1b92049ba7$export$b8813cd5d7824ce7, (v) => $faeb9d1b92049ba7$export$b8813cd5d7824ce7 = v);
49
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-FocusRing-ring", () => $faeb9d1b92049ba7$export$4109102f950813a6, (v) => $faeb9d1b92049ba7$export$4109102f950813a6 = v);
50
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-FocusRing", () => $faeb9d1b92049ba7$export$24c7f46a6e3605dd, (v) => $faeb9d1b92049ba7$export$24c7f46a6e3605dd = v);
51
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-FocusRing--quiet", () => $faeb9d1b92049ba7$export$2927016961429360, (v) => $faeb9d1b92049ba7$export$2927016961429360 = v);
52
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch", () => $faeb9d1b92049ba7$export$89a9162656c0c38c, (v) => $faeb9d1b92049ba7$export$89a9162656c0c38c = v);
53
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch--ab", () => $faeb9d1b92049ba7$export$dc5a33fddabf5882, (v) => $faeb9d1b92049ba7$export$dc5a33fddabf5882 = v);
54
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch--quiet", () => $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4, (v) => $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4 = v);
55
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch-input", () => $faeb9d1b92049ba7$export$38df7ea4ffef819a, (v) => $faeb9d1b92049ba7$export$38df7ea4ffef819a = v);
56
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch-label", () => $faeb9d1b92049ba7$export$8f1a69021a3897b2, (v) => $faeb9d1b92049ba7$export$8f1a69021a3897b2 = v);
57
- $parcel$export($faeb9d1b92049ba7$exports, "spectrum-ToggleSwitch-switch", () => $faeb9d1b92049ba7$export$b82d06d1b520a22f, (v) => $faeb9d1b92049ba7$export$b82d06d1b520a22f = v);
58
- var $faeb9d1b92049ba7$export$f39a09f249340e2a;
59
- var $faeb9d1b92049ba7$export$8c4ee2c50c22c514;
60
- var $faeb9d1b92049ba7$export$b8813cd5d7824ce7;
61
- var $faeb9d1b92049ba7$export$4109102f950813a6;
62
- var $faeb9d1b92049ba7$export$24c7f46a6e3605dd;
63
- var $faeb9d1b92049ba7$export$2927016961429360;
64
- var $faeb9d1b92049ba7$export$89a9162656c0c38c;
65
- var $faeb9d1b92049ba7$export$dc5a33fddabf5882;
66
- var $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4;
67
- var $faeb9d1b92049ba7$export$38df7ea4ffef819a;
68
- var $faeb9d1b92049ba7$export$8f1a69021a3897b2;
69
- var $faeb9d1b92049ba7$export$b82d06d1b520a22f;
70
- $faeb9d1b92049ba7$export$f39a09f249340e2a = `XHynUq_focus-ring`;
71
- $faeb9d1b92049ba7$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
72
- $faeb9d1b92049ba7$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
73
- $faeb9d1b92049ba7$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
74
- $faeb9d1b92049ba7$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$faeb9d1b92049ba7$export$4109102f950813a6}`;
75
- $faeb9d1b92049ba7$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
76
- $faeb9d1b92049ba7$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
77
- $faeb9d1b92049ba7$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
78
- $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
79
- $faeb9d1b92049ba7$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
80
- $faeb9d1b92049ba7$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
81
- $faeb9d1b92049ba7$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
82
-
83
-
84
-
85
-
86
-
87
-
88
- function $e216104aee091306$var$Switch(props, ref) {
89
- props = (0, $3fKzX$reactspectrumprovider.useProviderProps)(props);
90
- let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
91
- let { styleProps: styleProps } = (0, $3fKzX$reactspectrumutils.useStyleProps)(otherProps);
92
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3fKzX$reactariainteractions.useHover)({
93
- isDisabled: isDisabled
94
- });
95
- let inputRef = (0, $3fKzX$react.useRef)(null);
96
- let domRef = (0, $3fKzX$reactspectrumutils.useFocusableRef)(ref, inputRef);
97
- let state = (0, $3fKzX$reactstatelytoggle.useToggleState)(props);
98
- let { inputProps: inputProps } = (0, $3fKzX$reactariaswitch.useSwitch)(props, state, inputRef);
99
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3fKzX$react))).createElement("label", {
100
- ...styleProps,
101
- ...hoverProps,
102
- ref: domRef,
103
- className: (0, $3fKzX$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($faeb9d1b92049ba7$exports))), "spectrum-ToggleSwitch", {
104
- "spectrum-ToggleSwitch--quiet": !isEmphasized,
105
- "is-disabled": isDisabled,
106
- "is-hovered": isHovered
107
- }, styleProps.className)
108
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3fKzX$react))).createElement((0, $3fKzX$reactariafocus.FocusRing), {
109
- focusRingClass: (0, $3fKzX$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($faeb9d1b92049ba7$exports))), "focus-ring"),
110
- autoFocus: autoFocus
111
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3fKzX$react))).createElement("input", {
112
- ...inputProps,
113
- ref: inputRef,
114
- className: (0, $3fKzX$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($faeb9d1b92049ba7$exports))), "spectrum-ToggleSwitch-input")
115
- })), /*#__PURE__*/ (0, ($parcel$interopDefault($3fKzX$react))).createElement("span", {
116
- className: (0, $3fKzX$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($faeb9d1b92049ba7$exports))), "spectrum-ToggleSwitch-switch")
117
- }), children && /*#__PURE__*/ (0, ($parcel$interopDefault($3fKzX$react))).createElement("span", {
118
- className: (0, $3fKzX$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($faeb9d1b92049ba7$exports))), "spectrum-ToggleSwitch-label")
119
- }, children));
120
- }
121
- /**
122
- * Switches allow users to turn an individual option on or off.
123
- * They are usually used to activate or deactivate a specific setting.
124
- */ const $e216104aee091306$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $3fKzX$react.forwardRef)($e216104aee091306$var$Switch);
125
-
126
20
 
127
21
 
128
22
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAXA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;;;;;;;ADYtF,SAAS,6BAAO,KAA0B,EAAE,GAAmC;IAC7E,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,gBACF,eAAe,mBACf,aAAa,kBACb,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,QAAQ,CAAA,GAAA,wCAAa,EAAE;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAG3C,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,gEAAK,GACL,yBACA;YACE,gCAAgC,CAAC;YACjC,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QAAe,WAAW;qBACtE,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;uBAElC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACnC,0BACC,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAU,CAAA,GAAA,uBAAS,EAAE;","sources":["packages/@react-spectrum/switch/src/index.ts","packages/@react-spectrum/switch/src/Switch.tsx","packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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 {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumSwitchProps} from '@react-types/switch';\nimport styles from '@adobe/spectrum-css-temp/components/toggle/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSwitch} from '@react-aria/switch';\nimport {useToggleState} from '@react-stately/toggle';\n\nfunction Switch(props: SpectrumSwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n props = useProviderProps(props);\n let {\n isEmphasized = false,\n isDisabled = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let state = useToggleState(props);\n let {inputProps} = useSwitch(props, state, inputRef);\n\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ToggleSwitch',\n {\n 'spectrum-ToggleSwitch--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-ToggleSwitch-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-ToggleSwitch-switch')} />\n {children && (\n <span className={classNames(styles, 'spectrum-ToggleSwitch-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nconst _Switch = forwardRef(Switch);\nexport {_Switch as Switch};\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/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 */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,20 +1,5 @@
1
- import "./main.css";
2
- import {useStyleProps as $8Tpjb$useStyleProps, useFocusableRef as $8Tpjb$useFocusableRef, classNames as $8Tpjb$classNames} from "@react-spectrum/utils";
3
- import {FocusRing as $8Tpjb$FocusRing} from "@react-aria/focus";
4
- import $8Tpjb$react, {useRef as $8Tpjb$useRef, forwardRef as $8Tpjb$forwardRef} from "react";
5
- import {useHover as $8Tpjb$useHover} from "@react-aria/interactions";
6
- import {useProviderProps as $8Tpjb$useProviderProps} from "@react-spectrum/provider";
7
- import {useSwitch as $8Tpjb$useSwitch} from "@react-aria/switch";
8
- import {useToggleState as $8Tpjb$useToggleState} from "@react-stately/toggle";
1
+ import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.module.js";
9
2
 
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
-
15
- function $parcel$export(e, n, v, s) {
16
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
- }
18
3
  /*
19
4
  * Copyright 2020 Adobe. All rights reserved.
20
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -26,101 +11,6 @@ function $parcel$export(e, n, v, s) {
26
11
  * OF ANY KIND, either express or implied. See the License for the specific language
27
12
  * governing permissions and limitations under the License.
28
13
  */ /// <reference types="css-module-types" />
29
- /*
30
- * Copyright 2020 Adobe. All rights reserved.
31
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
32
- * you may not use this file except in compliance with the License. You may obtain a copy
33
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
34
- *
35
- * Unless required by applicable law or agreed to in writing, software distributed under
36
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
37
- * OF ANY KIND, either express or implied. See the License for the specific language
38
- * governing permissions and limitations under the License.
39
- */
40
-
41
-
42
- var $dfcff93ab25bb9b3$exports = {};
43
-
44
- $parcel$export($dfcff93ab25bb9b3$exports, "focus-ring", () => $dfcff93ab25bb9b3$export$f39a09f249340e2a, (v) => $dfcff93ab25bb9b3$export$f39a09f249340e2a = v);
45
- $parcel$export($dfcff93ab25bb9b3$exports, "i18nFontFamily", () => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514, (v) => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = v);
46
- $parcel$export($dfcff93ab25bb9b3$exports, "is-hovered", () => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7, (v) => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = v);
47
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing-ring", () => $dfcff93ab25bb9b3$export$4109102f950813a6, (v) => $dfcff93ab25bb9b3$export$4109102f950813a6 = v);
48
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing", () => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd, (v) => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = v);
49
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing--quiet", () => $dfcff93ab25bb9b3$export$2927016961429360, (v) => $dfcff93ab25bb9b3$export$2927016961429360 = v);
50
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch", () => $dfcff93ab25bb9b3$export$89a9162656c0c38c, (v) => $dfcff93ab25bb9b3$export$89a9162656c0c38c = v);
51
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--ab", () => $dfcff93ab25bb9b3$export$dc5a33fddabf5882, (v) => $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = v);
52
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--quiet", () => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4, (v) => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = v);
53
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-input", () => $dfcff93ab25bb9b3$export$38df7ea4ffef819a, (v) => $dfcff93ab25bb9b3$export$38df7ea4ffef819a = v);
54
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-label", () => $dfcff93ab25bb9b3$export$8f1a69021a3897b2, (v) => $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = v);
55
- $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-switch", () => $dfcff93ab25bb9b3$export$b82d06d1b520a22f, (v) => $dfcff93ab25bb9b3$export$b82d06d1b520a22f = v);
56
- var $dfcff93ab25bb9b3$export$f39a09f249340e2a;
57
- var $dfcff93ab25bb9b3$export$8c4ee2c50c22c514;
58
- var $dfcff93ab25bb9b3$export$b8813cd5d7824ce7;
59
- var $dfcff93ab25bb9b3$export$4109102f950813a6;
60
- var $dfcff93ab25bb9b3$export$24c7f46a6e3605dd;
61
- var $dfcff93ab25bb9b3$export$2927016961429360;
62
- var $dfcff93ab25bb9b3$export$89a9162656c0c38c;
63
- var $dfcff93ab25bb9b3$export$dc5a33fddabf5882;
64
- var $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4;
65
- var $dfcff93ab25bb9b3$export$38df7ea4ffef819a;
66
- var $dfcff93ab25bb9b3$export$8f1a69021a3897b2;
67
- var $dfcff93ab25bb9b3$export$b82d06d1b520a22f;
68
- $dfcff93ab25bb9b3$export$f39a09f249340e2a = `XHynUq_focus-ring`;
69
- $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
70
- $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
71
- $dfcff93ab25bb9b3$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
72
- $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
73
- $dfcff93ab25bb9b3$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
74
- $dfcff93ab25bb9b3$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
75
- $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
76
- $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
77
- $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
78
- $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
79
- $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
80
-
81
-
82
-
83
-
84
-
85
-
86
- function $8341c396cee1c5fc$var$Switch(props, ref) {
87
- props = (0, $8Tpjb$useProviderProps)(props);
88
- let { isEmphasized: isEmphasized = false, isDisabled: isDisabled = false, autoFocus: autoFocus, children: children, ...otherProps } = props;
89
- let { styleProps: styleProps } = (0, $8Tpjb$useStyleProps)(otherProps);
90
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $8Tpjb$useHover)({
91
- isDisabled: isDisabled
92
- });
93
- let inputRef = (0, $8Tpjb$useRef)(null);
94
- let domRef = (0, $8Tpjb$useFocusableRef)(ref, inputRef);
95
- let state = (0, $8Tpjb$useToggleState)(props);
96
- let { inputProps: inputProps } = (0, $8Tpjb$useSwitch)(props, state, inputRef);
97
- return /*#__PURE__*/ (0, $8Tpjb$react).createElement("label", {
98
- ...styleProps,
99
- ...hoverProps,
100
- ref: domRef,
101
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch", {
102
- "spectrum-ToggleSwitch--quiet": !isEmphasized,
103
- "is-disabled": isDisabled,
104
- "is-hovered": isHovered
105
- }, styleProps.className)
106
- }, /*#__PURE__*/ (0, $8Tpjb$react).createElement((0, $8Tpjb$FocusRing), {
107
- focusRingClass: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "focus-ring"),
108
- autoFocus: autoFocus
109
- }, /*#__PURE__*/ (0, $8Tpjb$react).createElement("input", {
110
- ...inputProps,
111
- ref: inputRef,
112
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-input")
113
- })), /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
114
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-switch")
115
- }), children && /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
116
- className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-label")
117
- }, children));
118
- }
119
- /**
120
- * Switches allow users to turn an individual option on or off.
121
- * They are usually used to activate or deactivate a specific setting.
122
- */ const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $8Tpjb$forwardRef)($8341c396cee1c5fc$var$Switch);
123
-
124
14
 
125
15
 
126
16
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAXA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;;;;;;;ADYtF,SAAS,6BAAO,KAA0B,EAAE,GAAmC;IAC7E,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,gBACF,eAAe,mBACf,aAAa,kBACb,SAAS,YACT,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAElD,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAClC,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE;IAC3B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE,OAAO,OAAO;IAG3C,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,gEAAK,GACL,yBACA;YACE,gCAAgC,CAAC;YACjC,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QAAe,WAAW;qBACtE,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;uBAElC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QACnC,0BACC,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OACjC;AAKX;AAEA;;;CAGC,GACD,MAAM,0DAAU,CAAA,GAAA,iBAAS,EAAE;","sources":["packages/@react-spectrum/switch/src/index.ts","packages/@react-spectrum/switch/src/Switch.tsx","packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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 {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\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 {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport React, {forwardRef, useRef} from 'react';\nimport {SpectrumSwitchProps} from '@react-types/switch';\nimport styles from '@adobe/spectrum-css-temp/components/toggle/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSwitch} from '@react-aria/switch';\nimport {useToggleState} from '@react-stately/toggle';\n\nfunction Switch(props: SpectrumSwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n props = useProviderProps(props);\n let {\n isEmphasized = false,\n isDisabled = false,\n autoFocus,\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let state = useToggleState(props);\n let {inputProps} = useSwitch(props, state, inputRef);\n\n\n return (\n <label\n {...styleProps}\n {...hoverProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ToggleSwitch',\n {\n 'spectrum-ToggleSwitch--quiet': !isEmphasized,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <input\n {...inputProps}\n ref={inputRef}\n className={classNames(styles, 'spectrum-ToggleSwitch-input')} />\n </FocusRing>\n <span className={classNames(styles, 'spectrum-ToggleSwitch-switch')} />\n {children && (\n <span className={classNames(styles, 'spectrum-ToggleSwitch-label')}>\n {children}\n </span>\n )}\n </label>\n );\n}\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nconst _Switch = forwardRef(Switch);\nexport {_Switch as Switch};\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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/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 */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,44 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+
6
+ $parcel$export(module.exports, "focus-ring", () => $faeb9d1b92049ba7$export$f39a09f249340e2a, (v) => $faeb9d1b92049ba7$export$f39a09f249340e2a = v);
7
+ $parcel$export(module.exports, "i18nFontFamily", () => $faeb9d1b92049ba7$export$8c4ee2c50c22c514, (v) => $faeb9d1b92049ba7$export$8c4ee2c50c22c514 = v);
8
+ $parcel$export(module.exports, "is-hovered", () => $faeb9d1b92049ba7$export$b8813cd5d7824ce7, (v) => $faeb9d1b92049ba7$export$b8813cd5d7824ce7 = v);
9
+ $parcel$export(module.exports, "spectrum-FocusRing-ring", () => $faeb9d1b92049ba7$export$4109102f950813a6, (v) => $faeb9d1b92049ba7$export$4109102f950813a6 = v);
10
+ $parcel$export(module.exports, "spectrum-FocusRing", () => $faeb9d1b92049ba7$export$24c7f46a6e3605dd, (v) => $faeb9d1b92049ba7$export$24c7f46a6e3605dd = v);
11
+ $parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $faeb9d1b92049ba7$export$2927016961429360, (v) => $faeb9d1b92049ba7$export$2927016961429360 = v);
12
+ $parcel$export(module.exports, "spectrum-ToggleSwitch", () => $faeb9d1b92049ba7$export$89a9162656c0c38c, (v) => $faeb9d1b92049ba7$export$89a9162656c0c38c = v);
13
+ $parcel$export(module.exports, "spectrum-ToggleSwitch--ab", () => $faeb9d1b92049ba7$export$dc5a33fddabf5882, (v) => $faeb9d1b92049ba7$export$dc5a33fddabf5882 = v);
14
+ $parcel$export(module.exports, "spectrum-ToggleSwitch--quiet", () => $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4, (v) => $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4 = v);
15
+ $parcel$export(module.exports, "spectrum-ToggleSwitch-input", () => $faeb9d1b92049ba7$export$38df7ea4ffef819a, (v) => $faeb9d1b92049ba7$export$38df7ea4ffef819a = v);
16
+ $parcel$export(module.exports, "spectrum-ToggleSwitch-label", () => $faeb9d1b92049ba7$export$8f1a69021a3897b2, (v) => $faeb9d1b92049ba7$export$8f1a69021a3897b2 = v);
17
+ $parcel$export(module.exports, "spectrum-ToggleSwitch-switch", () => $faeb9d1b92049ba7$export$b82d06d1b520a22f, (v) => $faeb9d1b92049ba7$export$b82d06d1b520a22f = v);
18
+ var $faeb9d1b92049ba7$export$f39a09f249340e2a;
19
+ var $faeb9d1b92049ba7$export$8c4ee2c50c22c514;
20
+ var $faeb9d1b92049ba7$export$b8813cd5d7824ce7;
21
+ var $faeb9d1b92049ba7$export$4109102f950813a6;
22
+ var $faeb9d1b92049ba7$export$24c7f46a6e3605dd;
23
+ var $faeb9d1b92049ba7$export$2927016961429360;
24
+ var $faeb9d1b92049ba7$export$89a9162656c0c38c;
25
+ var $faeb9d1b92049ba7$export$dc5a33fddabf5882;
26
+ var $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4;
27
+ var $faeb9d1b92049ba7$export$38df7ea4ffef819a;
28
+ var $faeb9d1b92049ba7$export$8f1a69021a3897b2;
29
+ var $faeb9d1b92049ba7$export$b82d06d1b520a22f;
30
+ $faeb9d1b92049ba7$export$f39a09f249340e2a = `XHynUq_focus-ring`;
31
+ $faeb9d1b92049ba7$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
32
+ $faeb9d1b92049ba7$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
33
+ $faeb9d1b92049ba7$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
34
+ $faeb9d1b92049ba7$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$faeb9d1b92049ba7$export$4109102f950813a6}`;
35
+ $faeb9d1b92049ba7$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
36
+ $faeb9d1b92049ba7$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
37
+ $faeb9d1b92049ba7$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
38
+ $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
39
+ $faeb9d1b92049ba7$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
40
+ $faeb9d1b92049ba7$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
41
+ $faeb9d1b92049ba7$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
42
+
43
+
44
+ //# sourceMappingURL=toggle_vars_css.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAXA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"toggle_vars_css.main.js.map"}
@@ -0,0 +1,46 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+ var $dfcff93ab25bb9b3$exports = {};
6
+
7
+ $parcel$export($dfcff93ab25bb9b3$exports, "focus-ring", () => $dfcff93ab25bb9b3$export$f39a09f249340e2a, (v) => $dfcff93ab25bb9b3$export$f39a09f249340e2a = v);
8
+ $parcel$export($dfcff93ab25bb9b3$exports, "i18nFontFamily", () => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514, (v) => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = v);
9
+ $parcel$export($dfcff93ab25bb9b3$exports, "is-hovered", () => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7, (v) => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = v);
10
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing-ring", () => $dfcff93ab25bb9b3$export$4109102f950813a6, (v) => $dfcff93ab25bb9b3$export$4109102f950813a6 = v);
11
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing", () => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd, (v) => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = v);
12
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing--quiet", () => $dfcff93ab25bb9b3$export$2927016961429360, (v) => $dfcff93ab25bb9b3$export$2927016961429360 = v);
13
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch", () => $dfcff93ab25bb9b3$export$89a9162656c0c38c, (v) => $dfcff93ab25bb9b3$export$89a9162656c0c38c = v);
14
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--ab", () => $dfcff93ab25bb9b3$export$dc5a33fddabf5882, (v) => $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = v);
15
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--quiet", () => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4, (v) => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = v);
16
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-input", () => $dfcff93ab25bb9b3$export$38df7ea4ffef819a, (v) => $dfcff93ab25bb9b3$export$38df7ea4ffef819a = v);
17
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-label", () => $dfcff93ab25bb9b3$export$8f1a69021a3897b2, (v) => $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = v);
18
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-switch", () => $dfcff93ab25bb9b3$export$b82d06d1b520a22f, (v) => $dfcff93ab25bb9b3$export$b82d06d1b520a22f = v);
19
+ var $dfcff93ab25bb9b3$export$f39a09f249340e2a;
20
+ var $dfcff93ab25bb9b3$export$8c4ee2c50c22c514;
21
+ var $dfcff93ab25bb9b3$export$b8813cd5d7824ce7;
22
+ var $dfcff93ab25bb9b3$export$4109102f950813a6;
23
+ var $dfcff93ab25bb9b3$export$24c7f46a6e3605dd;
24
+ var $dfcff93ab25bb9b3$export$2927016961429360;
25
+ var $dfcff93ab25bb9b3$export$89a9162656c0c38c;
26
+ var $dfcff93ab25bb9b3$export$dc5a33fddabf5882;
27
+ var $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4;
28
+ var $dfcff93ab25bb9b3$export$38df7ea4ffef819a;
29
+ var $dfcff93ab25bb9b3$export$8f1a69021a3897b2;
30
+ var $dfcff93ab25bb9b3$export$b82d06d1b520a22f;
31
+ $dfcff93ab25bb9b3$export$f39a09f249340e2a = `XHynUq_focus-ring`;
32
+ $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
33
+ $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
34
+ $dfcff93ab25bb9b3$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
35
+ $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
36
+ $dfcff93ab25bb9b3$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
37
+ $dfcff93ab25bb9b3$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
38
+ $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
39
+ $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
40
+ $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
41
+ $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
42
+ $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
43
+
44
+
45
+ export {$dfcff93ab25bb9b3$exports as default};
46
+ //# sourceMappingURL=toggle_vars_css.module.js.map
@@ -0,0 +1,46 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+ var $dfcff93ab25bb9b3$exports = {};
6
+
7
+ $parcel$export($dfcff93ab25bb9b3$exports, "focus-ring", () => $dfcff93ab25bb9b3$export$f39a09f249340e2a, (v) => $dfcff93ab25bb9b3$export$f39a09f249340e2a = v);
8
+ $parcel$export($dfcff93ab25bb9b3$exports, "i18nFontFamily", () => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514, (v) => $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = v);
9
+ $parcel$export($dfcff93ab25bb9b3$exports, "is-hovered", () => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7, (v) => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = v);
10
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing-ring", () => $dfcff93ab25bb9b3$export$4109102f950813a6, (v) => $dfcff93ab25bb9b3$export$4109102f950813a6 = v);
11
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing", () => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd, (v) => $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = v);
12
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-FocusRing--quiet", () => $dfcff93ab25bb9b3$export$2927016961429360, (v) => $dfcff93ab25bb9b3$export$2927016961429360 = v);
13
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch", () => $dfcff93ab25bb9b3$export$89a9162656c0c38c, (v) => $dfcff93ab25bb9b3$export$89a9162656c0c38c = v);
14
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--ab", () => $dfcff93ab25bb9b3$export$dc5a33fddabf5882, (v) => $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = v);
15
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--quiet", () => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4, (v) => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = v);
16
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-input", () => $dfcff93ab25bb9b3$export$38df7ea4ffef819a, (v) => $dfcff93ab25bb9b3$export$38df7ea4ffef819a = v);
17
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-label", () => $dfcff93ab25bb9b3$export$8f1a69021a3897b2, (v) => $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = v);
18
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-switch", () => $dfcff93ab25bb9b3$export$b82d06d1b520a22f, (v) => $dfcff93ab25bb9b3$export$b82d06d1b520a22f = v);
19
+ var $dfcff93ab25bb9b3$export$f39a09f249340e2a;
20
+ var $dfcff93ab25bb9b3$export$8c4ee2c50c22c514;
21
+ var $dfcff93ab25bb9b3$export$b8813cd5d7824ce7;
22
+ var $dfcff93ab25bb9b3$export$4109102f950813a6;
23
+ var $dfcff93ab25bb9b3$export$24c7f46a6e3605dd;
24
+ var $dfcff93ab25bb9b3$export$2927016961429360;
25
+ var $dfcff93ab25bb9b3$export$89a9162656c0c38c;
26
+ var $dfcff93ab25bb9b3$export$dc5a33fddabf5882;
27
+ var $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4;
28
+ var $dfcff93ab25bb9b3$export$38df7ea4ffef819a;
29
+ var $dfcff93ab25bb9b3$export$8f1a69021a3897b2;
30
+ var $dfcff93ab25bb9b3$export$b82d06d1b520a22f;
31
+ $dfcff93ab25bb9b3$export$f39a09f249340e2a = `XHynUq_focus-ring`;
32
+ $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `XHynUq_i18nFontFamily`;
33
+ $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `XHynUq_is-hovered`;
34
+ $dfcff93ab25bb9b3$export$4109102f950813a6 = `XHynUq_spectrum-FocusRing-ring`;
35
+ $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `XHynUq_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
36
+ $dfcff93ab25bb9b3$export$2927016961429360 = `XHynUq_spectrum-FocusRing--quiet`;
37
+ $dfcff93ab25bb9b3$export$89a9162656c0c38c = `XHynUq_spectrum-ToggleSwitch`;
38
+ $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `XHynUq_spectrum-ToggleSwitch--ab`;
39
+ $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `XHynUq_spectrum-ToggleSwitch--quiet`;
40
+ $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `XHynUq_spectrum-ToggleSwitch-input`;
41
+ $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `XHynUq_spectrum-ToggleSwitch-label`;
42
+ $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `XHynUq_spectrum-ToggleSwitch-switch`;
43
+
44
+
45
+ export {$dfcff93ab25bb9b3$exports as default};
46
+ //# sourceMappingURL=toggle_vars_css.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAXA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"toggle_vars_css.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import { SpectrumSwitchProps } from "@react-types/switch";
3
+ import { FocusableRefValue } from "@react-types/shared";
3
4
  /**
4
5
  * Switches allow users to turn an individual option on or off.
5
6
  * They are usually used to activate or deactivate a specific setting.
6
7
  */
7
- export const Switch: React.ForwardRefExoticComponent<SpectrumSwitchProps & React.RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLLabelElement, HTMLLabelElement>>>;
8
+ export const Switch: React.ForwardRefExoticComponent<SpectrumSwitchProps & React.RefAttributes<FocusableRefValue<HTMLLabelElement, HTMLLabelElement>>>;
8
9
  export type { SpectrumSwitchProps } from '@react-types/switch';
9
10
 
10
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;AA0EA;;;GAGG;AACH,OAAA,MAAM,uKAA4B,CAAC;AC/DnC,YAAY,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/switch/src/packages/@react-spectrum/switch/src/Switch.tsx","packages/@react-spectrum/switch/src/packages/@react-spectrum/switch/src/index.ts","packages/@react-spectrum/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\n/// <reference types=\"css-module-types\" />\n\nexport {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AA0EA;;;GAGG;AACH,OAAA,MAAM,yIAA4B,CAAC;AC/DnC,YAAY,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/switch/src/packages/@react-spectrum/switch/src/Switch.tsx","packages/@react-spectrum/switch/src/packages/@react-spectrum/switch/src/index.ts","packages/@react-spectrum/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\n/// <reference types=\"css-module-types\" />\n\nexport {Switch} from './Switch';\nexport type {SpectrumSwitchProps} from '@react-types/switch';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -23,11 +23,7 @@
23
23
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
24
24
  }
25
25
 
26
- .XHynUq_i18nFontFamily:lang(zh-SG) {
27
- font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
28
- }
29
-
30
- .XHynUq_i18nFontFamily:lang(zh-CN) {
26
+ .XHynUq_i18nFontFamily:lang(zh-SG), .XHynUq_i18nFontFamily:lang(zh-CN) {
31
27
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
32
28
  }
33
29
 
@@ -55,13 +51,7 @@
55
51
  transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
56
52
  display: block;
57
53
  position: absolute;
58
- top: 0;
59
- bottom: 0;
60
- left: 0;
61
- right: 0;
62
- }
63
-
64
- .XHynUq_spectrum-FocusRing {
54
+ inset: 0;
65
55
  }
66
56
 
67
57
  .XHynUq_spectrum-FocusRing.XHynUq_focus-ring:after {
@@ -78,6 +68,16 @@
78
68
  box-shadow: 0 var(--spectrum-focus-ring-size) 0 var(--spectrum-focus-ring-color);
79
69
  }
80
70
 
71
+ @media (forced-colors: active) {
72
+ .XHynUq_spectrum-FocusRing, .XHynUq_spectrum-FocusRing-ring, .XHynUq_spectrum-FocusRing--quiet {
73
+ --spectrum-high-contrast-focus-ring-color: Highlight;
74
+ }
75
+
76
+ :is(.XHynUq_spectrum-FocusRing, .XHynUq_spectrum-FocusRing-ring, .XHynUq_spectrum-FocusRing--quiet):after {
77
+ forced-color-adjust: none;
78
+ }
79
+ }
80
+
81
81
  .XHynUq_spectrum-ToggleSwitch {
82
82
  min-block-size: var(--spectrum-switch-height, var(--spectrum-global-dimension-size-400));
83
83
  vertical-align: top;
@@ -102,7 +102,7 @@
102
102
  top: 0;
103
103
  }
104
104
 
105
- .XHynUq_spectrum-ToggleSwitch-input:not(:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
105
+ .XHynUq_spectrum-ToggleSwitch-input:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
106
106
  left: 0;
107
107
  }
108
108
 
@@ -126,11 +126,7 @@
126
126
  transform: translateX(calc(100% - var(--spectrum-switch-track-width)));
127
127
  }
128
128
 
129
- .XHynUq_spectrum-ToggleSwitch-input:disabled {
130
- cursor: default;
131
- }
132
-
133
- .XHynUq_spectrum-ToggleSwitch-input[disabled] {
129
+ .XHynUq_spectrum-ToggleSwitch-input:disabled, .XHynUq_spectrum-ToggleSwitch-input[disabled] {
134
130
  cursor: default;
135
131
  }
136
132
 
@@ -167,21 +163,18 @@
167
163
  .XHynUq_spectrum-ToggleSwitch-switch:before {
168
164
  content: "";
169
165
  box-sizing: border-box;
170
- display: block;
171
- position: absolute;
172
- }
173
-
174
- .XHynUq_spectrum-ToggleSwitch-switch:before {
175
166
  transition: background var(--spectrum-global-animation-duration-100, .13s) ease-in-out, border var(--spectrum-global-animation-duration-100, .13s) ease-in-out, transform var(--spectrum-global-animation-duration-100, .13s) ease-in-out, box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
176
167
  inline-size: var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175));
177
168
  block-size: var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175));
178
169
  border-width: var(--spectrum-switch-handle-border-size, var(--spectrum-alias-border-size-thick));
179
170
  border-radius: calc(var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175)) / 2);
180
171
  border-style: solid;
172
+ display: block;
173
+ position: absolute;
181
174
  top: 0;
182
175
  }
183
176
 
184
- .XHynUq_spectrum-ToggleSwitch-switch:not(:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):before {
177
+ .XHynUq_spectrum-ToggleSwitch-switch:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):before {
185
178
  left: 0;
186
179
  }
187
180
 
@@ -204,10 +197,7 @@
204
197
  margin: 0;
205
198
  display: block;
206
199
  position: absolute;
207
- top: 0;
208
- bottom: 0;
209
- left: 0;
210
- right: 0;
200
+ inset: 0;
211
201
  transform: translateX(0);
212
202
  }
213
203
 
@@ -373,11 +363,7 @@
373
363
  border-color: var(--spectrum-switch-handle-border-color-selected, var(--spectrum-global-color-gray-700));
374
364
  }
375
365
 
376
- .XHynUq_spectrum-ToggleSwitch--ab .XHynUq_spectrum-ToggleSwitch-input:disabled:checked + .XHynUq_spectrum-ToggleSwitch-switch {
377
- background-color: var(--spectrum-switch-emphasized-track-color-disabled, var(--spectrum-global-color-gray-300));
378
- }
379
-
380
- .XHynUq_spectrum-ToggleSwitch--ab .XHynUq_spectrum-ToggleSwitch-input:disabled + .XHynUq_spectrum-ToggleSwitch-switch {
366
+ .XHynUq_spectrum-ToggleSwitch--ab .XHynUq_spectrum-ToggleSwitch-input:disabled:checked + .XHynUq_spectrum-ToggleSwitch-switch, .XHynUq_spectrum-ToggleSwitch--ab .XHynUq_spectrum-ToggleSwitch-input:disabled + .XHynUq_spectrum-ToggleSwitch-switch {
381
367
  background-color: var(--spectrum-switch-emphasized-track-color-disabled, var(--spectrum-global-color-gray-300));
382
368
  }
383
369
 
@@ -458,5 +444,4 @@
458
444
  box-shadow: inset 0 0 0 1px var(--spectrum-switch-emphasized-handle-border-color-disabled, var(--spectrum-global-color-gray-400));
459
445
  }
460
446
  }
461
-
462
- /*# sourceMappingURL=main.css.map */
447
+ /*# sourceMappingURL=vars.f7257b6a.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;AAgBA;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAqBI;;;;AAGA;;;;AAKF;;;;AAOI;;;;AAON;;;;;;;;;AASA;;;;;;;;;;;;;;;;;AA6BE;;;;;;;;;;;;;;AAQA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAeA;;;;;;;;;;;AA6BF;;;;;;;;;;;;;;;;;;;;AAuBA;;;;AAIE;;;;;AAMF;;;;AAOE;;;;AAEE;;;;AAWE;;;;;AAKF;;;;AAIA;;;;AAEE;;;;AAYA;;;;AAIF;;;;AAIA;;;;AAEE;;;;AAUJ;;;;AAEE;;;;AAIF;;;;AAKE;;;;AAEE;;;;AAIF;;;;AAWF;;;;AAEE;;;;AASF;;;;AAEE;;;;AASF;;;;AAEE;;;;AAYE;;;;AAGA;;;;AAMA;;;;AAEE;;;;AAaF;;;;AAEE;;;;AAUJ;;;;AAKE;;;;AAOA;;;;AAGE;;;;AAOF;;;;AAOE;;;;AASF;;;;AAEE;;;;AASF;;;;AAEE;;;;AAQR;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCE;;;;EAIE;;;;EAIF;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.f7257b6a.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/switch",
3
- "version": "3.5.3",
3
+ "version": "3.5.5",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,13 +36,13 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/focus": "^3.16.2",
40
- "@react-aria/interactions": "^3.21.1",
41
- "@react-aria/switch": "^3.6.2",
42
- "@react-spectrum/utils": "^3.11.5",
43
- "@react-stately/toggle": "^3.7.2",
44
- "@react-types/shared": "^3.22.1",
45
- "@react-types/switch": "^3.5.1",
39
+ "@react-aria/focus": "^3.17.1",
40
+ "@react-aria/interactions": "^3.21.3",
41
+ "@react-aria/switch": "^3.6.4",
42
+ "@react-spectrum/utils": "^3.11.7",
43
+ "@react-stately/toggle": "^3.7.4",
44
+ "@react-types/shared": "^3.23.1",
45
+ "@react-types/switch": "^3.5.3",
46
46
  "@swc/helpers": "^0.5.0"
47
47
  },
48
48
  "devDependencies": {
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "de9f84a22583fc741c29b341d14cd35ef4cca161"
58
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
59
59
  }
package/dist/main.css.map DELETED
@@ -1 +0,0 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;;;;AAiBF;;;AAII;;;;;AAQF;;;;AAKE;;;;;AAOJ;;;;;;;;;;;AAgBA;;;;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAqBI;;;;AAGA;;;;AAKF;;;;AAAA;;;;AAOI;;;;AAON;;;;;;;;;AASA;;;;;;;;;;;;;;;;;AA6BE;;;;;;;AAQA;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAeA;;;;;;;;;;;;;;AA6BF;;;;;;;;;;;;;;;;;;;;AAuBA;;;;AAIE;;;;;AAMF;;;;AAOE;;;;AAEE;;;;AAWE;;;;;AAKF;;;;AAIA;;;;AAEE;;;;AAYA;;;;AAIF;;;;AAIA;;;;AAEE;;;;AAUJ;;;;AAEE;;;;AAIF;;;;AAKE;;;;AAEE;;;;AAIF;;;;AAWF;;;;AAEE;;;;AASF;;;;AAEE;;;;AASF;;;;AAEE;;;;AAYE;;;;AAGA;;;;AAMA;;;;AAEE;;;;AAaF;;;;AAEE;;;;AAUJ;;;;AAKE;;;;AAOA;;;;AAGE;;;;AAOF;;;;AAIA;;;;AAGE;;;;AASF;;;;AAEE;;;;AASF;;;;AAEE;;;;AAQR;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCE;;;;EAIE;;;;EAIF;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/toggle/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.css.map"}