@momentum-design/components 0.84.3 → 0.84.4

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 (182) hide show
  1. package/README.md +8 -3
  2. package/dist/browser/index.js +2233 -2291
  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.js +28 -29
  54. package/dist/components/dialog/dialog.styles.js +10 -12
  55. package/dist/components/divider/divider.component.js +6 -8
  56. package/dist/components/divider/divider.constants.d.ts +1 -1
  57. package/dist/components/divider/divider.constants.js +1 -1
  58. package/dist/components/divider/divider.styles.js +5 -20
  59. package/dist/components/filterchip/filterchip.styles.js +4 -2
  60. package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
  61. package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
  62. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
  63. package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
  64. package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
  65. package/dist/components/icon/icon.component.js +7 -7
  66. package/dist/components/icon/icon.utils.d.ts +1 -1
  67. package/dist/components/icon/icon.utils.js +7 -7
  68. package/dist/components/iconprovider/iconprovider.component.js +7 -7
  69. package/dist/components/input/input.component.d.ts +5 -5
  70. package/dist/components/input/input.component.js +64 -62
  71. package/dist/components/input/input.styles.js +128 -117
  72. package/dist/components/inputchip/inputchip.component.js +14 -19
  73. package/dist/components/inputchip/inputchip.styles.js +5 -3
  74. package/dist/components/link/link.component.d.ts +1 -1
  75. package/dist/components/link/link.component.js +4 -8
  76. package/dist/components/link/link.constants.d.ts +1 -1
  77. package/dist/components/link/link.constants.js +1 -1
  78. package/dist/components/link/link.styles.js +12 -12
  79. package/dist/components/linksimple/linksimple.component.js +2 -4
  80. package/dist/components/linksimple/linksimple.styles.js +59 -57
  81. package/dist/components/list/list.component.js +12 -9
  82. package/dist/components/listitem/listitem.component.js +15 -11
  83. package/dist/components/listitem/listitem.styles.js +11 -6
  84. package/dist/components/marker/marker.component.js +1 -1
  85. package/dist/components/marker/marker.styles.js +2 -2
  86. package/dist/components/menubar/menubar.component.d.ts +19 -19
  87. package/dist/components/menubar/menubar.component.js +19 -19
  88. package/dist/components/menuitem/menuitem.component.js +15 -15
  89. package/dist/components/menuitem/menuitem.styles.js +3 -2
  90. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
  91. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
  92. package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
  93. package/dist/components/menupopover/menupopover.component.js +11 -11
  94. package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
  95. package/dist/components/menupopover/menupopover.utils.js +3 -8
  96. package/dist/components/navitem/navitem.component.js +11 -19
  97. package/dist/components/navitem/navitem.styles.js +147 -143
  98. package/dist/components/navitemlist/navitemlist.component.js +2 -2
  99. package/dist/components/optgroup/optgroup.component.js +12 -9
  100. package/dist/components/option/option.component.js +11 -11
  101. package/dist/components/option/option.styles.js +1 -1
  102. package/dist/components/popover/popover.component.js +4 -4
  103. package/dist/components/popover/popover.stack.js +1 -1
  104. package/dist/components/popover/popover.styles.js +0 -1
  105. package/dist/components/popover/popover.utils.js +3 -4
  106. package/dist/components/presence/presence.component.d.ts +4 -4
  107. package/dist/components/presence/presence.component.js +4 -4
  108. package/dist/components/progressbar/progressbar.component.js +3 -4
  109. package/dist/components/progressbar/progressbar.styles.js +77 -71
  110. package/dist/components/progressspinner/progressspiner.utils.js +4 -4
  111. package/dist/components/progressspinner/progressspinner.component.js +38 -37
  112. package/dist/components/progressspinner/progressspinner.styles.js +1 -1
  113. package/dist/components/radio/radio.component.d.ts +41 -41
  114. package/dist/components/radio/radio.component.js +84 -83
  115. package/dist/components/radio/radio.styles.js +77 -75
  116. package/dist/components/radiogroup/radiogroup.component.js +1 -1
  117. package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
  118. package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
  119. package/dist/components/searchfield/searchfield.component.js +23 -17
  120. package/dist/components/searchfield/searchfield.styles.js +11 -13
  121. package/dist/components/select/select.component.js +20 -23
  122. package/dist/components/select/select.styles.js +9 -9
  123. package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
  124. package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
  125. package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
  126. package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
  127. package/dist/components/skeleton/skeleton.component.js +1 -4
  128. package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
  129. package/dist/components/skeleton/skeleton.constants.js +1 -1
  130. package/dist/components/skeleton/skeleton.styles.js +4 -4
  131. package/dist/components/spinner/spinner.component.d.ts +7 -7
  132. package/dist/components/spinner/spinner.component.js +9 -9
  133. package/dist/components/spinner/spinner.styles.js +58 -53
  134. package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
  135. package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
  136. package/dist/components/staticradio/staticradio.component.d.ts +8 -8
  137. package/dist/components/staticradio/staticradio.component.js +10 -11
  138. package/dist/components/staticradio/staticradio.styles.js +77 -75
  139. package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
  140. package/dist/components/statictoggle/statictoggle.component.js +3 -3
  141. package/dist/components/statictoggle/statictoggle.styles.js +71 -68
  142. package/dist/components/tab/tab.component.d.ts +1 -1
  143. package/dist/components/tab/tab.component.js +2 -2
  144. package/dist/components/tab/tab.styles.js +247 -245
  145. package/dist/components/tablist/tablist.component.js +11 -15
  146. package/dist/components/tablist/tablist.styles.js +27 -25
  147. package/dist/components/tablist/tablist.types.d.ts +1 -1
  148. package/dist/components/tablist/tablist.utils.js +4 -4
  149. package/dist/components/text/fonts.styles.js +49 -49
  150. package/dist/components/text/text.component.js +21 -11
  151. package/dist/components/text/text.types.d.ts +1 -1
  152. package/dist/components/textarea/textarea.component.d.ts +31 -31
  153. package/dist/components/textarea/textarea.component.js +54 -61
  154. package/dist/components/textarea/textarea.styles.js +123 -122
  155. package/dist/components/themeprovider/themeprovider.component.js +1 -1
  156. package/dist/components/themeprovider/themeprovider.styles.js +4 -4
  157. package/dist/components/toggle/toggle.component.d.ts +35 -35
  158. package/dist/components/toggle/toggle.component.js +62 -63
  159. package/dist/components/toggle/toggle.styles.js +77 -69
  160. package/dist/components/toggletip/toggletip.component.d.ts +7 -7
  161. package/dist/components/toggletip/toggletip.component.js +3 -2
  162. package/dist/components/tooltip/tooltip.component.js +1 -1
  163. package/dist/components/tooltip/tooltip.styles.js +0 -1
  164. package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
  165. package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
  166. package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
  167. package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
  168. package/dist/custom-elements.json +514 -514
  169. package/dist/index.js +1 -0
  170. package/dist/models/component/index.d.ts +1 -1
  171. package/dist/models/index.d.ts +2 -2
  172. package/dist/models/index.js +1 -1
  173. package/dist/react/index.d.ts +4 -4
  174. package/dist/react/index.js +4 -4
  175. package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
  176. package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
  177. package/dist/utils/mixins/FocusTrapMixin.js +12 -12
  178. package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
  179. package/dist/utils/mixins/MenuMixin.js +23 -23
  180. package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
  181. package/dist/utils/styles/index.js +12 -12
  182. package/package.json +1 -1
