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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +1262 -81
  5. package/components/bibtemplate/dist/registered.js +1262 -81
  6. package/components/checkbox/README.md +1 -1
  7. package/components/checkbox/demo/api.html +16 -10
  8. package/components/checkbox/demo/api.md +47 -14
  9. package/components/checkbox/demo/api.min.js +65 -42
  10. package/components/checkbox/demo/index.html +16 -10
  11. package/components/checkbox/demo/index.md +2 -2
  12. package/components/checkbox/demo/index.min.js +65 -42
  13. package/components/checkbox/demo/readme.html +16 -9
  14. package/components/checkbox/demo/readme.md +1 -1
  15. package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
  16. package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
  17. package/components/checkbox/dist/index.js +65 -42
  18. package/components/checkbox/dist/registered.js +65 -42
  19. package/components/combobox/demo/api.html +16 -10
  20. package/components/combobox/demo/api.md +113 -8
  21. package/components/combobox/demo/api.min.js +3096 -870
  22. package/components/combobox/demo/index.html +16 -10
  23. package/components/combobox/demo/index.md +6 -30
  24. package/components/combobox/demo/index.min.js +3096 -870
  25. package/components/combobox/demo/readme.html +16 -9
  26. package/components/combobox/dist/auro-combobox.d.ts +42 -8
  27. package/components/combobox/dist/index.js +2878 -748
  28. package/components/combobox/dist/registered.js +2878 -748
  29. package/components/counter/demo/api.html +17 -10
  30. package/components/counter/demo/api.md +156 -21
  31. package/components/counter/demo/api.min.js +3363 -652
  32. package/components/counter/demo/index.html +17 -10
  33. package/components/counter/demo/index.md +185 -34
  34. package/components/counter/demo/index.min.js +3363 -652
  35. package/components/counter/demo/readme.html +16 -9
  36. package/components/counter/dist/auro-counter-button.d.ts +2 -0
  37. package/components/counter/dist/auro-counter-group.d.ts +151 -11
  38. package/components/counter/dist/auro-counter.d.ts +16 -0
  39. package/components/counter/dist/helptextVersion.d.ts +2 -0
  40. package/components/counter/dist/iconVersion.d.ts +1 -1
  41. package/components/counter/dist/index.js +3364 -653
  42. package/components/counter/dist/registered.js +3364 -653
  43. package/components/datepicker/demo/api.html +16 -10
  44. package/components/datepicker/demo/api.md +25 -16
  45. package/components/datepicker/demo/api.min.js +11857 -8105
  46. package/components/datepicker/demo/index.html +16 -10
  47. package/components/datepicker/demo/index.md +71 -4
  48. package/components/datepicker/demo/index.min.js +11857 -8105
  49. package/components/datepicker/demo/readme.html +16 -9
  50. package/components/datepicker/dist/auro-datepicker.d.ts +89 -11
  51. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  52. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  53. package/components/datepicker/dist/index.js +8691 -4939
  54. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  55. package/components/datepicker/dist/registered.js +8691 -4939
  56. package/components/dropdown/demo/api.html +16 -10
  57. package/components/dropdown/demo/api.md +81 -274
  58. package/components/dropdown/demo/api.min.js +429 -195
  59. package/components/dropdown/demo/index.html +16 -10
  60. package/components/dropdown/demo/index.md +92 -362
  61. package/components/dropdown/demo/index.min.js +429 -195
  62. package/components/dropdown/demo/readme.html +16 -9
  63. package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
  64. package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
  65. package/components/dropdown/dist/index.js +429 -195
  66. package/components/dropdown/dist/registered.js +429 -195
  67. package/components/form/demo/api.html +16 -9
  68. package/components/form/demo/api.min.js +1 -1
  69. package/components/form/demo/autocomplete.html +19 -3
  70. package/components/form/demo/index.html +16 -9
  71. package/components/form/demo/index.min.js +1 -1
  72. package/components/form/demo/readme.html +16 -9
  73. package/components/form/demo/working.html +19 -13
  74. package/components/form/dist/index.js +1 -1
  75. package/components/form/dist/registered.js +1 -1
  76. package/components/helptext/dist/index.js +2 -2
  77. package/components/helptext/dist/registered.js +2 -2
  78. package/components/input/README.md +5 -2
  79. package/components/input/demo/api.html +16 -10
  80. package/components/input/demo/api.md +228 -130
  81. package/components/input/demo/api.min.js +908 -246
  82. package/components/input/demo/index.html +16 -10
  83. package/components/input/demo/index.md +48 -32
  84. package/components/input/demo/index.min.js +908 -246
  85. package/components/input/demo/readme.html +16 -9
  86. package/components/input/demo/readme.md +5 -2
  87. package/components/input/dist/auro-input.d.ts +3 -3
  88. package/components/input/dist/base-input.d.ts +38 -10
  89. package/components/input/dist/buttonVersion.d.ts +1 -1
  90. package/components/input/dist/iconVersion.d.ts +1 -1
  91. package/components/input/dist/index.js +908 -246
  92. package/components/input/dist/registered.js +908 -246
  93. package/components/layoutElement/dist/index.js +13 -10
  94. package/components/menu/demo/api.html +32 -10
  95. package/components/menu/demo/api.md +69 -8
  96. package/components/menu/demo/api.min.js +238 -47
  97. package/components/menu/demo/index.html +16 -10
  98. package/components/menu/demo/index.min.js +238 -47
  99. package/components/menu/demo/readme.html +16 -9
  100. package/components/menu/dist/auro-menu.d.ts +41 -7
  101. package/components/menu/dist/auro-menuoption.d.ts +15 -3
  102. package/components/menu/dist/iconVersion.d.ts +1 -1
  103. package/components/menu/dist/index.js +238 -47
  104. package/components/menu/dist/registered.js +238 -47
  105. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  106. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  107. package/components/radio/demo/api.html +16 -10
  108. package/components/radio/demo/api.md +7 -8
  109. package/components/radio/demo/api.min.js +88 -90
  110. package/components/radio/demo/index.html +16 -10
  111. package/components/radio/demo/index.min.js +88 -90
  112. package/components/radio/demo/readme.html +16 -9
  113. package/components/radio/dist/auro-radio-group.d.ts +1 -1
  114. package/components/radio/dist/auro-radio.d.ts +9 -12
  115. package/components/radio/dist/index.js +88 -90
  116. package/components/radio/dist/registered.js +88 -90
  117. package/components/select/demo/api.html +16 -10
  118. package/components/select/demo/api.js +0 -2
  119. package/components/select/demo/api.md +104 -57
  120. package/components/select/demo/api.min.js +2148 -635
  121. package/components/select/demo/index.html +17 -11
  122. package/components/select/demo/index.md +45 -158
  123. package/components/select/demo/index.min.js +2148 -623
  124. package/components/select/demo/readme.html +16 -9
  125. package/components/select/dist/auro-select.d.ts +49 -16
  126. package/components/select/dist/index.js +2078 -649
  127. package/components/select/dist/registered.js +2078 -649
  128. package/package.json +30 -27
  129. /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
  130. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
  131. /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
  132. /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
  133. /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
  134. /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
  135. /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
  136. /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
  137. /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
  138. /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
