@aurodesignsystem-dev/auro-formkit 0.0.0-pr1608.1 → 0.0.0-pr1609.0

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 (51) hide show
  1. package/components/checkbox/demo/accessibility.md +4 -15
  2. package/components/checkbox/demo/customize.min.js +17 -53
  3. package/components/checkbox/demo/getting-started.min.js +17 -53
  4. package/components/checkbox/demo/index.min.js +17 -53
  5. package/components/checkbox/dist/auro-checkbox-group.d.ts +0 -13
  6. package/components/checkbox/dist/index.js +17 -53
  7. package/components/checkbox/dist/registered.js +17 -53
  8. package/components/combobox/demo/customize.min.js +3 -3
  9. package/components/combobox/demo/getting-started.min.js +3 -3
  10. package/components/combobox/demo/index.min.js +3 -3
  11. package/components/combobox/dist/index.js +3 -3
  12. package/components/combobox/dist/registered.js +3 -3
  13. package/components/counter/demo/customize.min.js +22 -296
  14. package/components/counter/demo/getting-started.min.js +22 -296
  15. package/components/counter/demo/index.min.js +22 -296
  16. package/components/counter/dist/counterGroupKeyboardStrategy.d.ts +0 -1
  17. package/components/counter/dist/index.js +22 -296
  18. package/components/counter/dist/registered.js +22 -296
  19. package/components/datepicker/demo/customize.min.js +3 -3
  20. package/components/datepicker/demo/getting-started.min.js +3 -3
  21. package/components/datepicker/demo/index.min.js +3 -3
  22. package/components/datepicker/dist/index.js +3 -3
  23. package/components/datepicker/dist/registered.js +3 -3
  24. package/components/dropdown/demo/customize.min.js +1 -1
  25. package/components/dropdown/demo/getting-started.min.js +2 -2
  26. package/components/dropdown/demo/index.min.js +1 -1
  27. package/components/dropdown/dist/index.js +1 -1
  28. package/components/dropdown/dist/registered.js +1 -1
  29. package/components/form/demo/customize.min.js +68 -416
  30. package/components/form/demo/getting-started.min.js +68 -416
  31. package/components/form/demo/index.min.js +68 -416
  32. package/components/form/demo/registerDemoDeps.min.js +68 -416
  33. package/components/input/demo/customize.min.js +1 -1
  34. package/components/input/demo/getting-started.min.js +1 -1
  35. package/components/input/demo/index.min.js +1 -1
  36. package/components/input/dist/index.js +1 -1
  37. package/components/input/dist/registered.js +1 -1
  38. package/components/radio/demo/accessibility.md +4 -13
  39. package/components/radio/demo/customize.min.js +16 -54
  40. package/components/radio/demo/getting-started.min.js +16 -54
  41. package/components/radio/demo/index.min.js +16 -54
  42. package/components/radio/dist/auro-radio-group.d.ts +0 -13
  43. package/components/radio/dist/index.js +16 -54
  44. package/components/radio/dist/registered.js +16 -54
  45. package/components/select/demo/customize.min.js +2 -2
  46. package/components/select/demo/getting-started.min.js +2 -2
  47. package/components/select/demo/index.min.js +2 -2
  48. package/components/select/dist/index.js +2 -2
  49. package/components/select/dist/registered.js +2 -2
  50. package/custom-elements.json +1 -23
  51. package/package.json +1 -1
@@ -1127,7 +1127,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
1127
1127
  }
1128
1128
  };
1129
1129
 
1130
- var formkitVersion$1 = '202609022217';
1130
+ var formkitVersion$1 = '202609022123';
1131
1131
 
1132
1132
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1133
1133
  // See LICENSE in the project root for license information.
@@ -4526,7 +4526,7 @@ class AuroFloatingUI {
4526
4526
  }
4527
4527
 
4528
4528
  // Selectors for focusable elements
