@spectrum-web-components/switch 1.12.0-next.20260218162159 → 1.12.0-testing.20260223092154
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/README.md +0 -1
- package/package.json +3 -3
- package/sp-switch.dev.js.map +1 -1
- package/sp-switch.js.map +1 -1
- package/src/Switch.d.ts +1 -1
- package/src/Switch.dev.js +1 -1
- package/src/Switch.dev.js.map +2 -2
- package/src/Switch.js +1 -1
- package/src/Switch.js.map +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.dev.js.map +1 -1
- package/src/index.js.map +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/switch",
|
|
3
|
-
"version": "1.12.0-
|
|
3
|
+
"version": "1.12.0-testing.20260223092154",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Adobe",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
],
|
|
56
56
|
"types": "./src/index.d.ts",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@spectrum-web-components/base": "1.12.0-
|
|
59
|
-
"@spectrum-web-components/checkbox": "1.12.0-
|
|
58
|
+
"@spectrum-web-components/base": "1.12.0-testing.20260223092154",
|
|
59
|
+
"@spectrum-web-components/checkbox": "1.12.0-testing.20260223092154"
|
|
60
60
|
},
|
|
61
61
|
"keywords": [
|
|
62
62
|
"design-system",
|
package/sp-switch.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-switch.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 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 */\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\nimport { Switch } from './src/Switch.dev.js'\n\ndefineElement('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,qBAAqB;AAE9B,SAAS,cAAc;AAEvB,cAAc,aAAa,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-switch.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-switch.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 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 */\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\nimport { Switch } from './src/Switch.js';\n\ndefineElement('sp-switch', Switch);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-switch': Switch;\n }\n}\n"],
|
|
5
5
|
"mappings": "aAWA,OAAS,iBAAAA,MAAqB,sDAE9B,OAAS,UAAAC,MAAc,kBAEvBD,EAAc,YAAaC,CAAM",
|
|
6
6
|
"names": ["defineElement", "Switch"]
|
|
7
7
|
}
|
package/src/Switch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
package/src/Switch.dev.js
CHANGED
|
@@ -23,7 +23,7 @@ export class Switch extends SizedMixin(CheckboxBase) {
|
|
|
23
23
|
this.emphasized = false;
|
|
24
24
|
}
|
|
25
25
|
static get styles() {
|
|
26
|
-
if (
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(window, "ShadyDOM")) {
|
|
27
27
|
return [switchStyles, legacyStyles];
|
|
28
28
|
}
|
|
29
29
|
return [switchStyles];
|
package/src/Switch.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEE;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAE7B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAQlB,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAWL,SAAO,aAAa;AAAA;AAAA,EAVpB,WAA2B,SAAyB;AAElD,QAAI,OAAO,eAAe,UAAU,GAAG;
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\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';\n\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 * @fires change - Announces a change in the `checked` property of a Switch\n */\nexport class Switch extends SizedMixin(CheckboxBase) {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (Object.prototype.hasOwnProperty.call(window, '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,EAEE;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAE7B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAQlB,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAWL,SAAO,aAAa;AAAA;AAAA,EAVpB,WAA2B,SAAyB;AAElD,QAAI,OAAO,UAAU,eAAe,KAAK,QAAQ,UAAU,GAAG;AAE5D,aAAO,CAAC,cAAc,YAAY;AAAA,IACpC;AACA,WAAO,CAAC,YAAY;AAAA,EACtB;AAAA,EAKmB,SAAyB;AAC1C,WAAO;AAAA,QACH,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA,EAIpB;AAAA,EAEmB,aAAa,SAA+B;AAC7D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACjD;AAAA,EAEmB,QAAQ,SAA+B;AACxD,QAAI,QAAQ,IAAI,SAAS,GAAG;AAC1B,WAAK,aAAa;AAAA,QAChB;AAAA,QACA,KAAK,UAAU,SAAS;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AACF;AAvBS;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAV/B,OAWJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Switch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=(s,r,e,i)=>{for(var t=i>1?void 0:i?u(r,e):r,o=s.length-1,l;o>=0;o--)(l=s[o])&&(t=(i?l(r,e,t):l(t))||t);return i&&t&&d(r,e,t),t};import{html as c,SizedMixin as n}from"@spectrum-web-components/base";import{property as m}from"@spectrum-web-components/base/src/decorators.js";import{CheckboxBase as h}from"@spectrum-web-components/checkbox/src/CheckboxBase.js";import a from"./switch.css.js";import
|
|
1
|
+
"use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=(s,r,e,i)=>{for(var t=i>1?void 0:i?u(r,e):r,o=s.length-1,l;o>=0;o--)(l=s[o])&&(t=(i?l(r,e,t):l(t))||t);return i&&t&&d(r,e,t),t};import{html as c,SizedMixin as n}from"@spectrum-web-components/base";import{property as m}from"@spectrum-web-components/base/src/decorators.js";import{CheckboxBase as h}from"@spectrum-web-components/checkbox/src/CheckboxBase.js";import a from"./switch.css.js";import y from"./switch-legacy.css.js";export class Switch extends n(h){constructor(){super(...arguments);this.emphasized=!1}static get styles(){return Object.prototype.hasOwnProperty.call(window,"ShadyDOM")?[a,y]:[a]}render(){return c`
|
|
2
2
|
${super.render()}
|
|
3
3
|
<span id="switch"></span>
|
|
4
4
|
<label id="label" for="input"><slot></slot></label>
|
package/src/Switch.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
5
|
-
"mappings": "qNAYA,OAEE,QAAAA,EAEA,cAAAC,MAEK,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,wDAE7B,OAAOC,MAAkB,kBACzB,OAAOC,MAAkB,yBAQlB,aAAM,eAAeJ,EAAWE,CAAY,CAAE,CAA9C,kCAWL,KAAO,WAAa,GAVpB,WAA2B,QAAyB,CAElD,OAAI,OAAO,eAAe,UAAU,
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\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';\n\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 * @fires change - Announces a change in the `checked` property of a Switch\n */\nexport class Switch extends SizedMixin(CheckboxBase) {\n public static override get styles(): CSSResultArray {\n /* c8 ignore next 4 */\n if (Object.prototype.hasOwnProperty.call(window, '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": "qNAYA,OAEE,QAAAA,EAEA,cAAAC,MAEK,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,wDAE7B,OAAOC,MAAkB,kBACzB,OAAOC,MAAkB,yBAQlB,aAAM,eAAeJ,EAAWE,CAAY,CAAE,CAA9C,kCAWL,KAAO,WAAa,GAVpB,WAA2B,QAAyB,CAElD,OAAI,OAAO,UAAU,eAAe,KAAK,OAAQ,UAAU,EAElD,CAACC,EAAcC,CAAY,EAE7B,CAACD,CAAY,CACtB,CAKmB,QAAyB,CAC1C,OAAOJ;AAAA,QACH,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA,KAIpB,CAEmB,aAAaM,EAA+B,CAC7D,MAAM,aAAaA,CAAO,EAC1B,KAAK,aAAa,aAAa,OAAQ,QAAQ,CACjD,CAEmB,QAAQA,EAA+B,CACpDA,EAAQ,IAAI,SAAS,GACvB,KAAK,aAAa,aAChB,eACA,KAAK,QAAU,OAAS,OAC1B,CAEJ,CACF,CAvBSC,EAAA,CADNL,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAV/B,OAWJ",
|
|
6
6
|
"names": ["html", "SizedMixin", "property", "CheckboxBase", "switchStyles", "legacyStyles", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
package/src/index.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport * from './Switch.dev.js'\n"],
|
|
5
5
|
"mappings": ";AAWA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport * from './Switch.js';\n"],
|
|
5
5
|
"mappings": "aAWA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|