@@ -1730,7 +1730,7 @@ class AuroFloatingUI {
1730
1730
  */
1731
1731
  mirrorSize() {
1732
1732
  // mirror the boxsize from bibSizer
1733
- if (this.element.bibSizer) {
1733
+ if (this.element.bibSizer && this.element.matchWidth) {
1734
1734
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
1735
1735
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
1736
1736
  if (sizerStyle.width !== '0px') {
@@ -1942,13 +1942,13 @@ class AuroFloatingUI {
1942
1942
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
1943
1943
  return;
1944
1944
  }
1945
-
1945
+
1946
1946
  // if fullscreen bib is in fullscreen mode, do not close
1947
1947
  if (this.element.bib.hasAttribute('isfullscreen')) {
1948
1948
  return;
1949
1949
  }
1950
1950
 
1951
- this.hideBib();
1951
+ this.hideBib("keydown");
1952
1952
  }
1953
1953
 
1954
1954
  setupHideHandlers() {
@@ -1973,7 +1973,7 @@ class AuroFloatingUI {
1973
1973
  document.expandedAuroFormkitDropdown = null;
1974
1974
  document.expandedAuroFloater = this;
1975
1975
  } else {
1976
- this.hideBib();
1976
+ this.hideBib("click");
1977
1977
  }
1978
1978
  }
1979
1979
  };
@@ -1986,7 +1986,7 @@ class AuroFloatingUI {
1986
1986
  // if something else is open, let it handle itself
1987
1987
  return;
1988
1988
  }
1989
- this.hideBib();
1989
+ this.hideBib("keydown");
1990
1990
  }
1991
1991
  };
1992
1992
 
@@ -2069,7 +2069,11 @@ class AuroFloatingUI {
2069
2069
  }
2070
2070
  }
2071
2071
 
