@aurodesignsystem/auro-formkit 4.0.0-rc-676.1 → 4.0.0-rc-1002.1

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 (172) hide show
  1. package/CHANGELOG.md +180 -1
  2. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
  3. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  4. package/components/bibtemplate/dist/headerVersion.d.ts +1 -1
  5. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  6. package/components/bibtemplate/dist/index.js +1184 -105
  7. package/components/bibtemplate/dist/registered.js +1184 -105
  8. package/components/checkbox/demo/api.html +16 -10
  9. package/components/checkbox/demo/api.md +52 -17
  10. package/components/checkbox/demo/api.min.js +66 -33
  11. package/components/checkbox/demo/index.html +16 -10
  12. package/components/checkbox/demo/index.min.js +66 -33
  13. package/components/checkbox/demo/readme.html +16 -9
  14. package/components/checkbox/dist/auro-checkbox-group.d.ts +2 -2
  15. package/components/checkbox/dist/auro-checkbox.d.ts +8 -1
  16. package/components/checkbox/dist/index.js +65 -32
  17. package/components/checkbox/dist/registered.js +65 -32
  18. package/components/combobox/README.md +2 -0
  19. package/components/combobox/demo/api.html +16 -10
  20. package/components/combobox/demo/api.md +124 -7
  21. package/components/combobox/demo/api.min.js +4542 -1330
  22. package/components/combobox/demo/index.html +16 -10
  23. package/components/combobox/demo/index.md +108 -4
  24. package/components/combobox/demo/index.min.js +4542 -1330
  25. package/components/combobox/demo/readme.html +16 -9
  26. package/components/combobox/demo/readme.md +2 -0
  27. package/components/combobox/dist/auro-combobox.d.ts +81 -18
  28. package/components/combobox/dist/index.js +4588 -1520
  29. package/components/combobox/dist/registered.js +4588 -1520
  30. package/components/counter/demo/api.html +17 -10
  31. package/components/counter/demo/api.md +167 -21
  32. package/components/counter/demo/api.min.js +3621 -866
  33. package/components/counter/demo/index.html +17 -10
  34. package/components/counter/demo/index.md +191 -34
  35. package/components/counter/demo/index.min.js +3621 -866
  36. package/components/counter/demo/readme.html +16 -9
  37. package/components/counter/dist/auro-counter-button.d.ts +2 -0
  38. package/components/counter/dist/auro-counter-group.d.ts +162 -11
  39. package/components/counter/dist/auro-counter.d.ts +16 -0
  40. package/components/counter/dist/helptextVersion.d.ts +2 -0
  41. package/components/counter/dist/iconVersion.d.ts +1 -1
  42. package/components/counter/dist/index.js +3619 -864
  43. package/components/counter/dist/registered.js +3619 -864
  44. package/components/datepicker/README.md +2 -1
  45. package/components/datepicker/demo/api.html +16 -10
  46. package/components/datepicker/demo/api.md +80 -30
  47. package/components/datepicker/demo/api.min.js +14795 -10365
  48. package/components/datepicker/demo/index.html +16 -10
  49. package/components/datepicker/demo/index.md +96 -4
  50. package/components/datepicker/demo/index.min.js +14795 -10365
  51. package/components/datepicker/demo/readme.html +16 -9
  52. package/components/datepicker/demo/readme.md +2 -1
  53. package/components/datepicker/dist/auro-datepicker.d.ts +163 -4
  54. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  55. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  56. package/components/datepicker/dist/index.js +14916 -10486
  57. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  58. package/components/datepicker/dist/registered.js +14916 -10486
  59. package/components/dropdown/demo/api.html +16 -10
  60. package/components/dropdown/demo/api.md +94 -262
  61. package/components/dropdown/demo/api.min.js +738 -259
  62. package/components/dropdown/demo/index.html +16 -10
  63. package/components/dropdown/demo/index.md +93 -266
  64. package/components/dropdown/demo/index.min.js +738 -259
  65. package/components/dropdown/demo/readme.html +16 -9
  66. package/components/dropdown/dist/auro-dropdown.d.ts +92 -73
  67. package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
  68. package/components/dropdown/dist/index.js +710 -231
  69. package/components/dropdown/dist/registered.js +710 -231
  70. package/components/dropdown/dist/styles/classic/style-css.d.ts +2 -0
  71. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +2 -0
  72. package/components/dropdown/dist/styles/shapeSize-css.d.ts +2 -0
  73. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +2 -0
  74. package/components/form/demo/api.html +16 -9
  75. package/components/form/demo/api.md +1 -1
  76. package/components/form/demo/api.min.js +3 -3
  77. package/components/form/demo/autocomplete.html +19 -3
  78. package/components/form/demo/index.html +16 -9
  79. package/components/form/demo/index.min.js +3 -3
  80. package/components/form/demo/readme.html +16 -9
  81. package/components/form/demo/working.html +19 -13
  82. package/components/form/dist/auro-form.d.ts +1 -1
  83. package/components/form/dist/index.js +2 -2
  84. package/components/form/dist/registered.js +2 -2
  85. package/components/helptext/dist/auro-helptext.d.ts +0 -2
  86. package/components/helptext/dist/index.js +2 -4
  87. package/components/helptext/dist/registered.js +2 -4
  88. package/components/input/README.md +6 -2
  89. package/components/input/demo/api.html +16 -10
  90. package/components/input/demo/api.md +258 -144
  91. package/components/input/demo/api.min.js +1550 -497
  92. package/components/input/demo/index.html +17 -11
  93. package/components/input/demo/index.md +95 -27
  94. package/components/input/demo/index.min.js +1549 -496
  95. package/components/input/demo/readme.html +16 -9
  96. package/components/input/demo/readme.md +6 -2
  97. package/components/input/dist/auro-input.d.ts +139 -3
  98. package/components/input/dist/base-input.d.ts +80 -26
  99. package/components/input/dist/buttonVersion.d.ts +1 -1
  100. package/components/input/dist/iconVersion.d.ts +1 -1
  101. package/components/input/dist/index.js +1504 -451
  102. package/components/input/dist/registered.js +1504 -451
  103. package/components/input/dist/styles/classic/color-css.d.ts +2 -0
  104. package/components/input/dist/styles/classic/style-css.d.ts +2 -0
  105. package/components/input/dist/styles/default/borders-css.d.ts +2 -0
  106. package/components/input/dist/styles/default/color-css.d.ts +2 -0
  107. package/components/input/dist/styles/default/mixins-css.d.ts +2 -0
  108. package/components/input/dist/styles/default/notificationIcons-css.d.ts +2 -0
  109. package/components/input/dist/styles/default/style-css.d.ts +2 -0
  110. package/components/input/dist/styles/emphasized/color-css.d.ts +2 -0
  111. package/components/input/dist/styles/emphasized/style-css.d.ts +2 -0
  112. package/components/input/dist/styles/shapeSize-css.d.ts +2 -0
  113. package/components/input/dist/styles/snowflake/style-css.d.ts +2 -0
  114. package/components/layoutElement/dist/auroElement.d.ts +34 -0
  115. package/components/layoutElement/dist/index.d.ts +2 -0
  116. package/components/layoutElement/dist/index.js +98 -0
  117. package/components/layoutElement/dist/registered.js +98 -0
  118. package/components/menu/demo/api.html +17 -10
  119. package/components/menu/demo/api.md +65 -8
  120. package/components/menu/demo/api.min.js +304 -65
  121. package/components/menu/demo/index.html +16 -10
  122. package/components/menu/demo/index.min.js +304 -65
  123. package/components/menu/demo/readme.html +16 -9
  124. package/components/menu/dist/auro-menu.d.ts +53 -7
  125. package/components/menu/dist/auro-menuoption.d.ts +21 -3
  126. package/components/menu/dist/iconVersion.d.ts +1 -1
  127. package/components/menu/dist/index.js +289 -50
  128. package/components/menu/dist/registered.js +289 -50
  129. package/components/menu/dist/styles/default/color-menu-css.d.ts +2 -0
  130. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
  131. package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
  132. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  133. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  134. package/components/radio/demo/api.html +16 -10
  135. package/components/radio/demo/api.md +41 -9
  136. package/components/radio/demo/api.min.js +93 -95
  137. package/components/radio/demo/index.html +16 -10
  138. package/components/radio/demo/index.min.js +93 -95
  139. package/components/radio/demo/readme.html +16 -9
  140. package/components/radio/dist/auro-radio-group.d.ts +1 -1
  141. package/components/radio/dist/auro-radio.d.ts +11 -12
  142. package/components/radio/dist/index.js +92 -94
  143. package/components/radio/dist/registered.js +92 -94
  144. package/components/select/README.md +1 -0
  145. package/components/select/demo/api.html +16 -10
  146. package/components/select/demo/api.js +0 -2
  147. package/components/select/demo/api.md +156 -114
  148. package/components/select/demo/api.min.js +3126 -657
  149. package/components/select/demo/index.html +17 -10
  150. package/components/select/demo/index.md +398 -62
  151. package/components/select/demo/index.min.js +3129 -648
  152. package/components/select/demo/readme.html +16 -9
  153. package/components/select/demo/readme.md +1 -0
  154. package/components/select/dist/auro-select.d.ts +173 -18
  155. package/components/select/dist/helptextVersion.d.ts +2 -0
  156. package/components/select/dist/index.js +3128 -791
  157. package/components/select/dist/registered.js +3128 -791
  158. package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
  159. package/components/select/dist/styles/tokens-css.d.ts +2 -0
  160. package/package.json +33 -32
  161. package/packages/build-tools/src/postinstall.mjs +0 -12
  162. /package/components/{dropdown/dist/styles/bibColors-css.d.ts → combobox/dist/styles/emphasized/style-css.d.ts} +0 -0
  163. /package/components/{dropdown/dist/styles/bibStyles-css.d.ts → combobox/dist/styles/snowflake/style-css.d.ts} +0 -0
  164. /package/components/{input/dist/styles/borders-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
  165. /package/components/{input/dist/styles/input-css.d.ts → datepicker/dist/styles/classic/color-css.d.ts} +0 -0
  166. /package/components/{input/dist/styles/label-css.d.ts → datepicker/dist/styles/classic/style-css.d.ts} +0 -0
  167. /package/components/{input/dist/styles/notificationIcons-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
  168. /package/components/{menu/dist/styles/color-menu-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
  169. /package/components/{menu/dist/styles/color-menuoption-css.d.ts → datepicker/dist/styles/snowflake/style-css.d.ts} +0 -0
  170. /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
  171. /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
  172. /package/components/{menu/dist/styles/tokens-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
2
- import { LitElement, css, html } from 'lit';
3
2
  import { classMap } from 'lit/directives/class-map.js';
3
+ import { LitElement, css, html } from 'lit';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
5
 
6
6
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
@@ -593,16 +593,22 @@ const flip$1 = function (options) {
593
593
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
594
594
  const nextPlacement = placements[nextIndex];
595
595
  if (nextPlacement) {
596
- // Try next placement and re-run the lifecycle.
597
- return {
598
- data: {
599
- index: nextIndex,
600
- overflows: overflowsData
601
- },
602
- reset: {
603
- placement: nextPlacement
604
- }
605
- };
596
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
597
+ if (!ignoreCrossAxisOverflow ||
598
+ // We leave the current main axis only if every placement on that axis
599
+ // overflows the main axis.
600
+ overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
601
+ // Try next placement and re-run the lifecycle.
602
+ return {
603
+ data: {
604
+ index: nextIndex,
605
+ overflows: overflowsData
606
+ },
607
+ reset: {
608
+ placement: nextPlacement
609
+ }
610
+ };
611
+ }
606
612
  }
607
613
 
608
614
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -1254,6 +1260,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1254
1260
  scrollTop: 0
1255
1261
  };
1256
1262
  const offsets = createCoords(0);
1263
+
1264
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1265
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1266
+ function setLeftRTLScrollbarOffset() {
1267
+ offsets.x = getWindowScrollBarX(documentElement);
1268
+ }
1257
1269
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1258
1270
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1259
1271
  scroll = getNodeScroll(offsetParent);
@@ -1263,11 +1275,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1263
1275
  offsets.x = offsetRect.x + offsetParent.clientLeft;
1264
1276
  offsets.y = offsetRect.y + offsetParent.clientTop;
1265
1277
  } else if (documentElement) {
1266
- // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1267
- // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1268
- offsets.x = getWindowScrollBarX(documentElement);
1278
+ setLeftRTLScrollbarOffset();
1269
1279
  }
1270
1280
  }
1281
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
1282
+ setLeftRTLScrollbarOffset();
1283
+ }
1271
1284
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1272
1285
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1273
1286
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -1444,7 +1457,7 @@ function observeMove(element, onMove) {
1444
1457
  // Handle <iframe>s
1445
1458
  root: root.ownerDocument
1446
1459
  });
