@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
@@ -56,9 +56,9 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
56
56
  constructor() {
57
57
  super(...arguments);
58
58
  /**
59
- * Determines whether the toggle is active or inactive.
60
- * @default false
61
- */
59
+ * Determines whether the toggle is active or inactive.
60
+ * @default false
61
+ */
62
62
  this.checked = false;
63
63
  /**
64
64
  * Determines toggle size in rem (height is specified here).
@@ -68,10 +68,10 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
68
68
  */
69
69
  this.size = DEFAULTS.SIZE;
70
70
  /**
71
- * Automatically focus on the element when the page loads.
72
- * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
73
- * @default false
74
- */
71
+ * Automatically focus on the element when the page loads.
72
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
73
+ * @default false
74
+ */
75
75
  this.autofocus = false;
76
76
  }
77
77
  connectedCallback() {
@@ -80,9 +80,9 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
80
80
  this.helpTextType = undefined;
81
81
  }
82
82
  /** @internal
83
- * Resets the checkbox to its initial state.
84
- * The checked property is set to false.
85
- */
83
+ * Resets the checkbox to its initial state.
84
+ * The checked property is set to false.
85
+ */
86
86
  formResetCallback() {
87
87
  this.checked = false;
88
88
  }
@@ -93,11 +93,11 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
93
93
  }
94
94
  }