2072
- hideBib() {
2072
+ /**
2073
+ * Hides the floating UI element.
2074
+ * @param {String} eventType - The event type that triggered the hiding action.
2075
+ */
2076
+ hideBib(eventType = "unknown") {
2073
2077
  if (!this.element.disabled && !this.element.noToggle) {
2074
2078
  this.lockScroll(false);
2075
2079
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2080,7 +2084,7 @@ class AuroFloatingUI {
2080
2084
  if (this.showing) {
2081
2085
  this.cleanupHideHandlers();
2082
2086
  this.showing = false;
2083
- this.dispatchEventDropdownToggle();
2087
+ this.dispatchEventDropdownToggle(eventType);
2084
2088
  }
2085
2089
  }
2086
2090
  document.expandedAuroFloater = null;
@@ -2089,11 +2093,13 @@ class AuroFloatingUI {
2089
2093
  /**
2090
2094
  * @private
2091
2095
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2096
+ * @param {String} eventType - The event type that triggered the toggle action.
2092
2097
  */
2093
- dispatchEventDropdownToggle() {
2098
+ dispatchEventDropdownToggle(eventType) {
2094
2099
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2095
2100
  detail: {
2096
2101
  expanded: this.showing,
2102
+ eventType: eventType || "unknown",
2097
2103
  },
2098
2104
  composed: true
2099
2105
  });
@@ -2103,7 +2109,7 @@ class AuroFloatingUI {
2103
2109
 
2104
2110
  handleClick() {
2105
2111
  if (this.element.isPopoverVisible) {
2106
- this.hideBib();
2112
+ this.hideBib("click");
2107
2113
  } else {
2108
2114
  this.showBib();
2109
2115
  }
@@ -2126,8 +2132,9 @@ class AuroFloatingUI {
2126
2132
  // Space is included as it's expected behavior for interactive elements
2127
2133
 
2128
2134
  const origin = event.composedPath()[0];
2129
- if (event.key === 'Enter' || ((!origin || origin.tagName !== "INPUT") && event.key === ' ')) {
2130
- event.preventDefault(); // Prevent page scroll on space
2135
+ if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
2136
+
2137
+ event.preventDefault();
2131
2138
  this.handleClick();
2132
2139
  }
2133
2140
  break;
@@ -2138,7 +2145,7 @@ class AuroFloatingUI {
2138
2145
  break;
2139
2146
  case 'mouseleave':
2140
2147
  if (this.element.hoverToggle) {
2141
- this.hideBib();
2148
+ this.hideBib("mouseleave");
2142
2149
  }
2143
2150
  break;
2144
2151
  case 'focus':
@@ -2281,6 +2288,267 @@ class AuroFloatingUI {
2281
2288
  }
2282
2289
  }
2283
2290
 
2291
+ // Selectors for focusable elements
2292
+ const FOCUSABLE_SELECTORS = [
2293
+ 'a[href]',
2294
+ 'button:not([disabled])',
2295
+ 'textarea:not([disabled])',
2296
+ 'input:not([disabled])',
2297
+ 'select:not([disabled])',
2298
+ '[role="tab"]:not([disabled])',
2299
+ '[role="link"]:not([disabled])',
2300
+ '[role="button"]:not([disabled])',
2301
+ '[tabindex]:not([tabindex="-1"])',
2302
+ '[contenteditable]:not([contenteditable="false"])'
2303
+ ];
2304
+
2305
+ // List of custom components that are known to be focusable
2306
+ const FOCUSABLE_COMPONENTS = [
2307
+ 'auro-checkbox',
2308
+ 'auro-radio',
2309
+ 'auro-dropdown',
2310
+ 'auro-button',
2311
+ 'auro-combobox',
2312
+ 'auro-input',
2313
+ 'auro-counter',
2314
+ 'auro-menu',
2315
+ 'auro-select',
2316
+ 'auro-datepicker',
2317
+ 'auro-hyperlink',
2318
+ 'auro-accordion',
2319
+ ];
2320
+
2321
+ /**
2322
+ * Determines if a given element is a custom focusable component.
2323
+ * Returns true if the element matches a known focusable component and is not disabled.
2324
+ *
2325
+ * @param {HTMLElement} element The element to check for focusability.
2326
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
2327
+ */
2328
+ function isFocusableComponent(element) {
2329
+ const componentName = element.tagName.toLowerCase();
2330
+
2331
+ // Guard Clause: Element is a focusable component
2332
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
2333
+
2334
+ // Guard Clause: Element is not disabled
2335
+ if (element.hasAttribute('disabled')) return false;
2336
+
2337
+ // Guard Clause: The element is a hyperlink and has no href attribute
2338
+ if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
2339
+
2340
+ // If all guard clauses pass, the element is a focusable component
2341
+ return true;
2342
+ }
2343
+
2344
+ /**
2345
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2346
+ * Returns a unique, ordered array of elements that can receive focus.
2347
+ *
2348
+ * @param {HTMLElement} container The container to search within
2349
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2350
+ */
2351
+ function getFocusableElements(container) {
2352
+ // Get elements in DOM order by walking the tree
2353
+ const orderedFocusableElements = [];
2354
+
2355
+ // Define a recursive function to collect focusable elements in DOM order
2356
+ const collectFocusableElements = (root) => {
2357
+ // Check if current element is focusable
2358
+ if (root.nodeType === Node.ELEMENT_NODE) {
2359
+ // Check if this is a custom component that is focusable
2360
+ const isComponentFocusable = isFocusableComponent(root);
2361
+
2362
+ if (isComponentFocusable) {
2363
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
2364
+ orderedFocusableElements.push(root);
2365
+ return; // Skip traversing inside this component
2366
+ }
2367
+
2368
+ // Check if the element itself matches any selector
2369
+ for (const selector of FOCUSABLE_SELECTORS) {
2370
+ if (root.matches?.(selector)) {
2371
+ orderedFocusableElements.push(root);
2372
+ break; // Once we know it's focusable, no need to check other selectors
2373
+ }
2374
+ }
2375
+
2376
+ // Process shadow DOM only for non-Auro components
2377
+ if (root.shadowRoot) {
2378
+ // Process shadow DOM children in order
2379
+ if (root.shadowRoot.children) {
2380
+ Array.from(root.shadowRoot.children).forEach(child => {
2381
+ collectFocusableElements(child);
2382
+ });
2383
+ }
2384
+ }
2385
+
2386
+ // Process slots and their assigned nodes in order
2387
+ if (root.tagName === 'SLOT') {
2388
+ const assignedNodes = root.assignedNodes({ flatten: true });
2389
+ for (const node of assignedNodes) {
2390
+ collectFocusableElements(node);
2391
+ }
2392
+ } else {
2393
+ // Process light DOM children in order
2394
+ if (root.children) {
2395
+ Array.from(root.children).forEach(child => {
2396
+ collectFocusableElements(child);
2397
+ });
2398
+ }
2399
+ }
2400
+ }
2401
+ };
2402
+
2403
+ // Start the traversal from the container
2404
+ collectFocusableElements(container);
2405
+
2406
+ // Remove duplicates that might have been collected through different paths
2407
+ // while preserving order
2408
+ const uniqueElements = [];
2409
+ const seen = new Set();
2410
+
2411
+ for (const element of orderedFocusableElements) {
2412
+ if (!seen.has(element)) {
2413
+ seen.add(element);
2414
+ uniqueElements.push(element);
2415
+ }
2416
+ }
2417
+
2418
+ return uniqueElements;
2419
+ }
2420
+
2421
+ /**
2422
+ * FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
2423
+ * It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
2424
+ */
2425
+ class FocusTrap {
2426
+ /**
2427
+ * Creates a new FocusTrap instance for the given container element.
2428
+ * Initializes event listeners and prepares the container for focus management.
2429
+ *
2430
+ * @param {HTMLElement} container The DOM element to trap focus within.
2431
+ * @throws {Error} If the provided container is not a valid HTMLElement.
2432
+ */
2433
+ constructor(container) {
2434
+ if (!container || !(container instanceof HTMLElement)) {
2435
+ throw new Error("FocusTrap requires a valid HTMLElement.");
2436
+ }
2437
+
2438
+ this.container = container;
2439
+ this.tabDirection = 'forward'; // or 'backward'
2440
+
2441
+ this._init();
2442
+ }
2443
+
2444
+ /**
2445
+ * Initializes the focus trap by setting up event listeners and attributes on the container.
2446
+ * Prepares the container for focus management, including support for shadow DOM and inert attributes.
2447
+ *
2448
+ * @private
2449
+ */
2450
+ _init() {
2451
+
2452
+ // Add inert attribute to prevent focusing programmatically as well (if supported)
2453
+ if ('inert' in HTMLElement.prototype) {
2454
+ this.container.inert = false; // Ensure the container isn't inert
2455
+ this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
2456
+ }
2457
+
2458
+ // Track tab direction
2459
+ this.container.addEventListener('keydown', this._onKeydown);
2460
+ }
2461
+
2462
+ /**
2463
+ * Handles keydown events to manage tab navigation within the container.
2464
+ * Ensures that focus wraps around when reaching the first or last focusable element.
2465
+ *
2466
+ * @param {KeyboardEvent} e The keyboard event triggered by user interaction.
2467
+ * @private
2468
+ */
2469
+ _onKeydown = (e) => {
2470
+
2471
+ if (e.key === 'Tab') {
2472
+
2473
+ // Set the tab direction based on the key pressed
2474
+ this.tabDirection = e.shiftKey ? 'backward' : 'forward';
2475
+
2476
+ // Get the active element(s) in the document and shadow root
2477
+ // This will include the active element in the shadow DOM if it exists
2478
+ // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
2479
+ let activeElement = document.activeElement;
2480
+ const actives = [activeElement];
2481
+ while (activeElement?.shadowRoot?.activeElement) {
2482
+ actives.push(activeElement.shadowRoot.activeElement);
2483
+ activeElement = activeElement.shadowRoot.activeElement;
2484
+ }
2485
+
2486
+ // Update the focusable elements
2487
+ const focusables = this._getFocusableElements();
2488
+
2489
+ // If we're at either end of the focusable elements, wrap around to the other end
2490
+ const focusIndex =
2491
+ (actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
2492
+ ? focusables.length - 1
2493
+ : actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
2494
+ ? 0
2495
+ : null;
2496
+
2497
+ if (focusIndex !== null) {
2498
+ focusables[focusIndex].focus();
2499
+ e.preventDefault(); // Prevent default tab behavior
2500
+ e.stopPropagation(); // Stop the event from bubbling up
2501
+ }
2502
+ }
2503
+ };
2504
+
2505
+ /**
2506
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2507
+ * Returns a unique, ordered array of elements that can receive focus.
2508
+ *
2509
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2510
+ * @private
2511
+ */
2512
+ _getFocusableElements() {
2513
+ // Use the imported utility function to get focusable elements
2514
+ const elements = getFocusableElements(this.container);
2515
+
2516
+ // Filter out any elements with the 'focus-bookend' class
2517
+ return elements;
2518
+ }
2519
+
2520
+ /**
2521
+ * Moves focus to the first focusable element within the container.
2522
+ * Useful for setting initial focus when activating the focus trap.
2523
+ */
2524
+ focusFirstElement() {
2525
+ const focusables = this._getFocusableElements();
2526
+ if (focusables.length) focusables[0].focus();
2527
+ }
2528
+
2529
+ /**
2530
+ * Moves focus to the last focusable element within the container.
2531
+ * Useful for setting focus when deactivating or cycling focus in reverse.
2532
+ */
2533
+ focusLastElement() {
2534
+ const focusables = this._getFocusableElements();
2535
+ if (focusables.length) focusables[focusables.length - 1].focus();
2536
+ }
2537
+
2538
+ /**
2539
+ * Removes event listeners and attributes added by the focus trap.
2540
+ * Call this method to clean up when the focus trap is no longer needed.
2541
+ */
2542
+ disconnect() {
2543
+
2544
+ if (this.container.hasAttribute('data-focus-trap-container')) {
2545
+ this.container.removeAttribute('data-focus-trap-container');
2546
+ }
2547
+
2548
+ this.container.removeEventListener('keydown', this._onKeydown);
2549
+ }
2550
+ }
2551
+
2284
2552
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2285
2553
  // See LICENSE in the project root for license information.
2286
2554
 
@@ -2673,8 +2941,12 @@ class AuroIcon extends BaseIcon {
2673
2941
  async firstUpdated() {
2674
2942
  await super.firstUpdated();
2675
2943
 
2676
- // Removes the SVG description for screenreader if ariaHidden is set to true
2677
- if (!this.hasAttribute('ariaHidden') && this.svg) {
2944
+ /**
2945
+ * icons provide a description for screen readers. Icon only instances Auro-button
2946
+ * depend on this description to provide context for the user using a screen reader.
2947
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
2948
+ */
2949
+ if (this.hasAttribute('ariaHidden') && this.svg) {
2678
2950
  const svgDesc = this.svg.querySelector('desc');
2679
2951
 
2680
2952
  if (svgDesc) {
@@ -2720,11 +2992,11 @@ class AuroIcon extends BaseIcon {
2720
2992
 
2721
2993
  var iconVersion = '6.1.2';
2722
2994
 
2723
- var styleCss$1 = i$2`: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}`;
2995
+ var styleCss$1 = i$2`: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}`;
2724
2996
 
2725
2997
  var colorCss$2 = i$2`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
2726
2998
 
2727
- var tokensCss$1 = i$2`: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)}`;
2999
+ var tokensCss$1 = i$2`: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)}`;
2728
3000
 
2729
3001
  // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2730
3002
  // See LICENSE in the project root for license information.
@@ -2745,7 +3017,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
2745
3017
  */
2746
3018
 
2747
3019
  class AuroDropdownBib extends i {
2748
-
3020
+ // not extending AuroElement because Bib needs only `shape` prop
2749
3021
  constructor() {
2750
3022
  super();
2751
3023
 
@@ -2755,6 +3027,9 @@ class AuroDropdownBib extends i {
2755
3027
  this._mobileBreakpointValue = undefined;
2756
3028
 
2757
3029
  AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
3030
+
3031
+ this.shape = "rounded";
3032
+ this.matchWidth = false;
2758
3033
  }
2759
3034
 
2760
3035
  static get styles() {
@@ -2792,6 +3067,15 @@ class AuroDropdownBib extends i {
2792
3067
  reflect: true
2793
3068
  },
2794
3069
 
3070
+ /**
3071
+ * If declared, the bib width will match the trigger width.
3072
+ * @private
3073
+ */
3074
+ matchWidth: {
3075
+ type: Boolean,
3076
+ reflect: true
3077
+ },
3078
+
2795
3079
  /**
2796
3080
  * If declared, will apply border-radius to the bib.
2797
3081
  */
@@ -2805,6 +3089,11 @@ class AuroDropdownBib extends i {
2805
3089
  */
2806
3090
  bibTemplate: {
2807
3091
  type: Object
3092
+ },
3093
+
3094
+ shape: {
3095
+ type: String,
3096
+ reflect: true
2808
3097
  }
2809
3098
  };
2810
3099
  }
@@ -2884,8 +3173,16 @@ class AuroDropdownBib extends i {
2884
3173
 
2885
3174
  // function that renders the HTML and CSS into the scope of the component
2886
3175
  render() {
3176
+ const classes = {
3177
+ container: true
3178
+ };
3179
+
3180
+ // Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
3181
+ // mimicking the class naming convention used in AuroElement.resetShapeClasses.
3182
+ classes[`shape-${this.shape}`] = true;
3183
+
2887
3184
  return u$1`
2888
- <div class="container" part="bibContainer">
3185
+ <div class="${e$2(classes)}" part="bibContainer">
2889
3186
  <slot></slot>
2890
3187
  </div>
2891
3188
  `;
@@ -2894,21 +3191,21 @@ class AuroDropdownBib extends i {
2894
3191
 
2895
3192
  var dropdownVersion = '3.0.0';
2896
3193
 
2897
- var shapeSizeCss = i$2`.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}`;
3194
+ var shapeSizeCss = i$2`.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}`;
2898
3195
 
2899
- var colorCss$1 = i$2`: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)}`;
3196
+ var colorCss$1 = i$2`: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)}`;
2900
3197
 
2901
- var classicColorCss = i$2`: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))}`;
3198
+ var classicColorCss = i$2``;
2902
3199
 
2903
- var classicLayoutCss = i$2`: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)}`;
3200
+ var classicLayoutCss = i$2`: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%}`;
2904
3201
 
2905
- var styleEmphasizedCss = i$2`: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))}`;
3202
+ var styleEmphasizedCss = i$2`: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)}`;
2906
3203
 
2907
- var styleSnowflakeCss = i$2`: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)}`;
3204
+ var styleSnowflakeCss = i$2`: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)}`;
2908
3205
 
2909
- var colorCss = i$2`: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)}`;
3206
+ var colorCss = i$2`: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)}`;
2910
3207
 
2911
- var styleCss = i$2`.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}`;
3208
+ var styleCss = i$2`: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}`;
2912
3209
 
2913
3210
  var tokensCss = i$2`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
