nve-designsystem 3.12.0 → 3.14.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 (179) hide show
  1. package/chunks/chunk.2PCBEMQZ.js +164 -226
  2. package/chunks/chunk.36O46B5H.js +15 -15
  3. package/chunks/chunk.3RPBFEDE.js +137 -161
  4. package/chunks/chunk.4TUIT776.js +78 -96
  5. package/chunks/chunk.5JY5FUCG.js +978 -1243
  6. package/chunks/chunk.5P45LHIX.js +76 -96
  7. package/chunks/chunk.6CTB5ZDJ.js +95 -100
  8. package/chunks/chunk.B4BZKR24.js +29 -39
  9. package/chunks/chunk.D5YQDJ7X.js +123 -166
  10. package/chunks/chunk.EA437WHD.js +5 -5
  11. package/chunks/chunk.GI7VDIWX.js +14 -15
  12. package/chunks/chunk.GMYPQTFK.js +18 -20
  13. package/chunks/chunk.HVTXQL7M.js +191 -215
  14. package/chunks/chunk.IKV4VH3T.js +18 -16
  15. package/chunks/chunk.IVVHNXMC.js +26 -27
  16. package/chunks/chunk.JCXLDPQF.js +141 -211
  17. package/chunks/chunk.JHOXTQXA.js +65 -74
  18. package/chunks/chunk.JXOKFADN.js +63 -90
  19. package/chunks/chunk.K7JGTRV7.js +24 -23
  20. package/chunks/chunk.KPLQLAWP.js +132 -147
  21. package/chunks/chunk.LD4M4QGE.js +61 -74
  22. package/chunks/chunk.MAQXLKQ7.js +5 -5
  23. package/chunks/chunk.MSKEYBDI.js +53 -71
  24. package/chunks/chunk.NYIIDP5N.js +39 -45
  25. package/chunks/chunk.RWUUFNUL.js +91 -114
  26. package/chunks/chunk.SAPQLUO4.js +249 -228
  27. package/chunks/chunk.SI4ACBFK.js +5 -5
  28. package/chunks/chunk.TP2GB2HO.js +361 -460
  29. package/chunks/chunk.UDWRA64J.js +185 -223
  30. package/chunks/chunk.URTPIBTY.js +119 -151
  31. package/chunks/chunk.VESXC477.js +63 -66
  32. package/chunks/chunk.XA43ZQPC.js +199 -313
  33. package/chunks/chunk.XQ2OKYYA.js +25 -26
  34. package/chunks/chunk.XZNBUGX7.js +6 -6
  35. package/chunks/chunk.YHLNUJ7P.js +93 -116
  36. package/chunks/chunk.ZH2AND3P.js +339 -399
  37. package/chunks/chunk.ZL53POKZ.js +61 -156
  38. package/chunks/chunk.js +20 -0
  39. package/chunks/class-map.js +49 -45
  40. package/chunks/decorate.js +105 -0
  41. package/chunks/directive-helpers.js +5 -7
  42. package/chunks/if-defined.js +5 -5
  43. package/chunks/lit.js +523 -0
  44. package/chunks/live.js +24 -24
  45. package/chunks/nve-alert.component.js +162 -0
  46. package/chunks/nve-button.component.js +26 -0
  47. package/chunks/nve-carousel-item.component.js +35 -0
  48. package/chunks/nve-carousel.component.js +38 -0
  49. package/chunks/nve-checkbox-group.component.js +113 -0
  50. package/chunks/nve-checkbox.component.js +24 -0
  51. package/chunks/nve-dialog.component.js +35 -0
  52. package/chunks/nve-divider.component.js +22 -0
  53. package/chunks/nve-drawer.component.js +36 -0
  54. package/chunks/nve-dropdown.component.js +80 -0
  55. package/chunks/nve-input.component.js +75 -0
  56. package/chunks/nve-label.component.js +87 -0
  57. package/chunks/nve-menu-item.component.js +30 -0
  58. package/chunks/nve-menu.component.js +16 -0
  59. package/chunks/nve-option.component.js +24 -0
  60. package/chunks/nve-popup.component.js +12 -0
  61. package/chunks/nve-radio-button.component.js +19 -0
  62. package/chunks/nve-radio-group.component.js +76 -0
  63. package/chunks/nve-radio.component.js +16 -0
  64. package/chunks/nve-select.component.js +52 -0
  65. package/chunks/nve-skeleton.component.js +19 -0
  66. package/chunks/nve-spinner.component.js +20 -0
  67. package/chunks/nve-tooltip.component.js +16 -0
  68. package/chunks/nve-warning-level.component.js +57 -0
  69. package/chunks/ref.js +75 -84
  70. package/chunks/shoelace.js +9859 -0
  71. package/chunks/static-html.js +24 -0
  72. package/chunks/unsafe-html.js +24 -20
  73. package/chunks/updateInvalidProperty.js +7 -7
  74. package/chunks/watch.js +20 -20
  75. package/components/nve-accordion/nve-accordion.component.js +24 -30
  76. package/components/nve-accordion-item/nve-accordion-item.component.js +51 -47
  77. package/components/nve-accordion-item/nve-accordion-item.styles.js +5 -5
  78. package/components/nve-alert/nve-alert.component.js +7 -227
  79. package/components/nve-alert/nve-alert.styles.js +5 -5
  80. package/components/nve-badge/nve-badge.component.js +41 -45
  81. package/components/nve-badge/nve-badge.styles.js +5 -5
  82. package/components/nve-button/nve-button.component.js +13 -38
  83. package/components/nve-button/nve-button.styles.js +5 -5
  84. package/components/nve-carousel/nve-carousel.component.js +9 -46
  85. package/components/nve-carousel/nve-carousel.styles.js +5 -5
  86. package/components/nve-carousel-item/nve-carousel-item.component.js +5 -39
  87. package/components/nve-carousel-item/nve-carousel-item.styles.js +5 -5
  88. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.js +44 -54
  89. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.js +5 -5
  90. package/components/nve-checkbox/nve-checkbox.component.js +12 -32
  91. package/components/nve-checkbox/nve-checkbox.styles.js +5 -5
  92. package/components/nve-checkbox-group/nve-checkbox-group.component.js +13 -152
  93. package/components/nve-checkbox-group/nve-checkbox-group.styles.js +5 -5
  94. package/components/nve-combobox/nve-combobox.component.js +237 -440
  95. package/components/nve-combobox/nve-combobox.styles.js +5 -5
  96. package/components/nve-darkmode-switch/nve-darkmode-switch.component.js +31 -38
  97. package/components/nve-dialog/nve-dialog-styles.js +5 -5
  98. package/components/nve-dialog/nve-dialog.component.js +12 -53
  99. package/components/nve-divider/nve-divider.component.js +5 -29
  100. package/components/nve-drawer/nve-drawer.component.js +12 -43
  101. package/components/nve-drawer/nve-drawer.styles.js +5 -5
  102. package/components/nve-dropdown/nve-dropdown.component.js +9 -68
  103. package/components/nve-dropdown/nve-dropdown.styles.js +5 -5
  104. package/components/nve-icon/nve-icon.component.js +145 -164
  105. package/components/nve-icon/nve-icon.styles.js +5 -5
  106. package/components/nve-icon/offline-icons.js +15 -13
  107. package/components/nve-input/nve-input.component.js +13 -98
  108. package/components/nve-input/nve-input.styles.js +5 -5
  109. package/components/nve-label/nve-label.component.js +12 -115
  110. package/components/nve-label/nve-label.styles.js +5 -5
  111. package/components/nve-link-card/nve-link-card.component.js +45 -80
  112. package/components/nve-link-card/nve-link-card.styles.js +5 -5
  113. package/components/nve-menu/nve-menu.component.js +5 -21
  114. package/components/nve-menu/nve-menu.styles.js +5 -5
  115. package/components/nve-menu-item/nve-menu-item.component.js +11 -41
  116. package/components/nve-menu-item/nve-menu-item.styles.js +5 -5
  117. package/components/nve-message-card/nve-message-card.component.js +63 -91
  118. package/components/nve-message-card/nve-message-card.styles.js +5 -5
  119. package/components/nve-navigation-card/nve-navigation-card.component.d.ts +52 -0
  120. package/components/nve-navigation-card/nve-navigation-card.component.js +62 -0
  121. package/components/nve-navigation-card/nve-navigation-card.styles.d.ts +2 -0
  122. package/components/nve-navigation-card/nve-navigation-card.styles.js +111 -0
  123. package/components/nve-option/nve-option.component.js +9 -40
  124. package/components/nve-option/nve-option.styles.js +5 -5
  125. package/components/nve-popup/nve-popup.component.js +8 -21
  126. package/components/nve-radio/nve-radio.component.js +8 -22
  127. package/components/nve-radio/nve-radio.styles.js +5 -5
  128. package/components/nve-radio-button/nve-radio-button.component.js +9 -24
  129. package/components/nve-radio-button/nve-radio-button.styles.js +5 -5
  130. package/components/nve-radio-group/nve-radio-group.component.js +8 -118
  131. package/components/nve-radio-group/nve-radio-group.styles.js +5 -5
  132. package/components/nve-relative-time/nve-relative-time.component.js +42 -39
  133. package/components/nve-relative-time/nve-relative-time.styles.js +5 -5
  134. package/components/nve-select/nve-select.component.js +14 -77
  135. package/components/nve-select/nve-select.styles.js +5 -5
  136. package/components/nve-skeleton/nve-skeleton.component.js +6 -26
  137. package/components/nve-skeleton/nve-skeleton.styles.js +5 -5
  138. package/components/nve-spinner/nve-spinner.component.js +6 -29
  139. package/components/nve-stepper/nve-step/nve-step.component.js +113 -173
  140. package/components/nve-stepper/nve-step/nve-step.styles.js +5 -5
  141. package/components/nve-stepper/nve-stepper-mobile.component.js +37 -49
  142. package/components/nve-stepper/nve-stepper-mobile.styles.js +5 -5
  143. package/components/nve-stepper/nve-stepper.component.js +91 -136
  144. package/components/nve-stepper/nve-stepper.styles.js +5 -5
  145. package/components/nve-switch/nve-switch.component.js +76 -107
  146. package/components/nve-switch/nve-switch.styles.js +5 -5
  147. package/components/nve-tab/nve-tab.component.js +30 -42
  148. package/components/nve-tab/nve-tab.styles.js +5 -5
  149. package/components/nve-tab-group/nve-tab-group.component.js +185 -257
  150. package/components/nve-tab-group/nve-tab-group.styles.js +5 -5
  151. package/components/nve-tab-panel/nve-tab-panel.component.js +21 -31
  152. package/components/nve-tab-panel/nve-tab-panel.styles.js +5 -5
  153. package/components/nve-tag/nve-tag.component.js +67 -70
  154. package/components/nve-tag/nve-tag.styles.js +5 -5
  155. package/components/nve-textarea/nve-textarea.component.js +114 -170
  156. package/components/nve-textarea/nve-textarea.styles.js +5 -5
  157. package/components/nve-tooltip/nve-tooltip.component.js +10 -29
  158. package/components/nve-tooltip/nve-tooltip.styles.js +5 -5
  159. package/components/nve-warning-level/nve-warning-level.component.js +6 -78
  160. package/components/nve-warning-level/nve-warning-level.styles.js +5 -5
  161. package/css/global.css +3 -2
  162. package/css/nve.css +8 -1
  163. package/css/rme.css +8 -1
  164. package/css/varsom.css +8 -1
  165. package/custom-elements.json +166 -0
  166. package/interfaces/NveComponent.interface.js +0 -1
  167. package/nve-designsystem.d.ts +1 -0
  168. package/nve-designsystem.js +84 -86
  169. package/package.json +1 -1
  170. package/registerIcons/systemLibraryCustomization.js +23 -91
  171. package/vite-env.d.js +0 -1
  172. package/vscode.css-custom-data.json +11 -0
  173. package/vscode.html-custom-data.json +46 -0
  174. package/chunks/chunk.JQBT7BOV.js +0 -8446
  175. package/chunks/lit-element.js +0 -508
  176. package/chunks/property.js +0 -37
  177. package/chunks/query.js +0 -13
  178. package/chunks/state.js +0 -7
  179. package/chunks/static.js +0 -26
