@lmvz-ds/components 0.19.0 → 0.21.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/assets/icons/checkmark.svg +4 -0
  3. package/cjs/{aria-loader-CfFuAbJn.js → aria-loader-Cec1zR2g.js} +1 -1
  4. package/cjs/icons-BQASWgk-.js +80 -0
  5. package/cjs/{index--7IqZZqn.js → index-3g9Z9sfF.js} +765 -2854
  6. package/cjs/index.cjs.js +4 -3
  7. package/cjs/lmvz-button.cjs.entry.js +3 -3
  8. package/cjs/lmvz-card.cjs.entry.js +1 -1
  9. package/cjs/lmvz-checkbox.cjs.entry.js +113 -0
  10. package/cjs/lmvz-chip.cjs.entry.js +3 -3
  11. package/cjs/lmvz-components.cjs.js +1 -1
  12. package/cjs/lmvz-header_2.cjs.entry.js +3 -3
  13. package/cjs/lmvz-icon.cjs.entry.js +9 -7
  14. package/cjs/lmvz-input.cjs.entry.js +4 -4
  15. package/cjs/lmvz-menuitem.cjs.entry.js +4 -4
  16. package/cjs/lmvz-select.cjs.entry.js +3 -3
  17. package/cjs/lmvz-toggle.cjs.entry.js +96 -0
  18. package/cjs/loader.cjs.js +1 -1
  19. package/cjs/{logger-Bn2yoZGP.js → logger-DsM6xg6V.js} +3063 -833
  20. package/cjs/{reactive-controller-host-Bi9eu2bV.js → reactive-controller-host-BA4ZhjKA.js} +1 -1
  21. package/cjs/{icons-Tg7ySOh-.js → svg-BMBduILB.js} +31 -85
  22. package/collection/assets/icons/checkmark.svg +4 -0
  23. package/collection/collection-manifest.json +2 -0
  24. package/collection/components/lmvz-button/lmvz-button.css +1 -2
  25. package/collection/components/lmvz-card/lmvz-card.css +1 -2
  26. package/collection/components/lmvz-checkbox/lmvz-checkbox.css +207 -0
  27. package/collection/components/lmvz-checkbox/lmvz-checkbox.js +424 -0
  28. package/collection/components/lmvz-chip/lmvz-chip.js +1 -1
  29. package/collection/components/lmvz-header/lmvz-header.js +1 -1
  30. package/collection/components/lmvz-icon/lmvz-icon.js +5 -5
  31. package/collection/components/lmvz-input/lmvz-input.js +2 -2
  32. package/collection/components/lmvz-menuitem/lmvz-menuitem.css +1 -1
  33. package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
  34. package/collection/components/lmvz-select/lmvz-select.js +1 -1
  35. package/collection/components/lmvz-toggle/lmvz-toggle.css +118 -0
  36. package/collection/components/lmvz-toggle/lmvz-toggle.js +358 -0
  37. package/collection/integration/header-integration/header-integration.js +1 -1
  38. package/collection/utils/icons/icons.js +2 -13
  39. package/collection/utils/icons/icons.unit.js +3 -15
  40. package/components/index.d.ts +4 -0
  41. package/components/index.d.ts.bak +4 -0
  42. package/components/index.js +1 -1
  43. package/components/lmvz-button.js +1 -1
  44. package/components/lmvz-card.js +1 -1
  45. package/components/lmvz-checkbox.d.ts +11 -0
  46. package/components/lmvz-checkbox.d.ts.bak +11 -0
  47. package/components/lmvz-checkbox.js +1 -0
  48. package/components/lmvz-chip.js +1 -1
  49. package/components/lmvz-header.js +1 -1
  50. package/components/lmvz-icon.js +1 -1
  51. package/components/lmvz-input.js +1 -1
  52. package/components/lmvz-menuitem.js +1 -1
  53. package/components/lmvz-select.js +1 -1
  54. package/components/lmvz-toggle.d.ts +11 -0
  55. package/components/lmvz-toggle.d.ts.bak +11 -0
  56. package/components/lmvz-toggle.js +1 -0
  57. package/components/p-0s99QfRy.js +12 -0
  58. package/components/{p-DbeHBSOe.js → p-BuFx0tTm.js} +1 -1
  59. package/components/p-CGmJG63p.js +1 -0
  60. package/components/p-CcxjkCOx.js +1 -0
  61. package/esm/{aria-loader-CES8Ae1e.js → aria-loader-BVolm0lC.js} +1 -1
  62. package/esm/icons-CmuFKDRz.js +75 -0
  63. package/esm/{index-BvxaUA12.js → index-Dh_9sN0q.js} +389 -2478
  64. package/esm/index.js +4 -3
  65. package/esm/lmvz-button.entry.js +3 -3
  66. package/esm/lmvz-card.entry.js +1 -1
  67. package/esm/lmvz-checkbox.entry.js +111 -0
  68. package/esm/lmvz-chip.entry.js +3 -3
  69. package/esm/lmvz-components.js +1 -1
  70. package/esm/lmvz-header_2.entry.js +3 -3
  71. package/esm/lmvz-icon.entry.js +9 -7
  72. package/esm/lmvz-input.entry.js +4 -4
  73. package/esm/lmvz-menuitem.entry.js +4 -4
  74. package/esm/lmvz-select.entry.js +3 -3
  75. package/esm/lmvz-toggle.entry.js +94 -0
  76. package/esm/loader.js +1 -1
  77. package/esm/{logger-0bL3pydp.js → logger-CGmJG63p.js} +2870 -765
  78. package/esm/{reactive-controller-host-J2thAxVH.js → reactive-controller-host-DHcPpJW7.js} +1 -1
  79. package/esm/{icons-Bj4dF1-I.js → svg-B2YoIRuh.js} +29 -80
  80. package/hydrate/index.js +2551 -165
  81. package/hydrate/index.mjs +2551 -165
  82. package/lmvz-components/index.esm.js +1 -1
  83. package/lmvz-components/lmvz-components.esm.js +1 -1
  84. package/lmvz-components/{p-ec96c6b6.entry.js → p-0f7a4236.entry.js} +1 -1
  85. package/lmvz-components/p-0s99QfRy.js +12 -0
  86. package/lmvz-components/p-2f83d7a2.entry.js +1 -0
  87. package/lmvz-components/{p-6e8acbd9.entry.js → p-32171f4f.entry.js} +1 -1
  88. package/lmvz-components/{p-9212bd23.entry.js → p-400b2318.entry.js} +1 -1
  89. package/lmvz-components/{p-9626e951.entry.js → p-851969bd.entry.js} +1 -1
  90. package/lmvz-components/p-9f9d845d.entry.js +1 -0
  91. package/lmvz-components/p-CFsC37ww.js +1 -0
  92. package/lmvz-components/p-CGmJG63p.js +1 -0
  93. package/lmvz-components/p-CcxjkCOx.js +1 -0
  94. package/lmvz-components/{p-BxHnZA0M.js → p-GdMr6Qlp.js} +1 -1
  95. package/lmvz-components/p-a12f95da.entry.js +1 -0
  96. package/lmvz-components/{p-e1b847d2.entry.js → p-ab4437dc.entry.js} +1 -1
  97. package/lmvz-components/p-c3b7890d.entry.js +1 -0
  98. package/lmvz-components/{p-7a6bec13.entry.js → p-d0a0e206.entry.js} +1 -1
  99. package/lmvz-components/{p-DYaffOLo.js → p-dhVSUYqd.js} +1 -1
  100. package/manifest.json +833 -77
  101. package/package.json +9 -1
  102. package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +39 -0
  103. package/types/components/lmvz-toggle/lmvz-toggle.d.ts +31 -0
  104. package/types/components.d.ts +270 -0
  105. package/types/utils/icons/icons.d.ts +0 -1
  106. package/components/p-DXOTa5VF.js +0 -12
  107. package/components/p-fiRXhuXK.js +0 -1
  108. package/lmvz-components/p-0bL3pydp.js +0 -1
  109. package/lmvz-components/p-40569208.entry.js +0 -1
  110. package/lmvz-components/p-49ab22bd.entry.js +0 -1
  111. package/lmvz-components/p-Bu4Z_PMf.js +0 -1
  112. package/lmvz-components/p-DHZwxmLb.js +0 -12
