@lmvz-ds/components 0.20.0 → 0.22.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 (107) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/assets/icons/close-sm.svg +3 -0
  3. package/cjs/{component-Csg9MtNK.js → component-C7cavwmZ.js} +3 -0
  4. package/cjs/{index-C2yDXRqP.js → index-lW-SEvL7.js} +67 -3
  5. package/cjs/lmvz-action.cjs.entry.js +2 -2
  6. package/cjs/{lmvz-button.cjs.entry.js → lmvz-button_2.cjs.entry.js} +139 -14
  7. package/cjs/lmvz-card.cjs.entry.js +2 -2
  8. package/cjs/lmvz-checkbox.cjs.entry.js +3 -3
  9. package/cjs/lmvz-chip.cjs.entry.js +4 -4
  10. package/cjs/lmvz-components.cjs.js +2 -2
  11. package/cjs/lmvz-header_2.cjs.entry.js +3 -3
  12. package/cjs/lmvz-input.cjs.entry.js +4 -4
  13. package/cjs/lmvz-menuitem.cjs.entry.js +3 -3
  14. package/cjs/lmvz-modal.cjs.entry.js +349 -0
  15. package/cjs/lmvz-select.cjs.entry.js +4 -4
  16. package/cjs/lmvz-toggle.cjs.entry.js +96 -0
  17. package/cjs/loader.cjs.js +2 -2
  18. package/cjs/{reactive-controller-host-BA4ZhjKA.js → reactive-controller-host-DnSTWHCF.js} +1 -1
  19. package/collection/assets/icons/close-sm.svg +3 -0
  20. package/collection/collection-manifest.json +2 -0
  21. package/collection/components/lmvz-button/lmvz-button.js +98 -10
  22. package/collection/components/lmvz-chip/lmvz-chip.js +2 -2
  23. package/collection/components/lmvz-modal/lmvz-modal.css +120 -0
  24. package/collection/components/lmvz-modal/lmvz-modal.js +448 -0
  25. package/collection/components/lmvz-select/lmvz-select.js +1 -1
  26. package/collection/components/lmvz-toggle/lmvz-toggle.css +118 -0
  27. package/collection/components/lmvz-toggle/lmvz-toggle.js +358 -0
  28. package/collection/integration/header-integration/header-integration.js +1 -1
  29. package/components/index.d.ts +4 -0
  30. package/components/index.d.ts.bak +4 -0
  31. package/components/index.js +1 -1
  32. package/components/lmvz-action.js +1 -1
  33. package/components/lmvz-button.js +1 -1
  34. package/components/lmvz-card.js +1 -1
  35. package/components/lmvz-checkbox.js +1 -1
  36. package/components/lmvz-chip.js +1 -1
  37. package/components/lmvz-header.js +1 -1
  38. package/components/lmvz-icon.js +1 -1
  39. package/components/lmvz-input.js +1 -1
  40. package/components/lmvz-menuitem.js +1 -1
  41. package/components/lmvz-modal.d.ts +11 -0
  42. package/components/lmvz-modal.d.ts.bak +11 -0
  43. package/components/lmvz-modal.js +1 -0
  44. package/components/lmvz-select.js +1 -1
  45. package/components/lmvz-toggle.d.ts +11 -0
  46. package/components/lmvz-toggle.d.ts.bak +11 -0
  47. package/components/lmvz-toggle.js +1 -0
  48. package/components/p-Boj0PCdB.js +1 -0
  49. package/components/p-CK8cAKcB.js +1 -0
  50. package/components/p-Cc6dOWwS.js +1 -0
  51. package/components/{p-BuFx0tTm.js → p-DBc1BzQb.js} +1 -1
  52. package/components/p-DOTK1OW3.js +1 -0
  53. package/esm/{component-DIrAQ4IB.js → component-DOTK1OW3.js} +3 -0
  54. package/esm/{index-saW7O-EW.js → index-Aa_425iY.js} +67 -3
  55. package/esm/lmvz-action.entry.js +2 -2
  56. package/esm/{lmvz-button.entry.js → lmvz-button_2.entry.js} +139 -15
  57. package/esm/lmvz-card.entry.js +2 -2
  58. package/esm/lmvz-checkbox.entry.js +3 -3
  59. package/esm/lmvz-chip.entry.js +4 -4
  60. package/esm/lmvz-components.js +3 -3
  61. package/esm/lmvz-header_2.entry.js +3 -3
  62. package/esm/lmvz-input.entry.js +4 -4
  63. package/esm/lmvz-menuitem.entry.js +3 -3
  64. package/esm/lmvz-modal.entry.js +347 -0
  65. package/esm/lmvz-select.entry.js +4 -4
  66. package/esm/lmvz-toggle.entry.js +94 -0
  67. package/esm/loader.js +3 -3
  68. package/esm/{reactive-controller-host-DHcPpJW7.js → reactive-controller-host-lF2kXM1x.js} +1 -1
  69. package/hydrate/index.js +559 -24
  70. package/hydrate/index.mjs +559 -24
  71. package/lmvz-components/lmvz-components.esm.js +1 -1
  72. package/lmvz-components/p-08a08b63.entry.js +1 -0
  73. package/lmvz-components/p-1b181e90.entry.js +1 -0
  74. package/lmvz-components/p-23fb2476.entry.js +1 -0
  75. package/lmvz-components/p-3846ba08.entry.js +1 -0
  76. package/lmvz-components/p-6bb145e4.entry.js +1 -0
  77. package/lmvz-components/{p-2f83d7a2.entry.js → p-7a310b1e.entry.js} +1 -1
  78. package/lmvz-components/p-Aa_425iY.js +2 -0
  79. package/lmvz-components/{p-GdMr6Qlp.js → p-DCTzMRMQ.js} +1 -1
  80. package/lmvz-components/p-DOTK1OW3.js +1 -0
  81. package/lmvz-components/p-b7940687.entry.js +1 -0
  82. package/lmvz-components/p-d984e118.entry.js +1 -0
  83. package/lmvz-components/p-db8306a5.entry.js +1 -0
  84. package/lmvz-components/p-ea335543.entry.js +1 -0
  85. package/lmvz-components/p-f8ea0eb2.entry.js +1 -0
  86. package/manifest.json +599 -5
  87. package/package.json +9 -1
  88. package/types/api/index.d.ts +6 -0
  89. package/types/components/lmvz-button/lmvz-button.d.ts +4 -0
  90. package/types/components/lmvz-modal/lmvz-modal.d.ts +58 -0
  91. package/types/components/lmvz-toggle/lmvz-toggle.d.ts +31 -0
  92. package/types/components.d.ts +196 -0
  93. package/cjs/lmvz-icon.cjs.entry.js +0 -100
  94. package/components/p-C_bScbrd.js +0 -1
  95. package/components/p-DIrAQ4IB.js +0 -1
  96. package/esm/lmvz-icon.entry.js +0 -98
  97. package/lmvz-components/p-0f7a4236.entry.js +0 -1
  98. package/lmvz-components/p-32171f4f.entry.js +0 -1
  99. package/lmvz-components/p-400b2318.entry.js +0 -1
  100. package/lmvz-components/p-43e295ba.entry.js +0 -1
  101. package/lmvz-components/p-851969bd.entry.js +0 -1
  102. package/lmvz-components/p-9f9d845d.entry.js +0 -1
  103. package/lmvz-components/p-DIrAQ4IB.js +0 -1
  104. package/lmvz-components/p-a12f95da.entry.js +0 -1
  105. package/lmvz-components/p-ab4437dc.entry.js +0 -1
  106. package/lmvz-components/p-d0a0e206.entry.js +0 -1
  107. package/lmvz-components/p-saW7O-EW.js +0 -2
