@react-spectrum/switch 3.6.9 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/import.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.mjs";
1
+ import {Switch as $a8f9d00057624d86$re_export$Switch} from "@adobe/react-spectrum/Switch";
2
2
 
3
3
  /*
4
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -14,5 +14,5 @@ import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.mjs"
14
14
 
15
15
 
16
16
 
17
- export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
17
+ export {$a8f9d00057624d86$re_export$Switch as Switch};
18
18
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
- var $e216104aee091306$exports = require("./Switch.main.js");
1
+ var $1gsQi$adobereactspectrumSwitch = require("@adobe/react-spectrum/Switch");
2
2
 
3
3
 
4
4
  function $parcel$export(e, n, v, s) {
5
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
6
  }
7
7
 
8
- $parcel$export(module.exports, "Switch", () => $e216104aee091306$exports.Switch);
8
+ $parcel$export(module.exports, "Switch", function () { return $1gsQi$adobereactspectrumSwitch.Switch; });
9
9
  /*
10
10
  * Copyright 2020 Adobe. All rights reserved.
11
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/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"}
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 '@adobe/react-spectrum/Switch';\n\nexport type {SpectrumSwitchProps} from '@adobe/react-spectrum/Switch';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.module.js";
1
+ import {Switch as $a8f9d00057624d86$re_export$Switch} from "@adobe/react-spectrum/Switch";
2
2
 
3
3
  /*
4
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -14,5 +14,5 @@ import {Switch as $8341c396cee1c5fc$export$b5d5cf8927ab7262} from "./Switch.modu
14
14
 
15
15
 
16
16
 
17
- export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
17
+ export {$a8f9d00057624d86$re_export$Switch as Switch};
18
18
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
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"}
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 '@adobe/react-spectrum/Switch';\n\nexport type {SpectrumSwitchProps} from '@adobe/react-spectrum/Switch';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,2 @@
1
+ export { Switch } from '@adobe/react-spectrum/Switch';
2
+ export type { SpectrumSwitchProps } from '@adobe/react-spectrum/Switch';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/switch",
3
- "version": "3.6.9",
3
+ "version": "3.7.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,41 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/focus": "^3.21.5",
44
- "@react-aria/interactions": "^3.27.1",
45
- "@react-aria/switch": "^3.7.11",
46
- "@react-spectrum/utils": "^3.12.12",
47
- "@react-stately/toggle": "^3.9.5",
48
- "@react-types/shared": "^3.33.1",
49
- "@react-types/switch": "^3.5.17",
34
+ "@adobe/react-spectrum": "3.47.0",
50
35
  "@swc/helpers": "^0.5.0"
51
36
  },
52
- "devDependencies": {
53
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
54
- },
55
37
  "peerDependencies": {
56
- "@react-spectrum/provider": "^3.0.0",
57
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
58
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
59
40
  },
60
41
  "publishConfig": {
61
42
  "access": "public"
62
43
  },
63
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
64
45
  }
package/src/index.ts CHANGED
@@ -12,5 +12,6 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {Switch} from './Switch';
16
- export type {SpectrumSwitchProps} from '@react-types/switch';
15
+ export {Switch} from '@adobe/react-spectrum/Switch';
16
+
17
+ export type {SpectrumSwitchProps} from '@adobe/react-spectrum/Switch';
@@ -1,74 +0,0 @@
1
- require("./switch.c46cd780.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
- const $e216104aee091306$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $3aWe4$react.forwardRef)(function 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
-
74
- //# sourceMappingURL=Switch.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiBM,MAAM,0DAAS,CAAA,GAAA,uBAAS,EAAE,SAAS,OAAO,KAA0B,EAAE,GAAmC;IAC9G,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","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\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 */\nexport const Switch = forwardRef(function 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"],"names":[],"version":3,"file":"Switch.main.js.map"}
package/dist/Switch.mjs DELETED
@@ -1,69 +0,0 @@
1
- import "./switch.c46cd780.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, {forwardRef as $cEq2J$forwardRef, useRef as $cEq2J$useRef} 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
- const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $cEq2J$forwardRef)(function 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
-
68
- export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
69
- //# sourceMappingURL=Switch.module.js.map
@@ -1,69 +0,0 @@
1
- import "./switch.c46cd780.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, {forwardRef as $cEq2J$forwardRef, useRef as $cEq2J$useRef} 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
- const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $cEq2J$forwardRef)(function 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
-
68
- export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
69
- //# sourceMappingURL=Switch.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiBM,MAAM,0DAAS,CAAA,GAAA,iBAAS,EAAE,SAAS,OAAO,KAA0B,EAAE,GAAmC;IAC9G,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","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\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 */\nexport const Switch = forwardRef(function 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"],"names":[],"version":3,"file":"Switch.module.js.map"}
@@ -1,448 +0,0 @@
1
- .El90pa_i18nFontFamily {
2
- font-synthesis: weight;
3
- font-family: adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
4
- }
5
-
6
- .El90pa_i18nFontFamily:lang(ar) {
7
- font-family: myriad-arabic, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
8
- }
9
-
10
- .El90pa_i18nFontFamily:lang(he) {
11
- font-family: myriad-hebrew, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
12
- }
13
-
14
- .El90pa_i18nFontFamily:lang(zh) {
15
- font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
16
- }
17
-
18
- .El90pa_i18nFontFamily:lang(zh-Hans) {
19
- font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
20
- }
21
-
22
- .El90pa_i18nFontFamily:lang(zh-Hant) {
23
- font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
24
- }
25
-
26
- .El90pa_i18nFontFamily:lang(zh-SG), .El90pa_i18nFontFamily:lang(zh-CN) {
27
- font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
28
- }
29
-
30
- .El90pa_i18nFontFamily:lang(ko) {
31
- font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
32
- }
33
-
34
- .El90pa_i18nFontFamily:lang(ja) {
35
- font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
36
- }
37
-
38
- .El90pa_spectrum-FocusRing-ring {
39
- --spectrum-focus-ring-border-radius: var(--spectrum-textfield-border-radius, var(--spectrum-alias-border-radius-regular));
40
- --spectrum-focus-ring-gap: var(--spectrum-alias-input-focusring-gap);
41
- --spectrum-focus-ring-size: var(--spectrum-alias-input-focusring-size);
42
- --spectrum-focus-ring-border-size: 0px;
43
- --spectrum-focus-ring-color: var(--spectrum-high-contrast-focus-ring-color, var(--spectrum-alias-focus-ring-color, var(--spectrum-alias-focus-color)));
44
- }
45
-
46
- .El90pa_spectrum-FocusRing-ring:after {
47
- border-radius: calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));
48
- content: "";
49
- margin: calc(-1 * var(--spectrum-focus-ring-border-size));
50
- pointer-events: none;
51
- transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
52
- display: block;
53
- position: absolute;
54
- inset: 0;
55
- }
56
-
57
- .El90pa_spectrum-FocusRing.El90pa_focus-ring:after {
58
- margin: calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size));
59
- box-shadow: 0 0 0 var(--spectrum-focus-ring-size) var(--spectrum-focus-ring-color);
60
- }
61
-
62
- .El90pa_spectrum-FocusRing--quiet:after {
63
- border-radius: 0;
64
- }
65
-
66
- .El90pa_spectrum-FocusRing--quiet.El90pa_focus-ring:after {
67
- margin: 0 0 calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size)) 0;
68
- box-shadow: 0 var(--spectrum-focus-ring-size) 0 var(--spectrum-focus-ring-color);
69
- }
70
-
71
- @media (forced-colors: active) {
72
- .El90pa_spectrum-FocusRing, .El90pa_spectrum-FocusRing-ring, .El90pa_spectrum-FocusRing--quiet {
73
- --spectrum-high-contrast-focus-ring-color: Highlight;
74
- }
75
-
76
- :is(.El90pa_spectrum-FocusRing, .El90pa_spectrum-FocusRing-ring, .El90pa_spectrum-FocusRing--quiet):after {
77
- forced-color-adjust: none;
78
- }
79
- }
80
-
81
- .El90pa_spectrum-ToggleSwitch {
82
- min-block-size: var(--spectrum-switch-height, var(--spectrum-global-dimension-size-400));
83
- vertical-align: top;
84
- isolation: isolate;
85
- max-inline-size: 100%;
86
- align-items: flex-start;
87
- margin-inline-end: calc(var(--spectrum-switch-cursor-hit-x, var(--spectrum-global-dimension-size-100)) * 2);
88
- display: inline-flex;
89
- position: relative;
90
- }
91
-
92
- .El90pa_spectrum-ToggleSwitch-input {
93
- box-sizing: border-box;
94
- opacity: .0001;
95
- z-index: 1;
96
- touch-action: manipulation;
97
- cursor: default;
98
- block-size: 100%;
99
- inline-size: 100%;
100
- margin: 0;
101
- padding: 0;
102
- position: absolute;
103
- top: 0;
104
- }
105
-
106
- .El90pa_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))) {
107
- left: 0;
108
- }
109
-
110
- .El90pa_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))) {
111
- left: 0;
112
- }
113
-
114
- .El90pa_spectrum-ToggleSwitch-input:-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)) {
115
- right: 0;
116
- }
117
-
118
- .El90pa_spectrum-ToggleSwitch-input: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)) {
119
- right: 0;
120
- }
121
-
122
- [dir="ltr"] :is(.El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch):before {
123
- transform: translateX(calc(var(--spectrum-switch-track-width) - 100%));
124
- }
125
-
126
- [dir="rtl"] :is(.El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch):before {
127
- transform: translateX(calc(100% - var(--spectrum-switch-track-width)));
128
- }
129
-
130
- .El90pa_spectrum-ToggleSwitch-input:disabled, .El90pa_spectrum-ToggleSwitch-input[disabled] {
131
- cursor: default;
132
- }
133
-
134
- .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring + .El90pa_spectrum-ToggleSwitch-switch:after {
135
- margin: calc(var(--spectrum-alias-focus-ring-gap, var(--spectrum-global-dimension-static-size-25)) * -1);
136
- }
137
-
138
- .El90pa_spectrum-ToggleSwitch-label {
139
- text-align: start;
140
- margin: 0 var(--spectrum-switch-text-gap, var(--spectrum-global-dimension-size-125));
141
- font-size: var(--spectrum-switch-text-size, var(--spectrum-alias-font-size-default));
142
- transition: color var(--spectrum-global-animation-duration-200, .16s) ease-in-out;
143
- margin-block-start: var(--spectrum-global-dimension-size-65);
144
- line-height: 1.49;
145
- }
146
-
147
- .El90pa_spectrum-ToggleSwitch-switch {
148
- box-sizing: border-box;
149
- inline-size: var(--spectrum-switch-track-width);
150
- margin: calc((var(--spectrum-switch-height, var(--spectrum-global-dimension-size-400)) - var(--spectrum-switch-track-height, var(--spectrum-global-dimension-size-175))) / 2) 0;
151
- vertical-align: middle;
152
- will-change: transform;
153
- transition: background var(--spectrum-global-animation-duration-100, .13s) ease-in-out, border var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
154
- block-size: var(--spectrum-switch-track-height, var(--spectrum-global-dimension-size-175));
155
- border-radius: calc(var(--spectrum-switch-track-height, var(--spectrum-global-dimension-size-175)) / 2);
156
- flex-grow: 0;
157
- flex-shrink: 0;
158
- display: inline-block;
159
- position: relative;
160
- left: 0;
161
- right: 0;
162
- }
163
-
164
- .El90pa_spectrum-ToggleSwitch-switch:before {
165
- content: "";
166
- box-sizing: border-box;
167
- 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;
168
- inline-size: var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175));
169
- block-size: var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175));
170
- border-width: var(--spectrum-switch-handle-border-size, var(--spectrum-alias-border-size-thick));
171
- border-radius: calc(var(--spectrum-switch-handle-size, var(--spectrum-global-dimension-size-175)) / 2);
172
- border-style: solid;
173
- display: block;
174
- position: absolute;
175
- top: 0;
176
- }
177
-
178
- .El90pa_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 {
179
- left: 0;
180
- }
181
-
182
- .El90pa_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 {
183
- left: 0;
184
- }
185
-
186
- .El90pa_spectrum-ToggleSwitch-switch:-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 {
187
- right: 0;
188
- }
189
-
190
- .El90pa_spectrum-ToggleSwitch-switch: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 {
191
- right: 0;
192
- }
193
-
194
- .El90pa_spectrum-ToggleSwitch-switch:after {
195
- border-radius: calc(calc(var(--spectrum-switch-track-height, var(--spectrum-global-dimension-size-175)) / 2) + var(--spectrum-alias-focus-ring-gap, var(--spectrum-global-dimension-static-size-25)) * 2);
196
- content: "";
197
- transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
198
- margin: 0;
199
- display: block;
200
- position: absolute;
201
- inset: 0;
202
- transform: translateX(0);
203
- }
204
-
205
- .El90pa_spectrum-ToggleSwitch {
206
- --spectrum-switch-emphasized-handle-border-color: var(--spectrum-alias-toggle-color-default);
207
- --spectrum-switch-emphasized-handle-border-color-hover: var(--spectrum-alias-toggle-color-hover);
208
- --spectrum-switch-emphasized-handle-border-color-key-focus: var(--spectrum-alias-toggle-color-key-focus);
209
- --spectrum-switch-quiet-track-color-selected: var(--spectrum-alias-toggle-color-selected);
210
- --spectrum-switch-quiet-track-color-selected-hover: var(--spectrum-alias-toggle-color-selected-hover);
211
- --spectrum-switch-quiet-track-color-selected-key-focus: var(--spectrum-alias-toggle-color-selected-key-focus);
212
- --spectrum-switch-quiet-handle-border-color-selected: var(--spectrum-alias-toggle-color-selected);
213
- --spectrum-switch-quiet-handle-border-color-selected-hover: var(--spectrum-alias-toggle-color-selected-hover);
214
- --spectrum-switch-quiet-handle-border-color-selected-key-focus: var(--spectrum-alias-toggle-color-selected-key-focus);
215
- --spectrum-switch-emphasized-track-color-selected: var(--spectrum-accent-color-900);
216
- --spectrum-switch-emphasized-handle-border-color-selected: var(--spectrum-accent-color-900);
217
- --spectrum-switch-emphasized-track-color-selected-hover: var(--spectrum-accent-color-1000);
218
- --spectrum-switch-emphasized-handle-border-color-selected-hover: var(--spectrum-accent-color-1000);
219
- --spectrum-switch-emphasized-track-color-selected-key-focus: var(--spectrum-accent-color-1000);
220
- --spectrum-switch-emphasized-handle-border-color-selected-key-focus: var(--spectrum-accent-color-1000);
221
- --spectrum-switch-emphasized-track-color-selected-down: var(--spectrum-accent-color-1100);
222
- --spectrum-switch-emphasized-handle-border-color-selected-down: var(--spectrum-accent-color-1100);
223
- }
224
-
225
- .El90pa_spectrum-ToggleSwitch-switch {
226
- background-color: var(--spectrum-switch-emphasized-track-color, var(--spectrum-global-color-gray-300));
227
- }
228
-
229
- .El90pa_spectrum-ToggleSwitch-switch:before {
230
- background-color: var(--spectrum-switch-emphasized-handle-background-color, var(--spectrum-global-color-gray-75));
231
- border-color: var(--spectrum-switch-emphasized-handle-border-color, var(--spectrum-global-color-gray-600));
232
- }
233
-
234
- .El90pa_spectrum-ToggleSwitch-input ~ .El90pa_spectrum-ToggleSwitch-label {
235
- color: var(--spectrum-switch-emphasized-text-color, var(--spectrum-alias-text-color));
236
- }
237
-
238
- .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch {
239
- background-color: var(--spectrum-switch-emphasized-track-color-selected, var(--spectrum-global-color-blue-500));
240
- }
241
-
242
- .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
243
- border-color: var(--spectrum-switch-emphasized-handle-border-color-selected, var(--spectrum-global-color-blue-500));
244
- }
245
-
246
- .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input + .El90pa_spectrum-ToggleSwitch-switch:before {
247
- border-color: var(--spectrum-switch-emphasized-handle-border-color-hover, var(--spectrum-global-color-gray-700));
248
- box-shadow: none;
249
- }
250
-
251
- .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input ~ .El90pa_spectrum-ToggleSwitch-label {
252
- color: var(--spectrum-switch-emphasized-text-color-hover, var(--spectrum-alias-text-color-hover));
253
- }
254
-
255
- .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
256
- background-color: var(--spectrum-switch-emphasized-track-color-selected-hover, var(--spectrum-global-color-blue-600));
257
- }
258
-
259
- .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
260
- border-color: var(--spectrum-switch-emphasized-handle-border-color-selected-hover, var(--spectrum-global-color-blue-600));
261
- }
262
-
263
- .El90pa_spectrum-ToggleSwitch:active .El90pa_spectrum-ToggleSwitch-input + .El90pa_spectrum-ToggleSwitch-switch:before {
264
- border-color: var(--spectrum-switch-emphasized-handle-border-color-down, var(--spectrum-global-color-gray-800));
265
- }
266
-
267
- .El90pa_spectrum-ToggleSwitch:active .El90pa_spectrum-ToggleSwitch-input ~ .El90pa_spectrum-ToggleSwitch-label {
268
- color: var(--spectrum-switch-emphasized-text-color-down, var(--spectrum-alias-text-color-down));
269
- }
270
-
271
- .El90pa_spectrum-ToggleSwitch:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
272
- background-color: var(--spectrum-switch-emphasized-track-color-selected-down, var(--spectrum-global-color-blue-700));
273
- }
274
-
275
- .El90pa_spectrum-ToggleSwitch:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
276
- border-color: var(--spectrum-switch-emphasized-handle-border-color-selected-down, var(--spectrum-global-color-blue-700));
277
- }
278
-
279
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled + .El90pa_spectrum-ToggleSwitch-switch {
280
- background-color: var(--spectrum-switch-emphasized-track-color-disabled, var(--spectrum-global-color-gray-300));
281
- }
282
-
283
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled + .El90pa_spectrum-ToggleSwitch-switch:before {
284
- border-color: var(--spectrum-switch-emphasized-handle-border-color-disabled, var(--spectrum-global-color-gray-400));
285
- }
286
-
287
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled ~ .El90pa_spectrum-ToggleSwitch-label {
288
- color: var(--spectrum-switch-emphasized-text-color-disabled, var(--spectrum-alias-text-color-disabled));
289
- }
290
-
291
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled:checked + .El90pa_spectrum-ToggleSwitch-switch {
292
- background-color: var(--spectrum-switch-emphasized-track-color-selected-disabled, var(--spectrum-global-color-gray-400));
293
- }
294
-
295
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
296
- border-color: var(--spectrum-switch-emphasized-handle-border-color-selected-disabled, var(--spectrum-global-color-gray-400));
297
- }
298
-
299
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled:checked ~ .El90pa_spectrum-ToggleSwitch-label {
300
- color: var(--spectrum-switch-emphasized-text-color-selected-disabled, var(--spectrum-alias-text-color-disabled));
301
- }
302
-
303
- .El90pa_spectrum-ToggleSwitch--quiet .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch {
304
- background-color: var(--spectrum-switch-quiet-track-color-selected, var(--spectrum-global-color-gray-700));
305
- }
306
-
307
- .El90pa_spectrum-ToggleSwitch--quiet .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
308
- border-color: var(--spectrum-switch-quiet-handle-border-color-selected, var(--spectrum-global-color-gray-700));
309
- }
310
-
311
- .El90pa_spectrum-ToggleSwitch--quiet.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
312
- background-color: var(--spectrum-switch-quiet-track-color-selected-hover, var(--spectrum-global-color-gray-800));
313
- }
314
-
315
- .El90pa_spectrum-ToggleSwitch--quiet.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
316
- border-color: var(--spectrum-switch-quiet-handle-border-color-selected-hover, var(--spectrum-global-color-gray-800));
317
- }
318
-
319
- .El90pa_spectrum-ToggleSwitch.El90pa_spectrum-ToggleSwitch--quiet:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
320
- background-color: var(--spectrum-switch-quiet-track-color-selected-down, var(--spectrum-global-color-gray-900));
321
- }
322
-
323
- .El90pa_spectrum-ToggleSwitch.El90pa_spectrum-ToggleSwitch--quiet:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
324
- border-color: var(--spectrum-switch-quiet-handle-border-color-selected-down, var(--spectrum-global-color-gray-900));
325
- }
326
-
327
- :is(.El90pa_spectrum-ToggleSwitch, .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring + .El90pa_spectrum-ToggleSwitch-switch:after {
328
- box-shadow: 0 0 0 var(--spectrum-switch-focus-ring-size-key-focus, var(--spectrum-alias-focus-ring-size)) var(--spectrum-switch-focus-ring-color-key-focus, var(--spectrum-alias-focus-ring-color));
329
- }
330
-
331
- :is(.El90pa_spectrum-ToggleSwitch, .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring + .El90pa_spectrum-ToggleSwitch-switch:before {
332
- border-color: var(--spectrum-switch-emphasized-handle-border-color-key-focus, var(--spectrum-global-color-gray-700));
333
- }
334
-
335
- :is(.El90pa_spectrum-ToggleSwitch, .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch {
336
- background-color: var(--spectrum-switch-emphasized-track-color-selected-key-focus, var(--spectrum-global-color-blue-600));
337
- }
338
-
339
- :is(.El90pa_spectrum-ToggleSwitch, .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
340
- border-color: var(--spectrum-switch-emphasized-handle-border-color-selected-key-focus, var(--spectrum-global-color-blue-600));
341
- }
342
-
343
- :is(.El90pa_spectrum-ToggleSwitch--quiet, .El90pa_spectrum-ToggleSwitch--quiet.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch {
344
- background-color: var(--spectrum-switch-quiet-track-color-selected-key-focus, var(--spectrum-global-color-gray-800));
345
- }
346
-
347
- :is(.El90pa_spectrum-ToggleSwitch--quiet, .El90pa_spectrum-ToggleSwitch--quiet.El90pa_is-hovered) .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
348
- border-color: var(--spectrum-switch-quiet-handle-border-color-selected-key-focus, var(--spectrum-global-color-gray-800));
349
- }
350
-
351
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch {
352
- background-color: var(--spectrum-switch-track-color, var(--spectrum-global-color-gray-300));
353
- }
354
-
355
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
356
- border-color: var(--spectrum-switch-handle-border-color, var(--spectrum-global-color-gray-600));
357
- }
358
-
359
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch {
360
- background-color: var(--spectrum-switch-track-color, var(--spectrum-global-color-gray-300));
361
- }
362
-
363
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input.El90pa_focus-ring:checked + .El90pa_spectrum-ToggleSwitch-switch:before {
364
- border-color: var(--spectrum-switch-handle-border-color-selected, var(--spectrum-global-color-gray-700));
365
- }
366
-
367
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input:disabled:checked + .El90pa_spectrum-ToggleSwitch-switch, .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input:disabled + .El90pa_spectrum-ToggleSwitch-switch {
368
- background-color: var(--spectrum-switch-emphasized-track-color-disabled, var(--spectrum-global-color-gray-300));
369
- }
370
-
371
- .El90pa_spectrum-ToggleSwitch--ab .El90pa_spectrum-ToggleSwitch-input:disabled + .El90pa_spectrum-ToggleSwitch-switch:before {
372
- border-color: var(--spectrum-switch-emphasized-handle-border-color-disabled, var(--spectrum-global-color-gray-400));
373
- }
374
-
375
- .El90pa_spectrum-ToggleSwitch--ab.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
376
- background-color: var(--spectrum-switch-emphasized-track-color, var(--spectrum-global-color-gray-300));
377
- }
378
-
379
- .El90pa_spectrum-ToggleSwitch--ab.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
380
- border-color: var(--spectrum-switch-emphasized-handle-border-color-hover, var(--spectrum-global-color-gray-700));
381
- }
382
-
383
- .El90pa_spectrum-ToggleSwitch--ab:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch {
384
- background-color: var(--spectrum-switch-emphasized-track-color, var(--spectrum-global-color-gray-300));
385
- }
386
-
387
- .El90pa_spectrum-ToggleSwitch--ab:active .El90pa_spectrum-ToggleSwitch-input:checked:enabled + .El90pa_spectrum-ToggleSwitch-switch:before {
388
- border-color: var(--spectrum-switch-emphasized-handle-border-color-down, var(--spectrum-global-color-gray-800));
389
- }
390
-
391
- @media (forced-colors: active) {
392
- .El90pa_spectrum-ToggleSwitch {
393
- forced-color-adjust: none;
394
- --spectrum-switch-emphasized-handle-background-color: ButtonFace;
395
- --spectrum-switch-emphasized-handle-border-color: ButtonText;
396
- --spectrum-switch-emphasized-handle-border-color-disabled: GrayText;
397
- --spectrum-switch-emphasized-handle-border-color-down: Highlight;
398
- --spectrum-switch-emphasized-handle-border-color-hover: Highlight;
399
- --spectrum-switch-emphasized-handle-border-color-key-focus: Highlight;
400
- --spectrum-switch-emphasized-handle-border-color-selected: Highlight;
401
- --spectrum-switch-emphasized-handle-border-color-selected-disabled: GrayText;
402
- --spectrum-switch-emphasized-handle-border-color-selected-down: Highlight;
403
- --spectrum-switch-emphasized-handle-border-color-selected-hover: Highlight;
404
- --spectrum-switch-emphasized-handle-border-color-selected-key-focus: Highlight;
405
- --spectrum-switch-emphasized-text-color: CanvasText;
406
- --spectrum-switch-emphasized-text-color-disabled: GrayText;
407
- --spectrum-switch-emphasized-text-color-down: CanvasText;
408
- --spectrum-switch-emphasized-text-color-hover: CanvasText;
409
- --spectrum-switch-emphasized-text-color-selected-disabled: GrayText;
410
- --spectrum-switch-emphasized-track-color: ButtonFace;
411
- --spectrum-switch-emphasized-track-color-disabled: ButtonFace;
412
- --spectrum-switch-emphasized-track-color-selected: Highlight;
413
- --spectrum-switch-emphasized-track-color-selected-disabled: GrayText;
414
- --spectrum-switch-emphasized-track-color-selected-down: Highlight;
415
- --spectrum-switch-emphasized-track-color-selected-hover: Highlight;
416
- --spectrum-switch-emphasized-track-color-selected-key-focus: Highlight;
417
- --spectrum-switch-focus-ring-color-key-focus: ButtonText;
418
- --spectrum-switch-handle-border-color: ButtonText;
419
- --spectrum-switch-handle-border-color-selected: Highlight;
420
- --spectrum-switch-quiet-handle-border-color-selected: Highlight;
421
- --spectrum-switch-quiet-handle-border-color-selected-down: Highlight;
422
- --spectrum-switch-quiet-handle-border-color-selected-hover: Highlight;
423
- --spectrum-switch-quiet-handle-border-color-selected-key-focus: Highlight;
424
- --spectrum-switch-quiet-track-color-selected: Highlight;
425
- --spectrum-switch-quiet-track-color-selected-down: Highlight;
426
- --spectrum-switch-quiet-track-color-selected-hover: Highlight;
427
- --spectrum-switch-quiet-track-color-selected-key-focus: Highlight;
428
- --spectrum-switch-track-color: ButtonFace;
429
- --spectrum-switch-track-color-disabled: ButtonFace;
430
- }
431
-
432
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:not(:checked) + .El90pa_spectrum-ToggleSwitch-switch {
433
- box-shadow: inset 0 0 0 1px var(--spectrum-switch-handle-border-color, var(--spectrum-global-color-gray-600));
434
- }
435
-
436
- .El90pa_spectrum-ToggleSwitch.El90pa_is-hovered .El90pa_spectrum-ToggleSwitch-input:not(:checked) + .El90pa_spectrum-ToggleSwitch-switch {
437
- box-shadow: inset 0 0 0 1px var(--spectrum-switch-emphasized-handle-border-color-hover, var(--spectrum-global-color-gray-700));
438
- }
439
-
440
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:not(:checked):focus + .El90pa_spectrum-ToggleSwitch-switch {
441
- box-shadow: inset 0 0 0 1px var(--spectrum-switch-emphasized-handle-border-color-key-focus, var(--spectrum-global-color-gray-700));
442
- }
443
-
444
- .El90pa_spectrum-ToggleSwitch .El90pa_spectrum-ToggleSwitch-input:disabled + .El90pa_spectrum-ToggleSwitch-switch {
445
- box-shadow: inset 0 0 0 1px var(--spectrum-switch-emphasized-handle-border-color-disabled, var(--spectrum-global-color-gray-400));
446
- }
447
- }
448
- /*# sourceMappingURL=switch.c46cd780.css.map */
@@ -1 +0,0 @@
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;;;;AAuBI;;;;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":"switch.c46cd780.css.map"}
@@ -1,44 +0,0 @@
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 = `El90pa_focus-ring`;
31
- $faeb9d1b92049ba7$export$8c4ee2c50c22c514 = `El90pa_i18nFontFamily`;
32
- $faeb9d1b92049ba7$export$b8813cd5d7824ce7 = `El90pa_is-hovered`;
33
- $faeb9d1b92049ba7$export$4109102f950813a6 = `El90pa_spectrum-FocusRing-ring`;
34
- $faeb9d1b92049ba7$export$24c7f46a6e3605dd = `El90pa_spectrum-FocusRing ${$faeb9d1b92049ba7$export$4109102f950813a6}`;
35
- $faeb9d1b92049ba7$export$2927016961429360 = `El90pa_spectrum-FocusRing--quiet`;
36
- $faeb9d1b92049ba7$export$89a9162656c0c38c = `El90pa_spectrum-ToggleSwitch`;
37
- $faeb9d1b92049ba7$export$dc5a33fddabf5882 = `El90pa_spectrum-ToggleSwitch--ab`;
38
- $faeb9d1b92049ba7$export$ce1b1dcfc10f3df4 = `El90pa_spectrum-ToggleSwitch--quiet`;
39
- $faeb9d1b92049ba7$export$38df7ea4ffef819a = `El90pa_spectrum-ToggleSwitch-input`;
40
- $faeb9d1b92049ba7$export$8f1a69021a3897b2 = `El90pa_spectrum-ToggleSwitch-label`;
41
- $faeb9d1b92049ba7$export$b82d06d1b520a22f = `El90pa_spectrum-ToggleSwitch-switch`;
42
-
43
-
44
- //# sourceMappingURL=toggle_vars_css.main.js.map
@@ -1 +0,0 @@
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,2CAA2C;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"}
@@ -1,46 +0,0 @@
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 = `El90pa_focus-ring`;
32
- $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `El90pa_i18nFontFamily`;
33
- $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `El90pa_is-hovered`;
34
- $dfcff93ab25bb9b3$export$4109102f950813a6 = `El90pa_spectrum-FocusRing-ring`;
35
- $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `El90pa_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
36
- $dfcff93ab25bb9b3$export$2927016961429360 = `El90pa_spectrum-FocusRing--quiet`;
37
- $dfcff93ab25bb9b3$export$89a9162656c0c38c = `El90pa_spectrum-ToggleSwitch`;
38
- $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `El90pa_spectrum-ToggleSwitch--ab`;
39
- $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `El90pa_spectrum-ToggleSwitch--quiet`;
40
- $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `El90pa_spectrum-ToggleSwitch-input`;
41
- $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `El90pa_spectrum-ToggleSwitch-label`;
42
- $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `El90pa_spectrum-ToggleSwitch-switch`;
43
-
44
-
45
- export {$dfcff93ab25bb9b3$exports as default};
46
- //# sourceMappingURL=toggle_vars_css.module.js.map
@@ -1,46 +0,0 @@
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 = `El90pa_focus-ring`;
32
- $dfcff93ab25bb9b3$export$8c4ee2c50c22c514 = `El90pa_i18nFontFamily`;
33
- $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = `El90pa_is-hovered`;
34
- $dfcff93ab25bb9b3$export$4109102f950813a6 = `El90pa_spectrum-FocusRing-ring`;
35
- $dfcff93ab25bb9b3$export$24c7f46a6e3605dd = `El90pa_spectrum-FocusRing ${$dfcff93ab25bb9b3$export$4109102f950813a6}`;
36
- $dfcff93ab25bb9b3$export$2927016961429360 = `El90pa_spectrum-FocusRing--quiet`;
37
- $dfcff93ab25bb9b3$export$89a9162656c0c38c = `El90pa_spectrum-ToggleSwitch`;
38
- $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = `El90pa_spectrum-ToggleSwitch--ab`;
39
- $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = `El90pa_spectrum-ToggleSwitch--quiet`;
40
- $dfcff93ab25bb9b3$export$38df7ea4ffef819a = `El90pa_spectrum-ToggleSwitch-input`;
41
- $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = `El90pa_spectrum-ToggleSwitch-label`;
42
- $dfcff93ab25bb9b3$export$b82d06d1b520a22f = `El90pa_spectrum-ToggleSwitch-switch`;
43
-
44
-
45
- export {$dfcff93ab25bb9b3$exports as default};
46
- //# sourceMappingURL=toggle_vars_css.module.js.map
@@ -1 +0,0 @@
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,2CAA2C;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 DELETED
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { SpectrumSwitchProps } from "@react-types/switch";
3
- import { FocusableRefValue } from "@react-types/shared";
4
- /**
5
- * Switches allow users to turn an individual option on or off.
6
- * They are usually used to activate or deactivate a specific setting.
7
- */
8
- export const Switch: React.ForwardRefExoticComponent<SpectrumSwitchProps & React.RefAttributes<FocusableRefValue<HTMLLabelElement, HTMLLabelElement>>>;
9
- export type { SpectrumSwitchProps } from '@react-types/switch';
10
-
11
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AAuBA;;;GAGG;AACH,OAAO,MAAM,yIAiDX,CAAC;AC7DH,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"}
package/src/Switch.tsx DELETED
@@ -1,77 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';
14
- import {FocusableRef} from '@react-types/shared';
15
- import {FocusRing} from '@react-aria/focus';
16
- import React, {forwardRef, useRef} from 'react';
17
- import {SpectrumSwitchProps} from '@react-types/switch';
18
- import styles from '@adobe/spectrum-css-temp/components/toggle/vars.css';
19
- import {useHover} from '@react-aria/interactions';
20
- import {useProviderProps} from '@react-spectrum/provider';
21
- import {useSwitch} from '@react-aria/switch';
22
- import {useToggleState} from '@react-stately/toggle';
23
-
24
- /**
25
- * Switches allow users to turn an individual option on or off.
26
- * They are usually used to activate or deactivate a specific setting.
27
- */
28
- export const Switch = forwardRef(function Switch(props: SpectrumSwitchProps, ref: FocusableRef<HTMLLabelElement>) {
29
- props = useProviderProps(props);
30
- let {
31
- isEmphasized = false,
32
- isDisabled = false,
33
- autoFocus,
34
- children,
35
- ...otherProps
36
- } = props;
37
- let {styleProps} = useStyleProps(otherProps);
38
- let {hoverProps, isHovered} = useHover({isDisabled});
39
-
40
- let inputRef = useRef<HTMLInputElement>(null);
41
- let domRef = useFocusableRef(ref, inputRef);
42
- let state = useToggleState(props);
43
- let {inputProps} = useSwitch(props, state, inputRef);
44
-
45
-
46
- return (
47
- <label
48
- {...styleProps}
49
- {...hoverProps}
50
- ref={domRef}
51
- className={
52
- classNames(
53
- styles,
54
- 'spectrum-ToggleSwitch',
55
- {
56
- 'spectrum-ToggleSwitch--quiet': !isEmphasized,
57
- 'is-disabled': isDisabled,
58
- 'is-hovered': isHovered
59
- },
60
- styleProps.className
61
- )
62
- }>
63
- <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>
64
- <input
65
- {...inputProps}
66
- ref={inputRef}
67
- className={classNames(styles, 'spectrum-ToggleSwitch-input')} />
68
- </FocusRing>
69
- <span className={classNames(styles, 'spectrum-ToggleSwitch-switch')} />
70
- {children && (
71
- <span className={classNames(styles, 'spectrum-ToggleSwitch-label')}>
72
- {children}
73
- </span>
74
- )}
75
- </label>
76
- );
77
- });