@@ -78,15 +78,15 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
78
78
  */
79
79
  getAllValidOptions() {
80
80
  var _a;
81
- return ((_a = this.optionsList) === null || _a === void 0 ? void 0 : _a.map((option) => {
81
+ return (((_a = this.optionsList) === null || _a === void 0 ? void 0 : _a.map(option => {
82
82
  if (option.tagName.toLowerCase() === OPTION_TAG_NAME) {
83
83
  return option;
84
84
  }
85
85
  if (option.tagName.toLowerCase() === OPTION_GROUP_TAG_NAME) {
86
- return Array.from(option.children).filter((optgroup) => optgroup.tagName.toLowerCase() === OPTION_TAG_NAME);
86
+ return Array.from(option.children).filter(optgroup => optgroup.tagName.toLowerCase() === OPTION_TAG_NAME);
87
87
  }
88
88
  return [];
89
- }).flat()) || [];
89
+ }).flat()) || []);
90
90
  }
91
91
  handlePopoverOpen() {
92
92
  this.displayPopover = true;
@@ -106,7 +106,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
106
106
  updateTabIndexForAllOptions(selectedOption) {
107
107
  var _a;
108
108
  let isTabIndexSet = false;
109
- this.getAllValidOptions().forEach((option) => {
109
+ this.getAllValidOptions().forEach(option => {
110
110
  if (option === selectedOption) {
111
111
  this.setSelectedValue(option);
112
112
  isTabIndexSet = true;
@@ -209,7 +209,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
209
209
  var _a;
210
210
  switch (event.key) {
211
211
  case KEYS.TAB: {
212
- const focusedOptionIndex = this.getAllValidOptions().findIndex((option) => option === event.target);
212
+ const focusedOptionIndex = this.getAllValidOptions().findIndex(option => option === event.target);
213
213
  this.setFocusAndTabIndex(focusedOptionIndex);
214
214
  event.preventDefault();
215
215
  break;
@@ -285,7 +285,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
285
285
  */
286
286
  handleOptionsNavigation(event) {
287
287
  const options = this.getAllValidOptions();
288
- const currentIndex = options.findIndex((option) => option === event.target);
288
+ const currentIndex = options.findIndex(option => option === event.target);
289
289
  const newIndex = this.getNewIndexBasedOnKey(event.key, currentIndex, options.length);
290
290
  if (newIndex !== -1) {
291
291
  this.setFocusAndTabIndex(newIndex);
@@ -316,11 +316,11 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
316
316
  }
317
317
  if (key === KEYS.PAGE_DOWN) {
318
318
  // Jumps visual focus down 10 options (or to last option).
319
- return (currentIndex + 10) > optionsLength ? optionsLength - 1 : currentIndex + 10;
319
+ return currentIndex + 10 > optionsLength ? optionsLength - 1 : currentIndex + 10;
320
320
  }
321
321
  if (key === KEYS.PAGE_UP) {
322
322
  // Jumps visual focus up 10 options (or to first option).
323
- return (currentIndex - 10) < 0 ? 0 : currentIndex - 10;
323
+ return currentIndex - 10 < 0 ? 0 : currentIndex - 10;
324
324
  }
325
325
  return -1;
326
326
  }
@@ -328,12 +328,12 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
328
328
  var _a, _b, _c, _d, _e;
329
329
  const options = this.getAllValidOptions();
330
330
  if (target) {
331
- const currentIndex = options.findIndex((option) => option === target);
331
+ const currentIndex = options.findIndex(option => option === target);
332
332
  this.activeDescendant = (_b = (_a = options[currentIndex]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
333
333
  }
334
334
  else {
335
335
  // If no target is provided, find the option with tabindex="0" or the first option
336
- const focusedOption = options.find((option) => option.getAttribute('tabindex') === '0');
336
+ const focusedOption = options.find(option => option.getAttribute('tabindex') === '0');
337
337
  this.activeDescendant = (_e = (_c = focusedOption === null || focusedOption === void 0 ? void 0 : focusedOption.id) !== null && _c !== void 0 ? _c : (_d = options[0]) === null || _d === void 0 ? void 0 : _d.id) !== null && _e !== void 0 ? _e : '';
338
338
  }
339
339
  }
@@ -359,8 +359,8 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
359
359
  this.displayPopover = true;
360
360
  // Find the currently selected option or the first option
361
361
  const options = this.getAllValidOptions();
362
- const selectedOption = options.find((option) => option.hasAttribute('selected'));
363
- const focusedOption = options.find((option) => option.getAttribute('tabindex') === '0');
362
+ const selectedOption = options.find(option => option.hasAttribute('selected'));
363
+ const focusedOption = options.find(option => option.getAttribute('tabindex') === '0');
364
364
  // Set activeDescendant to the selected/focused option or first option
365
365
  this.activeDescendant = (_b = (_a = (selectedOption || focusedOption || options[0])) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
366
366
  }
@@ -375,7 +375,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
375
375
  */
376
376
  firstUpdated() {
377
377
  const options = this.getAllValidOptions();
378
- const selectedOptionIndex = options.findIndex((option) => option === null || option === void 0 ? void 0 : option.hasAttribute('selected'));
378
+ const selectedOptionIndex = options.findIndex(option => option === null || option === void 0 ? void 0 : option.hasAttribute('selected'));
379
379
  if (selectedOptionIndex !== -1) {
380
380
  this.setSelectedValue(options[selectedOptionIndex]);
381
381
  this.updateTabIndexForAllOptions(options[selectedOptionIndex]);
@@ -426,8 +426,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
426
426
  * @returns An array of `TemplateResult` representing the option elements.
427
427
  */
428
428
  getOptionsContentFromSlot() {
429
- return this.getAllValidOptions()
430
- .map((option) => {
429
+ return this.getAllValidOptions().map(option => {
431
430
  var _a, _b;
432
431
  return html `
433
432
  <option
@@ -439,7 +438,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
439
438
  >
440
439
  ${option.textContent}
441
440
  </option>
442
- `;
441
+ `;
443
442
  });
444
443
  }
445
444
  /**
@@ -470,9 +469,8 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
470
469
  @hidden="${this.handlePopoverClose}"
471
470
  style="--mdc-popover-max-width: 100%; --mdc-popover-max-height: ${this.height};"
472
471
  >
473
- <slot
474
- @click="${this.handleOptionsClick}"></slot>
475
- </mdc-popover>
472
+ <slot @click="${this.handleOptionsClick}"></slot>
473
+ </mdc-popover>
476
474
  `;
477
475
  }
478
476
  updated(changedProperties) {
@@ -503,14 +501,14 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
503
501
  class="${this.disabled ? '' : 'mdc-focus-ring'}"
504
502
  role="${ROLE.COMBOBOX}"
505
503
  aria-activedescendant="${ifDefined(this.activeDescendant || undefined)}"
506
- aria-controls="${(ifDefined(this.displayPopover ? 'options-popover' : undefined))}"
504
+ aria-controls="${ifDefined(this.displayPopover ? 'options-popover' : undefined)}"
507
505
  aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
508
506
  aria-labelledby="${this.label ? FORMFIELD_DEFAULTS.HEADING_ID : ''}"
509
507
  aria-expanded="${this.displayPopover ? 'true' : 'false'}"
510
508
  aria-required="${this.required ? 'true' : 'false'}"
511
509
  aria-invalid="${this.helpTextType === VALIDATION.ERROR ? 'true' : 'false'}"
512
510
  >
513
- ${this.selectedIcon
511
+ ${this.selectedIcon
514
512
  ? html `<mdc-icon length-unit="rem" size="1" name="${this.selectedIcon}" part="selected-icon"></mdc-icon>`
515
513
  : nothing}
516
514
  <mdc-text
@@ -524,8 +522,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
524
522
  <mdc-icon size="1" length-unit="rem" name="${this.baseIconName}"></mdc-icon>
525
523
  </div>
526
524
  </div>
527
- ${this.getNativeSelect()}
528
- ${this.getPopoverContent()}
525
+ ${this.getNativeSelect()} ${this.getPopoverContent()}
529
526
  </div>
530
527
  ${this.renderHelperText()}
531
528
  `;
@@ -79,12 +79,12 @@ const styles = css `
79
79
  }
80
80
  :host([disabled])::part(base-container),
81
81
  :host([readonly])::part(base-container),
82
- :host([help-text-type="success"][disabled])::part(base-container),
83
- :host([help-text-type="error"][disabled])::part(base-container),
84
- :host([help-text-type="warning"][disabled])::part(base-container),
85
- :host([help-text-type="success"][readonly])::part(base-container),
86
- :host([help-text-type="error"][readonly])::part(base-container),
87
- :host([help-text-type="warning"][readonly])::part(base-container) {
82
+ :host([help-text-type='success'][disabled])::part(base-container),
83
+ :host([help-text-type='error'][disabled])::part(base-container),
84
+ :host([help-text-type='warning'][disabled])::part(base-container),
85
+ :host([help-text-type='success'][readonly])::part(base-container),
86
+ :host([help-text-type='error'][readonly])::part(base-container),
87
+ :host([help-text-type='warning'][readonly])::part(base-container) {
88
88
  border-color: var(--mdc-select-disabled-border-color);
89
89
  background: var(--mdc-select-disabled-background-color);
90
90
  }
@@ -98,13 +98,13 @@ const styles = css `
98
98
  :host([disabled])::part(base-text) {
99
99
  color: var(--mdc-select-disabled-text-color);
100
100
  }
101
- :host([help-text-type="success"])::part(base-container) {
101
+ :host([help-text-type='success'])::part(base-container) {
102
102
  border-color: var(--mdc-select-success-border-color);
103
103
  }
104
- :host([help-text-type="error"])::part(base-container) {
104
+ :host([help-text-type='error'])::part(base-container) {
105
105
  border-color: var(--mdc-select-error-border-color);
106
106
  }
107
- :host([help-text-type="warning"])::part(base-container) {
107
+ :host([help-text-type='warning'])::part(base-container) {
108
108
  border-color: var(--mdc-select-warning-border-color);
109
109
  }
110
110
  `;
@@ -1,7 +1,7 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { Provider } from '../../models';
3
- import SideNavigationContext from './sidenavigation.context';
4
3
  import type { SideNavigationVariant } from './sidenavigation.types';
4
+ import SideNavigationContext from './sidenavigation.context';
5
5
  /**
6
6
  * The `mdc-sidenavigation` component provides a vertically stacked navigation experience,
7
7
  * typically used in layouts with persistent or collapsible sidebars.
@@ -90,11 +90,11 @@ declare class SideNavigation extends Provider<SideNavigationContext> {
90
90
  */
91
91
  parentNavTooltipText?: string;
92
92
  /**
93
- * Toggles between true and false when it's variant is flexible.
94
- * @default true
95
- *
96
- * @internal
97
- */
93
+ * Toggles between true and false when it's variant is flexible.
94
+ * @default true
95
+ *
96
+ * @internal
97
+ */
98
98
  private flexibleExpanded;
99
99
  /**
100
100
  * Direction of the arrow icon, if applicable.
@@ -9,13 +9,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { html, nothing } from 'lit';
11
11
  import { property, state } from 'lit/decorators.js';
12
- import styles from './sidenavigation.styles';
13
12
  import { Component, Provider } from '../../models';
14
- import SideNavigationContext from './sidenavigation.context';
15
- import { DEFAULTS, VARIANTS } from './sidenavigation.constants';
16
13
  import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
17
14
  import { DIRECTIONS, DIVIDER_VARIANT, DIVIDER_ORIENTATION } from '../divider/divider.constants';
18
15
  import { ROLE } from '../../utils/roles';
16
+ import { DEFAULTS, VARIANTS } from './sidenavigation.constants';
17
+ import SideNavigationContext from './sidenavigation.context';
18
+ import styles from './sidenavigation.styles';
19
19
  /**
20
20
  * The `mdc-sidenavigation` component provides a vertically stacked navigation experience,
21
21
  * typically used in layouts with persistent or collapsible sidebars.
@@ -87,11 +87,11 @@ class SideNavigation extends Provider {
87
87
  */
88
88
  this.customerName = '';
89
89
  /**
90
- * Toggles between true and false when it's variant is flexible.
91
- * @default true
92
- *
93
- * @internal
94
- */
90
+ * Toggles between true and false when it's variant is flexible.
91
+ * @default true
92
+ *
93
+ * @internal
94
+ */
95
95
  this.flexibleExpanded = this.variant === DEFAULTS.VARIANT;
96
96
  /**
97
97
  * Direction of the arrow icon, if applicable.
@@ -148,9 +148,9 @@ class SideNavigation extends Provider {
148
148
  * Is called on every re-render, see Provider class
149
149
  */
150
150
  updateContext() {
151
- if (this.context.value.variant !== this.variant
152
- || this.context.value.expanded !== this.expanded
153
- || this.context.value.parentNavTooltipText !== this.parentNavTooltipText) {
151
+ if (this.context.value.variant !== this.variant ||
152
+ this.context.value.expanded !== this.expanded ||
153
+ this.context.value.parentNavTooltipText !== this.parentNavTooltipText) {
154
154
  this.context.value.variant = this.variant;
155
155
  this.context.value.expanded = this.expanded;
156
156
  this.context.value.parentNavTooltipText = this.parentNavTooltipText;
@@ -186,30 +186,40 @@ class SideNavigation extends Provider {
186
186
  return html ``;
187
187
  }
188
188
  return html `
189
- <div part="side-navigation-container" id='side-nav-container'>
190
- <div part="scrollable-section">
191
- <slot name="scrollable-section"></slot>
192
- </div>
193
- <mdc-divider variant="gradient" part="separator"></mdc-divider>
194
- <div part="fixed-section">
195
- <slot name="fixed-section"></slot>
196
- <div part="brand-logo-container">
197
- <slot name="brand-logo"></slot>
198
- ${this.expanded ? html `<mdc-text type=${TYPE.BODY_MIDSIZE_MEDIUM} tagname=${VALID_TEXT_TAGS.SPAN}
199
- part="label">${this.customerName}</mdc-text>` : nothing}
200
- </div>
189
+ <div part="side-navigation-container" id="side-nav-container">
190
+ <div part="scrollable-section">
191
+ <slot name="scrollable-section"></slot>
192
+ </div>
193
+ <mdc-divider variant="gradient" part="separator"></mdc-divider>
194
+ <div part="fixed-section">
195
+ <slot name="fixed-section"></slot>
196
+ <div part="brand-logo-container">
197
+ <slot name="brand-logo"></slot>
198
+ ${this.expanded
199
+ ? html `<mdc-text type=${TYPE.BODY_MIDSIZE_MEDIUM} tagname=${VALID_TEXT_TAGS.SPAN} part="label"
200
+ >${this.customerName}</mdc-text
201
+ >`
202
+ : nothing}
201
203
  </div>
202
204
  </div>
203
- ${this.variant === VARIANTS.FLEXIBLE ? html `<mdc-divider
205
+ </div>
206
+ ${this.variant === VARIANTS.FLEXIBLE
207
+ ? html `<mdc-divider
204
208
  orientation=${DIVIDER_ORIENTATION.VERTICAL}
205
209
  variant=${DIVIDER_VARIANT.GRADIENT}
206
210
  arrow-direction=${this.arrowDirection}
207
211
  button-position=${DIRECTIONS.POSITIVE}
208
- > <mdc-button aria-label=${(_a = this.grabberBtnAriaLabel) !== null && _a !== void 0 ? _a : ''} @click=${this.toggleSideNavigation}
209
- aria-expanded="${!!this.expanded}" aria-controls='side-nav-container'
210
- part="grabber-btn"></mdc-button>
211
- </mdc-divider>` : nothing}
212
- `;
212
+ >
213
+ <mdc-button
214
+ aria-label=${(_a = this.grabberBtnAriaLabel) !== null && _a !== void 0 ? _a : ''}
215
+ @click=${this.toggleSideNavigation}
216
+ aria-expanded="${!!this.expanded}"
217
+ aria-controls="side-nav-container"
218
+ part="grabber-btn"
219
+ ></mdc-button>
220
+ </mdc-divider>`
221
+ : nothing}
222
+ `;
213
223
  }
214
224
  }
215
225
  SideNavigation.styles = [...Component.styles, ...styles];
@@ -15,9 +15,9 @@ class SideNavigationContext {
15
15
  if (!id)
16
16
  return false;
17
17
  const siblings = Array.from((_b = (_a = navItem === null || navItem === void 0 ? void 0 : navItem.parentElement) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
18
- return siblings.some((sibling) => sibling !== navItem
19
- && sibling.tagName.toLowerCase() === MENUPOPOVER_TAGNAME
20
- && sibling.getAttribute('triggerid') === id);
18
+ return siblings.some(sibling => sibling !== navItem &&
19
+ sibling.tagName.toLowerCase() === MENUPOPOVER_TAGNAME &&
20
+ sibling.getAttribute('triggerid') === id);
21
21
  }
22
22
  getParentNavItems(navItem) {
23
23
  if (!navItem)
@@ -55,7 +55,7 @@ class SideNavigationContext {
55
55
  this.currentActiveNavItem.removeAttribute('aria-current');
56
56
  this.currentActiveNavItem.removeAttribute('active');
57
57
  const previousParents = this.getParentNavItems(this.currentActiveNavItem);
58
- previousParents.forEach((parent) => {
58
+ previousParents.forEach(parent => {
59
59
  parent.removeAttribute('tooltip-text');
60
60
  parent.removeAttribute('active');
61
61
  });
@@ -67,7 +67,7 @@ class SideNavigationContext {
67
67
  navItem.setAttribute('aria-current', 'page');
68
68
  navItem.setAttribute('active', '');
69
69
  const newParents = this.getParentNavItems(navItem);
70
- newParents.forEach((parent) => {
70
+ newParents.forEach(parent => {
71
71
  parent.setAttribute('tooltip-text', this.parentNavTooltipText || '');
72
72
  parent.setAttribute('tooltip-placement', POPOVER_PLACEMENT.BOTTOM);
73
73
  parent.setAttribute('active', '');
@@ -1,68 +1,68 @@
1
1
  import { css } from 'lit';
2
2
  const styles = css `
3
- :host {
4
- --mdc-sidenavigation-expanded-width: 15rem;
5
- --mdc-sidenavigation-collapsed-width: 4.5rem;
3
+ :host {
4
+ --mdc-sidenavigation-expanded-width: 15rem;
5
+ --mdc-sidenavigation-collapsed-width: 4.5rem;
6
6
 
7
- display: flex;
8
- height: 100%;
9
- }
7
+ display: flex;
8
+ height: 100%;
9
+ }
10
10
 
11
- :host([expanded]) {
12
- width: var(--mdc-sidenavigation-expanded-width);
13
- }
11
+ :host([expanded]) {
12
+ width: var(--mdc-sidenavigation-expanded-width);
13
+ }
14
14
 
15
- :host(:not([expanded])) {
16
- width: var(--mdc-sidenavigation-collapsed-width);
17
- }
15
+ :host(:not([expanded])) {
16
+ width: var(--mdc-sidenavigation-collapsed-width);
17
+ }
18
18
 
19
- :host::part(side-navigation-container) {
20
- display: flex;
21
- flex-direction: column;
22
- width: 100%;
23
- }
19
+ :host::part(side-navigation-container) {
20
+ display: flex;
21
+ flex-direction: column;
22
+ width: 100%;
23
+ }
24
24
 
25
- :host::part(scrollable-section) {
26
- flex-grow: 1;
27
- overflow: auto;
28
- padding: 1rem 0;
29
- min-height: 0;
30
- }
25
+ :host::part(scrollable-section) {
26
+ flex-grow: 1;
27
+ overflow: auto;
28
+ padding: 1rem 0;
29
+ min-height: 0;
30
+ }
31
31
 
32
- :host::part(fixed-section) {
33
- flex-shrink: 0;
34
- display: flex;
35
- flex-direction: column;
36
- align-items: flex-start;
37
- padding-bottom: 1rem;
38
- gap: 0.5rem;
39
- }
32
+ :host::part(fixed-section) {
33
+ flex-shrink: 0;
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: flex-start;
37
+ padding-bottom: 1rem;
38
+ gap: 0.5rem;
39
+ }
40
40
 
41
- :host::part(brand-logo-container) {
42
- display: flex;
43
- align-items: center;
44
- width: 100%;
45
- gap: 0.5rem;
46
- border-radius: 1.25rem;
47
- }
41
+ :host::part(brand-logo-container) {
42
+ display: flex;
43
+ align-items: center;
44
+ width: 100%;
45
+ gap: 0.5rem;
46
+ border-radius: 1.25rem;
47
+ }
48
48
 
49
- :host(:dir(ltr))::part(brand-logo-container) {
50
- padding: 0.5rem 0rem 0.5rem 1.5rem;
51
- }
49
+ :host(:dir(ltr))::part(brand-logo-container) {
50
+ padding: 0.5rem 0rem 0.5rem 1.5rem;
51
+ }
52
52
 
53
- :host(:dir(rtl))::part(brand-logo-container) {
54
- padding: 0.5rem 1.5rem 0.5rem 0rem;
55
- }
53
+ :host(:dir(rtl))::part(brand-logo-container) {
54
+ padding: 0.5rem 1.5rem 0.5rem 0rem;
55
+ }
56
56
 
57
- ::slotted([slot="brand-logo"]) {
58
- width: 1.5rem;
59
- height: 1.5rem;
60
- flex-shrink: 0;
61
- aspect-ratio: 1 / 1;
62
- }
57
+ ::slotted([slot='brand-logo']) {
58
+ width: 1.5rem;
59
+ height: 1.5rem;
60
+ flex-shrink: 0;
61
+ aspect-ratio: 1 / 1;
62
+ }
63
63
 
64
- :host::part(separator) {
65
- margin-bottom: 0.75rem;
66
- }
64
+ :host::part(separator) {
65
+ margin-bottom: 0.75rem;
66
+ }
67
67
  `;
68
68
  export default [styles];
@@ -75,10 +75,7 @@ class Skeleton extends Component {
75
75
  /**
76
76
  * Styles associated with this component.
77
77
  */
78
- Skeleton.styles = [
79
- ...Component.styles,
80
- styles,
81
- ];
78
+ Skeleton.styles = [...Component.styles, styles];
82
79
  __decorate([
83
80
  property({ type: String, reflect: true }),
84
81
  __metadata("design:type", String)
@@ -8,4 +8,4 @@ declare const SKELETON_VARIANTS: {
8
8
  declare const DEFAULTS: {
9
9
  VARIANT: "rectangular";
10
10
  };
11
- export { TAG_NAME, SKELETON_VARIANTS, DEFAULTS, };
11
+ export { TAG_NAME, SKELETON_VARIANTS, DEFAULTS };
@@ -9,4 +9,4 @@ const SKELETON_VARIANTS = {
9
9
  const DEFAULTS = {
10
10
  VARIANT: SKELETON_VARIANTS.RECTANGULAR,
11
11
  };
12
- export { TAG_NAME, SKELETON_VARIANTS, DEFAULTS, };
12
+ export { TAG_NAME, SKELETON_VARIANTS, DEFAULTS };
@@ -11,19 +11,19 @@ const styles = css `
11
11
  width: var(--mdc-skeleton-width);
12
12
  }
13
13
 
14
- :host([variant="rectangular"]) {
14
+ :host([variant='rectangular']) {
15
15
  border-radius: 0.25rem;
16
16
  }
17
17
 
18
- :host([variant="rounded"]) {
18
+ :host([variant='rounded']) {
19
19
  border-radius: 0.5rem;
20
20
  }
21
21
 
22
- :host([variant="circular"]) {
22
+ :host([variant='circular']) {
23
23
  border-radius: 50%;
24
24
  }
25
25
 
26
- :host([variant="button"]) {
26
+ :host([variant='button']) {
27
27
  border-radius: 1.25rem;
28
28
  }
29
29
 
@@ -60,13 +60,13 @@ declare class Spinner extends Component {
60
60
  */
61
61
  ariaLabel: string | null;
62
62
  /**
63
- * There are 2 variants of spinner: default and button. Their coloring is different.
64
- * - **Standalone (Default)**: Track has a blue color.
65
- * - **Button**: To be used when placed in a button to show that the button’s action is currently in progress.
66
- * To ensure a minimum 3:1 contrast ratio, change the active indicator color to be the same color as the button’s
67
- * icon or label text.
68
- * @default standalone
69
- */
63
+ * There are 2 variants of spinner: default and button. Their coloring is different.
64
+ * - **Standalone (Default)**: Track has a blue color.
65
+ * - **Button**: To be used when placed in a button to show that the button’s action is currently in progress.
66
+ * To ensure a minimum 3:1 contrast ratio, change the active indicator color to be the same color as the button’s
67
+ * icon or label text.
68
+ * @default standalone
69
+ */
70
70
  variant: SpinnerVariant;
71
71
  updated(changedProperties: Map<string, any>): void;
72
72
  render(): import("lit-html").TemplateResult<1>;
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { html } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
- import styles from './spinner.styles';
13
12
  import { Component } from '../../models';
14
- import { DEFAULTS } from './spinner.constants';
15
13
  import { ROLE } from '../../utils/roles';
14
+ import styles from './spinner.styles';
15
+ import { DEFAULTS } from './spinner.constants';
16
16
  /**
17
17
  * `mdc-spinner` is loading spinner which is an indeterminate progress indicator, meaning
18
18
  * it's best for cases where the progress or duration of a process is variable or unknown.
@@ -74,13 +74,13 @@ class Spinner extends Component {
74
74
  */
75
75
  this.ariaLabel = null;
76
76
  /**
77
- * There are 2 variants of spinner: default and button. Their coloring is different.
78
- * - **Standalone (Default)**: Track has a blue color.
79
- * - **Button**: To be used when placed in a button to show that the button’s action is currently in progress.
80
- * To ensure a minimum 3:1 contrast ratio, change the active indicator color to be the same color as the button’s
81
- * icon or label text.
82
- * @default standalone
83
- */
77
+ * There are 2 variants of spinner: default and button. Their coloring is different.
78
+ * - **Standalone (Default)**: Track has a blue color.
79
+ * - **Button**: To be used when placed in a button to show that the button’s action is currently in progress.
80
+ * To ensure a minimum 3:1 contrast ratio, change the active indicator color to be the same color as the button’s
81
+ * icon or label text.
82
+ * @default standalone
83
+ */
84
84
  this.variant = DEFAULTS.VARIANT;
85
85
  }
86
86
  updated(changedProperties) {