@momentum-design/components 0.84.3 → 0.84.5

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 (185) hide show
  1. package/README.md +8 -3
  2. package/dist/browser/index.js +2241 -2299
  3. package/dist/browser/index.js.map +4 -4
  4. package/dist/components/alertchip/alertchip.component.d.ts +1 -1
  5. package/dist/components/alertchip/alertchip.component.js +2 -2
  6. package/dist/components/alertchip/alertchip.styles.js +22 -23
  7. package/dist/components/alertchip/alertchip.types.d.ts +1 -1
  8. package/dist/components/animation/animation.component.js +1 -1
  9. package/dist/components/animation/animation.styles.js +8 -5
  10. package/dist/components/appheader/appheader.component.js +12 -13
  11. package/dist/components/appheader/appheader.styles.js +0 -1
  12. package/dist/components/avatar/avatar.component.js +3 -16
  13. package/dist/components/avatar/avatar.constants.d.ts +1 -1
  14. package/dist/components/avatar/avatar.constants.js +1 -1
  15. package/dist/components/avatar/avatar.styles.js +129 -122
  16. package/dist/components/avatar/avatar.types.d.ts +1 -1
  17. package/dist/components/avatar/avatar.utils.d.ts +1 -1
  18. package/dist/components/avatar/avatar.utils.js +1 -1
  19. package/dist/components/avatarbutton/avatarbutton.component.d.ts +2 -2
  20. package/dist/components/avatarbutton/avatarbutton.component.js +2 -2
  21. package/dist/components/avatarbutton/avatarbutton.styles.js +34 -30
  22. package/dist/components/badge/badge.styles.js +9 -7
  23. package/dist/components/brandvisual/brandvisual.component.js +4 -4
  24. package/dist/components/bullet/bullet.component.d.ts +1 -1
  25. package/dist/components/bullet/bullet.component.js +2 -2
  26. package/dist/components/bullet/bullet.styles.js +3 -3
  27. package/dist/components/button/button.component.js +10 -4
  28. package/dist/components/button/button.utils.js +1 -1
  29. package/dist/components/buttongroup/buttongroup.component.js +1 -1
  30. package/dist/components/buttongroup/buttongroup.styles.js +68 -68
  31. package/dist/components/buttonlink/buttonlink.component.d.ts +5 -5
  32. package/dist/components/buttonlink/buttonlink.component.js +9 -9
  33. package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
  34. package/dist/components/buttonsimple/buttonsimple.constants.d.ts +1 -1
  35. package/dist/components/buttonsimple/buttonsimple.constants.js +1 -1
  36. package/dist/components/buttonsimple/buttonsimple.styles.js +62 -57
  37. package/dist/components/card/card.component.d.ts +6 -6
  38. package/dist/components/card/card.component.js +15 -16
  39. package/dist/components/card/card.styles.js +24 -22
  40. package/dist/components/cardbutton/cardbutton.component.js +9 -12
  41. package/dist/components/cardbutton/cardbutton.styles.js +1 -1
  42. package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +6 -6
  43. package/dist/components/cardcheckbox/cardcheckbox.component.js +30 -29
  44. package/dist/components/cardcheckbox/cardcheckbox.styles.js +10 -10
  45. package/dist/components/cardradio/cardradio.component.d.ts +12 -12
  46. package/dist/components/cardradio/cardradio.component.js +27 -30
  47. package/dist/components/cardradio/cardradio.styles.js +8 -8
  48. package/dist/components/checkbox/checkbox.component.js +7 -9
  49. package/dist/components/checkbox/checkbox.styles.js +62 -60
  50. package/dist/components/chip/chip.component.d.ts +1 -1
  51. package/dist/components/chip/chip.component.js +6 -11
  52. package/dist/components/chip/chip.styles.js +4 -2
  53. package/dist/components/dialog/dialog.component.d.ts +7 -2
  54. package/dist/components/dialog/dialog.component.js +43 -33
  55. package/dist/components/dialog/dialog.constants.d.ts +1 -0
  56. package/dist/components/dialog/dialog.constants.js +1 -0
  57. package/dist/components/dialog/dialog.styles.js +10 -12
  58. package/dist/components/divider/divider.component.js +6 -8
  59. package/dist/components/divider/divider.constants.d.ts +1 -1
  60. package/dist/components/divider/divider.constants.js +1 -1
  61. package/dist/components/divider/divider.styles.js +5 -20
  62. package/dist/components/filterchip/filterchip.styles.js +4 -2
  63. package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
  64. package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
  65. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
  66. package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
  67. package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
  68. package/dist/components/icon/icon.component.js +7 -7
  69. package/dist/components/icon/icon.utils.d.ts +1 -1
  70. package/dist/components/icon/icon.utils.js +7 -7
  71. package/dist/components/iconprovider/iconprovider.component.js +7 -7
  72. package/dist/components/input/input.component.d.ts +5 -5
  73. package/dist/components/input/input.component.js +64 -62
  74. package/dist/components/input/input.styles.js +128 -117
  75. package/dist/components/inputchip/inputchip.component.js +14 -19
  76. package/dist/components/inputchip/inputchip.styles.js +5 -3
  77. package/dist/components/link/link.component.d.ts +1 -1
  78. package/dist/components/link/link.component.js +4 -8
  79. package/dist/components/link/link.constants.d.ts +1 -1
  80. package/dist/components/link/link.constants.js +1 -1
  81. package/dist/components/link/link.styles.js +12 -12
  82. package/dist/components/linksimple/linksimple.component.js +2 -4
  83. package/dist/components/linksimple/linksimple.styles.js +59 -57
  84. package/dist/components/list/list.component.js +12 -9
  85. package/dist/components/listitem/listitem.component.js +15 -11
  86. package/dist/components/listitem/listitem.styles.js +11 -6
  87. package/dist/components/marker/marker.component.js +1 -1
  88. package/dist/components/marker/marker.styles.js +2 -2
  89. package/dist/components/menubar/menubar.component.d.ts +19 -19
  90. package/dist/components/menubar/menubar.component.js +19 -19
  91. package/dist/components/menuitem/menuitem.component.js +15 -15
  92. package/dist/components/menuitem/menuitem.styles.js +3 -2
  93. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
  94. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
  95. package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
  96. package/dist/components/menupopover/menupopover.component.js +11 -11
  97. package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
  98. package/dist/components/menupopover/menupopover.utils.js +3 -8
  99. package/dist/components/navitem/navitem.component.js +11 -19
  100. package/dist/components/navitem/navitem.styles.js +147 -143
  101. package/dist/components/navitemlist/navitemlist.component.js +2 -2
  102. package/dist/components/optgroup/optgroup.component.js +12 -9
  103. package/dist/components/option/option.component.js +11 -11
  104. package/dist/components/option/option.styles.js +1 -1
  105. package/dist/components/popover/popover.component.js +4 -4
  106. package/dist/components/popover/popover.stack.js +1 -1
  107. package/dist/components/popover/popover.styles.js +0 -1
  108. package/dist/components/popover/popover.utils.js +3 -4
  109. package/dist/components/presence/presence.component.d.ts +4 -4
  110. package/dist/components/presence/presence.component.js +4 -4
  111. package/dist/components/progressbar/progressbar.component.js +3 -4
  112. package/dist/components/progressbar/progressbar.styles.js +77 -71
  113. package/dist/components/progressspinner/progressspiner.utils.js +4 -4
  114. package/dist/components/progressspinner/progressspinner.component.js +38 -37
  115. package/dist/components/progressspinner/progressspinner.styles.js +1 -1
  116. package/dist/components/radio/radio.component.d.ts +41 -41
  117. package/dist/components/radio/radio.component.js +84 -83
  118. package/dist/components/radio/radio.styles.js +77 -75
  119. package/dist/components/radiogroup/radiogroup.component.js +1 -1
  120. package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
  121. package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
  122. package/dist/components/searchfield/searchfield.component.js +23 -17
  123. package/dist/components/searchfield/searchfield.styles.js +11 -13
  124. package/dist/components/select/select.component.js +20 -23
  125. package/dist/components/select/select.styles.js +9 -9
  126. package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
  127. package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
  128. package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
  129. package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
  130. package/dist/components/skeleton/skeleton.component.js +1 -4
  131. package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
  132. package/dist/components/skeleton/skeleton.constants.js +1 -1
  133. package/dist/components/skeleton/skeleton.styles.js +4 -4
  134. package/dist/components/spinner/spinner.component.d.ts +7 -7
  135. package/dist/components/spinner/spinner.component.js +9 -9
  136. package/dist/components/spinner/spinner.styles.js +58 -53
  137. package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
  138. package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
  139. package/dist/components/staticradio/staticradio.component.d.ts +8 -8
  140. package/dist/components/staticradio/staticradio.component.js +10 -11
  141. package/dist/components/staticradio/staticradio.styles.js +77 -75
  142. package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
  143. package/dist/components/statictoggle/statictoggle.component.js +3 -3
  144. package/dist/components/statictoggle/statictoggle.styles.js +71 -68
  145. package/dist/components/tab/tab.component.d.ts +1 -1
  146. package/dist/components/tab/tab.component.js +2 -2
  147. package/dist/components/tab/tab.styles.js +247 -245
  148. package/dist/components/tablist/tablist.component.js +11 -15
  149. package/dist/components/tablist/tablist.styles.js +27 -25
  150. package/dist/components/tablist/tablist.types.d.ts +1 -1
  151. package/dist/components/tablist/tablist.utils.js +4 -4
  152. package/dist/components/text/fonts.styles.js +49 -49
  153. package/dist/components/text/text.component.js +21 -11
  154. package/dist/components/text/text.types.d.ts +1 -1
  155. package/dist/components/textarea/textarea.component.d.ts +31 -31
  156. package/dist/components/textarea/textarea.component.js +54 -61
  157. package/dist/components/textarea/textarea.styles.js +123 -122
  158. package/dist/components/themeprovider/themeprovider.component.js +1 -1
  159. package/dist/components/themeprovider/themeprovider.styles.js +4 -4
  160. package/dist/components/toggle/toggle.component.d.ts +35 -35
  161. package/dist/components/toggle/toggle.component.js +62 -63
  162. package/dist/components/toggle/toggle.styles.js +77 -69
  163. package/dist/components/toggletip/toggletip.component.d.ts +7 -7
  164. package/dist/components/toggletip/toggletip.component.js +3 -2
  165. package/dist/components/tooltip/tooltip.component.js +1 -1
  166. package/dist/components/tooltip/tooltip.styles.js +0 -1
  167. package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
  168. package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
  169. package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
  170. package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
  171. package/dist/custom-elements.json +239 -228
  172. package/dist/index.js +1 -0
  173. package/dist/models/component/index.d.ts +1 -1
  174. package/dist/models/index.d.ts +2 -2
  175. package/dist/models/index.js +1 -1
  176. package/dist/react/index.d.ts +3 -3
  177. package/dist/react/index.js +3 -3
  178. package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
  179. package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
  180. package/dist/utils/mixins/FocusTrapMixin.js +15 -12
  181. package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
  182. package/dist/utils/mixins/MenuMixin.js +23 -23
  183. package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
  184. package/dist/utils/styles/index.js +12 -12
  185. package/package.json +1 -1
