@lmvz-ds/components 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/cjs/{index-lW-SEvL7.js → index-BCFBLj0e.js} +1 -1
- package/cjs/lmvz-action.cjs.entry.js +1 -1
- package/cjs/lmvz-button_3.cjs.entry.js +5 -5
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +5 -5
- package/cjs/lmvz-chip.cjs.entry.js +3 -3
- package/cjs/lmvz-components.cjs.js +3 -3
- package/cjs/lmvz-header_2.cjs.entry.js +2 -2
- package/cjs/lmvz-input.cjs.entry.js +3 -3
- package/cjs/lmvz-menuitem.cjs.entry.js +3 -3
- package/cjs/lmvz-modal.cjs.entry.js +5 -5
- package/cjs/lmvz-radio.cjs.entry.js +334 -0
- package/cjs/lmvz-select.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +7 -5
- package/cjs/loader.cjs.js +2 -2
- package/cjs/{reactive-controller-host-BOFg4vL-.js → reactive-controller-host-DrtMkMd7.js} +1 -1
- package/collection/collection-manifest.json +2 -1
- package/collection/components/lmvz-button/lmvz-button.css +35 -27
- package/collection/components/lmvz-button/lmvz-button.js +1 -1
- package/collection/components/lmvz-button-group/lmvz-button-group.css +1 -1
- package/collection/components/lmvz-card/lmvz-card.css +35 -27
- package/collection/components/lmvz-checkbox/lmvz-checkbox.css +20 -19
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +2 -2
- package/collection/components/lmvz-chip/lmvz-chip.css +3 -3
- package/collection/components/lmvz-input/lmvz-input.css +17 -17
- package/collection/components/lmvz-menuitem/lmvz-menuitem.css +14 -10
- package/collection/components/lmvz-modal/lmvz-modal.css +40 -18
- package/collection/components/lmvz-modal/lmvz-modal.js +2 -2
- package/collection/components/lmvz-radio/lmvz-radio.css +182 -0
- package/collection/components/lmvz-radio/lmvz-radio.js +487 -0
- package/collection/components/lmvz-select/lmvz-select.css +15 -11
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.css +16 -17
- package/collection/components/lmvz-toggle/lmvz-toggle.js +3 -3
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/styles/fragments/_focus-within.css +13 -0
- package/collection/utils/radio/radio-group-controller.js +160 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button-group.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-radio.d.ts +11 -0
- package/components/lmvz-radio.d.ts.bak +11 -0
- package/components/lmvz-radio.js +1 -0
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/p-Bb-kEOmU.js +1 -0
- package/components/{p-Cg2XX_J-.js → p-CCcoDnH-.js} +1 -1
- package/components/{p-slgmfnHm.js → p-CNmHnJ1D.js} +1 -1
- package/components/p-vUYpZZoR.js +1 -0
- package/esm/{index-Aa_425iY.js → index-CKYszC64.js} +1 -1
- package/esm/lmvz-action.entry.js +1 -1
- package/esm/lmvz-button_3.entry.js +5 -5
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +5 -5
- package/esm/lmvz-chip.entry.js +3 -3
- package/esm/lmvz-components.js +4 -4
- package/esm/lmvz-header_2.entry.js +2 -2
- package/esm/lmvz-input.entry.js +3 -3
- package/esm/lmvz-menuitem.entry.js +3 -3
- package/esm/lmvz-modal.entry.js +5 -5
- package/esm/lmvz-radio.entry.js +332 -0
- package/esm/lmvz-select.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +7 -5
- package/esm/loader.js +3 -3
- package/esm/{reactive-controller-host-CroMsXdS.js → reactive-controller-host-ZrGf1F2-.js} +1 -1
- package/hydrate/index.js +372 -20
- package/hydrate/index.mjs +372 -20
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-d1dacf7e.entry.js → p-01aeca60.entry.js} +1 -1
- package/lmvz-components/p-0dced359.entry.js +1 -0
- package/lmvz-components/{p-f6d1d9df.entry.js → p-2044a9ac.entry.js} +1 -1
- package/lmvz-components/p-3c2adbb4.entry.js +1 -0
- package/lmvz-components/p-3df070b0.entry.js +1 -0
- package/lmvz-components/p-758078db.entry.js +1 -0
- package/lmvz-components/p-90f5a19d.entry.js +1 -0
- package/lmvz-components/{p-BRl6zKXT.js → p-CwX1wKkM.js} +1 -1
- package/lmvz-components/p-acfeae08.entry.js +1 -0
- package/lmvz-components/p-c01a6c70.entry.js +1 -0
- package/lmvz-components/p-e1eaa7a2.entry.js +1 -0
- package/lmvz-components/p-e23d0054.entry.js +1 -0
- package/lmvz-components/p-fe607f10.entry.js +1 -0
- package/manifest.json +416 -3
- package/package.json +5 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +42 -0
- package/types/components.d.ts +176 -0
- package/types/stencil-public-runtime.d.ts +1 -0
- package/types/utils/radio/radio-group-controller.d.ts +26 -0
- package/assets/icons/checkmark.svg +0 -4
- package/assets/icons/close-sm.svg +0 -3
- package/collection/assets/icons/checkmark.svg +0 -4
- package/collection/assets/icons/close-sm.svg +0 -3
- package/components/p-DSvYtVoD.js +0 -1
- package/components/p-K_EPq-vy.js +0 -1
- package/lmvz-components/p-05896617.entry.js +0 -1
- package/lmvz-components/p-267344a7.entry.js +0 -1
- package/lmvz-components/p-2b09b8bc.entry.js +0 -1
- package/lmvz-components/p-3846ba08.entry.js +0 -1
- package/lmvz-components/p-3df92762.entry.js +0 -1
- package/lmvz-components/p-5f550b9f.entry.js +0 -1
- package/lmvz-components/p-8e43fabb.entry.js +0 -1
- package/lmvz-components/p-f7f32879.entry.js +0 -1
- package/lmvz-components/p-fa4e00cf.entry.js +0 -1
- /package/components/{p-CK8cAKcB.js → p-DYr7Jc0V.js} +0 -0
- /package/lmvz-components/{p-Aa_425iY.js → p-CKYszC64.js} +0 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
|
|
3
|
+
import { RadioGroupController } from "../../utils/radio/radio-group-controller";
|
|
4
|
+
import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
|
|
5
|
+
let radioIdCounter = 0;
|
|
6
|
+
export class LmvzRadio extends ReactiveControllerHost {
|
|
7
|
+
el;
|
|
8
|
+
get validationEl() {
|
|
9
|
+
return this.el;
|
|
10
|
+
}
|
|
11
|
+
internals;
|
|
12
|
+
nativeInput;
|
|
13
|
+
radioId = `lmvz-radio-${radioIdCounter++}`;
|
|
14
|
+
initialChecked = false;
|
|
15
|
+
radioGroupController;
|
|
16
|
+
get helperId() {
|
|
17
|
+
return this.helperText ? `${this.radioId}-helper` : undefined;
|
|
18
|
+
}
|
|
19
|
+
label;
|
|
20
|
+
checked = false;
|
|
21
|
+
value = 'on';
|
|
22
|
+
name;
|
|
23
|
+
disabled = false;
|
|
24
|
+
required = false;
|
|
25
|
+
error = false;
|
|
26
|
+
helperText;
|
|
27
|
+
form;
|
|
28
|
+
autofocus = false;
|
|
29
|
+
_handlingNativeChange = false;
|
|
30
|
+
_handlingFormReset = false;
|
|
31
|
+
handleCheckedChange(newVal, oldVal) {
|
|
32
|
+
this.internals.setFormValue?.(newVal ? this.value : null);
|
|
33
|
+
if (!newVal && oldVal && !this._handlingNativeChange && !this._handlingFormReset) {
|
|
34
|
+
this.lmvzChange.emit(false);
|
|
35
|
+
}
|
|
36
|
+
if (newVal && !oldVal && !this._handlingNativeChange && !this._handlingFormReset) {
|
|
37
|
+
this.lmvzChange.emit(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
handleValueChange(newVal) {
|
|
41
|
+
if (this.checked) {
|
|
42
|
+
this.internals.setFormValue?.(newVal);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
handleLabelChange(newVal) {
|
|
46
|
+
if (!newVal) {
|
|
47
|
+
console.warn('[lmvz-radio] label prop is required and must not be empty');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
lmvzChange;
|
|
51
|
+
lmvzActivation;
|
|
52
|
+
async focusInput() {
|
|
53
|
+
this.nativeInput?.focus();
|
|
54
|
+
}
|
|
55
|
+
async checkValidity() {
|
|
56
|
+
return this.internals?.checkValidity() ?? true;
|
|
57
|
+
}
|
|
58
|
+
async reportValidity() {
|
|
59
|
+
return this.internals?.reportValidity() ?? true;
|
|
60
|
+
}
|
|
61
|
+
constructor() {
|
|
62
|
+
super();
|
|
63
|
+
this.addController(new AriaValidationController(this, {
|
|
64
|
+
reValidateOnPropChanges: true,
|
|
65
|
+
}));
|
|
66
|
+
this.radioGroupController = new RadioGroupController(this);
|
|
67
|
+
this.addController(this.radioGroupController);
|
|
68
|
+
}
|
|
69
|
+
componentWillLoad() {
|
|
70
|
+
this.initialChecked = this.checked;
|
|
71
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
72
|
+
super.componentWillLoad();
|
|
73
|
+
}
|
|
74
|
+
formAssociatedCallback() {
|
|
75
|
+
this.internals.setFormValue?.(this.checked ? this.value : null);
|
|
76
|
+
}
|
|
77
|
+
formResetCallback() {
|
|
78
|
+
this._handlingFormReset = true;
|
|
79
|
+
try {
|
|
80
|
+
this.checked = this.initialChecked;
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
this._handlingFormReset = false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
formStateRestoreCallback(state) {
|
|
87
|
+
if (typeof state !== 'string')
|
|
88
|
+
return;
|
|
89
|
+
this._handlingFormReset = true;
|
|
90
|
+
try {
|
|
91
|
+
this.checked = state === this.value;
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
this._handlingFormReset = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
handleChange = (event) => {
|
|
98
|
+
this._handlingNativeChange = true;
|
|
99
|
+
try {
|
|
100
|
+
const input = event.target;
|
|
101
|
+
this.checked = input.checked;
|
|
102
|
+
this.lmvzChange.emit(this.checked);
|
|
103
|
+
this.radioGroupController.select(this);
|
|
104
|
+
this.lmvzActivation.emit();
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
this._handlingNativeChange = false;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
handleKeydown(event) {
|
|
111
|
+
const { key } = event;
|
|
112
|
+
if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft', 'Home', 'End'].includes(key))
|
|
113
|
+
return;
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
const radios = this.radioGroupController.sortedEnabled;
|
|
116
|
+
if (radios.length === 0)
|
|
117
|
+
return;
|
|
118
|
+
const currentIndex = radios.indexOf(this);
|
|
119
|
+
if (currentIndex === -1)
|
|
120
|
+
return;
|
|
121
|
+
let targetIndex;
|
|
122
|
+
if (key === 'ArrowDown' || key === 'ArrowRight') {
|
|
123
|
+
targetIndex = (currentIndex + 1) % radios.length;
|
|
124
|
+
}
|
|
125
|
+
else if (key === 'ArrowUp' || key === 'ArrowLeft') {
|
|
126
|
+
targetIndex = (currentIndex - 1 + radios.length) % radios.length;
|
|
127
|
+
}
|
|
128
|
+
else if (key === 'Home') {
|
|
129
|
+
targetIndex = 0;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
targetIndex = radios.length - 1;
|
|
133
|
+
}
|
|
134
|
+
const target = radios[targetIndex];
|
|
135
|
+
if (!target)
|
|
136
|
+
return;
|
|
137
|
+
this.radioGroupController.setFocused(target);
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return (h(Host, { key: '0226e313fcf4fe3c3cf343cfe0776cf71da169a6' }, h("input", { key: '5bb1f733d2f29217bc7544d8fd24f6b21bedc654', type: "radio", id: this.radioId, name: this.name ?? undefined, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, autoFocus: this.autofocus, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.helperId, ref: (el) => (this.nativeInput = el), onChange: this.handleChange }), h("span", { key: 'ae18f49167d1a2e8e6ec4ceca435e69e3d79f593', class: "circle", "aria-hidden": "true" }, this.checked && h("span", { key: '5dfb65105831a672f2a47952aff987cd45e9b178', class: "dot" })), h("span", { key: 'df148ca52be7e580226d94ff9aef4e3cf5a6182c', class: "content" }, h("label", { key: 'e042c57755eadb64692ace49204dccb1ee03ed1c', htmlFor: this.radioId }, this.label), h("span", { key: 'a90b0bef927dddb39f9e6357adf888e0818a3c5a', "aria-live": "polite", class: "helper-text", id: this.helperId }, this.helperText))));
|
|
141
|
+
}
|
|
142
|
+
static get is() { return "lmvz-radio"; }
|
|
143
|
+
static get encapsulation() { return "scoped"; }
|
|
144
|
+
static get formAssociated() { return true; }
|
|
145
|
+
static get originalStyleUrls() {
|
|
146
|
+
return {
|
|
147
|
+
"$": ["./lmvz-radio.css", "../../styles/fragments/_focus-within.css"]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
static get styleUrls() {
|
|
151
|
+
return {
|
|
152
|
+
"$": ["lmvz-radio.css", "../../styles/fragments/_focus-within.css"]
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
static get properties() {
|
|
156
|
+
return {
|
|
157
|
+
"label": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": true,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Label text for the radio. Required for accessibility."
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"reflect": false,
|
|
174
|
+
"attribute": "label"
|
|
175
|
+
},
|
|
176
|
+
"checked": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"mutable": true,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "boolean",
|
|
181
|
+
"resolved": "boolean",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": false,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [{
|
|
188
|
+
"name": "default",
|
|
189
|
+
"text": "false"
|
|
190
|
+
}],
|
|
191
|
+
"text": "Whether the radio is checked.\n\nSetting this prop programmatically (e.g. `element.checked = true`) fires `lmvzChange`\nwith the new value, unless the change occurs during native form lifecycle callbacks\n(`formResetCallback` or `formStateRestoreCallback`), in which case emission is suppressed\nto match native `<input type=\"radio\">` behavior. Internal form state is always updated\nregardless of emission suppression."
|
|
192
|
+
},
|
|
193
|
+
"getter": false,
|
|
194
|
+
"setter": false,
|
|
195
|
+
"reflect": true,
|
|
196
|
+
"attribute": "checked",
|
|
197
|
+
"defaultValue": "false"
|
|
198
|
+
},
|
|
199
|
+
"value": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "string",
|
|
204
|
+
"resolved": "string",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [{
|
|
211
|
+
"name": "default",
|
|
212
|
+
"text": "'on'"
|
|
213
|
+
}],
|
|
214
|
+
"text": "Form submission value when checked."
|
|
215
|
+
},
|
|
216
|
+
"getter": false,
|
|
217
|
+
"setter": false,
|
|
218
|
+
"reflect": false,
|
|
219
|
+
"attribute": "value",
|
|
220
|
+
"defaultValue": "'on'"
|
|
221
|
+
},
|
|
222
|
+
"name": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string | undefined",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": true,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [{
|
|
234
|
+
"name": "remarks",
|
|
235
|
+
"text": "A value of `\"\"` (empty string) is forwarded to the native `<input>`, but\n`RadioGroupController` treats it as unnamed \u2014 no group coordination occurs between\nradios with `name=\"\"`."
|
|
236
|
+
}],
|
|
237
|
+
"text": "Name attribute for form submission via ElementInternals.\n\nWhen multiple `lmvz-radio` elements share the same `name` and form scope,\nthe `name` is forwarded directly to the native `<input type=\"radio\">`,\nenabling browser-native mutual exclusion: selecting one radio automatically\ndeselects all others with the same name in that form. If a radio is outside\nany form, its scope defaults to the document level \u2014 same-name radios\noutside forms form a document-scoped group. Radios with the same `name` in\ndifferent forms are independent groups.\n\nThe `RadioGroupController` automatically manages roving tabindex (only the\nchecked radio has `tabindex=\"0\"`) and keyboard navigation (Arrow keys, Home, End)\nwithin the form-scoped group."
|
|
238
|
+
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"attribute": "name"
|
|
243
|
+
},
|
|
244
|
+
"disabled": {
|
|
245
|
+
"type": "boolean",
|
|
246
|
+
"mutable": false,
|
|
247
|
+
"complexType": {
|
|
248
|
+
"original": "boolean",
|
|
249
|
+
"resolved": "boolean",
|
|
250
|
+
"references": {}
|
|
251
|
+
},
|
|
252
|
+
"required": false,
|
|
253
|
+
"optional": false,
|
|
254
|
+
"docs": {
|
|
255
|
+
"tags": [{
|
|
256
|
+
"name": "default",
|
|
257
|
+
"text": "false"
|
|
258
|
+
}],
|
|
259
|
+
"text": "Whether the radio is disabled."
|
|
260
|
+
},
|
|
261
|
+
"getter": false,
|
|
262
|
+
"setter": false,
|
|
263
|
+
"reflect": true,
|
|
264
|
+
"attribute": "disabled",
|
|
265
|
+
"defaultValue": "false"
|
|
266
|
+
},
|
|
267
|
+
"required": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"mutable": false,
|
|
270
|
+
"complexType": {
|
|
271
|
+
"original": "boolean",
|
|
272
|
+
"resolved": "boolean",
|
|
273
|
+
"references": {}
|
|
274
|
+
},
|
|
275
|
+
"required": false,
|
|
276
|
+
"optional": false,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [{
|
|
279
|
+
"name": "default",
|
|
280
|
+
"text": "false"
|
|
281
|
+
}],
|
|
282
|
+
"text": "Whether the radio is required."
|
|
283
|
+
},
|
|
284
|
+
"getter": false,
|
|
285
|
+
"setter": false,
|
|
286
|
+
"reflect": true,
|
|
287
|
+
"attribute": "required",
|
|
288
|
+
"defaultValue": "false"
|
|
289
|
+
},
|
|
290
|
+
"error": {
|
|
291
|
+
"type": "boolean",
|
|
292
|
+
"mutable": false,
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "boolean",
|
|
295
|
+
"resolved": "boolean",
|
|
296
|
+
"references": {}
|
|
297
|
+
},
|
|
298
|
+
"required": false,
|
|
299
|
+
"optional": false,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [{
|
|
302
|
+
"name": "default",
|
|
303
|
+
"text": "false"
|
|
304
|
+
}],
|
|
305
|
+
"text": "Whether the radio is in an error state."
|
|
306
|
+
},
|
|
307
|
+
"getter": false,
|
|
308
|
+
"setter": false,
|
|
309
|
+
"reflect": true,
|
|
310
|
+
"attribute": "error",
|
|
311
|
+
"defaultValue": "false"
|
|
312
|
+
},
|
|
313
|
+
"helperText": {
|
|
314
|
+
"type": "string",
|
|
315
|
+
"mutable": false,
|
|
316
|
+
"complexType": {
|
|
317
|
+
"original": "string",
|
|
318
|
+
"resolved": "string | undefined",
|
|
319
|
+
"references": {}
|
|
320
|
+
},
|
|
321
|
+
"required": false,
|
|
322
|
+
"optional": true,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": "Helper / description text displayed below the label."
|
|
326
|
+
},
|
|
327
|
+
"getter": false,
|
|
328
|
+
"setter": false,
|
|
329
|
+
"reflect": false,
|
|
330
|
+
"attribute": "helper-text"
|
|
331
|
+
},
|
|
332
|
+
"form": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "string",
|
|
337
|
+
"resolved": "string | undefined",
|
|
338
|
+
"references": {}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": true,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": "Form id to associate with (for out-of-form usage).\nReflected to the host attribute so both HTML attribute and programmatic assignment work."
|
|
345
|
+
},
|
|
346
|
+
"getter": false,
|
|
347
|
+
"setter": false,
|
|
348
|
+
"reflect": true,
|
|
349
|
+
"attribute": "form"
|
|
350
|
+
},
|
|
351
|
+
"autofocus": {
|
|
352
|
+
"type": "boolean",
|
|
353
|
+
"mutable": false,
|
|
354
|
+
"complexType": {
|
|
355
|
+
"original": "boolean",
|
|
356
|
+
"resolved": "boolean",
|
|
357
|
+
"references": {}
|
|
358
|
+
},
|
|
359
|
+
"required": false,
|
|
360
|
+
"optional": false,
|
|
361
|
+
"docs": {
|
|
362
|
+
"tags": [{
|
|
363
|
+
"name": "default",
|
|
364
|
+
"text": "false"
|
|
365
|
+
}],
|
|
366
|
+
"text": "Whether the radio should autofocus."
|
|
367
|
+
},
|
|
368
|
+
"getter": false,
|
|
369
|
+
"setter": false,
|
|
370
|
+
"reflect": false,
|
|
371
|
+
"attribute": "autofocus",
|
|
372
|
+
"defaultValue": "false"
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
static get events() {
|
|
377
|
+
return [{
|
|
378
|
+
"method": "lmvzChange",
|
|
379
|
+
"name": "lmvzChange",
|
|
380
|
+
"bubbles": true,
|
|
381
|
+
"cancelable": true,
|
|
382
|
+
"composed": true,
|
|
383
|
+
"docs": {
|
|
384
|
+
"tags": [],
|
|
385
|
+
"text": "Emitted whenever the radio checked state changes.\nEvent detail contains the new checked boolean value.\n\nEmission contract:\n- Fires `true` on user selection (native `change` event).\n- Fires on programmatic external prop transitions: `true \u2192 false` (emits `false`) and\n `false \u2192 true` (emits `true`), e.g. `element.checked = false` or `element.checked = true`.\n- Does NOT fire during browser-driven form lifecycle callbacks: `formResetCallback` and\n `formStateRestoreCallback` (autofill / session restore). This matches native `<input type=\"radio\">`\n behaviour, which does not fire `change` on form reset. Note that internal form state\n (`ElementInternals.setFormValue`) is always updated regardless of suppression \u2014 only the\n event channel is silenced.\n- Does NOT re-fire from the `@Watch('checked')` watcher during the same tick as the native\n `change` handler, preventing a double-emission when the user clicks the radio."
|
|
386
|
+
},
|
|
387
|
+
"complexType": {
|
|
388
|
+
"original": "boolean",
|
|
389
|
+
"resolved": "boolean",
|
|
390
|
+
"references": {}
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
"method": "lmvzActivation",
|
|
394
|
+
"name": "lmvzActivation",
|
|
395
|
+
"bubbles": true,
|
|
396
|
+
"cancelable": true,
|
|
397
|
+
"composed": true,
|
|
398
|
+
"docs": {
|
|
399
|
+
"tags": [],
|
|
400
|
+
"text": "Fired on every explicit user activation of this radio \u2014 via click or Space key on the\nnative input. Fires even when the radio is already checked (re-activation). Use this\nevent to react to user intent; use `lmvzChange` to react to state transitions."
|
|
401
|
+
},
|
|
402
|
+
"complexType": {
|
|
403
|
+
"original": "void",
|
|
404
|
+
"resolved": "void",
|
|
405
|
+
"references": {}
|
|
406
|
+
}
|
|
407
|
+
}];
|
|
408
|
+
}
|
|
409
|
+
static get methods() {
|
|
410
|
+
return {
|
|
411
|
+
"focusInput": {
|
|
412
|
+
"complexType": {
|
|
413
|
+
"signature": "() => Promise<void>",
|
|
414
|
+
"parameters": [],
|
|
415
|
+
"references": {
|
|
416
|
+
"Promise": {
|
|
417
|
+
"location": "global",
|
|
418
|
+
"id": "global::Promise"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"return": "Promise<void>"
|
|
422
|
+
},
|
|
423
|
+
"docs": {
|
|
424
|
+
"text": "Sets focus on the native radio input.",
|
|
425
|
+
"tags": []
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"checkValidity": {
|
|
429
|
+
"complexType": {
|
|
430
|
+
"signature": "() => Promise<boolean>",
|
|
431
|
+
"parameters": [],
|
|
432
|
+
"references": {
|
|
433
|
+
"Promise": {
|
|
434
|
+
"location": "global",
|
|
435
|
+
"id": "global::Promise"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"return": "Promise<boolean>"
|
|
439
|
+
},
|
|
440
|
+
"docs": {
|
|
441
|
+
"text": "Returns whether the radio satisfies its validation constraints.",
|
|
442
|
+
"tags": []
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"reportValidity": {
|
|
446
|
+
"complexType": {
|
|
447
|
+
"signature": "() => Promise<boolean>",
|
|
448
|
+
"parameters": [],
|
|
449
|
+
"references": {
|
|
450
|
+
"Promise": {
|
|
451
|
+
"location": "global",
|
|
452
|
+
"id": "global::Promise"
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
"return": "Promise<boolean>"
|
|
456
|
+
},
|
|
457
|
+
"docs": {
|
|
458
|
+
"text": "Reports validation errors to the user.",
|
|
459
|
+
"tags": []
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
static get elementRef() { return "el"; }
|
|
465
|
+
static get watchers() {
|
|
466
|
+
return [{
|
|
467
|
+
"propName": "checked",
|
|
468
|
+
"methodName": "handleCheckedChange"
|
|
469
|
+
}, {
|
|
470
|
+
"propName": "value",
|
|
471
|
+
"methodName": "handleValueChange"
|
|
472
|
+
}, {
|
|
473
|
+
"propName": "label",
|
|
474
|
+
"methodName": "handleLabelChange"
|
|
475
|
+
}];
|
|
476
|
+
}
|
|
477
|
+
static get listeners() {
|
|
478
|
+
return [{
|
|
479
|
+
"name": "keydown",
|
|
480
|
+
"method": "handleKeydown",
|
|
481
|
+
"target": undefined,
|
|
482
|
+
"capture": false,
|
|
483
|
+
"passive": false
|
|
484
|
+
}];
|
|
485
|
+
}
|
|
486
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
487
|
+
}
|
|
@@ -5,31 +5,35 @@
|
|
|
5
5
|
* Important: Always import this file _before_ layering your own styles!
|
|
6
6
|
*/
|
|
7
7
|
@layer lmvz-ds.theme {
|
|
8
|
+
/**
|
|
9
|
+
* !CAUTION: Changes to this file have to be manually synced into `/packages/styles/src/no-transform/router-font.css`
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
@font-face {
|
|
9
13
|
font-family: Router;
|
|
10
14
|
src:
|
|
15
|
+
local('RouterBook-Regular'),
|
|
11
16
|
local('Router-Book'),
|
|
12
|
-
url('/assets/fonts/Router-Book.woff') format('woff')
|
|
13
|
-
|
|
14
|
-
font-weight: 400 normal;
|
|
17
|
+
url('/assets/fonts/Router-Book.woff') format('woff');
|
|
18
|
+
font-weight: 400;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@font-face {
|
|
18
22
|
font-family: Router;
|
|
19
23
|
src:
|
|
24
|
+
local('RouterMedium-Regular'),
|
|
20
25
|
local('Router-Medium'),
|
|
21
|
-
url('/assets/fonts/Router-Medium.woff') format('woff')
|
|
22
|
-
local('Router');
|
|
26
|
+
url('/assets/fonts/Router-Medium.woff') format('woff');
|
|
23
27
|
font-weight: 500;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
@font-face {
|
|
27
31
|
font-family: Router;
|
|
28
32
|
src:
|
|
33
|
+
local('RouterBold-Regular'),
|
|
29
34
|
local('Router-Bold'),
|
|
30
|
-
url('/assets/fonts/Router-Bold.woff') format('woff')
|
|
31
|
-
|
|
32
|
-
font-weight: 700 bold;
|
|
35
|
+
url('/assets/fonts/Router-Bold.woff') format('woff');
|
|
36
|
+
font-weight: 700;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
}
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
--lmvz-select-label-top-offset: calc(var(--lmvz-internal-select-floating-label-top-offset) * -1);
|
|
56
60
|
--lmvz-select-label-minimized-padding-x: 4px;
|
|
57
61
|
--lmvz-select-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%);
|
|
58
|
-
--lmvz-select-helper-color: var(--lmvz-semantic-color-on-surface-input-secondary, #
|
|
62
|
+
--lmvz-select-helper-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454);
|
|
59
63
|
--lmvz-select-focus-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
|
|
60
64
|
--lmvz-select-error-color: var(--lmvz-semantic-color-status-on-danger, #e52a31);
|
|
61
65
|
}
|
|
@@ -121,8 +125,8 @@ div[aria-hidden] {
|
|
|
121
125
|
background-color: var(--lmvz-select-bg-hover);
|
|
122
126
|
}
|
|
123
127
|
.select-wrapper:focus-within div[aria-hidden] {
|
|
124
|
-
outline:
|
|
125
|
-
outline-offset:
|
|
128
|
+
outline: var(--lmvz-ds-outline, 1px solid #0e7ab4);
|
|
129
|
+
outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem));
|
|
126
130
|
}
|
|
127
131
|
div[aria-hidden] > span:first-child {
|
|
128
132
|
flex: 1 0 0;
|
|
@@ -50,7 +50,7 @@ export class LmvzSelect extends ReactiveControllerHost {
|
|
|
50
50
|
render() {
|
|
51
51
|
const hasValue = this.hasValue;
|
|
52
52
|
const shouldShowLabel = hasValue;
|
|
53
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: '597245455ffb9b5f83472a7970fb1c6c92017fd2' }, h("div", { key: 'edeb4d02d5a5291e60fd2d26d16edc500a355b63', class: "select-wrapper" }, h("label", { key: 'd0068817bb3586467d73284cecc03de393c37589', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && h("span", { key: '624ee28842aed8c01651c7758099bccc446840d6', "aria-hidden": "true" }, " *")), h("div", { key: '184591bc8ac11e9eed17795ce21319591e6d4211', "aria-hidden": "true" }, h("span", { key: '53e673521ed26125c24fb529d6016e3827b47a44' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && h("span", { key: '7af1a756e3343701ad066f3c107b2028126c5f09', "aria-hidden": "true" }, " *")), h("span", { key: '6210f2069758f8579f67780530fd294210875b3f' }, h("img", { key: '05aa6cf110ba0c7eacd36f59525144c61f0705d9', src: chevronDownSvg, alt: "" }))), h("select", { key: 'dc9dfe93226858f73f1d5a655388b9ce3a5e4037', id: this.selectId, ref: (el) => (this.nativeSelectEl = el), name: this.name, disabled: this.disabled, required: this.required, "aria-label": this.label, onChange: this.handleChange }, !hasValue && h("option", { key: '38ffb95d089932d0ce0c6a5629004679d3f7f857', value: "", disabled: true, selected: true, hidden: true }), h("slot", { key: '51b96884bb010b0a93f24b8b2f3f91a7b040e220' }))), this.helperText && h("div", { key: 'f7149a48024e87d2a3843d96674e45cb91fd9cf4', role: "status" }, this.helperText)));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "lmvz-select"; }
|
|
56
56
|
static get encapsulation() { return "scoped"; }
|
|
@@ -5,38 +5,42 @@
|
|
|
5
5
|
* Important: Always import this file _before_ layering your own styles!
|
|
6
6
|
*/
|
|
7
7
|
@layer lmvz-ds.theme {
|
|
8
|
+
/**
|
|
9
|
+
* !CAUTION: Changes to this file have to be manually synced into `/packages/styles/src/no-transform/router-font.css`
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
@font-face {
|
|
9
13
|
font-family: Router;
|
|
10
14
|
src:
|
|
15
|
+
local('RouterBook-Regular'),
|
|
11
16
|
local('Router-Book'),
|
|
12
|
-
url('/assets/fonts/Router-Book.woff') format('woff')
|
|
13
|
-
|
|
14
|
-
font-weight: 400 normal;
|
|
17
|
+
url('/assets/fonts/Router-Book.woff') format('woff');
|
|
18
|
+
font-weight: 400;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@font-face {
|
|
18
22
|
font-family: Router;
|
|
19
23
|
src:
|
|
24
|
+
local('RouterMedium-Regular'),
|
|
20
25
|
local('Router-Medium'),
|
|
21
|
-
url('/assets/fonts/Router-Medium.woff') format('woff')
|
|
22
|
-
local('Router');
|
|
26
|
+
url('/assets/fonts/Router-Medium.woff') format('woff');
|
|
23
27
|
font-weight: 500;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
@font-face {
|
|
27
31
|
font-family: Router;
|
|
28
32
|
src:
|
|
33
|
+
local('RouterBold-Regular'),
|
|
29
34
|
local('Router-Bold'),
|
|
30
|
-
url('/assets/fonts/Router-Bold.woff') format('woff')
|
|
31
|
-
|
|
32
|
-
font-weight: 700 bold;
|
|
35
|
+
url('/assets/fonts/Router-Bold.woff') format('woff');
|
|
36
|
+
font-weight: 700;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
}
|
|
36
40
|
:host {
|
|
37
41
|
display: inline-flex;
|
|
38
42
|
align-items: center;
|
|
39
|
-
gap: var(--lmvz-component-input-gap-md, clamp(0.
|
|
43
|
+
gap: var(--lmvz-component-input-gap-md, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
40
44
|
padding-block: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
|
|
41
45
|
padding-inline: var(--lmvz-dimension-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
42
46
|
/* TODO[LDHCID-136]: min-height currently below accessibility requirements for tap targets (44px) */
|
|
@@ -50,10 +54,10 @@
|
|
|
50
54
|
background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0);
|
|
51
55
|
}
|
|
52
56
|
:host([checked]) {
|
|
53
|
-
background-color: var(--lmvz-semantic-color-status-active, #
|
|
57
|
+
background-color: var(--lmvz-semantic-color-status-active, #f6fbfe);
|
|
54
58
|
}
|
|
55
59
|
:host([disabled][checked]) {
|
|
56
|
-
background-color: var(--lmvz-semantic-color-status-active, #
|
|
60
|
+
background-color: var(--lmvz-semantic-color-status-active, #f6fbfe);
|
|
57
61
|
}
|
|
58
62
|
:host([disabled]) {
|
|
59
63
|
cursor: not-allowed;
|
|
@@ -86,17 +90,12 @@ input {
|
|
|
86
90
|
margin: 0;
|
|
87
91
|
cursor: inherit;
|
|
88
92
|
}
|
|
89
|
-
:host(:focus-within) {
|
|
90
|
-
/* TODO[LDHCID-136]: no focus-visible token in DS */
|
|
91
|
-
outline: 2px solid var(--lmvz-semantic-color-border-active, #0f8acc);
|
|
92
|
-
outline-offset: 2px;
|
|
93
|
-
}
|
|
94
93
|
.thumb {
|
|
95
94
|
position: absolute;
|
|
96
95
|
width: var(--lmvz-global-s13, 13px);
|
|
97
96
|
height: var(--lmvz-global-s13, 13px);
|
|
98
97
|
border-radius: 50%;
|
|
99
|
-
background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #
|
|
98
|
+
background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454);
|
|
100
99
|
top: 50%;
|
|
101
100
|
transform: translateY(-50%);
|
|
102
101
|
left: var(--lmvz-global-s4, 4px);
|
|
@@ -65,19 +65,19 @@ export class LmvzToggle extends ReactiveControllerHost {
|
|
|
65
65
|
this.lmvzChange.emit(newChecked);
|
|
66
66
|
};
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: '4bb633301740c3e69a836615e2266242980ac17a' }, h("span", { key: 'cc7188d8e2caff2968ad6c64c72565a71c89ec74', class: "track" }, h("input", { key: '867f7865711b9224b89f0f491df8a19589342729', type: "checkbox", role: "switch", id: this.toggleId, checked: this.checked, disabled: this.disabled, required: this.required, name: this.name, value: this.value, form: this.form, ref: (el) => (this.nativeInputElement = el), onChange: this.handleChange }), h("span", { key: '426ee9f042afcc3d74b2137d2edbe95573b3c136', class: "thumb", "aria-hidden": "true" })), h("label", { key: '600cb22f2915d86edafa9ac57b77707055f6ae16', htmlFor: this.toggleId }, this.label)));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "lmvz-toggle"; }
|
|
71
71
|
static get encapsulation() { return "scoped"; }
|
|
72
72
|
static get formAssociated() { return true; }
|
|
73
73
|
static get originalStyleUrls() {
|
|
74
74
|
return {
|
|
75
|
-
"$": ["./lmvz-toggle.css"]
|
|
75
|
+
"$": ["./lmvz-toggle.css", "../../styles/fragments/_focus-within.css"]
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
static get styleUrls() {
|
|
79
79
|
return {
|
|
80
|
-
"$": ["lmvz-toggle.css"]
|
|
80
|
+
"$": ["lmvz-toggle.css", "../../styles/fragments/_focus-within.css"]
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
static get properties() {
|