@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.6 → 0.0.0-pr624.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +1214 -83
  5. package/components/bibtemplate/dist/registered.js +1214 -83
  6. package/components/checkbox/README.md +1 -1
  7. package/components/checkbox/demo/api.html +16 -10
  8. package/components/checkbox/demo/api.md +47 -14
  9. package/components/checkbox/demo/api.min.js +65 -42
  10. package/components/checkbox/demo/index.html +16 -10
  11. package/components/checkbox/demo/index.md +2 -2
  12. package/components/checkbox/demo/index.min.js +65 -42
  13. package/components/checkbox/demo/readme.html +16 -9
  14. package/components/checkbox/demo/readme.md +1 -1
  15. package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
  16. package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
  17. package/components/checkbox/dist/index.js +65 -42
  18. package/components/checkbox/dist/registered.js +65 -42
  19. package/components/combobox/demo/api.html +16 -10
  20. package/components/combobox/demo/api.md +113 -8
  21. package/components/combobox/demo/api.min.js +3052 -926
  22. package/components/combobox/demo/index.html +16 -10
  23. package/components/combobox/demo/index.md +6 -30
  24. package/components/combobox/demo/index.min.js +3052 -926
  25. package/components/combobox/demo/readme.html +16 -9
  26. package/components/combobox/dist/auro-combobox.d.ts +42 -8
  27. package/components/combobox/dist/index.js +2773 -743
  28. package/components/combobox/dist/registered.js +2773 -743
  29. package/components/counter/demo/api.html +17 -10
  30. package/components/counter/demo/api.md +156 -21
  31. package/components/counter/demo/api.min.js +6728 -4118
  32. package/components/counter/demo/index.html +17 -10
  33. package/components/counter/demo/index.md +185 -34
  34. package/components/counter/demo/index.min.js +6728 -4118
  35. package/components/counter/demo/readme.html +16 -9
  36. package/components/counter/dist/auro-counter-button.d.ts +2 -0
  37. package/components/counter/dist/auro-counter-group.d.ts +151 -11
  38. package/components/counter/dist/auro-counter.d.ts +16 -0
  39. package/components/counter/dist/helptextVersion.d.ts +2 -0
  40. package/components/counter/dist/iconVersion.d.ts +1 -1
  41. package/components/counter/dist/index.js +6728 -4118
  42. package/components/counter/dist/registered.js +6728 -4118
  43. package/components/datepicker/demo/api.html +16 -10
  44. package/components/datepicker/demo/api.md +25 -16
  45. package/components/datepicker/demo/api.min.js +11540 -7985
  46. package/components/datepicker/demo/index.html +16 -10
  47. package/components/datepicker/demo/index.md +71 -4
  48. package/components/datepicker/demo/index.min.js +11540 -7985
  49. package/components/datepicker/demo/readme.html +16 -9
  50. package/components/datepicker/dist/auro-datepicker.d.ts +89 -11
  51. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  52. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  53. package/components/datepicker/dist/index.js +11603 -8048
  54. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  55. package/components/datepicker/dist/registered.js +11603 -8048
  56. package/components/dropdown/demo/api.html +16 -10
  57. package/components/dropdown/demo/api.md +81 -274
  58. package/components/dropdown/demo/api.min.js +429 -195
  59. package/components/dropdown/demo/index.html +16 -10
  60. package/components/dropdown/demo/index.md +92 -362
  61. package/components/dropdown/demo/index.min.js +429 -195
  62. package/components/dropdown/demo/readme.html +16 -9
  63. package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
  64. package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
  65. package/components/dropdown/dist/index.js +429 -195
  66. package/components/dropdown/dist/registered.js +429 -195
  67. package/components/form/demo/api.html +16 -9
  68. package/components/form/demo/api.min.js +1 -1
  69. package/components/form/demo/autocomplete.html +19 -3
  70. package/components/form/demo/index.html +16 -9
  71. package/components/form/demo/index.min.js +1 -1
  72. package/components/form/demo/readme.html +16 -9
  73. package/components/form/demo/working.html +19 -13
  74. package/components/form/dist/index.js +1 -1
  75. package/components/form/dist/registered.js +1 -1
  76. package/components/helptext/dist/index.js +2 -2
  77. package/components/helptext/dist/registered.js +2 -2
  78. package/components/input/README.md +5 -2
  79. package/components/input/demo/api.html +16 -10
  80. package/components/input/demo/api.md +228 -130
  81. package/components/input/demo/api.min.js +853 -241
  82. package/components/input/demo/index.html +16 -10
  83. package/components/input/demo/index.md +48 -32
  84. package/components/input/demo/index.min.js +853 -241
  85. package/components/input/demo/readme.html +16 -9
  86. package/components/input/demo/readme.md +5 -2
  87. package/components/input/dist/auro-input.d.ts +3 -3
  88. package/components/input/dist/base-input.d.ts +38 -10
  89. package/components/input/dist/buttonVersion.d.ts +1 -1
  90. package/components/input/dist/iconVersion.d.ts +1 -1
  91. package/components/input/dist/index.js +853 -241
  92. package/components/input/dist/registered.js +853 -241
  93. package/components/layoutElement/dist/index.js +13 -10
  94. package/components/menu/demo/api.html +32 -10
  95. package/components/menu/demo/api.md +69 -8
  96. package/components/menu/demo/api.min.js +238 -47
  97. package/components/menu/demo/index.html +16 -10
  98. package/components/menu/demo/index.min.js +238 -47
  99. package/components/menu/demo/readme.html +16 -9
  100. package/components/menu/dist/auro-menu.d.ts +41 -7
  101. package/components/menu/dist/auro-menuoption.d.ts +15 -3
  102. package/components/menu/dist/iconVersion.d.ts +1 -1
  103. package/components/menu/dist/index.js +238 -47
  104. package/components/menu/dist/registered.js +238 -47
  105. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  106. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  107. package/components/radio/demo/api.html +16 -10
  108. package/components/radio/demo/api.md +7 -8
  109. package/components/radio/demo/api.min.js +88 -90
  110. package/components/radio/demo/index.html +16 -10
  111. package/components/radio/demo/index.min.js +88 -90
  112. package/components/radio/demo/readme.html +16 -9
  113. package/components/radio/dist/auro-radio-group.d.ts +1 -1
  114. package/components/radio/dist/auro-radio.d.ts +9 -12
  115. package/components/radio/dist/index.js +88 -90
  116. package/components/radio/dist/registered.js +88 -90
  117. package/components/select/demo/api.html +16 -10
  118. package/components/select/demo/api.js +0 -2
  119. package/components/select/demo/api.md +104 -57
  120. package/components/select/demo/api.min.js +2123 -644
  121. package/components/select/demo/index.html +16 -11
  122. package/components/select/demo/index.md +45 -158
  123. package/components/select/demo/index.min.js +2123 -632
  124. package/components/select/demo/readme.html +16 -9
  125. package/components/select/dist/auro-select.d.ts +57 -16
  126. package/components/select/dist/index.js +2047 -652
  127. package/components/select/dist/registered.js +2047 -652
  128. package/package.json +29 -26
  129. /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
  130. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
  131. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
  132. /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
  133. /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
  134. /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
  135. /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
  136. /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
  137. /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
  138. /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