@@ -0,0 +1,424 @@
1
+ import { toValidSvgStringWithFallback } from "@lmvz-ds/lib-ts/validation/svg.js";
2
+ import { h, Host } from "@stencil/core";
3
+ import checkmark from "../../assets/icons/checkmark.svg";
4
+ import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
5
+ import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
6
+ const CHECKMARK_SVG = toValidSvgStringWithFallback(checkmark);
7
+ let checkboxIdCounter = 0;
8
+ export class LmvzCheckbox extends ReactiveControllerHost {
9
+ el;
10
+ get validationEl() {
11
+ return this.el;
12
+ }
13
+ internals;
14
+ nativeInput;
15
+ checkboxId = `lmvz-checkbox-${checkboxIdCounter++}`;
16
+ initialChecked = false;
17
+ get helperId() {
18
+ return this.helperText ? `${this.checkboxId}-helper` : undefined;
19
+ }
20
+ get errorId() {
21
+ return this.errorMessage ? `${this.checkboxId}-error` : undefined;
22
+ }
23
+ get ariaDescribedBy() {
24
+ const ids = [this.errorId, this.helperId].filter(Boolean);
25
+ return ids.length > 0 ? ids.join(' ') : undefined;
26
+ }
27
+ label;
28
+ checked = false;
29
+ value = 'on';
30
+ name;
31
+ disabled = false;
32
+ required = false;
33
+ error = false;
34
+ errorMessage;
35
+ helperText;
36
+ form;
37
+ autofocus = false;
38
+ checkedState = false;
39
+ handleCheckedChange(val) {
40
+ this.checkedState = val;
41
+ this.internals.setFormValue?.(val ? (this.value ?? 'on') : null);
42
+ }
43
+ lmvzChange;
44
+ async focusInput() {
45
+ this.nativeInput?.focus();
46
+ }
47
+ async checkValidity() {
48
+ return this.internals?.checkValidity() ?? true;
49
+ }
50
+ async reportValidity() {
51
+ return this.internals?.reportValidity() ?? true;
52
+ }
53
+ constructor() {
54
+ super();
55
+ this.addController(new AriaValidationController(this, {
56
+ reValidateOnPropChanges: true,
57
+ }));
58
+ }
59
+ componentWillLoad() {
60
+ this.initialChecked = this.checked;
61
+ this.checkedState = this.checked;
62
+ this.internals.setFormValue?.(this.checked ? (this.value ?? 'on') : null);
63
+ super.componentWillLoad();
64
+ }
65
+ componentWillRender() {
66
+ if (this.error && !this.errorMessage) {
67
+ console.warn('lmvz-checkbox: error=true set without errorMessage — no visual-only error state is rendered. Provide errorMessage to communicate the error to users.');
68
+ }
69
+ super.componentWillRender();
70
+ }
71
+ formAssociatedCallback() {
72
+ this.internals.setFormValue?.(this.checked ? (this.value ?? 'on') : null);
73
+ }
74
+ formResetCallback() {
75
+ this.checked = this.initialChecked;
76
+ }
77
+ formStateRestoreCallback(state) {
78
+ this.checked = state === (this.value ?? 'on');
79
+ }
80
+ handleChange = (event) => {
81
+ const input = event.target;
82
+ this.checked = input.checked;
83
+ this.lmvzChange.emit(this.checked);
84
+ };
85
+ render() {
86
+ return (h(Host, { key: '6014c885305bc9824f7a6d4f0ba8c642125f3a5b' }, h("div", { key: 'cbc6de2b684acfb00b77a366e707d73de74a0b8a', class: "pill" }, h("input", { key: '5b442512b6cab2e60a1d62fd40e4c868b1bf87ac', type: "checkbox", id: this.checkboxId, checked: this.checkedState, disabled: this.disabled, required: this.required, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.ariaDescribedBy, "aria-errormessage": this.error && this.errorId ? this.errorId : undefined, ref: (el) => (this.nativeInput = el), onChange: this.handleChange, autoFocus: this.autofocus }), h("span", { key: '09c534b7c5642c620129ea05a4468bd584c56ce7', class: "box", "aria-hidden": "true" }, this.checkedState && h("span", { key: 'eaa49e1a60054f8efc62ade0446a4704f0bb46e9', class: "indicator", innerHTML: CHECKMARK_SVG })), h("span", { key: '8fb836d71cbb3d4eadaf67284f5bb52906549275', class: "content" }, h("label", { key: '8df862f11e9885158264908fdac6599f21ecba07', htmlFor: this.checkboxId }, this.label), this.helperText && (h("span", { key: '1e45e6177774e937311cddacd1a3d3379c9c6af5', class: "helper-text", id: this.helperId, role: "status" }, this.helperText)))), this.errorMessage && (h("span", { key: '83fc1f7cd6828973e52ef27604f12f94f41d7f4b', class: "error-text", id: this.errorId, role: "alert" }, this.errorMessage))));
87
+ }
88
+ static get is() { return "lmvz-checkbox"; }
89
+ static get encapsulation() { return "scoped"; }
90
+ static get formAssociated() { return true; }
91
+ static get originalStyleUrls() {
92
+ return {
93
+ "$": ["./lmvz-checkbox.css"]
94
+ };
95
+ }
96
+ static get styleUrls() {
97
+ return {
98
+ "$": ["lmvz-checkbox.css"]
99
+ };
100
+ }
101
+ static get properties() {
102
+ return {
103
+ "label": {
104
+ "type": "string",
105
+ "mutable": false,
106
+ "complexType": {
107
+ "original": "string",
108
+ "resolved": "string",
109
+ "references": {}
110
+ },
111
+ "required": true,
112
+ "optional": false,
113
+ "docs": {
114
+ "tags": [],
115
+ "text": "Label text for the checkbox. Required for accessibility."
116
+ },
117
+ "getter": false,
118
+ "setter": false,
119
+ "reflect": false,
120
+ "attribute": "label"
121
+ },
122
+ "checked": {
123
+ "type": "boolean",
124
+ "mutable": true,
125
+ "complexType": {
126
+ "original": "boolean",
127
+ "resolved": "boolean",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [{
134
+ "name": "default",
135
+ "text": "false"
136
+ }],
137
+ "text": "Whether the checkbox is checked."
138
+ },
139
+ "getter": false,
140
+ "setter": false,
141
+ "reflect": true,
142
+ "attribute": "checked",
143
+ "defaultValue": "false"
144
+ },
145
+ "value": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [{
157
+ "name": "default",
158
+ "text": "'on'"
159
+ }],
160
+ "text": "Form submission value when checked."
161
+ },
162
+ "getter": false,
163
+ "setter": false,
164
+ "reflect": false,
165
+ "attribute": "value",
166
+ "defaultValue": "'on'"
167
+ },
168
+ "name": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string | undefined",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": true,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Name attribute for form submission via ElementInternals."
181
+ },
182
+ "getter": false,
183
+ "setter": false,
184
+ "reflect": false,
185
+ "attribute": "name"
186
+ },
187
+ "disabled": {
188
+ "type": "boolean",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "boolean",
192
+ "resolved": "boolean",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [{
199
+ "name": "default",
200
+ "text": "false"
201
+ }],
202
+ "text": "Whether the checkbox is disabled."
203
+ },
204
+ "getter": false,
205
+ "setter": false,
206
+ "reflect": true,
207
+ "attribute": "disabled",
208
+ "defaultValue": "false"
209
+ },
210
+ "required": {
211
+ "type": "boolean",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "boolean",
215
+ "resolved": "boolean",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [{
222
+ "name": "default",
223
+ "text": "false"
224
+ }],
225
+ "text": "Whether the checkbox is required."
226
+ },
227
+ "getter": false,
228
+ "setter": false,
229
+ "reflect": true,
230
+ "attribute": "required",
231
+ "defaultValue": "false"
232
+ },
233
+ "error": {
234
+ "type": "boolean",
235
+ "mutable": false,
236
+ "complexType": {
237
+ "original": "boolean",
238
+ "resolved": "boolean",
239
+ "references": {}
240
+ },
241
+ "required": false,
242
+ "optional": false,
243
+ "docs": {
244
+ "tags": [{
245
+ "name": "default",
246
+ "text": "false"
247
+ }],
248
+ "text": "Whether the checkbox is in an error state."
249
+ },
250
+ "getter": false,
251
+ "setter": false,
252
+ "reflect": true,
253
+ "attribute": "error",
254
+ "defaultValue": "false"
255
+ },
256
+ "errorMessage": {
257
+ "type": "string",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "string",
261
+ "resolved": "string | undefined",
262
+ "references": {}
263
+ },
264
+ "required": false,
265
+ "optional": true,
266
+ "docs": {
267
+ "tags": [],
268
+ "text": "Error message displayed when error is true. Required when error=true."
269
+ },
270
+ "getter": false,
271
+ "setter": false,
272
+ "reflect": false,
273
+ "attribute": "error-message"
274
+ },
275
+ "helperText": {
276
+ "type": "string",
277
+ "mutable": false,
278
+ "complexType": {
279
+ "original": "string",
280
+ "resolved": "string | undefined",
281
+ "references": {}
282
+ },
283
+ "required": false,
284
+ "optional": true,
285
+ "docs": {
286
+ "tags": [],
287
+ "text": "Helper / description text displayed below the label."
288
+ },
289
+ "getter": false,
290
+ "setter": false,
291
+ "reflect": false,
292
+ "attribute": "helper-text"
293
+ },
294
+ "form": {
295
+ "type": "string",
296
+ "mutable": false,
297
+ "complexType": {
298
+ "original": "string",
299
+ "resolved": "string | undefined",
300
+ "references": {}
301
+ },
302
+ "required": false,
303
+ "optional": true,
304
+ "docs": {
305
+ "tags": [],
306
+ "text": "Form id to associate with (for out-of-form usage)."
307
+ },
308
+ "getter": false,
309
+ "setter": false,
310
+ "reflect": false,
311
+ "attribute": "form"
312
+ },
313
+ "autofocus": {
314
+ "type": "boolean",
315
+ "mutable": false,
316
+ "complexType": {
317
+ "original": "boolean",
318
+ "resolved": "boolean",
319
+ "references": {}
320
+ },
321
+ "required": false,
322
+ "optional": false,
323
+ "docs": {
324
+ "tags": [{
325
+ "name": "default",
326
+ "text": "false"
327
+ }],
328
+ "text": "Whether the checkbox should autofocus."
329
+ },
330
+ "getter": false,
331
+ "setter": false,
332
+ "reflect": false,
333
+ "attribute": "autofocus",
334
+ "defaultValue": "false"
335
+ }
336
+ };
337
+ }
338
+ static get states() {
339
+ return {
340
+ "checkedState": {}
341
+ };
342
+ }
343
+ static get events() {
344
+ return [{
345
+ "method": "lmvzChange",
346
+ "name": "lmvzChange",
347
+ "bubbles": true,
348
+ "cancelable": true,
349
+ "composed": true,
350
+ "docs": {
351
+ "tags": [],
352
+ "text": "Emitted whenever the checkbox checked state changes.\nEvent detail contains the new checked boolean value."
353
+ },
354
+ "complexType": {
355
+ "original": "boolean",
356
+ "resolved": "boolean",
357
+ "references": {}
358
+ }
359
+ }];
360
+ }
361
+ static get methods() {
362
+ return {
363
+ "focusInput": {
364
+ "complexType": {
365
+ "signature": "() => Promise<void>",
366
+ "parameters": [],
367
+ "references": {
368
+ "Promise": {
369
+ "location": "global",
370
+ "id": "global::Promise"
371
+ }
372
+ },
373
+ "return": "Promise<void>"
374
+ },
375
+ "docs": {
376
+ "text": "Sets focus on the native checkbox input.",
377
+ "tags": []
378
+ }
379
+ },
380
+ "checkValidity": {
381
+ "complexType": {
382
+ "signature": "() => Promise<boolean>",
383
+ "parameters": [],
384
+ "references": {
385
+ "Promise": {
386
+ "location": "global",
387
+ "id": "global::Promise"
388
+ }
389
+ },
390
+ "return": "Promise<boolean>"
391
+ },
392
+ "docs": {
393
+ "text": "Returns whether the checkbox satisfies its validation constraints.",
394
+ "tags": []
395
+ }
396
+ },
397
+ "reportValidity": {
398
+ "complexType": {
399
+ "signature": "() => Promise<boolean>",
400
+ "parameters": [],
401
+ "references": {
402
+ "Promise": {
403
+ "location": "global",
404
+ "id": "global::Promise"
405
+ }
406
+ },
407
+ "return": "Promise<boolean>"
408
+ },
409
+ "docs": {
410
+ "text": "Reports validation errors to the user.",
411
+ "tags": []
412
+ }
413
+ }
414
+ };
415
+ }
416
+ static get elementRef() { return "el"; }
417
+ static get watchers() {
418
+ return [{
419
+ "propName": "checked",
420
+ "methodName": "handleCheckedChange"
421
+ }];
422
+ }
423
+ static get attachInternalsMemberName() { return "internals"; }
424
+ }
@@ -48,7 +48,7 @@ export class LmvzChip extends ReactiveControllerHost {
48
48
  }