@@ -1,14 +1,13 @@
1
- import { i as g, x as p } from "./lit-element.js";
2
- import { f as _ } from "./chunk.SI4ACBFK.js";
3
- import { c as b, d as l, S as v } from "./chunk.4TUIT776.js";
4
- import { n } from "./property.js";
5
- import { r as f } from "./state.js";
6
- import { e as m } from "./query.js";
7
- import { F as C, c as x, a as R, v as V } from "./chunk.3RPBFEDE.js";
8
- import { H as w } from "./chunk.NYIIDP5N.js";
9
- import { w as y } from "./chunk.GMYPQTFK.js";
10
- import { e as A } from "./class-map.js";
11
- var k = g`
1
+ import { s as e, u as t } from "./lit.js";
2
+ import { a as n, o as r, r as i } from "./decorate.js";
3
+ import { n as a, r as o, t as s } from "./chunk.4TUIT776.js";
4
+ import { i as c, n as l, r as u, t as d } from "./chunk.3RPBFEDE.js";
5
+ import { t as f } from "./chunk.SI4ACBFK.js";
6
+ import { t as p } from "./chunk.NYIIDP5N.js";
7
+ import { t as m } from "./chunk.GMYPQTFK.js";
8
+ import { t as h } from "./class-map.js";
9
+ //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B63YXDJO.js
10
+ var g = t`
12
11
  :host {
13
12
  display: block;
14
13
  }