@@ -1689,7 +1689,7 @@ class AuroFloatingUI {
1689
1689
  */
1690
1690
  mirrorSize() {
1691
1691
  // mirror the boxsize from bibSizer
1692
- if (this.element.bibSizer) {
1692
+ if (this.element.bibSizer && this.element.matchWidth) {
1693
1693
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
1694
1694
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
1695
1695
  if (sizerStyle.width !== '0px') {
@@ -1901,13 +1901,13 @@ class AuroFloatingUI {
1901
1901
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
1902
1902
  return;
1903
1903
  }
1904
-
1904
+
1905
1905
  // if fullscreen bib is in fullscreen mode, do not close
1906
1906
  if (this.element.bib.hasAttribute('isfullscreen')) {
1907
1907
  return;
1908
1908
  }
1909
1909
 
1910
- this.hideBib();
1910
+ this.hideBib("keydown");
1911
1911
  }
1912
1912
 
1913
1913
  setupHideHandlers() {
@@ -1932,7 +1932,7 @@ class AuroFloatingUI {
1932
1932
  document.expandedAuroFormkitDropdown = null;
1933
1933
  document.expandedAuroFloater = this;
1934
1934
  } else {
1935
- this.hideBib();
1935
+ this.hideBib("click");
1936
1936
  }
1937
1937
  }
1938
1938
  };
@@ -1945,7 +1945,7 @@ class AuroFloatingUI {
1945
1945
  // if something else is open, let it handle itself
1946
1946
  return;
1947
1947
  }
1948
- this.hideBib();
1948
+ this.hideBib("keydown");
1949
1949
  }
1950
1950
  };
1951
1951
 
@@ -2028,7 +2028,11 @@ class AuroFloatingUI {
2028
2028
  }
2029
2029
  }
2030
2030
 