2914
3211
 
@@ -3149,18 +3446,21 @@ class AuroElement extends i {
3149
3446
  }
3150
3447
 
3151
3448
  resetShapeClasses() {
3152
- if (this.shape && this.size) {
3153
- const wrapper = this.shadowRoot.querySelector('.wrapper');
3449
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3154
3450
 
3155
- if (wrapper) {
3156
- wrapper.classList.forEach((className) => {
3157
- if (className.startsWith('shape-')) {
3158
- wrapper.classList.remove(className);
3159
- }
3160
- });
3451
+ if (wrapper) {
3452
+ wrapper.classList.forEach((className) => {
3453
+ if (className.startsWith('shape-')) {
3454
+ wrapper.classList.remove(className);
3455
+ }
3456
+ });
3161
3457
 
3162
- wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3163
- }
3458
+ }
3459
+
3460
+ if (this.shape && this.size) {
3461
+ wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3462
+ } else {
3463
+ wrapper.classList.add('shape-none');
3164
3464
  }
3165
3465
  }
3166
3466
 
@@ -3210,10 +3510,8 @@ class AuroElement extends i {
3210
3510
  // See LICENSE in the project root for license information.
3211
3511
 
3212
3512
 
3213
- /**
3214
- * @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
3513
+ /*
3215
3514
  * @slot - Default slot for the popover content.
3216
- * @slot label - Defines the content of the label.
3217
3515
  * @slot helpText - Defines the content of the helpText.
3218
3516
  * @slot trigger - Defines the content of the trigger.
3219
3517
  * @csspart trigger - The trigger content container.
@@ -3232,23 +3530,25 @@ class AuroDropdown extends AuroElement {
3232
3530
  this.matchWidth = false;
3233
3531
  this.noHideOnThisFocusLoss = false;
3234
3532
 
3235
- this.errorMessage = ''; // TODO!
3533
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3236
3534
 
3237
3535
  // Layout Config
3238
- this.layout = 'classic';
3239
- this.shape = 'rounded';
3240
- this.size = 'xl';
3536
+ this.layout = undefined;
3537
+ this.shape = undefined;
3538
+ this.size = undefined;
3539
+
3241
3540
  this.parentBorder = false;
3242
3541
 
3243
- this.privateDefaults();
3244
- }
3542
+ /** @private */
3543
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
3245
3544
 
3246
- get commonLabelClasses() {
3247
- return {
3248
- // 'withValue': this.value && this.value.length > 0
3249
- };
3545
+ this.privateDefaults();
3250
3546
  }
3251
3547
 
3548
+ /**
3549
+ * @private
3550
+ * @returns {object} Class definition for the wrapper element.
3551
+ */
3252
3552
  get commonWrapperClasses() {
3253
3553
  return {
3254
3554
  'trigger': true,
@@ -3266,13 +3566,10 @@ class AuroDropdown extends AuroElement {
3266
3566
  privateDefaults() {
3267
3567
  this.chevron = false;
3268
3568
  this.disabled = false;
3569
+ this.disableFocusTrap = false;
3269
3570
  this.error = false;
3270
- this.inset = false;
3271
- this.rounded = false;
3272
3571
  this.tabIndex = 0;
3273
3572
  this.noToggle = false;
3274
- this.a11yAutocomplete = 'none';
3275
- this.labeled = true;
3276
3573
  this.a11yRole = 'button';
3277
3574
  this.onDark = false;
3278
3575
  this.showTriggerBorders = true;
@@ -3368,6 +3665,18 @@ class AuroDropdown extends AuroElement {
3368
3665
  this.floater.showBib();
3369
3666
  }
3370
3667
 
3668
+ /**
3669
+ * When bib is open, focus on the first element inside of bib.
3670
+ * If not, trigger element will get focus.
3671
+ */
3672
+ focus() {
3673
+ if (this.isPopoverVisible && this.focusTrap) {
3674
+ this.focusTrap.focusFirstElement();
3675
+ } else {
3676
+ this.trigger.focus();
3677
+ }
3678
+ }
3679
+
3371
3680
  // function to define props used within the scope of this component
3372
3681
  static get properties() {
3373
3682
  return {
@@ -3381,6 +3690,15 @@ class AuroDropdown extends AuroElement {
3381
3690
  reflect: true
3382
3691
  },
3383
3692
 
3693
+ /**
3694
+ * If declared, the dropdown will only show by calling the API .show() public method.
3695
+ * @default false
3696
+ */
3697
+ disableEventShow: {
3698
+ type: Boolean,
3699
+ reflect: true
3700
+ },
3701
+
3384
3702
  /**
3385
3703
  * If declared, applies a border around the trigger slot.
3386
3704
  */
@@ -3399,17 +3717,17 @@ class AuroDropdown extends AuroElement {
3399
3717
  },
3400
3718
 
3401
3719
  /**
3402
- * If declared, the dropdown will be styled with the common theme.
3720
+ * If declared, the dropdown is not interactive.
3403
3721
  */
3404
- common: {
3722
+ disabled: {
3405
3723
  type: Boolean,
3406
3724
  reflect: true
3407
3725
  },
3408
3726
 
3409
3727
  /**
3410
- * If declared, the dropdown is not interactive.
3728
+ * If declared, the focus trap inside of bib will be turned off.
3411
3729
  */
3412
- disabled: {
3730
+ disableFocusTrap: {
3413
3731
  type: Boolean,
3414
3732
  reflect: true
3415
3733
  },
@@ -3454,22 +3772,6 @@ class AuroDropdown extends AuroElement {
3454
3772
  reflect: true
3455
3773
  },
3456
3774
 
3457
- /**
3458
- * Makes the trigger to be full width of its parent container.
3459
- */
3460
- fluid: {
3461
- type: Boolean,
3462
- reflect: true
3463
- },
3464
-
3465
- /**
3466
- * If declared, will apply padding around trigger slot content.
3467
- */
3468
- inset: {
3469
- type: Boolean,
3470
- reflect: true
3471
- },
3472
-
3473
3775
  /**
3474
3776
  * If true, the dropdown bib is displayed.
3475
3777
  */
@@ -3513,15 +3815,6 @@ class AuroDropdown extends AuroElement {
3513
3815
  reflect: true
3514
3816
  },
3515
3817
 
3516
- /**
3517
- * Defines if there is a label preset.
3518
- * @private
3519
- */
3520
- labeled: {
3521
- type: Boolean,
3522
- reflect: true
3523
- },
3524
-
3525
3818
  /**
3526
3819
  * Defines if the trigger should size based on the parent element providing the border UI.
3527
3820
  * @private
@@ -3582,6 +3875,9 @@ class AuroDropdown extends AuroElement {
3582
3875
  reflect: true
3583
3876
  },
3584
3877
 
3878
+ /**
3879
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3880
+ */
3585
3881
  onSlotChange: {
3586
3882
  type: Function,
3587
3883
  reflect: false
@@ -3596,14 +3892,6 @@ class AuroDropdown extends AuroElement {
3596
3892
  reflect: true
3597
3893
  },
3598
3894
 
3599
- /**
3600
- * If declared, will apply border-radius to trigger and default slots.
3601
- */
3602
- rounded: {
3603
- type: Boolean,
3604
- reflect: true
3605
- },
3606
-
3607
3895
  /**
3608
3896
  * @private
3609
3897
  */
@@ -3618,22 +3906,14 @@ class AuroDropdown extends AuroElement {
3618
3906
  type: String || undefined,
3619
3907
  attribute: false,
3620
3908
  reflect: false
3621
- },
3622
-
3623
- /**
3624
- * The value for the aria-autocomplete attribute of the trigger element.
3625
- */
3626
- a11yAutocomplete: {
3627
- type: String,
3628
- attribute: false,
3629
3909
  }
3630
3910
  };
3631
3911
  }
3632
3912
 
3633
3913
  static get styles() {
3634
3914
  return [
3635
- colorCss$1,
3636
3915
  tokensCss$1,
3916
+ colorCss$1,
3637
3917
 
3638
3918
  // default layout
3639
3919
  classicColorCss,
@@ -3695,13 +3975,27 @@ class AuroDropdown extends AuroElement {
3695
3975
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
3696
3976
  this.handleTriggerContentSlotChange();
3697
3977
  }
3978
+ }
3698
3979
 
3980
+ /**
3981
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
3982
+ * @private
3983
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
3984
+ */
3985
+ handleDropdownToggle(event) {
3986
+ this.updateFocusTrap();
3987
+ this.isPopoverVisible = event.detail.expanded;
3988
+ const eventType = event.detail.eventType || "unknown";
3989
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
3990
+ this.trigger.focus();
3991
+ }
3699
3992
  }
3700
3993
 
3701
3994
  firstUpdated() {
3702
3995
 
3703
3996
  // Configure the floater to, this will generate the ID for the bib
3704
3997
  this.floater.configure(this, 'auroDropdown');
3998
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
3705
3999
 
3706
4000
  /**
3707
4001
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -3761,6 +4055,27 @@ class AuroDropdown extends AuroElement {
3761
4055
  this.hasFocus = true;
3762
4056
  }
3763
4057
 
4058
+ /**
4059
+ * @private
4060
+ */
4061
+ updateFocusTrap() {
4062
+ // If the dropdown is open, create a focus trap and focus the first element
4063
+ if (this.isPopoverVisible && !this.disableFocusTrap) {
4064
+ this.focusTrap = new FocusTrap(this.bibContent);
4065
+ this.focusTrap.focusFirstElement();
4066
+ return;
4067
+ }
4068
+
4069
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
4070
+ if (!this.focusTrap) {
4071
+ return;
4072
+ }
4073
+
4074
+ // If the dropdown is not open, disconnect the focus trap if it exists
4075
+ this.focusTrap.disconnect();
4076
+ this.focusTrap = undefined;
4077
+ }
4078
+
3764
4079
  /**
3765
4080
  * Function to support @focusout event.
3766
4081
  * @private
@@ -3921,14 +4236,13 @@ class AuroDropdown extends AuroElement {
3921
4236
  * @returns {void}
3922
4237
  */
3923
4238
  handleTriggerContentSlotChange(event) {
3924
-
3925
4239
  this.floater.handleTriggerTabIndex();
3926
4240
 
3927
4241
  // Get the trigger
3928
4242
  const trigger = this.shadowRoot.querySelector('#trigger');
3929
4243
 
3930
4244
  // Get the trigger slot
3931
- const triggerSlot = this.shadowRoot.querySelector('.triggerContent slot');
4245
+ const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
3932
4246
 
3933
4247
  // If there's a trigger slot
3934
4248
  if (triggerSlot) {
@@ -3991,7 +4305,6 @@ class AuroDropdown extends AuroElement {
3991
4305
  *
3992
4306
  * @private
3993
4307
  * @method handleDefaultSlot
3994
- * @param {Event} event - The event object representing the slot change.
3995
4308
  * @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
3996
4309
  */
3997
4310
  handleDefaultSlot() {
@@ -4001,29 +4314,6 @@ class AuroDropdown extends AuroElement {
4001
4314
  }
4002
4315
  }
4003
4316
 
4004
- /**
4005
- * @private
4006
- * @method handleLabelSlotChange
4007
- * @param {event} event - The event object representing the slot change.
4008
- * @description Handles the slot change event for the label slot.
4009
- */
4010
- handleLabelSlotChange (event) {
4011
-
4012
- // Get the nodes from the event
4013
- const nodes = event.target.assignedNodes();
4014
-
4015
- // Guard clause for no nodes
4016
- if (!nodes) {
4017
- return;
4018
- }
4019
-
4020
- // Convert the nodes to a measurable array so we can get the length
4021
- const nodesArr = Array.from(nodes);
4022
-
4023
- // If the nodes array has a length, the dropdown is labeled
4024
- this.labeled = nodesArr.length > 0;
4025
- }
4026
-
4027
4317
  /**
4028
4318
  * Returns HTML for the common portion of the layouts.
4029
4319
  * @private
@@ -4038,22 +4328,17 @@ class AuroDropdown extends AuroElement {
4038
4328
  class="${e$2(this.commonWrapperClasses)}" part="wrapper"
4039
4329
  tabindex="${this.tabIndex}"
4040
4330
  role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
4041
- aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4042
- aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
4331
+ aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4332
+ aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
4043
4333
  aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
4044
4334
  @focusin="${this.handleFocusin}"
4045
4335
  @blur="${this.handleFocusOut}">
4046
- <div class="triggerContentWrapper">
4047
- <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
4048
- <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
4049
- </label>
4050
- <div class="triggerContent">
4051
- <slot
4052
- name="trigger"
4053
- @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4054
- </div>
4336
+ <div class="triggerContentWrapper" id="triggerLabel">
4337
+ <slot
4338
+ name="trigger"
4339
+ @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4055
4340
  </div>
4056
- ${this.chevron || this.common ? u$1`
4341
+ ${this.chevron ? u$1`
4057
4342
  <div
4058
4343
  id="showStateIcon"
4059
4344
  class="chevron"
@@ -4074,11 +4359,9 @@ class AuroDropdown extends AuroElement {
4074
4359
  <div id="bibSizer" part="size"></div>
4075
4360
  <${this.dropdownBibTag}
4076
4361
  id="bib"
4362
+ shape="${this.shape}"
4077
4363
  ?data-show="${this.isPopoverVisible}"
4078
- ?isfullscreen="${this.isBibFullscreen}"
4079
- ?common="${this.common}"
4080
- ?rounded="${this.common || this.rounded}"
4081
- ?inset="${this.common || this.inset}">
4364
+ ?isfullscreen="${this.isBibFullscreen}">
4082
4365
  <div class="slotContent">
4083
4366
  <slot @slotchange="${this.handleDefaultSlot}"></slot>
4084
4367
  </div>
@@ -4093,62 +4376,13 @@ class AuroDropdown extends AuroElement {
4093
4376
  * @returns {html} - Returns HTML for the classic layout.
4094
4377
  */
4095
4378
  renderLayoutClassic() {
4379
+ // TODO: check with Doug why this was never used?
4380
+ const helpTextClasses = {
4381
+ 'helpText': true
4382
+ };
4096
4383
 
4097
4384
  return u$1`
4098
- <div>
4099
- <div
4100
- id="trigger"
4101
- class="trigger"
4102
- part="trigger"
4103
- tabindex="${this.tabIndex}"
4104
- ?showBorder="${this.showTriggerBorders}"
4105
- role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
4106
- aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4107
- aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
4108
- aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
4109
- >
4110
- <div class="triggerContentWrapper">
4111
- <label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
4112
- <slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
4113
- </label>
4114
- <div class="triggerContent">
4115
- <slot
4116
- name="trigger"
4117
- @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4118
- </div>
4119
- </div>
4120
- ${this.chevron || this.common ? u$1`
4121
- <div
4122
- id="showStateIcon"
4123
- part="chevron">
4124
- <${this.iconTag}
4125
- category="interface"
4126
- name="chevron-down"
4127
- ?onDark="${this.onDark}"
4128
- variant="${this.disabled ? 'disabled' : 'muted'}">
4129
- >
4130
- </${this.iconTag}>
4131
- </div>
4132
- ` : undefined }
4133
- </div>
4134
- <${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
4135
- <slot name="helpText"></slot>
4136
- </${this.helpTextTag}>
4137
-
4138
- <div id="bibSizer" part="size"></div>
4139
- <${this.dropdownBibTag}
4140
- id="bib"
4141
- ?data-show="${this.isPopoverVisible}"
4142
- ?isfullscreen="${this.isBibFullscreen}"
4143
- ?common="${this.common}"
4144
- ?rounded="${this.common || this.rounded}"
4145
- ?inset="${this.common || this.inset}"
4146
- >
4147
- <div class="slotContent">
4148
- <slot @slotchange="${this.handleDefaultSlot}"></slot>
4149
- </div>
4150
- </${this.dropdownBibTag}>
4151
- </div>
4385
+ ${this.renderBasicHtml(helpTextClasses)}
4152
4386
  `;
4153
4387
  }
4154
4388