@@ -40,7 +39,7 @@ var k = g`
40
39
  white-space: nowrap;
41
40
  border: 0;
42
41
  }
43
- `, S = g`
42
+ `, _ = t`
44
43
  :host {
45
44
  display: inline-block;
46
45
  }
@@ -49,38 +48,31 @@ var k = g`
49
48
  display: flex;
50
49
  flex-wrap: nowrap;
51
50
  }
52
- `, c = class extends v {
53
- constructor() {
54
- super(...arguments), this.disableRole = !1, this.label = "";
55
- }
56
- handleFocus(t) {
57
- const e = h(t.target);
58
- e?.toggleAttribute("data-sl-button-group__button--focus", !0);
59
- }
60
- handleBlur(t) {
61
- const e = h(t.target);
62
- e?.toggleAttribute("data-sl-button-group__button--focus", !1);
63
- }
64
- handleMouseOver(t) {
65
- const e = h(t.target);
66
- e?.toggleAttribute("data-sl-button-group__button--hover", !0);
67
- }
68
- handleMouseOut(t) {
69
- const e = h(t.target);
70
- e?.toggleAttribute("data-sl-button-group__button--hover", !1);
71
- }
72
- handleSlotChange() {
73
- const t = [...this.defaultSlot.assignedElements({ flatten: !0 })];
74
- t.forEach((e) => {
75
- const o = t.indexOf(e), s = h(e);
76
- s && (s.toggleAttribute("data-sl-button-group__button", !0), s.toggleAttribute("data-sl-button-group__button--first", o === 0), s.toggleAttribute("data-sl-button-group__button--inner", o > 0 && o < t.length - 1), s.toggleAttribute("data-sl-button-group__button--last", o === t.length - 1), s.toggleAttribute(
77
- "data-sl-button-group__button--radio",
78
- s.tagName.toLowerCase() === "sl-radio-button"
79
- ));
80
- });
81
- }
82
- render() {
83
- return p`
51
+ `, v = class extends s {
52
+ constructor() {
53
+ super(...arguments), this.disableRole = !1, this.label = "";
54
+ }
55
+ handleFocus(e) {
56
+ y(e.target)?.toggleAttribute("data-sl-button-group__button--focus", !0);
57
+ }
58
+ handleBlur(e) {
59
+ y(e.target)?.toggleAttribute("data-sl-button-group__button--focus", !1);
60
+ }
61
+ handleMouseOver(e) {
62
+ y(e.target)?.toggleAttribute("data-sl-button-group__button--hover", !0);
63
+ }
64
+ handleMouseOut(e) {
65
+ y(e.target)?.toggleAttribute("data-sl-button-group__button--hover", !1);
66
+ }
67
+ handleSlotChange() {
68
+ let e = [...this.defaultSlot.assignedElements({ flatten: !0 })];
69
+ e.forEach((t) => {
70
+ let n = e.indexOf(t), r = y(t);
71
+ r && (r.toggleAttribute("data-sl-button-group__button", !0), r.toggleAttribute("data-sl-button-group__button--first", n === 0), r.toggleAttribute("data-sl-button-group__button--inner", n > 0 && n < e.length - 1), r.toggleAttribute("data-sl-button-group__button--last", n === e.length - 1), r.toggleAttribute("data-sl-button-group__button--radio", r.tagName.toLowerCase() === "sl-radio-button"));
72
+ });
73
+ }
74
+ render() {
75
+ return e`
84
76
  <div
