@sbb-esta/lyne-elements 2.2.0 → 2.3.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 (184) hide show
  1. package/accordion.js +6 -6
  2. package/alert/alert-group.js +4 -4
  3. package/alert/alert.js +9 -9
  4. package/autocomplete-grid/autocomplete-grid-button.js +4 -4
  5. package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -4
  6. package/autocomplete-grid/autocomplete-grid-row.js +4 -4
  7. package/autocomplete.js +1 -1
  8. package/badge.css +31 -0
  9. package/breadcrumb/breadcrumb-group.js +4 -4
  10. package/breadcrumb/breadcrumb.js +19 -19
  11. package/button/accent-button-link.js +9 -9
  12. package/button/accent-button-static.js +6 -6
  13. package/button/accent-button.js +6 -6
  14. package/button/button-link.js +7 -7
  15. package/button/button-static.js +7 -7
  16. package/button/button.js +8 -8
  17. package/button/common.js +1 -1
  18. package/button/mini-button-group.js +8 -8
  19. package/button/secondary-button-link.js +7 -7
  20. package/button/secondary-button-static.js +7 -7
  21. package/button/secondary-button.js +3 -3
  22. package/button/transparent-button-link.js +6 -6
  23. package/button/transparent-button-static.js +5 -5
  24. package/button/transparent-button.js +6 -6
  25. package/calendar.js +1 -1
  26. package/card/card-badge.js +9 -9
  27. package/card/card-button.js +5 -5
  28. package/card/card-link.js +7 -7
  29. package/card/card.js +1 -1
  30. package/checkbox/checkbox-panel.js +16 -16
  31. package/checkbox/checkbox.js +15 -15
  32. package/checkbox/common.js +3 -3
  33. package/clock.js +8 -8
  34. package/container/container.js +4 -4
  35. package/core/base-elements.js +10 -10
  36. package/core/controllers.js +4 -4
  37. package/core/datetime.js +6 -6
  38. package/core/eventing.js +4 -4
  39. package/core/i18n/i18n.d.ts +2 -0
  40. package/core/i18n/i18n.d.ts.map +1 -1
  41. package/core/i18n.js +43 -31
  42. package/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
  43. package/core/mixins/form-associated-mixin.d.ts +3 -0
  44. package/core/mixins/form-associated-mixin.d.ts.map +1 -1
  45. package/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
  46. package/core/mixins.js +342 -248
  47. package/core/styles/badge.scss +3 -0
  48. package/core/styles/mixins/badge.scss +26 -1
  49. package/core/styles/mixins/font-face.scss +12 -12
  50. package/core/styles/mixins/link.scss +32 -8
  51. package/core/styles/standard-theme.scss +1 -0
  52. package/core/testing.js +14 -14
  53. package/core.css +3 -3
  54. package/custom-elements.json +7323 -169
  55. package/datepicker/datepicker-toggle.js +14 -14
  56. package/development/alert/alert-group.js +1 -1
  57. package/development/alert/alert.js +1 -1
  58. package/development/autocomplete.js +1 -1
  59. package/development/breadcrumb/breadcrumb.js +5 -2
  60. package/development/button/common.js +18 -14
  61. package/development/calendar.js +1 -1
  62. package/development/card/card.js +1 -1
  63. package/development/checkbox/checkbox-panel.js +1 -1
  64. package/development/core/i18n/i18n.d.ts +2 -0
  65. package/development/core/i18n/i18n.d.ts.map +1 -1
  66. package/development/core/i18n.js +15 -1
  67. package/development/core/mixins/form-associated-checkbox-mixin.d.ts.map +1 -1
  68. package/development/core/mixins/form-associated-mixin.d.ts +3 -0
  69. package/development/core/mixins/form-associated-mixin.d.ts.map +1 -1
  70. package/development/core/mixins/form-associated-radio-button-mixin.d.ts.map +1 -1
  71. package/development/core/mixins.js +159 -22
  72. package/development/datepicker/datepicker-toggle.js +1 -1
  73. package/development/dialog/dialog-title.js +1 -1
  74. package/development/expansion-panel/expansion-panel-header.js +1 -1
  75. package/development/expansion-panel/expansion-panel.js +1 -1
  76. package/development/file-selector/common.js +1 -1
  77. package/development/footer.js +1 -1
  78. package/development/form-field/form-field/form-field.d.ts.map +1 -1
  79. package/development/form-field/form-field.js +5 -2
  80. package/development/image.js +1 -1
  81. package/development/journey-header.js +1 -1
  82. package/development/link/common.js +19 -7
  83. package/development/link-list/common.js +1 -1
  84. package/development/map-container.js +1 -1
  85. package/development/menu/common/menu-action-common.d.ts +3 -0
  86. package/development/menu/common/menu-action-common.d.ts.map +1 -1
  87. package/development/menu/common.js +35 -12
  88. package/development/navigation/navigation-section.js +1 -1
  89. package/development/notification.js +1 -1
  90. package/development/overlay.js +1 -1
  91. package/development/radio-button/radio-button-panel.js +1 -1
  92. package/development/select/select.d.ts +4 -1
  93. package/development/select/select.d.ts.map +1 -1
  94. package/development/select.js +22 -4
  95. package/development/skiplink-list.js +1 -1
  96. package/development/slider.js +1 -1
  97. package/development/tabs/tab-label.js +1 -1
  98. package/development/timetable-occupancy.js +1 -1
  99. package/development/toast.js +1 -1
  100. package/development/toggle/toggle/toggle.d.ts +25 -6
  101. package/development/toggle/toggle/toggle.d.ts.map +1 -1
  102. package/development/toggle/toggle-option/toggle-option.d.ts +2 -6
  103. package/development/toggle/toggle-option/toggle-option.d.ts.map +1 -1
  104. package/development/toggle/toggle-option.js +21 -39
  105. package/development/toggle/toggle.js +57 -39
  106. package/development/train/train-formation.js +1 -1
  107. package/development/train/train.js +1 -1
  108. package/development/visual-checkbox.js +1 -1
  109. package/dialog/dialog-content.js +3 -3
  110. package/dialog/dialog-title.js +8 -8
  111. package/divider.js +12 -12
  112. package/expansion-panel/expansion-panel-header.js +1 -1
  113. package/expansion-panel/expansion-panel.js +1 -1
  114. package/file-selector/common.js +9 -9
  115. package/file-selector/file-selector-dropzone.js +5 -5
  116. package/file-selector/file-selector.js +6 -6
  117. package/flip-card/flip-card-details.js +4 -4
  118. package/flip-card/flip-card-summary.js +9 -9
  119. package/font-characters-extension.css +3 -3
  120. package/footer.js +4 -4
  121. package/form-field/form-field/form-field.d.ts.map +1 -1
  122. package/form-field/form-field.js +7 -5
  123. package/header/header-button.js +5 -5
  124. package/header/header-link.js +5 -5
  125. package/icon.js +36 -36
  126. package/image.js +1 -1
  127. package/journey-header.js +5 -5
  128. package/link/block-link-button.js +4 -4
  129. package/link/block-link-static.js +9 -9
  130. package/link/block-link.js +4 -4
  131. package/link/common.js +28 -28
  132. package/link/link-button.js +7 -7
  133. package/link/link-static.js +7 -7
  134. package/link/link.js +4 -4
  135. package/link-list/common.js +15 -15
  136. package/loading-indicator-circle.js +11 -11
  137. package/map-container.js +5 -5
  138. package/menu/common/menu-action-common.d.ts +3 -0
  139. package/menu/common/menu-action-common.d.ts.map +1 -1
  140. package/menu/common.js +34 -30
  141. package/menu/menu-button.js +8 -8
  142. package/menu/menu-link.js +6 -6
  143. package/menu/menu.js +7 -7
  144. package/navigation/navigation-button.js +4 -4
  145. package/navigation/navigation-link.js +7 -7
  146. package/navigation/navigation-list.js +4 -4
  147. package/navigation/navigation-marker.js +3 -3
  148. package/navigation/navigation-section.js +1 -1
  149. package/notification.js +18 -18
  150. package/option/optgroup.js +11 -11
  151. package/overlay.js +14 -14
  152. package/package.json +6 -2
  153. package/paginator/common.js +6 -6
  154. package/popover/popover.js +13 -13
  155. package/radio-button/radio-button-panel.js +6 -6
  156. package/screen-reader-only.js +5 -5
  157. package/select/select.d.ts +4 -1
  158. package/select/select.d.ts.map +1 -1
  159. package/select.js +35 -28
  160. package/skiplink-list.js +3 -3
  161. package/slider.js +13 -13
  162. package/standard-theme.css +35 -3
  163. package/status.js +3 -3
  164. package/stepper/step-label.js +4 -4
  165. package/table/table-wrapper.js +4 -4
  166. package/tabs/tab-group.js +24 -24
  167. package/tabs/tab-label.js +1 -1
  168. package/tabs/tab.js +4 -4
  169. package/tag/tag-group.js +7 -7
  170. package/teaser-product/common.js +5 -5
  171. package/teaser-product/teaser-product-static.js +2 -2
  172. package/timetable-occupancy-icon.js +3 -3
  173. package/timetable-occupancy.js +6 -6
  174. package/toast.js +5 -5
  175. package/toggle/toggle/toggle.d.ts +25 -6
  176. package/toggle/toggle/toggle.d.ts.map +1 -1
  177. package/toggle/toggle-option/toggle-option.d.ts +2 -6
  178. package/toggle/toggle-option/toggle-option.d.ts.map +1 -1
  179. package/toggle/toggle-option.js +44 -52
  180. package/toggle/toggle.js +103 -83
  181. package/toggle-check.js +5 -5
  182. package/train/train-formation.js +1 -1
  183. package/train/train.js +29 -29
  184. package/visual-checkbox.js +1 -1
