@spectrum-web-components/switch 0.35.1-rc.26 → 0.35.1-rc.41
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 +4 -4
- package/src/Switch.dev.js.map +1 -1
- package/src/Switch.js.map +1 -1
- package/stories/switch.stories.js.map +1 -1
- package/custom-elements.json +0 -83
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/switch",
|
|
3
|
-
"version": "0.35.1-rc.
|
|
3
|
+
"version": "0.35.1-rc.41+6ac4e82f0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"lit-html"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@spectrum-web-components/base": "^0.35.1-rc.
|
|
62
|
-
"@spectrum-web-components/checkbox": "^0.35.1-rc.
|
|
61
|
+
"@spectrum-web-components/base": "^0.35.1-rc.41+6ac4e82f0",
|
|
62
|
+
"@spectrum-web-components/checkbox": "^0.35.1-rc.41+6ac4e82f0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@spectrum-css/switch": "^3.1.8"
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"./sp-*.js",
|
|
71
71
|
"./**/*.dev.js"
|
|
72
72
|
],
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "6ac4e82f0a4a68eb50b5dd4b96a562060162ac6f"
|
|
74
74
|
}
|
package/src/Switch.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.ts"],
|
|
4
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 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';\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 SizedMixin(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,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAOlB,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAWH,SAAO,aAAa;AAAA;AAAA,EAVpB,WAA2B,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,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAOlB,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAWH,SAAO,aAAa;AAAA;AAAA,EAVpB,WAA2B,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,CAAC;AAAA;AAAA;AAAA;AAAA,EAIxB;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;AAAA,QACd;AAAA,QACA,KAAK,UAAU,SAAS;AAAA,MAC5B;AAAA,IACJ;AAAA,EACJ;AACJ;AAvBW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAVjC,OAWF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Switch.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Switch.ts"],
|
|
4
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 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';\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 SizedMixin(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": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,wDAC7B,OAAOC,MAAkB,kBACzB,OAAOC,MAAkB,yBAOlB,aAAM,eAAeJ,EAAWE,CAAY,CAAE,CAA9C,kCAWH,KAAO,WAAa,GAVpB,WAA2B,QAAyB,CAEhD,OAAI,OAAO,eAAe,UAAU,EAEzB,CAACC,EAAcC,CAAY,EAE/B,CAACD,CAAY,CACxB,CAKmB,QAAyB,CACxC,OAAOJ;AAAA,cACD,MAAM,OAAO;AAAA;AAAA;AAAA,
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,wDAC7B,OAAOC,MAAkB,kBACzB,OAAOC,MAAkB,yBAOlB,aAAM,eAAeJ,EAAWE,CAAY,CAAE,CAA9C,kCAWH,KAAO,WAAa,GAVpB,WAA2B,QAAyB,CAEhD,OAAI,OAAO,eAAe,UAAU,EAEzB,CAACC,EAAcC,CAAY,EAE/B,CAACD,CAAY,CACxB,CAKmB,QAAyB,CACxC,OAAOJ;AAAA,cACD,MAAM,OAAO,CAAC;AAAA;AAAA;AAAA,SAIxB,CAEmB,aAAaM,EAA+B,CAC3D,MAAM,aAAaA,CAAO,EAC1B,KAAK,aAAa,aAAa,OAAQ,QAAQ,CACnD,CAEmB,QAAQA,EAA+B,CAClDA,EAAQ,IAAI,SAAS,GACrB,KAAK,aAAa,aACd,eACA,KAAK,QAAU,OAAS,OAC5B,CAER,CACJ,CAvBWC,EAAA,CADNL,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAVjC,OAWF",
|
|
6
6
|
"names": ["html", "SizedMixin", "property", "CheckboxBase", "switchStyles", "legacyStyles", "changes", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["switch.stories.ts"],
|
|
4
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 '@spectrum-web-components/switch/sp-switch.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { spreadProps } from '../../../test/lit-helpers.js';\n\nexport default {\n component: 'sp-switch',\n title: 'Switch',\n\n argTypes: {\n size: {\n name: 'size',\n type: { name: 'string', required: false },\n description: 'The size at which to display the Switch element',\n table: {\n type: { summary: '\"s\" | \"m\" | \"l\" | \"xl\"' },\n defaultValue: { summary: 'm' },\n },\n control: {\n type: 'text',\n },\n },\n },\n args: {\n size: 'm',\n },\n};\n\nexport interface StoryArgs {\n Autofocus?: boolean;\n checked?: boolean;\n Disabled?: boolean;\n disabledChecked?: boolean;\n emphasized?: boolean;\n readonly?: boolean;\n size?: 's' | 'm' | 'l' | 'xl';\n [prop: string]: unknown;\n}\n\nfunction renderSwitch(args: StoryArgs): TemplateResult {\n return html`\n <sp-switch ${spreadProps(args)}>Switch</sp-switch>\n `;\n}\n\nexport const Default = (args: StoryArgs): TemplateResult => renderSwitch(args);\n\nexport const Checked = (): TemplateResult => {\n return html`\n <sp-switch checked>Switch</sp-switch>\n `;\n};\n\nexport const Sizes = (): TemplateResult => {\n return html`\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <sp-switch size=\"s\">Small</sp-switch>\n <sp-switch size=\"m\">Medium</sp-switch>\n <sp-switch size=\"l\">Large</sp-switch>\n <sp-switch size=\"xl\">Extra-Large</sp-switch>\n </div>\n `;\n};\n\nexport const readonly = (): TemplateResult => {\n return html`\n <sp-switch checked readonly>Switch</sp-switch>\n `;\n};\n\nexport const emphasized = (): TemplateResult => {\n return html`\n <sp-switch emphasized>Switch</sp-switch>\n `;\n};\n\nexport const emphasizedChecked = (): TemplateResult => {\n return html`\n <sp-switch emphasized checked>Switch</sp-switch>\n `;\n};\n\nexport const Autofocus = (): TemplateResult => {\n return html`\n <sp-switch autofocus>Switch</sp-switch>\n `;\n};\n\nexport const Disabled = (): TemplateResult => {\n return html`\n <sp-switch disabled>Switch</sp-switch>\n `;\n};\n\nexport const disabledChecked = (): TemplateResult => {\n return html`\n <sp-switch disabled checked>Switch</sp-switch>\n `;\n};\n"],
|
|
5
|
-
"mappings": ";AAWA,OAAO;AACP,SAAS,YAA4B;AACrC,SAAS,mBAAmB;AAE5B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EAEP,UAAU;AAAA,IACN,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,aAAa;AAAA,MACb,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,yBAAyB;AAAA,QAC1C,cAAc,EAAE,SAAS,IAAI;AAAA,MACjC;AAAA,MACA,SAAS;AAAA,QACL,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACF,MAAM;AAAA,EACV;AACJ;AAaA,SAAS,aAAa,MAAiC;AACnD,SAAO;AAAA,qBACU,YAAY,IAAI;AAAA;
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,SAAS,YAA4B;AACrC,SAAS,mBAAmB;AAE5B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EAEP,UAAU;AAAA,IACN,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,aAAa;AAAA,MACb,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,yBAAyB;AAAA,QAC1C,cAAc,EAAE,SAAS,IAAI;AAAA,MACjC;AAAA,MACA,SAAS;AAAA,QACL,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACF,MAAM;AAAA,EACV;AACJ;AAaA,SAAS,aAAa,MAAiC;AACnD,SAAO;AAAA,qBACU,YAAY,IAAI,CAAC;AAAA;AAEtC;AAEO,aAAM,UAAU,CAAC,SAAoC,aAAa,IAAI;AAEtE,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,QAAQ,MAAsB;AACvC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQX;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,aAAa,MAAsB;AAC5C,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,oBAAoB,MAAsB;AACnD,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,YAAY,MAAsB;AAC3C,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,WAAW,MAAsB;AAC1C,SAAO;AAAA;AAAA;AAGX;AAEO,aAAM,kBAAkB,MAAsB;AACjD,SAAO;AAAA;AAAA;AAGX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/custom-elements.json
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0.0",
|
|
3
|
-
"readme": "",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "sp-switch.ts",
|
|
8
|
-
"declarations": [],
|
|
9
|
-
"exports": [
|
|
10
|
-
{
|
|
11
|
-
"kind": "custom-element-definition",
|
|
12
|
-
"name": "sp-switch",
|
|
13
|
-
"declaration": {
|
|
14
|
-
"name": "Switch",
|
|
15
|
-
"module": "/src/Switch.js"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"kind": "javascript-module",
|
|
22
|
-
"path": "src/Switch.ts",
|
|
23
|
-
"declarations": [
|
|
24
|
-
{
|
|
25
|
-
"kind": "class",
|
|
26
|
-
"description": "",
|
|
27
|
-
"name": "Switch",
|
|
28
|
-
"slots": [
|
|
29
|
-
{
|
|
30
|
-
"description": "text label of the Switch",
|
|
31
|
-
"name": ""
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"members": [
|
|
35
|
-
{
|
|
36
|
-
"kind": "field",
|
|
37
|
-
"name": "emphasized",
|
|
38
|
-
"type": {
|
|
39
|
-
"text": "boolean"
|
|
40
|
-
},
|
|
41
|
-
"privacy": "public",
|
|
42
|
-
"default": "false",
|
|
43
|
-
"attribute": "emphasized",
|
|
44
|
-
"reflects": true
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"attributes": [
|
|
48
|
-
{
|
|
49
|
-
"name": "emphasized",
|
|
50
|
-
"type": {
|
|
51
|
-
"text": "boolean"
|
|
52
|
-
},
|
|
53
|
-
"default": "false",
|
|
54
|
-
"fieldName": "emphasized"
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"mixins": [
|
|
58
|
-
{
|
|
59
|
-
"name": "SizedMixin",
|
|
60
|
-
"package": "@spectrum-web-components/base"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"superclass": {
|
|
64
|
-
"name": "CheckboxBase",
|
|
65
|
-
"package": "@spectrum-web-components/checkbox/src/CheckboxBase.js"
|
|
66
|
-
},
|
|
67
|
-
"tagName": "sp-switch",
|
|
68
|
-
"customElement": true
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"exports": [
|
|
72
|
-
{
|
|
73
|
-
"kind": "js",
|
|
74
|
-
"name": "Switch",
|
|
75
|
-
"declaration": {
|
|
76
|
-
"name": "Switch",
|
|
77
|
-
"module": "src/Switch.ts"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|