4529
- const FOCUSABLE_SELECTORS$1 = [
4529
+ const FOCUSABLE_SELECTORS = [
4530
4530
  "a[href]",
4531
4531
  "button:not([disabled])",
4532
4532
  "textarea:not([disabled])",
@@ -4540,7 +4540,7 @@ const FOCUSABLE_SELECTORS$1 = [
4540
4540
  ];
4541
4541
 
4542
4542
  // List of custom components that are known to be focusable
4543
- const FOCUSABLE_COMPONENTS$1 = [
4543
+ const FOCUSABLE_COMPONENTS = [
4544
4544
  "auro-checkbox",
4545
4545
  "auro-radio",
4546
4546
  "auro-dropdown",
@@ -4562,12 +4562,12 @@ const FOCUSABLE_COMPONENTS$1 = [
4562
4562
  * @param {HTMLElement} element The element to check for focusability.
4563
4563
  * @returns {boolean} True if the element is a focusable custom component, false otherwise.
4564
4564
  */
4565
- function isFocusableComponent$1(element) {
4565
+ function isFocusableComponent(element) {
4566
4566
  const componentName = element.tagName.toLowerCase();
4567
4567
 
4568
4568
  // Guard Clause: Element is a focusable component
4569
4569
  if (
4570
- !FOCUSABLE_COMPONENTS$1.some(
4570
+ !FOCUSABLE_COMPONENTS.some(
4571
4571
  (name) => element.hasAttribute(name) || componentName === name,
4572
4572
  )
4573
4573
  )
@@ -4591,7 +4591,7 @@ function isFocusableComponent$1(element) {
4591
4591
  * @param {HTMLElement} element The element whose tabindex to read.
4592
4592
  * @returns {?number} The numeric tabindex or null if missing/invalid.
4593
4593
  */
4594
- function getNumericTabIndex$1(element) {
4594
+ function getNumericTabIndex(element) {
4595
4595
  const raw = element.getAttribute("tabindex");
4596
4596
  if (raw == null) return null;
4597
4597
 
@@ -4607,7 +4607,7 @@ function getNumericTabIndex$1(element) {
4607
4607
  * @param {HTMLElement} container The container to search within
4608
4608
  * @returns {Array<HTMLElement>} An array of focusable elements within the container.
4609
4609
  */
4610
- function getFocusableElements$1(container) {
4610
+ function getFocusableElements(container) {
4611
4611
  // Get elements in DOM order by walking the tree
4612
4612
  const orderedFocusableElements = [];
4613
4613
 
@@ -4616,7 +4616,7 @@ function getFocusableElements$1(container) {
4616
4616
  // Check if current element is focusable
4617
4617
  if (root.nodeType === Node.ELEMENT_NODE) {
4618
4618
  // Check if this is a custom component that is focusable
4619
- const isComponentFocusable = isFocusableComponent$1(root);
4619
+ const isComponentFocusable = isFocusableComponent(root);
4620
4620
 
4621
4621
  if (isComponentFocusable) {
4622
4622
  // Add the component itself as a focusable element and don't traverse its shadow DOM
@@ -4625,7 +4625,7 @@ function getFocusableElements$1(container) {
4625
4625
  }
4626
4626
 
4627
4627
  // Check if the element itself matches any selector
4628
- for (const selector of FOCUSABLE_SELECTORS$1) {
4628
+ for (const selector of FOCUSABLE_SELECTORS) {
4629
4629
  if (root.matches?.(selector)) {
4630
4630
  orderedFocusableElements.push(root);
4631
4631
  break; // Once we know it's focusable, no need to check other selectors
@@ -4679,20 +4679,20 @@ function getFocusableElements$1(container) {
4679
4679
 
4680
4680
  // First extract elements with valid positive tabindex
4681
4681
  const elementsWithTabindex = uniqueElements.filter((el) => {
4682
- const tabindex = getNumericTabIndex$1(el);
4682
+ const tabindex = getNumericTabIndex(el);
4683
4683
  return tabindex !== null && tabindex > 0;
4684
4684
  });
4685
4685
 
4686
4686
  // Sort these elements by their tabindex value
4687
4687
  elementsWithTabindex.sort((a, b) => {
4688
- const aIndex = getNumericTabIndex$1(a) ?? 0;
4689
- const bIndex = getNumericTabIndex$1(b) ?? 0;
4688
+ const aIndex = getNumericTabIndex(a) ?? 0;
4689
+ const bIndex = getNumericTabIndex(b) ?? 0;
4690
4690
  return aIndex - bIndex;
4691
4691
  });
4692
4692
 
4693
4693
  // Elements without tabindex (preserving their original order)
4694
4694
  const elementsWithoutTabindex = uniqueElements.filter((el) => {
4695
- const tabindex = getNumericTabIndex$1(el);
4695
+ const tabindex = getNumericTabIndex(el);
4696
4696
 
4697
4697
  // Elements without tabindex or with tabindex of 0 stay in DOM order
4698
4698
  return tabindex === null || tabindex === 0;
@@ -5487,7 +5487,7 @@ class AuroHelpText extends i$2 {
5487
5487
  }
5488
5488
  }
5489
5489
 
5490
- var formkitVersion = '202609022217';
5490
+ var formkitVersion = '202609022123';
5491
5491
 
5492
5492
  /**
5493
5493
  * AuroElement is the shared base class for layout-aware Auro form components.
@@ -5787,7 +5787,7 @@ class AuroDropdown extends AuroElement$1 {
5787
5787
  */
5788
5788
  focus() {
5789
5789
  if (this.isPopoverVisible && this.bibContent) {
5790
- const focusables = getFocusableElements$1(this.bibContent);
5790
+ const focusables = getFocusableElements(this.bibContent);
5791
5791
  if (focusables.length > 0) {
5792
5792
  focusables[0].focus();
5793
5793
  }
@@ -5819,7 +5819,7 @@ class AuroDropdown extends AuroElement$1 {
5819
5819
  // wrappers like <div> containing a <button>). If none found, try
5820
5820
  // focusing the element directly (works for custom elements like
5821
5821
  // auro-input that have delegatesFocus or a custom focus() method).
5822
- const descendants = getFocusableElements$1(el);
5822
+ const descendants = getFocusableElements(el);
5823
5823
  if (descendants.length > 0) {
5824
5824
  descendants[0].focus();
5825
5825
  return;
@@ -5831,7 +5831,7 @@ class AuroDropdown extends AuroElement$1 {
5831
5831
  }
5832
5832
  }
5833
5833
  // Fallback: try DOM children (non-slotted content)
5834
- const focusables = getFocusableElements$1(this.trigger);
5834
+ const focusables = getFocusableElements(this.trigger);
5835
5835
  if (focusables.length > 0) {
5836
5836
  focusables[0].focus();
5837
5837
  }
@@ -6510,7 +6510,7 @@ class AuroDropdown extends AuroElement$1 {
6510
6510
  }
6511
6511
 
6512
6512
  // Collect focusable elements from the bib content.
6513
- const focusables = getFocusableElements$1(this.bibContent);
6513
+ const focusables = getFocusableElements(this.bibContent);
6514
6514
 
6515
6515
  // Fallback: try from slotted content directly
6516
6516
  if (!focusables.length) {
@@ -6519,7 +6519,7 @@ class AuroDropdown extends AuroElement$1 {
6519
6519
 
6520
6520
  for (const node of assignedNodes) {
6521
6521
  if (node.nodeType === Node.ELEMENT_NODE) {
6522
- focusables.push(...getFocusableElements$1(node));
6522
+ focusables.push(...getFocusableElements(node));
6523
6523
  }
6524
6524
  }
6525
6525
  }
@@ -6579,7 +6579,7 @@ class AuroDropdown extends AuroElement$1 {
6579
6579
 
6580
6580
  // Move initial focus into the bib content, matching FocusTrap behavior
6581
6581
  requestAnimationFrame(() => {
6582
- const focusables = getFocusableElements$1(this.bibContent);
6582
+ const focusables = getFocusableElements(this.bibContent);
6583
6583
  if (focusables.length) {
6584
6584
  focusables[0].focus();
6585
6585
  }
@@ -6592,7 +6592,7 @@ class AuroDropdown extends AuroElement$1 {
6592
6592
  // popover asynchronously — a synchronous focus() would target
6593
6593
  // zero-dimension elements and be silently ignored.
6594
6594
  requestAnimationFrame(() => {
6595
- const focusables = getFocusableElements$1(this.bibContent);
6595
+ const focusables = getFocusableElements(this.bibContent);
6596
6596
  if (focusables.length) {
6597
6597
  focusables[0].focus();
6598
6598
  }
@@ -6810,7 +6810,7 @@ class AuroDropdown extends AuroElement$1 {
6810
6810
  if (triggerContentNodes) {
6811
6811
 
6812
6812
  // See if any of them are focusable elements
6813
- this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements$1(node).length > 0);
6813
+ this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
6814
6814
 
6815
6815
  // If any of them are focusable elements
6816
6816
  if (this.triggerContentFocusable) {
@@ -7572,241 +7572,9 @@ class AuroElement extends i$2 {
7572
7572
  }
7573
7573
  }
7574
7574
 
7575
- // Selectors for focusable elements
7576
- const FOCUSABLE_SELECTORS = [
7577
- "a[href]",
7578
- "button:not([disabled])",
7579
- "textarea:not([disabled])",
7580
- "input:not([disabled])",
7581
- "select:not([disabled])",
7582
- '[role="tab"]:not([disabled])',
7583
- '[role="link"]:not([disabled])',
7584
- '[role="button"]:not([disabled])',
7585
- '[tabindex]:not([tabindex="-1"])',
7586
- '[contenteditable]:not([contenteditable="false"])',
7587
- ];
7588
-
7589
- // List of custom components that are known to be focusable
7590
- const FOCUSABLE_COMPONENTS = [
7591
- "auro-checkbox",
7592
- "auro-radio",
7593
- "auro-dropdown",
7594
- "auro-button",
7595
- "auro-combobox",
7596
- "auro-input",
7597
- "auro-counter",
7598
- // 'auro-menu', // Auro menu is not focusable by default, it uses a different interaction model
7599
- "auro-select",
7600
- "auro-datepicker",
7601
- "auro-hyperlink",
7602
- "auro-accordion",
7603
- ];
7604
-
7605
- /**
7606
- * Determines if a given element is a custom focusable component.
7607
- * Returns true if the element matches a known focusable component and is not disabled.
7608
- *
7609
- * @param {HTMLElement} element The element to check for focusability.
7610
- * @returns {boolean} True if the element is a focusable custom component, false otherwise.
7611
- */
7612
- function isFocusableComponent(element) {
7613
- const componentName = element.tagName.toLowerCase();
7614
-
7615
- // Guard Clause: Element is a focusable component
7616
- if (
7617
- !FOCUSABLE_COMPONENTS.some(
7618
- (name) => element.hasAttribute(name) || componentName === name,
7619
- )
7620
- )
7621
- return false;
7622
-
7623
- // Guard Clause: Element is not disabled
7624
- if (element.hasAttribute("disabled")) return false;
7625
-
7626
- // Guard Clause: The element is a hyperlink and has no href attribute
7627
- if (componentName.match("hyperlink") && !element.hasAttribute("href"))
7628
- return false;
7629
-
7630
- // If all guard clauses pass, the element is a focusable component
7631
- return true;
7632
- }
7633
-
7634
- /**
7635
- * Safely get a numeric tabindex for an element.
7636
- * Returns a number if the tabindex is a valid integer, otherwise null.
7637
- *
7638
- * @param {HTMLElement} element The element whose tabindex to read.
7639
- * @returns {?number} The numeric tabindex or null if missing/invalid.
7640
- */
7641
- function getNumericTabIndex(element) {
7642
- const raw = element.getAttribute("tabindex");
7643
- if (raw == null) return null;
7644
-
7645
- const value = Number.parseInt(raw, 10);
7646
- return Number.isNaN(value) ? null : value;
7647
- }
7648
-
7649
- /**
7650
- * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
7651
- * Returns a unique, ordered array of elements that can receive focus.
7652
- * Also sorts elements with tabindex first, preserving their order.
7653
- *
7654
- * @param {HTMLElement} container The container to search within
7655
- * @returns {Array<HTMLElement>} An array of focusable elements within the container.
7656
- */
7657
- function getFocusableElements(container) {
7658
- // Get elements in DOM order by walking the tree
7659
- const orderedFocusableElements = [];
7660
-
7661
- // Define a recursive function to collect focusable elements in DOM order
7662
- const collectFocusableElements = (root) => {
7663
- // Check if current element is focusable
7664
- if (root.nodeType === Node.ELEMENT_NODE) {
7665
- // Check if this is a custom component that is focusable
7666
- const isComponentFocusable = isFocusableComponent(root);
7667
-
7668
- if (isComponentFocusable) {
7669
- // Add the component itself as a focusable element and don't traverse its shadow DOM
7670
- orderedFocusableElements.push(root);
7671
- return; // Skip traversing inside this component
7672
- }
7673
-
7674
- // Check if the element itself matches any selector
7675
- for (const selector of FOCUSABLE_SELECTORS) {
7676
- if (root.matches?.(selector)) {
7677
- orderedFocusableElements.push(root);
7678
- break; // Once we know it's focusable, no need to check other selectors
7679
- }
7680
- }
7681
-
7682
- // Process shadow DOM only for non-Auro components
7683
- if (root.shadowRoot) {
7684
- // Process shadow DOM children in order
7685
- if (root.shadowRoot.children) {
7686
- Array.from(root.shadowRoot.children).forEach((child) => {
7687
- collectFocusableElements(child);
7688
- });
7689
- }
7690
- }
7691
-
7692
- // Process slots and their assigned nodes in order
7693
- if (root.tagName === "SLOT") {
7694
- const assignedNodes = root.assignedNodes({ flatten: true });
7695
- for (const node of assignedNodes) {
7696
- collectFocusableElements(node);
7697
- }
7698
- } else {
7699
- // Process light DOM children in order
7700
- if (root.children) {
7701
- Array.from(root.children).forEach((child) => {
7702
- collectFocusableElements(child);
7703
- });
7704
- }
7705
- }
7706
- }
7707
- };
7708
-
7709
- // Start the traversal from the container
7710
- collectFocusableElements(container);
7711
-
7712
- // Remove duplicates that might have been collected through different paths
7713
- // while preserving order
7714
- const uniqueElements = [];
7715
- const seen = new Set();
7716
-
7717
- for (const element of orderedFocusableElements) {
7718
- if (!seen.has(element)) {
7719
- seen.add(element);
7720
- uniqueElements.push(element);
7721
- }
7722
- }
7723
-
7724
- // Move tab-indexed elements to the front while preserving their order
7725
- // This ensures that elements with tabindex are prioritized in the focus order
7726
-
7727
- // First extract elements with valid positive tabindex
7728
- const elementsWithTabindex = uniqueElements.filter((el) => {
7729
- const tabindex = getNumericTabIndex(el);
7730
- return tabindex !== null && tabindex > 0;
7731
- });
7732
-
7733
- // Sort these elements by their tabindex value
7734
- elementsWithTabindex.sort((a, b) => {
7735
- const aIndex = getNumericTabIndex(a) ?? 0;
7736
- const bIndex = getNumericTabIndex(b) ?? 0;
7737
- return aIndex - bIndex;
7738
- });
7739
-
7740
- // Elements without tabindex (preserving their original order)
7741
- const elementsWithoutTabindex = uniqueElements.filter((el) => {
7742
- const tabindex = getNumericTabIndex(el);
7743
-
7744
- // Elements without tabindex or with tabindex of 0 stay in DOM order
7745
- return tabindex === null || tabindex === 0;
7746
- });
7747
-
7748
- // Combine both arrays with tabindex elements first
7749
- const tabIndexedUniqueElements = [
7750
- ...elementsWithTabindex,
7751
- ...elementsWithoutTabindex,
7752
- ];
7753
-
7754
- return tabIndexedUniqueElements;
7755
- }
7756
-
7757
7575
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
7758
7576
  // See LICENSE in the project root for license information.
7759
7577
 
7760
-
7761
- /**
7762
- * Whether `el` is currently visible enough to receive focus. Prefers the
7763
- * browser's `checkVisibility()`; otherwise combines a display/visibility check
7764
- * with an ancestor-hidden probe that keeps position:fixed elements visible.
7765
- * @param {Element} el - The element to test.
7766
- * @returns {boolean}
7767
- */
7768
- function isVisibleForFocus(el) {
7769
- if (typeof el.checkVisibility === 'function') {
7770
- return el.checkVisibility();
7771
- }
7772
- const style = el.ownerDocument.defaultView.getComputedStyle(el);
7773
- if (style.display === 'none' || style.visibility === 'hidden') {
7774
- return false;
7775
- }
7776
- return el.offsetParent !== null || style.position === 'fixed';
7777
- }
7778
-
7779
- /**
7780
- * Return the tab stop that comes before the counter-group in page tab order,
7781
- * skipping any hidden entries the walker doesn't filter itself. The group host
7782
- * itself is not a tab stop; its focusables (the internal dropdown and the
7783
- * counters) are, so anchor the search on the group's earliest focusable.
7784
- * @param {Element} component - The auro-counter-group host element.
7785
- * @returns {Element|null}
7786
- */
7787
- function getPreviousTabStop(component) {
7788
- const tabStops = getFocusableElements(component.ownerDocument.body);
7789
- const counters = component.counters || [];
7790
- const owned = [
7791
- component,
7792
- component.dropdown,
7793
- ...counters
7794
- ].filter(Boolean);
7795
- let groupStart = tabStops.length;
7796
- owned.forEach((node) => {
7797
- const index = tabStops.indexOf(node);
7798
- if (index >= 0 && index < groupStart) {
7799
- groupStart = index;
7800
- }
7801
- });
7802
- for (let index = groupStart - 1; index >= 0; index -= 1) {
7803
- if (isVisibleForFocus(tabStops[index])) {
7804
- return tabStops[index];
7805
- }
7806
- }
7807
- return null;
7808
- }
7809
-
7810
7578
  const counterGroupKeyboardStrategy = {
7811
7579
  Escape(component, evt) {
7812
7580
  if (!component.dropdown || !component.dropdown.isPopoverVisible) {
@@ -7820,48 +7588,6 @@ const counterGroupKeyboardStrategy = {
7820
7588
 
7821
7589
  component.dropdown.hide();
7822
7590
  },
7823
-
7824
- Tab(component, evt, ctx) {
7825
- // Forward Tab already exits past the bib content and the focusout handler
7826
- // closes the bib. Fullscreen relies on the dialog's native focus trapping.
7827
- if (!ctx.isExpanded || ctx.isModal || !evt.shiftKey) {
7828
- return;
7829
- }
7830
-
7831
- // The trigger precedes the bib content in the flattened tab order, so a
7832
- // native Shift+Tab off the first counter lands back on the trigger and
7833
- // leaves the bib open. Only intercept when focus is on the first focusable
7834
- // in the bib; otherwise let the browser move to the previous counter.
7835
- // `composedPath()` reports the real event origin through every shadow
7836
- // boundary, unlike `document.activeElement`, which retargets to the first
7837
- // slotted counter and cannot tell the counters apart.
7838
- const focusables = getFocusableElements(component.dropdown.bibContent);
7839
- if (!focusables.length) {
7840
- return;
7841
- }
7842
-
7843
- const path = evt.composedPath();
7844
- const activeIndex = focusables.findIndex((el) => path.includes(el));
7845
- if (activeIndex !== 0) {
7846
- return;
7847
- }
7848
-
7849
- const previousTabStop = getPreviousTabStop(component);
7850
-
7851
- // Always suppress the native Shift+Tab. Otherwise it fires against the bib
7852
- // as it is torn down and lands focus on the trigger (which precedes the
7853
- // first counter), re-opening the exact loop this handler prevents. When
7854
- // nothing precedes the group, focus falls to the body instead of the
7855
- // trigger, which reads as exiting the group backward.
7856
- evt.preventDefault();
7857
- component.hideBib();
7858
-
7859
- if (!previousTabStop) {
7860
- return;
7861
- }
7862
-
7863
- doubleRaf(() => previousTabStop.focus());
7864
- },
7865
7591
  };
7866
7592
 
7867
7593
  /* eslint-disable lit/no-invalid-html, lit/binding-positions, max-lines, no-underscore-dangle, arrow-parens, no-confusing-arrow, curly, dot-location, no-inline-comments, line-comment-position,