2031
- hideBib() {
2031
+ /**
2032
+ * Hides the floating UI element.
2033
+ * @param {String} eventType - The event type that triggered the hiding action.
2034
+ */
2035
+ hideBib(eventType = "unknown") {
2032
2036
  if (!this.element.disabled && !this.element.noToggle) {
2033
2037
  this.lockScroll(false);
2034
2038
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2039,7 +2043,7 @@ class AuroFloatingUI {
2039
2043
  if (this.showing) {
2040
2044
  this.cleanupHideHandlers();
2041
2045
  this.showing = false;
2042
- this.dispatchEventDropdownToggle();
2046
+ this.dispatchEventDropdownToggle(eventType);
2043
2047
  }
2044
2048
  }
2045
2049
  document.expandedAuroFloater = null;
@@ -2048,11 +2052,13 @@ class AuroFloatingUI {
2048
2052
  /**
2049
2053
  * @private
2050
2054
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2055
+ * @param {String} eventType - The event type that triggered the toggle action.
2051
2056
  */
2052
- dispatchEventDropdownToggle() {
2057
+ dispatchEventDropdownToggle(eventType) {
2053
2058
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2054
2059
  detail: {
2055
2060
  expanded: this.showing,
2061
+ eventType: eventType || "unknown",
2056
2062
  },
2057
2063
  composed: true
2058
2064
  });
@@ -2062,7 +2068,7 @@ class AuroFloatingUI {
2062
2068
 
2063
2069
  handleClick() {
2064
2070
  if (this.element.isPopoverVisible) {
2065
- this.hideBib();
2071
+ this.hideBib("click");
2066
2072
  } else {
2067
2073
  this.showBib();
2068
2074
  }
@@ -2085,8 +2091,9 @@ class AuroFloatingUI {
2085
2091
  // Space is included as it's expected behavior for interactive elements
2086
2092
 
2087
2093
  const origin = event.composedPath()[0];
2088
- if (event.key === 'Enter' || ((!origin || origin.tagName !== "INPUT") && event.key === ' ')) {
2089
- event.preventDefault(); // Prevent page scroll on space
2094
+ if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
2095
+
2096
+ event.preventDefault();
2090
2097
  this.handleClick();
2091
2098
  }
2092
2099
  break;
@@ -2097,7 +2104,7 @@ class AuroFloatingUI {
2097
2104
  break;
2098
2105
  case 'mouseleave':
2099
2106
  if (this.element.hoverToggle) {
2100
- this.hideBib();
2107
+ this.hideBib("mouseleave");
2101
2108
  }
2102
2109
  break;
2103
2110
  case 'focus':
@@ -2240,6 +2247,267 @@ class AuroFloatingUI {
2240
2247
  }
2241
2248
  }
2242
2249
 
2250
+ // Selectors for focusable elements
2251
+ const FOCUSABLE_SELECTORS = [
2252
+ 'a[href]',
2253
+ 'button:not([disabled])',
2254
+ 'textarea:not([disabled])',
2255
+ 'input:not([disabled])',
2256
+ 'select:not([disabled])',
2257
+ '[role="tab"]:not([disabled])',
2258
+ '[role="link"]:not([disabled])',
2259
+ '[role="button"]:not([disabled])',
2260
+ '[tabindex]:not([tabindex="-1"])',
2261
+ '[contenteditable]:not([contenteditable="false"])'
2262
+ ];
2263
+
2264
+ // List of custom components that are known to be focusable
2265
+ const FOCUSABLE_COMPONENTS = [
2266
+ 'auro-checkbox',
2267
+ 'auro-radio',
2268
+ 'auro-dropdown',
2269
+ 'auro-button',
2270
+ 'auro-combobox',
2271
+ 'auro-input',
2272
+ 'auro-counter',
2273
+ 'auro-menu',
2274
+ 'auro-select',
2275
+ 'auro-datepicker',
2276
+ 'auro-hyperlink',
2277
+ 'auro-accordion',
2278
+ ];
2279
+
2280
+ /**
2281
+ * Determines if a given element is a custom focusable component.
2282
+ * Returns true if the element matches a known focusable component and is not disabled.
2283
+ *
2284
+ * @param {HTMLElement} element The element to check for focusability.
2285
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
2286
+ */
2287
+ function isFocusableComponent(element) {
2288
+ const componentName = element.tagName.toLowerCase();
2289
+
2290
+ // Guard Clause: Element is a focusable component
2291
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
2292
+
2293
+ // Guard Clause: Element is not disabled
2294
+ if (element.hasAttribute('disabled')) return false;
2295
+
2296
+ // Guard Clause: The element is a hyperlink and has no href attribute
2297
+ if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
2298
+
2299
+ // If all guard clauses pass, the element is a focusable component
2300
+ return true;
2301
+ }
2302
+
2303
+ /**
2304
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2305
+ * Returns a unique, ordered array of elements that can receive focus.
2306
+ *
2307
+ * @param {HTMLElement} container The container to search within
2308
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2309
+ */
2310
+ function getFocusableElements(container) {
2311
+ // Get elements in DOM order by walking the tree
2312
+ const orderedFocusableElements = [];
2313
+
2314
+ // Define a recursive function to collect focusable elements in DOM order
2315
+ const collectFocusableElements = (root) => {
2316
+ // Check if current element is focusable
2317
+ if (root.nodeType === Node.ELEMENT_NODE) {
2318
+ // Check if this is a custom component that is focusable
2319
+ const isComponentFocusable = isFocusableComponent(root);
2320
+
2321
+ if (isComponentFocusable) {
2322
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
2323
+ orderedFocusableElements.push(root);
2324
+ return; // Skip traversing inside this component
2325
+ }
2326
+
2327
+ // Check if the element itself matches any selector
2328
+ for (const selector of FOCUSABLE_SELECTORS) {
2329
+ if (root.matches?.(selector)) {
2330
+ orderedFocusableElements.push(root);
2331
+ break; // Once we know it's focusable, no need to check other selectors
2332
+ }
2333
+ }
2334
+
2335
+ // Process shadow DOM only for non-Auro components
2336
+ if (root.shadowRoot) {
2337
+ // Process shadow DOM children in order
2338
+ if (root.shadowRoot.children) {
2339
+ Array.from(root.shadowRoot.children).forEach(child => {
2340
+ collectFocusableElements(child);
2341
+ });
2342
+ }
2343
+ }
2344
+
2345
+ // Process slots and their assigned nodes in order
2346
+ if (root.tagName === 'SLOT') {
2347
+ const assignedNodes = root.assignedNodes({ flatten: true });
2348
+ for (const node of assignedNodes) {
2349
+ collectFocusableElements(node);
2350
+ }
2351
+ } else {
2352
+ // Process light DOM children in order
2353
+ if (root.children) {
2354
+ Array.from(root.children).forEach(child => {
2355
+ collectFocusableElements(child);
2356
+ });
2357
+ }
2358
+ }
2359
+ }
2360
+ };
2361
+
2362
+ // Start the traversal from the container
2363
+ collectFocusableElements(container);
2364
+
2365
+ // Remove duplicates that might have been collected through different paths
2366
+ // while preserving order
2367
+ const uniqueElements = [];
2368
+ const seen = new Set();
2369
+
2370
+ for (const element of orderedFocusableElements) {
2371
+ if (!seen.has(element)) {
2372
+ seen.add(element);
2373
+ uniqueElements.push(element);
2374
+ }
2375
+ }
2376
+
2377
+ return uniqueElements;
2378
+ }
2379
+
2380
+ /**
2381
+ * FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
2382
+ * It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
2383
+ */
2384
+ class FocusTrap {
2385
+ /**
2386
+ * Creates a new FocusTrap instance for the given container element.
2387
+ * Initializes event listeners and prepares the container for focus management.
2388
+ *
2389
+ * @param {HTMLElement} container The DOM element to trap focus within.
2390
+ * @throws {Error} If the provided container is not a valid HTMLElement.
2391
+ */
2392
+ constructor(container) {
2393
+ if (!container || !(container instanceof HTMLElement)) {
2394
+ throw new Error("FocusTrap requires a valid HTMLElement.");
2395
+ }
2396
+
2397
+ this.container = container;
2398
+ this.tabDirection = 'forward'; // or 'backward'
2399
+
2400
+ this._init();
2401
+ }
2402
+
2403
+ /**
2404
+ * Initializes the focus trap by setting up event listeners and attributes on the container.
2405
+ * Prepares the container for focus management, including support for shadow DOM and inert attributes.
2406
+ *
2407
+ * @private
2408
+ */
2409
+ _init() {
2410
+
2411
+ // Add inert attribute to prevent focusing programmatically as well (if supported)
2412
+ if ('inert' in HTMLElement.prototype) {
2413
+ this.container.inert = false; // Ensure the container isn't inert
2414
+ this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
2415
+ }
2416
+
2417
+ // Track tab direction
2418
+ this.container.addEventListener('keydown', this._onKeydown);
2419
+ }
2420
+
2421
+ /**
2422
+ * Handles keydown events to manage tab navigation within the container.
2423
+ * Ensures that focus wraps around when reaching the first or last focusable element.
2424
+ *
2425
+ * @param {KeyboardEvent} e The keyboard event triggered by user interaction.
2426
+ * @private
2427
+ */
2428
+ _onKeydown = (e) => {
2429
+
2430
+ if (e.key === 'Tab') {
2431
+
2432
+ // Set the tab direction based on the key pressed
2433
+ this.tabDirection = e.shiftKey ? 'backward' : 'forward';
2434
+
2435
+ // Get the active element(s) in the document and shadow root
2436
+ // This will include the active element in the shadow DOM if it exists
2437
+ // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
2438
+ let activeElement = document.activeElement;
2439
+ const actives = [activeElement];
2440
+ while (activeElement?.shadowRoot?.activeElement) {
2441
+ actives.push(activeElement.shadowRoot.activeElement);
2442
+ activeElement = activeElement.shadowRoot.activeElement;
2443
+ }
2444
+
2445
+ // Update the focusable elements
2446
+ const focusables = this._getFocusableElements();
2447
+
2448
+ // If we're at either end of the focusable elements, wrap around to the other end
2449
+ const focusIndex =
2450
+ (actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
2451
+ ? focusables.length - 1
2452
+ : actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
2453
+ ? 0
2454
+ : null;
2455
+
2456
+ if (focusIndex !== null) {
2457
+ focusables[focusIndex].focus();
2458
+ e.preventDefault(); // Prevent default tab behavior
2459
+ e.stopPropagation(); // Stop the event from bubbling up
2460
+ }
2461
+ }
2462
+ };
2463
+
2464
+ /**
2465
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2466
+ * Returns a unique, ordered array of elements that can receive focus.
2467
+ *
2468
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2469
+ * @private
2470
+ */
2471
+ _getFocusableElements() {
2472
+ // Use the imported utility function to get focusable elements
2473
+ const elements = getFocusableElements(this.container);
2474
+
2475
+ // Filter out any elements with the 'focus-bookend' class
2476
+ return elements;
2477
+ }
2478
+
2479
+ /**
2480
+ * Moves focus to the first focusable element within the container.
2481
+ * Useful for setting initial focus when activating the focus trap.
2482
+ */
2483
+ focusFirstElement() {
2484
+ const focusables = this._getFocusableElements();
2485
+ if (focusables.length) focusables[0].focus();
2486
+ }
2487
+
2488
+ /**
2489
+ * Moves focus to the last focusable element within the container.
2490
+ * Useful for setting focus when deactivating or cycling focus in reverse.
2491
+ */
2492
+ focusLastElement() {
2493
+ const focusables = this._getFocusableElements();
2494
+ if (focusables.length) focusables[focusables.length - 1].focus();
2495
+ }
2496
+
2497
+ /**
2498
+ * Removes event listeners and attributes added by the focus trap.
2499
+ * Call this method to clean up when the focus trap is no longer needed.
2500
+ */
2501
+ disconnect() {
2502
+
2503
+ if (this.container.hasAttribute('data-focus-trap-container')) {
2504
+ this.container.removeAttribute('data-focus-trap-container');
2505
+ }
2506
+
2507
+ this.container.removeEventListener('keydown', this._onKeydown);
2508
+ }
2509
+ }
2510
+
2243
2511
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2244
2512
  // See LICENSE in the project root for license information.
2245
2513
 
@@ -2626,8 +2894,12 @@ class AuroIcon extends BaseIcon {
2626
2894
  async firstUpdated() {
2627
2895
  await super.firstUpdated();
2628
2896
 
2629
- // Removes the SVG description for screenreader if ariaHidden is set to true
2630
- if (!this.hasAttribute('ariaHidden') && this.svg) {
2897
+ /**
2898
+ * icons provide a description for screen readers. Icon only instances Auro-button
2899
+ * depend on this description to provide context for the user using a screen reader.
2900
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
2901
+ */
2902
+ if (this.hasAttribute('ariaHidden') && this.svg) {
2631
2903
  const svgDesc = this.svg.querySelector('desc');
2632
2904
 
2633
2905
  if (svgDesc) {
@@ -2673,11 +2945,11 @@ class AuroIcon extends BaseIcon {
2673
2945
 
2674
2946
  var iconVersion = '6.1.2';
2675
2947
 
2676
- var styleCss$1 = 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}`;
2948
+ var styleCss$1 = 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}`;
2677
2949
 
2678
2950
  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)}`;
2679
2951
 
2680
- 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: transparent;--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdown-helptext-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: transparent;--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdown-helptext-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)}`;
2952
+ 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)}`;
2681
2953
 
2682
2954
  // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2683
2955
  // See LICENSE in the project root for license information.
@@ -2698,7 +2970,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
2698
2970
  */
2699
2971
 
2700
2972
  class AuroDropdownBib extends LitElement {
2701
-
2973
+ // not extending AuroElement because Bib needs only `shape` prop
2702
2974
  constructor() {
2703
2975
  super();
2704
2976
 
@@ -2708,6 +2980,9 @@ class AuroDropdownBib extends LitElement {
2708
2980
  this._mobileBreakpointValue = undefined;
2709
2981
 
2710
2982
  AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
2983
+
2984
+ this.shape = "rounded";
2985
+ this.matchWidth = false;
2711
2986
  }
2712
2987
 
2713
2988
  static get styles() {
@@ -2745,6 +3020,15 @@ class AuroDropdownBib extends LitElement {
2745
3020
  reflect: true
2746
3021
  },
2747
3022
 
3023
+ /**
3024
+ * If declared, the bib width will match the trigger width.
3025
+ * @private
3026
+ */
3027
+ matchWidth: {
3028
+ type: Boolean,
3029
+ reflect: true
3030
+ },
3031
+
2748
3032
  /**
2749
3033
  * If declared, will apply border-radius to the bib.
2750
3034
  */
@@ -2758,6 +3042,11 @@ class AuroDropdownBib extends LitElement {
2758
3042
  */
2759
3043
  bibTemplate: {
2760
3044
  type: Object
3045
+ },
3046
+
3047
+ shape: {
3048
+ type: String,
3049
+ reflect: true
2761
3050
  }
2762
3051
  };
2763
3052
  }
@@ -2837,8 +3126,16 @@ class AuroDropdownBib extends LitElement {
2837
3126
 
2838
3127
  // function that renders the HTML and CSS into the scope of the component
2839
3128
  render() {
3129
+ const classes = {
3130
+ container: true
3131
+ };
3132
+
3133
+ // Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
3134
+ // mimicking the class naming convention used in AuroElement.resetShapeClasses.
3135
+ classes[`shape-${this.shape}`] = true;
3136
+
2840
3137
  return html$1`
2841
- <div class="container" part="bibContainer">
3138
+ <div class="${classMap(classes)}" part="bibContainer">
2842
3139
  <slot></slot>
2843
3140
  </div>
2844
3141
  `;
@@ -2847,21 +3144,21 @@ class AuroDropdownBib extends LitElement {
2847
3144
 
2848
3145
  var dropdownVersion = '3.0.0';
2849
3146
 
2850
- var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;background-color:unset}.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:58px;max-height:58px;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;min-height:56px;max-height:56px}.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}.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;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}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;min-height:68px;max-height:68px}.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}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;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}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:72px;max-height:72px;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}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:72px;max-height:72px;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}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-md{min-height:72px;max-height:72px;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}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:72px;max-height:72px;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}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:72px;max-height:72px;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}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;min-height:44px;max-height:44px}`;
3147
+ var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;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:60px;max-height:60px;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:58px;max-height:58px;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:56px;max-height:56px}.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-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}`;
2851
3148
 
2852
- var colorCss$1 = css`:host .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,:host(:not([ondark])) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([ondark]) .wrapper:focus,:host([ondark]) .wrapper:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([error]:not([ondark])){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([error][ondark]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helpText{color:var(--ds-auro-dropdown-helptext-text-color)}`;
3149
+ 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{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-basic-color-status-error-subtle, #fbc6c6)}`;
2853
3150
 
2854
- var classicColorCss = css`:host([layout*=classic]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([layout*=classic]) .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)}:host([layout*=classic]) .trigger:focus-within,:host([layout*=classic]) .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([layout*=classic])[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([layout*=classic])[common],:host([layout*=classic])[bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67)}:host([layout*=classic])[common] .trigger:active,:host([layout*=classic])[common] .trigger:focus-within,:host([layout*=classic])[bordered] .trigger:active,:host([layout*=classic])[bordered] .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([layout*=classic])[error]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([layout*=classic])[error] .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([layout*=classic])[error] .trigger:focus-within,:host([layout*=classic])[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([layout*=classic])[disabled][common],:host([layout*=classic])[disabled][bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host([layout*=classic])[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([layout*=classic])[onDark]:focus-within,:host([layout*=classic])[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([layout*=classic])[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([layout*=classic])[onDark][common],:host([layout*=classic])[onDark][bordered]{--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([layout*=classic])[onDark][common] .trigger:focus-within,:host([layout*=classic])[onDark][common] .trigger:active,:host([layout*=classic])[onDark][bordered] .trigger:focus-within,:host([layout*=classic])[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([layout*=classic])[onDark][error]{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}:host([layout*=classic])[onDark][error] .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([layout*=classic])[onDark][error] .trigger:focus-within,:host([layout*=classic])[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([layout*=classic])[onDark][disabled][common],:host([layout*=classic])[onDark][disabled][bordered]{--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}`;
3151
+ var classicColorCss = css``;
2855
3152
 
2856
- 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{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .trigger{display:flex;flex-direction:row}@media(hover: hover){:host([layout*=classic]) .trigger:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([layout*=classic][fluid]){display:block}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}:host([layout*=classic][inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][inset][bordered][labeled]) .trigger{padding:var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem)}:host([layout*=classic][common]) .trigger,:host([layout*=classic][rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
3153
+ 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{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}: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);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
2857
3154
 
2858
- var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex-direction:row}.trigger{flex:1;display:flex;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{flex:1;display:flex;align-items:center;justify-content:center;width:100%}.triggerContent{overflow:hidden;flex:1;display:flex;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap;width:100%}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{margin-left:var(--ds-size-300, 1.5rem);width:calc(100% - var(--ds-size-300, 1.5rem))}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{margin-right:var(--ds-size-300, 1.5rem);width:calc(100% - var(--ds-size-300, 1.5rem))}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{margin-right:var(--ds-size-300, 1.5rem);width:calc(100% - var(--ds-size-600, 3rem))}`;
3155
+ var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.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([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)}`;
2859
3156
 
2860
- var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex-direction:wrapper}.trigger{flex:1;display:flex;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{flex:1;display:flex;align-items:center;justify-content:center;width:100%}.triggerContent{overflow:hidden;flex:1;display:flex;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap;width:100%}:host([layout*=snowflake]) .leftIndent{margin-left:var(--ds-size-300, 1.5rem);width:calc(100% - var(--ds-size-600, 3rem))}:host([layout*=snowflake]) .rightIndent{margin-right:var(--ds-size-300, 1.5rem);width:calc(100% - var(--ds-size-600, 3rem))}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
3157
+ var styleSnowflakeCss = css`:host{display:block}.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([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)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
2861
3158
 
2862
- 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)}`;
3159
+ 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-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
2863
3160
 
2864
- 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}`;
3161
+ var styleCss = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;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}`;
2865
3162
 
2866
3163
  var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
2867
3164
 
@@ -3102,18 +3399,21 @@ class AuroElement extends LitElement {
3102
3399
  }
3103
3400
 
3104
3401
  resetShapeClasses() {
3105
- if (this.shape && this.size) {
3106
- const wrapper = this.shadowRoot.querySelector('.wrapper');
3402
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3107
3403
 
3108
- if (wrapper) {
3109
- wrapper.classList.forEach((className) => {
3110
- if (className.startsWith('shape-')) {
3111
- wrapper.classList.remove(className);
3112
- }
3113
- });
3404
+ if (wrapper) {
3405
+ wrapper.classList.forEach((className) => {
3406
+ if (className.startsWith('shape-')) {
3407
+ wrapper.classList.remove(className);
3408
+ }
3409
+ });
3114
3410
 
3115
- wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3116
- }
3411
+ }
3412
+
3413
+ if (this.shape && this.size) {
3414
+ wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3415
+ } else {
3416
+ wrapper.classList.add('shape-none');
3117
3417
  }
3118
3418
  }
3119
3419
 
@@ -3163,10 +3463,8 @@ class AuroElement extends LitElement {
3163
3463
  // See LICENSE in the project root for license information.
3164
3464
 
3165
3465
 
3166
- /**
3167
- * @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
3466
+ /*
3168
3467
  * @slot - Default slot for the popover content.
3169
- * @slot label - Defines the content of the label.
3170
3468
  * @slot helpText - Defines the content of the helpText.
3171
3469
  * @slot trigger - Defines the content of the trigger.
3172
3470
  * @csspart trigger - The trigger content container.
@@ -3185,23 +3483,25 @@ class AuroDropdown extends AuroElement {
3185
3483
  this.matchWidth = false;
3186
3484
  this.noHideOnThisFocusLoss = false;
3187
3485
 
3188
- this.errorMessage = ''; // TODO!
3486
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3189
3487
 
3190
3488
  // Layout Config
3191
- this.layout = 'classic';
3192
- this.shape = 'rounded';
3193
- this.size = 'xl';
3489
+ this.layout = undefined;
3490
+ this.shape = undefined;
3491
+ this.size = undefined;
3492
+
3194
3493
  this.parentBorder = false;
3195
3494
 
3196
- this.privateDefaults();
3197
- }
3495
+ /** @private */
3496
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
3198
3497
 
3199
- get commonLabelClasses() {
3200
- return {
3201
- // 'withValue': this.value && this.value.length > 0
3202
- };
3498
+ this.privateDefaults();
3203
3499
  }
3204
3500
 
3501
+ /**
3502
+ * @private
3503
+ * @returns {object} Class definition for the wrapper element.
3504
+ */
3205
3505
  get commonWrapperClasses() {
3206
3506
  return {
3207
3507
  'trigger': true,
@@ -3219,13 +3519,10 @@ class AuroDropdown extends AuroElement {
3219
3519
  privateDefaults() {
3220
3520
  this.chevron = false;
3221
3521
  this.disabled = false;
3522
+ this.disableFocusTrap = false;
3222
3523
  this.error = false;
3223
- this.inset = false;
3224
- this.rounded = false;
3225
3524
  this.tabIndex = 0;
3226
3525
  this.noToggle = false;
3227
- this.a11yAutocomplete = 'none';
3228
- this.labeled = true;
3229
3526
  this.a11yRole = 'button';
3230
3527
  this.onDark = false;
3231
3528
  this.showTriggerBorders = true;
@@ -3321,6 +3618,18 @@ class AuroDropdown extends AuroElement {
3321
3618
  this.floater.showBib();
3322
3619
  }
3323
3620
 
3621
+ /**
3622
+ * When bib is open, focus on the first element inside of bib.
3623
+ * If not, trigger element will get focus.
3624
+ */
3625
+ focus() {
3626
+ if (this.isPopoverVisible && this.focusTrap) {
3627
+ this.focusTrap.focusFirstElement();
3628
+ } else {
3629
+ this.trigger.focus();
3630
+ }
3631
+ }
3632
+
3324
3633
  // function to define props used within the scope of this component
3325
3634
  static get properties() {
3326
3635
  return {
@@ -3334,6 +3643,15 @@ class AuroDropdown extends AuroElement {
3334
3643
  reflect: true
3335
3644
  },
3336
3645
 
3646
+ /**
3647
+ * If declared, the dropdown will only show by calling the API .show() public method.
3648
+ * @default false
3649
+ */
3650
+ disableEventShow: {
3651
+ type: Boolean,
3652
+ reflect: true
3653
+ },
3654
+
3337
3655
  /**
3338
3656
  * If declared, applies a border around the trigger slot.
3339
3657
  */
@@ -3352,17 +3670,17 @@ class AuroDropdown extends AuroElement {
3352
3670
  },
3353
3671
 
3354
3672
  /**
3355
- * If declared, the dropdown will be styled with the common theme.
3673
+ * If declared, the dropdown is not interactive.
3356
3674
  */
3357
- common: {
3675
+ disabled: {
3358
3676
  type: Boolean,
3359
3677
  reflect: true
3360
3678
  },
3361
3679
 
3362
3680
  /**
3363
- * If declared, the dropdown is not interactive.
3681
+ * If declared, the focus trap inside of bib will be turned off.
3364
3682
  */
3365
- disabled: {
3683
+ disableFocusTrap: {
3366
3684
  type: Boolean,
3367
3685
  reflect: true
3368
3686
  },
@@ -3407,22 +3725,6 @@ class AuroDropdown extends AuroElement {
3407
3725
  reflect: true
3408
3726
  },
3409
3727
 
3410
- /**
3411
- * Makes the trigger to be full width of its parent container.
3412
- */
3413
- fluid: {
3414
- type: Boolean,
3415
- reflect: true
3416
- },
3417
-
3418
- /**
3419
- * If declared, will apply padding around trigger slot content.
3420
- */
3421
- inset: {
3422
- type: Boolean,
3423
- reflect: true
3424
- },
3425
-
3426
3728
  /**
3427
3729
  * If true, the dropdown bib is displayed.
3428
3730
  */
@@ -3466,15 +3768,6 @@ class AuroDropdown extends AuroElement {
3466
3768
  reflect: true
3467
3769
  },
3468
3770
 
3469
- /**
3470
- * Defines if there is a label preset.
3471
- * @private
3472
- */
3473
- labeled: {
3474
- type: Boolean,
3475
- reflect: true
3476
- },
3477
-
3478
3771
  /**
3479
3772
  * Defines if the trigger should size based on the parent element providing the border UI.
3480
3773
  * @private
@@ -3535,6 +3828,9 @@ class AuroDropdown extends AuroElement {
3535
3828
  reflect: true
3536
3829
  },
3537
3830
 
3831
+ /**
3832
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3833
+ */
3538
3834
  onSlotChange: {
3539
3835
  type: Function,
3540
3836
  reflect: false
@@ -3549,14 +3845,6 @@ class AuroDropdown extends AuroElement {
3549
3845
  reflect: true
3550
3846
  },
3551
3847
 
3552
- /**
3553
- * If declared, will apply border-radius to trigger and default slots.
3554
- */
3555
- rounded: {
3556
- type: Boolean,
3557
- reflect: true
3558
- },
3559
-
3560
3848
  /**
3561
3849
  * @private
3562
3850
  */
@@ -3571,22 +3859,14 @@ class AuroDropdown extends AuroElement {
3571
3859
  type: String || undefined,
3572
3860
  attribute: false,
3573
3861
  reflect: false
3574
- },
3575
-
3576
- /**
3577
- * The value for the aria-autocomplete attribute of the trigger element.
3578
- */
3579
- a11yAutocomplete: {
3580
- type: String,
3581
- attribute: false,
3582
3862
  }
3583
3863
  };
3584
3864
  }
3585
3865
 
3586
3866
  static get styles() {
3587
3867
  return [
3588
- colorCss$1,
3589
3868
  tokensCss$1,
3869
+ colorCss$1,
3590
3870
 
3591
3871
  // default layout
3592
3872
  classicColorCss,
@@ -3648,13 +3928,27 @@ class AuroDropdown extends AuroElement {
3648
3928
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
3649
3929
  this.handleTriggerContentSlotChange();
3650
3930
  }
3931
+ }
3651
3932
 
3933
+ /**
3934
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
3935
+ * @private
3936
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
3937
+ */
3938
+ handleDropdownToggle(event) {
3939
+ this.updateFocusTrap();
3940
+ this.isPopoverVisible = event.detail.expanded;
3941
+ const eventType = event.detail.eventType || "unknown";
3942
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
3943
+ this.trigger.focus();
3944
+ }
3652
3945
  }
3653
3946
 
3654
3947
  firstUpdated() {
3655
3948
 
3656
3949
  // Configure the floater to, this will generate the ID for the bib
3657
3950
  this.floater.configure(this, 'auroDropdown');
3951
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
3658
3952
 
3659
3953
  /**
3660
3954
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -3714,6 +4008,27 @@ class AuroDropdown extends AuroElement {
3714
4008
  this.hasFocus = true;
3715
4009
  }
3716
4010
 
4011
+ /**
4012
+ * @private
4013
+ */
4014
+ updateFocusTrap() {
4015
+ // If the dropdown is open, create a focus trap and focus the first element
4016
+ if (this.isPopoverVisible && !this.disableFocusTrap) {
4017
+ this.focusTrap = new FocusTrap(this.bibContent);
4018
+ this.focusTrap.focusFirstElement();
4019
+ return;
4020
+ }
4021
+
4022
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
4023
+ if (!this.focusTrap) {
4024
+ return;
4025
+ }
4026
+
4027
+ // If the dropdown is not open, disconnect the focus trap if it exists
4028
+ this.focusTrap.disconnect();
4029
+ this.focusTrap = undefined;
4030
+ }
4031
+
3717
4032
  /**
3718
4033
  * Function to support @focusout event.
3719
4034
  * @private
@@ -3874,14 +4189,13 @@ class AuroDropdown extends AuroElement {
3874
4189
  * @returns {void}
3875
4190
  */
3876
4191
  handleTriggerContentSlotChange(event) {
3877
-
3878
4192
  this.floater.handleTriggerTabIndex();
3879
4193
 
3880
4194
  // Get the trigger
3881
4195
  const trigger = this.shadowRoot.querySelector('#trigger');
3882
4196
 
3883
4197
  // Get the trigger slot
3884
- const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
4198
+ const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
3885
4199
 
3886
4200
  // If there's a trigger slot
3887
4201
  if (triggerSlot) {
@@ -3944,7 +4258,6 @@ class AuroDropdown extends AuroElement {
3944
4258
  *
3945
4259
  * @private
3946
4260
  * @method handleDefaultSlot
3947
- * @param {Event} event - The event object representing the slot change.
3948
4261
  * @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
3949
4262
  */
3950
4263
  handleDefaultSlot() {
@@ -3954,29 +4267,6 @@ class AuroDropdown extends AuroElement {
3954
4267
  }
3955
4268
  }
3956
4269
 
3957
- /**
3958
- * @private
3959
- * @method handleLabelSlotChange
3960
- * @param {event} event - The event object representing the slot change.
3961
- * @description Handles the slot change event for the label slot.
3962
- */
3963
- handleLabelSlotChange (event) {
3964
-
3965
- // Get the nodes from the event
3966
- const nodes = event.target.assignedNodes();
3967
-
3968
- // Guard clause for no nodes
3969
- if (!nodes) {
3970
- return;
3971
- }
3972
-
3973
- // Convert the nodes to a measurable array so we can get the length
3974
- const nodesArr = Array.from(nodes);
3975
-
3976
- // If the nodes array has a length, the dropdown is labeled
3977
- this.labeled = nodesArr.length > 0;
3978
- }
3979
-
3980
4270
  /**
3981
4271
  * Returns HTML for the common portion of the layouts.
3982
4272
  * @private
@@ -3991,22 +4281,17 @@ class AuroDropdown extends AuroElement {
3991
4281
  class="${classMap(this.commonWrapperClasses)}" part="wrapper"
3992
4282
  tabindex="${this.tabIndex}"
3993
4283
  role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
3994
- aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
3995
- aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
4284
+ aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4285
+ aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
3996
4286
  aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
3997
4287
  @focusin="${this.handleFocusin}"
3998
4288
  @blur="${this.handleFocusOut}">
3999
- <div class="triggerContentWrapper">
4000
- <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
4001
- <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
4002
- </label>
4003
- <div class="triggerContent">
4004
- <slot
4005
- name="trigger"
4006
- @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4007
- </div>
4289
+ <div class="triggerContentWrapper" id="triggerLabel">
4290
+ <slot
4291
+ name="trigger"
4292
+ @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4008
4293
  </div>
4009
- ${this.chevron || this.common ? html$1`
4294
+ ${this.chevron ? html$1`
4010
4295
  <div
4011
4296
  id="showStateIcon"
4012
4297
  class="chevron"
@@ -4027,11 +4312,9 @@ class AuroDropdown extends AuroElement {
4027
4312
  <div id="bibSizer" part="size"></div>
4028
4313
  <${this.dropdownBibTag}
4029
4314
  id="bib"
4315
+ shape="${this.shape}"
4030
4316
  ?data-show="${this.isPopoverVisible}"
4031
- ?isfullscreen="${this.isBibFullscreen}"
4032
- ?common="${this.common}"
4033
- ?rounded="${this.common || this.rounded}"
4034
- ?inset="${this.common || this.inset}">
4317
+ ?isfullscreen="${this.isBibFullscreen}">
4035
4318
  <div class="slotContent">
4036
4319
  <slot @slotchange="${this.handleDefaultSlot}"></slot>
4037
4320
  </div>
@@ -4046,62 +4329,13 @@ class AuroDropdown extends AuroElement {
4046
4329
  * @returns {html} - Returns HTML for the classic layout.
4047
4330
  */
4048
4331
  renderLayoutClassic() {
4332
+ // TODO: check with Doug why this was never used?
4333
+ const helpTextClasses = {
4334
+ 'helpText': true
4335
+ };
4049
4336
 
4050
4337
  return html$1`
4051
- <div>
4052
- <div
4053
- id="trigger"
4054
- class="trigger"
4055
- part="trigger"
4056
- tabindex="${this.tabIndex}"
4057
- ?showBorder="${this.showTriggerBorders}"
4058
- role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
4059
- aria-expanded="${ifDefined(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4060
- aria-controls="${ifDefined(this.triggerContentFocusable ? undefined : this.dropdownId)}"
4061
- aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
4062
- >
4063
- <div class="triggerContentWrapper">
4064
- <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
4065
- <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
4066
- </label>
4067
- <div class="triggerContent">
4068
- <slot
4069
- name="trigger"
4070
- @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4071
- </div>
4072
- </div>
4073
- ${this.chevron || this.common ? html$1`
4074
- <div
4075
- id="showStateIcon"
4076
- part="chevron">
4077
- <${this.iconTag}
4078
- category="interface"
4079
- name="chevron-down"
4080
- ?onDark="${this.onDark}"
4081
- variant="${this.disabled ? 'disabled' : 'muted'}">
4082
- >
4083
- </${this.iconTag}>
4084
- </div>
4085
- ` : undefined }
4086
- </div>
4087
- <${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
4088
- <slot name="helpText"></slot>
4089
- </${this.helpTextTag}>
4090
-
4091
- <div id="bibSizer" part="size"></div>
4092
- <${this.dropdownBibTag}
4093
- id="bib"
4094
- ?data-show="${this.isPopoverVisible}"
4095
- ?isfullscreen="${this.isBibFullscreen}"
4096
- ?common="${this.common}"
4097
- ?rounded="${this.common || this.rounded}"
4098
- ?inset="${this.common || this.inset}"
4099
- >
4100
- <div class="slotContent">
4101
- <slot @slotchange="${this.handleDefaultSlot}"></slot>
4102
- </div>
4103
- </${this.dropdownBibTag}>
4104
- </div>
4338
+ ${this.renderBasicHtml(helpTextClasses)}
4105
4339
  `;
4106
4340
  }
4107
4341