@@ -11,12 +11,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  import { html, nothing } from 'lit';
12
12
  import { property } from 'lit/decorators.js';
13
13
  import { ifDefined } from 'lit/directives/if-defined.js';
14
- import styles from './radio.styles';
15
14
  import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
16
15
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
17
16
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
18
17
  import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
19
18
  import { ROLE } from '../../utils/roles';
19
+ import styles from './radio.styles';
20
20
  /**
21
21
  * Radio allow users to select single options from a list or turn an item/feature on or off.
22
22
  * These are often used in forms, settings, and selection in lists.
@@ -48,30 +48,27 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
48
48
  constructor() {
49
49
  super(...arguments);
50
50
  /**
51
- * Determines whether the radio is selected or unselected.
52
- *
53
- * @default false
54
- */
51
+ * Determines whether the radio is selected or unselected.
52
+ *
53
+ * @default false
54
+ */
55
55
  this.checked = false;
56
56
  /**
57
- * Determines whether the radio is read-only.
58
- *
59
- * @default false
60
- */
57
+ * Determines whether the radio is read-only.
58
+ *
59
+ * @default false
60
+ */
61
61
  this.readonly = false;
62
62
  /**
63
- * Automatically focus on the element when the page loads.
64
- * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
65
- * @default false
66
- */
63
+ * Automatically focus on the element when the page loads.
64
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
65
+ * @default false
66
+ */
67
67
  this.autofocus = false;