@@ -19,6 +19,9 @@ export class LmvzButton extends ReactiveControllerHost {
19
19
  disabled = false;
20
20
  type = 'button';
21
21
  form;
22
+ formMethod;
23
+ name;
24
+ value;
22
25
  constructor() {
23
26
  super();
24
27
  this.addController(new AriaValidationController(this));
@@ -31,18 +34,46 @@ export class LmvzButton extends ReactiveControllerHost {
31
34
  this.inheritedAttributes = inheritAriaAttributes(this.el);
32
35
  super.connectedCallback();
33
36
  }
37
+ disconnectedCallback() {
38
+ this.formButtonEl?.remove();
39
+ this.formButtonEl = null;
40
+ this.formEl = null;
41
+ super.disconnectedCallback();
42
+ }
34
43
  renderHiddenButton() {
35
- const formEl = (this.formEl = findFormByRef(this.form, this.el));
36
- if (!formEl)
44
+ if (this.type !== 'submit') {
45
+ this.formButtonEl?.remove();
46
+ this.formButtonEl = null;
47
+ this.formEl = null;
37
48
  return;
38
- const { formButtonEl } = this;
39
- if (formButtonEl !== null && formEl.contains(formButtonEl))
49
+ }
50
+ const formEl = findFormByRef(this.form, this.el);
51
+ if (!formEl) {
52
+ this.formButtonEl?.remove();
53
+ this.formButtonEl = null;
54
+ this.formEl = null;
40
55
  return;
41
- const newFormButtonEl = (this.formButtonEl = document.createElement('button'));
42
- newFormButtonEl.type = 'submit';
43
- newFormButtonEl.style.display = 'none';
44
- newFormButtonEl.disabled = this.disabled;
45
- formEl.appendChild(newFormButtonEl);
56
+ }
57
+ this.formEl = formEl;
58
+ const formButtonEl = this.formButtonEl ?? document.createElement('button');
59
+ formButtonEl.type = 'submit';
60
+ formButtonEl.style.display = 'none';
61
+ formButtonEl.disabled = this.disabled;
62
+ formButtonEl.name = this.name ?? '';
63
+ formButtonEl.value = this.value ?? '';
64
+ if (this.formMethod) {
65
+ formButtonEl.setAttribute('formmethod', this.formMethod);
66
+ }
67
+ else {
68
+ formButtonEl.removeAttribute('formmethod');
69
+ }
70
+ if (this.formButtonEl !== formButtonEl) {
71
+ this.formButtonEl = formButtonEl;
72
+ }
73
+ if (formButtonEl.parentElement !== formEl) {
74
+ formButtonEl.remove();
75
+ formEl.appendChild(formButtonEl);
76
+ }
46
77
  }
47
78
  submitForm(ev) {
48
79
  if (this.formEl && this.formButtonEl) {
@@ -57,7 +88,7 @@ export class LmvzButton extends ReactiveControllerHost {
57
88
  };
58
89
  render() {
59
90
  this.renderHiddenButton();
60
- return (h(Host, { key: 'ce82e749ffb9172a9421d303e0d7cc02de58dff9', "aria-disabled": this.disabled ? 'true' : null }, h("button", { key: 'acd0773f72e76139ec5495eb15fc3a5949029e40', ref: (e) => (this.validationEl = e), disabled: this.disabled, class: classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, h("slot", { key: 'f519e0f82e68811a8831214e83e609bd9501fed0' }))));
91
+ return (h(Host, { key: '6c44aa8a4b40927313461b5139e88066b855dca6', "aria-disabled": this.disabled ? 'true' : null }, h("button", { key: '3696f0ad46a03fe9573571b46a56772def87bf53', ref: (e) => (this.validationEl = e), disabled: this.disabled, type: this.type, class: classNames(this.variant, { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, h("slot", { key: '3ecce9c6ae978b72b14a807d93248a4566a13f4b' }))));
61
92
  }
62
93
  static get is() { return "lmvz-button"; }
63
94
  static get encapsulation() { return "shadow"; }
@@ -225,6 +256,63 @@ export class LmvzButton extends ReactiveControllerHost {
225
256
  "setter": false,
226
257
  "reflect": false,
227
258
  "attribute": "form"
259
+ },
260
+ "formMethod": {
261
+ "type": "string",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "'dialog' | 'get' | 'post'",
265
+ "resolved": "\"dialog\" | \"get\" | \"post\" | undefined",
266
+ "references": {}
267
+ },
268
+ "required": false,
269
+ "optional": true,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": "Native formmethod value forwarded to the hidden native submit button.\nUse `dialog` to support native dialog close/confirm flows from `lmvz-button`."
273
+ },
274
+ "getter": false,
275
+ "setter": false,
276
+ "reflect": false,
277
+ "attribute": "form-method"
278
+ },
279
+ "name": {
280
+ "type": "string",
281
+ "mutable": false,
282
+ "complexType": {
283
+ "original": "string",
284
+ "resolved": "string | undefined",
285
+ "references": {}
286
+ },
287
+ "required": false,
288
+ "optional": true,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": "Native button name forwarded to the hidden native submit button."
292
+ },
293
+ "getter": false,
294
+ "setter": false,
295
+ "reflect": false,
296
+ "attribute": "name"
297
+ },
298
+ "value": {
299
+ "type": "string",
300
+ "mutable": false,
301
+ "complexType": {
302
+ "original": "string",
303
+ "resolved": "string | undefined",
304
+ "references": {}
305
+ },
306
+ "required": false,
307
+ "optional": true,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Native button value forwarded to the hidden native submit button.\nFor `formmethod=\"dialog\"` flows this becomes the dialog `returnValue`."
311
+ },
312
+ "getter": false,
313
+ "setter": false,
314
+ "reflect": false,
315
+ "attribute": "value"
228
316
  }
229
317
  };
230
318
  }
@@ -40,7 +40,7 @@ export class LmvzChip extends ReactiveControllerHost {
40
40
  this.checkContent();
41
41
  }
42
42
  checkContent = debounce(() => {
43
- if (!isAriaValidationEnabled)
43
+ if (!isAriaValidationEnabled())
44
44
  return;
45
45
  const elements = [...(this.beforeSlot?.assignedElements() ?? []), ...(this.defaultSlot?.assignedElements() ?? []), ...(this.afterSlot?.assignedElements() ?? [])];
46
46
  if (!elements.length) {
@@ -48,7 +48,7 @@ export class LmvzChip extends ReactiveControllerHost {
48
48
  }
49
49
  }, 500);
50
50
  render() {
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() })));
51
+ return (h(Host, { key: '14ee006aff40f125aef2e9a461e68e25c6ed27d6', type: this.type, size: this.size }, h("slot", { key: '3222c7f40b833f344aa233c13e2644d6e928bf4c', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), h("span", { key: '4d1c9fa87ccda9387b945444e9ac6a50703a19e5', class: "content-overflow-wrapper" }, h("slot", { key: '42866115b8a6c50e86663ed8934504240ee0e6fa', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), h("slot", { key: '890afa73be440ee7e7620a024744be08fee57b83', 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"; }
@@ -0,0 +1,120 @@
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
+ @layer lmvz-ds.reset {
37
+ body {
38
+ margin: 0;
39
+ }
40
+
41
+ h1,
42
+ h2,
43
+ h3,
44
+ h4,
45
+ h5,
46
+ h6 {
47
+ margin: 0;
48
+ }
49
+
50
+ }
51
+ :host {
52
+ display: contents;
53
+ color: var(--lmvz-semantic-color-on-surface-primary, #000000);
54
+
55
+ --lmvz-modal-shell-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
56
+ --lmvz-modal-shell-gap: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
57
+ --lmvz-modal-actions-gap: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
58
+ --lmvz-modal-viewport-padding: var(--lmvz-dimension-16-24, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
59
+
60
+ /* TODO(LDHCID-135): Assumption until a modal container token/value is available. */
61
+ --lmvz-modal-shell-max-width: 40rem;
62
+ }
63
+ dialog {
64
+ border: none;
65
+ padding: 0;
66
+ background: transparent;
67
+ color: var(--lmvz-semantic-color-on-surface-primary, #000000);
68
+ }
69
+ dialog::backdrop {
70
+ /* TODO(LDHCID-135): Missing token for the modal backdrop color */
71
+ /* Fallback for browsers without CSS Color Level 4 relative-color syntax (Chrome < 119, FF < 128, Safari < 16.4) */
72
+ background: rgba(0, 0, 0, 0.19);
73
+ background: rgb(from var(--lmvz-semantic-color-int-primary, #000000) r g b / 0.19);
74
+ }
75
+ .modal-shell {
76
+ display: flex;
77
+ flex-direction: column;
78
+ gap: var(--lmvz-modal-shell-gap);
79
+ inline-size: min(calc(100vw - (2 * var(--lmvz-modal-viewport-padding))), var(--lmvz-modal-shell-max-width));
80
+ max-inline-size: 100%;
81
+ padding: var(--lmvz-modal-shell-padding);
82
+ border-radius: var(--lmvz-semantic-border-radius-lg, 14px);
83
+ background: var(--lmvz-semantic-color-surface-primary, #ffffff);
84
+ /* TODO(LDHCID-135): clarify overflow behaviour */
85
+ overflow: auto;
86
+ }
87
+ .header {
88
+ display: flex;
89
+ align-items: flex-start;
90
+ justify-content: flex-end;
91
+ gap: var(--lmvz-modal-shell-gap);
92
+ }
93
+ .title {
94
+ min-inline-size: 0;
95
+ font: var(--lmvz-typography-heading-lg, 500 clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem) / 1.4
96
+ Router);
97
+ }
98
+ .has-title .title {
99
+ flex: 1 1 auto;
100
+ }
101
+ .body {
102
+ font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
103
+ Router);
104
+ }
105
+ .actions {
106
+ display: flex;
107
+ flex-wrap: wrap;
108
+ justify-content: flex-end;
109
+ gap: var(--lmvz-modal-actions-gap);
110
+ font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4
111
+ Router);
112
+ /* TODO(LDHCID-135): Action wrapping threshold remains an assumption and currently follows intrinsic content width */
113
+ }
114
+ .close-button {
115
+ display: inline-flex;
116
+ flex: none;
117
+ }
118
+ ::slotted([slot='actions'][hidden]) {
119
+ display: none;
120
+ }