49
49
  }, 500);
50
50
  render() {
51
- return (h(Host, { key: 'd34b677a3f6ac2cdb53453c774badb837a3b9e25', type: this.type, size: this.size }, h("slot", { key: 'c6f8beea28cd847f8d8b7c7a075c774f58e39262', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), h("span", { key: 'be784ef977bc1d0eae2fd2d9377642636bd325bc', class: "content-overflow-wrapper" }, h("slot", { key: '3730f2902bcae7917979dedd91264670fbff00de', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), h("slot", { key: 'f827a03e407385c7bdfd483073453d97f6f73afb', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
51
+ return (h(Host, { key: 'c77e8ae55531eefb31dd37b41b4851746a78f077', type: this.type, size: this.size }, h("slot", { key: '3f4d0a8feb887080172d11facc01afbe730b2726', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), h("span", { key: '6ec135ebcb32f15fea342379ac2b1dfebbe76fa6', class: "content-overflow-wrapper" }, h("slot", { key: '053afb88e2d6702428aab195bfcec6aff6d9c55f', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), h("slot", { key: 'ed51db073a512a32d12da59dee285708b83ae87b', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
52
52
  }
53
53
  static get is() { return "lmvz-chip"; }
54
54
  static get encapsulation() { return "shadow"; }
@@ -84,7 +84,7 @@ export class LmvzHeader extends ReactiveControllerHost {
84
84
  }
85
85
  }
86
86
  render() {
87
- return (h(Host, { key: '74061d97a6d4cdec1f445a91b9e819bb12565681', onFocus: this.delegateFocus.bind(this) }, h("div", { key: 'af7f08ff48a20b7d36df5ee233da7027cd30a047', class: "brand" }, h("slot", { key: '46be4fcf2798ac374ac967bc2742260c4d7e082b', name: "brand" }, h("img", { key: '3ee79f9732758a6ca5dd6e8264c67707917b358b', id: "fallback-logo-lmvz", src: logo, alt: "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: '8f37883454544a384bb35a151c4e24bb12c35f40', "aria-label": "Hauptnavigation" }, h("div", { key: 'a3166ad7e924dd72148d05c01160c889c8f07529', role: "menubar", class: "primary-menubar" }, h("slot", { key: 'aa600791e4d8f3463fefbc3b366831e3b3a3eaac', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), h("div", { key: '6471256967f4d14c454205a330b2a97ecfcad7a8', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, h("slot", { key: '1b9b461b958e76184938a1c65d032b296894e2dd', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), h("div", { key: '019d87472272df09ce99eeed405771229f326f1a', class: "actions" }, h("slot", { key: '18035fb0a51a26c96dc687547d17d57118a88e87', name: "actions" }))));
87
+ return (h(Host, { key: '87ecb9948039ea2f4b998bf35865e5839708a65c', onFocus: this.delegateFocus.bind(this) }, h("div", { key: '4f1ae09b1a3e0a9c3eb12659b3952eef34cbd67b', class: "brand" }, h("slot", { key: '99c03f87f0b3462d9b44835ba34ee05c75373b22', name: "brand" }, h("img", { key: '1616ce8464c2e798a53bc7c879385e3882e4d32f', id: "fallback-logo-lmvz", src: logo, alt: "Lehrmittelverlag Z\u00FCrich" }))), h("nav", { key: 'ff7c56dbc9e80ba9a0757683069e1cba168abcb6', "aria-label": "Hauptnavigation" }, h("div", { key: 'a3bb67d788b936422992b066431c73098ff2aa11', role: "menubar", class: "primary-menubar" }, h("slot", { key: 'e85b93f943c6d97bd5a7fa6f75e4855785d09ec5', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), h("div", { key: 'e9efcfc5d3a8cb991c255b32b205924dafb5aaf6', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, h("slot", { key: '7314e6a72705d48b347fa30945b1d5513b87bfd3', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), h("div", { key: 'aee503cddbf8964833934e594caf5faa6e073a02', class: "actions" }, h("slot", { key: '5c1b15c0507ef24f67e37cd1652b4cc5ce4cc104', name: "actions" }))));
88
88
  }
89
89
  static get is() { return "lmvz-header"; }
90
90
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,5 @@
1
- import { createValidSVGString, isValidSVG } from "@lmvz-ds/lib-ts/validation/svg.js";
1
+ import { parseSvgString } from "@lmvz-ds/lib-ts/validation/svg.js";
2
2
  import { Build, h, Host } from "@stencil/core";
3
- import { Micro } from "effect";
4
3
  import { AriaValidationController } from "../../utils/aria/aria-validation-controller";
5
4
  import { resolveIconSvg } from "../../utils/icons/icons";
6
5
  import { ReactiveControllerHost } from "../../utils/reactive-controller-host";
@@ -42,8 +41,9 @@ export class LmvzIcon extends ReactiveControllerHost {
42
41
  if (!Build.isBrowser || !icon || !visible) {
43
42
  return;
44
43
  }
45
- if (isValidSVG(icon)) {
46
- this.iconData = await Micro.runPromise(createValidSVGString(icon));
44
+ const maybeIcon = parseSvgString(icon);
45
+ if (maybeIcon) {
46
+ this.iconData = maybeIcon;
47
47
  return;
48
48
  }
49
49
  this.iconData = await resolveIconSvg({
@@ -57,7 +57,7 @@ export class LmvzIcon extends ReactiveControllerHost {
57
57
  super.componentDidRender();
58
58
  }
59
59
  render() {
60
- return h(Host, { key: 'c1e952e00df287c66c49eb043408514c07c3dc39', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
60
+ return h(Host, { key: 'e76fe28500b3545b8917ecdad590da5bc04ed38f', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
61
61
  }
62
62
  waitUntilVisible(callback, rootMargin = 50) {
63
63
  if (!Build.isBrowser || typeof window === 'undefined' || !window.IntersectionObserver) {
@@ -150,9 +150,9 @@ export class LmvzInput extends ReactiveControllerHost {
150
150
  render() {
151
151
  const hasValue = Boolean(this.value);
152
152
  const shouldFloatLabel = hasValue || Boolean(this.placeholder);
153
- return (h("div", { key: '22be29e5fcd4976fc6c4d125781be00acef0b359', class: classNames('input-container', {
153
+ return (h("div", { key: '3cbfee5fccbb5efe1bfb9c6622653e11d4896615', class: classNames('input-container', {
154
154
  'interaction-filled': hasValue,
155
- }) }, h("div", { key: 'ffeb620419316976e800b16b4a9fd9538f1efd26', class: "input-wrapper" }, h("slot", { key: '2a1a67f7fde0232b2bb5ce3cc228b869e5ac3516', name: "before-input" }), h("div", { key: '3bbe623cae67d376c60a28306164293a712b1bb5', class: "label-input-group" }, h("label", { key: 'c260b3eb249d5c785fe3b6e223c7428a8c147f50', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: 'f43dd77efe7e319428dd72ec8933b7587635e767', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: 'eeb821a74a5ac7aab3fab65a48a37d21a22744e6', id: this.inputId, ref: (el) => (this.nativeInputElement = el), type: this.type, min: this.min, max: this.max, step: this.step, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, form: this.form, autocomplete: this.autocomplete, inputmode: this.inputmode, autocorrect: this.autocorrect, autocapitalize: this.autocapitalize, spellcheck: this.spellcheck, autofocus: this.autofocus, minlength: this.minlength, maxlength: this.maxlength, pattern: this.pattern, "aria-invalid": this.error ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-describedby": this.describedBy, "aria-errormessage": this.errorId, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("slot", { key: 'dd36a212c05c43ab2a8249750c14a7475b6d65d3', name: "after-input" })), h("div", { key: 'c2aedd67036faf4d3dc459c3c1fab8d07ee5a991', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '01d2a6d6df9b3804a595711c7b57b6177d311c39', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
155
+ }) }, h("div", { key: '2712b0d5eda0ca1d4da70f362047df07acf922a5', class: "input-wrapper" }, h("slot", { key: '992bc86de6b3bdd3cdbac1c000d38a338e6e4474', name: "before-input" }), h("div", { key: '35ace7d889667f5d09eea76dcba161f8711c9b1c', class: "label-input-group" }, h("label", { key: '28520dddf331d35ba75283673aa81e0046628907', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (h("span", { key: 'b91766b86b1bc68ce3dbb4b734ee4aa40fe0759b', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), h("input", { key: 'ed7cd4b64091256df1c3b939c1e22d6082fe58b9', id: this.inputId, ref: (el) => (this.nativeInputElement = el), type: this.type, min: this.min, max: this.max, step: this.step, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, form: this.form, autocomplete: this.autocomplete, inputmode: this.inputmode, autocorrect: this.autocorrect, autocapitalize: this.autocapitalize, spellcheck: this.spellcheck, autofocus: this.autofocus, minlength: this.minlength, maxlength: this.maxlength, pattern: this.pattern, "aria-invalid": this.error ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-describedby": this.describedBy, "aria-errormessage": this.errorId, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("slot", { key: '1e42c305b8e554fadd7c50fbbb54ea234c734b0a', name: "after-input" })), h("div", { key: '190a1a92971a717f3ef594615fbe4dd0c9a72493', id: this.helperId, role: "status" }, this.helperText || null), h("div", { key: '4d07b45a51d3733caf09a1bbc56ae6f51411ecbc', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
156
156
  }
157
157
  static get is() { return "lmvz-input"; }
158
158
  static get encapsulation() { return "scoped"; }
@@ -62,6 +62,6 @@
62
62
  z-index: 1;
63
63
  }
64
64
  :host([aria-expanded='true']) {
65
- --lmvz-menuitem-background: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
65
+ --lmvz-menuitem-background: var(--lmvz-semantic-color-status-active, #f1f9fe);
66
66
  --lmvz-menuitem-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
67
67
  }
@@ -21,7 +21,7 @@ export class LmvzMenuItem extends ReactiveControllerHost {
21
21
  this.addController(new ElementActivationController(this));
22
22
  }
23
23
  render() {
24
- return (h(Host, { key: '0878343aec1c98c16c073c6cdd3382ee5c980799' }, h("slot", { key: 'f7a87d4c9d786bb4686d406d4313e9b5d79701d6', ref: (e) => (this.validationSlot = e) })));
24
+ return (h(Host, { key: 'a87116fba2d35c612e590c6b4e12c03b60d1ef0e' }, h("slot", { key: 'b302049db0b5818d4d7f90c043eb5c3caf48ca1b', ref: (e) => (this.validationSlot = e) })));
25
25
  }
26
26
  static get is() { return "lmvz-menuitem"; }
27
27
  static get encapsulation() { return "scoped"; }
@@ -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: 'b9f6211fec35e7c03cc9c462cb1f8eb60fc6c96c' }, h("div", { key: '43d22daa1492f87f89f9479687b82ee893f10faa', class: "select-wrapper" }, h("label", { key: 'cf399d80e31a345cea60286db4aea2d7dd7973d1', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && h("span", { key: '6bdd8e0d652f126eb1c64c2a647ac0816cc61b05', "aria-hidden": "true" }, " *")), h("div", { key: '5d8497c64e197a71003a0c8e11149993fcefd684', "aria-hidden": "true" }, h("span", { key: '95b73705ad81d000ce415a377002e4ae4d63aae6' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && h("span", { key: '2ff855f0fa89d3c66c59a176f855fdbf18ecb6c2', "aria-hidden": "true" }, " *")), h("span", { key: 'a66d4ec65c95b1463223c07aecb17d65a45c6b24' }, h("img", { key: '4cd21532ff13a3ecbd229cd79d0a3fa7b3eafc60', src: chevronDownSvg, alt: "" }))), h("select", { key: '2a9e46e29f8ef7d116989b58abfacee840dd2275', 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: '5c5fa4d5e3b120a0085f6fc408d20a56f6547441', value: "", disabled: true, selected: true, hidden: true }), h("slot", { key: 'e11909e901624af7d9d5275f2e9715007960eab9' }))), this.helperText && h("div", { key: 'fa0d06d3294f303081fd5ffb9aeaff6a8e297901', role: "status" }, this.helperText)));
53
+ return (h(Host, { key: '1bdd53df4a33c5292cc072b0a9abc45fa01b237f' }, h("div", { key: 'e38d81e620d8c27cd34e1a7799c42d5640d4b0db', class: "select-wrapper" }, h("label", { key: '3995206b564c7e17ac273709577eb8dd7a3b0ff1', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && h("span", { key: '7c04028f9ff3e0f365f76d10b0139dc6805f2af4', "aria-hidden": "true" }, " *")), h("div", { key: '7b428d22a32181fc13e837b6821ab163ac286453', "aria-hidden": "true" }, h("span", { key: '385ddb473337869777e835cc5b533f9a41c1fbe3' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && h("span", { key: 'c53036bd718b916b910225297b40df998729650c', "aria-hidden": "true" }, " *")), h("span", { key: '06db17fbe01d9fea9904aa04e72b6cbfc9d93652' }, h("img", { key: 'b4d46ada048e931aa71f2ace33c93ff9fc67e479', src: chevronDownSvg, alt: "" }))), h("select", { key: '841c86f1d340cd36475a7757e9cad5f33aeac710', 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: '4bd193f7878da2077c9185cd093d61c62406a7b9', value: "", disabled: true, selected: true, hidden: true }), h("slot", { key: 'c14a15e022f08ad72a5ad9d29befe0db7c6f24db' }))), this.helperText && h("div", { key: '833eaa383f8a9722fd990fadcdff4a93aa0a79df', role: "status" }, this.helperText)));
54
54
  }
55
55
  static get is() { return "lmvz-select"; }
56
56
  static get encapsulation() { return "scoped"; }
@@ -0,0 +1,118 @@
1
+
2
+ @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides;
3
+ /**
4
+ * This defines the order of our lmvz-ds' CSS layers. See readme.md for details.
5
+ * Important: Always import this file _before_ layering your own styles!
6
+ */
7
+ @layer lmvz-ds.theme {
8
+ @font-face {
9
+ font-family: Router;
10
+ src:
11
+ local('Router-Book'),
12
+ url('/assets/fonts/Router-Book.woff') format('woff'),
13
+ local('Router');
14
+ font-weight: 400 normal;
15
+ }
16
+
17
+ @font-face {
18
+ font-family: Router;
19
+ src:
20
+ local('Router-Medium'),
21
+ url('/assets/fonts/Router-Medium.woff') format('woff'),
22
+ local('Router');
23
+ font-weight: 500;
24
+ }
25
+
26
+ @font-face {
27
+ font-family: Router;
28
+ src:
29
+ local('Router-Bold'),
30
+ url('/assets/fonts/Router-Bold.woff') format('woff'),
31
+ local('Router');
32
+ font-weight: 700 bold;
33
+ }
34
+
35
+ }
36
+ :host {
37
+ display: inline-flex;
38
+ align-items: center;
39
+ gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
40
+ padding-block: var(--lmvz-dimension-2-8, clamp(0.13rem, 0.03rem + 0.39vw, 0.5rem));
41
+ padding-inline: var(--lmvz-dimension-4-10, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
42
+ /* TODO[LDHCID-136]: min-height currently below accessibility requirements for tap targets (44px) */
43
+ /* min-height: 38px; */
44
+ border-radius: var(--lmvz-semantic-border-radius-round, 999px);
45
+ cursor: pointer;
46
+ background-color: transparent;
47
+ user-select: none;
48
+ }
49
+ :host(:not([disabled]):hover) {
50
+ background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0);
51
+ }
52
+ :host([checked]) {
53
+ background-color: var(--lmvz-semantic-color-status-active, #f1f9fe);
54
+ }
55
+ :host([disabled][checked]) {
56
+ background-color: var(--lmvz-semantic-color-status-active, #f1f9fe);
57
+ }
58
+ :host([disabled]) {
59
+ cursor: not-allowed;
60
+ opacity: var(--lmvz-component-input-disabled-opacity, 40%);
61
+ pointer-events: none;
62
+ }
63
+ .track {
64
+ position: relative;
65
+ flex-shrink: 0;
66
+ width: var(--lmvz-global-s32, 32px);
67
+ height: var(--lmvz-global-s20, 20px);
68
+ border-radius: var(--lmvz-semantic-border-radius-round, 999px);
69
+ background-color: var(--lmvz-semantic-color-surface-input-primary, #ffffff);
70
+ border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0);
71
+ }
72
+ :host(:not([disabled]):hover) .track {
73
+ border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7);
74
+ }
75
+ :host([checked]) .track {
76
+ border-color: var(--lmvz-semantic-color-border-active, #0f8acc);
77
+ }
78
+ input {
79
+ /* visually hidden, keyboard-accessible */
80
+ position: absolute;
81
+ top: 0;
82
+ left: 0;
83
+ width: 100%;
84
+ height: 100%;
85
+ opacity: 0;
86
+ margin: 0;
87
+ cursor: inherit;
88
+ }
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
+ .thumb {
95
+ position: absolute;
96
+ width: var(--lmvz-global-s13, 13px);
97
+ height: var(--lmvz-global-s13, 13px);
98
+ border-radius: 50%;
99
+ background-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a);
100
+ top: 50%;
101
+ transform: translateY(-50%);
102
+ left: var(--lmvz-global-s4, 4px);
103
+ /* TODO[LDHCID-136]: no DS motion/duration token — 0.2s ease from Figma interaction baseline */
104
+ transition:
105
+ left 0.2s ease,
106
+ background-color 0.2s ease;
107
+ pointer-events: none;
108
+ }
109
+ :host([checked]) .thumb {
110
+ left: calc(var(--lmvz-global-s4, 4px) + var(--lmvz-global-s11, 11px));
111
+ background-color: var(--lmvz-semantic-color-status-on-active, #0e7ab4);
112
+ }
113
+ label {
114
+ font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
115
+ Router);
116
+ color: var(--lmvz-semantic-color-on-surface-primary, #000000);
117
+ cursor: pointer;
118
+ }