68
68
  this.renderLabelAndHelperText = () => {
69
69
  if (!this.label)
70
70
  return nothing;
71
- return html `<div class="mdc-radio__label-container">
72
- ${this.renderLabel()}
73
- ${this.renderHelperText()}
74
- </div>`;
71
+ return html `<div class="mdc-radio__label-container">${this.renderLabel()} ${this.renderHelperText()}</div>`;
75
72
  };
76
73
  }
77
74
  connectedCallback() {
@@ -83,16 +80,16 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
83
80
  this.updateTabIndex();
84
81
  }
85
82
  /**
86
- * Returns all radios within the same group (name).
87
- */
83
+ * Returns all radios within the same group (name).
84
+ */
88
85
  getAllRadiosWithinSameGroup() {
89
86
  return Array.from(document.querySelectorAll(`mdc-radio[name="${this.name}"]`));
90
87
  }
91
88
  /**
92
- * The 'change' event does not bubble up through the shadow DOM as it was not composed.
93
- * Therefore, we need to re-dispatch the same event to ensure it is propagated correctly.
94
- * Read more: https://developer.mozilla.org/en-US/docs/Web/API/Event/composed
95
- */
89
+ * The 'change' event does not bubble up through the shadow DOM as it was not composed.
90
+ * Therefore, we need to re-dispatch the same event to ensure it is propagated correctly.
91
+ * Read more: https://developer.mozilla.org/en-US/docs/Web/API/Event/composed
92
+ */
96
93
  dispatchChangeEvent(event) {
97
94
  const EventConstructor = event.constructor;
98
95
  this.dispatchEvent(new EventConstructor(event.type, event));
@@ -100,12 +97,14 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
100
97
  /** @internal */
101
98
  formResetCallback() {
102
99
  const radios = this.getAllRadiosWithinSameGroup();
103
- radios.forEach((radio) => {
100
+ radios.forEach(radio => {
104
101
  radio.checked = false;
105
102
  });
106
- this.updateComplete.then(() => {
103
+ this.updateComplete
104
+ .then(() => {
107
105
  this.setActualFormValue();
108
- }).catch((error) => {
106
+ })
107
+ .catch(error => {
109
108
  if (this.onerror) {
110
109
  this.onerror(error);
111
110
  }
@@ -118,8 +117,8 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
118
117
  }
119
118
  }
120
119
  /**
121
- * @internal
122
- */
120
+ * @internal
121
+ */
123
122
  setComponentValidity(isValid) {
124
123
  if (isValid) {
125
124
  this.internals.setValidity({});
@@ -141,21 +140,23 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
141
140
  * @param isValid - Boolean value to set the validity of the group
142
141
  */
143
142
  setGroupValidity(radios, isValid) {
144
- this.updateComplete.then(() => {
145
- radios.forEach((radio) => {
143
+ this.updateComplete
144
+ .then(() => {
145
+ radios.forEach(radio => {
146
146
  radio.setComponentValidity(isValid);
147
147
  });
148
- }).catch((error) => {
148
+ })
149
+ .catch(error => {
149
150
  if (this.onerror) {
150
151
  this.onerror(error);
151
152
  }
152
153
  });
153
154
  }
154
155
  /**
155
- * Updates the form value to reflect the current state of the radio.
156
- * If checked, the value is set to the user-provided value.
157
- * If unchecked, the value is set to null.
158
- */
156
+ * Updates the form value to reflect the current state of the radio.
157
+ * If checked, the value is set to the user-provided value.
158
+ * If unchecked, the value is set to null.
159
+ */
159
160
  setActualFormValue() {
160
161
  let actualValue = '';
161
162
  if (this.checked) {
@@ -169,28 +170,28 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
169
170
  this.setGroupValidity(radios, true);
170
171
  }
171
172
  else {
172
- const anyRequired = radios.some((r) => r.required);
173
- const anyChecked = !!radios.find((r) => r.checked);
173
+ const anyRequired = radios.some(r => r.required);
174
+ const anyChecked = !!radios.find(r => r.checked);
174
175
  const isInvalid = anyRequired && !anyChecked;
175
176
  this.setGroupValidity(radios, !isInvalid);
176
177
  }
177
178
  this.internals.setFormValue(actualValue);
178
179
  }
179
180
  /**
180
- * Handles the change event on the radio element.
181
- * This will toggle the state of the radio element.
182
- * Dispatches the change event.
183
- */
181
+ * Handles the change event on the radio element.
182
+ * This will toggle the state of the radio element.
183
+ * Dispatches the change event.
184
+ */
184
185
  handleChange(event) {
185
186
  var _a;
186
187
  if (this.disabled || this.readonly)
187
188
  return;
188
189
  const radios = this.getAllRadiosWithinSameGroup();
189
- radios.forEach((radio) => {
190
+ radios.forEach(radio => {
190
191
  var _a;
191
192
  /**
192
- * Uncheck all radios in the same group (name)
193
- */
193
+ * Uncheck all radios in the same group (name)
194
+ */
194
195
  const radioElement = (_a = radio.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');
195
196
  if (radioElement) {
196
197
  radio.checked = false;
@@ -205,27 +206,27 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
205
206
  this.dispatchChangeEvent(event);
206
207
  }
207
208
  /**
208
- * Updates the state of the radio button at the specified index within the enabled radios.
209
- * Focuses the radio button and triggers the change event if the radio button is not read-only.
210
- *
211
- * @param enabledRadios - An array of enabled radio buttons within the same group.
212
- * @param index - The index of the radio button to be updated within the enabled radios array.
213
- * @param event - The event that triggered the update.
214
- */
209
+ * Updates the state of the radio button at the specified index within the enabled radios.
210
+ * Focuses the radio button and triggers the change event if the radio button is not read-only.
211
+ *
212
+ * @param enabledRadios - An array of enabled radio buttons within the same group.
213
+ * @param index - The index of the radio button to be updated within the enabled radios array.
214
+ * @param event - The event that triggered the update.
215
+ */
215
216
  updateRadio(enabledRadios, index, event) {
216
217
  var _a, _b;
217
218
  (_b = (_a = enabledRadios[index].shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.focus();
218
219
  enabledRadios[index].handleChange(event);
219
220
  }
220
221
  /**
221
- * Handles the keydown event (Arrow Up/Down/Left/Right) on the radio element.
222
- */
222
+ * Handles the keydown event (Arrow Up/Down/Left/Right) on the radio element.
223
+ */
223
224
  handleKeyDown(event) {
224
225
  var _a;
225
226
  if (this.disabled)
226
227
  return;
227
228
  const radios = this.getAllRadiosWithinSameGroup();
228
- const enabledRadios = radios.filter((radio) => !radio.disabled);
229
+ const enabledRadios = radios.filter(radio => !radio.disabled);
229
230
  const currentIndex = enabledRadios.indexOf(this);
230
231
  if (['ArrowDown', 'ArrowRight'].includes(event.key)) {
231
232
  // Move focus to the next radio
@@ -246,15 +247,15 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
246
247
  }
247
248
  }
248
249
  /**
249
- * Update tab index for all radios in the same group (name)
250
- * If any radio group is checked, it will have a tab index of 0
251
- * If no radio group is checked, the first enabled radio will have a tab index of 0
252
- */
250
+ * Update tab index for all radios in the same group (name)
251
+ * If any radio group is checked, it will have a tab index of 0
252
+ * If no radio group is checked, the first enabled radio will have a tab index of 0
253
+ */
253
254
  updateTabIndex() {
254
255
  const radios = this.getAllRadiosWithinSameGroup();
255
- const checked = radios.find((radio) => radio.checked);
256
- const firstEnabledRadio = radios.find((radio) => !radio.disabled);
257
- radios.forEach((radio) => {
256
+ const checked = radios.find(radio => radio.checked);
257
+ const firstEnabledRadio = radios.find(radio => !radio.disabled);
258
+ radios.forEach(radio => {
258
259
  var _a;
259
260
  const inputElement = (_a = radio.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input');
260
261
  if (inputElement) {
@@ -277,32 +278,32 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
277
278
  render() {
278
279
  var _a;
279
280
  return html `
280
- <mdc-staticradio
281
+ <mdc-staticradio
281
282
  class="mdc-focus-ring"
282
283
  ?checked="${this.checked}"
283
284
  ?disabled="${this.disabled}"
284
285
  ?readonly="${this.readonly}"
285
- >
286
- <input
287
- id="${this.id}"
288
- type="radio"
289
- role="${ROLE.RADIO}"
290
- ?autofocus="${this.autofocus}"
291
- name="${ifDefined(this.name)}"
292
- value="${ifDefined(this.value)}"
293
- ?required="${this.required}"
294
- @change=${this.handleChange}
295
- @keydown=${this.handleKeyDown}
296
- ?checked=${this.checked}
297
- ?readonly=${this.readonly}
298
- ?disabled=${this.disabled}
299
- class="mdc-radio__input"
300
- aria-checked="${this.checked}"
301
- aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
302
- aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
303
- />
304
- </mdc-staticradio>
305
- ${this.renderLabelAndHelperText()}
286
+ >
287
+ <input
288
+ id="${this.id}"
289
+ type="radio"
290
+ role="${ROLE.RADIO}"
291
+ ?autofocus="${this.autofocus}"
292
+ name="${ifDefined(this.name)}"
293
+ value="${ifDefined(this.value)}"
294
+ ?required="${this.required}"
295
+ @change=${this.handleChange}
296
+ @keydown=${this.handleKeyDown}
297
+ ?checked=${this.checked}
298
+ ?readonly=${this.readonly}
299
+ ?disabled=${this.disabled}
300
+ class="mdc-radio__input"
301
+ aria-checked="${this.checked}"
302
+ aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
303
+ aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
304
+ />
305
+ </mdc-staticradio>
306
+ ${this.renderLabelAndHelperText()}
306
307
  `;
307
308
  }
308
309
  }
@@ -1,91 +1,93 @@
1
1
  import { css } from 'lit';
2
2
  import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
3
- const styles = [hostFitContentStyles, css `
4
- :host{
5
- display: flex;
6
- flex-direction: row;
7
- align-items: start;
8
- gap: 0.5rem;
3
+ const styles = [
4
+ hostFitContentStyles,
5
+ css `
6
+ :host {
7
+ display: flex;
8
+ flex-direction: row;
9
+ align-items: start;
10
+ gap: 0.5rem;
9
11
 
10
- --mdc-radio-text-disabled-color: var(--mds-color-theme-text-primary-disabled);
11
- --mdc-radio-control-inactive-hover: var(--mds-color-theme-control-inactive-hover);
12
- --mdc-radio-control-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
13
- --mdc-radio-control-active-hover-color: var(--mds-color-theme-control-active-hover);
14
- --mdc-radio-control-active-pressed-color: var(--mds-color-theme-control-active-pressed);
15
- --mdc-radio-control-active-disabled-background: var(--mds-color-theme-control-active-disabled);
16
- --mdc-radio-control-inactive-disabled-background: var(--mds-color-theme-control-inactive-disabled);
17
- --mdc-radio-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
18
- }
12
+ --mdc-radio-text-disabled-color: var(--mds-color-theme-text-primary-disabled);
13
+ --mdc-radio-control-inactive-hover: var(--mds-color-theme-control-inactive-hover);
14
+ --mdc-radio-control-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
15
+ --mdc-radio-control-active-hover-color: var(--mds-color-theme-control-active-hover);
16
+ --mdc-radio-control-active-pressed-color: var(--mds-color-theme-control-active-pressed);
17
+ --mdc-radio-control-active-disabled-background: var(--mds-color-theme-control-active-disabled);
18
+ --mdc-radio-control-inactive-disabled-background: var(--mds-color-theme-control-inactive-disabled);
19
+ --mdc-radio-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
20
+ }
19
21
 
22
+ :host(:hover)::part(radio-icon) {
23
+ background-color: var(--mdc-radio-control-inactive-hover);
24
+ }
20
25
 
21
- :host(:hover)::part(radio-icon) {
22
- background-color: var(--mdc-radio-control-inactive-hover);
23
- }
26
+ :host(:active)::part(radio-icon) {
27
+ background-color: var(--mdc-radio-control-inactive-pressed-color);
28
+ }
24
29
 
25
- :host(:active)::part(radio-icon) {
26
- background-color: var(--mdc-radio-control-inactive-pressed-color);
27
- }
30
+ :host([checked]:hover)::part(radio-icon) {
31
+ border-color: var(--mdc-radio-control-active-hover-color);
32
+ background-color: var(--mdc-radio-control-active-hover-color);
33
+ }
28
34
 
29
- :host([checked]:hover)::part(radio-icon) {
30
- border-color: var(--mdc-radio-control-active-hover-color);
31
- background-color: var(--mdc-radio-control-active-hover-color);
32
- }
35
+ :host([checked]:active)::part(radio-icon) {
36
+ border-color: var(--mdc-radio-control-active-pressed-color);
37
+ background-color: var(--mdc-radio-control-active-pressed-color);
38
+ }
33
39
 
34
- :host([checked]:active)::part(radio-icon) {
35
- border-color: var(--mdc-radio-control-active-pressed-color);
36
- background-color: var(--mdc-radio-control-active-pressed-color);
37
- }
40
+ :host([readonly]:hover)::part(radio-icon) {
41
+ border-color: var(--mdc-staticradio-normal-border-color);
42
+ background-color: var(--mdc-staticradio-control-inactive-color);
43
+ }
38
44
 
39
- :host([readonly]:hover)::part(radio-icon) {
40
- border-color: var(--mdc-staticradio-normal-border-color);
41
- background-color: var(--mdc-staticradio-control-inactive-color);
42
- }
45
+ :host([disabled]:hover)::part(radio-icon),
46
+ :host([disabled][readonly]:hover)::part(radio-icon) {
47
+ border-color: var(--mdc-radio-disabled-border-color);
48
+ background-color: var(--mdc-radio-control-inactive-disabled-background);
49
+ }
43
50
 
44
- :host([disabled]:hover)::part(radio-icon),
45
- :host([disabled][readonly]:hover)::part(radio-icon) {
46
- border-color: var(--mdc-radio-disabled-border-color);
47
- background-color: var(--mdc-radio-control-inactive-disabled-background);
48
- }
51
+ :host([disabled][checked]:hover)::part(radio-icon) {
52
+ background-color: var(--mdc-radio-control-active-disabled-background);
53
+ }
49
54
 
50
- :host([disabled][checked]:hover)::part(radio-icon){
51
- background-color: var(--mdc-radio-control-active-disabled-background);
52
- }
55
+ :host([readonly]) .mdc-radio__input,
56
+ :host([disabled]) .mdc-radio__input,
57
+ :host([disabled]) .mdc-label,
58
+ :host([readonly]) .mdc-label {
59
+ cursor: default;
60
+ }
53
61
 
54
- :host([readonly]) .mdc-radio__input,
55
- :host([disabled]) .mdc-radio__input,
56
- :host([disabled]) .mdc-label,
57
- :host([readonly]) .mdc-label{
58
- cursor: default;
59
- }
62
+ .mdc-label {
63
+ cursor: pointer;
64
+ }
60
65
 
61
- .mdc-label {
62
- cursor: pointer;
63
- }
66
+ :host([disabled]) .mdc-radio__label-text,
67
+ :host([disabled]) .mdc-radio__help-text {
68
+ color: var(--mdc-radio-text-disabled-color);
69
+ }
64
70
 
65
- :host([disabled]) .mdc-radio__label-text,
66
- :host([disabled]) .mdc-radio__help-text {
67
- color: var(--mdc-radio-text-disabled-color);
68
- }
71
+ .mdc-radio__input {
72
+ position: absolute;
73
+ opacity: 0;
74
+ margin: 0;
75
+ width: 100%;
76
+ height: 100%;
77
+ cursor: pointer;
78
+ z-index: 2;
79
+ }
69
80
 
70
- .mdc-radio__input{
71
- position: absolute;
72
- opacity: 0;
73
- margin: 0;
74
- width: 100%;
75
- height: 100%;
76
- cursor: pointer;
77
- z-index: 2;
78
- }
79
-
80
- .mdc-radio__label-container{
81
- display: flex;
82
- flex-direction: column;
83
- justify-content: center;
84
- gap: 0.25rem;
85
- }
86
- :host::part(required-indicator){
87
- display: none;
88
- }
89
-
90
- `, ...hostFocusRingStyles(true)];
81
+ .mdc-radio__label-container {
82
+ display: flex;
83
+ flex-direction: column;
84
+ justify-content: center;
85
+ gap: 0.25rem;
86
+ }
87
+ :host::part(required-indicator) {
88
+ display: none;
89
+ }
90
+ `,
91
+ ...hostFocusRingStyles(true),
92
+ ];
91
93
  export default styles;
@@ -40,7 +40,7 @@ class RadioGroup extends FormfieldGroup {
40
40
  */
41
41
  firstUpdated() {
42
42
  var _a, _b, _c, _d, _e;
43
- (_e = (_d = (_c = (_b = Array.from(((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('slot')) || [])) === null || _b === void 0 ? void 0 : _b.flatMap((slot) => slot.assignedElements({ flatten: true }))) === null || _c === void 0 ? void 0 : _c.filter((el) => el.tagName.toLowerCase() === RADIO_TAGNAME || el.tagName.toLowerCase() === CARD_RADIO_TAGNAME)) === null || _d === void 0 ? void 0 : _d.filter((radio) => !radio.hasAttribute('name'))) === null || _e === void 0 ? void 0 : _e.forEach((radio) => {
43
+ (_e = (_d = (_c = (_b = Array.from(((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('slot')) || [])) === null || _b === void 0 ? void 0 : _b.flatMap(slot => slot.assignedElements({ flatten: true }))) === null || _c === void 0 ? void 0 : _c.filter(el => el.tagName.toLowerCase() === RADIO_TAGNAME || el.tagName.toLowerCase() === CARD_RADIO_TAGNAME)) === null || _d === void 0 ? void 0 : _d.filter(radio => !radio.hasAttribute('name'))) === null || _e === void 0 ? void 0 : _e.forEach(radio => {
44
44
  radio.setAttribute('name', this.name);
45
45
  if (this.required)
46
46
  radio.setAttribute('required', this.required.toString());
@@ -130,10 +130,10 @@ class ScreenreaderAnnouncer extends Component {
130
130
  * Clears all timeouts and removes all announcements from the screen reader.
131
131
  */
132
132
  clearTimeOutsAndAnnouncements() {
133
- this.timeOutIds.forEach((timeOutId) => {
133
+ this.timeOutIds.forEach(timeOutId => {
134
134
  window.clearTimeout(timeOutId);
135
135
  });
136
- this.ariaLiveAnnouncementIds.forEach((announcementId) => {
136
+ this.ariaLiveAnnouncementIds.forEach(announcementId => {
137
137
  var _a;
138
138
  (_a = document.getElementById(announcementId)) === null || _a === void 0 ? void 0 : _a.remove();
139
139
  });
@@ -1,8 +1,10 @@
1
1
  import { css } from 'lit';
2
- const styles = [css `
3
- :host {
4
- display: none;
5
- visibility: hidden;
6
- }
7
- `];
2
+ const styles = [
3
+ css `
4
+ :host {
5
+ display: none;
6
+ visibility: hidden;
7
+ }
8
+ `,
9
+ ];
8
10
  export default styles;
@@ -10,8 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html } from 'lit';
11
11
  import { queryAssignedElements, state } from 'lit/decorators.js';
12
12
  import { classMap } from 'lit-html/directives/class-map.js';
13
- import styles from './searchfield.styles';
14
13
  import Input from '../input/input.component';
14
+ import styles from './searchfield.styles';
15
15
  import { DEFAULTS } from './searchfield.constants';
16
16
  /**
17
17
  * searchfield component is used as an input field for search functionality.
@@ -67,7 +67,7 @@ class Searchfield extends Input {
67
67
  var _a;
68
68
  this.hasInputChips = !!((_a = this.inputChips) === null || _a === void 0 ? void 0 : _a.length);
69
69
  if (this.inputChips) {
70
- this.inputChips.forEach((element) => {
70
+ this.inputChips.forEach(element => {
71
71
  if (!element.matches(DEFAULTS.INPUT_CHIP_TAG)) {
72
72
  element.remove();
73
73
  }
@@ -90,30 +90,36 @@ class Searchfield extends Input {
90
90
  clearInputText() {
91
91
  var _a;
92
92
  super.clearInputText();
93
- (_a = this.inputChips) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
93
+ (_a = this.inputChips) === null || _a === void 0 ? void 0 : _a.forEach(element => {
94
94
  // Dispatch the custom 'remove' event from inputChip
95
95
  element.dispatchEvent(new CustomEvent('remove', { bubbles: true, composed: true }));
96
96
  });
97
97
  }
98
98
  render() {
99
99
  return html `
100
- ${this.renderLabelElement()}
101
- <div class="${classMap({
100
+ ${this.renderLabelElement()}
101
+ <div
102
+ class="${classMap({
102
103
  'input-container': true,
103
104
  'mdc-focus-ring': this.isInputFocused,
104
- })}" part="input-container">
105
- ${this.renderLeadingIcon()}
106
- <div part='scrollable-container' tabindex='-1'>
107
- <div part="filters-container"
108
- @click=${() => this.inputElement.focus()}
109
- @keydown=${(e) => e.key === 'Enter' ? this.inputElement.focus() : null}
110
- @keyup=${(e) => e.key === ' ' ? this.inputElement.focus() : null}>
111
- <slot name="filters" @slotchange=${this.renderInputChips}></slot></div>
112
- ${this.renderInputElement(DEFAULTS.TYPE, this.hasInputChips)}
105
+ })}"
106
+ part="input-container"
107
+ >
108
+ ${this.renderLeadingIcon()}
109
+ <div part="scrollable-container" tabindex="-1">
110
+ <div
111
+ part="filters-container"
112
+ @click=${() => this.inputElement.focus()}
113
+ @keydown=${(e) => (e.key === 'Enter' ? this.inputElement.focus() : null)}
114
+ @keyup=${(e) => (e.key === ' ' ? this.inputElement.focus() : null)}
115
+ >
116
+ <slot name="filters" @slotchange=${this.renderInputChips}></slot>
117
+ </div>
118
+ ${this.renderInputElement(DEFAULTS.TYPE, this.hasInputChips)}
119
+ </div>
120
+ ${this.renderTrailingButton(this.hasInputChips)}
113
121
  </div>
114
- ${this.renderTrailingButton(this.hasInputChips)}
115
- </div>
116
- `;
122
+ `;
117
123
  }
118
124
  }
119
125
  Searchfield.styles = [...Input.styles, ...styles];
@@ -1,23 +1,22 @@
1
1
  import { css } from 'lit';
2
2
  const styles = css `
3
+ :host::part(filters-container) {
4
+ display: flex;
5
+ gap: 0.25rem;
6
+ margin: 0.25rem 0;
7
+ }
3
8
 
4
- :host::part(filters-container){
5
- display: flex;
6
- gap: 0.25rem;
7
- margin: 0.25rem 0;
8
- }
9
-
10
- .input {
11
- white-space: nowrap;
12
- min-width: 90%;
13
- }
9
+ .input {
10
+ white-space: nowrap;
11
+ min-width: 90%;
12
+ }
14
13
 
15
- .input::-webkit-search-cancel-button {
14
+ .input::-webkit-search-cancel-button {
16
15
  -webkit-appearance: none;
17
16
  pointer-events: none;
18
17
  }
19
18
 
20
- :host::part(scrollable-container){
19
+ :host::part(scrollable-container) {
21
20
  display: flex;
22
21
  flex-grow: 1;
23
22
  overflow-x: scroll;
@@ -25,6 +24,5 @@ const styles = css `
25
24
  position: relative;
26
25
  scrollbar-width: none;
27
26
  }
28
-
29
27
  `;
30
28
  export default [styles];