@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.7 → 0.0.0-pr624.70

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 (138) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +1262 -81
  5. package/components/bibtemplate/dist/registered.js +1262 -81
  6. package/components/checkbox/README.md +1 -1
  7. package/components/checkbox/demo/api.html +16 -10
  8. package/components/checkbox/demo/api.md +47 -14
  9. package/components/checkbox/demo/api.min.js +65 -42
  10. package/components/checkbox/demo/index.html +16 -10
  11. package/components/checkbox/demo/index.md +2 -2
  12. package/components/checkbox/demo/index.min.js +65 -42
  13. package/components/checkbox/demo/readme.html +16 -9
  14. package/components/checkbox/demo/readme.md +1 -1
  15. package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
  16. package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
  17. package/components/checkbox/dist/index.js +65 -42
  18. package/components/checkbox/dist/registered.js +65 -42
  19. package/components/combobox/demo/api.html +16 -10
  20. package/components/combobox/demo/api.md +113 -8
  21. package/components/combobox/demo/api.min.js +3096 -870
  22. package/components/combobox/demo/index.html +16 -10
  23. package/components/combobox/demo/index.md +6 -30
  24. package/components/combobox/demo/index.min.js +3096 -870
  25. package/components/combobox/demo/readme.html +16 -9
  26. package/components/combobox/dist/auro-combobox.d.ts +42 -8
  27. package/components/combobox/dist/index.js +2878 -748
  28. package/components/combobox/dist/registered.js +2878 -748
  29. package/components/counter/demo/api.html +17 -10
  30. package/components/counter/demo/api.md +156 -21
  31. package/components/counter/demo/api.min.js +3363 -652
  32. package/components/counter/demo/index.html +17 -10
  33. package/components/counter/demo/index.md +185 -34
  34. package/components/counter/demo/index.min.js +3363 -652
  35. package/components/counter/demo/readme.html +16 -9
  36. package/components/counter/dist/auro-counter-button.d.ts +2 -0
  37. package/components/counter/dist/auro-counter-group.d.ts +151 -11
  38. package/components/counter/dist/auro-counter.d.ts +16 -0
  39. package/components/counter/dist/helptextVersion.d.ts +2 -0
  40. package/components/counter/dist/iconVersion.d.ts +1 -1
  41. package/components/counter/dist/index.js +3364 -653
  42. package/components/counter/dist/registered.js +3364 -653
  43. package/components/datepicker/demo/api.html +16 -10
  44. package/components/datepicker/demo/api.md +25 -16
  45. package/components/datepicker/demo/api.min.js +11857 -8105
  46. package/components/datepicker/demo/index.html +16 -10
  47. package/components/datepicker/demo/index.md +71 -4
  48. package/components/datepicker/demo/index.min.js +11857 -8105
  49. package/components/datepicker/demo/readme.html +16 -9
  50. package/components/datepicker/dist/auro-datepicker.d.ts +89 -11
  51. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  52. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  53. package/components/datepicker/dist/index.js +8691 -4939
  54. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  55. package/components/datepicker/dist/registered.js +8691 -4939
  56. package/components/dropdown/demo/api.html +16 -10
  57. package/components/dropdown/demo/api.md +81 -274
  58. package/components/dropdown/demo/api.min.js +429 -195
  59. package/components/dropdown/demo/index.html +16 -10
  60. package/components/dropdown/demo/index.md +92 -362
  61. package/components/dropdown/demo/index.min.js +429 -195
  62. package/components/dropdown/demo/readme.html +16 -9
  63. package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
  64. package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
  65. package/components/dropdown/dist/index.js +429 -195
  66. package/components/dropdown/dist/registered.js +429 -195
  67. package/components/form/demo/api.html +16 -9
  68. package/components/form/demo/api.min.js +1 -1
  69. package/components/form/demo/autocomplete.html +19 -3
  70. package/components/form/demo/index.html +16 -9
  71. package/components/form/demo/index.min.js +1 -1
  72. package/components/form/demo/readme.html +16 -9
  73. package/components/form/demo/working.html +19 -13
  74. package/components/form/dist/index.js +1 -1
  75. package/components/form/dist/registered.js +1 -1
  76. package/components/helptext/dist/index.js +2 -2
  77. package/components/helptext/dist/registered.js +2 -2
  78. package/components/input/README.md +5 -2
  79. package/components/input/demo/api.html +16 -10
  80. package/components/input/demo/api.md +228 -130
  81. package/components/input/demo/api.min.js +908 -246
  82. package/components/input/demo/index.html +16 -10
  83. package/components/input/demo/index.md +48 -32
  84. package/components/input/demo/index.min.js +908 -246
  85. package/components/input/demo/readme.html +16 -9
  86. package/components/input/demo/readme.md +5 -2
  87. package/components/input/dist/auro-input.d.ts +3 -3
  88. package/components/input/dist/base-input.d.ts +38 -10
  89. package/components/input/dist/buttonVersion.d.ts +1 -1
  90. package/components/input/dist/iconVersion.d.ts +1 -1
  91. package/components/input/dist/index.js +908 -246
  92. package/components/input/dist/registered.js +908 -246
  93. package/components/layoutElement/dist/index.js +13 -10
  94. package/components/menu/demo/api.html +32 -10
  95. package/components/menu/demo/api.md +69 -8
  96. package/components/menu/demo/api.min.js +238 -47
  97. package/components/menu/demo/index.html +16 -10
  98. package/components/menu/demo/index.min.js +238 -47
  99. package/components/menu/demo/readme.html +16 -9
  100. package/components/menu/dist/auro-menu.d.ts +41 -7
  101. package/components/menu/dist/auro-menuoption.d.ts +15 -3
  102. package/components/menu/dist/iconVersion.d.ts +1 -1
  103. package/components/menu/dist/index.js +238 -47
  104. package/components/menu/dist/registered.js +238 -47
  105. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  106. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  107. package/components/radio/demo/api.html +16 -10
  108. package/components/radio/demo/api.md +7 -8
  109. package/components/radio/demo/api.min.js +88 -90
  110. package/components/radio/demo/index.html +16 -10
  111. package/components/radio/demo/index.min.js +88 -90
  112. package/components/radio/demo/readme.html +16 -9
  113. package/components/radio/dist/auro-radio-group.d.ts +1 -1
  114. package/components/radio/dist/auro-radio.d.ts +9 -12
  115. package/components/radio/dist/index.js +88 -90
  116. package/components/radio/dist/registered.js +88 -90
  117. package/components/select/demo/api.html +16 -10
  118. package/components/select/demo/api.js +0 -2
  119. package/components/select/demo/api.md +104 -57
  120. package/components/select/demo/api.min.js +2148 -635
  121. package/components/select/demo/index.html +17 -11
  122. package/components/select/demo/index.md +45 -158
  123. package/components/select/demo/index.min.js +2148 -623
  124. package/components/select/demo/readme.html +16 -9
  125. package/components/select/dist/auro-select.d.ts +49 -16
  126. package/components/select/dist/index.js +2078 -649
  127. package/components/select/dist/registered.js +2078 -649
  128. package/package.json +30 -27
  129. /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
  130. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
  131. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
  132. /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
  133. /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
  134. /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
  135. /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
  136. /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
  137. /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
  138. /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