95
95
  /**
96
- * Manages the required state of the checkbox.
97
- * If the checkbox is not checked and the required property is set, then the checkbox is invalid.
98
- * If the validationMessage is set, it will be used as the custom validity message.
99
- * If the validationMessage is not set, it will clear the custom validity message.
100
- */
96
+ * Manages the required state of the checkbox.
97
+ * If the checkbox is not checked and the required property is set, then the checkbox is invalid.
98
+ * If the validationMessage is set, it will be used as the custom validity message.
99
+ * If the validationMessage is not set, it will clear the custom validity message.
100
+ */
101
101
  manageRequired() {
102
102
  if (!this.checked && this.required) {
103
103
  if (this.validationMessage) {
@@ -113,10 +113,10 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
113
113
  }
114
114
  }
115
115
  /**
116
- * Updates the form value to reflect the current state of the toggle.
117
- * If toggle is switched on, the value is set to either the user-provided value or 'isActive' if no value is provided.
118
- * If toggle is switched off, the value is set to null.
119
- */
116
+ * Updates the form value to reflect the current state of the toggle.
117
+ * If toggle is switched on, the value is set to either the user-provided value or 'isActive' if no value is provided.
118
+ * If toggle is switched off, the value is set to null.
119
+ */
120
120
  setFormValue() {
121
121
  let actualValue = null;
122
122
  if (this.checked) {
@@ -129,19 +129,19 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
129
129
  this.internals.setFormValue(actualValue);
130
130
  }
131
131
  /**
132
- * Toggles the state of the toggle element.
133
- * If the element is not disabled, then the checked property is toggled.
134
- */
132
+ * Toggles the state of the toggle element.
133
+ * If the element is not disabled, then the checked property is toggled.
134
+ */
135
135
  toggleState() {
136
136
  if (!this.disabled) {
137
137
  this.checked = !this.checked;
138
138
  }
139
139
  }
140
140
  /**
141
- * Handles the keydown event on the toggle element.
142
- * When the user presses Enter, the form is submitted.
143
- * @param event - The keyboard event.
144
- */
141
+ * Handles the keydown event on the toggle element.
142
+ * When the user presses Enter, the form is submitted.
143
+ * @param event - The keyboard event.
144
+ */
145
145
  handleKeyDown(event) {
146
146
  var _a;
147
147
  if (event.key === 'Enter') {
@@ -149,21 +149,21 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
149
149
  }
150
150
  }
151
151
  /**
152
- * Toggles the state of the toggle element.
153
- * and dispatch the new change event.
154
- */
152
+ * Toggles the state of the toggle element.
153
+ * and dispatch the new change event.
154
+ */
155
155
  handleChange(event) {
156
156
  this.toggleState();
157
157
  const EventConstructor = event.constructor;
158
158
  this.dispatchEvent(new EventConstructor(event.type, event));
159
159
  }
160
160
  /**
161
- * Sets the size attribute for the toggle component.
162
- * If the provided size is not included in the TOGGLE_SIZE,
163
- * it defaults to the value specified in DEFAULTS.SIZE.
164
- *
165
- * @param size - The size to set.
166
- */
161
+ * Sets the size attribute for the toggle component.
162
+ * If the provided size is not included in the TOGGLE_SIZE,
163
+ * it defaults to the value specified in DEFAULTS.SIZE.
164
+ *
165
+ * @param size - The size to set.
166
+ */
167
167
  setToggleSize(size) {
168
168
  this.setAttribute('size', Object.values(TOGGLE_SIZE).includes(size) ? size : DEFAULTS.SIZE);
169
169
  }
@@ -179,34 +179,33 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
179
179
  render() {
180
180
  var _a;
181
181
  return html `
182
- <mdc-statictoggle
183
- ?checked="${this.checked}"
184
- ?disabled="${this.disabled}"
185
- size="${this.size}"
186
- class="mdc-focus-ring"
187
- part="container"
188
- >
189
- <input
190
- id="${this.id}"
191
- type="checkbox"
192
- part="toggle-input"
193
- role="${ROLE.CHECKBOX}"
194
- ?autofocus="${this.autofocus}"
195
- ?required="${this.required}"
196
- name="${ifDefined(this.name)}"
197
- value="${ifDefined(this.value)}"
198
- .checked="${this.checked}"
199
- aria-checked="${this.checked}"
200
- .disabled="${this.disabled}"
201
- aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
202
- aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
203
- tabindex="${this.disabled ? -1 : 0}"
204
- @change="${this.handleChange}"
205
- @keydown="${this.handleKeyDown}"
206
- />
207
- </mdc-statictoggle>
208
- ${this.renderLabel()}
209
- ${this.renderHelperText()}
182
+ <mdc-statictoggle
183
+ ?checked="${this.checked}"
184
+ ?disabled="${this.disabled}"
185
+ size="${this.size}"
186
+ class="mdc-focus-ring"
187
+ part="container"
188
+ >
189
+ <input
190
+ id="${this.id}"
191
+ type="checkbox"
192
+ part="toggle-input"
193
+ role="${ROLE.CHECKBOX}"
194
+ ?autofocus="${this.autofocus}"
195
+ ?required="${this.required}"
196
+ name="${ifDefined(this.name)}"
197
+ value="${ifDefined(this.value)}"
198
+ .checked="${this.checked}"
199
+ aria-checked="${this.checked}"
200
+ .disabled="${this.disabled}"
201
+ aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
202
+ aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
203
+ tabindex="${this.disabled ? -1 : 0}"
204
+ @change="${this.handleChange}"
205
+ @keydown="${this.handleKeyDown}"
206
+ />
207
+ </mdc-statictoggle>
208
+ ${this.renderLabel()} ${this.renderHelperText()}
210
209
  `;
211
210
  }
212
211
  }
@@ -1,86 +1,94 @@
1
1
  import { css } from 'lit';
2
2
  import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
3
- const styles = [hostFitContentStyles, css `
4
- :host {
5
- --mdc-toggle-width: 3rem;
6
- --mdc-toggle-height: 1.5rem;
7
- --mdc-toggle-width-compact: 2rem;
8
- --mdc-toggle-height-compact: 1rem;
3
+ const styles = [
4
+ hostFitContentStyles,
5
+ css `
6
+ :host {
7
+ --mdc-toggle-width: 3rem;
8
+ --mdc-toggle-height: 1.5rem;
9
+ --mdc-toggle-width-compact: 2rem;
10
+ --mdc-toggle-height-compact: 1rem;
9
11
 
10
- --mdc-toggle-label-lineheight: var(--mds-font-lineheight-body-midsize);
11
- --mdc-toggle-label-fontsize: var(--mds-font-size-body-midsize);
12
- --mdc-toggle-label-fontweight: 400;
13
- --mdc-toggle-label-color-disabled: var(--mds-color-theme-text-primary-disabled);
14
- --mdc-toggle-help-text-color: var(--mds-color-theme-text-secondary-normal);
12
+ --mdc-toggle-label-lineheight: var(--mds-font-lineheight-body-midsize);
13
+ --mdc-toggle-label-fontsize: var(--mds-font-size-body-midsize);
14
+ --mdc-toggle-label-fontweight: 400;
15
+ --mdc-toggle-label-color-disabled: var(--mds-color-theme-text-primary-disabled);
16
+ --mdc-toggle-help-text-color: var(--mds-color-theme-text-secondary-normal);
15
17
 
16
- --mdc-toggle-active-hover-color: var(--mds-color-theme-control-active-hover);
17
- --mdc-toggle-active-pressed-color: var(--mds-color-theme-control-active-pressed);
18
- --mdc-toggle-inactive-hover-color: var(--mds-color-theme-control-inactive-hover);
19
- --mdc-toggle-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
20
- }
18
+ --mdc-toggle-active-hover-color: var(--mds-color-theme-control-active-hover);
19
+ --mdc-toggle-active-pressed-color: var(--mds-color-theme-control-active-pressed);
20
+ --mdc-toggle-inactive-hover-color: var(--mds-color-theme-control-inactive-hover);
21
+ --mdc-toggle-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
22
+ }
21
23
 
22
- :host([label]), :host([help-text]){
23
- display: grid;
24
- grid-template-rows: auto auto;
25
- grid-template-columns: auto auto;
26
- column-gap: 0.75rem;
27
- row-gap: 0.25rem;
28
- }
24
+ :host([label]),
25
+ :host([help-text]) {
26
+ display: grid;
27
+ grid-template-rows: auto auto;
28
+ grid-template-columns: auto auto;
29
+ column-gap: 0.75rem;
30
+ row-gap: 0.25rem;
31
+ }
29
32
 
30
- :host([help-text='']) {
31
- grid-template-rows: auto;
32
- row-gap: 0rem;
33
- }
33
+ :host([help-text='']) {
34
+ grid-template-rows: auto;
35
+ row-gap: 0rem;
36
+ }
34
37
 
35
- :host::part(toggle-input) {
36
- margin: 0;
37
- padding: 0;
38
- position: absolute;
39
- opacity: 0.1%;
40
- overflow: visible;
41
- z-index: 1;
42
- width: var(--mdc-toggle-width);
43
- height: var(--mdc-toggle-height);
44
- }
38
+ :host::part(toggle-input) {
39
+ margin: 0;
40
+ padding: 0;
41
+ position: absolute;
42
+ opacity: 0.1%;
43
+ overflow: visible;
44
+ z-index: 1;
45
+ width: var(--mdc-toggle-width);
46
+ height: var(--mdc-toggle-height);
47
+ }
45
48
 
46
- .mdc-label-text, .mdc-help-text {
47
- font-size: var(--mdc-toggle-label-fontsize);
48
- font-weight: var(--mdc-toggle-label-fontweight);
49
- line-height: var(--mdc-toggle-label-lineheight);
50
- grid-column: 2;
51
- }
49
+ .mdc-label-text,
50
+ .mdc-help-text {
51
+ font-size: var(--mdc-toggle-label-fontsize);
52
+ font-weight: var(--mdc-toggle-label-fontweight);
53
+ line-height: var(--mdc-toggle-label-lineheight);
54
+ grid-column: 2;
55
+ }
52
56
 
53
- .mdc-label, :host::part(toggle-input) {
54
- cursor: pointer;
55
- }
57
+ .mdc-label,
58
+ :host::part(toggle-input) {
59
+ cursor: pointer;
60
+ }
56
61
 
57
- :host([disabled]) .mdc-label,
58
- :host([disabled])::part(toggle-input) {
59
- cursor: default;
60
- }
62
+ :host([disabled]) .mdc-label,
63
+ :host([disabled])::part(toggle-input) {
64
+ cursor: default;
65
+ }
61
66
 
62
- .mdc-help-text {
63
- color: var(--mdc-toggle-help-text-color);
64
- }
67
+ .mdc-help-text {
68
+ color: var(--mdc-toggle-help-text-color);
69
+ }
65
70
 
66
- :host(:hover:not([disabled]))::part(container) {
67
- background-color: var(--mdc-toggle-inactive-hover-color);
68
- }
71
+ :host(:hover:not([disabled]))::part(container) {
72
+ background-color: var(--mdc-toggle-inactive-hover-color);
73
+ }
69
74
 
70
- :host(:active:not([disabled]))::part(container) {
71
- background-color: var(--mdc-toggle-inactive-pressed-color);
72
- }
75
+ :host(:active:not([disabled]))::part(container) {
76
+ background-color: var(--mdc-toggle-inactive-pressed-color);
77
+ }
73
78
 
74
- :host(:hover:not([disabled])[checked])::part(container) {
75
- background-color: var(--mdc-toggle-active-hover-color);
76
- }
79
+ :host(:hover:not([disabled])[checked])::part(container) {
80
+ background-color: var(--mdc-toggle-active-hover-color);
81
+ }
77
82
 
78
- :host(:active:not([disabled])[checked])::part(container) {
79
- background-color: var(--mdc-toggle-active-pressed-color);
80
- }
83
+ :host(:active:not([disabled])[checked])::part(container) {
84
+ background-color: var(--mdc-toggle-active-pressed-color);
85
+ }
81
86
 
82
- :host([disabled]) .mdc-label-text, :host([disabled]) .mdc-help-text {
83
- color: var(--mdc-toggle-label-color-disabled);
84
- }
85
- `, ...hostFocusRingStyles(true)];
87
+ :host([disabled]) .mdc-label-text,
88
+ :host([disabled]) .mdc-help-text {
89
+ color: var(--mdc-toggle-label-color-disabled);
90
+ }
91
+ `,
92
+ ...hostFocusRingStyles(true),
93
+ ];
86
94
  export default styles;