package/core/mixins.js CHANGED
@@ -1,31 +1,33 @@
1
- var D = (l) => {
2
- throw TypeError(l);
1
+ var V = (c) => {
2
+ throw TypeError(c);
3
3
  };
4
- var M = (l, p, o) => p.has(l) || D("Cannot " + o);
5
- var k = (l, p, o) => (M(l, p, "read from private field"), o ? o.call(l) : p.get(l)), x = (l, p, o) => p.has(l) ? D("Cannot add the same private member more than once") : p instanceof WeakSet ? p.add(l) : p.set(l, o), v = (l, p, o, r) => (M(l, p, "write to private field"), r ? r.call(l, o) : p.set(l, o), o);
6
- import { __esDecorate as y, __runInitializers as f } from "tslib";
7
- import { property as S, state as F } from "lit/decorators.js";
8
- import { forceType as w, getOverride as N, hostAttributes as j } from "./decorators.js";
9
- import { defaultConverter as A, isServer as G, html as R, nothing as E, css as V } from "lit";
10
- import { preventScrollOnSpacebarPress as $, EventEmitter as P } from "./eventing.js";
11
- import { interactivityChecker as T, isArrowKeyPressed as H, getNextElementIndex as K } from "./a11y.js";
12
- import { SbbConnectedAbortController as W } from "./controllers.js";
4
+ var q = (c, m, u) => m.has(c) || V("Cannot " + u);
5
+ var x = (c, m, u) => (q(c, m, "read from private field"), u ? u.call(c) : m.get(c)), C = (c, m, u) => m.has(c) ? V("Cannot add the same private member more than once") : m instanceof WeakSet ? m.add(c) : m.set(c, u), y = (c, m, u, o) => (q(c, m, "write to private field"), o ? o.call(c, u) : m.set(c, u), u);
6
+ import { __esDecorate as g, __runInitializers as f } from "tslib";
7
+ import { property as S, state as A } from "lit/decorators.js";
8
+ import { forceType as R, getOverride as N, hostAttributes as P } from "./decorators.js";
9
+ import { defaultConverter as D, isServer as G, nothing as B, html as I, css as $ } from "lit";
10
+ import { SbbLanguageController as z, SbbConnectedAbortController as T } from "./controllers.js";
11
+ import { preventScrollOnSpacebarPress as H, EventEmitter as K } from "./eventing.js";
12
+ import { i18nCheckboxRequired as W, i18nSelectionRequired as X } from "./i18n.js";
13
+ import { isWebkit as J } from "./dom.js";
14
+ import { interactivityChecker as Q, isArrowKeyPressed as Y, getNextElementIndex as Z } from "./a11y.js";
13
15
  import "../screen-reader-only.js";
14
- const I = (l) => (() => {
15
- var u, e;
16
- let o = l, r, h = [], a = [];
17
- return e = class extends o {
16
+ const M = (c) => (() => {
17
+ var h, e;
18
+ let u = c, o, p = [], r = [];
19
+ return e = class extends u {
18
20
  constructor() {
19
21
  super(...arguments);
20
- x(this, u, f(this, h, !1));
21
- f(this, a);
22
+ C(this, h, f(this, p, !1));
23
+ f(this, r);
22
24
  }
23
25
  /** Whether the component is disabled. */
24
26
  get disabled() {
25
- return k(this, u);
27
+ return x(this, h);
26
28
  }
27
29
  set disabled(t) {
28
- v(this, u, t);
30
+ y(this, h, t);
29
31
  }
30
32
  /**
31
33
  * Will be used as 'or' check to the current disabled state.
@@ -34,52 +36,64 @@ const I = (l) => (() => {
34
36
  isDisabledExternally() {
35
37
  return !1;
36
38
  }
37
- }, u = new WeakMap(), (() => {
38
- const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
39
- r = [w(), S({ reflect: !0, type: Boolean }), N((s, i) => i || s.isDisabledExternally())], y(e, null, r, { kind: "accessor", name: "disabled", static: !1, private: !1, access: { has: (s) => "disabled" in s, get: (s) => s.disabled, set: (s, i) => {
40
- s.disabled = i;
41
- } }, metadata: t }, h, a), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
39
+ }, h = new WeakMap(), (() => {
40
+ const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
41
+ o = [R(), S({ reflect: !0, type: Boolean }), N((s, l) => l || s.isDisabledExternally())], g(e, null, o, { kind: "accessor", name: "disabled", static: !1, private: !1, access: { has: (s) => "disabled" in s, get: (s) => s.disabled, set: (s, l) => {
42
+ s.disabled = l;
43
+ } }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
42
44
  })(), e;
43
- })(), X = (l) => (() => {
44
- var u, e;
45
- let o = l, r, h = [], a = [];
46
- return e = class extends o {
45
+ })(), ee = (c) => (() => {
46
+ var h, e;
47
+ let u = c, o, p = [], r = [];
48
+ return e = class extends u {
47
49
  constructor() {
48
50
  super(...arguments);
49
- x(this, u, f(this, h, !1));
50
- f(this, a);
51
+ C(this, h, f(this, p, !1));
52
+ f(this, r);
51
53
  }
52
54
  /** Whether the button should be aria-disabled but stay interactive. */
53
55
  get disabledInteractive() {
54
- return k(this, u);
56
+ return x(this, h);
55
57
  }
56
58
  set disabledInteractive(t) {
57
- v(this, u, t);
59
+ y(this, h, t);
58
60
  }
59
- }, u = new WeakMap(), (() => {
60
- const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
61
- r = [w(), S({ attribute: "disabled-interactive", type: Boolean, reflect: !0 })], y(e, null, r, { kind: "accessor", name: "disabledInteractive", static: !1, private: !1, access: { has: (s) => "disabledInteractive" in s, get: (s) => s.disabledInteractive, set: (s, i) => {
62
- s.disabledInteractive = i;
63
- } }, metadata: t }, h, a), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
61
+ }, h = new WeakMap(), (() => {
62
+ const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
63
+ o = [R(), S({ attribute: "disabled-interactive", type: Boolean, reflect: !0 })], g(e, null, o, { kind: "accessor", name: "disabledInteractive", static: !1, private: !1, access: { has: (s) => "disabledInteractive" in s, get: (s) => s.disabledInteractive, set: (s, l) => {
64
+ s.disabledInteractive = l;
65
+ } }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
64
66
  })(), e;
65
- })(), le = (l) => {
66
- class p extends X(I(l)) {
67
- willUpdate(r) {
68
- super.willUpdate(r), r.has("disabledInteractive") && (this.internals.ariaDisabled = this.disabledInteractive ? "true" : null), r.has("disabled") && (this.disabled ? this.removeAttribute("tabindex") : this.setAttribute("tabindex", "0"));
67
+ })(), pe = (c) => {
68
+ class m extends ee(M(c)) {
69
+ willUpdate(o) {
70
+ super.willUpdate(o), o.has("disabledInteractive") && (this.internals.ariaDisabled = this.disabledInteractive ? "true" : null), o.has("disabled") && (this.disabled ? this.removeAttribute("tabindex") : this.setAttribute("tabindex", "0"));
69
71
  }
70
72
  }
71
- return p;
72
- }, L = (l) => (() => {
73
- var d, t;
74
- let o = l, r = [], h, a, u, e = [], n = [];
75
- return t = class extends o {
76
- constructor() {
77
- super(...arguments);
78
- x(this, d);
79
- this._value = (f(this, r), null), this.internals = this.attachInternals(), v(this, d, f(this, e, !1)), f(this, n);
73
+ return m;
74
+ }, te = {
75
+ badInput: !1,
76
+ customError: !1,
77
+ patternMismatch: !1,
78
+ rangeOverflow: !1,
79
+ rangeUnderflow: !1,
80
+ stepMismatch: !1,
81
+ tooLong: !1,
82
+ tooShort: !1,
83
+ typeMismatch: !1,
84
+ valueMissing: !1
85
+ }, L = (c) => (() => {
86
+ var n, t;
87
+ let u = c, o = [], p, r, h, e = [], i = [];
88
+ return t = class extends u {
89
+ constructor(...a) {
90
+ var d;
91
+ super(...a);
92
+ C(this, n);
93
+ this._value = (f(this, o), null), this.internals = this.attachInternals(), this._validityStates = /* @__PURE__ */ new Map(), y(this, n, f(this, e, !1)), f(this, i), (d = this.addEventListener) == null || d.call(this, "invalid", (b) => b.preventDefault());
80
94
  }
81
95
  /**
82
- * Returns the form owner of the internals of the target element.
96
+ * Returns the form owner of this element.
83
97
  */
84
98
  get form() {
85
99
  return this.internals.form;
@@ -90,8 +104,8 @@ const I = (l) => (() => {
90
104
  * @description Developer note: In this case updating the attribute must be synchronous.
91
105
  * Due to this it is implemented as a getter/setter and the attributeChangedCallback() handles the diff check.
92
106
  */
93
- set name(c) {
94
- this.setAttribute("name", `${c}`), this.updateFormValue();
107
+ set name(a) {
108
+ this.setAttribute("name", `${a}`), this.updateFormValue();
95
109
  }
96
110
  get name() {
97
111
  return this.getAttribute("name") ?? "";
@@ -101,94 +115,150 @@ const I = (l) => (() => {
101
115
  return this.localName;
102
116
  }
103
117
  /** Value of the form element. */
104
- set value(c) {
105
- this._value = c, this.updateFormValue();
118
+ set value(a) {
119
+ this._value = a, this.updateFormValue();
106
120
  }
107
121
  get value() {
108
122
  return this._value;
109
123
  }
110
124
  /**
111
- * Returns the ValidityState object for internals target element.
112
- *
113
- * @internal
125
+ * Returns the ValidityState object for this element.
114
126
  */
115
127
  get validity() {
116
128
  return this.internals.validity;
117
129
  }
118
130
  /**
119
- * Returns the error message that would be shown to the user
120
- * if internals target element was to be checked for validity.
121
- *
122
- * @internal
131
+ * Returns the current error message, if available, which corresponds
132
+ * to the current validation state.
133
+ * Please note that only one message is returned at a time (e.g. if
134
+ * multiple validity states are invalid, only the chronologically first one
135
+ * is returned until it is fixed, at which point the next message might be
136
+ * returned, if it is still applicable). Also a custom validity message
137
+ * (see below) has precedence over native validation messages.
123
138
  */
124
139
  get validationMessage() {
125
140
  return this.internals.validationMessage;
126
141
  }
127
142
  /**
128
- * Returns true if internals target element will be validated
143
+ * Returns true if this element will be validated
129
144
  * when the form is submitted; false otherwise.
130
- *
131
- * @internal
132
145
  */
133
146
  get willValidate() {
134
147
  return this.internals.willValidate;
135
148
  }
136
149
  /** Whenever a surrounding form or fieldset is changing its disabled state. */
137
150
  get formDisabled() {
138
- return k(this, d);
151
+ return x(this, n);
139
152
  }
140
- set formDisabled(c) {
141
- v(this, d, c);
153
+ set formDisabled(a) {
154
+ y(this, n, a);
142
155
  }
143
- attributeChangedCallback(c, b, m) {
144
- (c !== "name" || b !== m) && super.attributeChangedCallback(c, b, m);
156
+ attributeChangedCallback(a, d, b) {
157
+ (a !== "name" || d !== b) && super.attributeChangedCallback(a, d, b);
145
158
  }
146
159
  /**
147
- * Returns true if internals target element has no validity problems; false otherwise.
160
+ * Returns true if this element has no validity problems; false otherwise.
148
161
  * Fires an invalid event at the element in the latter case.
149
- *
150
- * @internal
151
162
  */
152
163
  checkValidity() {
153
164
  return this.internals.checkValidity();
154
165
  }
155
166
  /**
156
- * Returns true if internals target element has no validity problems; otherwise,
167
+ * Returns true if this element has no validity problems; otherwise,
157
168
  * returns false, fires an invalid event at the element,
158
169
  * and (if the event isn't canceled) reports the problem to the user.
159
- *
160
- * @internal
161
170
  */
162
171
  reportValidity() {
163
172
  return this.internals.reportValidity();
164
173
  }
174
+ /**
175
+ * Sets the custom validity message for this element. Use the empty string
176
+ * to indicate that the element does not have a custom validity error.
177
+ */
178
+ setCustomValidity(a) {
179
+ a ? this.setValidityFlag("customError", a) : this.removeValidityFlag("customError");
180
+ }
165
181
  /**
166
182
  * Is called whenever a surrounding form / fieldset changes disabled state.
167
183
  * @param disabled
168
184
  *
169
185
  * @internal
170
186
  */
171
- formDisabledCallback(c) {
187
+ formDisabledCallback(a) {
172
188
  Promise.resolve().then(() => {
173
- this.formDisabled = c;
189
+ this.formDisabled = a;
174
190
  });
175
191
  }
176
- }, d = new WeakMap(), (() => {
177
- const c = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
178
- h = [S()], a = [S()], u = [F()], y(t, null, h, { kind: "setter", name: "name", static: !1, private: !1, access: { has: (b) => "name" in b, set: (b, m) => {
179
- b.name = m;
180
- } }, metadata: c }, null, r), y(t, null, a, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (b) => "value" in b, set: (b, m) => {
181
- b.value = m;
182
- } }, metadata: c }, null, r), y(t, null, u, { kind: "accessor", name: "formDisabled", static: !1, private: !1, access: { has: (b) => "formDisabled" in b, get: (b) => b.formDisabled, set: (b, m) => {
183
- b.formDisabled = m;
184
- } }, metadata: c }, e, n), c && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: c });
192
+ /**
193
+ * Marks this element as suffering from the constraint indicated by the
194
+ * flag argument and associates the given message to it.
195
+ * Note that only one message is displayed at a time and custom messages by
196
+ * consumers are always displayed before internal messages and internal
197
+ * messages are displayed in the order they were added.
198
+ * To set/define custom validity state flags, you need to extend the
199
+ * ValidityState prototype and both the ValidityState and the
200
+ * ValidityStateFlags interface.
201
+ *
202
+ * @example
203
+ *
204
+ * // The type of the custom validity state does not need to be boolean.
205
+ * Object.assign(ValidityState.prototype, {
206
+ * get myError(): boolean {
207
+ * return false;
208
+ * },
209
+ * });
210
+ *
211
+ * declare global {
212
+ * interface ValidityState {
213
+ * myError: boolean;
214
+ * }
215
+ * interface ValidityState {
216
+ * myError?: boolean;
217
+ * }
218
+ * }
219
+ */
220
+ setValidityFlag(a, d, b) {
221
+ b ?? (b = !0), this._validityStates.set(a, { flagValue: b, message: d }), this._setInternalValidity();
222
+ }
223
+ removeValidityFlag(a) {
224
+ this._validityStates.delete(a), this._setInternalValidity();
225
+ }
226
+ _setInternalValidity() {
227
+ var a;
228
+ if (this._validityStates.size) {
229
+ let d = (a = this._validityStates.get("customError")) == null ? void 0 : a.message;
230
+ const b = {};
231
+ this._validityStates.forEach(({ flagValue: k, message: _ }, v) => {
232
+ b[v] = k, d || (d = _);
233
+ });
234
+ const E = Object.keys(ValidityState.prototype).filter((k) => !(k in te) && k !== "valid");
235
+ for (const k of E) {
236
+ const _ = k in b ? b[k] : !1;
237
+ Object.defineProperty(this.internals.validity, k, { value: _, configurable: !0 }), _ && (b.customError = !0);
238
+ }
239
+ this.internals.setValidity(b, d), J && Object.defineProperty(this.internals.validity, "customError", {
240
+ value: this._validityStates.has("customError") || !!b.customError,
241
+ configurable: !0
242
+ });
243
+ } else
244
+ this.internals.setValidity({});
245
+ }
246
+ }, n = new WeakMap(), (() => {
247
+ const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
248
+ p = [S()], r = [S()], h = [A()], g(t, null, p, { kind: "setter", name: "name", static: !1, private: !1, access: { has: (d) => "name" in d, set: (d, b) => {
249
+ d.name = b;
250
+ } }, metadata: a }, null, o), g(t, null, r, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (d) => "value" in d, set: (d, b) => {
251
+ d.value = b;
252
+ } }, metadata: a }, null, o), g(t, null, h, { kind: "accessor", name: "formDisabled", static: !1, private: !1, access: { has: (d) => "formDisabled" in d, get: (d) => d.formDisabled, set: (d, b) => {
253
+ d.formDisabled = b;
254
+ } }, metadata: a }, e, i), a && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
185
255
  })(), t.formAssociated = !0, t;
186
- })(), U = (l) => (() => {
187
- var a;
188
- let o = l, r = [], h;
189
- return a = class extends o {
256
+ })(), j = (c) => (() => {
257
+ var r;
258
+ let u = c, o = [], p;
259
+ return r = class extends u {
190
260
  constructor() {
191
- super(...arguments), this._required = (f(this, r), !1);
261
+ super(...arguments), this._required = (f(this, o), !1);
192
262
  }
193
263
  /** Whether the component is required. */
194
264
  set required(e) {
@@ -208,21 +278,21 @@ const I = (l) => (() => {
208
278
  return !1;
209
279
  }
210
280
  }, (() => {
211
- const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
212
- h = [S({ reflect: !0, type: Boolean })], y(a, null, h, { kind: "setter", name: "required", static: !1, private: !1, access: { has: (n) => "required" in n, set: (n, d) => {
213
- n.required = d;
214
- } }, metadata: e }, null, r), e && Object.defineProperty(a, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
215
- })(), a;
216
- })(), oe = (l) => (() => {
217
- var d;
218
- let o = [j({
281
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
282
+ p = [S({ reflect: !0, type: Boolean })], g(r, null, p, { kind: "setter", name: "required", static: !1, private: !1, access: { has: (i) => "required" in i, set: (i, n) => {
283
+ i.required = n;
284
+ } }, metadata: e }, null, o), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
285
+ })(), r;
286
+ })(), me = (c) => (() => {
287
+ var n;
288
+ let u = [P({
219
289
  tabindex: "0"
220
- })], r, h = [], a, u = I(U(L(l))), e = [], n;
221
- return d = class extends u {
290
+ })], o, p = [], r, h = M(j(L(c))), e = [], i;
291
+ return n = class extends h {
222
292
  /** Whether the checkbox is checked. */
223
293
  set checked(s) {
224
- const i = typeof s == "object" ? s.attribute : !1;
225
- i && (s = s.value), this.hasUpdated && !i && (this._attributeMutationBlocked = !0), this._checked = !!s, this.updateFormValue();
294
+ const l = typeof s == "object" ? s.attribute : !1;
295
+ l && (s = s.value), this.hasUpdated && !l && (this._attributeMutationBlocked = !0), this._checked = !!s, this.updateFormValue();
226
296
  }
227
297
  get checked() {
228
298
  return this._checked;
@@ -235,16 +305,16 @@ const I = (l) => (() => {
235
305
  return "checkbox";
236
306
  }
237
307
  constructor() {
238
- var s, i, c;
239
- super(), this._attributeMutationBlocked = (f(this, e), !1), this._checked = !1, this._handleKeyboardInteraction = (b) => {
240
- b.key === " " && this._handleUserInteraction();
308
+ var s, l, a;
309
+ super(), this._attributeMutationBlocked = (f(this, e), !1), this._languageController = new z(this), this._checked = !1, this._handleKeyboardInteraction = (d) => {
310
+ d.key === " " && this._handleUserInteraction();
241
311
  }, this._handleUserInteraction = () => {
242
- var b;
243
- this.disabled || ((b = this.withUserInteraction) == null || b.call(this), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
244
- }, this.internals.role = "checkbox", (s = this.addEventListener) == null || s.call(this, "click", this._handleUserInteraction), (i = this.addEventListener) == null || i.call(this, "keydown", $), (c = this.addEventListener) == null || c.call(this, "keyup", this._handleKeyboardInteraction);
312
+ var d;
313
+ this.disabled || ((d = this.withUserInteraction) == null || d.call(this), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
314
+ }, this.internals.role = "checkbox", (s = this.addEventListener) == null || s.call(this, "click", this._handleUserInteraction), (l = this.addEventListener) == null || l.call(this, "keydown", H), (a = this.addEventListener) == null || a.call(this, "keyup", this._handleKeyboardInteraction);
245
315
  }
246
- attributeChangedCallback(s, i, c) {
247
- (s !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(s, i, c);
316
+ attributeChangedCallback(s, l, a) {
317
+ (s !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(s, l, a);
248
318
  }
249
319
  /**
250
320
  * Is called whenever the form is being reset.
@@ -263,32 +333,41 @@ const I = (l) => (() => {
263
333
  *
264
334
  * @internal
265
335
  */
266
- formStateRestoreCallback(s, i) {
336
+ formStateRestoreCallback(s, l) {
267
337
  s && (this.checked = s === "true");
268
338
  }
339
+ requestUpdate(s, l, a) {
340
+ super.requestUpdate(s, l, a), this.hasUpdated && (s === "checked" || s === "required" || !s) && this._setValidity();
341
+ }
342
+ firstUpdated(s) {
343
+ super.firstUpdated(s), this._setValidity();
344
+ }
269
345
  updateFormValue() {
270
346
  this.checked ? this.internals.setFormValue(this.value, `${this.checked}`) : this.internals.setFormValue(null);
271
347
  }
272
- }, a = d, (() => {
273
- const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
274
- n = [S({
348
+ _setValidity() {
349
+ this.required && !this.checked ? this.setValidityFlag("valueMissing", W[this._languageController.current]) : this.removeValidityFlag("valueMissing");
350
+ }
351
+ }, r = n, (() => {
352
+ const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
353
+ i = [S({
275
354
  type: Boolean,
276
355
  converter: {
277
- ...A,
356
+ ...D,
278
357
  // We need to pass information to the setter so that we know it was called by attribute change.
279
- fromAttribute: (i, c) => {
280
- var m, B;
281
- return { value: (B = (m = A).fromAttribute) == null ? void 0 : B.call(m, i, c), attribute: !0 };
358
+ fromAttribute: (l, a) => {
359
+ var b, E;
360
+ return { value: (E = (b = D).fromAttribute) == null ? void 0 : E.call(b, l, a), attribute: !0 };
282
361
  }
283
362
  }
284
- })], y(d, null, n, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (i) => "checked" in i, set: (i, c) => {
285
- i.checked = c;
286
- } }, metadata: s }, null, e), y(null, r = { value: a }, o, { kind: "class", name: a.name, metadata: s }, null, h), a = r.value, s && Object.defineProperty(a, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), f(a, h);
287
- })(), a;
288
- })(), O = /* @__PURE__ */ new WeakMap(), de = (l) => (() => {
289
- var a;
290
- let o = I(U(L(l))), r = [], h;
291
- return a = class extends o {
363
+ })], g(n, null, i, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (l) => "checked" in l, set: (l, a) => {
364
+ l.checked = a;
365
+ } }, metadata: s }, null, e), g(null, o = { value: r }, u, { kind: "class", name: r.name, metadata: s }, null, p), r = o.value, s && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), f(r, p);
366
+ })(), r;
367
+ })(), O = /* @__PURE__ */ new WeakMap(), fe = (c) => (() => {
368
+ var r;
369
+ let u = M(j(L(c))), o = [], p;
370
+ return r = class extends u {
292
371
  /**
293
372
  * Whether the radio button is checked.
294
373
  */
@@ -313,7 +392,7 @@ const I = (l) => (() => {
313
392
  }
314
393
  constructor() {
315
394
  var e;
316
- super(), this._checked = (f(this, r), !1), this.abort = new W(this), this._didLoad = !1, this.internals.role = "radio", (e = this.addEventListener) == null || e.call(this, "keydown", (n) => this._handleArrowKeyDown(n));
395
+ super(), this._checked = (f(this, o), !1), this.abort = new T(this), this._didLoad = !1, this._languageController = new z(this), this.internals.role = "radio", (e = this.addEventListener) == null || e.call(this, "keydown", (i) => this._handleArrowKeyDown(i));
317
396
  }
318
397
  connectedCallback() {
319
398
  super.connectedCallback(), this._connectToRegistry(), this._synchronizeGroupState();
@@ -334,14 +413,17 @@ const I = (l) => (() => {
334
413
  * user in which case reason is “autocomplete”.
335
414
  * @internal
336
415
  */
337
- formStateRestoreCallback(e, n) {
416
+ formStateRestoreCallback(e, i) {
338
417
  e && (this.checked = e === this.value);
339
418
  }
419
+ requestUpdate(e, i, n) {
420
+ super.requestUpdate(e, i, n), this.hasUpdated && (e === "checked" || e === "required" || !e) && this._setValidity();
421
+ }
340
422
  willUpdate(e) {
341
423
  super.willUpdate(e), e.has("disabled") && this.updateFocusableRadios();
342
424
  }
343
425
  firstUpdated(e) {
344
- super.firstUpdated(e), this._didLoad = !0, this.updateFocusableRadios();
426
+ super.firstUpdated(e), this._didLoad = !0, this.updateFocusableRadios(), this._setValidity();
345
427
  }
346
428
  /**
347
429
  * Called on `value` change
@@ -358,8 +440,8 @@ const I = (l) => (() => {
358
440
  updateFocusableRadios() {
359
441
  if (!this._didLoad)
360
442
  return;
361
- const e = this._interactableGroupedRadios(), n = e.findIndex((t) => t.checked && !t.disabled && !t.formDisabled), d = n !== -1 ? n : e.findIndex((t) => !t.disabled && !t.formDisabled);
362
- d !== -1 && (e[d].tabIndex = 0, e.splice(d, 1)), e.forEach((t) => t.removeAttribute("tabindex"));
443
+ const e = this._interactableGroupedRadios(), i = e.findIndex((t) => t.checked && !t.disabled && !t.formDisabled), n = i !== -1 ? i : e.findIndex((t) => !t.disabled && !t.formDisabled);
444
+ n !== -1 && (e[n].tabIndex = 0, e.splice(n, 1)), e.forEach((t) => t.removeAttribute("tabindex"));
363
445
  }
364
446
  async navigateByKeyboard(e) {
365
447
  e.checked = !0, this.emitChangeEvents(), await e.updateComplete, e.focus();
@@ -378,23 +460,35 @@ const I = (l) => (() => {
378
460
  return;
379
461
  const e = this.form ?? this.getRootNode();
380
462
  this._radioButtonGroupsMap = O.get(e), this._radioButtonGroupsMap || (this._radioButtonGroupsMap = /* @__PURE__ */ new Map(), O.set(e, this._radioButtonGroupsMap)), this.associatedRadioButtons = this._radioButtonGroupsMap.get(this.name), this.associatedRadioButtons || (this.associatedRadioButtons = /* @__PURE__ */ new Set(), this._radioButtonGroupsMap.set(this.name, this.associatedRadioButtons));
381
- const n = Array.from(this.associatedRadioButtons);
463
+ const i = Array.from(this.associatedRadioButtons);
382
464
  this.associatedRadioButtons.clear();
383
- const d = n.findIndex((t) => this.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
384
- d !== -1 ? n.splice(d, 0, this) : n.push(this), n.forEach((t) => this.associatedRadioButtons.add(t));
465
+ const n = i.findIndex((t) => this.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
466
+ n !== -1 ? i.splice(n, 0, this) : i.push(this), i.forEach((t) => this.associatedRadioButtons.add(t)), this._setValidity();
385
467
  }
386
468
  /**
387
469
  * Remove `this` from the radioButton registry and, if the group is empty, delete the entry from the groups Map
388
470
  */
389
471
  _disconnectFromRegistry() {
390
- var e, n, d;
391
- (e = this.associatedRadioButtons) == null || e.delete(this), ((n = this.associatedRadioButtons) == null ? void 0 : n.size) === 0 && ((d = this._radioButtonGroupsMap) == null || d.delete(this.name)), this.associatedRadioButtons = void 0, this._radioButtonGroupsMap = void 0;
472
+ var e, i, n;
473
+ (e = this.associatedRadioButtons) == null || e.delete(this), ((i = this.associatedRadioButtons) == null ? void 0 : i.size) === 0 ? (n = this._radioButtonGroupsMap) == null || n.delete(this.name) : this._setValidity(), this.associatedRadioButtons = void 0, this._radioButtonGroupsMap = void 0;
474
+ }
475
+ /**
476
+ * Sets the validity of all associated radio buttons.
477
+ * If any radio button is required, all associated are required as well.
478
+ */
479
+ _setValidity() {
480
+ if (!this.associatedRadioButtons)
481
+ return;
482
+ let e = !1, i = !1;
483
+ for (const n of this.associatedRadioButtons)
484
+ e || (e = n.required), i || (i = n.checked);
485
+ e && !i ? this.associatedRadioButtons.forEach((n) => n.setValidityFlag("valueMissing", X[this._languageController.current])) : this.associatedRadioButtons.forEach((n) => n.removeValidityFlag("valueMissing"));
392
486
  }
393
487
  /**
394
488
  * Return a list of 'interactable' grouped radios, ordered in DOM order
395
489
  */
396
490
  _interactableGroupedRadios() {
397
- return Array.from(this.associatedRadioButtons ?? []).filter((e) => T.isVisible(e));
491
+ return Array.from(this.associatedRadioButtons ?? []).filter((e) => Q.isVisible(e));
398
492
  }
399
493
  /**
400
494
  * Deselect other radio of the same group
@@ -403,20 +497,20 @@ const I = (l) => (() => {
403
497
  Array.from(this.associatedRadioButtons ?? []).filter((e) => e !== this).forEach((e) => e.checked = !1);
404
498
  }
405
499
  async _handleArrowKeyDown(e) {
406
- if (!H(e))
500
+ if (!Y(e))
407
501
  return;
408
502
  e.preventDefault();
409
- const n = this._interactableGroupedRadios().filter((s) => !s.disabled && !s.formDisabled), d = n.indexOf(this), t = K(e, d, n.length);
410
- await this.navigateByKeyboard(n[t]);
503
+ const i = this._interactableGroupedRadios().filter((s) => !s.disabled && !s.formDisabled), n = i.indexOf(this), t = Z(e, n, i.length);
504
+ await this.navigateByKeyboard(i[t]);
411
505
  }
412
506
  }, (() => {
413
- const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
414
- h = [S({ type: Boolean })], y(a, null, h, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (n) => "checked" in n, set: (n, d) => {
415
- n.checked = d;
416
- } }, metadata: e }, null, r), e && Object.defineProperty(a, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
417
- })(), a;
418
- })(), J = (l) => {
419
- class p extends l {
507
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
508
+ p = [S({ type: Boolean })], g(r, null, p, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (i) => "checked" in i, set: (i, n) => {
509
+ i.checked = n;
510
+ } }, metadata: e }, null, o), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
511
+ })(), r;
512
+ })(), se = (c) => {
513
+ class m extends c {
420
514
  /**
421
515
  * Returns a Promise that resolves when the element has completed hydration.
422
516
  * The Promise value is a boolean that is `true` if the element required hydration
@@ -432,34 +526,34 @@ const I = (l) => (() => {
432
526
  get hydrationRequired() {
433
527
  return this._hydrationRequired;
434
528
  }
435
- constructor(...r) {
436
- var h;
437
- if (super(...r), this._hydrationComplete = new Promise((a) => this._resolveHydration = a), this._hydrationRequired = !!this.shadowRoot, !this._hydrationRequired)
529
+ constructor(...o) {
530
+ var p;
531
+ if (super(...o), this._hydrationComplete = new Promise((r) => this._resolveHydration = r), this._hydrationRequired = !!this.shadowRoot, !this._hydrationRequired)
438
532
  this._resolveHydration(!1);
439
533
  else {
440
- const a = (n) => {
441
- this._hydrationRequired && n.stopImmediatePropagation();
442
- }, u = { capture: !0 }, e = (h = this.shadowRoot) == null ? void 0 : h.querySelectorAll("slot");
443
- e != null && e.length && (e.forEach((n) => n.addEventListener("slotchange", a, u)), this.hydrationComplete.then(() => e.forEach((n) => {
444
- n.removeEventListener("slotchange", a, u), n.assignedNodes().length && n.dispatchEvent(new Event("slotchange", { bubbles: !0 }));
534
+ const r = (i) => {
535
+ this._hydrationRequired && i.stopImmediatePropagation();
536
+ }, h = { capture: !0 }, e = (p = this.shadowRoot) == null ? void 0 : p.querySelectorAll("slot");
537
+ e != null && e.length && (e.forEach((i) => i.addEventListener("slotchange", r, h)), this.hydrationComplete.then(() => e.forEach((i) => {
538
+ i.removeEventListener("slotchange", r, h), i.assignedNodes().length && i.dispatchEvent(new Event("slotchange", { bubbles: !0 }));
445
539
  })));
446
540
  }
447
541
  }
448
- update(r) {
449
- super.update(r), this._hydrationRequired && (this._hydrationRequired = !1, this._resolveHydration(!0));
542
+ update(o) {
543
+ super.update(o), this._hydrationRequired && (this._hydrationRequired = !1, this._resolveHydration(!0));
450
544
  }
451
545
  }
452
- return p;
453
- }, z = "data-ssr-child-count", q = "li", ce = (l) => (() => {
454
- var u, e;
455
- let o = J(l), r, h = [], a = [];
456
- return e = class extends o {
546
+ return m;
547
+ }, F = "data-ssr-child-count", U = "li", ve = (c) => (() => {
548
+ var h, e;
549
+ let u = se(c), o, p = [], r = [];
550
+ return e = class extends u {
457
551
  constructor() {
458
552
  super(...arguments);
459
- x(this, u);
460
- v(this, u, f(this, h, [])), this._handleSlotchange = (f(this, a), () => {
553
+ C(this, h);
554
+ y(this, h, f(this, p, [])), this._handleSlotchange = (f(this, r), () => {
461
555
  const t = Array.from(this.children ?? []).filter((s) => this.listChildLocalNames.includes(s.localName));
462
- t.length === this.listChildren.length && this.listChildren.every((s, i) => t[i] === s) || (this.listChildren.filter((s) => !t.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = t, this.listChildren.forEach((s, i) => s.setAttribute("slot", `${q}-${i}`)), this.removeAttribute(z));
556
+ t.length === this.listChildren.length && this.listChildren.every((s, l) => t[l] === s) || (this.listChildren.filter((s) => !t.includes(s)).forEach((s) => s.removeAttribute("slot")), this.listChildren = t, this.listChildren.forEach((s, l) => s.setAttribute("slot", `${U}-${l}`)), this.removeAttribute(F));
463
557
  });
464
558
  }
465
559
  /**
@@ -468,10 +562,10 @@ const I = (l) => (() => {
468
562
  * to the child elements.
469
563
  */
470
564
  get listChildren() {
471
- return k(this, u);
565
+ return x(this, h);
472
566
  }
473
567
  set listChildren(t) {
474
- v(this, u, t);
568
+ y(this, h, t);
475
569
  }
476
570
  connectedCallback() {
477
571
  var t;
@@ -491,23 +585,23 @@ const I = (l) => (() => {
491
585
  * children to be passed via the `data-ssr-child-count` attribute value.
492
586
  */
493
587
  renderList(t = {}, s = {}) {
494
- const i = this.listSlotEntries(s);
495
- return i.length >= 2 ? R`
588
+ const l = this.listSlotEntries(s);
589
+ return l.length >= 2 ? I`
496
590
  <ul
497
591
  class=${t.class || this.localName}
498
- aria-label=${t.ariaLabel || E}
499
- aria-labelledby=${t.ariaLabelledby || E}
592
+ aria-label=${t.ariaLabel || B}
593
+ aria-labelledby=${t.ariaLabelledby || B}
500
594
  >
501
- ${i.map((c) => R`
502
- <li aria-hidden=${c.ariaHidden || E}>
503
- <slot name=${c.name}></slot>
595
+ ${l.map((a) => I`
596
+ <li aria-hidden=${a.ariaHidden || B}>
597
+ <slot name=${a.name}></slot>
504
598
  </li>
505
599
  `)}
506
600
  </ul>
507
601
  ${this.renderHiddenSlot()}
508
- ` : i.length === 1 ? R`<sbb-screen-reader-only>${t.ariaLabel}</sbb-screen-reader-only>
602
+ ` : l.length === 1 ? I`<sbb-screen-reader-only>${t.ariaLabel}</sbb-screen-reader-only>
509
603
  <span class=${t.class || this.localName}>
510
- <span><slot name=${i[0].name}></slot></span>
604
+ <span><slot name=${l[0].name}></slot></span>
511
605
  </span>
512
606
  ${this.renderHiddenSlot()} ` : this.renderHiddenSlot();
513
607
  }
@@ -521,11 +615,11 @@ const I = (l) => (() => {
521
615
  * children to be passed via the `data-ssr-child-count` attribute value.
522
616
  */
523
617
  listSlotEntries(t) {
524
- return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(z) ?? 0) })).map((i, c) => {
525
- var b;
618
+ return (this.listChildren.length ? this.listChildren : Array.from({ length: +(this.getAttribute(F) ?? 0) })).map((l, a) => {
619
+ var d;
526
620
  return {
527
- name: `${q}-${c}`,
528
- ariaHidden: ((b = t == null ? void 0 : t.localNameVisualOnly) == null ? void 0 : b.includes(i.localName)) ?? !1
621
+ name: `${U}-${a}`,
622
+ ariaHidden: ((d = t == null ? void 0 : t.localNameVisualOnly) == null ? void 0 : d.includes(l.localName)) ?? !1
529
623
  };
530
624
  });
531
625
  }
@@ -535,115 +629,115 @@ const I = (l) => (() => {
535
629
  * the slotchange event, which can be used to assign it to the appropriate named slot.
536
630
  */
537
631
  renderHiddenSlot() {
538
- return R`<span hidden><slot></slot></span>`;
632
+ return I`<span hidden><slot></slot></span>`;
539
633
  }
540
- }, u = new WeakMap(), (() => {
541
- const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
542
- r = [F()], y(e, null, r, { kind: "accessor", name: "listChildren", static: !1, private: !1, access: { has: (s) => "listChildren" in s, get: (s) => s.listChildren, set: (s, i) => {
543
- s.listChildren = i;
544
- } }, metadata: t }, h, a), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
634
+ }, h = new WeakMap(), (() => {
635
+ const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
636
+ o = [A()], g(e, null, o, { kind: "accessor", name: "listChildren", static: !1, private: !1, access: { has: (s) => "listChildren" in s, get: (s) => s.listChildren, set: (s, l) => {
637
+ s.listChildren = l;
638
+ } }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
545
639
  })(), e;
546
- })(), ue = (l) => (() => {
547
- var u, e;
548
- let o = l, r, h = [], a = [];
549
- return e = class extends o {
640
+ })(), _e = (c) => (() => {
641
+ var h, e;
642
+ let u = c, o, p = [], r = [];
643
+ return e = class extends u {
550
644
  constructor() {
551
645
  super(...arguments);
552
- x(this, u, f(this, h, !1));
553
- f(this, a);
646
+ C(this, h, f(this, p, !1));
647
+ f(this, r);
554
648
  }
555
649
  /** Negative coloring variant flag. */
556
650
  get negative() {
557
- return k(this, u);
651
+ return x(this, h);
558
652
  }
559
653
  set negative(t) {
560
- v(this, u, t);
654
+ y(this, h, t);
561
655
  }
562
- }, u = new WeakMap(), (() => {
563
- const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
564
- r = [w(), S({ reflect: !0, type: Boolean })], y(e, null, r, { kind: "accessor", name: "negative", static: !1, private: !1, access: { has: (s) => "negative" in s, get: (s) => s.negative, set: (s, i) => {
565
- s.negative = i;
566
- } }, metadata: t }, h, a), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
656
+ }, h = new WeakMap(), (() => {
657
+ const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
658
+ o = [R(), S({ reflect: !0, type: Boolean })], g(e, null, o, { kind: "accessor", name: "negative", static: !1, private: !1, access: { has: (s) => "negative" in s, get: (s) => s.negative, set: (s, l) => {
659
+ s.negative = l;
660
+ } }, metadata: t }, p, r), t && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
567
661
  })(), e;
568
- })(), be = (l) => (() => {
569
- var i, c, b, m;
570
- let o = l, r, h = [], a = [], u, e = [], n = [], d, t = [], s = [];
571
- return m = class extends o {
662
+ })(), ye = (c) => (() => {
663
+ var l, a, d, b;
664
+ let u = c, o, p = [], r = [], h, e = [], i = [], n, t = [], s = [];
665
+ return b = class extends u {
572
666
  constructor() {
573
667
  super(...arguments);
574
- x(this, i);
575
- x(this, c);
576
- x(this, b);
577
- v(this, i, f(this, h, "white")), v(this, c, (f(this, a), f(this, e, !1))), v(this, b, (f(this, n), f(this, t, ""))), this._panelConnected = (f(this, s), new P(this, m.events.panelConnected, { bubbles: !0 }));
668
+ C(this, l);
669
+ C(this, a);
670
+ C(this, d);
671
+ y(this, l, f(this, p, "white")), y(this, a, (f(this, r), f(this, e, !1))), y(this, d, (f(this, i), f(this, t, ""))), this._panelConnected = (f(this, s), new K(this, b.events.panelConnected, { bubbles: !0 }));
578
672
  }
579
673
  /** The background color of the panel. */
580
674
  get color() {
581
- return k(this, i);
675
+ return x(this, l);
582
676
  }
583
- set color(g) {
584
- v(this, i, g);
677
+ set color(_) {
678
+ y(this, l, _);
585
679
  }
586
680
  /** Whether the unselected panel has a border. */
587
681
  get borderless() {
588
- return k(this, c);
682
+ return x(this, a);
589
683
  }
590
- set borderless(g) {
591
- v(this, c, g);
684
+ set borderless(_) {
685
+ y(this, a, _);
592
686
  }
593
687
  /** @internal used for accessibility label when in expansion panel */
594
688
  get expansionState() {
595
- return k(this, b);
689
+ return x(this, d);
596
690
  }
597
- set expansionState(g) {
598
- v(this, b, g);
691
+ set expansionState(_) {
692
+ y(this, d, _);
599
693
  }
600
694
  connectedCallback() {
601
695
  super.connectedCallback(), this._panelConnected.emit();
602
696
  }
603
- }, i = new WeakMap(), c = new WeakMap(), b = new WeakMap(), (() => {
604
- const g = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
605
- r = [S()], u = [w(), S({ reflect: !0, type: Boolean })], d = [w(), S()], y(m, null, r, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (_) => "color" in _, get: (_) => _.color, set: (_, C) => {
606
- _.color = C;
607
- } }, metadata: g }, h, a), y(m, null, u, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (_) => "borderless" in _, get: (_) => _.borderless, set: (_, C) => {
608
- _.borderless = C;
609
- } }, metadata: g }, e, n), y(m, null, d, { kind: "accessor", name: "expansionState", static: !1, private: !1, access: { has: (_) => "expansionState" in _, get: (_) => _.expansionState, set: (_, C) => {
610
- _.expansionState = C;
611
- } }, metadata: g }, t, s), g && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: g });
612
- })(), m.events = {
697
+ }, l = new WeakMap(), a = new WeakMap(), d = new WeakMap(), (() => {
698
+ const _ = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
699
+ o = [S()], h = [R(), S({ reflect: !0, type: Boolean })], n = [R(), S()], g(b, null, o, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (v) => "color" in v, get: (v) => v.color, set: (v, w) => {
700
+ v.color = w;
701
+ } }, metadata: _ }, p, r), g(b, null, h, { kind: "accessor", name: "borderless", static: !1, private: !1, access: { has: (v) => "borderless" in v, get: (v) => v.borderless, set: (v, w) => {
702
+ v.borderless = w;
703
+ } }, metadata: _ }, e, i), g(b, null, n, { kind: "accessor", name: "expansionState", static: !1, private: !1, access: { has: (v) => "expansionState" in v, get: (v) => v.expansionState, set: (v, w) => {
704
+ v.expansionState = w;
705
+ } }, metadata: _ }, t, s), _ && Object.defineProperty(b, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: _ });
706
+ })(), b.events = {
613
707
  panelConnected: "panelConnected"
614
- }, m;
615
- })(), he = (l) => {
616
- class p extends l {
708
+ }, b;
709
+ })(), ge = (c) => {
710
+ class m extends c {
617
711
  constructor() {
618
712
  super(...arguments), this._updatePromise = Promise.resolve(), this._updateResolve = () => {
619
713
  };
620
714
  }
621
715
  startUpdate() {
622
- this._updatePromise = new Promise((r) => this._updateResolve = r);
716
+ this._updatePromise = new Promise((o) => this._updateResolve = o);
623
717
  }
624
718
  completeUpdate() {
625
719
  this._updateResolve();
626
720
  }
627
721
  async getUpdateComplete() {
628
- const r = await super.getUpdateComplete();
629
- return await this._updatePromise, r;
722
+ const o = await super.getUpdateComplete();
723
+ return await this._updatePromise, o;
630
724
  }
631
725
  }
632
- return p;
633
- }, pe = V`:host{--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-white) );--sbb-selection-panel-border-color: var(--sbb-color-cloud);--sbb-selection-panel-border-radius: var( --sbb-selection-expansion-panel-border-radius, var(--sbb-border-radius-4x) );--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-1x) );--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xs) var(--sbb-spacing-responsive-xxs);--sbb-selection-panel-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-selection-panel-cursor: pointer;--sbb-selection-panel-suffix-color: var(--sbb-color-charcoal);--sbb-selection-panel-subtext-color: var(--sbb-color-granite);display:block;outline:none!important}:host([size=s]){--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xxxs)}:host([color=milk]){--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-milk) )}:host([borderless]:not([data-checked])){--sbb-selection-panel-border-color: transparent}:host(:is([data-checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color: var(--sbb-color-charcoal);--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-2x) )}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor: default}.sbb-selection-panel{display:block;cursor:var(--sbb-selection-panel-cursor);position:relative;border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow}@media (forced-colors: active){.sbb-selection-panel:after{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-selection-panel-border-width) solid var(--sbb-selection-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius)}}:host(:focus-visible) .sbb-selection-panel{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width)}.sbb-selection-panel__badge{-webkit-user-select:none;user-select:none;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-selection-panel-border-radius);overflow:hidden}slot[name=suffix]{color:var(--sbb-selection-panel-suffix-color)}slot[name=subtext]{display:block;color:var(--sbb-selection-panel-subtext-color);padding-inline-start:var(--sbb-spacing-fixed-8x)}:host(:not([data-slot-names~=subtext])) slot[name=subtext]{display:none}`;
726
+ return m;
727
+ }, Se = $`:host{--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-white) );--sbb-selection-panel-border-color: var(--sbb-color-cloud);--sbb-selection-panel-border-radius: var( --sbb-selection-expansion-panel-border-radius, var(--sbb-border-radius-4x) );--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-1x) );--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xs) var(--sbb-spacing-responsive-xxs);--sbb-selection-panel-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-selection-panel-cursor: pointer;--sbb-selection-panel-suffix-color: var(--sbb-color-charcoal);--sbb-selection-panel-subtext-color: var(--sbb-color-granite);display:block;outline:none!important}:host([size=s]){--sbb-selection-panel-input-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xxxs)}:host([color=milk]){--sbb-selection-panel-background: var( --sbb-selection-expansion-panel-inner-background, var(--sbb-color-milk) )}:host([borderless]:not([data-checked])){--sbb-selection-panel-border-color: transparent}:host(:is([data-checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color: var(--sbb-color-charcoal);--sbb-selection-panel-border-width: var( --sbb-selection-expansion-panel-inner-border-width, var(--sbb-border-width-2x) )}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor: default}.sbb-selection-panel{display:block;cursor:var(--sbb-selection-panel-cursor);position:relative;border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow}@media (forced-colors: active){.sbb-selection-panel:after{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-selection-panel-border-width) solid var(--sbb-selection-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius)}}:host(:focus-visible) .sbb-selection-panel{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width)}.sbb-selection-panel__badge{-webkit-user-select:none;user-select:none;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-selection-panel-border-radius);overflow:hidden}slot[name=suffix]{color:var(--sbb-selection-panel-suffix-color)}slot[name=subtext]{display:block;color:var(--sbb-selection-panel-subtext-color);padding-inline-start:var(--sbb-spacing-fixed-8x)}:host(:not([data-slot-names~=subtext])) slot[name=subtext]{display:none}`;
634
728
  export {
635
- X as SbbDisabledInteractiveMixin,
636
- I as SbbDisabledMixin,
637
- le as SbbDisabledTabIndexActionMixin,
638
- oe as SbbFormAssociatedCheckboxMixin,
729
+ ee as SbbDisabledInteractiveMixin,
730
+ M as SbbDisabledMixin,
731
+ pe as SbbDisabledTabIndexActionMixin,
732
+ me as SbbFormAssociatedCheckboxMixin,
639
733
  L as SbbFormAssociatedMixin,
640
- de as SbbFormAssociatedRadioButtonMixin,
641
- J as SbbHydrationMixin,
642
- ce as SbbNamedSlotListMixin,
643
- ue as SbbNegativeMixin,
644
- be as SbbPanelMixin,
645
- U as SbbRequiredMixin,
646
- he as SbbUpdateSchedulerMixin,
647
- pe as panelCommonStyle,
734
+ fe as SbbFormAssociatedRadioButtonMixin,
735
+ se as SbbHydrationMixin,
736
+ ve as SbbNamedSlotListMixin,
737
+ _e as SbbNegativeMixin,
738
+ ye as SbbPanelMixin,
739
+ j as SbbRequiredMixin,
740
+ ge as SbbUpdateSchedulerMixin,
741
+ Se as panelCommonStyle,
648
742
  O as radioButtonRegistry
649
743
  };