@@ -64,11 +64,106 @@ const t$1=globalThis,i$3=t$1.trustedTypes,s$2=i$3?i$3.createPolicy("lit-html",{c
64
64
  * SPDX-License-Identifier: BSD-3-Clause
65
65
  */const s$1=globalThis;let i$2 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}};i$2._$litElement$=true,i$2["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$2});const o$2=s$1.litElementPolyfillSupport;o$2?.({LitElement:i$2});(s$1.litElementVersions??=[]).push("4.2.0");
66
66
 
67
- var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:inline-block;width:100%;margin:0;padding:0;vertical-align:middle}:host ::slotted(auro-menuoption),:host ::slotted([auro-menuoption]),:host auro-menuoption[loadingplaceholder]{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host ::slotted([selected]){padding-left:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host([nocheckmark]) ::slotted(auro-menuoption),:host([nocheckmark]) auro-menuoption[loadingplaceholder]{padding-left:var(--ds-size-200, 1rem)}:host([root]){overflow-y:auto}[loadingplaceholder].empty{opacity:0;position:absolute}[loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}[loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}`;
67
+ var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
68
68
 
69
69
  var colorCss$2 = i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
70
70
 
71
- var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
71
+ var tokensCss$1 = i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
72
+
73
+ let AuroElement$1 = class AuroElement extends i$2 {
74
+ static get properties() {
75
+ return {
76
+
77
+ /**
78
+ * Defines the language of an element.
79
+ * @default {'default'}
80
+ */
81
+ layout: {
82
+ type: String,
83
+ attribute: "layout",
84
+ reflect: true
85
+ },
86
+
87
+ shape: {
88
+ type: String,
89
+ attribute: "shape",
90
+ reflect: true
91
+ },
92
+
93
+ size: {
94
+ type: String,
95
+ attribute: "size",
96
+ reflect: true
97
+ },
98
+
99
+ onDark: {
100
+ type: Boolean,
101
+ attribute: "ondark",
102
+ reflect: true
103
+ }
104
+ };
105
+ }
106
+
107
+ resetShapeClasses() {
108
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
109
+
110
+ if (wrapper) {
111
+ wrapper.classList.forEach((className) => {
112
+ if (className.startsWith('shape-')) {
113
+ wrapper.classList.remove(className);
114
+ }
115
+ });
116
+
117
+ }
118
+
119
+ if (this.shape && this.size) {
120
+ wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
121
+ } else {
122
+ wrapper.classList.add('shape-none');
123
+ }
124
+ }
125
+
126
+ resetLayoutClasses() {
127
+ if (this.layout) {
128
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
129
+
130
+ if (wrapper) {
131
+ wrapper.classList.forEach((className) => {
132
+ if (className.startsWith('layout-')) {
133
+ wrapper.classList.remove(className);
134
+ }
135
+ });
136
+
137
+ wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
138
+ }
139
+ }
140
+ }
141
+
142
+ updateComponentArchitecture() {
143
+ this.resetLayoutClasses();
144
+ this.resetShapeClasses();
145
+ }
146
+
147
+ updated(changedProperties) {
148
+ if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
149
+ this.updateComponentArchitecture();
150
+ }
151
+ }
152
+
153
+ // Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
154
+ // This will catch if an invalid layout value is passed in and render the default layout if so.
155
+ render() {
156
+ try {
157
+ return this.renderLayout();
158
+ } catch (error) {
159
+ // failed to get the defined layout
160
+ console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
161
+
162
+ // fallback to the default layout
163
+ return this.getLayout('default');
164
+ }
165
+ }
166
+ };
72
167
 
73
168
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
74
169
  // See LICENSE in the project root for license information.
@@ -191,7 +286,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
191
286
  * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
192
287
  * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
193
288
  * @attr {boolean} multiselect - When true, the selected option can be multiple options.
194
- * @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
195
289
  * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
196
290
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
197
291
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
@@ -204,14 +298,17 @@ function dispatchMenuEvent(element, eventName, detail = null) {
204
298
  * @slot - Slot for insertion of menu options.
205
299
  */
206
300
 
207
- /* eslint-disable no-magic-numbers, max-lines, no-extra-parens */
301
+ /* eslint-disable no-magic-numbers, max-lines, no-extra-parens, no-inline-comments, line-comment-position */
208
302
 
209
- class AuroMenu extends i$2 {
303
+ class AuroMenu extends AuroElement$1 {
210
304
  constructor() {
211
305
  super();
212
306
 
213
307
  // State properties (reactive)
214
308
 
309
+ this.shape = ""; // box, rounded, pill
310
+ this.size = ""; // md, lg, xl
311
+
215
312
  // Value of the selected options
216
313
  this.value = undefined;
217
314
  // Currently selected option
@@ -270,6 +367,7 @@ class AuroMenu extends i$2 {
270
367
 
271
368
  static get properties() {
272
369
  return {
370
+ ...super.properties,
273
371
  noCheckmark: {
274
372
  type: Boolean,
275
373
  reflect: true,
@@ -300,9 +398,24 @@ class AuroMenu extends i$2 {
300
398
  reflect: true,
301
399
  attribute: 'multiselect'
302
400
  },
401
+
402
+ /**
403
+ * Value selected for the component.
404
+ */
303
405
  value: {
304
- // Allow string, string[] arrays and undefined
305
- type: Object
406
+ type: String,
407
+ reflect: true,
408
+ attribute: 'value'
409
+ },
410
+
411
+ /**
412
+ * Indent level for submenus.
413
+ * @private
414
+ */
415
+ level: {
416
+ type: Number,
417
+ reflect: false,
418
+ attribute: false
306
419
  }
307
420
  };
308
421
  }
@@ -327,6 +440,25 @@ class AuroMenu extends i$2 {
327
440
  AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
328
441
  }
329
442
 
443
+ /**
444
+ * Formatted value based on `multiSelect` state.
445
+ * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
446
+ * @private
447
+ * @returns {String|Array<String>}
448
+ */
449
+ get formattedValue() {
450
+ if (this.multiSelect) {
451
+ if (!this.value) {
452
+ return undefined;
453
+ }
454
+ if (this.value.startsWith("[")) {
455
+ return JSON.parse(this.value);
456
+ }
457
+ return [this.value];
458
+ }
459
+ return this.value;
460
+ }
461
+
330
462
  // Lifecycle Methods
331
463
 
332
464
  connectedCallback() {
@@ -336,6 +468,7 @@ class AuroMenu extends i$2 {
336
468
  this.addEventListener('mousedown', this.handleMouseSelect);
337
469
  this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
338
470
  this.addEventListener('slotchange', this.handleSlotChange);
471
+ this.setTagAttribute("auro-menu");
339
472
  }
340
473
 
341
474
  disconnectedCallback() {
@@ -354,13 +487,27 @@ class AuroMenu extends i$2 {
354
487
  this.initializeMenu();
355
488
  }
356
489
 
490
+ /**
491
+ * Sets an attribute that matches the default tag name if the tag name is not the default.
492
+ * @param {string} tagName - The tag name to set as an attribute.
493
+ * @private
494
+ */
495
+ setTagAttribute(tagName) {
496
+ if (this.tagName.toLowerCase() !== tagName) {
497
+ this.setAttribute(tagName, true);
498
+ }
499
+ }
500
+
357
501
  updated(changedProperties) {
358
- if (changedProperties.has('multiSelect')) {
502
+ super.updated(changedProperties);
503
+
504
+ if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
359
505
  // Reset selection if multiSelect mode changes
360
506
  this.clearSelection();
361
507
  }
362
508
 
363
- if (changedProperties.has('value')) {
509
+
510
+ if (changedProperties.has("value")) {
364
511
  // Handle null/undefined case
365
512
  if (this.value === undefined || this.value === null) {
366
513
  this.optionSelected = undefined;
@@ -368,7 +515,7 @@ class AuroMenu extends i$2 {
368
515
  } else {
369
516
  if (this.multiSelect) {
370
517
  // In multiselect mode, this.value should be an array of strings
371
- const valueArray = Array.isArray(this.value) ? this.value : [this.value];
518
+ const valueArray = this.formattedValue;
372
519
  const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
373
520
 
374
521
  this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
@@ -428,6 +575,19 @@ class AuroMenu extends i$2 {
428
575
  this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]').forEach((element) => element.setAttribute('noCheckmark', ''));
429
576
  }
430
577
 
578
+ // Handle layout propagation to all menus and options
579
+ const propagationTargets = this.querySelectorAll('auro-menu, [auro-menu], auro-menuoption, [auro-menuoption]');
580
+ [
581
+ 'size',
582
+ 'shape'
583
+ ].forEach((prop) => {
584
+ if (changedProperties.has(prop)) {
585
+ propagationTargets.forEach((el) => {
586
+ el.setAttribute(prop, this[prop]);
587
+ });
588
+ }
589
+ });
590
+
431
591
  // Regex for matchWord if needed
432
592
  let regexWord = null;
433
593
 
@@ -522,14 +682,14 @@ class AuroMenu extends i$2 {
522
682
  */
523
683
  handleSelectState(option) {
524
684
  if (this.multiSelect) {
525
- const currentValue = this.value || [];
685
+ const currentValue = this.formattedValue || [];
526
686
  const currentSelected = this.optionSelected || [];
527
687
 
528
688
  if (!currentValue.includes(option.value)) {
529
- this.value = [
689
+ this.value = JSON.stringify([
530
690
  ...currentValue,
531
691
  option.value
532
- ];
692
+ ]);
533
693
  }
534
694
  if (!currentSelected.includes(option)) {
535
695
  this.optionSelected = [
@@ -552,13 +712,15 @@ class AuroMenu extends i$2 {
552
712
  * @param {HTMLElement} option - The menuoption to be deselected.
553
713
  */
554
714
  handleDeselectState(option) {
555
- if (this.multiSelect && Array.isArray(this.value)) {
715
+ if (this.multiSelect) {
556
716
  // Remove this option from array
557
- this.value = this.value.filter((val) => val !== option.value);
717
+ const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
558
718
 
559
719
  // If array is empty after removal, set back to undefined
560
- if (this.value.length === 0) {
720
+ if (newFormattedValue && newFormattedValue.length === 0) {
561
721
  this.value = undefined;
722
+ } else {
723
+ this.value = JSON.stringify(newFormattedValue);
562
724
  }
563
725
 
564
726
  this.optionSelected = this.optionSelected.filter((val) => val !== option);
@@ -624,21 +786,20 @@ class AuroMenu extends i$2 {
624
786
  * @param {HTMLElement} menu - Root menu element.
625
787
  */
626
788
  handleNestedMenus(menu) {
627
- const nestedMenus = menu.querySelectorAll('auro-menu, [auro-menu]');
789
+ menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
628
790
 
629
- nestedMenus.forEach((nestedMenu) => {
630
- // role="listbox" only allows "role=group" for children.
631
- nestedMenu.setAttribute('role', 'group');
632
- if (!nestedMenu.hasAttribute('aria-label')) {
633
- nestedMenu.setAttribute('aria-label', 'submenu');
791
+ if (menu.level > 0) {
792
+ menu.setAttribute('role', 'group');
793
+ menu.removeAttribute("root");
794
+ if (!menu.hasAttribute('aria-label')) {
795
+ menu.setAttribute('aria-label', 'submenu');
634
796
  }
797
+ }
635
798
 
636
- const options = nestedMenu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
637
- options.forEach((option) => {
638
- option.innerHTML = this.nestingSpacer + option.innerHTML;
639
- });
640
-
641
- this.handleNestedMenus(nestedMenu);
799
+ const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
800
+ options.forEach((option) => {
801
+ const regex = new RegExp(this.nestingSpacer, "gu");
802
+ option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
642
803
  });
643
804
  }
644
805
 
@@ -880,22 +1041,33 @@ class AuroMenu extends i$2 {
880
1041
  }
881
1042
 
882
1043
  /**
883
- * Renders the component.
884
- * @returns {boolean} - True if loading slots are present and non-empty.
1044
+ * Logic to determine the layout of the component.
1045
+ * @protected
1046
+ * @returns {void}
885
1047
  */
886
- render() {
1048
+ renderLayout() {
887
1049
  if (this.loading) {
888
1050
  return x`
889
- <auro-menuoption disabled loadingplaceholder class="${this.hasLoadingPlaceholder ? '' : 'empty'}">
890
- <div>
891
- <slot name="loadingIcon"></slot>
892
- <slot name="loadingText"></slot>
893
- </div>
894
- </auro-menuoption>
1051
+ <div class="wrapper">
1052
+ <auro-menuoption
1053
+ disabled
1054
+ loadingplaceholder
1055
+ class="${this.hasLoadingPlaceholder ? "" : "empty"}"
1056
+ >
1057
+ <div>
1058
+ <slot name="loadingIcon"></slot>
1059
+ <slot name="loadingText"></slot>
1060
+ </div>
1061
+ </auro-menuoption>
1062
+ </div>
895
1063
  `;
896
1064
  }
897
1065
 
898
- return x`<slot @slotchange=${this.handleSlotChange}></slot>`;
1066
+ return x`
1067
+ <div class="wrapper">
1068
+ <slot @slotchange=${this.handleSlotChange}></slot>
1069
+ </div>
1070
+ `;
899
1071
  }
900
1072
  }
901
1073
 
@@ -906,9 +1078,9 @@ class AuroMenu extends i$2 {
906
1078
  */
907
1079
  const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i$1=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$1(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
908
1080
 
909
- var styleCss$1 = i$5`:host{display:flex;align-items:center;padding:var(--ds-size-50, 0.25rem) var(--ds-size-200, 1rem) var(--ds-size-50, 0.25rem) 0;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
1081
+ var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
910
1082
 
911
- var colorCss$1 = i$5`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
1083
+ var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
912
1084
 
913
1085
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
914
1086
  // See LICENSE in the project root for license information.
@@ -1315,8 +1487,12 @@ class AuroIcon extends BaseIcon {
1315
1487
  async firstUpdated() {
1316
1488
  await super.firstUpdated();
1317
1489
 
1318
- // Removes the SVG description for screenreader if ariaHidden is set to true
1319
- if (!this.hasAttribute('ariaHidden') && this.svg) {
1490
+ /**
1491
+ * icons provide a description for screen readers. Icon only instances Auro-button
1492
+ * depend on this description to provide context for the user using a screen reader.
1493
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
1494
+ */
1495
+ if (this.hasAttribute('ariaHidden') && this.svg) {
1320
1496
  const svgDesc = this.svg.querySelector('desc');
1321
1497
 
1322
1498
  if (svgDesc) {
@@ -1360,7 +1536,7 @@ class AuroIcon extends BaseIcon {
1360
1536
  }
1361
1537
  }
1362
1538
 
1363
- var iconVersion = '8.0.3';
1539
+ var iconVersion = '8.0.4';
1364
1540
 
1365
1541
  var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
1366
1542
 
@@ -1378,10 +1554,13 @@ var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlin
1378
1554
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
1379
1555
  * @slot - Specifies text for an option, but is not the value.
1380
1556
  */
1381
- class AuroMenuOption extends i$2 {
1557
+ class AuroMenuOption extends AuroElement$1 {
1382
1558
  constructor() {
1383
1559
  super();
1384
1560
 
1561
+ this.size = ""; // md, lg, xl
1562
+ this.shape = ""; // box, rounded, pill
1563
+
1385
1564
  /**
1386
1565
  * Generate unique names for dependency components.
1387
1566
  */
@@ -1405,6 +1584,7 @@ class AuroMenuOption extends i$2 {
1405
1584
 
1406
1585
  static get properties() {
1407
1586
  return {
1587
+ ...super.properties,
1408
1588
  nocheckmark: {
1409
1589
  type: Boolean,
1410
1590
  reflect: true
@@ -1466,6 +1646,8 @@ class AuroMenuOption extends i$2 {
1466
1646
 
1467
1647
  // observer for selected property changes
1468
1648
  updated(changedProperties) {
1649
+ super.updated(changedProperties);
1650
+
1469
1651
  if (changedProperties.has('selected')) {
1470
1652
  this.setAttribute('aria-selected', this.selected.toString());
1471
1653
  }
@@ -1487,10 +1669,19 @@ class AuroMenuOption extends i$2 {
1487
1669
  return u`<${this.iconTag} customColor customSvg slot="icon">${svg}</${this.iconTag}>`;
1488
1670
  }
1489
1671
 
1490
- render() {
1672
+ /**
1673
+ * Logic to determine the layout of the component.
1674
+ * @protected
1675
+ * @returns {void}
1676
+ */
1677
+ renderLayout() {
1491
1678
  return u`
1492
- ${this.selected && !this.nocheckmark ? this.generateIconHtml(checkmarkIcon.svg) : undefined}
1493
- <slot></slot>
1679
+ <div class="wrapper">
1680
+ ${this.selected && !this.nocheckmark
1681
+ ? this.generateIconHtml(checkmarkIcon.svg)
1682
+ : undefined}
1683
+ <slot></slot>
1684
+ </div>
1494
1685
  `;
1495
1686
  }
1496
1687
  }
@@ -16,18 +16,24 @@
16
16
  <head>
17
17
  <meta charset="UTF-8" />
18
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
- <title>Auro Web Component Generator | auro-menu custom element</title>
20
- <link
21
- rel="stylesheet"
22
- type="text/css"
23
- href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"
24
- />
25
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
26
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
19
+ <title>Auro Web Component Demo | auro-menu</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-menu's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
26
+
27
+ <!-- Design Token Alaska Theme -->
28
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
29
+
30
+ <!-- Webcore Stylesheet Alaska Theme -->
31
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
32
+
33
+ <!-- Demo Specific Styles -->
27
34
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
28
35
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
29
- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/essentials-as.css" />
30
- </head>
36
+ </head>
31
37
  <body class="auro-markdown">
32
38
  <main></main>
33
39