@spectrum-web-components/switch 0.9.11 → 0.9.14-devmode.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/switch",
3
- "version": "0.9.11",
3
+ "version": "0.9.14-devmode.0+07474d44f",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,25 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-switch": "./sp-switch.js",
27
- "./sp-switch.js": "./sp-switch.js"
28
+ "./src/Switch.js": {
29
+ "development": "./src/Switch.dev.js",
30
+ "default": "./src/Switch.js"
31
+ },
32
+ "./src/index.js": {
33
+ "development": "./src/index.dev.js",
34
+ "default": "./src/index.js"
35
+ },
36
+ "./src/switch-legacy.css.js": "./src/switch-legacy.css.js",
37
+ "./src/switch.css.js": "./src/switch.css.js",
38
+ "./sp-switch.js": {
39
+ "development": "./sp-switch.dev.js",
40
+ "default": "./sp-switch.js"
41
+ }
28
42
  },
29
43
  "scripts": {
30
44
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -44,17 +58,17 @@
44
58
  "lit-html"
45
59
  ],
46
60
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.7",
48
- "@spectrum-web-components/checkbox": "^0.13.3",
61
+ "@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
62
+ "@spectrum-web-components/checkbox": "^0.13.6-devmode.0+07474d44f",
49
63
  "tslib": "^2.0.0"
50
64
  },
51
65
  "devDependencies": {
52
- "@spectrum-css/switch": "^1.0.21"
66
+ "@spectrum-css/switch": "^1.0.23"
53
67
  },
54
68
  "types": "./src/index.d.ts",
55
69
  "customElements": "custom-elements.json",
56
70
  "sideEffects": [
57
71
  "./sp-*.js"
58
72
  ],
59
- "gitHead": "275ee61b152ac3eed0cd1603d8eab2aec90876a0"
73
+ "gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
60
74
  }
