@getflip/swirl-components 0.532.0 → 0.532.1
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/components.json +28 -10
- package/dist/cjs/swirl-checkbox.cjs.entry.js +2 -1
- package/dist/cjs/swirl-radio.cjs.entry.js +2 -1
- package/dist/cjs/swirl-switch.cjs.entry.js +3 -2
- package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
- package/dist/collection/components/swirl-checkbox/swirl-checkbox.js +6 -4
- package/dist/collection/components/swirl-radio/swirl-radio.js +6 -4
- package/dist/collection/components/swirl-switch/swirl-switch.js +7 -5
- package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.css +1 -1
- package/dist/components/swirl-checkbox.js +1 -1
- package/dist/components/swirl-radio.js +1 -1
- package/dist/components/swirl-switch.js +1 -1
- package/dist/components/swirl-visually-hidden2.js +1 -1
- package/dist/esm/swirl-checkbox.entry.js +2 -1
- package/dist/esm/swirl-radio.entry.js +2 -1
- package/dist/esm/swirl-switch.entry.js +3 -2
- package/dist/esm/swirl-visually-hidden.entry.js +1 -1
- package/dist/swirl-components/{p-ffcaf25a.entry.js → p-6b8f82d2.entry.js} +1 -1
- package/dist/swirl-components/p-769d0e2e.entry.js +1 -0
- package/dist/swirl-components/p-850d71e1.entry.js +1 -0
- package/dist/swirl-components/p-bbe66770.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-checkbox/swirl-checkbox.d.ts +1 -1
- package/dist/types/components/swirl-radio/swirl-radio.d.ts +1 -1
- package/dist/types/components/swirl-switch/swirl-switch.d.ts +1 -1
- package/dist/types/components.d.ts +27 -9
- package/package.json +1 -1
- package/dist/swirl-components/p-090c46fe.entry.js +0 -1
- package/dist/swirl-components/p-d7be455c.entry.js +0 -1
- package/dist/swirl-components/p-d8f87ffc.entry.js +0 -1
package/components.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
2
|
+
"timestamp": "2026-11-03T16:14:42",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.43.1",
|
|
@@ -9291,14 +9291,20 @@
|
|
|
9291
9291
|
"attr": "input-id",
|
|
9292
9292
|
"reflectToAttr": false,
|
|
9293
9293
|
"docs": "",
|
|
9294
|
-
"docsTags": [
|
|
9294
|
+
"docsTags": [
|
|
9295
|
+
{
|
|
9296
|
+
"name": "default",
|
|
9297
|
+
"text": "crypto.randomUUID()"
|
|
9298
|
+
}
|
|
9299
|
+
],
|
|
9300
|
+
"default": "crypto.randomUUID()",
|
|
9295
9301
|
"values": [
|
|
9296
9302
|
{
|
|
9297
9303
|
"type": "string"
|
|
9298
9304
|
}
|
|
9299
9305
|
],
|
|
9300
|
-
"optional":
|
|
9301
|
-
"required":
|
|
9306
|
+
"optional": true,
|
|
9307
|
+
"required": false,
|
|
9302
9308
|
"getter": false,
|
|
9303
9309
|
"setter": false
|
|
9304
9310
|
},
|
|
@@ -76273,14 +76279,20 @@
|
|
|
76273
76279
|
"attr": "input-id",
|
|
76274
76280
|
"reflectToAttr": false,
|
|
76275
76281
|
"docs": "",
|
|
76276
|
-
"docsTags": [
|
|
76282
|
+
"docsTags": [
|
|
76283
|
+
{
|
|
76284
|
+
"name": "default",
|
|
76285
|
+
"text": "crypto.randomUUID()"
|
|
76286
|
+
}
|
|
76287
|
+
],
|
|
76288
|
+
"default": "crypto.randomUUID()",
|
|
76277
76289
|
"values": [
|
|
76278
76290
|
{
|
|
76279
76291
|
"type": "string"
|
|
76280
76292
|
}
|
|
76281
76293
|
],
|
|
76282
|
-
"optional":
|
|
76283
|
-
"required":
|
|
76294
|
+
"optional": true,
|
|
76295
|
+
"required": false,
|
|
76284
76296
|
"getter": false,
|
|
76285
76297
|
"setter": false
|
|
76286
76298
|
},
|
|
@@ -82275,14 +82287,20 @@
|
|
|
82275
82287
|
"attr": "input-id",
|
|
82276
82288
|
"reflectToAttr": false,
|
|
82277
82289
|
"docs": "",
|
|
82278
|
-
"docsTags": [
|
|
82290
|
+
"docsTags": [
|
|
82291
|
+
{
|
|
82292
|
+
"name": "default",
|
|
82293
|
+
"text": "crypto.randomUUID()"
|
|
82294
|
+
}
|
|
82295
|
+
],
|
|
82296
|
+
"default": "crypto.randomUUID()",
|
|
82279
82297
|
"values": [
|
|
82280
82298
|
{
|
|
82281
82299
|
"type": "string"
|
|
82282
82300
|
}
|
|
82283
82301
|
],
|
|
82284
|
-
"optional":
|
|
82285
|
-
"required":
|
|
82302
|
+
"optional": true,
|
|
82303
|
+
"required": false,
|
|
82286
82304
|
"getter": false,
|
|
82287
82305
|
"setter": false
|
|
82288
82306
|
},
|
|
@@ -11,6 +11,7 @@ const SwirlCheckbox = class {
|
|
|
11
11
|
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
12
12
|
this.checked = false;
|
|
13
13
|
this.disabled = false;
|
|
14
|
+
this.inputId = crypto.randomUUID();
|
|
14
15
|
this.labelWeight = "medium";
|
|
15
16
|
this.variant = "default";
|
|
16
17
|
this.onChange = () => {
|
|
@@ -44,7 +45,7 @@ const SwirlCheckbox = class {
|
|
|
44
45
|
"checkbox--invalid": this.invalid,
|
|
45
46
|
"checkbox--unchecked": unchecked,
|
|
46
47
|
});
|
|
47
|
-
return (index.h(index.Host, { key: '
|
|
48
|
+
return (index.h(index.Host, { key: 'e7c4032f95972cd2e90dc6f9bf899de38a154a4e', style: { width: this.variant === "card" ? "100%" : undefined } }, index.h("label", { key: '765ffc3ae1f9dc40fdc4a6683331af83af59d20a', class: className, htmlFor: this.inputId }, index.h("span", { key: '4100239fcbe52595fe5e38ea9967c3d99896eee6', class: "checkbox__control" }, index.h("swirl-visually-hidden", { key: 'd108786464e34b89ae5a6dd7d2deeb52d03922ca' }, index.h("input", { key: '206d3c0ab5d53ca3f9d4326084f4c8bffa29761b', "aria-checked": ariaCheckedLabel, "aria-describedby": this.swirlAriaDescribedby, "aria-invalid": ariaInvalid, "aria-label": this.swirlAriaLabel, checked: checked, class: "checkbox__input", disabled: this.disabled, id: this.inputId, indeterminate: indeterminate, name: this.inputName, onChange: this.onChange, type: "checkbox", value: this.value })), index.h("span", { key: '10acd779a97de8eb2828d74fa124a6d567482c39', "aria-hidden": "true", class: "checkbox__box" }, index.h("span", { key: '9055b3a6923a5ce5224147f3bb3ccd81cb548665', class: "checkbox__icon" }, checked && index.h("swirl-icon-check-strong", { key: '6c8ce0054a50831fdd2e64e4e9a1860a4a1592db' }), indeterminate && (index.h("span", { key: 'd35dca89d5c2ba494ff00d9e55150d3c27478948', class: "checkbox__indeterminate-icon" }))))), showLabelContainer && (index.h("span", { key: '0519275b5dcfbde82045fb472e7917e31c6441e3', class: "checkbox__label-container" }, this.label && index.h("span", { key: '577382d52c0d6afa4bcf72178341d6ca33c8145a', class: "checkbox__label" }, this.label), this.description && (index.h("span", { key: 'fec16480bf5388e60ec0218e47dc5be9b52a55cd', class: "checkbox__description" }, this.description)))))));
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
SwirlCheckbox.style = swirlCheckboxCss();
|
|
@@ -11,6 +11,7 @@ const SwirlRadio = class {
|
|
|
11
11
|
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
12
12
|
this.checked = false;
|
|
13
13
|
this.disabled = false;
|
|
14
|
+
this.inputId = crypto.randomUUID();
|
|
14
15
|
this.variant = "default";
|
|
15
16
|
this.onChange = () => {
|
|
16
17
|
this.checked = true;
|
|
@@ -37,7 +38,7 @@ const SwirlRadio = class {
|
|
|
37
38
|
"radio--invalid": this.invalid,
|
|
38
39
|
"radio--unchecked": unchecked,
|
|
39
40
|
});
|
|
40
|
-
return (index.h(index.Host, { key: '
|
|
41
|
+
return (index.h(index.Host, { key: 'cfb259d161199e74cfaa826aca8e9abd3ed8ffed', style: { width: this.variant === "card" ? "100%" : undefined } }, index.h("label", { key: '69e4a727c2e2ff6e2490643f38a269b82a82263a', class: className, htmlFor: this.inputId }, index.h("span", { key: 'c97180a8acbfd3176648f83c6d370ec15297162d', class: "radio__control" }, index.h("swirl-visually-hidden", { key: '46557b0101bafc9dae150b87291ac85819c105e8' }, index.h("input", { key: 'e5c88c448399e0e1c07638c2beb1dd2434292270', "aria-checked": ariaCheckedLabel, "aria-invalid": ariaInvalid, checked: checked, class: "radio__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, type: "radio", value: this.value })), index.h("span", { key: 'fc025452ad24d4cafe00ae9153ded9f899059e2d', "aria-hidden": "true", class: "radio__box" })), index.h("span", { key: '00f2eaa8df9223fe6c2791a1baa237ff96b9a1f4', class: "radio__label-container" }, this.label && (index.h("span", { key: '94739c905c8a9e10b2eba65d32528da16c3a025a', class: "radio__label" }, this.label, this.tooltip && (index.h("swirl-tooltip", { key: '965d305cb72b850497bd091fa8e6ac706c81923d', content: this.tooltip, position: "top" }, index.h("swirl-icon-help", { key: 'f582e563d7b07779d48896de0503499238127be3', color: "default", size: 20, tabIndex: 0 }))))), this.description && (index.h("span", { key: '65c9d3291fbac74b677008702df24e8e643eb8f3', class: "radio__description", innerHTML: this.description }))))));
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
SwirlRadio.style = swirlRadioCss();
|
|
@@ -11,6 +11,7 @@ const SwirlSwitch = class {
|
|
|
11
11
|
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
12
12
|
this.checked = false;
|
|
13
13
|
this.disabled = false;
|
|
14
|
+
this.inputId = crypto.randomUUID();
|
|
14
15
|
this.labelPosition = "end";
|
|
15
16
|
this.onChange = () => {
|
|
16
17
|
this.checked = !this.checked;
|
|
@@ -33,9 +34,9 @@ const SwirlSwitch = class {
|
|
|
33
34
|
"switch--disabled": this.disabled,
|
|
34
35
|
"switch--hide-content": this.hideLabel && (!this.description || this.hideDescription),
|
|
35
36
|
});
|
|
36
|
-
return (index.h(index.Host, { key: '
|
|
37
|
+
return (index.h(index.Host, { key: '0d68ddd690f66e644e85a53c1d86bb1469a4c8d4' }, index.h("label", { key: '8bd6c56d9e5c22c1d6fd34ad38abe000eaeb0600', class: className, htmlFor: this.inputId }, index.h("span", { key: '6f5284902b1f57fd78638cf368b95057a1f3ee78', class: "switch__control" }, index.h("swirl-visually-hidden", { key: 'a07e478a02f5a405589d4120a02ac4d0a0111f4d' }, index.h("input", { key: '009fc5ad9edb9252964d8828ff6e25e9642ad33a', "aria-checked": ariaCheckedLabel, "aria-label": !this.hideLabel && this.swirlAriaLabel
|
|
37
38
|
? this.swirlAriaLabel
|
|
38
|
-
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), index.h("span", { key: '
|
|
39
|
+
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), index.h("span", { key: 'e2fbb765f6d4fae8e35986f4979d7efd1cf7bf5b', "aria-hidden": "true", class: "switch__thumb" })), index.h("swirl-stack", { key: '9ac89fa753146fcdd1a99d439e4cb2b766ae77b4', class: "switch__content" }, this.label && !this.hideLabel && (index.h("span", { key: '56d4f1b982427f2f54656475113c97f2518d1a84', class: "switch__label" }, this.label)), this.hideLabel && (index.h("swirl-visually-hidden", { key: 'f9392a1f09cf4ed60065bb2f1f43925516d2dbaf' }, this.swirlAriaLabel || this.label)), this.description && !this.hideDescription && (index.h("span", { key: 'd712b05d3ed27eec29a097aa4e372ccf386b05ac', class: "switch__description" }, this.description)), this.description && this.hideDescription && (index.h("swirl-visually-hidden", { key: '076c244a36a043789d3099697c10c8d53c83bc48' }, this.description))))));
|
|
39
40
|
}
|
|
40
41
|
get el() { return index.getElement(this); }
|
|
41
42
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-D-n4TKMG.js');
|
|
4
4
|
|
|
5
|
-
const swirlVisuallyHiddenCss = () => `.sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;
|
|
5
|
+
const swirlVisuallyHiddenCss = () => `.sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;word-wrap:normal;white-space:nowrap;clip:rect(0, 0, 0, 0)}`;
|
|
6
6
|
|
|
7
7
|
const SwirlVisuallyHidden = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -4,6 +4,7 @@ export class SwirlCheckbox {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.checked = false;
|
|
6
6
|
this.disabled = false;
|
|
7
|
+
this.inputId = crypto.randomUUID();
|
|
7
8
|
this.labelWeight = "medium";
|
|
8
9
|
this.variant = "default";
|
|
9
10
|
this.onChange = () => {
|
|
@@ -37,7 +38,7 @@ export class SwirlCheckbox {
|
|
|
37
38
|
"checkbox--invalid": this.invalid,
|
|
38
39
|
"checkbox--unchecked": unchecked,
|
|
39
40
|
});
|
|
40
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: 'e7c4032f95972cd2e90dc6f9bf899de38a154a4e', style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { key: '765ffc3ae1f9dc40fdc4a6683331af83af59d20a', class: className, htmlFor: this.inputId }, h("span", { key: '4100239fcbe52595fe5e38ea9967c3d99896eee6', class: "checkbox__control" }, h("swirl-visually-hidden", { key: 'd108786464e34b89ae5a6dd7d2deeb52d03922ca' }, h("input", { key: '206d3c0ab5d53ca3f9d4326084f4c8bffa29761b', "aria-checked": ariaCheckedLabel, "aria-describedby": this.swirlAriaDescribedby, "aria-invalid": ariaInvalid, "aria-label": this.swirlAriaLabel, checked: checked, class: "checkbox__input", disabled: this.disabled, id: this.inputId, indeterminate: indeterminate, name: this.inputName, onChange: this.onChange, type: "checkbox", value: this.value })), h("span", { key: '10acd779a97de8eb2828d74fa124a6d567482c39', "aria-hidden": "true", class: "checkbox__box" }, h("span", { key: '9055b3a6923a5ce5224147f3bb3ccd81cb548665', class: "checkbox__icon" }, checked && h("swirl-icon-check-strong", { key: '6c8ce0054a50831fdd2e64e4e9a1860a4a1592db' }), indeterminate && (h("span", { key: 'd35dca89d5c2ba494ff00d9e55150d3c27478948', class: "checkbox__indeterminate-icon" }))))), showLabelContainer && (h("span", { key: '0519275b5dcfbde82045fb472e7917e31c6441e3', class: "checkbox__label-container" }, this.label && h("span", { key: '577382d52c0d6afa4bcf72178341d6ca33c8145a', class: "checkbox__label" }, this.label), this.description && (h("span", { key: 'fec16480bf5388e60ec0218e47dc5be9b52a55cd', class: "checkbox__description" }, this.description)))))));
|
|
41
42
|
}
|
|
42
43
|
static get is() { return "swirl-checkbox"; }
|
|
43
44
|
static get encapsulation() { return "scoped"; }
|
|
@@ -164,8 +165,8 @@ export class SwirlCheckbox {
|
|
|
164
165
|
"resolved": "string",
|
|
165
166
|
"references": {}
|
|
166
167
|
},
|
|
167
|
-
"required":
|
|
168
|
-
"optional":
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": true,
|
|
169
170
|
"docs": {
|
|
170
171
|
"tags": [],
|
|
171
172
|
"text": ""
|
|
@@ -173,7 +174,8 @@ export class SwirlCheckbox {
|
|
|
173
174
|
"getter": false,
|
|
174
175
|
"setter": false,
|
|
175
176
|
"reflect": false,
|
|
176
|
-
"attribute": "input-id"
|
|
177
|
+
"attribute": "input-id",
|
|
178
|
+
"defaultValue": "crypto.randomUUID()"
|
|
177
179
|
},
|
|
178
180
|
"inputName": {
|
|
179
181
|
"type": "string",
|
|
@@ -4,6 +4,7 @@ export class SwirlRadio {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.checked = false;
|
|
6
6
|
this.disabled = false;
|
|
7
|
+
this.inputId = crypto.randomUUID();
|
|
7
8
|
this.variant = "default";
|
|
8
9
|
this.onChange = () => {
|
|
9
10
|
this.checked = true;
|
|
@@ -30,7 +31,7 @@ export class SwirlRadio {
|
|
|
30
31
|
"radio--invalid": this.invalid,
|
|
31
32
|
"radio--unchecked": unchecked,
|
|
32
33
|
});
|
|
33
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: 'cfb259d161199e74cfaa826aca8e9abd3ed8ffed', style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { key: '69e4a727c2e2ff6e2490643f38a269b82a82263a', class: className, htmlFor: this.inputId }, h("span", { key: 'c97180a8acbfd3176648f83c6d370ec15297162d', class: "radio__control" }, h("swirl-visually-hidden", { key: '46557b0101bafc9dae150b87291ac85819c105e8' }, h("input", { key: 'e5c88c448399e0e1c07638c2beb1dd2434292270', "aria-checked": ariaCheckedLabel, "aria-invalid": ariaInvalid, checked: checked, class: "radio__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, type: "radio", value: this.value })), h("span", { key: 'fc025452ad24d4cafe00ae9153ded9f899059e2d', "aria-hidden": "true", class: "radio__box" })), h("span", { key: '00f2eaa8df9223fe6c2791a1baa237ff96b9a1f4', class: "radio__label-container" }, this.label && (h("span", { key: '94739c905c8a9e10b2eba65d32528da16c3a025a', class: "radio__label" }, this.label, this.tooltip && (h("swirl-tooltip", { key: '965d305cb72b850497bd091fa8e6ac706c81923d', content: this.tooltip, position: "top" }, h("swirl-icon-help", { key: 'f582e563d7b07779d48896de0503499238127be3', color: "default", size: 20, tabIndex: 0 }))))), this.description && (h("span", { key: '65c9d3291fbac74b677008702df24e8e643eb8f3', class: "radio__description", innerHTML: this.description }))))));
|
|
34
35
|
}
|
|
35
36
|
static get is() { return "swirl-radio"; }
|
|
36
37
|
static get encapsulation() { return "scoped"; }
|
|
@@ -119,8 +120,8 @@ export class SwirlRadio {
|
|
|
119
120
|
"resolved": "string",
|
|
120
121
|
"references": {}
|
|
121
122
|
},
|
|
122
|
-
"required":
|
|
123
|
-
"optional":
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": true,
|
|
124
125
|
"docs": {
|
|
125
126
|
"tags": [],
|
|
126
127
|
"text": ""
|
|
@@ -128,7 +129,8 @@ export class SwirlRadio {
|
|
|
128
129
|
"getter": false,
|
|
129
130
|
"setter": false,
|
|
130
131
|
"reflect": false,
|
|
131
|
-
"attribute": "input-id"
|
|
132
|
+
"attribute": "input-id",
|
|
133
|
+
"defaultValue": "crypto.randomUUID()"
|
|
132
134
|
},
|
|
133
135
|
"inputName": {
|
|
134
136
|
"type": "string",
|
|
@@ -4,6 +4,7 @@ export class SwirlSwitch {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.checked = false;
|
|
6
6
|
this.disabled = false;
|
|
7
|
+
this.inputId = crypto.randomUUID();
|
|
7
8
|
this.labelPosition = "end";
|
|
8
9
|
this.onChange = () => {
|
|
9
10
|
this.checked = !this.checked;
|
|
@@ -26,9 +27,9 @@ export class SwirlSwitch {
|
|
|
26
27
|
"switch--disabled": this.disabled,
|
|
27
28
|
"switch--hide-content": this.hideLabel && (!this.description || this.hideDescription),
|
|
28
29
|
});
|
|
29
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '0d68ddd690f66e644e85a53c1d86bb1469a4c8d4' }, h("label", { key: '8bd6c56d9e5c22c1d6fd34ad38abe000eaeb0600', class: className, htmlFor: this.inputId }, h("span", { key: '6f5284902b1f57fd78638cf368b95057a1f3ee78', class: "switch__control" }, h("swirl-visually-hidden", { key: 'a07e478a02f5a405589d4120a02ac4d0a0111f4d' }, h("input", { key: '009fc5ad9edb9252964d8828ff6e25e9642ad33a', "aria-checked": ariaCheckedLabel, "aria-label": !this.hideLabel && this.swirlAriaLabel
|
|
30
31
|
? this.swirlAriaLabel
|
|
31
|
-
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), h("span", { key: '
|
|
32
|
+
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), h("span", { key: 'e2fbb765f6d4fae8e35986f4979d7efd1cf7bf5b', "aria-hidden": "true", class: "switch__thumb" })), h("swirl-stack", { key: '9ac89fa753146fcdd1a99d439e4cb2b766ae77b4', class: "switch__content" }, this.label && !this.hideLabel && (h("span", { key: '56d4f1b982427f2f54656475113c97f2518d1a84', class: "switch__label" }, this.label)), this.hideLabel && (h("swirl-visually-hidden", { key: 'f9392a1f09cf4ed60065bb2f1f43925516d2dbaf' }, this.swirlAriaLabel || this.label)), this.description && !this.hideDescription && (h("span", { key: 'd712b05d3ed27eec29a097aa4e372ccf386b05ac', class: "switch__description" }, this.description)), this.description && this.hideDescription && (h("swirl-visually-hidden", { key: '076c244a36a043789d3099697c10c8d53c83bc48' }, this.description))))));
|
|
32
33
|
}
|
|
33
34
|
static get is() { return "swirl-switch"; }
|
|
34
35
|
static get encapsulation() { return "scoped"; }
|
|
@@ -149,8 +150,8 @@ export class SwirlSwitch {
|
|
|
149
150
|
"resolved": "string",
|
|
150
151
|
"references": {}
|
|
151
152
|
},
|
|
152
|
-
"required":
|
|
153
|
-
"optional":
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": true,
|
|
154
155
|
"docs": {
|
|
155
156
|
"tags": [],
|
|
156
157
|
"text": ""
|
|
@@ -158,7 +159,8 @@ export class SwirlSwitch {
|
|
|
158
159
|
"getter": false,
|
|
159
160
|
"setter": false,
|
|
160
161
|
"reflect": false,
|
|
161
|
-
"attribute": "input-id"
|
|
162
|
+
"attribute": "input-id",
|
|
163
|
+
"defaultValue": "crypto.randomUUID()"
|
|
162
164
|
},
|
|
163
165
|
"inputName": {
|
|
164
166
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as c,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as r}from"@stencil/core/internal/client";import{c as h}from"./index2.js";import{d as a}from"./swirl-icon-check-strong2.js";import{d as b}from"./swirl-visually-hidden2.js";const
|
|
1
|
+
import{proxyCustomElement as c,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as r}from"@stencil/core/internal/client";import{c as h}from"./index2.js";import{d as a}from"./swirl-icon-check-strong2.js";import{d as b}from"./swirl-visually-hidden2.js";const t=c(class extends e{constructor(c){super(),!1!==c&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.labelWeight="medium",this.variant="default",this.onChange=()=>{this.checked=!0!==this.checked&&"true"!==this.checked,this.valueChange.emit(this.checked)}}getAriaCheckedLabel(c,e){return c?"true":e?"false":"mixed"}render(){const c=!1===this.checked||"false"===this.checked,e=!0===this.checked||"true"===this.checked,i="indeterminate"===this.checked,r=!!this.label||!!this.description,a=this.getAriaCheckedLabel(e,c),b=!0===this.invalid||!1===this.invalid?this.invalid+"":void 0,t=h("checkbox","checkbox--label-weight-"+this.labelWeight,"checkbox--variant-"+this.variant,{"checkbox--checked":e,"checkbox--disabled":this.disabled,"checkbox--indeterminate":i,"checkbox--invalid":this.invalid,"checkbox--unchecked":c});return o(s,{key:"e7c4032f95972cd2e90dc6f9bf899de38a154a4e",style:{width:"card"===this.variant?"100%":void 0}},o("label",{key:"765ffc3ae1f9dc40fdc4a6683331af83af59d20a",class:t,htmlFor:this.inputId},o("span",{key:"4100239fcbe52595fe5e38ea9967c3d99896eee6",class:"checkbox__control"},o("swirl-visually-hidden",{key:"d108786464e34b89ae5a6dd7d2deeb52d03922ca"},o("input",{key:"206d3c0ab5d53ca3f9d4326084f4c8bffa29761b","aria-checked":a,"aria-describedby":this.swirlAriaDescribedby,"aria-invalid":b,"aria-label":this.swirlAriaLabel,checked:e,class:"checkbox__input",disabled:this.disabled,id:this.inputId,indeterminate:i,name:this.inputName,onChange:this.onChange,type:"checkbox",value:this.value})),o("span",{key:"10acd779a97de8eb2828d74fa124a6d567482c39","aria-hidden":"true",class:"checkbox__box"},o("span",{key:"9055b3a6923a5ce5224147f3bb3ccd81cb548665",class:"checkbox__icon"},e&&o("swirl-icon-check-strong",{key:"6c8ce0054a50831fdd2e64e4e9a1860a4a1592db"}),i&&o("span",{key:"d35dca89d5c2ba494ff00d9e55150d3c27478948",class:"checkbox__indeterminate-icon"})))),r&&o("span",{key:"0519275b5dcfbde82045fb472e7917e31c6441e3",class:"checkbox__label-container"},this.label&&o("span",{key:"577382d52c0d6afa4bcf72178341d6ca33c8145a",class:"checkbox__label"},this.label),this.description&&o("span",{key:"fec16480bf5388e60ec0218e47dc5be9b52a55cd",class:"checkbox__description"},this.description))))}static get style(){return'.sc-swirl-checkbox-h{display:inline-flex}.sc-swirl-checkbox-h *.sc-swirl-checkbox{box-sizing:border-box}.checkbox.sc-swirl-checkbox{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer;flex-grow:1}.checkbox.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.checkbox--variant-card.sc-swirl-checkbox:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default), 0 0 0 0.25rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:none}.checkbox--variant-card.sc-swirl-checkbox:hover:not(.checkbox--disabled){background-color:var(--s-state-hovered)}.checkbox--variant-card.sc-swirl-checkbox:active:not(.checkbox--disabled){background-color:var(--s-state-pressed)}.checkbox--variant-card.checkbox--checked.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-highlight)}.checkbox--variant-card.checkbox--invalid.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-critical)}.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.checkbox--invalid.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--invalid.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-critical)}.checkbox--invalid.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-critical)}.checkbox--disabled.sc-swirl-checkbox{cursor:default}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled);background-color:var(--s-icon-disabled)}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:transparent}.checkbox--disabled.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox,.checkbox--disabled.sc-swirl-checkbox .checkbox__description.sc-swirl-checkbox{color:var(--s-text-disabled)}.checkbox--label-weight-regular.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-regular)}.checkbox__control.sc-swirl-checkbox{position:relative;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__control.sc-swirl-checkbox{width:1.375rem;height:1.375rem}}.checkbox__box.sc-swirl-checkbox{position:relative;z-index:1;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.checkbox__icon.sc-swirl-checkbox{display:inline-flex;width:1.0625rem;height:1.0625rem}.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox::part(icon),.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox [part~="icon"]{width:1.0625rem;height:1.0625rem}.checkbox__indeterminate-icon.sc-swirl-checkbox{position:relative;width:100%;height:100%}.checkbox__indeterminate-icon.sc-swirl-checkbox:after{position:absolute;top:50%;left:50%;width:0.625rem;height:0.125rem;border-radius:0.0625rem;background-color:currentColor;content:"";transform:translate3d(-50%, -50%, 0)}.checkbox__label-container.sc-swirl-checkbox{display:inline-flex;margin-left:var(--s-space-8);align-items:flex-start;flex-direction:column}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label-container.sc-swirl-checkbox{padding-top:var(--s-space-2)}}.checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.checkbox__description.sc-swirl-checkbox{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__description.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}'}},[2,"swirl-checkbox",{checked:[1032],description:[1],disabled:[4],swirlAriaDescribedby:[1,"swirl-aria-describedby"],swirlAriaLabel:[1,"swirl-aria-label"],inputId:[1,"input-id"],inputName:[1,"input-name"],invalid:[4],label:[1],labelWeight:[1,"label-weight"],value:[1],variant:[1]}]),l=t,d=function(){"undefined"!=typeof customElements&&["swirl-checkbox","swirl-icon-check-strong","swirl-visually-hidden"].forEach((c=>{switch(c){case"swirl-checkbox":customElements.get(r(c))||customElements.define(r(c),t);break;case"swirl-icon-check-strong":customElements.get(r(c))||a();break;case"swirl-visually-hidden":customElements.get(r(c))||b()}}))};export{l as SwirlCheckbox,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as i,HTMLElement as r,createEvent as a,h as o,Host as d,transformTag as s}from"@stencil/core/internal/client";import{c as e}from"./index2.js";import{d as c}from"./swirl-icon-help2.js";import{d as l}from"./swirl-tooltip2.js";import{d as t}from"./swirl-visually-hidden2.js";const n=i(class extends r{constructor(i){super(),!1!==i&&this.__registerHost(),this.valueChange=a(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.variant="default",this.onChange=()=>{this.checked=!0,this.valueChange.emit(this.value)}}getAriaCheckedLabel(i,r){return i?"true":r?"false":"mixed"}render(){const i=!1===this.checked||"false"===this.checked,r=!0===this.checked||"true"===this.checked,a=this.getAriaCheckedLabel(r,i),s=this.invalid,c=e("radio","radio--variant-"+this.variant,{"radio--checked":r,"radio--disabled":this.disabled,"radio--invalid":this.invalid,"radio--unchecked":i});return o(d,{key:"
|
|
1
|
+
import{proxyCustomElement as i,HTMLElement as r,createEvent as a,h as o,Host as d,transformTag as s}from"@stencil/core/internal/client";import{c as e}from"./index2.js";import{d as c}from"./swirl-icon-help2.js";import{d as l}from"./swirl-tooltip2.js";import{d as t}from"./swirl-visually-hidden2.js";const n=i(class extends r{constructor(i){super(),!1!==i&&this.__registerHost(),this.valueChange=a(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.variant="default",this.onChange=()=>{this.checked=!0,this.valueChange.emit(this.value)}}getAriaCheckedLabel(i,r){return i?"true":r?"false":"mixed"}render(){const i=!1===this.checked||"false"===this.checked,r=!0===this.checked||"true"===this.checked,a=this.getAriaCheckedLabel(r,i),s=this.invalid,c=e("radio","radio--variant-"+this.variant,{"radio--checked":r,"radio--disabled":this.disabled,"radio--invalid":this.invalid,"radio--unchecked":i});return o(d,{key:"cfb259d161199e74cfaa826aca8e9abd3ed8ffed",style:{width:"card"===this.variant?"100%":void 0}},o("label",{key:"69e4a727c2e2ff6e2490643f38a269b82a82263a",class:c,htmlFor:this.inputId},o("span",{key:"c97180a8acbfd3176648f83c6d370ec15297162d",class:"radio__control"},o("swirl-visually-hidden",{key:"46557b0101bafc9dae150b87291ac85819c105e8"},o("input",{key:"e5c88c448399e0e1c07638c2beb1dd2434292270","aria-checked":a,"aria-invalid":s,checked:r,class:"radio__input",disabled:this.disabled,id:this.inputId,name:this.inputName,onChange:this.onChange,type:"radio",value:this.value})),o("span",{key:"fc025452ad24d4cafe00ae9153ded9f899059e2d","aria-hidden":"true",class:"radio__box"})),o("span",{key:"00f2eaa8df9223fe6c2791a1baa237ff96b9a1f4",class:"radio__label-container"},this.label&&o("span",{key:"94739c905c8a9e10b2eba65d32528da16c3a025a",class:"radio__label"},this.label,this.tooltip&&o("swirl-tooltip",{key:"965d305cb72b850497bd091fa8e6ac706c81923d",content:this.tooltip,position:"top"},o("swirl-icon-help",{key:"f582e563d7b07779d48896de0503499238127be3",color:"default",size:20,tabIndex:0}))),this.description&&o("span",{key:"65c9d3291fbac74b677008702df24e8e643eb8f3",class:"radio__description",innerHTML:this.description}))))}static get style(){return'.sc-swirl-radio-h{display:inline-flex}.sc-swirl-radio-h *.sc-swirl-radio{box-sizing:border-box}.radio.sc-swirl-radio{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer;align-items:center}.radio.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.radio--variant-card.sc-swirl-radio:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default), 0 0 0 0.25rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:none}.radio--variant-card.sc-swirl-radio:hover:not(.radio--disabled){background-color:var(--s-state-hovered)}.radio--variant-card.sc-swirl-radio:active:not(.radio--disabled){background-color:var(--s-state-pressed)}.radio--variant-card.radio--checked.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-highlight)}.radio--variant-card.radio--invalid.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-critical)}.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{position:relative;border-color:var(--s-icon-highlight);background-color:var(--s-icon-highlight)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{position:absolute;top:50%;left:50%;width:0.5rem;height:0.5rem;border-radius:50%;background-color:var(--s-background-default);content:"";transform:translate3d(-50%, -50%, 0)}.radio--invalid.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio,.radio--invalid.radio--indeterminate.sc-swirl-radio .radio__box.sc-swirl-radio{background-color:var(--s-icon-critical)}.radio--invalid.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-critical)}.radio--disabled.sc-swirl-radio{cursor:default}.radio--disabled.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:transparent}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:var(--s-background-default)}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{background-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:transparent}.radio--disabled.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__description.sc-swirl-radio,.radio--disabled.sc-swirl-radio .radio__label.sc-swirl-radio{color:var(--s-text-disabled)}.radio__control.sc-swirl-radio{position:relative;display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__control.sc-swirl-radio{width:1.375rem;height:1.375rem}}.radio__box.sc-swirl-radio{position:relative;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:50%}.radio__label-container.sc-swirl-radio{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);flex-direction:column}.radio__label.sc-swirl-radio{display:flex;align-items:center;font-weight:var(--s-font-weight-medium);gap:var(--s-space-8)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__label.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.radio__description.sc-swirl-radio{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__description.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}'}},[2,"swirl-radio",{checked:[1032],description:[1],disabled:[4],inputId:[1,"input-id"],inputName:[1,"input-name"],invalid:[4],label:[1],tooltip:[1],value:[1],variant:[1]}]),h=n,b=function(){"undefined"!=typeof customElements&&["swirl-radio","swirl-icon-help","swirl-tooltip","swirl-visually-hidden"].forEach((i=>{switch(i){case"swirl-radio":customElements.get(s(i))||customElements.define(s(i),n);break;case"swirl-icon-help":customElements.get(s(i))||c();break;case"swirl-tooltip":customElements.get(s(i))||l();break;case"swirl-visually-hidden":customElements.get(s(i))||t()}}))};export{h as SwirlRadio,b as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as i,HTMLElement as s,createEvent as t,h as e,Host as c,transformTag as r}from"@stencil/core/internal/client";import{c as h}from"./index2.js";import{d as a}from"./swirl-stack2.js";import{d as l}from"./swirl-visually-hidden2.js";const n=i(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.valueChange=t(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.labelPosition="end",this.onChange=()=>{this.checked=!this.checked,this.valueChange.emit(this.checked)}}async toggle(){this.inputEl.dispatchEvent(new Event("change"))}render(){const i=this.checked,s=i?"true":"false",t=h("switch","switch--label-position-"+this.labelPosition,{"switch--off":!this.checked,"switch--on":i,"switch--disabled":this.disabled,"switch--hide-content":this.hideLabel&&(!this.description||this.hideDescription)});return e(c,{key:"
|
|
1
|
+
import{proxyCustomElement as i,HTMLElement as s,createEvent as t,h as e,Host as c,transformTag as r}from"@stencil/core/internal/client";import{c as h}from"./index2.js";import{d as a}from"./swirl-stack2.js";import{d as l}from"./swirl-visually-hidden2.js";const n=i(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.valueChange=t(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.labelPosition="end",this.onChange=()=>{this.checked=!this.checked,this.valueChange.emit(this.checked)}}async toggle(){this.inputEl.dispatchEvent(new Event("change"))}render(){const i=this.checked,s=i?"true":"false",t=h("switch","switch--label-position-"+this.labelPosition,{"switch--off":!this.checked,"switch--on":i,"switch--disabled":this.disabled,"switch--hide-content":this.hideLabel&&(!this.description||this.hideDescription)});return e(c,{key:"0d68ddd690f66e644e85a53c1d86bb1469a4c8d4"},e("label",{key:"8bd6c56d9e5c22c1d6fd34ad38abe000eaeb0600",class:t,htmlFor:this.inputId},e("span",{key:"6f5284902b1f57fd78638cf368b95057a1f3ee78",class:"switch__control"},e("swirl-visually-hidden",{key:"a07e478a02f5a405589d4120a02ac4d0a0111f4d"},e("input",{key:"009fc5ad9edb9252964d8828ff6e25e9642ad33a","aria-checked":s,"aria-label":!this.hideLabel&&this.swirlAriaLabel?this.swirlAriaLabel:void 0,checked:i,class:"switch__input",disabled:this.disabled,id:this.inputId,name:this.inputName,onChange:this.onChange,ref:i=>this.inputEl=i,role:"switch",type:"checkbox",value:this.value})),e("span",{key:"e2fbb765f6d4fae8e35986f4979d7efd1cf7bf5b","aria-hidden":"true",class:"switch__thumb"})),e("swirl-stack",{key:"9ac89fa753146fcdd1a99d439e4cb2b766ae77b4",class:"switch__content"},this.label&&!this.hideLabel&&e("span",{key:"56d4f1b982427f2f54656475113c97f2518d1a84",class:"switch__label"},this.label),this.hideLabel&&e("swirl-visually-hidden",{key:"f9392a1f09cf4ed60065bb2f1f43925516d2dbaf"},this.swirlAriaLabel||this.label),this.description&&!this.hideDescription&&e("span",{key:"d712b05d3ed27eec29a097aa4e372ccf386b05ac",class:"switch__description"},this.description),this.description&&this.hideDescription&&e("swirl-visually-hidden",{key:"076c244a36a043789d3099697c10c8d53c83bc48"},this.description))))}get el(){return this}static get style(){return".sc-swirl-switch-h{display:inline-flex;max-width:100%}.sc-swirl-switch-h *.sc-swirl-switch{box-sizing:border-box}.switch.sc-swirl-switch{display:inline-flex;width:100%;align-items:center;touch-action:none}.switch.sc-swirl-switch:focus-within .switch__control.sc-swirl-switch{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.switch--label-position-start.sc-swirl-switch{flex-direction:row-reverse}.switch--label-position-start.sc-swirl-switch .switch__content.sc-swirl-switch{margin-right:var(--s-space-12);margin-left:0}.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 1.25rem - var(--s-space-2))}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 0.875rem - var(--s-space-2))}}.switch--on.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-default)}.switch--disabled.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-disabled);cursor:default}.switch--disabled.sc-swirl-switch .switch__thumb.sc-swirl-switch{background-color:var(--s-interactive-neutral-default)}.switch--disabled.sc-swirl-switch .switch__label.sc-swirl-switch{color:var(--s-text-disabled)}.switch--hide-content.sc-swirl-switch .switch__content.sc-swirl-switch{margin-left:0}.switch__control.sc-swirl-switch{position:relative;width:2.75rem;height:1.5rem;flex-shrink:0;border-radius:calc(1.5rem / 2);background-color:var(--s-interactive-primary-disabled);cursor:pointer;transition:background-color 0.2s}@media (prefers-reduced-motion){.switch__control.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__control.sc-swirl-switch{width:1.875rem;height:1.125rem;border-radius:calc(1.125rem / 2)}}.switch__thumb.sc-swirl-switch{position:absolute;top:var(--s-space-2);left:var(--s-space-2);width:1.25rem;height:1.25rem;border-radius:50%;background-color:var(--s-surface-default);transition:left 0.2s;pointer-events:none}@media (prefers-reduced-motion){.switch__thumb.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__thumb.sc-swirl-switch{width:0.875rem;height:0.875rem}}.switch__content.sc-swirl-switch{position:relative;z-index:1;margin-left:var(--s-space-12)}.switch__label.sc-swirl-switch{overflow:hidden;font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);white-space:nowrap;text-overflow:ellipsis}.switch__description.sc-swirl-switch{color:var(--s-text-subdued);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-normal);line-height:var(--s-line-height-sm)}"}},[2,"swirl-switch",{checked:[1028],description:[1],disabled:[4],hideDescription:[4,"hide-description"],hideLabel:[4,"hide-label"],inputId:[1,"input-id"],inputName:[1,"input-name"],label:[1],labelPosition:[1,"label-position"],value:[1],swirlAriaLabel:[1,"swirl-aria-label"],toggle:[64]}]),d=n,w=function(){"undefined"!=typeof customElements&&["swirl-switch","swirl-stack","swirl-visually-hidden"].forEach((i=>{switch(i){case"swirl-switch":customElements.get(r(i))||customElements.define(r(i),n);break;case"swirl-stack":customElements.get(r(i))||a();break;case"swirl-visually-hidden":customElements.get(r(i))||l()}}))};export{d as SwirlSwitch,w as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,h as s,Host as t,transformTag as n}from"@stencil/core/internal/client";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return s(t,{key:"482c1ecff1f05c4e937aecc0f173b8d9db242cef"},s("slot",{key:"adcbcfa81a30d9609a37c1be5cb38db48e6704f8"}))}static get style(){return".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,h as s,Host as t,transformTag as n}from"@stencil/core/internal/client";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return s(t,{key:"482c1ecff1f05c4e937aecc0f173b8d9db242cef"},s("slot",{key:"adcbcfa81a30d9609a37c1be5cb38db48e6704f8"}))}static get style(){return".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;word-wrap:normal;white-space:nowrap;clip:rect(0, 0, 0, 0)}"}},[262,"swirl-visually-hidden"]);function r(){"undefined"!=typeof customElements&&["swirl-visually-hidden"].forEach((e=>{"swirl-visually-hidden"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))}export{l as S,r as d}
|
|
@@ -9,6 +9,7 @@ const SwirlCheckbox = class {
|
|
|
9
9
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
10
10
|
this.checked = false;
|
|
11
11
|
this.disabled = false;
|
|
12
|
+
this.inputId = crypto.randomUUID();
|
|
12
13
|
this.labelWeight = "medium";
|
|
13
14
|
this.variant = "default";
|
|
14
15
|
this.onChange = () => {
|
|
@@ -42,7 +43,7 @@ const SwirlCheckbox = class {
|
|
|
42
43
|
"checkbox--invalid": this.invalid,
|
|
43
44
|
"checkbox--unchecked": unchecked,
|
|
44
45
|
});
|
|
45
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: 'e7c4032f95972cd2e90dc6f9bf899de38a154a4e', style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { key: '765ffc3ae1f9dc40fdc4a6683331af83af59d20a', class: className, htmlFor: this.inputId }, h("span", { key: '4100239fcbe52595fe5e38ea9967c3d99896eee6', class: "checkbox__control" }, h("swirl-visually-hidden", { key: 'd108786464e34b89ae5a6dd7d2deeb52d03922ca' }, h("input", { key: '206d3c0ab5d53ca3f9d4326084f4c8bffa29761b', "aria-checked": ariaCheckedLabel, "aria-describedby": this.swirlAriaDescribedby, "aria-invalid": ariaInvalid, "aria-label": this.swirlAriaLabel, checked: checked, class: "checkbox__input", disabled: this.disabled, id: this.inputId, indeterminate: indeterminate, name: this.inputName, onChange: this.onChange, type: "checkbox", value: this.value })), h("span", { key: '10acd779a97de8eb2828d74fa124a6d567482c39', "aria-hidden": "true", class: "checkbox__box" }, h("span", { key: '9055b3a6923a5ce5224147f3bb3ccd81cb548665', class: "checkbox__icon" }, checked && h("swirl-icon-check-strong", { key: '6c8ce0054a50831fdd2e64e4e9a1860a4a1592db' }), indeterminate && (h("span", { key: 'd35dca89d5c2ba494ff00d9e55150d3c27478948', class: "checkbox__indeterminate-icon" }))))), showLabelContainer && (h("span", { key: '0519275b5dcfbde82045fb472e7917e31c6441e3', class: "checkbox__label-container" }, this.label && h("span", { key: '577382d52c0d6afa4bcf72178341d6ca33c8145a', class: "checkbox__label" }, this.label), this.description && (h("span", { key: 'fec16480bf5388e60ec0218e47dc5be9b52a55cd', class: "checkbox__description" }, this.description)))))));
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
SwirlCheckbox.style = swirlCheckboxCss();
|
|
@@ -9,6 +9,7 @@ const SwirlRadio = class {
|
|
|
9
9
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
10
10
|
this.checked = false;
|
|
11
11
|
this.disabled = false;
|
|
12
|
+
this.inputId = crypto.randomUUID();
|
|
12
13
|
this.variant = "default";
|
|
13
14
|
this.onChange = () => {
|
|
14
15
|
this.checked = true;
|
|
@@ -35,7 +36,7 @@ const SwirlRadio = class {
|
|
|
35
36
|
"radio--invalid": this.invalid,
|
|
36
37
|
"radio--unchecked": unchecked,
|
|
37
38
|
});
|
|
38
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'cfb259d161199e74cfaa826aca8e9abd3ed8ffed', style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { key: '69e4a727c2e2ff6e2490643f38a269b82a82263a', class: className, htmlFor: this.inputId }, h("span", { key: 'c97180a8acbfd3176648f83c6d370ec15297162d', class: "radio__control" }, h("swirl-visually-hidden", { key: '46557b0101bafc9dae150b87291ac85819c105e8' }, h("input", { key: 'e5c88c448399e0e1c07638c2beb1dd2434292270', "aria-checked": ariaCheckedLabel, "aria-invalid": ariaInvalid, checked: checked, class: "radio__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, type: "radio", value: this.value })), h("span", { key: 'fc025452ad24d4cafe00ae9153ded9f899059e2d', "aria-hidden": "true", class: "radio__box" })), h("span", { key: '00f2eaa8df9223fe6c2791a1baa237ff96b9a1f4', class: "radio__label-container" }, this.label && (h("span", { key: '94739c905c8a9e10b2eba65d32528da16c3a025a', class: "radio__label" }, this.label, this.tooltip && (h("swirl-tooltip", { key: '965d305cb72b850497bd091fa8e6ac706c81923d', content: this.tooltip, position: "top" }, h("swirl-icon-help", { key: 'f582e563d7b07779d48896de0503499238127be3', color: "default", size: 20, tabIndex: 0 }))))), this.description && (h("span", { key: '65c9d3291fbac74b677008702df24e8e643eb8f3', class: "radio__description", innerHTML: this.description }))))));
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
SwirlRadio.style = swirlRadioCss();
|
|
@@ -9,6 +9,7 @@ const SwirlSwitch = class {
|
|
|
9
9
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
10
10
|
this.checked = false;
|
|
11
11
|
this.disabled = false;
|
|
12
|
+
this.inputId = crypto.randomUUID();
|
|
12
13
|
this.labelPosition = "end";
|
|
13
14
|
this.onChange = () => {
|
|
14
15
|
this.checked = !this.checked;
|
|
@@ -31,9 +32,9 @@ const SwirlSwitch = class {
|
|
|
31
32
|
"switch--disabled": this.disabled,
|
|
32
33
|
"switch--hide-content": this.hideLabel && (!this.description || this.hideDescription),
|
|
33
34
|
});
|
|
34
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '0d68ddd690f66e644e85a53c1d86bb1469a4c8d4' }, h("label", { key: '8bd6c56d9e5c22c1d6fd34ad38abe000eaeb0600', class: className, htmlFor: this.inputId }, h("span", { key: '6f5284902b1f57fd78638cf368b95057a1f3ee78', class: "switch__control" }, h("swirl-visually-hidden", { key: 'a07e478a02f5a405589d4120a02ac4d0a0111f4d' }, h("input", { key: '009fc5ad9edb9252964d8828ff6e25e9642ad33a', "aria-checked": ariaCheckedLabel, "aria-label": !this.hideLabel && this.swirlAriaLabel
|
|
35
36
|
? this.swirlAriaLabel
|
|
36
|
-
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), h("span", { key: '
|
|
37
|
+
: undefined, checked: on, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, ref: (el) => (this.inputEl = el), role: "switch", type: "checkbox", value: this.value })), h("span", { key: 'e2fbb765f6d4fae8e35986f4979d7efd1cf7bf5b', "aria-hidden": "true", class: "switch__thumb" })), h("swirl-stack", { key: '9ac89fa753146fcdd1a99d439e4cb2b766ae77b4', class: "switch__content" }, this.label && !this.hideLabel && (h("span", { key: '56d4f1b982427f2f54656475113c97f2518d1a84', class: "switch__label" }, this.label)), this.hideLabel && (h("swirl-visually-hidden", { key: 'f9392a1f09cf4ed60065bb2f1f43925516d2dbaf' }, this.swirlAriaLabel || this.label)), this.description && !this.hideDescription && (h("span", { key: 'd712b05d3ed27eec29a097aa4e372ccf386b05ac', class: "switch__description" }, this.description)), this.description && this.hideDescription && (h("swirl-visually-hidden", { key: '076c244a36a043789d3099697c10c8d53c83bc48' }, this.description))))));
|
|
37
38
|
}
|
|
38
39
|
get el() { return getElement(this); }
|
|
39
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as Host } from './index-Dz56lJ37.js';
|
|
2
2
|
|
|
3
|
-
const swirlVisuallyHiddenCss = () => `.sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;
|
|
3
|
+
const swirlVisuallyHiddenCss = () => `.sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;word-wrap:normal;white-space:nowrap;clip:rect(0, 0, 0, 0)}`;
|
|
4
4
|
|
|
5
5
|
const SwirlVisuallyHidden = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as r,a}from"./p-Dz56lJ37.js";const i=class{constructor(r){e(this,r)}render(){return r(a,{key:"482c1ecff1f05c4e937aecc0f173b8d9db242cef"},r("slot",{key:"adcbcfa81a30d9609a37c1be5cb38db48e6704f8"}))}};i.style=".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;
|
|
1
|
+
import{r as e,h as r,a}from"./p-Dz56lJ37.js";const i=class{constructor(r){e(this,r)}render(){return r(a,{key:"482c1ecff1f05c4e937aecc0f173b8d9db242cef"},r("slot",{key:"adcbcfa81a30d9609a37c1be5cb38db48e6704f8"}))}};i.style=".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;word-wrap:normal;white-space:nowrap;clip:rect(0, 0, 0, 0)}";export{i as swirl_visually_hidden}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as r,h as a,a as o}from"./p-Dz56lJ37.js";import{c as d}from"./p-orsBiyT_.js";const s=class{constructor(a){i(this,a),this.valueChange=r(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.variant="default",this.onChange=()=>{this.checked=!0,this.valueChange.emit(this.value)}}getAriaCheckedLabel(i,r){return i?"true":r?"false":"mixed"}render(){const i=!1===this.checked||"false"===this.checked,r=!0===this.checked||"true"===this.checked,s=this.getAriaCheckedLabel(r,i),e=this.invalid,c=d("radio",`radio--variant-${this.variant}`,{"radio--checked":r,"radio--disabled":this.disabled,"radio--invalid":this.invalid,"radio--unchecked":i});return a(o,{key:"cfb259d161199e74cfaa826aca8e9abd3ed8ffed",style:{width:"card"===this.variant?"100%":void 0}},a("label",{key:"69e4a727c2e2ff6e2490643f38a269b82a82263a",class:c,htmlFor:this.inputId},a("span",{key:"c97180a8acbfd3176648f83c6d370ec15297162d",class:"radio__control"},a("swirl-visually-hidden",{key:"46557b0101bafc9dae150b87291ac85819c105e8"},a("input",{key:"e5c88c448399e0e1c07638c2beb1dd2434292270","aria-checked":s,"aria-invalid":e,checked:r,class:"radio__input",disabled:this.disabled,id:this.inputId,name:this.inputName,onChange:this.onChange,type:"radio",value:this.value})),a("span",{key:"fc025452ad24d4cafe00ae9153ded9f899059e2d","aria-hidden":"true",class:"radio__box"})),a("span",{key:"00f2eaa8df9223fe6c2791a1baa237ff96b9a1f4",class:"radio__label-container"},this.label&&a("span",{key:"94739c905c8a9e10b2eba65d32528da16c3a025a",class:"radio__label"},this.label,this.tooltip&&a("swirl-tooltip",{key:"965d305cb72b850497bd091fa8e6ac706c81923d",content:this.tooltip,position:"top"},a("swirl-icon-help",{key:"f582e563d7b07779d48896de0503499238127be3",color:"default",size:20,tabIndex:0}))),this.description&&a("span",{key:"65c9d3291fbac74b677008702df24e8e643eb8f3",class:"radio__description",innerHTML:this.description}))))}};s.style='.sc-swirl-radio-h{display:inline-flex}.sc-swirl-radio-h *.sc-swirl-radio{box-sizing:border-box}.radio.sc-swirl-radio{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer;align-items:center}.radio.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.radio--variant-card.sc-swirl-radio:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default), 0 0 0 0.25rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:none}.radio--variant-card.sc-swirl-radio:hover:not(.radio--disabled){background-color:var(--s-state-hovered)}.radio--variant-card.sc-swirl-radio:active:not(.radio--disabled){background-color:var(--s-state-pressed)}.radio--variant-card.radio--checked.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-highlight)}.radio--variant-card.radio--invalid.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-critical)}.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{position:relative;border-color:var(--s-icon-highlight);background-color:var(--s-icon-highlight)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{position:absolute;top:50%;left:50%;width:0.5rem;height:0.5rem;border-radius:50%;background-color:var(--s-background-default);content:"";transform:translate3d(-50%, -50%, 0)}.radio--invalid.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio,.radio--invalid.radio--indeterminate.sc-swirl-radio .radio__box.sc-swirl-radio{background-color:var(--s-icon-critical)}.radio--invalid.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-critical)}.radio--disabled.sc-swirl-radio{cursor:default}.radio--disabled.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:transparent}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:var(--s-background-default)}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{background-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:transparent}.radio--disabled.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__description.sc-swirl-radio,.radio--disabled.sc-swirl-radio .radio__label.sc-swirl-radio{color:var(--s-text-disabled)}.radio__control.sc-swirl-radio{position:relative;display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__control.sc-swirl-radio{width:1.375rem;height:1.375rem}}.radio__box.sc-swirl-radio{position:relative;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:50%}.radio__label-container.sc-swirl-radio{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);flex-direction:column}.radio__label.sc-swirl-radio{display:flex;align-items:center;font-weight:var(--s-font-weight-medium);gap:var(--s-space-8)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__label.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.radio__description.sc-swirl-radio{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__description.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}';export{s as swirl_radio}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,c as e,h as o,a as i}from"./p-Dz56lJ37.js";import{c as s}from"./p-orsBiyT_.js";const r=class{constructor(o){c(this,o),this.valueChange=e(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.labelWeight="medium",this.variant="default",this.onChange=()=>{this.checked=!0!==this.checked&&"true"!==this.checked,this.valueChange.emit(this.checked)}}getAriaCheckedLabel(c,e){return c?"true":e?"false":"mixed"}render(){const c=!1===this.checked||"false"===this.checked,e=!0===this.checked||"true"===this.checked,r="indeterminate"===this.checked,h=Boolean(this.label)||Boolean(this.description),a=this.getAriaCheckedLabel(e,c),b=!0===this.invalid||!1===this.invalid?String(this.invalid):void 0,d=s("checkbox",`checkbox--label-weight-${this.labelWeight}`,`checkbox--variant-${this.variant}`,{"checkbox--checked":e,"checkbox--disabled":this.disabled,"checkbox--indeterminate":r,"checkbox--invalid":this.invalid,"checkbox--unchecked":c});return o(i,{key:"e7c4032f95972cd2e90dc6f9bf899de38a154a4e",style:{width:"card"===this.variant?"100%":void 0}},o("label",{key:"765ffc3ae1f9dc40fdc4a6683331af83af59d20a",class:d,htmlFor:this.inputId},o("span",{key:"4100239fcbe52595fe5e38ea9967c3d99896eee6",class:"checkbox__control"},o("swirl-visually-hidden",{key:"d108786464e34b89ae5a6dd7d2deeb52d03922ca"},o("input",{key:"206d3c0ab5d53ca3f9d4326084f4c8bffa29761b","aria-checked":a,"aria-describedby":this.swirlAriaDescribedby,"aria-invalid":b,"aria-label":this.swirlAriaLabel,checked:e,class:"checkbox__input",disabled:this.disabled,id:this.inputId,indeterminate:r,name:this.inputName,onChange:this.onChange,type:"checkbox",value:this.value})),o("span",{key:"10acd779a97de8eb2828d74fa124a6d567482c39","aria-hidden":"true",class:"checkbox__box"},o("span",{key:"9055b3a6923a5ce5224147f3bb3ccd81cb548665",class:"checkbox__icon"},e&&o("swirl-icon-check-strong",{key:"6c8ce0054a50831fdd2e64e4e9a1860a4a1592db"}),r&&o("span",{key:"d35dca89d5c2ba494ff00d9e55150d3c27478948",class:"checkbox__indeterminate-icon"})))),h&&o("span",{key:"0519275b5dcfbde82045fb472e7917e31c6441e3",class:"checkbox__label-container"},this.label&&o("span",{key:"577382d52c0d6afa4bcf72178341d6ca33c8145a",class:"checkbox__label"},this.label),this.description&&o("span",{key:"fec16480bf5388e60ec0218e47dc5be9b52a55cd",class:"checkbox__description"},this.description))))}};r.style='.sc-swirl-checkbox-h{display:inline-flex}.sc-swirl-checkbox-h *.sc-swirl-checkbox{box-sizing:border-box}.checkbox.sc-swirl-checkbox{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer;flex-grow:1}.checkbox.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.checkbox--variant-card.sc-swirl-checkbox:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default), 0 0 0 0.25rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:none}.checkbox--variant-card.sc-swirl-checkbox:hover:not(.checkbox--disabled){background-color:var(--s-state-hovered)}.checkbox--variant-card.sc-swirl-checkbox:active:not(.checkbox--disabled){background-color:var(--s-state-pressed)}.checkbox--variant-card.checkbox--checked.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-highlight)}.checkbox--variant-card.checkbox--invalid.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-critical)}.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.checkbox--invalid.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--invalid.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-critical)}.checkbox--invalid.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-critical)}.checkbox--disabled.sc-swirl-checkbox{cursor:default}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled);background-color:var(--s-icon-disabled)}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:transparent}.checkbox--disabled.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox,.checkbox--disabled.sc-swirl-checkbox .checkbox__description.sc-swirl-checkbox{color:var(--s-text-disabled)}.checkbox--label-weight-regular.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-regular)}.checkbox__control.sc-swirl-checkbox{position:relative;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__control.sc-swirl-checkbox{width:1.375rem;height:1.375rem}}.checkbox__box.sc-swirl-checkbox{position:relative;z-index:1;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.checkbox__icon.sc-swirl-checkbox{display:inline-flex;width:1.0625rem;height:1.0625rem}.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox::part(icon),.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox [part~="icon"]{width:1.0625rem;height:1.0625rem}.checkbox__indeterminate-icon.sc-swirl-checkbox{position:relative;width:100%;height:100%}.checkbox__indeterminate-icon.sc-swirl-checkbox:after{position:absolute;top:50%;left:50%;width:0.625rem;height:0.125rem;border-radius:0.0625rem;background-color:currentColor;content:"";transform:translate3d(-50%, -50%, 0)}.checkbox__label-container.sc-swirl-checkbox{display:inline-flex;margin-left:var(--s-space-8);align-items:flex-start;flex-direction:column}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label-container.sc-swirl-checkbox{padding-top:var(--s-space-2)}}.checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.checkbox__description.sc-swirl-checkbox{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__description.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}';export{r as swirl_checkbox}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t,a as e,d as c}from"./p-Dz56lJ37.js";import{c as h}from"./p-orsBiyT_.js";const r=class{constructor(t){s(this,t),this.valueChange=i(this,"valueChange",7),this.checked=!1,this.disabled=!1,this.inputId=crypto.randomUUID(),this.labelPosition="end",this.onChange=()=>{this.checked=!this.checked,this.valueChange.emit(this.checked)}}async toggle(){this.inputEl.dispatchEvent(new Event("change"))}render(){const s=this.checked,i=s?"true":"false",c=h("switch",`switch--label-position-${this.labelPosition}`,{"switch--off":!this.checked,"switch--on":s,"switch--disabled":this.disabled,"switch--hide-content":this.hideLabel&&(!this.description||this.hideDescription)});return t(e,{key:"0d68ddd690f66e644e85a53c1d86bb1469a4c8d4"},t("label",{key:"8bd6c56d9e5c22c1d6fd34ad38abe000eaeb0600",class:c,htmlFor:this.inputId},t("span",{key:"6f5284902b1f57fd78638cf368b95057a1f3ee78",class:"switch__control"},t("swirl-visually-hidden",{key:"a07e478a02f5a405589d4120a02ac4d0a0111f4d"},t("input",{key:"009fc5ad9edb9252964d8828ff6e25e9642ad33a","aria-checked":i,"aria-label":!this.hideLabel&&this.swirlAriaLabel?this.swirlAriaLabel:void 0,checked:s,class:"switch__input",disabled:this.disabled,id:this.inputId,name:this.inputName,onChange:this.onChange,ref:s=>this.inputEl=s,role:"switch",type:"checkbox",value:this.value})),t("span",{key:"e2fbb765f6d4fae8e35986f4979d7efd1cf7bf5b","aria-hidden":"true",class:"switch__thumb"})),t("swirl-stack",{key:"9ac89fa753146fcdd1a99d439e4cb2b766ae77b4",class:"switch__content"},this.label&&!this.hideLabel&&t("span",{key:"56d4f1b982427f2f54656475113c97f2518d1a84",class:"switch__label"},this.label),this.hideLabel&&t("swirl-visually-hidden",{key:"f9392a1f09cf4ed60065bb2f1f43925516d2dbaf"},this.swirlAriaLabel||this.label),this.description&&!this.hideDescription&&t("span",{key:"d712b05d3ed27eec29a097aa4e372ccf386b05ac",class:"switch__description"},this.description),this.description&&this.hideDescription&&t("swirl-visually-hidden",{key:"076c244a36a043789d3099697c10c8d53c83bc48"},this.description))))}get el(){return c(this)}};r.style=".sc-swirl-switch-h{display:inline-flex;max-width:100%}.sc-swirl-switch-h *.sc-swirl-switch{box-sizing:border-box}.switch.sc-swirl-switch{display:inline-flex;width:100%;align-items:center;touch-action:none}.switch.sc-swirl-switch:focus-within .switch__control.sc-swirl-switch{box-shadow:0 0 0 0.0625rem var(--s-background-default), 0 0 0 0.1875rem var(--s-focus-default)}.switch--label-position-start.sc-swirl-switch{flex-direction:row-reverse}.switch--label-position-start.sc-swirl-switch .switch__content.sc-swirl-switch{margin-right:var(--s-space-12);margin-left:0}.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 1.25rem - var(--s-space-2))}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 0.875rem - var(--s-space-2))}}.switch--on.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-default)}.switch--disabled.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-disabled);cursor:default}.switch--disabled.sc-swirl-switch .switch__thumb.sc-swirl-switch{background-color:var(--s-interactive-neutral-default)}.switch--disabled.sc-swirl-switch .switch__label.sc-swirl-switch{color:var(--s-text-disabled)}.switch--hide-content.sc-swirl-switch .switch__content.sc-swirl-switch{margin-left:0}.switch__control.sc-swirl-switch{position:relative;width:2.75rem;height:1.5rem;flex-shrink:0;border-radius:calc(1.5rem / 2);background-color:var(--s-interactive-primary-disabled);cursor:pointer;transition:background-color 0.2s}@media (prefers-reduced-motion){.switch__control.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__control.sc-swirl-switch{width:1.875rem;height:1.125rem;border-radius:calc(1.125rem / 2)}}.switch__thumb.sc-swirl-switch{position:absolute;top:var(--s-space-2);left:var(--s-space-2);width:1.25rem;height:1.25rem;border-radius:50%;background-color:var(--s-surface-default);transition:left 0.2s;pointer-events:none}@media (prefers-reduced-motion){.switch__thumb.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__thumb.sc-swirl-switch{width:0.875rem;height:0.875rem}}.switch__content.sc-swirl-switch{position:relative;z-index:1;margin-left:var(--s-space-12)}.switch__label.sc-swirl-switch{overflow:hidden;font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);white-space:nowrap;text-overflow:ellipsis}.switch__description.sc-swirl-switch{color:var(--s-text-subdued);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-normal);line-height:var(--s-line-height-sm)}";export{r as swirl_switch}
|