@aurodesignsystem-dev/auro-formkit 0.0.0-pr741.0 → 0.0.0-pr750.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/components/bibtemplate/dist/index.js +1 -1
  2. package/components/bibtemplate/dist/registered.js +1 -1
  3. package/components/checkbox/demo/api.html +16 -10
  4. package/components/checkbox/demo/api.min.js +11 -11
  5. package/components/checkbox/demo/index.html +16 -10
  6. package/components/checkbox/demo/index.min.js +11 -11
  7. package/components/checkbox/demo/readme.html +16 -9
  8. package/components/checkbox/dist/index.js +11 -11
  9. package/components/checkbox/dist/registered.js +11 -11
  10. package/components/combobox/demo/api.html +16 -10
  11. package/components/combobox/demo/api.md +12 -6
  12. package/components/combobox/demo/api.min.js +411 -103
  13. package/components/combobox/demo/index.html +16 -10
  14. package/components/combobox/demo/index.min.js +411 -103
  15. package/components/combobox/demo/readme.html +16 -9
  16. package/components/combobox/dist/index.js +374 -91
  17. package/components/combobox/dist/registered.js +374 -91
  18. package/components/counter/demo/api.html +16 -10
  19. package/components/counter/demo/api.md +140 -7
  20. package/components/counter/demo/api.min.js +1145 -987
  21. package/components/counter/demo/index.html +16 -10
  22. package/components/counter/demo/index.md +82 -0
  23. package/components/counter/demo/index.min.js +1145 -987
  24. package/components/counter/demo/readme.html +16 -9
  25. package/components/counter/dist/auro-counter-group.d.ts +64 -23
  26. package/components/counter/dist/auro-counter.d.ts +10 -0
  27. package/components/counter/dist/index.js +1145 -987
  28. package/components/counter/dist/registered.js +1145 -987
  29. package/components/datepicker/demo/api.html +16 -10
  30. package/components/datepicker/demo/api.min.js +374 -91
  31. package/components/datepicker/demo/index.html +16 -10
  32. package/components/datepicker/demo/index.min.js +374 -91
  33. package/components/datepicker/demo/readme.html +16 -9
  34. package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
  35. package/components/datepicker/dist/index.js +374 -91
  36. package/components/datepicker/dist/registered.js +374 -91
  37. package/components/dropdown/demo/api.html +16 -10
  38. package/components/dropdown/demo/api.md +77 -267
  39. package/components/dropdown/demo/api.min.js +331 -64
  40. package/components/dropdown/demo/index.html +16 -10
  41. package/components/dropdown/demo/index.md +45 -363
  42. package/components/dropdown/demo/index.min.js +331 -64
  43. package/components/dropdown/demo/readme.html +16 -9
  44. package/components/dropdown/dist/auro-dropdown.d.ts +35 -67
  45. package/components/dropdown/dist/index.js +331 -64
  46. package/components/dropdown/dist/registered.js +331 -64
  47. package/components/form/demo/api.html +16 -9
  48. package/components/form/demo/autocomplete.html +19 -3
  49. package/components/form/demo/index.html +16 -9
  50. package/components/form/demo/readme.html +16 -9
  51. package/components/form/demo/working.html +19 -13
  52. package/components/helptext/dist/index.js +1 -1
  53. package/components/helptext/dist/registered.js +1 -1
  54. package/components/input/demo/api.html +16 -10
  55. package/components/input/demo/api.md +1 -1
  56. package/components/input/demo/api.min.js +14 -14
  57. package/components/input/demo/index.html +16 -10
  58. package/components/input/demo/index.min.js +14 -14
  59. package/components/input/demo/readme.html +16 -9
  60. package/components/input/dist/base-input.d.ts +1 -1
  61. package/components/input/dist/index.js +14 -14
  62. package/components/input/dist/registered.js +14 -14
  63. package/components/menu/demo/api.html +16 -32
  64. package/components/menu/demo/api.md +1 -1
  65. package/components/menu/demo/api.min.js +37 -12
  66. package/components/menu/demo/index.html +16 -10
  67. package/components/menu/demo/index.min.js +37 -12
  68. package/components/menu/demo/readme.html +16 -9
  69. package/components/menu/dist/auro-menu.d.ts +13 -2
  70. package/components/menu/dist/index.js +37 -12
  71. package/components/menu/dist/registered.js +37 -12
  72. package/components/radio/demo/api.html +16 -10
  73. package/components/radio/demo/api.md +0 -1
  74. package/components/radio/demo/api.min.js +61 -76
  75. package/components/radio/demo/index.html +16 -10
  76. package/components/radio/demo/index.min.js +61 -76
  77. package/components/radio/demo/readme.html +16 -9
  78. package/components/radio/dist/auro-radio.d.ts +8 -11
  79. package/components/radio/dist/index.js +61 -76
  80. package/components/radio/dist/registered.js +61 -76
  81. package/components/select/demo/api.html +16 -10
  82. package/components/select/demo/api.js +0 -2
  83. package/components/select/demo/api.md +53 -51
  84. package/components/select/demo/api.min.js +491 -326
  85. package/components/select/demo/index.html +16 -11
  86. package/components/select/demo/index.md +6 -158
  87. package/components/select/demo/index.min.js +491 -314
  88. package/components/select/demo/readme.html +16 -9
  89. package/components/select/dist/auro-select.d.ts +33 -8
  90. package/components/select/dist/index.js +454 -302
  91. package/components/select/dist/registered.js +454 -302
  92. package/package.json +26 -25