@@ -41,13 +41,13 @@ declare class ToggleTip extends Popover {
41
41
  /** @internal */
42
42
  currentAnnouncement: string;
43
43
  /**
44
- * Set this attribute with the id of the element in the DOM, to which announcement
45
- * elements will be appended.
46
- * If an id is provided, the announcement elements will be appended to this element.
47
- * If id is not provided, a visually hidden div element will be created in the DOM.
48
- *
49
- * Please refer to the `mdc-screenreaderannouncer` component for more details.
50
- */
44
+ * Set this attribute with the id of the element in the DOM, to which announcement
45
+ * elements will be appended.
46
+ * If an id is provided, the announcement elements will be appended to this element.
47
+ * If id is not provided, a visually hidden div element will be created in the DOM.
48
+ *
49
+ * Please refer to the `mdc-screenreaderannouncer` component for more details.
50
+ */
51
51
  screenreaderAnnouncerIdentity?: string;
52
52
  /**
53
53
  * The placement of the popover.
@@ -94,7 +94,7 @@ class ToggleTip extends Popover {
94
94
  */
95
95
  getToggleTipText() {
96
96
  var _a, _b;
97
- return ((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map((node) => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '';
97
+ return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map((node) => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
98
98
  }
99
99
  /**
100
100
  * Updates the placement attribute if it is not a valid placement.
@@ -120,7 +120,8 @@ class ToggleTip extends Popover {
120
120
  <mdc-screenreaderannouncer
121
121
  identity="${ifDefined(this.screenreaderAnnouncerIdentity)}"
122
122
  announcement="${this.currentAnnouncement}"
123
- delay="300">
123
+ delay="300"
124
+ >
124
125
  </mdc-screenreaderannouncer>
125
126
  `;
126
127
  }
@@ -71,7 +71,7 @@ class Tooltip extends Popover {
71
71
  */
72
72
  getTooltipText() {
73
73
  var _a, _b;
74
- return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map((node) => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
74
+ return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map(node => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
75
75
  }
76
76
  /**
77
77
  * Sets the type attribute for the tooltip component.
@@ -1,6 +1,5 @@
1
1
  import { css } from 'lit';
2
2
  const styles = css `
3
-
4
3
  :host {
5
4
  --mdc-tooltip-max-width: 400px;
6
5
  --mdc-tooltip-padding: 0.75rem;
@@ -11,8 +11,8 @@ import { html } from 'lit';
11
11
  import { VirtualizerController } from '@tanstack/lit-virtual';
12
12
  import { property } from 'lit/decorators.js';
13
13
  import { createRef, ref } from 'lit/directives/ref.js';
14
- import styles from './virtualizedlist.styles';
15
14
  import { Component } from '../../models';
15
+ import styles from './virtualizedlist.styles';
16
16
  import { DEFAULTS } from './virtualizedlist.constants';
17
17
  /**
18
18
  * `mdc-virtualizedlist` component for creating custom virtualized lists.
@@ -121,22 +121,14 @@ class VirtualizedList extends Component {
121
121
  this.setlistdata({ virtualItems, measureElement, listStyle });
122
122
  }
123
123
  }
124
- return html `<div
125
- part="container"
126
- style="height: ${getTotalSize()}px;"
127
- >
128
- <slot></slot>
129
- </div>`;
124
+ return html `<div part="container" style="height: ${getTotalSize()}px;">
125
+ <slot></slot>
126
+ </div>`;
130
127
  }
131
128
  render() {
132
- return html `<div
133
- ${ref(this.scrollElementRef)}
134
- part="scroll"
135
- @scroll=${this.onscroll && this.onscroll}
136
- >
129
+ return html `<div ${ref(this.scrollElementRef)} part="scroll" @scroll=${this.onscroll && this.onscroll}>
137
130
  ${this.virtualizerController ? this.getVirtualizedListWrapper(this.virtualizerController) : html ``}
138
- </div>
139
- `;
131
+ </div> `;
140
132
  }
141
133
  }
142
134
  VirtualizedList.styles = [...Component.styles, ...styles];
@@ -1,6 +1,6 @@
1
1
  import { CSSResult, PropertyValues, TemplateResult } from 'lit';
2
- import { VirtualizerProps } from './virtualizedlist.types';
3
2
  import { Component } from '../../models';
3
+ import { VirtualizerProps } from './virtualizedlist.types';
4
4
  declare class VirtualizedWrapper extends Component {
5
5
  onscroll: ((this: GlobalEventHandlers, ev: Event) => void) | null;
6
6
  virtualizerProps: VirtualizerProps;
@@ -17,9 +17,7 @@ class VirtualizedWrapper extends Component {
17
17
  super();
18
18
  this.virtualizerProps = { count: 100, estimateSize: () => 100, overscan: 60 };
19
19
  this.list = html ``;
20
- this.listItemTexts = new Array(this.virtualizerProps.count)
21
- .fill(true)
22
- .map((_, index) => `list item number ${index}`);
20
+ this.listItemTexts = new Array(this.virtualizerProps.count).fill(true).map((_, index) => `list item number ${index}`);
23
21
  this.onscroll = null;
24
22
  this.setListData = this.setListData.bind(this);
25
23
  }
@@ -44,18 +42,23 @@ class VirtualizedWrapper extends Component {
44
42
  }
45
43
  setListData({ virtualItems, measureElement, listStyle }) {
46
44
  if (virtualItems) {
47
- this.list = html `<ul style="margin: 0;${styleMap(listStyle)}">${virtualItems.map((virtualItem) => html `<li role="listitem" key=${virtualItem.key} data-index=${virtualItem.index} ref=${ref(measureElement)}>
48
- ${this.listItemTexts[virtualItem.index]}</li>`)}</ul>`;
45
+ this.list = html `<ul style="margin: 0;${styleMap(listStyle)}">
46
+ ${virtualItems.map((virtualItem) => html `<li role="listitem" key=${virtualItem.key} data-index=${virtualItem.index} ref=${ref(measureElement)}>
47
+ ${this.listItemTexts[virtualItem.index]}
48
+ </li>`)}
49
+ </ul>`;
49
50
  }
50
51
  }
51
52
  render() {
52
53
  return html `
53
- <div style="height: 500px; width: 500px;">
54
- <mdc-virtualizedlist
55
- .onscroll=${this.onscroll}
56
- .virtualizerProps=${this.virtualizerProps}
57
- .setlistdata=${this.setListData}
58
- >${this.list}</mdc-virtualizedlist></div>
54
+ <div style="height: 500px; width: 500px;">
55
+ <mdc-virtualizedlist
56
+ .onscroll=${this.onscroll}
57
+ .virtualizerProps=${this.virtualizerProps}
58
+ .setlistdata=${this.setListData}
59
+ >${this.list}</mdc-virtualizedlist
60
+ >
61
+ </div>
59
62
  `;
60
63
  }
61
64
  }
@@ -1,15 +1,15 @@
1
1
  import { css } from 'lit';
2
2
  const styles = [
3
3
  css `
4
- :host::part(scroll) {
4
+ :host::part(scroll) {
5
5
  height: 100%;
6
6
  width: 100%;
7
7
  overflow-y: auto;
8
- }
9
- :host::part(container) {
8
+ }
9
+ :host::part(container) {
10
10
  position: relative;
11
11
  width: 100%;
12
- }
12
+ }
13
13
  `,
14
14
  ];
15
15
  export default styles;