@@ -0,0 +1,3 @@
1
+ import { Switch } from "./src/Switch.dev.js";
2
+ customElements.define("sp-switch", Switch);
3
+ //# sourceMappingURL=sp-switch.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-switch.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Switch } from './src/Switch.dev.js'\n\ncustomElements.define('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
package/sp-switch.js CHANGED
@@ -1,14 +1,3 @@
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
- import { Switch } from './src/Switch.js';
13
- customElements.define('sp-switch', Switch);
14
- //# sourceMappingURL=sp-switch.js.map
1
+ import { Switch } from "./src/Switch.js";
2
+ customElements.define("sp-switch", Switch);
3
+ //# sourceMappingURL=sp-switch.js.map
package/sp-switch.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-switch.js","sourceRoot":"","sources":["sp-switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Switch } from './src/Switch.js';\n\ncustomElements.define('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-switch.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Switch } from './src/Switch.js';\n\ncustomElements.define('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
@@ -0,0 +1,50 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html
14
+ } from "@spectrum-web-components/base";
15
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
16
+ import { CheckboxBase } from "@spectrum-web-components/checkbox/src/CheckboxBase.js";
17
+ import switchStyles from "./switch.css.js";
18
+ import legacyStyles from "./switch-legacy.css.js";
19
+ export class Switch extends CheckboxBase {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.emphasized = false;
23
+ }
24
+ static get styles() {
25
+ if (window.hasOwnProperty("ShadyDOM")) {
26
+ return [switchStyles, legacyStyles];
27
+ }
28
+ return [switchStyles];
29
+ }
30
+ render() {
31
+ return html`
32
+ ${super.render()}
33
+ <span id="switch"></span>
34
+ <label id="label" for="input"><slot></slot></label>
35
+ `;
36
+ }
37
+ firstUpdated(changes) {
38
+ super.firstUpdated(changes);
39
+ this.inputElement.setAttribute("role", "switch");
40
+ }
41
+ updated(changes) {
42
+ if (changes.has("checked")) {
43
+ this.inputElement.setAttribute("aria-checked", this.checked ? "true" : "false");
44
+ }
45
+ }
46
+ }
47
+ __decorateClass([
48
+ property({ type: Boolean, reflect: true })
49
+ ], Switch.prototype, "emphasized", 2);
50
+ //# sourceMappingURL=Switch.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Switch.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends CheckboxBase {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAOO,aAAM,eAAe,aAAa;AAAA,EAAlC;AAAA;AAWI,sBAAa;AAAA;AAAA,aAVO,SAAyB;AAEhD,QAAI,OAAO,eAAe,UAAU,GAAG;AAEnC,aAAO,CAAC,cAAc,YAAY;AAAA,IACtC;AACA,WAAO,CAAC,YAAY;AAAA,EACxB;AAAA,EAKmB,SAAyB;AACxC,WAAO;AAAA,cACD,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA,EAIvB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACnD;AAAA,EAEmB,QAAQ,SAA+B;AACtD,QAAI,QAAQ,IAAI,SAAS,GAAG;AACxB,WAAK,aAAa,aACd,gBACA,KAAK,UAAU,SAAS,OAC5B;AAAA,IACJ;AAAA,EACJ;AACJ;AAvBW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAXJ,OAWI;",
6
+ "names": []
7
+ }
package/src/Switch.js CHANGED
@@ -1,56 +1,50 @@
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
- import { __decorate } from "tslib";
13
- import { html, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';
16
- import switchStyles from './switch.css.js';
17
- import legacyStyles from './switch-legacy.css.js';
18
- /**
19
- * @element sp-switch
20
- *
21
- * @slot - text label of the Switch
22
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html
14
+ } from "@spectrum-web-components/base";
15
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
16
+ import { CheckboxBase } from "@spectrum-web-components/checkbox/src/CheckboxBase.js";
17
+ import switchStyles from "./switch.css.js";
18
+ import legacyStyles from "./switch-legacy.css.js";
23
19
  export class Switch extends CheckboxBase {
24
- constructor() {
25
- super(...arguments);
26
- this.emphasized = false;
20
+ constructor() {
21
+ super(...arguments);
22
+ this.emphasized = false;
23
+ }
24
+ static get styles() {
25
+ if (window.hasOwnProperty("ShadyDOM")) {
26
+ return [switchStyles, legacyStyles];
27
27
  }
28
- static get styles() {
29
- /* c8 ignore next 4 */
30
- if (window.hasOwnProperty('ShadyDOM')) {
31
- // Override some styles if we are using the web component polyfill
32
- return [switchStyles, legacyStyles];
33
- }
34
- return [switchStyles];
35
- }
36
- render() {
37
- return html `
28
+ return [switchStyles];
29
+ }
30
+ render() {
31
+ return html`
38
32
  ${super.render()}
39
33
  <span id="switch"></span>
40
34
  <label id="label" for="input"><slot></slot></label>
41
35
  `;
36
+ }
37
+ firstUpdated(changes) {
38
+ super.firstUpdated(changes);
39
+ this.inputElement.setAttribute("role", "switch");
40
+ }
41
+ updated(changes) {
42
+ if (changes.has("checked")) {
43
+ this.inputElement.setAttribute("aria-checked", this.checked ? "true" : "false");
42
44
  }
43
- firstUpdated(changes) {
44
- super.firstUpdated(changes);
45
- this.inputElement.setAttribute('role', 'switch');
46
- }
47
- updated(changes) {
48
- if (changes.has('checked')) {
49
- this.inputElement.setAttribute('aria-checked', this.checked ? 'true' : 'false');
50
- }
51
- }
45
+ }
52
46
  }
53
- __decorate([
54
- property({ type: Boolean, reflect: true })
55
- ], Switch.prototype, "emphasized", void 0);
56
- //# sourceMappingURL=Switch.js.map
47
+ __decorateClass([
48
+ property({ type: Boolean, reflect: true })
49
+ ], Switch.prototype, "emphasized", 2);
50
+ //# sourceMappingURL=Switch.js.map
package/src/Switch.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"","sources":["Switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IAAxC;;QAWW,eAAU,GAAG,KAAK,CAAC;IAuB9B,CAAC;IAjCU,MAAM,KAAc,MAAM;QAC7B,sBAAsB;QACtB,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACnC,kEAAkE;YAClE,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SACvC;QACD,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IAKkB,MAAM;QACrB,OAAO,IAAI,CAAA;cACL,KAAK,CAAC,MAAM,EAAE;;;SAGnB,CAAC;IACN,CAAC;IAEkB,YAAY,CAAC,OAAuB;QACnD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAEkB,OAAO,CAAC,OAAuB;QAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,YAAY,CAC1B,cAAc,EACd,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAClC,CAAC;SACL;IACL,CAAC;CACJ;AAvBG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends CheckboxBase {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["Switch.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from '@spectrum-web-components/checkbox/src/CheckboxBase.js';\nimport switchStyles from './switch.css.js';\nimport legacyStyles from './switch-legacy.css.js';\n\n/**\n * @element sp-switch\n *\n * @slot - text label of the Switch\n */\nexport class Switch extends CheckboxBase {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (window.hasOwnProperty('ShadyDOM')) {\n // Override some styles if we are using the web component polyfill\n return [switchStyles, legacyStyles];\n }\n return [switchStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"switch\"></span>\n <label id=\"label\" for=\"input\"><slot></slot></label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.inputElement.setAttribute('role', 'switch');\n }\n\n protected override updated(changes: PropertyValues): void {\n if (changes.has('checked')) {\n this.inputElement.setAttribute(\n 'aria-checked',\n this.checked ? 'true' : 'false'\n );\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAOO,aAAM,eAAe,aAAa;AAAA,EAAlC;AAAA;AAWI,sBAAa;AAAA;AAAA,aAVO,SAAyB;AAEhD,QAAI,OAAO,eAAe,UAAU,GAAG;AAEnC,aAAO,CAAC,cAAc,YAAY;AAAA,IACtC;AACA,WAAO,CAAC,YAAY;AAAA,EACxB;AAAA,EAKmB,SAAyB;AACxC,WAAO;AAAA,cACD,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA,EAIvB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACnD;AAAA,EAEmB,QAAQ,SAA+B;AACtD,QAAI,QAAQ,IAAI,SAAS,GAAG;AACxB,WAAK,aAAa,aACd,gBACA,KAAK,UAAU,SAAS,OAC5B;AAAA,IACJ;AAAA,EACJ;AACJ;AAvBW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAXJ,OAWI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Switch.dev.js";
2
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Switch.dev.js'\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,13 +1,2 @@
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
- export * from './Switch.js';
13
- //# sourceMappingURL=index.js.map
1
+ export * from "./Switch.js";
2
+ //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,aAAa,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Switch.js';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Switch.js';\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,135 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{--spectrum-switch-handle-size:var(
4
+ --spectrum-switch-m-handle-size,var(--spectrum-alias-control-two-size-m)
5
+ );--spectrum-switch-handle-border-size:var(
6
+ --spectrum-switch-m-handle-border-size,var(--spectrum-alias-border-size-thick)
7
+ );--spectrum-switch-handle-border-radius:var(
8
+ --spectrum-switch-m-handle-border-radius,var(--spectrum-alias-control-two-border-radius-m)
9
+ );--spectrum-switch-text-gap:var(
10
+ --spectrum-switch-m-text-gap,var(--spectrum-global-dimension-size-125)
11
+ );--spectrum-switch-text-size:var(
12
+ --spectrum-switch-m-text-size,var(--spectrum-global-dimension-font-size-100)
13
+ );--spectrum-switch-track-height:var(
14
+ --spectrum-switch-m-track-height,var(--spectrum-alias-control-three-height-m)
15
+ );--spectrum-switch-track-width:var(
16
+ --spectrum-switch-m-track-width,var(--spectrum-alias-control-three-width-m)
17
+ );--spectrum-switch-cursor-hit-x:var(
18
+ --spectrum-switch-m-cursor-hit-x,var(--spectrum-global-dimension-size-100)
19
+ );--spectrum-switch-height:var(
20
+ --spectrum-switch-m-height,var(--spectrum-global-dimension-size-400)
21
+ );--spectrum-switch-label-margin-top:var(
22
+ --spectrum-global-dimension-size-65
23
+ );--spectrum-switch-label-line-height:1.49}:host([dir=ltr]){margin-right:calc(var(--spectrum-switch-cursor-hit-x)*2)}:host([dir=rtl]){margin-left:calc(var(--spectrum-switch-cursor-hit-x)*2)}:host{align-items:flex-start;display:inline-flex;max-width:100%;min-height:var(--spectrum-switch-height);position:relative;vertical-align:top}:host([dir=ltr]) #input{left:0}:host([dir=rtl]) #input{right:0}#input{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;padding:0;position:absolute;top:0;width:100%;z-index:1}:host([dir=ltr][checked]) #input+#switch:before{transform:translateX(calc(var(--spectrum-switch-track-width) - 100%))}:host([dir=rtl][checked]) #input+#switch:before{transform:translateX(calc((var(--spectrum-switch-track-width) - 100%)*-1))}#input[disabled],:host([disabled]) #input{cursor:default}#input.focus-visible+#switch:after{margin:calc(var(
24
+ --spectrum-alias-focus-ring-gap,
25
+ var(--spectrum-global-dimension-static-size-25)
26
+ )*-1)}#input:focus-visible+#switch:after{margin:calc(var(
27
+ --spectrum-alias-focus-ring-gap,
28
+ var(--spectrum-global-dimension-static-size-25)
29
+ )*-1)}#label{font-size:var(--spectrum-switch-text-size);line-height:var(--spectrum-switch-label-line-height);margin-bottom:0;margin-left:var(--spectrum-switch-text-gap);margin-right:var(--spectrum-switch-text-gap);margin-top:var(--spectrum-switch-label-margin-top);transition:color var(--spectrum-global-animation-duration-200,.16s) ease-in-out}:host([dir=ltr]) #switch{left:0}:host([dir=rtl]) #switch{right:0}:host([dir=ltr]) #switch{right:0}:host([dir=rtl]) #switch{left:0}#switch{border-radius:calc(var(--spectrum-switch-track-height)/2);box-sizing:border-box;display:inline-block;flex-grow:0;flex-shrink:0;height:var(--spectrum-switch-track-height);margin-bottom:calc((var(--spectrum-switch-height) - var(--spectrum-switch-track-height))/2);margin-left:0;margin-right:0;margin-top:calc((var(--spectrum-switch-height) - var(--spectrum-switch-track-height))/2);position:relative;transition:background var(--spectrum-global-animation-duration-100,.13s) ease-in-out,border var(--spectrum-global-animation-duration-100,.13s) ease-in-out;vertical-align:middle;width:var(--spectrum-switch-track-width)}#switch:before{box-sizing:border-box;content:"";display:block;position:absolute}:host([dir=ltr]) #switch:before{left:0}:host([dir=rtl]) #switch:before{right:0}#switch:before{border-radius:var(--spectrum-switch-handle-border-radius);border-style:solid;border-width:var(--spectrum-switch-handle-border-size);height:var(--spectrum-switch-handle-size);top:0;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;width:var(--spectrum-switch-handle-size)}:host([dir=ltr]) #switch:after{left:0}:host([dir=rtl]) #switch:after{right:0}:host([dir=ltr]) #switch:after{right:0}:host([dir=rtl]) #switch:after{left:0}#switch:after{border-radius:calc(var(--spectrum-switch-track-height) + var(
30
+ --spectrum-alias-focus-ring-gap,
31
+ var(--spectrum-global-dimension-static-size-25)
32
+ ));bottom:0;content:"";display:block;margin:0;position:absolute;top:0;transition:opacity var(--spectrum-global-animation-duration-100,.13s) ease-out,margin var(--spectrum-global-animation-duration-100,.13s) ease-out}#switch{background-color:var(
33
+ --spectrum-switch-m-track-color,var(--spectrum-global-color-gray-300)
34
+ )}#switch:before{background-color:var(
35
+ --spectrum-switch-m-handle-background-color,var(--spectrum-global-color-gray-75)
36
+ );border-color:var(
37
+ --spectrum-switch-m-handle-border-color,var(--spectrum-alias-toggle-border-color-default)
38
+ )}#input~#label{color:var(
39
+ --spectrum-switch-m-text-color,var(--spectrum-alias-component-text-color-default)
40
+ )}:host([checked]) #input+#switch{background-color:var(
41
+ --spectrum-switch-m-track-color-selected,var(--spectrum-alias-toggle-background-color-default)
42
+ )}:host([checked]) #input+#switch:before{border-color:var(
43
+ --spectrum-switch-m-handle-border-color-selected,var(--spectrum-alias-toggle-background-color-default)
44
+ )}:host(:hover) #input+#switch:before{border-color:var(
45
+ --spectrum-switch-m-handle-border-color-hover,var(--spectrum-alias-toggle-border-color-hover)
46
+ );box-shadow:none}:host(:hover) #input~#label{color:var(
47
+ --spectrum-switch-m-text-color-hover,var(--spectrum-alias-component-text-color-hover)
48
+ )}:host(:hover[checked]) #input:enabled+#switch{background-color:var(
49
+ --spectrum-switch-m-track-color-selected-hover,var(--spectrum-alias-toggle-background-color-hover)
50
+ )}:host(:hover[checked]) #input:enabled+#switch:before{border-color:var(
51
+ --spectrum-switch-m-handle-border-color-selected-hover,var(--spectrum-alias-toggle-background-color-hover)
52
+ )}:host(:active) #input+#switch:before{border-color:var(
53
+ --spectrum-switch-m-handle-border-color-down,var(--spectrum-alias-toggle-border-color-down)
54
+ )}:host(:active) #input~#label{color:var(
55
+ --spectrum-switch-m-text-color-down,var(--spectrum-alias-component-text-color-down)
56
+ )}:host(:active[checked]) #input:enabled+#switch{background-color:var(
57
+ --spectrum-switch-m-track-color-selected-down,var(--spectrum-alias-toggle-background-color-down)
58
+ )}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(
59
+ --spectrum-switch-m-handle-border-color-selected-down,var(--spectrum-alias-toggle-background-color-down)
60
+ )}:host([disabled]) #input+#switch{background-color:var(
61
+ --spectrum-switch-m-track-color-disabled,var(--spectrum-global-color-gray-300)
62
+ )}:host([disabled]) #input+#switch:before{border-color:var(
63
+ --spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)
64
+ )}:host([disabled]) #input~#label{color:var(
65
+ --spectrum-switch-m-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)
66
+ )}:host([disabled][checked][dir]) #input+#switch{background-color:var(
67
+ --spectrum-switch-m-track-color-selected-disabled,var(--spectrum-global-color-gray-400)
68
+ )}:host([disabled][checked][dir]) #input+#switch:before{border-color:var(
69
+ --spectrum-switch-m-handle-border-color-selected-disabled,var(--spectrum-global-color-gray-400)
70
+ )}:host([disabled][checked][dir]) #input~#label{color:var(
71
+ --spectrum-switch-m-text-color-selected-disabled,var(--spectrum-alias-component-text-color-disabled)
72
+ )}:host([emphasized][checked]) #input+#switch{background-color:var(
73
+ --spectrum-switch-m-emphasized-track-color-selected,var(
74
+ --spectrum-alias-toggle-background-color-emphasized-selected-default
75
+ )
76
+ )}:host([emphasized][checked]) #input+#switch:before{border-color:var(
77
+ --spectrum-switch-m-emphasized-handle-border-color-selected,var(
78
+ --spectrum-alias-toggle-background-color-emphasized-selected-default
79
+ )
80
+ )}:host([emphasized][checked]:hover) #input:enabled+#switch{background-color:var(
81
+ --spectrum-switch-m-emphasized-track-color-selected-hover,var(--spectrum-alias-toggle-background-color-emphasized-selected-hover)
82
+ )}:host([emphasized][checked]:hover) #input:enabled+#switch:before{border-color:var(
83
+ --spectrum-switch-m-emphasized-handle-border-color-selected-hover,var(--spectrum-alias-toggle-background-color-emphasized-selected-hover)
84
+ )}:host([emphasized]:active[checked]) #input:enabled+#switch{background-color:var(
85
+ --spectrum-switch-m-emphasized-track-color-selected-down,var(--spectrum-alias-toggle-background-color-emphasized-selected-down)
86
+ )}:host([emphasized]:active[checked]) #input:enabled+#switch:before{border-color:var(
87
+ --spectrum-switch-m-emphasized-handle-border-color-selected-down,var(--spectrum-alias-toggle-background-color-emphasized-selected-down)
88
+ )}#input.focus-visible+#switch:after,:host(:hover) #input.focus-visible+#switch:after{box-shadow:0 0 0 var(
89
+ --spectrum-switch-m-focus-ring-size,var(--spectrum-alias-focus-ring-size)
90
+ ) var(
91
+ --spectrum-switch-m-focus-ring-color-key-focus,var(--spectrum-alias-focus-ring-color)
92
+ )}#input:focus-visible+#switch:after,:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(
93
+ --spectrum-switch-m-focus-ring-size,var(--spectrum-alias-focus-ring-size)
94
+ ) var(
95
+ --spectrum-switch-m-focus-ring-color-key-focus,var(--spectrum-alias-focus-ring-color)
96
+ )}#input.focus-visible+#switch:before,:host(:hover) #input.focus-visible+#switch:before{border-color:var(
97
+ --spectrum-switch-m-handle-border-color-key-focus,var(--spectrum-alias-toggle-border-color-key-focus)
98
+ )}#input:focus-visible+#switch:before,:host(:hover) #input:focus-visible+#switch:before{border-color:var(
99
+ --spectrum-switch-m-handle-border-color-key-focus,var(--spectrum-alias-toggle-border-color-key-focus)
100
+ )}:host(:hover[checked]) #input.focus-visible+#switch,:host([checked]) #input.focus-visible+#switch{background-color:var(
101
+ --spectrum-switch-m-track-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)
102
+ )}:host(:hover[checked]) #input:focus-visible+#switch,:host([checked]) #input:focus-visible+#switch{background-color:var(
103
+ --spectrum-switch-m-track-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)
104
+ )}:host(:hover[checked]) #input.focus-visible+#switch:before,:host([checked]) #input.focus-visible+#switch:before{border-color:var(
105
+ --spectrum-switch-m-handle-border-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)
106
+ )}:host(:hover[checked]) #input:focus-visible+#switch:before,:host([checked]) #input:focus-visible+#switch:before{border-color:var(
107
+ --spectrum-switch-m-handle-border-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)
108
+ )}:host([emphasized][checked]) #input.focus-visible+#switch,:host([emphasized][checked]:hover) #input.focus-visible+#switch{background-color:var(
109
+ --spectrum-switch-m-emphasized-track-color-selected-key-focus,var(
110
+ --spectrum-alias-toggle-background-color-emphasized-selected-key-focus
111
+ )
112
+ )}:host([emphasized][checked]) #input:focus-visible+#switch,:host([emphasized][checked]:hover) #input:focus-visible+#switch{background-color:var(
113
+ --spectrum-switch-m-emphasized-track-color-selected-key-focus,var(
114
+ --spectrum-alias-toggle-background-color-emphasized-selected-key-focus
115
+ )
116
+ )}:host([emphasized][checked]) #input.focus-visible+#switch:before,:host([emphasized][checked]:hover) #input.focus-visible+#switch:before{border-color:var(
117
+ --spectrum-switch-m-emphasized-handle-border-color-selected-key-focus,var(
118
+ --spectrum-alias-toggle-background-color-emphasized-selected-key-focus
119
+ )
120
+ )}:host([emphasized][checked]) #input:focus-visible+#switch:before,:host([emphasized][checked]:hover) #input:focus-visible+#switch:before{border-color:var(
121
+ --spectrum-switch-m-emphasized-handle-border-color-selected-key-focus,var(
122
+ --spectrum-alias-toggle-background-color-emphasized-selected-key-focus
123
+ )
124
+ )}@media (forced-colors:active){:host{--spectrum-switch-m-emphasized-handle-border-color-selected:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-down:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-hover:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-key-focus:Highlight;--spectrum-switch-m-emphasized-track-color-selected:Highlight;--spectrum-switch-m-emphasized-track-color-selected-down:Highlight;--spectrum-switch-m-emphasized-track-color-selected-hover:Highlight;--spectrum-switch-m-emphasized-track-color-selected-key-focus:Highlight;--spectrum-switch-m-focus-ring-color-key-focus:ButtonText;--spectrum-switch-m-handle-background-color:ButtonFace;--spectrum-switch-m-handle-border-color:ButtonText;--spectrum-switch-m-handle-border-color-disabled:GrayText;--spectrum-switch-m-handle-border-color-down:Highlight;--spectrum-switch-m-handle-border-color-hover:Highlight;--spectrum-switch-m-handle-border-color-key-focus:ButtonText;--spectrum-switch-m-handle-border-color-selected:Highlight;--spectrum-switch-m-handle-border-color-selected-disabled:GrayText;--spectrum-switch-m-handle-border-color-selected-down:Highlight;--spectrum-switch-m-handle-border-color-selected-hover:Highlight;--spectrum-switch-m-handle-border-color-selected-key-focus:Highlight;--spectrum-switch-m-text-color:CanvasText;--spectrum-switch-m-text-color-disabled:GrayText;--spectrum-switch-m-text-color-down:CanvasText;--spectrum-switch-m-text-color-hover:CanvasText;--spectrum-switch-m-text-color-selected-disabled:GrayText;--spectrum-switch-m-track-color:ButtonFace;--spectrum-switch-m-track-color-disabled:ButtonFace;--spectrum-switch-m-track-color-selected:Highlight;--spectrum-switch-m-track-color-selected-disabled:GrayText;--spectrum-switch-m-track-color-selected-down:Highlight;--spectrum-switch-m-track-color-selected-hover:Highlight;--spectrum-switch-m-track-color-selected-key-focus:Highlight;forced-color-adjust:none}#input:not([checked])+#switch{box-shadow:inset 0 0 0 1px var(
125
+ --spectrum-switch-m-handle-border-color,var(--spectrum-alias-toggle-border-color-default)
126
+ )}:host(:hover) #input:not([checked])+#switch{box-shadow:inset 0 0 0 1px var(
127
+ --spectrum-switch-m-handle-border-color-hover,var(--spectrum-alias-toggle-border-color-hover)
128
+ )}:host([disabled]) #input+#switch{box-shadow:inset 0 0 0 1px var(
129
+ --spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)
130
+ )}:host(:hover[disabled]) #input+#switch{box-shadow:inset 0 0 0 1px var(
131
+ --spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)
132
+ )}}
133
+ `;
134
+ export default styles;
135
+ //# sourceMappingURL=spectrum-switch.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-switch.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-switch-handle-size:var(\n--spectrum-switch-m-handle-size,var(--spectrum-alias-control-two-size-m)\n);--spectrum-switch-handle-border-size:var(\n--spectrum-switch-m-handle-border-size,var(--spectrum-alias-border-size-thick)\n);--spectrum-switch-handle-border-radius:var(\n--spectrum-switch-m-handle-border-radius,var(--spectrum-alias-control-two-border-radius-m)\n);--spectrum-switch-text-gap:var(\n--spectrum-switch-m-text-gap,var(--spectrum-global-dimension-size-125)\n);--spectrum-switch-text-size:var(\n--spectrum-switch-m-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-switch-track-height:var(\n--spectrum-switch-m-track-height,var(--spectrum-alias-control-three-height-m)\n);--spectrum-switch-track-width:var(\n--spectrum-switch-m-track-width,var(--spectrum-alias-control-three-width-m)\n);--spectrum-switch-cursor-hit-x:var(\n--spectrum-switch-m-cursor-hit-x,var(--spectrum-global-dimension-size-100)\n);--spectrum-switch-height:var(\n--spectrum-switch-m-height,var(--spectrum-global-dimension-size-400)\n);--spectrum-switch-label-margin-top:var(\n--spectrum-global-dimension-size-65\n);--spectrum-switch-label-line-height:1.49}:host([dir=ltr]){margin-right:calc(var(--spectrum-switch-cursor-hit-x)*2)}:host([dir=rtl]){margin-left:calc(var(--spectrum-switch-cursor-hit-x)*2)}:host{align-items:flex-start;display:inline-flex;max-width:100%;min-height:var(--spectrum-switch-height);position:relative;vertical-align:top}:host([dir=ltr]) #input{left:0}:host([dir=rtl]) #input{right:0}#input{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;padding:0;position:absolute;top:0;width:100%;z-index:1}:host([dir=ltr][checked]) #input+#switch:before{transform:translateX(calc(var(--spectrum-switch-track-width) - 100%))}:host([dir=rtl][checked]) #input+#switch:before{transform:translateX(calc((var(--spectrum-switch-track-width) - 100%)*-1))}#input[disabled],:host([disabled]) #input{cursor:default}#input.focus-visible+#switch:after{margin:calc(var(\n--spectrum-alias-focus-ring-gap,\nvar(--spectrum-global-dimension-static-size-25)\n)*-1)}#input:focus-visible+#switch:after{margin:calc(var(\n--spectrum-alias-focus-ring-gap,\nvar(--spectrum-global-dimension-static-size-25)\n)*-1)}#label{font-size:var(--spectrum-switch-text-size);line-height:var(--spectrum-switch-label-line-height);margin-bottom:0;margin-left:var(--spectrum-switch-text-gap);margin-right:var(--spectrum-switch-text-gap);margin-top:var(--spectrum-switch-label-margin-top);transition:color var(--spectrum-global-animation-duration-200,.16s) ease-in-out}:host([dir=ltr]) #switch{left:0}:host([dir=rtl]) #switch{right:0}:host([dir=ltr]) #switch{right:0}:host([dir=rtl]) #switch{left:0}#switch{border-radius:calc(var(--spectrum-switch-track-height)/2);box-sizing:border-box;display:inline-block;flex-grow:0;flex-shrink:0;height:var(--spectrum-switch-track-height);margin-bottom:calc((var(--spectrum-switch-height) - var(--spectrum-switch-track-height))/2);margin-left:0;margin-right:0;margin-top:calc((var(--spectrum-switch-height) - var(--spectrum-switch-track-height))/2);position:relative;transition:background var(--spectrum-global-animation-duration-100,.13s) ease-in-out,border var(--spectrum-global-animation-duration-100,.13s) ease-in-out;vertical-align:middle;width:var(--spectrum-switch-track-width)}#switch:before{box-sizing:border-box;content:\"\";display:block;position:absolute}:host([dir=ltr]) #switch:before{left:0}:host([dir=rtl]) #switch:before{right:0}#switch:before{border-radius:var(--spectrum-switch-handle-border-radius);border-style:solid;border-width:var(--spectrum-switch-handle-border-size);height:var(--spectrum-switch-handle-size);top:0;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;width:var(--spectrum-switch-handle-size)}:host([dir=ltr]) #switch:after{left:0}:host([dir=rtl]) #switch:after{right:0}:host([dir=ltr]) #switch:after{right:0}:host([dir=rtl]) #switch:after{left:0}#switch:after{border-radius:calc(var(--spectrum-switch-track-height) + var(\n--spectrum-alias-focus-ring-gap,\nvar(--spectrum-global-dimension-static-size-25)\n));bottom:0;content:\"\";display:block;margin:0;position:absolute;top:0;transition:opacity var(--spectrum-global-animation-duration-100,.13s) ease-out,margin var(--spectrum-global-animation-duration-100,.13s) ease-out}#switch{background-color:var(\n--spectrum-switch-m-track-color,var(--spectrum-global-color-gray-300)\n)}#switch:before{background-color:var(\n--spectrum-switch-m-handle-background-color,var(--spectrum-global-color-gray-75)\n);border-color:var(\n--spectrum-switch-m-handle-border-color,var(--spectrum-alias-toggle-border-color-default)\n)}#input~#label{color:var(\n--spectrum-switch-m-text-color,var(--spectrum-alias-component-text-color-default)\n)}:host([checked]) #input+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected,var(--spectrum-alias-toggle-background-color-default)\n)}:host([checked]) #input+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected,var(--spectrum-alias-toggle-background-color-default)\n)}:host(:hover) #input+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-hover,var(--spectrum-alias-toggle-border-color-hover)\n);box-shadow:none}:host(:hover) #input~#label{color:var(\n--spectrum-switch-m-text-color-hover,var(--spectrum-alias-component-text-color-hover)\n)}:host(:hover[checked]) #input:enabled+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected-hover,var(--spectrum-alias-toggle-background-color-hover)\n)}:host(:hover[checked]) #input:enabled+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected-hover,var(--spectrum-alias-toggle-background-color-hover)\n)}:host(:active) #input+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-down,var(--spectrum-alias-toggle-border-color-down)\n)}:host(:active) #input~#label{color:var(\n--spectrum-switch-m-text-color-down,var(--spectrum-alias-component-text-color-down)\n)}:host(:active[checked]) #input:enabled+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected-down,var(--spectrum-alias-toggle-background-color-down)\n)}:host(:active[checked]) #input:enabled+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected-down,var(--spectrum-alias-toggle-background-color-down)\n)}:host([disabled]) #input+#switch{background-color:var(\n--spectrum-switch-m-track-color-disabled,var(--spectrum-global-color-gray-300)\n)}:host([disabled]) #input+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)\n)}:host([disabled]) #input~#label{color:var(\n--spectrum-switch-m-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n)}:host([disabled][checked][dir]) #input+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected-disabled,var(--spectrum-global-color-gray-400)\n)}:host([disabled][checked][dir]) #input+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected-disabled,var(--spectrum-global-color-gray-400)\n)}:host([disabled][checked][dir]) #input~#label{color:var(\n--spectrum-switch-m-text-color-selected-disabled,var(--spectrum-alias-component-text-color-disabled)\n)}:host([emphasized][checked]) #input+#switch{background-color:var(\n--spectrum-switch-m-emphasized-track-color-selected,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-default\n)\n)}:host([emphasized][checked]) #input+#switch:before{border-color:var(\n--spectrum-switch-m-emphasized-handle-border-color-selected,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-default\n)\n)}:host([emphasized][checked]:hover) #input:enabled+#switch{background-color:var(\n--spectrum-switch-m-emphasized-track-color-selected-hover,var(--spectrum-alias-toggle-background-color-emphasized-selected-hover)\n)}:host([emphasized][checked]:hover) #input:enabled+#switch:before{border-color:var(\n--spectrum-switch-m-emphasized-handle-border-color-selected-hover,var(--spectrum-alias-toggle-background-color-emphasized-selected-hover)\n)}:host([emphasized]:active[checked]) #input:enabled+#switch{background-color:var(\n--spectrum-switch-m-emphasized-track-color-selected-down,var(--spectrum-alias-toggle-background-color-emphasized-selected-down)\n)}:host([emphasized]:active[checked]) #input:enabled+#switch:before{border-color:var(\n--spectrum-switch-m-emphasized-handle-border-color-selected-down,var(--spectrum-alias-toggle-background-color-emphasized-selected-down)\n)}#input.focus-visible+#switch:after,:host(:hover) #input.focus-visible+#switch:after{box-shadow:0 0 0 var(\n--spectrum-switch-m-focus-ring-size,var(--spectrum-alias-focus-ring-size)\n) var(\n--spectrum-switch-m-focus-ring-color-key-focus,var(--spectrum-alias-focus-ring-color)\n)}#input:focus-visible+#switch:after,:host(:hover) #input:focus-visible+#switch:after{box-shadow:0 0 0 var(\n--spectrum-switch-m-focus-ring-size,var(--spectrum-alias-focus-ring-size)\n) var(\n--spectrum-switch-m-focus-ring-color-key-focus,var(--spectrum-alias-focus-ring-color)\n)}#input.focus-visible+#switch:before,:host(:hover) #input.focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-key-focus,var(--spectrum-alias-toggle-border-color-key-focus)\n)}#input:focus-visible+#switch:before,:host(:hover) #input:focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-key-focus,var(--spectrum-alias-toggle-border-color-key-focus)\n)}:host(:hover[checked]) #input.focus-visible+#switch,:host([checked]) #input.focus-visible+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)\n)}:host(:hover[checked]) #input:focus-visible+#switch,:host([checked]) #input:focus-visible+#switch{background-color:var(\n--spectrum-switch-m-track-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)\n)}:host(:hover[checked]) #input.focus-visible+#switch:before,:host([checked]) #input.focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)\n)}:host(:hover[checked]) #input:focus-visible+#switch:before,:host([checked]) #input:focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-handle-border-color-selected-key-focus,var(--spectrum-alias-toggle-background-color-key-focus)\n)}:host([emphasized][checked]) #input.focus-visible+#switch,:host([emphasized][checked]:hover) #input.focus-visible+#switch{background-color:var(\n--spectrum-switch-m-emphasized-track-color-selected-key-focus,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-key-focus\n)\n)}:host([emphasized][checked]) #input:focus-visible+#switch,:host([emphasized][checked]:hover) #input:focus-visible+#switch{background-color:var(\n--spectrum-switch-m-emphasized-track-color-selected-key-focus,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-key-focus\n)\n)}:host([emphasized][checked]) #input.focus-visible+#switch:before,:host([emphasized][checked]:hover) #input.focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-emphasized-handle-border-color-selected-key-focus,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-key-focus\n)\n)}:host([emphasized][checked]) #input:focus-visible+#switch:before,:host([emphasized][checked]:hover) #input:focus-visible+#switch:before{border-color:var(\n--spectrum-switch-m-emphasized-handle-border-color-selected-key-focus,var(\n--spectrum-alias-toggle-background-color-emphasized-selected-key-focus\n)\n)}@media (forced-colors:active){:host{--spectrum-switch-m-emphasized-handle-border-color-selected:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-down:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-hover:Highlight;--spectrum-switch-m-emphasized-handle-border-color-selected-key-focus:Highlight;--spectrum-switch-m-emphasized-track-color-selected:Highlight;--spectrum-switch-m-emphasized-track-color-selected-down:Highlight;--spectrum-switch-m-emphasized-track-color-selected-hover:Highlight;--spectrum-switch-m-emphasized-track-color-selected-key-focus:Highlight;--spectrum-switch-m-focus-ring-color-key-focus:ButtonText;--spectrum-switch-m-handle-background-color:ButtonFace;--spectrum-switch-m-handle-border-color:ButtonText;--spectrum-switch-m-handle-border-color-disabled:GrayText;--spectrum-switch-m-handle-border-color-down:Highlight;--spectrum-switch-m-handle-border-color-hover:Highlight;--spectrum-switch-m-handle-border-color-key-focus:ButtonText;--spectrum-switch-m-handle-border-color-selected:Highlight;--spectrum-switch-m-handle-border-color-selected-disabled:GrayText;--spectrum-switch-m-handle-border-color-selected-down:Highlight;--spectrum-switch-m-handle-border-color-selected-hover:Highlight;--spectrum-switch-m-handle-border-color-selected-key-focus:Highlight;--spectrum-switch-m-text-color:CanvasText;--spectrum-switch-m-text-color-disabled:GrayText;--spectrum-switch-m-text-color-down:CanvasText;--spectrum-switch-m-text-color-hover:CanvasText;--spectrum-switch-m-text-color-selected-disabled:GrayText;--spectrum-switch-m-track-color:ButtonFace;--spectrum-switch-m-track-color-disabled:ButtonFace;--spectrum-switch-m-track-color-selected:Highlight;--spectrum-switch-m-track-color-selected-disabled:GrayText;--spectrum-switch-m-track-color-selected-down:Highlight;--spectrum-switch-m-track-color-selected-hover:Highlight;--spectrum-switch-m-track-color-selected-key-focus:Highlight;forced-color-adjust:none}#input:not([checked])+#switch{box-shadow:inset 0 0 0 1px var(\n--spectrum-switch-m-handle-border-color,var(--spectrum-alias-toggle-border-color-default)\n)}:host(:hover) #input:not([checked])+#switch{box-shadow:inset 0 0 0 1px var(\n--spectrum-switch-m-handle-border-color-hover,var(--spectrum-alias-toggle-border-color-hover)\n)}:host([disabled]) #input+#switch{box-shadow:inset 0 0 0 1px var(\n--spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)\n)}:host(:hover[disabled]) #input+#switch{box-shadow:inset 0 0 0 1px var(\n--spectrum-switch-m-handle-border-color-disabled,var(--spectrum-global-color-gray-400)\n)}}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoIf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2022 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
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
14
3
  :host{--spectrum-switch-handle-size:var(
15
4
  --spectrum-switch-m-handle-size,var(--spectrum-alias-control-two-size-m)
16
5
  );--spectrum-switch-handle-border-size:var(
@@ -143,4 +132,4 @@ var(--spectrum-global-dimension-static-size-25)
143
132
  )}}
144
133
  `;
145
134
  export default styles;
146
- //# sourceMappingURL=spectrum-switch.css.js.map
135
+ //# sourceMappingURL=spectrum-switch.css.js.map