@@ -2241,6 +2241,267 @@ class AuroFloatingUI {
2241
2241
  }
2242
2242
  }
2243
2243
 
2244
+ // Selectors for focusable elements
2245
+ const FOCUSABLE_SELECTORS = [
2246
+ 'a[href]',
2247
+ 'button:not([disabled])',
2248
+ 'textarea:not([disabled])',
2249
+ 'input:not([disabled])',
2250
+ 'select:not([disabled])',
2251
+ '[role="tab"]:not([disabled])',
2252
+ '[role="link"]:not([disabled])',
2253
+ '[role="button"]:not([disabled])',
2254
+ '[tabindex]:not([tabindex="-1"])',
2255
+ '[contenteditable]:not([contenteditable="false"])'
2256
+ ];
2257
+
2258
+ // List of custom components that are known to be focusable
2259
+ const FOCUSABLE_COMPONENTS = [
2260
+ 'auro-checkbox',
2261
+ 'auro-radio',
2262
+ 'auro-dropdown',
2263
+ 'auro-button',
2264
+ 'auro-combobox',
2265
+ 'auro-input',
2266
+ 'auro-counter',
2267
+ 'auro-menu',
2268
+ 'auro-select',
2269
+ 'auro-datepicker',
2270
+ 'auro-hyperlink',
2271
+ 'auro-accordion',
2272
+ ];
2273
+
2274
+ /**
2275
+ * Determines if a given element is a custom focusable component.
2276
+ * Returns true if the element matches a known focusable component and is not disabled.
2277
+ *
2278
+ * @param {HTMLElement} element The element to check for focusability.
2279
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
2280
+ */
2281
+ function isFocusableComponent(element) {
2282
+ const componentName = element.tagName.toLowerCase();
2283
+
2284
+ // Guard Clause: Element is a focusable component
2285
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
2286
+
2287
+ // Guard Clause: Element is not disabled
2288
+ if (element.hasAttribute('disabled')) return false;
2289
+
2290
+ // Guard Clause: The element is a hyperlink and has no href attribute
2291
+ if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
2292
+
2293
+ // If all guard clauses pass, the element is a focusable component
2294
+ return true;
2295
+ }
2296
+
2297
+ /**
2298
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2299
+ * Returns a unique, ordered array of elements that can receive focus.
2300
+ *
2301
+ * @param {HTMLElement} container The container to search within
2302
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2303
+ */
2304
+ function getFocusableElements(container) {
2305
+ // Get elements in DOM order by walking the tree
2306
+ const orderedFocusableElements = [];
2307
+
2308
+ // Define a recursive function to collect focusable elements in DOM order
2309
+ const collectFocusableElements = (root) => {
2310
+ // Check if current element is focusable
2311
+ if (root.nodeType === Node.ELEMENT_NODE) {
2312
+ // Check if this is a custom component that is focusable
2313
+ const isComponentFocusable = isFocusableComponent(root);
2314
+
2315
+ if (isComponentFocusable) {
2316
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
2317
+ orderedFocusableElements.push(root);
2318
+ return; // Skip traversing inside this component
2319
+ }
2320
+
2321
+ // Check if the element itself matches any selector
2322
+ for (const selector of FOCUSABLE_SELECTORS) {
2323
+ if (root.matches?.(selector)) {
2324
+ orderedFocusableElements.push(root);
2325
+ break; // Once we know it's focusable, no need to check other selectors
2326
+ }
2327
+ }
2328
+
2329
+ // Process shadow DOM only for non-Auro components
2330
+ if (root.shadowRoot) {
2331
+ // Process shadow DOM children in order
2332
+ if (root.shadowRoot.children) {
2333
+ Array.from(root.shadowRoot.children).forEach(child => {
2334
+ collectFocusableElements(child);
2335
+ });
2336
+ }
2337
+ }
2338
+
2339
+ // Process slots and their assigned nodes in order
2340
+ if (root.tagName === 'SLOT') {
2341
+ const assignedNodes = root.assignedNodes({ flatten: true });
2342
+ for (const node of assignedNodes) {
2343
+ collectFocusableElements(node);
2344
+ }
2345
+ } else {
2346
+ // Process light DOM children in order
2347
+ if (root.children) {
2348
+ Array.from(root.children).forEach(child => {
2349
+ collectFocusableElements(child);
2350
+ });
2351
+ }
2352
+ }
2353
+ }
2354
+ };
2355
+
2356
+ // Start the traversal from the container
2357
+ collectFocusableElements(container);
2358
+
2359
+ // Remove duplicates that might have been collected through different paths
2360
+ // while preserving order
2361
+ const uniqueElements = [];
2362
+ const seen = new Set();
2363
+
2364
+ for (const element of orderedFocusableElements) {
2365
+ if (!seen.has(element)) {
2366
+ seen.add(element);
2367
+ uniqueElements.push(element);
2368
+ }
2369
+ }
2370
+
2371
+ return uniqueElements;
2372
+ }
2373
+
2374
+ /**
2375
+ * FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
2376
+ * It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
2377
+ */
2378
+ class FocusTrap {
2379
+ /**
2380
+ * Creates a new FocusTrap instance for the given container element.
2381
+ * Initializes event listeners and prepares the container for focus management.
2382
+ *
2383
+ * @param {HTMLElement} container The DOM element to trap focus within.
2384
+ * @throws {Error} If the provided container is not a valid HTMLElement.
2385
+ */
2386
+ constructor(container) {
2387
+ if (!container || !(container instanceof HTMLElement)) {
2388
+ throw new Error("FocusTrap requires a valid HTMLElement.");
2389
+ }
2390
+
2391
+ this.container = container;
2392
+ this.tabDirection = 'forward'; // or 'backward'
2393
+
2394
+ this._init();
2395
+ }
2396
+
2397
+ /**
2398
+ * Initializes the focus trap by setting up event listeners and attributes on the container.
2399
+ * Prepares the container for focus management, including support for shadow DOM and inert attributes.
2400
+ *
2401
+ * @private
2402
+ */
2403
+ _init() {
2404
+
2405
+ // Add inert attribute to prevent focusing programmatically as well (if supported)
2406
+ if ('inert' in HTMLElement.prototype) {
2407
+ this.container.inert = false; // Ensure the container isn't inert
2408
+ this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
2409
+ }
2410
+
2411
+ // Track tab direction
2412
+ this.container.addEventListener('keydown', this._onKeydown);
2413
+ }
2414
+
2415
+ /**
2416
+ * Handles keydown events to manage tab navigation within the container.
2417
+ * Ensures that focus wraps around when reaching the first or last focusable element.
2418
+ *
2419
+ * @param {KeyboardEvent} e The keyboard event triggered by user interaction.
2420
+ * @private
2421
+ */
2422
+ _onKeydown = (e) => {
2423
+
2424
+ if (e.key === 'Tab') {
2425
+
2426
+ // Set the tab direction based on the key pressed
2427
+ this.tabDirection = e.shiftKey ? 'backward' : 'forward';
2428
+
2429
+ // Get the active element(s) in the document and shadow root
2430
+ // This will include the active element in the shadow DOM if it exists
2431
+ // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
2432
+ let activeElement = document.activeElement;
2433
+ const actives = [activeElement];
2434
+ while (activeElement?.shadowRoot?.activeElement) {
2435
+ actives.push(activeElement.shadowRoot.activeElement);
2436
+ activeElement = activeElement.shadowRoot.activeElement;
2437
+ }
2438
+
2439
+ // Update the focusable elements
2440
+ const focusables = this._getFocusableElements();
2441
+
2442
+ // If we're at either end of the focusable elements, wrap around to the other end
2443
+ const focusIndex =
2444
+ (actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
2445
+ ? focusables.length - 1
2446
+ : actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
2447
+ ? 0
2448
+ : null;
2449
+
2450
+ if (focusIndex !== null) {
2451
+ focusables[focusIndex].focus();
2452
+ e.preventDefault(); // Prevent default tab behavior
2453
+ e.stopPropagation(); // Stop the event from bubbling up
2454
+ }
2455
+ }
2456
+ };
2457
+
2458
+ /**
2459
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2460
+ * Returns a unique, ordered array of elements that can receive focus.
2461
+ *
2462
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2463
+ * @private
2464
+ */
2465
+ _getFocusableElements() {
2466
+ // Use the imported utility function to get focusable elements
2467
+ const elements = getFocusableElements(this.container);
2468
+
2469
+ // Filter out any elements with the 'focus-bookend' class
2470
+ return elements;
2471
+ }
2472
+
2473
+ /**
2474
+ * Moves focus to the first focusable element within the container.
2475
+ * Useful for setting initial focus when activating the focus trap.
2476
+ */
2477
+ focusFirstElement() {
2478
+ const focusables = this._getFocusableElements();
2479
+ if (focusables.length) focusables[0].focus();
2480
+ }
2481
+
2482
+ /**
2483
+ * Moves focus to the last focusable element within the container.
2484
+ * Useful for setting focus when deactivating or cycling focus in reverse.
2485
+ */
2486
+ focusLastElement() {
2487
+ const focusables = this._getFocusableElements();
2488
+ if (focusables.length) focusables[focusables.length - 1].focus();
2489
+ }
2490
+
2491
+ /**
2492
+ * Removes event listeners and attributes added by the focus trap.
2493
+ * Call this method to clean up when the focus trap is no longer needed.
2494
+ */
2495
+ disconnect() {
2496
+
2497
+ if (this.container.hasAttribute('data-focus-trap-container')) {
2498
+ this.container.removeAttribute('data-focus-trap-container');
2499
+ }
2500
+
2501
+ this.container.removeEventListener('keydown', this._onKeydown);
2502
+ }
2503
+ }
2504
+
2244
2505
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2245
2506
  // See LICENSE in the project root for license information.
2246
2507
 
@@ -2879,11 +3140,11 @@ var dropdownVersion = '3.0.0';
2879
3140
 
2880
3141
  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}`;
2881
3142
 
2882
- var colorCss$1 = css`: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)}`;
3143
+ 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)}`;
2883
3144
 