1447
- } catch (e) {
1460
+ } catch (_e) {
1448
1461
  io = new IntersectionObserver(handleObserve, options);
1449
1462
  }
1450
1463
  io.observe(element);
@@ -1676,7 +1689,7 @@ class AuroFloatingUI {
1676
1689
  */
1677
1690
  mirrorSize() {
1678
1691
  // mirror the boxsize from bibSizer
1679
- if (this.element.bibSizer) {
1692
+ if (this.element.bibSizer && this.element.matchWidth) {
1680
1693
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
1681
1694
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
1682
1695
  if (sizerStyle.width !== '0px') {
@@ -1812,6 +1825,7 @@ class AuroFloatingUI {
1812
1825
  this.element.bib.style.left = "0px";
1813
1826
  this.element.bib.style.width = '';
1814
1827
  this.element.bib.style.height = '';
1828
+ this.element.style.contain = '';
1815
1829
 
1816
1830
  // reset the size that was mirroring `size` css-part
1817
1831
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
@@ -1836,6 +1850,7 @@ class AuroFloatingUI {
1836
1850
  this.element.bib.style.position = '';
1837
1851
  this.element.bib.removeAttribute('isfullscreen');
1838
1852
  this.element.isBibFullscreen = false;
1853
+ this.element.style.contain = 'layout';
1839
1854
  }
1840
1855
 
1841
1856
  const isChanged = this.strategy && this.strategy !== value;
@@ -1888,22 +1903,16 @@ class AuroFloatingUI {
1888
1903
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
1889
1904
  return;
1890
1905
  }
1891
-
1906
+
1892
1907
  // if fullscreen bib is in fullscreen mode, do not close
1893
1908
  if (this.element.bib.hasAttribute('isfullscreen')) {
1894
1909
  return;
1895
1910
  }
1896
1911
 
1897
- this.hideBib();
1912
+ this.hideBib("keydown");
1898
1913
  }
1899
1914
 
1900
1915
  setupHideHandlers() {
1901
- this.preventFocusLoseOnBibClick = (event) => {
1902
- event.preventDefault();
1903
- event.stopPropagation();
1904
- };
1905
- this.element.bib.addEventListener('mousedown', this.preventFocusLoseOnBibClick);
1906
-
1907
1916
  // Define handlers & store references
1908
1917
  this.focusHandler = () => this.handleFocusLoss();
1909
1918
 
@@ -1919,7 +1928,7 @@ class AuroFloatingUI {
1919
1928
  document.expandedAuroFormkitDropdown = null;
1920
1929
  document.expandedAuroFloater = this;
1921
1930
  } else {
1922
- this.hideBib();
1931
+ this.hideBib("click");
1923
1932
  }
1924
1933
  }
1925
1934
  };
@@ -1932,7 +1941,7 @@ class AuroFloatingUI {
1932
1941
  // if something else is open, let it handle itself
1933
1942
  return;
1934
1943
  }
1935
- this.hideBib();
1944
+ this.hideBib("keydown");
1936
1945
  }
1937
1946
  };
1938
1947
 
@@ -1953,11 +1962,6 @@ class AuroFloatingUI {
1953
1962
  cleanupHideHandlers() {
1954
1963
  // Remove event listeners if they exist
1955
1964
 
1956
- if (this.preventFocusLoseOnBibClick) {
1957
- this.element.bib.removeEventListener('mousedown', this.preventFocusLoseOnBibClick);
1958
- delete this.preventFocusLoseOnBibClick;
1959
- }
1960
-
1961
1965
  if (this.focusHandler) {
1962
1966
  document.removeEventListener('focusin', this.focusHandler);
1963
1967
  this.focusHandler = null;
@@ -2015,7 +2019,11 @@ class AuroFloatingUI {
2015
2019
  }
2016
2020
  }
2017
2021
 
2018
- hideBib() {
2022
+ /**
2023
+ * Hides the floating UI element.
2024
+ * @param {String} eventType - The event type that triggered the hiding action.
2025
+ */
2026
+ hideBib(eventType = "unknown") {
2019
2027
  if (!this.element.disabled && !this.element.noToggle) {
2020
2028
  this.lockScroll(false);
2021
2029
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2026,7 +2034,7 @@ class AuroFloatingUI {
2026
2034
  if (this.showing) {
2027
2035
  this.cleanupHideHandlers();
2028
2036
  this.showing = false;
2029
- this.dispatchEventDropdownToggle();
2037
+ this.dispatchEventDropdownToggle(eventType);
2030
2038
  }
2031
2039
  }
2032
2040
  document.expandedAuroFloater = null;
@@ -2035,11 +2043,13 @@ class AuroFloatingUI {
2035
2043
  /**
2036
2044
  * @private
2037
2045
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2046
+ * @param {String} eventType - The event type that triggered the toggle action.
2038
2047
  */
2039
- dispatchEventDropdownToggle() {
2048
+ dispatchEventDropdownToggle(eventType) {
2040
2049
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2041
2050
  detail: {
2042
2051
  expanded: this.showing,
2052
+ eventType: eventType || "unknown",
2043
2053
  },
2044
2054
  composed: true
2045
2055
  });
@@ -2049,7 +2059,7 @@ class AuroFloatingUI {
2049
2059
 
2050
2060
  handleClick() {
2051
2061
  if (this.element.isPopoverVisible) {
2052
- this.hideBib();
2062
+ this.hideBib("click");
2053
2063
  } else {
2054
2064
  this.showBib();
2055
2065
  }
@@ -2072,8 +2082,9 @@ class AuroFloatingUI {
2072
2082
  // Space is included as it's expected behavior for interactive elements
2073
2083
 
2074
2084
  const origin = event.composedPath()[0];
2075
- if (event.key === 'Enter' || ((!origin || origin.tagName !== "INPUT") && event.key === ' ')) {
2076
- event.preventDefault(); // Prevent page scroll on space
2085
+ if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
2086
+
2087
+ event.preventDefault();
2077
2088
  this.handleClick();
2078
2089
  }
2079
2090
  break;
@@ -2084,7 +2095,7 @@ class AuroFloatingUI {
2084
2095
  break;
2085
2096
  case 'mouseleave':
2086
2097
  if (this.element.hoverToggle) {
2087
- this.hideBib();
2098
+ this.hideBib("mouseleave");
2088
2099
  }
2089
2100
  break;
2090
2101
  case 'focus':
@@ -2227,6 +2238,267 @@ class AuroFloatingUI {
2227
2238
  }
2228
2239
  }
2229
2240
 
2241
+ // Selectors for focusable elements
2242
+ const FOCUSABLE_SELECTORS = [
2243
+ 'a[href]',
2244
+ 'button:not([disabled])',
2245
+ 'textarea:not([disabled])',
2246
+ 'input:not([disabled])',
2247
+ 'select:not([disabled])',
2248
+ '[role="tab"]:not([disabled])',
2249
+ '[role="link"]:not([disabled])',
2250
+ '[role="button"]:not([disabled])',
2251
+ '[tabindex]:not([tabindex="-1"])',
2252
+ '[contenteditable]:not([contenteditable="false"])'
2253
+ ];
2254
+
2255
+ // List of custom components that are known to be focusable
2256
+ const FOCUSABLE_COMPONENTS = [
2257
+ 'auro-checkbox',
2258
+ 'auro-radio',
2259
+ 'auro-dropdown',
2260
+ 'auro-button',
2261
+ 'auro-combobox',
2262
+ 'auro-input',
2263
+ 'auro-counter',
2264
+ 'auro-menu',
2265
+ 'auro-select',
2266
+ 'auro-datepicker',
2267
+ 'auro-hyperlink',
2268
+ 'auro-accordion',
2269
+ ];
2270
+
2271
+ /**
2272
+ * Determines if a given element is a custom focusable component.
2273
+ * Returns true if the element matches a known focusable component and is not disabled.
2274
+ *
2275
+ * @param {HTMLElement} element The element to check for focusability.
2276
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
2277
+ */
2278
+ function isFocusableComponent(element) {
2279
+ const componentName = element.tagName.toLowerCase();
2280
+
2281
+ // Guard Clause: Element is a focusable component
2282
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
2283
+
2284
+ // Guard Clause: Element is not disabled
2285
+ if (element.hasAttribute('disabled')) return false;
2286
+
2287
+ // Guard Clause: The element is a hyperlink and has no href attribute
2288
+ if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
2289
+
2290
+ // If all guard clauses pass, the element is a focusable component
2291
+ return true;
2292
+ }
2293
+
2294
+ /**
2295
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2296
+ * Returns a unique, ordered array of elements that can receive focus.
2297
+ *
2298
+ * @param {HTMLElement} container The container to search within
2299
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2300
+ */
2301
+ function getFocusableElements(container) {
2302
+ // Get elements in DOM order by walking the tree
2303
+ const orderedFocusableElements = [];
2304
+
2305
+ // Define a recursive function to collect focusable elements in DOM order
2306
+ const collectFocusableElements = (root) => {
2307
+ // Check if current element is focusable
2308
+ if (root.nodeType === Node.ELEMENT_NODE) {
2309
+ // Check if this is a custom component that is focusable
2310
+ const isComponentFocusable = isFocusableComponent(root);
2311
+
2312
+ if (isComponentFocusable) {
2313
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
2314
+ orderedFocusableElements.push(root);
2315
+ return; // Skip traversing inside this component
2316
+ }
2317
+
2318
+ // Check if the element itself matches any selector
2319
+ for (const selector of FOCUSABLE_SELECTORS) {
2320
+ if (root.matches?.(selector)) {
2321
+ orderedFocusableElements.push(root);
2322
+ break; // Once we know it's focusable, no need to check other selectors
2323
+ }
2324
+ }
2325
+
2326
+ // Process shadow DOM only for non-Auro components
2327
+ if (root.shadowRoot) {
2328
+ // Process shadow DOM children in order
2329
+ if (root.shadowRoot.children) {
2330
+ Array.from(root.shadowRoot.children).forEach(child => {
2331
+ collectFocusableElements(child);
2332
+ });
2333
+ }
2334
+ }
2335
+
2336
+ // Process slots and their assigned nodes in order
2337
+ if (root.tagName === 'SLOT') {
2338
+ const assignedNodes = root.assignedNodes({ flatten: true });
2339
+ for (const node of assignedNodes) {
2340
+ collectFocusableElements(node);
2341
+ }
2342
+ } else {
2343
+ // Process light DOM children in order
2344
+ if (root.children) {
2345
+ Array.from(root.children).forEach(child => {
2346
+ collectFocusableElements(child);
2347
+ });
2348
+ }
2349
+ }
2350
+ }
2351
+ };
2352
+
2353
+ // Start the traversal from the container
2354
+ collectFocusableElements(container);
2355
+
2356
+ // Remove duplicates that might have been collected through different paths
2357
+ // while preserving order
2358
+ const uniqueElements = [];
2359
+ const seen = new Set();
2360
+
2361
+ for (const element of orderedFocusableElements) {
2362
+ if (!seen.has(element)) {
2363
+ seen.add(element);
2364
+ uniqueElements.push(element);
2365
+ }
2366
+ }
2367
+
2368
+ return uniqueElements;
2369
+ }
2370
+
2371
+ /**
2372
+ * FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
2373
+ * It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
2374
+ */
2375
+ class FocusTrap {
2376
+ /**
2377
+ * Creates a new FocusTrap instance for the given container element.
2378
+ * Initializes event listeners and prepares the container for focus management.
2379
+ *
2380
+ * @param {HTMLElement} container The DOM element to trap focus within.
2381
+ * @throws {Error} If the provided container is not a valid HTMLElement.
2382
+ */
2383
+ constructor(container) {
2384
+ if (!container || !(container instanceof HTMLElement)) {
2385
+ throw new Error("FocusTrap requires a valid HTMLElement.");
2386
+ }
2387
+
2388
+ this.container = container;
2389
+ this.tabDirection = 'forward'; // or 'backward'
2390
+
2391
+ this._init();
2392
+ }
2393
+
2394
+ /**
2395
+ * Initializes the focus trap by setting up event listeners and attributes on the container.
2396
+ * Prepares the container for focus management, including support for shadow DOM and inert attributes.
2397
+ *
2398
+ * @private
2399
+ */
2400
+ _init() {
2401
+
2402
+ // Add inert attribute to prevent focusing programmatically as well (if supported)
2403
+ if ('inert' in HTMLElement.prototype) {
2404
+ this.container.inert = false; // Ensure the container isn't inert
2405
+ this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
2406
+ }
2407
+
2408
+ // Track tab direction
2409
+ this.container.addEventListener('keydown', this._onKeydown);
2410
+ }
2411
+
2412
+ /**
2413
+ * Handles keydown events to manage tab navigation within the container.
2414
+ * Ensures that focus wraps around when reaching the first or last focusable element.
2415
+ *
2416
+ * @param {KeyboardEvent} e The keyboard event triggered by user interaction.
2417
+ * @private
2418
+ */
2419
+ _onKeydown = (e) => {
2420
+
2421
+ if (e.key === 'Tab') {
2422
+
2423
+ // Set the tab direction based on the key pressed
2424
+ this.tabDirection = e.shiftKey ? 'backward' : 'forward';
2425
+
2426
+ // Get the active element(s) in the document and shadow root
2427
+ // This will include the active element in the shadow DOM if it exists
2428
+ // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
2429
+ let activeElement = document.activeElement;
2430
+ const actives = [activeElement];
2431
+ while (activeElement?.shadowRoot?.activeElement) {
2432
+ actives.push(activeElement.shadowRoot.activeElement);
2433
+ activeElement = activeElement.shadowRoot.activeElement;
2434
+ }
2435
+
2436
+ // Update the focusable elements
2437
+ const focusables = this._getFocusableElements();
2438
+
2439
+ // If we're at either end of the focusable elements, wrap around to the other end
2440
+ const focusIndex =
2441
+ (actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
2442
+ ? focusables.length - 1
2443
+ : actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
2444
+ ? 0
2445
+ : null;
2446
+
2447
+ if (focusIndex !== null) {
2448
+ focusables[focusIndex].focus();
2449
+ e.preventDefault(); // Prevent default tab behavior
2450
+ e.stopPropagation(); // Stop the event from bubbling up
2451
+ }
2452
+ }
2453
+ };
2454
+
2455
+ /**
2456
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2457
+ * Returns a unique, ordered array of elements that can receive focus.
2458
+ *
2459
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2460
+ * @private
2461
+ */
2462
+ _getFocusableElements() {
2463
+ // Use the imported utility function to get focusable elements
2464
+ const elements = getFocusableElements(this.container);
2465
+
2466
+ // Filter out any elements with the 'focus-bookend' class
2467
+ return elements;
2468
+ }
2469
+
2470
+ /**
2471
+ * Moves focus to the first focusable element within the container.
2472
+ * Useful for setting initial focus when activating the focus trap.
2473
+ */
2474
+ focusFirstElement() {
2475
+ const focusables = this._getFocusableElements();
2476
+ if (focusables.length) focusables[0].focus();
2477
+ }
2478
+
2479
+ /**
2480
+ * Moves focus to the last focusable element within the container.
2481
+ * Useful for setting focus when deactivating or cycling focus in reverse.
2482
+ */
2483
+ focusLastElement() {
2484
+ const focusables = this._getFocusableElements();
2485
+ if (focusables.length) focusables[focusables.length - 1].focus();
2486
+ }
2487
+
2488
+ /**
2489
+ * Removes event listeners and attributes added by the focus trap.
2490
+ * Call this method to clean up when the focus trap is no longer needed.
2491
+ */
2492
+ disconnect() {
2493
+
2494
+ if (this.container.hasAttribute('data-focus-trap-container')) {
2495
+ this.container.removeAttribute('data-focus-trap-container');
2496
+ }
2497
+
2498
+ this.container.removeEventListener('keydown', this._onKeydown);
2499
+ }
2500
+ }
2501
+
2230
2502
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2231
2503
  // See LICENSE in the project root for license information.
2232
2504
 
@@ -2277,7 +2549,7 @@ class AuroDependencyVersioning {
2277
2549
  * @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
2278
2550
  */
2279
2551
 
2280
- class AuroElement extends LitElement {
2552
+ let AuroElement$1 = class AuroElement extends LitElement {
2281
2553
 
2282
2554
  // function to define props used within the scope of this component
2283
2555
  static get properties() {
@@ -2301,7 +2573,7 @@ class AuroElement extends LitElement {
2301
2573
 
2302
2574
  return 'false'
2303
2575
  }
2304
- }
2576
+ };
2305
2577
 
2306
2578
  var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" 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=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
2307
2579
 
@@ -2345,7 +2617,7 @@ var styleCss$3 = css`:focus:not(:focus-visible){outline:3px solid transparent}.u
2345
2617
  */
2346
2618
 
2347
2619
  // build the component class
2348
- class BaseIcon extends AuroElement {
2620
+ class BaseIcon extends AuroElement$1 {
2349
2621
  constructor() {
2350
2622
  super();
2351
2623
  this.onDark = false;
@@ -2419,7 +2691,7 @@ class BaseIcon extends AuroElement {
2419
2691
 
2420
2692
  var tokensCss$2 = css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
2421
2693
 
2422
- var colorCss$3 = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}`;
2694
+ var colorCss$3 = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
2423
2695
 
2424
2696
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2425
2697
  // See LICENSE in the project root for license information.
@@ -2538,7 +2810,8 @@ class AuroIcon extends BaseIcon {
2538
2810
  * Allows custom color to be set.
2539
2811
  */
2540
2812
  customColor: {
2541
- type: Boolean
2813
+ type: Boolean,
2814
+ reflect: true
2542
2815
  },
2543
2816
 
2544
2817
  /**
@@ -2613,8 +2886,12 @@ class AuroIcon extends BaseIcon {
2613
2886
  async firstUpdated() {
2614
2887
  await super.firstUpdated();
2615
2888
 
2616
- // Removes the SVG description for screenreader if ariaHidden is set to true
2617
- if (!this.hasAttribute('ariaHidden') && this.svg) {
2889
+ /**
2890
+ * icons provide a description for screen readers. Icon only instances Auro-button
2891
+ * depend on this description to provide context for the user using a screen reader.
2892
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
2893
+ */
2894
+ if (this.hasAttribute('ariaHidden') && this.svg) {
2618
2895
  const svgDesc = this.svg.querySelector('desc');
2619
2896
 
2620
2897
  if (svgDesc) {
@@ -2660,11 +2937,11 @@ class AuroIcon extends BaseIcon {
2660
2937
 
2661
2938
  var iconVersion = '6.1.2';
2662
2939
 
2663
- var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}`;
2940
+ var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
2664
2941
 
2665
2942
  var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
2666
2943
 
2667
- var tokensCss$1 = css`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: transparent;--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
2944
+ var tokensCss$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
2668
2945
 
2669
2946
  // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2670
2947
  // See LICENSE in the project root for license information.
@@ -2685,7 +2962,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
2685
2962
  */
2686
2963
 
2687
2964
  class AuroDropdownBib extends LitElement {
2688
-
2965
+ // not extending AuroElement because Bib needs only `shape` prop
2689
2966
  constructor() {
2690
2967
  super();
2691
2968
 
@@ -2695,6 +2972,9 @@ class AuroDropdownBib extends LitElement {
2695
2972
  this._mobileBreakpointValue = undefined;
2696
2973
 
2697
2974
  AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
2975
+
2976
+ this.shape = "rounded";
2977
+ this.matchWidth = false;
2698
2978
  }
2699
2979
 
2700
2980
  static get styles() {
@@ -2732,6 +3012,15 @@ class AuroDropdownBib extends LitElement {
2732
3012
  reflect: true
2733
3013
  },
2734
3014
 
3015
+ /**
3016
+ * If declared, the bib width will match the trigger width.
3017
+ * @private
3018
+ */
3019
+ matchWidth: {
3020
+ type: Boolean,
3021
+ reflect: true
3022
+ },
3023
+
2735
3024
  /**
2736
3025
  * If declared, will apply border-radius to the bib.
2737
3026
  */
@@ -2745,6 +3034,11 @@ class AuroDropdownBib extends LitElement {
2745
3034
  */
2746
3035
  bibTemplate: {
2747
3036
  type: Object
3037
+ },
3038
+
3039
+ shape: {
3040
+ type: String,
3041
+ reflect: true
2748
3042
  }
2749
3043
  };
2750
3044
  }
@@ -2824,8 +3118,16 @@ class AuroDropdownBib extends LitElement {
2824
3118
 
2825
3119
  // function that renders the HTML and CSS into the scope of the component
2826
3120
  render() {
3121
+ const classes = {
3122
+ container: true
3123
+ };
3124
+
3125
+ // Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
3126
+ // mimicking the class naming convention used in AuroElement.resetShapeClasses.
3127
+ classes[`shape-${this.shape}`] = true;
3128
+
2827
3129
  return html$1`
2828
- <div class="container" part="bibContainer">
3130
+ <div class="${classMap(classes)}" part="bibContainer">
2829
3131
  <slot></slot>
2830
3132
  </div>
2831
3133
  `;
@@ -2834,13 +3136,23 @@ class AuroDropdownBib extends LitElement {
2834
3136
 
2835
3137
  var dropdownVersion = '3.0.0';
2836
3138
 
2837
- var styleCss$1 = css`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-line-height, 24px)}.trigger{position:relative;display:flex;align-items:center}.trigger[showBorder]{border-width:1px;border-style:solid;cursor:pointer;outline-style:solid;outline-width:1px}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
3139
+ var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:56px;max-height:56px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:58px;max-height:58px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:56px;max-height:56px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:54px;max-height:54px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-box-lg{min-height:52px;max-height:52px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-box-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-box-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-box-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-box-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-box-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-box-sm{min-height:32px;max-height:32px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-sm.simple{border-width:0px;min-height:36px;max-height:36px;background-color:unset;box-shadow:none}.shape-box-sm.thin{border-width:1px;min-height:34px;max-height:34px;background-color:unset}.shape-box-sm.parentBorder{border:0;box-shadow:unset;min-height:32px;max-height:32px}.shape-box-xs{min-height:20px;max-height:20px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xs.simple{border-width:0px;min-height:24px;max-height:24px;background-color:unset;box-shadow:none}.shape-box-xs.thin{border-width:1px;min-height:22px;max-height:22px;background-color:unset}.shape-box-xs.parentBorder{border:0;box-shadow:unset;min-height:20px;max-height:20px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
3140
+
3141
+ var colorCss$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label,:host([onDark]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
3142
+
3143
+ var styleCss$1 = css`:host{position:relative;display:block}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
2838
3144
 
2839
- var colorCss$1 = css`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color);outline-color:var(--ds-auro-dropdown-trigger-outline-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host([onDark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark]):focus-within,:host([onDark]):active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][common]),:host([onDark][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][common]) .trigger:focus-within,:host([onDark][common]) .trigger:active,:host([onDark][bordered]) .trigger:focus-within,:host([onDark][bordered]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}:host([onDark][error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([onDark][error]) .trigger:focus-within,:host([onDark][error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled][common]),:host([onDark][disabled][bordered]){--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}`;
3145
+ var classicColorCss = css``;
3146
+
3147
+ var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) label{transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}`;
3148
+
3149
+ var styleEmphasizedCss = css`.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
3150
+
3151
+ var styleSnowflakeCss = css`:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .trigger,:host([layout*=snowflake]) .helpText{text-align:center}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
2840
3152
 
2841
3153
  var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
2842
3154
 
2843
- var styleCss = css`.helptext-wrapper{display:none;font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px)}:host([large]) .helptext-wrapper{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-line-height, 24px)}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
3155
+ var styleCss = css`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
2844
3156
 
2845
3157
  var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
2846
3158
 
@@ -2920,8 +3232,6 @@ class AuroLibraryRuntimeUtils {
2920
3232
 
2921
3233
  /**
2922
3234
  * Displays help text or error messages within form elements - Internal Use Only.
2923
- *
2924
- * @attr { Boolean } large - If declared, make font-size to 1rem(16px).
2925
3235
  */
2926
3236
  class AuroHelpText extends LitElement {
2927
3237
 
@@ -3037,7 +3347,7 @@ class AuroHelpText extends LitElement {
3037
3347
  // function that renders the HTML and CSS into the scope of the component
3038
3348
  render() {
3039
3349
  return html`
3040
- <div class="helptext-wrapper" ?visible="${this.hasTextContent}">
3350
+ <div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
3041
3351
  <slot @slotchange=${this.handleSlotChange}></slot>
3042
3352
  </div>
3043
3353
  `;
@@ -3046,24 +3356,119 @@ class AuroHelpText extends LitElement {
3046
3356
 
3047
3357
  var helpTextVersion = '1.0.0';
3048
3358
 
3359
+ class AuroElement extends LitElement {
3360
+ static get properties() {
3361
+ return {
3362
+
3363
+ /**
3364
+ * Defines the language of an element.
3365
+ * @default {'default'}
3366
+ */
3367
+ layout: {
3368
+ type: String,
3369
+ attribute: "layout",
3370
+ reflect: true
3371
+ },
3372
+
3373
+ shape: {
3374
+ type: String,
3375
+ attribute: "shape",
3376
+ reflect: true
3377
+ },
3378
+
3379
+ size: {
3380
+ type: String,
3381
+ attribute: "size",
3382
+ reflect: true
3383
+ },
3384
+
3385
+ onDark: {
3386
+ type: Boolean,
3387
+ attribute: "ondark",
3388
+ reflect: true
3389
+ }
3390
+ };
3391
+ }
3392
+
3393
+ resetShapeClasses() {
3394
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3395
+
3396
+ if (wrapper) {
3397
+ wrapper.classList.forEach((className) => {
3398
+ if (className.startsWith('shape-')) {
3399
+ wrapper.classList.remove(className);
3400
+ }
3401
+ });
3402
+
3403
+ if (this.shape && this.size) {
3404
+ wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3405
+ } else {
3406
+ wrapper.classList.add('shape-none');
3407
+ }
3408
+ }
3409
+
3410
+ }
3411
+
3412
+ resetLayoutClasses() {
3413
+ if (this.layout) {
3414
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3415
+
3416
+ if (wrapper) {
3417
+ wrapper.classList.forEach((className) => {
3418
+ if (className.startsWith('layout-')) {
3419
+ wrapper.classList.remove(className);
3420
+ }
3421
+ });
3422
+
3423
+ wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
3424
+ }
3425
+ }
3426
+ }
3427
+
3428
+ updateComponentArchitecture() {
3429
+ this.resetLayoutClasses();
3430
+ this.resetShapeClasses();
3431
+ }
3432
+
3433
+ updated(changedProperties) {
3434
+ if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
3435
+ this.updateComponentArchitecture();
3436
+ }
3437
+ }
3438
+
3439
+ // Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
3440
+ // This will catch if an invalid layout value is passed in and render the default layout if so.
3441
+ render() {
3442
+ try {
3443
+ return this.renderLayout();
3444
+ } catch (error) {
3445
+ // failed to get the defined layout
3446
+ console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
3447
+
3448
+ // fallback to the default layout
3449
+ return this.getLayout('default');
3450
+ }
3451
+ }
3452
+ }
3453
+
3049
3454
  // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
3050
3455
  // See LICENSE in the project root for license information.
3051
3456
 
3052
3457
 
3053
- /**
3054
- * @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
3458
+
3459
+ /*
3055
3460
  * @slot - Default slot for the popover content.
3056
- * @slot label - Defines the content of the label.
3057
3461
  * @slot helpText - Defines the content of the helpText.
3058
3462
  * @slot trigger - Defines the content of the trigger.
3059
3463
  * @csspart trigger - The trigger content container.
3060
3464
  * @csspart chevron - The collapsed/expanded state icon container.
3465
+ * @csspart size - The size of the dropdown bib. (height, width, maxHeight, maxWidth only)
3061
3466
  * @csspart helpText - The helpText content container.
3062
3467
  * @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
3063
3468
  * @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
3064
3469
  * @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
3065
3470
  */
3066
- class AuroDropdown extends LitElement {
3471
+ class AuroDropdown extends AuroElement {
3067
3472
  constructor() {
3068
3473
  super();
3069
3474
 
@@ -3072,26 +3477,33 @@ class AuroDropdown extends LitElement {
3072
3477
  this.matchWidth = false;
3073
3478
  this.noHideOnThisFocusLoss = false;
3074
3479
 
3075
- this.privateDefaults();
3480
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3076
3481
 
3077
- /**
3078
- * @private
3079
- * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
3080
- */
3081
- this.constructor.shadowRootOptions = {
3082
- ...LitElement.shadowRootOptions,
3083
- delegatesFocus: true,
3084
- };
3482
+ // Layout Config
3483
+ this.layout = undefined;
3484
+ this.shape = undefined;
3485
+ this.size = undefined;
3085
3486
 
3086
- /**
3087
- * @private
3088
- */
3089
- this.triggerContentFocusable = false;
3487
+ this.parentBorder = false;
3090
3488
 
3091
- /**
3092
- * @private
3093
- */
3094
- this.showTriggerBorders = true;
3489
+ /** @private */
3490
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
3491
+
3492
+ this.privateDefaults();
3493
+ }
3494
+
3495
+ /**
3496
+ * @private
3497
+ * @returns {object} Class definition for the wrapper element.
3498
+ */
3499
+ get commonWrapperClasses() {
3500
+ return {
3501
+ 'trigger': true,
3502
+ 'wrapper': true,
3503
+ 'hasFocus': this.hasFocus,
3504
+ 'simple': this.simple,
3505
+ 'parentBorder': this.parentBorder
3506
+ };
3095
3507
  }
3096
3508
 
3097
3509
  /**
@@ -3099,18 +3511,17 @@ class AuroDropdown extends LitElement {
3099
3511
  * @returns {void} Internal defaults.
3100
3512
  */
3101
3513
  privateDefaults() {
3102
- this.bordered = false;
3103
3514
  this.chevron = false;
3104
3515
  this.disabled = false;
3516
+ this.disableFocusTrap = false;
3105
3517
  this.error = false;
3106
- this.inset = false;
3107
- this.rounded = false;
3108
3518
  this.tabIndex = 0;
3109
3519
  this.noToggle = false;
3110
- this.a11yAutocomplete = 'none';
3111
- this.labeled = true;
3112
- this.a11yRole = 'combobox';
3520
+ this.a11yRole = 'button';
3113
3521
  this.onDark = false;
3522
+ this.showTriggerBorders = true;
3523
+ this.triggerContentFocusable = false;
3524
+ this.simple = false;
3114
3525
 
3115
3526
  // floaterConfig
3116
3527
  this.placement = 'bottom-start';
@@ -3118,6 +3529,15 @@ class AuroDropdown extends LitElement {
3118
3529
  this.noFlip = false;
3119
3530
  this.autoPlacement = false;
3120
3531
 
3532
+ /**
3533
+ * @private
3534
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
3535
+ */
3536
+ this.constructor.shadowRootOptions = {
3537
+ ...LitElement.shadowRootOptions,
3538
+ delegatesFocus: true,
3539
+ };
3540
+
3121
3541
  /**
3122
3542
  * @private
3123
3543
  */
@@ -3192,6 +3612,18 @@ class AuroDropdown extends LitElement {
3192
3612
  this.floater.showBib();
3193
3613
  }
3194
3614
 
3615
+ /**
3616
+ * When bib is open, focus on the first element inside of bib.
3617
+ * If not, trigger element will get focus.
3618
+ */
3619
+ focus() {
3620
+ if (this.isPopoverVisible && this.focusTrap) {
3621
+ this.focusTrap.focusFirstElement();
3622
+ } else {
3623
+ this.trigger.focus();
3624
+ }
3625
+ }
3626
+
3195
3627
  // function to define props used within the scope of this component
3196
3628
  static get properties() {
3197
3629
  return {
@@ -3205,10 +3637,19 @@ class AuroDropdown extends LitElement {
3205
3637
  reflect: true
3206
3638
  },
3207
3639
 
3640
+ /**
3641
+ * If declared, the dropdown will only show by calling the API .show() public method.
3642
+ * @default false
3643
+ */
3644
+ disableEventShow: {
3645
+ type: Boolean,
3646
+ reflect: true
3647
+ },
3648
+
3208
3649
  /**
3209
3650
  * If declared, applies a border around the trigger slot.
3210
3651
  */
3211
- bordered: {
3652
+ simple: {
3212
3653
  type: Boolean,
3213
3654
  reflect: true
3214
3655
  },
@@ -3223,17 +3664,17 @@ class AuroDropdown extends LitElement {
3223
3664
  },
3224
3665
 
3225
3666
  /**
3226
- * If declared, the dropdown will be styled with the common theme.
3667
+ * If declared, the dropdown is not interactive.
3227
3668
  */
3228
- common: {
3669
+ disabled: {
3229
3670
  type: Boolean,
3230
3671
  reflect: true
3231
3672
  },
3232
3673
 
3233
3674
  /**
3234
- * If declared, the dropdown is not interactive.
3675
+ * If declared, the focus trap inside of bib will be turned off.
3235
3676
  */
3236
- disabled: {
3677
+ disableFocusTrap: {
3237
3678
  type: Boolean,
3238
3679
  reflect: true
3239
3680
  },
@@ -3256,7 +3697,7 @@ class AuroDropdown extends LitElement {
3256
3697
  },
3257
3698
 
3258
3699
  /**
3259
- * If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
3700
+ * If declared in combination with not using the `simple` property or `helpText` slot content, will apply red color to both.
3260
3701
  */
3261
3702
  error: {
3262
3703
  type: Boolean,
@@ -3264,25 +3705,16 @@ class AuroDropdown extends LitElement {
3264
3705
  },
3265
3706
 
3266
3707
  /**
3267
- * If declared, the bib will display when focus is applied to the trigger.
3708
+ * Contains the help text message for the current validity error.
3268
3709
  */
3269
- focusShow: {
3270
- type: Boolean,
3271
- reflect: true
3272
- },
3273
-
3274
- /**
3275
- * Makes the trigger to be full width of its parent container.
3276
- */
3277
- fluid: {
3278
- type: Boolean,
3279
- reflect: true
3710
+ errorMessage: {
3711
+ type: String
3280
3712
  },
3281
3713
 
3282
3714
  /**
3283
- * If declared, will apply padding around trigger slot content.
3715
+ * If declared, the bib will display when focus is applied to the trigger.
3284
3716
  */
3285
- inset: {
3717
+ focusShow: {
3286
3718
  type: Boolean,
3287
3719
  reflect: true
3288
3720
  },
@@ -3291,7 +3723,9 @@ class AuroDropdown extends LitElement {
3291
3723
  * If true, the dropdown bib is displayed.
3292
3724
  */
3293
3725
  isPopoverVisible: {
3294
- type: Boolean
3726
+ type: Boolean,
3727
+ reflect: true,
3728
+ attribute: 'open'
3295
3729
  },
3296
3730
 
3297
3731
  /**
@@ -3331,10 +3765,10 @@ class AuroDropdown extends LitElement {
3331
3765
  },
3332
3766
 
3333
3767
  /**
3334
- * Defines if there is a label preset.
3768
+ * Defines if the trigger should size based on the parent element providing the border UI.
3335
3769
  * @private
3336
3770
  */
3337
- labeled: {
3771
+ parentBorder: {
3338
3772
  type: Boolean,
3339
3773
  reflect: true
3340
3774
  },
@@ -3390,6 +3824,9 @@ class AuroDropdown extends LitElement {
3390
3824
  reflect: true
3391
3825
  },
3392
3826
 
3827
+ /**
3828
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3829
+ */
3393
3830
  onSlotChange: {
3394
3831
  type: Function,
3395
3832
  reflect: false
@@ -3397,11 +3834,6 @@ class AuroDropdown extends LitElement {
3397
3834
 
3398
3835
  /**
3399
3836
  * Position where the bib should appear relative to the trigger.
3400
- * Accepted values:
3401
- * "top" | "right" | "bottom" | "left" |
3402
- * "bottom-start" | "top-start" | "top-end" |
3403
- * "right-start" | "right-end" | "bottom-end" |
3404
- * "left-start" | "left-end"
3405
3837
  * @default bottom-start
3406
3838
  */
3407
3839
  placement: {
@@ -3409,14 +3841,6 @@ class AuroDropdown extends LitElement {
3409
3841
  reflect: true
3410
3842
  },
3411
3843
 
3412
- /**
3413
- * If declared, will apply border-radius to trigger and default slots.
3414
- */
3415
- rounded: {
3416
- type: Boolean,
3417
- reflect: true
3418
- },
3419
-
3420
3844
  /**
3421
3845
  * @private
3422
3846
  */
@@ -3431,23 +3855,27 @@ class AuroDropdown extends LitElement {
3431
3855
  type: String || undefined,
3432
3856
  attribute: false,
3433
3857
  reflect: false
3434
- },
3435
-
3436
- /**
3437
- * The value for the aria-autocomplete attribute of the trigger element.
3438
- */
3439
- a11yAutocomplete: {
3440
- type: String,
3441
- attribute: false,
3442
3858
  }
3443
3859
  };
3444
3860
  }
3445
3861
 
3446
3862
  static get styles() {
3447
3863
  return [
3448
- colorCss$1,
3449
3864
  styleCss$1,
3450
- tokensCss$1
3865
+ tokensCss$1,
3866
+ colorCss$1,
3867
+
3868
+ // default layout
3869
+ classicColorCss,
3870
+ classicLayoutCss,
3871
+
3872
+ // emphasized layout
3873
+ styleEmphasizedCss,
3874
+
3875
+ // snowflake layout
3876
+ styleSnowflakeCss,
3877
+
3878
+ shapeSizeCss
3451
3879
  ];
3452
3880
  }
3453
3881
 
@@ -3483,6 +3911,7 @@ class AuroDropdown extends LitElement {
3483
3911
  }
3484
3912
 
3485
3913
  updated(changedProperties) {
3914
+ super.updated(changedProperties);
3486
3915
  this.floater.handleUpdate(changedProperties);
3487
3916
 
3488
3917
  // Note: `disabled` is not a breakpoint (it is not a screen size),
@@ -3492,17 +3921,31 @@ class AuroDropdown extends LitElement {
3492
3921
  }
3493
3922
 
3494
3923
  // when trigger's content is changed without any attribute or node change,
3495
- // `requestUpdate` needs to be called to update hasTriggerContnet
3924
+ // `requestUpdate` needs to be called to update hasTriggerContent
3496
3925
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
3497
3926
  this.handleTriggerContentSlotChange();
3498
3927
  }
3928
+ }
3499
3929
 
3930
+ /**
3931
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
3932
+ * @private
3933
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
3934
+ */
3935
+ handleDropdownToggle(event) {
3936
+ this.updateFocusTrap();
3937
+ this.isPopoverVisible = event.detail.expanded;
3938
+ const eventType = event.detail.eventType || "unknown";
3939
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
3940
+ this.trigger.focus();
3941
+ }
3500
3942
  }
3501
3943
 
3502
3944
  firstUpdated() {
3503
3945
 
3504
3946
  // Configure the floater to, this will generate the ID for the bib
3505
3947
  this.floater.configure(this, 'auroDropdown');
3948
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
3506
3949
 
3507
3950
  /**
3508
3951
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -3520,6 +3963,13 @@ class AuroDropdown extends LitElement {
3520
3963
 
3521
3964
  // Add the tag name as an attribute if it is different than the component name
3522
3965
  this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
3966
+
3967
+ this.trigger.addEventListener('click', () => {
3968
+ this.dispatchEvent(new CustomEvent('auroDropdown-triggerClick', {
3969
+ bubbles: true,
3970
+ composed: true
3971
+ }));
3972
+ });
3523
3973
  }
3524
3974
 
3525
3975
  /**
@@ -3554,66 +4004,47 @@ class AuroDropdown extends LitElement {
3554
4004
  }
3555
4005
 
3556
4006
  /**
3557
- * Determines if the element or any children are focusable.
4007
+ * Function to support @focusin event.
3558
4008
  * @private
3559
- * @param {HTMLElement} element - Element to check.
3560
- * @returns {Boolean} - True if the element or any children are focusable.
4009
+ * @return {void}
3561
4010
  */
3562
- containsFocusableElement(element) {
3563
- this.showTriggerBorders = true;
3564
-
3565
- const nodes = [
3566
- element,
3567
- ...element.children
3568
- ];
3569
-
3570
- const focusableElements = [
3571
- 'a',
3572
- 'auro-hyperlink',
3573
- 'button',
3574
- 'auro-button',
3575
- 'input',
3576
- 'auro-input',
3577
- ];
3578
-
3579
- const focusableElementsThatNeedBorders = ['auro-input'];
3580
-
3581
- const result = nodes.some((node) => {
3582
- const tagName = node.tagName.toLowerCase();
3583
-
3584
- if (node.tabIndex > -1) {
3585
- return true;
3586
- }
3587
-
3588
- if (focusableElements.includes(tagName)) {
3589
- if ((tagName === 'a' || tagName === 'auro-hyperlink' || node.hasAttribute('auro-hyperlink')) && node.hasAttribute('href')) {
3590
- return true;
3591
- }
3592
- if (!node.hasAttribute('disabled')) {
3593
- return true;
3594
- }
3595
- }
3596
-
3597
- if (focusableElements.some((focusableElement) => focusableElement.startsWith('auro-') && (focusableElement === tagName || node.hasAttribute(focusableElement)))) {
3598
- return true;
3599
- }
4011
+ handleFocusin() {
4012
+ this.hasFocus = true;
4013
+ }
3600
4014
 
3601
- return false;
3602
- });
4015
+ /**
4016
+ * @private
4017
+ */
4018
+ updateFocusTrap() {
4019
+ // If the dropdown is open, create a focus trap and focus the first element
4020
+ if (this.isPopoverVisible && !this.disableFocusTrap) {
4021
+ this.focusTrap = new FocusTrap(this.bibContent);
4022
+ this.focusTrap.focusFirstElement();
4023
+ return;
4024
+ }
3603
4025
 
3604
- if (result) {
3605
- this.showTriggerBorders = !nodes.some((node) => {
3606
- const tagName = node.tagName.toLowerCase();
3607
- return focusableElements.includes(tagName) && !focusableElementsThatNeedBorders.includes(tagName);
3608
- });
4026
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
4027
+ if (!this.focusTrap) {
4028
+ return;
3609
4029
  }
3610
4030
 
3611
- return result;
4031
+ // If the dropdown is not open, disconnect the focus trap if it exists
4032
+ this.focusTrap.disconnect();
4033
+ this.focusTrap = undefined;
3612
4034
  }
3613
4035
 
3614
4036
  /**
4037
+ * Function to support @focusout event.
3615
4038
  * @private
4039
+ * @return {void}
4040
+ */
4041
+ handleFocusout() {
4042
+ this.hasFocus = false;
4043
+ }
4044
+
4045
+ /**
3616
4046
  * Creates and dispatches a duplicate focus event on the trigger element.
4047
+ * @private
3617
4048
  * @param {Event} event - The original focus event.
3618
4049
  */
3619
4050
  bindFocusEventToTrigger(event) {
@@ -3626,9 +4057,9 @@ class AuroDropdown extends LitElement {
3626
4057
  }
3627
4058
 
3628
4059
  /**
3629
- * @private
3630
4060
  * Sets up event listeners to deliver focus and blur events from nested Auro components within the trigger slot to trigger.
3631
4061
  * This ensures that focus/blur events originating from within these components are propagated to the trigger element itself.
4062
+ * @private
3632
4063
  */
3633
4064
  setupTriggerFocusEventBinding() {
3634
4065
  if (!this.triggerContentSlot || this.triggerContentSlot.length === 0) {
@@ -3704,14 +4135,13 @@ class AuroDropdown extends LitElement {
3704
4135
  * @returns {void}
3705
4136
  */
3706
4137
  handleTriggerContentSlotChange(event) {
3707
-
3708
4138
  this.floater.handleTriggerTabIndex();
3709
4139
 
3710
4140
  // Get the trigger
3711
4141
  const trigger = this.shadowRoot.querySelector('#trigger');
3712
4142
 
3713
4143
  // Get the trigger slot
3714
- const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
4144
+ const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
3715
4145
 
3716
4146
  // If there's a trigger slot
3717
4147
  if (triggerSlot) {
@@ -3722,8 +4152,8 @@ class AuroDropdown extends LitElement {
3722
4152
  // If there are children
3723
4153
  if (triggerContentNodes) {
3724
4154
 
3725
- // See if any of them are focusable elemeents
3726
- this.triggerContentFocusable = triggerContentNodes.some((node) => this.containsFocusableElement(node));
4155
+ // See if any of them are focusable elements
4156
+ this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
3727
4157
 
3728
4158
  // If any of them are focusable elements
3729
4159
  if (this.triggerContentFocusable) {
@@ -3774,7 +4204,6 @@ class AuroDropdown extends LitElement {
3774
4204
  *
3775
4205
  * @private
3776
4206
  * @method handleDefaultSlot
3777
- * @param {Event} event - The event object representing the slot change.
3778
4207
  * @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
3779
4208
  */
3780
4209
  handleDefaultSlot() {
@@ -3785,56 +4214,33 @@ class AuroDropdown extends LitElement {
3785
4214
  }
3786
4215
 
3787
4216
  /**
4217
+ * Returns HTML for the common portion of the layouts.
3788
4218
  * @private
3789
- * @method handleLabelSlotChange
3790
- * @param {event} event - The event object representing the slot change.
3791
- * @description Handles the slot change event for the label slot.
4219
+ * @param {Object} helpTextClasses - Classes to apply to the help text container.
4220
+ * @returns {html} - Returns HTML.
3792
4221
  */
3793
- handleLabelSlotChange (event) {
3794
-
3795
- // Get the nodes from the event
3796
- const nodes = event.target.assignedNodes();
3797
-
3798
- // Guard clause for no nodes
3799
- if (!nodes) {
3800
- return;
3801
- }
3802
-
3803
- // Convert the nodes to a measurable array so we can get the length
3804
- const nodesArr = Array.from(nodes);
3805
-
3806
- // If the nodes array has a length, the dropdown is labeled
3807
- this.labeled = nodesArr.length > 0;
3808
- }
3809
-
3810
- // function that renders the HTML and CSS into the scope of the component
3811
- render() {
4222
+ renderBasicHtml(helpTextClasses) {
3812
4223
  return html$1`
3813
4224
  <div>
3814
4225
  <div
3815
4226
  id="trigger"
3816
- class="trigger"
3817
- part="trigger"
3818
- tabindex="${this.tabIndex}"
3819
- ?showBorder="${this.showTriggerBorders}"
4227
+ class="${classMap(this.commonWrapperClasses)}" part="wrapper"
4228
+ tabindex="${ifDefined(this.triggerContentFocusable ? undefined : this.tabIndex)}"
3820
4229
  role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
3821
- aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
3822
- aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
4230
+ aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4231
+ aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
3823
4232
  aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
3824
- >
3825
- <div class="triggerContentWrapper">
3826
- <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
3827
- <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
3828
- </label>
3829
- <div class="triggerContent">
3830
- <slot
3831
- name="trigger"
3832
- @slotchange="${this.handleTriggerContentSlotChange}"></slot>
3833
- </div>
4233
+ @focusin="${this.handleFocusin}"
4234
+ @blur="${this.handleFocusOut}">
4235
+ <div class="triggerContentWrapper" id="triggerLabel">
4236
+ <slot
4237
+ name="trigger"
4238
+ @slotchange="${this.handleTriggerContentSlotChange}"></slot>
3834
4239
  </div>
3835
- ${this.chevron || this.common ? html$1`
4240
+ ${this.chevron ? html$1`
3836
4241
  <div
3837
4242
  id="showStateIcon"
4243
+ class="chevron"
3838
4244
  part="chevron">
3839
4245
  <${this.iconTag}
3840
4246
  category="interface"
@@ -3846,19 +4252,15 @@ class AuroDropdown extends LitElement {
3846
4252
  </div>
3847
4253
  ` : undefined }
3848
4254
  </div>
3849
- <${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
4255
+ <div class="${classMap(helpTextClasses)}">
3850
4256
  <slot name="helpText"></slot>
3851
- </${this.helpTextTag}>
3852
-
4257
+ </div>
3853
4258
  <div id="bibSizer" part="size"></div>
3854
4259
  <${this.dropdownBibTag}
3855
4260
  id="bib"
4261
+ shape="${this.shape}"
3856
4262
  ?data-show="${this.isPopoverVisible}"
3857
- ?isfullscreen="${this.isBibFullscreen}"
3858
- ?common="${this.common}"
3859
- ?rounded="${this.common || this.rounded}"
3860
- ?inset="${this.common || this.inset}"
3861
- >
4263
+ ?isfullscreen="${this.isBibFullscreen}">
3862
4264
  <div class="slotContent">
3863
4265
  <slot @slotchange="${this.handleDefaultSlot}"></slot>
3864
4266
  </div>
@@ -3866,6 +4268,83 @@ class AuroDropdown extends LitElement {
3866
4268
  </div>
3867
4269
  `;
3868
4270
  }
4271
+
4272
+ /**
4273
+ * Returns HTML for the classic layout. Does not support type="*".
4274
+ * @private
4275
+ * @returns {html} - Returns HTML for the classic layout.
4276
+ */
4277
+ renderLayoutClassic() {
4278
+ // TODO: check with Doug why this was never used?
4279
+ const helpTextClasses = {
4280
+ 'helpText': true
4281
+ };
4282
+
4283
+ return html$1`
4284
+ ${this.renderBasicHtml(helpTextClasses)}
4285
+ `;
4286
+ }
4287
+
4288
+ /**
4289
+ * Returns HTML for the snowflake layout. Does not support type="*".
4290
+ * @private
4291
+ * @returns {html} - Returns HTML for the snowflake layout.
4292
+ */
4293
+ renderLayoutSnowflake() {
4294
+ const helpTextClasses = {
4295
+ 'helpText': true,
4296
+ 'leftIndent': true,
4297
+ 'rightIndent': true
4298
+ };
4299
+
4300
+ return html$1`
4301
+ ${this.renderBasicHtml(helpTextClasses)}
4302
+ `;
4303
+ }
4304
+
4305
+ /**
4306
+ * Returns HTML for the emphasized layout. Does not support type="*".
4307
+ * @private
4308
+ * @returns {html} - Returns HTML for the emphasized layout.
4309
+ */
4310
+ renderLayoutEmphasized() {
4311
+ const helpTextClasses = {
4312
+ 'helpText': true,
4313
+ 'leftIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('right'),
4314
+ 'rightIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('left')
4315
+ };
4316
+
4317
+ return html$1`
4318
+ ${this.renderBasicHtml(helpTextClasses)}
4319
+ `;
4320
+ }
4321
+
4322
+ /**
4323
+ * Logic to determine the layout of the component.
4324
+ * @private
4325
+ * @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
4326
+ * @returns {HTMLCollection} - Returns the HTML for the layout.
4327
+ */
4328
+ renderLayout(ForcedLayout) {
4329
+ const layout = ForcedLayout || this.layout;
4330
+
4331
+ switch (layout) {
4332
+ case 'emphasized':
4333
+ return this.renderLayoutEmphasized();
4334
+ case 'emphasized-left':
4335
+ return this.renderLayoutEmphasized();
4336
+ case 'emphasized-right':
4337
+ return this.renderLayoutEmphasized();
4338
+ case 'snowflake':
4339
+ return this.renderLayoutSnowflake();
4340
+ case 'snowflake-left':
4341
+ return this.renderLayoutSnowflake();
4342
+ case 'snowflake-right':
4343
+ return this.renderLayoutSnowflake();
4344
+ default:
4345
+ return this.renderLayoutClassic();
4346
+ }
4347
+ }
3869
4348
  }
3870
4349
 
3871
4350
  export { AuroDropdown };