85
77
  part="base"
86
78
  class="button-group"
@@ -94,140 +86,122 @@ var k = g`
94
86
  <slot @slotchange=${this.handleSlotChange}></slot>
95
87
  </div>
96
88
  `;
97
- }
89
+ }
98
90
  };
99
- c.styles = [b, S];
100
- l([
101
- m("slot")
102
- ], c.prototype, "defaultSlot", 2);
103
- l([
104
- f()
105
- ], c.prototype, "disableRole", 2);
106
- l([
107
- n()
108
- ], c.prototype, "label", 2);
109
- function h(t) {
110
- var e;
111
- const o = "sl-button, sl-radio-button";
112
- return (e = t.closest(o)) != null ? e : t.querySelector(o);
91
+ v.styles = [a, _], o([i("slot")], v.prototype, "defaultSlot", 2), o([n()], v.prototype, "disableRole", 2), o([r()], v.prototype, "label", 2);
92
+ function y(e) {
93
+ let t = "sl-button, sl-radio-button";
94
+ return e.closest(t) ?? e.querySelector(t);
113
95
  }
114
- var i = class extends v {
115
- constructor() {
116
- super(...arguments), this.formControlController = new C(this), this.hasSlotController = new w(this, "help-text", "label"), this.customValidityMessage = "", this.hasButtonGroup = !1, this.errorMessage = "", this.defaultValue = "", this.label = "", this.helpText = "", this.name = "option", this.value = "", this.size = "medium", this.form = "", this.required = !1;
117
- }
118
- /** Gets the validity state object */
119
- get validity() {
120
- const t = this.required && !this.value;
121
- return this.customValidityMessage !== "" ? x : t ? R : V;
122
- }
123
- /** Gets the validation message */
124
- get validationMessage() {
125
- const t = this.required && !this.value;
126
- return this.customValidityMessage !== "" ? this.customValidityMessage : t ? this.validationInput.validationMessage : "";
127
- }
128
- connectedCallback() {
129
- super.connectedCallback(), this.defaultValue = this.value;
130
- }
131
- firstUpdated() {
132
- this.formControlController.updateValidity();
133
- }
134
- getAllRadios() {
135
- return [...this.querySelectorAll("sl-radio, sl-radio-button")];
136
- }
137
- handleRadioClick(t) {
138
- const e = t.target.closest("sl-radio, sl-radio-button"), o = this.getAllRadios(), s = this.value;
139
- !e || e.disabled || (this.value = e.value, o.forEach((a) => a.checked = a === e), this.value !== s && (this.emit("sl-change"), this.emit("sl-input")));
140
- }
141
- handleKeyDown(t) {
142
- var e;
143
- if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", " "].includes(t.key))
144
- return;
145
- const o = this.getAllRadios().filter((u) => !u.disabled), s = (e = o.find((u) => u.checked)) != null ? e : o[0], a = t.key === " " ? 0 : ["ArrowUp", "ArrowLeft"].includes(t.key) ? -1 : 1, d = this.value;
146
- let r = o.indexOf(s) + a;
147
- r < 0 && (r = o.length - 1), r > o.length - 1 && (r = 0), this.getAllRadios().forEach((u) => {
148
- u.checked = !1, this.hasButtonGroup || u.setAttribute("tabindex", "-1");
149
- }), this.value = o[r].value, o[r].checked = !0, this.hasButtonGroup ? o[r].shadowRoot.querySelector("button").focus() : (o[r].setAttribute("tabindex", "0"), o[r].focus()), this.value !== d && (this.emit("sl-change"), this.emit("sl-input")), t.preventDefault();
150
- }
151
- handleLabelClick() {
152
- this.focus();
153
- }
154
- handleInvalid(t) {
155
- this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(t);
156
- }
157
- async syncRadioElements() {
158
- var t, e;
159
- const o = this.getAllRadios();
160
- if (await Promise.all(
161
- // Sync the checked state and size
162
- o.map(async (s) => {
163
- await s.updateComplete, s.checked = s.value === this.value, s.size = this.size;
164
- })
165
- ), this.hasButtonGroup = o.some((s) => s.tagName.toLowerCase() === "sl-radio-button"), o.length > 0 && !o.some((s) => s.checked))
166
- if (this.hasButtonGroup) {
167
- const s = (t = o[0].shadowRoot) == null ? void 0 : t.querySelector("button");
168
- s && s.setAttribute("tabindex", "0");
169
- } else
170
- o[0].setAttribute("tabindex", "0");
171
- if (this.hasButtonGroup) {
172
- const s = (e = this.shadowRoot) == null ? void 0 : e.querySelector("sl-button-group");
173
- s && (s.disableRole = !0);
174
- }
175
- }
176
- syncRadios() {
177
- if (customElements.get("sl-radio") && customElements.get("sl-radio-button")) {
178
- this.syncRadioElements();
179
- return;
180
- }
181
- customElements.get("sl-radio") ? this.syncRadioElements() : customElements.whenDefined("sl-radio").then(() => this.syncRadios()), customElements.get("sl-radio-button") ? this.syncRadioElements() : customElements.whenDefined("sl-radio-button").then(() => this.syncRadios());
182
- }
183
- updateCheckedRadio() {
184
- this.getAllRadios().forEach((e) => e.checked = e.value === this.value), this.formControlController.setValidity(this.validity.valid);
185
- }
186
- handleSizeChange() {
187
- this.syncRadios();
188
- }
189
- handleValueChange() {
190
- this.hasUpdated && this.updateCheckedRadio();
191
- }
192
- /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
193
- checkValidity() {
194
- const t = this.required && !this.value, e = this.customValidityMessage !== "";
195
- return t || e ? (this.formControlController.emitInvalidEvent(), !1) : !0;
196
- }
197
- /** Gets the associated form, if one exists. */
198
- getForm() {
199
- return this.formControlController.getForm();
200
- }
201
- /** Checks for validity and shows the browser's validation message if the control is invalid. */
202
- reportValidity() {
203
- const t = this.validity.valid;
204
- return this.errorMessage = this.customValidityMessage || t ? "" : this.validationInput.validationMessage, this.formControlController.setValidity(t), this.validationInput.hidden = !0, clearTimeout(this.validationTimeout), t || (this.validationInput.hidden = !1, this.validationInput.reportValidity(), this.validationTimeout = setTimeout(() => this.validationInput.hidden = !0, 1e4)), t;
205
- }
206
- /** Sets a custom validation message. Pass an empty string to restore validity. */
207
- setCustomValidity(t = "") {
208
- this.customValidityMessage = t, this.errorMessage = t, this.validationInput.setCustomValidity(t), this.formControlController.updateValidity();
209
- }
210
- /** Sets focus on the radio-group. */
211
- focus(t) {
212
- const e = this.getAllRadios(), o = e.find((d) => d.checked), s = e.find((d) => !d.disabled), a = o || s;
213
- a && a.focus(t);
214
- }
215
- render() {
216
- const t = this.hasSlotController.test("label"), e = this.hasSlotController.test("help-text"), o = this.label ? !0 : !!t, s = this.helpText ? !0 : !!e, a = p`
96
+ //#endregion
97
+ //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZJNIZFRS.js
98
+ var b = class extends s {
99
+ constructor() {
100
+ super(...arguments), this.formControlController = new d(this), this.hasSlotController = new p(this, "help-text", "label"), this.customValidityMessage = "", this.hasButtonGroup = !1, this.errorMessage = "", this.defaultValue = "", this.label = "", this.helpText = "", this.name = "option", this.value = "", this.size = "medium", this.form = "", this.required = !1;
101
+ }
102
+ get validity() {
103
+ let e = this.required && !this.value;
104
+ return this.customValidityMessage === "" ? e ? c : u : l;
105
+ }
106
+ get validationMessage() {
107
+ let e = this.required && !this.value;
108
+ return this.customValidityMessage === "" ? e ? this.validationInput.validationMessage : "" : this.customValidityMessage;
109
+ }
110
+ connectedCallback() {
111
+ super.connectedCallback(), this.defaultValue = this.value;
112
+ }
113
+ firstUpdated() {
114
+ this.formControlController.updateValidity();
115
+ }
116
+ getAllRadios() {
117
+ return [...this.querySelectorAll("sl-radio, sl-radio-button")];
118
+ }
119
+ handleRadioClick(e) {
120
+ let t = e.target.closest("sl-radio, sl-radio-button"), n = this.getAllRadios(), r = this.value;
121
+ !t || t.disabled || (this.value = t.value, n.forEach((e) => e.checked = e === t), this.value !== r && (this.emit("sl-change"), this.emit("sl-input")));
122
+ }
123
+ handleKeyDown(e) {
124
+ if (![
125
+ "ArrowUp",
126
+ "ArrowDown",
127
+ "ArrowLeft",
128
+ "ArrowRight",
129
+ " "
130
+ ].includes(e.key)) return;
131
+ let t = this.getAllRadios().filter((e) => !e.disabled), n = t.find((e) => e.checked) ?? t[0], r = e.key === " " ? 0 : ["ArrowUp", "ArrowLeft"].includes(e.key) ? -1 : 1, i = this.value, a = t.indexOf(n) + r;
132
+ a < 0 && (a = t.length - 1), a > t.length - 1 && (a = 0), this.getAllRadios().forEach((e) => {
133
+ e.checked = !1, this.hasButtonGroup || e.setAttribute("tabindex", "-1");
134
+ }), this.value = t[a].value, t[a].checked = !0, this.hasButtonGroup ? t[a].shadowRoot.querySelector("button").focus() : (t[a].setAttribute("tabindex", "0"), t[a].focus()), this.value !== i && (this.emit("sl-change"), this.emit("sl-input")), e.preventDefault();
135
+ }
136
+ handleLabelClick() {
137
+ this.focus();
138
+ }
139
+ handleInvalid(e) {
140
+ this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(e);
141
+ }
142
+ async syncRadioElements() {
143
+ let e = this.getAllRadios();
144
+ if (await Promise.all(e.map(async (e) => {
145
+ await e.updateComplete, e.checked = e.value === this.value, e.size = this.size;
146
+ })), this.hasButtonGroup = e.some((e) => e.tagName.toLowerCase() === "sl-radio-button"), e.length > 0 && !e.some((e) => e.checked)) if (this.hasButtonGroup) {
147
+ let t = e[0].shadowRoot?.querySelector("button");
148
+ t && t.setAttribute("tabindex", "0");
149
+ } else e[0].setAttribute("tabindex", "0");
150
+ if (this.hasButtonGroup) {
151
+ let e = this.shadowRoot?.querySelector("sl-button-group");
152
+ e && (e.disableRole = !0);
153
+ }
154
+ }
155
+ syncRadios() {
156
+ if (customElements.get("sl-radio") && customElements.get("sl-radio-button")) {
157
+ this.syncRadioElements();
158
+ return;
159
+ }
160
+ customElements.get("sl-radio") ? this.syncRadioElements() : customElements.whenDefined("sl-radio").then(() => this.syncRadios()), customElements.get("sl-radio-button") ? this.syncRadioElements() : customElements.whenDefined("sl-radio-button").then(() => this.syncRadios());
161
+ }
162
+ updateCheckedRadio() {
163
+ this.getAllRadios().forEach((e) => e.checked = e.value === this.value), this.formControlController.setValidity(this.validity.valid);
164
+ }
165
+ handleSizeChange() {
166
+ this.syncRadios();
167
+ }
168
+ handleValueChange() {
169
+ this.hasUpdated && this.updateCheckedRadio();
170
+ }
171
+ checkValidity() {
172
+ let e = this.required && !this.value, t = this.customValidityMessage !== "";
173
+ return e || t ? (this.formControlController.emitInvalidEvent(), !1) : !0;
174
+ }
175
+ getForm() {
176
+ return this.formControlController.getForm();
177
+ }
178
+ reportValidity() {
179
+ let e = this.validity.valid;
180
+ return this.errorMessage = this.customValidityMessage || e ? "" : this.validationInput.validationMessage, this.formControlController.setValidity(e), this.validationInput.hidden = !0, clearTimeout(this.validationTimeout), e || (this.validationInput.hidden = !1, this.validationInput.reportValidity(), this.validationTimeout = setTimeout(() => this.validationInput.hidden = !0, 1e4)), e;
181
+ }
182
+ setCustomValidity(e = "") {
183
+ this.customValidityMessage = e, this.errorMessage = e, this.validationInput.setCustomValidity(e), this.formControlController.updateValidity();
184
+ }
185
+ focus(e) {
186
+ let t = this.getAllRadios(), n = t.find((e) => e.checked), r = t.find((e) => !e.disabled), i = n || r;
187
+ i && i.focus(e);
188
+ }
189
+ render() {
190
+ let t = this.hasSlotController.test("label"), n = this.hasSlotController.test("help-text"), r = this.label ? !0 : !!t, i = this.helpText ? !0 : !!n, a = e`
217
191
  <slot @slotchange=${this.syncRadios} @click=${this.handleRadioClick} @keydown=${this.handleKeyDown}></slot>
218
192
  `;
219
- return p`
193
+ return e`
220
194
  <fieldset
221
195
  part="form-control"
222
- class=${A({
223
- "form-control": !0,
224
- "form-control--small": this.size === "small",
225
- "form-control--medium": this.size === "medium",
226
- "form-control--large": this.size === "large",
227
- "form-control--radio-group": !0,
228
- "form-control--has-label": o,
229
- "form-control--has-help-text": s
230
- })}
196
+ class=${h({
197
+ "form-control": !0,
198
+ "form-control--small": this.size === "small",
199
+ "form-control--medium": this.size === "medium",
200
+ "form-control--large": this.size === "large",
201
+ "form-control--radio-group": !0,
202
+ "form-control--has-label": r,
203
+ "form-control--has-help-text": i
204
+ })}
231
205
  role="radiogroup"
232
206
  aria-labelledby="label"
233
207
  aria-describedby="help-text"
@@ -237,7 +211,7 @@ var i = class extends v {
237
211
  part="form-control-label"
238
212
  id="label"
239
213
  class="form-control__label"
240
- aria-hidden=${o ? "false" : "true"}
214
+ aria-hidden=${r ? "false" : "true"}
241
215
  @click=${this.handleLabelClick}
242
216
  >
243
217
  <slot name="label">${this.label}</slot>
@@ -258,7 +232,7 @@ var i = class extends v {
258
232
  </label>
259
233
  </div>
260
234
 
261
- ${this.hasButtonGroup ? p`
235
+ ${this.hasButtonGroup ? e`
262
236
  <sl-button-group part="button-group" exportparts="base:button-group__base" role="presentation">
263
237
  ${a}
264
238
  </sl-button-group>
@@ -269,61 +243,25 @@ var i = class extends v {
269
243
  part="form-control-help-text"
270
244
  id="help-text"
271
245
  class="form-control__help-text"
272
- aria-hidden=${s ? "false" : "true"}
246
+ aria-hidden=${i ? "false" : "true"}
273
247
  >
274
248
  <slot name="help-text">${this.helpText}</slot>
275
249
  </div>
276
250
  </fieldset>
277
251
  `;
278
- }
279
- };
280
- i.styles = [b, _, k];
281
- i.dependencies = { "sl-button-group": c };
282
- l([
283
- m("slot:not([name])")
284
- ], i.prototype, "defaultSlot", 2);
285
- l([
286
- m(".radio-group__validation-input")
287
- ], i.prototype, "validationInput", 2);
288
- l([
289
- f()
290
- ], i.prototype, "hasButtonGroup", 2);
291
- l([
292
- f()
293
- ], i.prototype, "errorMessage", 2);
294
- l([
295
- f()
296
- ], i.prototype, "defaultValue", 2);
297
- l([
298
- n()
299
- ], i.prototype, "label", 2);
300
- l([
301
- n({ attribute: "help-text" })
302
- ], i.prototype, "helpText", 2);
303
- l([
304
- n()
305
- ], i.prototype, "name", 2);
306
- l([
307
- n({ reflect: !0 })
308
- ], i.prototype, "value", 2);
309
- l([
310
- n({ reflect: !0 })
311
- ], i.prototype, "size", 2);
312
- l([
313
- n({ reflect: !0 })
314
- ], i.prototype, "form", 2);
315
- l([
316
- n({ type: Boolean, reflect: !0 })
317
- ], i.prototype, "required", 2);
318
- l([
319
- y("size", { waitUntilFirstUpdate: !0 })
320
- ], i.prototype, "handleSizeChange", 1);
321
- l([
322
- y("value")
323
- ], i.prototype, "handleValueChange", 1);
324
- var L = i;
325
- i.define("sl-radio-group");
326
- export {
327
- c as S,
328
- L as r
252
+ }
329
253
  };
254
+ b.styles = [
255
+ a,
256
+ f,
257
+ g
258
+ ], b.dependencies = { "sl-button-group": v }, o([i("slot:not([name])")], b.prototype, "defaultSlot", 2), o([i(".radio-group__validation-input")], b.prototype, "validationInput", 2), o([n()], b.prototype, "hasButtonGroup", 2), o([n()], b.prototype, "errorMessage", 2), o([n()], b.prototype, "defaultValue", 2), o([r()], b.prototype, "label", 2), o([r({ attribute: "help-text" })], b.prototype, "helpText", 2), o([r()], b.prototype, "name", 2), o([r({ reflect: !0 })], b.prototype, "value", 2), o([r({ reflect: !0 })], b.prototype, "size", 2), o([r({ reflect: !0 })], b.prototype, "form", 2), o([r({
259
+ type: Boolean,
260
+ reflect: !0
261
+ })], b.prototype, "required", 2), o([m("size", { waitUntilFirstUpdate: !0 })], b.prototype, "handleSizeChange", 1), o([m("value")], b.prototype, "handleValueChange", 1);
262
+ //#endregion
263
+ //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2PCBEMQZ.js
264
+ var x = b;
265
+ b.define("sl-radio-group");
266
+ //#endregion
267
+ export { v as n, x as t };
@@ -1,7 +1,8 @@
1
- import { i as r, x as e } from "./lit-element.js";
2
- import { L as a } from "./chunk.6CTB5ZDJ.js";
3
- import { c as t, S as s } from "./chunk.4TUIT776.js";
4
- var i = r`
1
+ import { s as e, u as t } from "./lit.js";
2
+ import { n, t as r } from "./chunk.4TUIT776.js";
3
+ import { t as i } from "./chunk.6CTB5ZDJ.js";
4
+ //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7DUCI5S4.js
5
+ var a = t`
5
6
  :host {
6
7
  --track-width: 2px;
7
8
  --track-color: rgb(128 128 128 / 25%);
@@ -58,20 +59,19 @@ var i = r`
58
59
  stroke-dasharray: 0.05em, 3em;
59
60
  }
60
61
  }
61
- `, o = class extends s {
62
- constructor() {
63
- super(...arguments), this.localize = new a(this);
64
- }
65
- render() {
66
- return e`
62
+ `, o = class extends r {
63
+ constructor() {
64
+ super(...arguments), this.localize = new i(this);
65
+ }
66
+ render() {
67
+ return e`
67
68
  <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
68
69
  <circle class="spinner__track"></circle>
69
70
  <circle class="spinner__indicator"></circle>
70
71
  </svg>
71
72
  `;
72
- }
73
- };
74
- o.styles = [t, i];
75
- export {
76
- o as S
73
+ }
77
74
  };
75
+ o.styles = [n, a];
76
+ //#endregion
77
+ export { o as t };