2884
3145
  var classicColorCss = css``;
2885
3146
 
2886
- 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([layout*=classic]:not([simple])) .triggerContentWrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([layout*=classic][matchwidth]) #bibSizer{width:100%}:host([layout*=classic][disabled]){pointer-events:none}`;
3147
+ var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{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%}`;
2887
3148
 
2888
3149
  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)}`;
2889
3150
 
@@ -2891,7 +3152,7 @@ var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex:1;fle
2891
3152
 
2892
3153
  var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
2893
3154
 
2894
- var styleCss = css`.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}`;
3155
+ 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}`;
2895
3156
 
2896
3157
  var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
2897
3158
 
@@ -3196,10 +3457,8 @@ class AuroElement extends LitElement {
3196
3457
  // See LICENSE in the project root for license information.
3197
3458
 
3198
3459
 
3199
- /**
3200
- * @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
3460
+ /*
3201
3461
  * @slot - Default slot for the popover content.
3202
- * @slot label - Defines the content of the label.
3203
3462
  * @slot helpText - Defines the content of the helpText.
3204
3463
  * @slot trigger - Defines the content of the trigger.
3205
3464
  * @csspart trigger - The trigger content container.
@@ -3218,18 +3477,22 @@ class AuroDropdown extends AuroElement {
3218
3477
  this.matchWidth = false;
3219
3478
  this.noHideOnThisFocusLoss = false;
3220
3479
 
3221
- this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
3480
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3222
3481
 
3223
3482
  // Layout Config
3224
- this.layout = 'classic';
3225
- this.shape = 'classic';
3226
- this.size = 'xl';
3483
+ this.layout = undefined;
3484
+ this.shape = undefined;
3485
+ this.size = undefined;
3227
3486
 
3228
3487
  this.parentBorder = false;
3229
3488
 
3230
3489
  this.privateDefaults();
3231
3490
  }
3232
3491
 
3492
+ /**
3493
+ * @private
3494
+ * @returns {object} Class definition for the wrapper element.
3495
+ */
3233
3496
  get commonWrapperClasses() {
3234
3497
  return {
3235
3498
  'trigger': true,
@@ -3247,13 +3510,10 @@ class AuroDropdown extends AuroElement {
3247
3510
  privateDefaults() {
3248
3511
  this.chevron = false;
3249
3512
  this.disabled = false;
3513
+ this.disableFocusTrap = false;
3250
3514
  this.error = false;
3251
- this.inset = false;
3252
- this.rounded = false;
3253
3515
  this.tabIndex = 0;
3254
3516
  this.noToggle = false;
3255
- this.a11yAutocomplete = 'none';
3256
- this.labeled = true;
3257
3517
  this.a11yRole = 'button';
3258
3518
  this.onDark = false;
3259
3519
  this.showTriggerBorders = true;
@@ -3349,6 +3609,18 @@ class AuroDropdown extends AuroElement {
3349
3609
  this.floater.showBib();
3350
3610
  }
3351
3611
 
3612
+ /**
3613
+ * When bib is open, focus on the first element inside of bib.
3614
+ * If not, trigger element will get focus.
3615
+ */
3616
+ focus() {
3617
+ if (this.isPopoverVisible && this.focusTrap) {
3618
+ this.focusTrap.focusFirstElement();
3619
+ } else {
3620
+ this.trigger.focus();
3621
+ }
3622
+ }
3623
+
3352
3624
  // function to define props used within the scope of this component
3353
3625
  static get properties() {
3354
3626
  return {
@@ -3362,6 +3634,15 @@ class AuroDropdown extends AuroElement {
3362
3634
  reflect: true
3363
3635
  },
3364
3636
 
3637
+ /**
3638
+ * If declared, the dropdown will only show by calling the API .show() public method.
3639
+ * @default false
3640
+ */
3641
+ disableEventShow: {
3642
+ type: Boolean,
3643
+ reflect: true
3644
+ },
3645
+
3365
3646
  /**
3366
3647
  * If declared, applies a border around the trigger slot.
3367
3648
  */
@@ -3380,17 +3661,17 @@ class AuroDropdown extends AuroElement {
3380
3661
  },
3381
3662
 
3382
3663
  /**
3383
- * If declared, the dropdown will be styled with the common theme.
3664
+ * If declared, the dropdown is not interactive.
3384
3665
  */
3385
- common: {
3666
+ disabled: {
3386
3667
  type: Boolean,
3387
3668
  reflect: true
3388
3669
  },
3389
3670
 
3390
3671
  /**
3391
- * If declared, the dropdown is not interactive.
3672
+ * If declared, the focus trap inside of bib will be turned off.
3392
3673
  */
3393
- disabled: {
3674
+ disableFocusTrap: {
3394
3675
  type: Boolean,
3395
3676
  reflect: true
3396
3677
  },
@@ -3435,22 +3716,6 @@ class AuroDropdown extends AuroElement {
3435
3716
  reflect: true
3436
3717
  },
3437
3718
 
3438
- /**
3439
- * Makes the trigger to be full width of its parent container.
3440
- */
3441
- fluid: {
3442
- type: Boolean,
3443
- reflect: true
3444
- },
3445
-
3446
- /**
3447
- * If declared, will apply padding around trigger slot content.
3448
- */
3449
- inset: {
3450
- type: Boolean,
3451
- reflect: true
3452
- },
3453
-
3454
3719
  /**
3455
3720
  * If true, the dropdown bib is displayed.
3456
3721
  */
@@ -3494,15 +3759,6 @@ class AuroDropdown extends AuroElement {
3494
3759
  reflect: true
3495
3760
  },
3496
3761
 
3497
- /**
3498
- * Defines if there is a label preset.
3499
- * @private
3500
- */
3501
- labeled: {
3502
- type: Boolean,
3503
- reflect: true
3504
- },
3505
-
3506
3762
  /**
3507
3763
  * Defines if the trigger should size based on the parent element providing the border UI.
3508
3764
  * @private
@@ -3563,6 +3819,9 @@ class AuroDropdown extends AuroElement {
3563
3819
  reflect: true
3564
3820
  },
3565
3821
 
3822
+ /**
3823
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3824
+ */
3566
3825
  onSlotChange: {
3567
3826
  type: Function,
3568
3827
  reflect: false
@@ -3577,14 +3836,6 @@ class AuroDropdown extends AuroElement {
3577
3836
  reflect: true
3578
3837
  },
3579
3838
 
3580
- /**
3581
- * If declared, will apply border-radius to trigger and default slots.
3582
- */
3583
- rounded: {
3584
- type: Boolean,
3585
- reflect: true
3586
- },
3587
-
3588
3839
  /**
3589
3840
  * @private
3590
3841
  */
@@ -3599,22 +3850,14 @@ class AuroDropdown extends AuroElement {
3599
3850
  type: String || undefined,
3600
3851
  attribute: false,
3601
3852
  reflect: false
3602
- },
3603
-
3604
- /**
3605
- * The value for the aria-autocomplete attribute of the trigger element.
3606
- */
3607
- a11yAutocomplete: {
3608
- type: String,
3609
- attribute: false,
3610
3853
  }
3611
3854
  };
3612
3855
  }
3613
3856
 
3614
3857
  static get styles() {
3615
3858
  return [
3616
- colorCss$1,
3617
3859
  tokensCss$1,
3860
+ colorCss$1,
3618
3861
 
3619
3862
  // default layout
3620
3863
  classicColorCss,
@@ -3677,6 +3920,12 @@ class AuroDropdown extends AuroElement {
3677
3920
  this.handleTriggerContentSlotChange();
3678
3921
  }
3679
3922
 
3923
+ if (changedProperties.has('isPopoverVisible')) {
3924
+ this.updateFocusTrap();
3925
+ if (!this.isPopoverVisible && this.hasFocus) {
3926
+ this.trigger.focus();
3927
+ }
3928
+ }
3680
3929
  }
3681
3930
 
3682
3931
  firstUpdated() {
@@ -3742,6 +3991,27 @@ class AuroDropdown extends AuroElement {
3742
3991
  this.hasFocus = true;
3743
3992
  }
3744
3993
 
3994
+ /**
3995
+ * @private
3996
+ */
3997
+ updateFocusTrap() {
3998
+ // If the dropdown is open, create a focus trap and focus the first element
3999
+ if (this.isPopoverVisible && !this.disableFocusTrap) {
4000
+ this.focusTrap = new FocusTrap(this.bibContent);
4001
+ this.focusTrap.focusFirstElement();
4002
+ return;
4003
+ }
4004
+
4005
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
4006
+ if (!this.focusTrap) {
4007
+ return;
4008
+ }
4009
+
4010
+ // If the dropdown is not open, disconnect the focus trap if it exists
4011
+ this.focusTrap.disconnect();
4012
+ this.focusTrap = undefined;
4013
+ }
4014
+
3745
4015
  /**
3746
4016
  * Function to support @focusout event.
3747
4017
  * @private
@@ -4027,10 +4297,7 @@ class AuroDropdown extends AuroElement {
4027
4297
  id="bib"
4028
4298
  shape="${this.shape}"
4029
4299
  ?data-show="${this.isPopoverVisible}"
4030
- ?isfullscreen="${this.isBibFullscreen}"
4031
- ?common="${this.common}"
4032
- ?rounded="${this.common || this.rounded}"
4033
- ?inset="${this.common || this.inset}">
4300
+ ?isfullscreen="${this.isBibFullscreen}">
4034
4301
  <div class="slotContent">
4035
4302
  <slot @slotchange="${this.handleDefaultSlot}"></slot>
4036
4303
  </div>
@@ -16,17 +16,24 @@
16
16
  <head>
17
17
  <meta charset="UTF-8" />
18
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
- <title>Auro Web Component Generator | auro-form custom element</title>
20
- <link
21
- rel="stylesheet"
22
- type="text/css"
23
- href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"
24
- />
25
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
26
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
19
+ <title>Auro Web Component Demo | auro-form</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-form's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
26
+
27
+ <!-- Design Token Alaska Theme -->
28
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
29
+
30
+ <!-- Webcore Stylesheet Alaska Theme -->
31
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
32
+
33
+ <!-- Demo Specific Styles -->
27
34
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
28
35
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
29
- </head>
36
+ </head>
30
37
  <body class="auro-markdown">
31
38
  <main></main>
32
39
 
@@ -1,9 +1,25 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Demo page for auto-complete</title>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Auro Web Component Demo | auro-form</title>
7
+
8
+ <!-- Prism.js Stylesheet -->
9
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
10
+
11
+ <!-- Legacy reference is still needed to support auro-form's use of legacy token values at this time -->
12
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
13
+
14
+ <!-- Design Token Alaska Theme -->
15
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
16
+
17
+ <!-- Webcore Stylesheet Alaska Theme -->
18
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
19
+
20
+ <!-- Demo Specific Styles -->
21
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
7
23
  </head>
8
24
  <body>
9
25
  <!-- EVERY AUTOCOMPLETE OPTION, auro inputs -->
@@ -16,17 +16,24 @@
16
16
  <head>
17
17
  <meta charset="UTF-8" />
18
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
- <title>Auro Web Component Generator | auro-form custom element</title>
20
- <link
21
- rel="stylesheet"
22
- type="text/css"
23
- href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"
24
- />
25
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css">
26
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/alaska/CSSCustomProperties--alaska.css">
19
+ <title>Auro Web Component Demo | auro-form</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-form's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
26
+
27
+ <!-- Design Token Alaska Theme -->
28
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
29
+
30
+ <!-- Webcore Stylesheet Alaska Theme -->
31
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
32
+
33
+ <!-- Demo Specific Styles -->
27
34
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
28
35
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
29
- </head>
36
+ </head>
30
37
  <body class="auro-markdown">
31
38
  <main></main>
32
39