@aurodesignsystem-dev/auro-formkit 0.0.0-pr1545.0 → 0.0.0-pr1546.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 (46) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +276 -33
  7. package/components/combobox/demo/getting-started.min.js +276 -33
  8. package/components/combobox/demo/index.min.js +276 -33
  9. package/components/combobox/demo/keyboard-behavior.md +1 -1
  10. package/components/combobox/dist/auro-combobox.d.ts +1 -0
  11. package/components/combobox/dist/index.js +276 -33
  12. package/components/combobox/dist/registered.js +276 -33
  13. package/components/counter/demo/customize.min.js +2 -2
  14. package/components/counter/demo/index.min.js +2 -2
  15. package/components/counter/dist/index.js +2 -2
  16. package/components/counter/dist/registered.js +2 -2
  17. package/components/datepicker/demo/customize.min.js +3 -3
  18. package/components/datepicker/demo/index.min.js +3 -3
  19. package/components/datepicker/dist/index.js +3 -3
  20. package/components/datepicker/dist/registered.js +3 -3
  21. package/components/dropdown/demo/customize.min.js +1 -1
  22. package/components/dropdown/demo/getting-started.min.js +1 -1
  23. package/components/dropdown/demo/index.min.js +1 -1
  24. package/components/dropdown/dist/index.js +1 -1
  25. package/components/dropdown/dist/registered.js +1 -1
  26. package/components/form/demo/customize.min.js +340 -97
  27. package/components/form/demo/getting-started.min.js +340 -97
  28. package/components/form/demo/index.min.js +340 -97
  29. package/components/form/demo/registerDemoDeps.min.js +340 -97
  30. package/components/input/demo/customize.min.js +1 -1
  31. package/components/input/demo/getting-started.min.js +1 -1
  32. package/components/input/demo/index.min.js +1 -1
  33. package/components/input/dist/index.js +1 -1
  34. package/components/input/dist/registered.js +1 -1
  35. package/components/radio/demo/customize.min.js +1 -1
  36. package/components/radio/demo/getting-started.min.js +1 -1
  37. package/components/radio/demo/index.min.js +1 -1
  38. package/components/radio/dist/index.js +1 -1
  39. package/components/radio/dist/registered.js +1 -1
  40. package/components/select/demo/customize.min.js +2 -2
  41. package/components/select/demo/getting-started.min.js +2 -2
  42. package/components/select/demo/index.min.js +2 -2
  43. package/components/select/dist/index.js +2 -2
  44. package/components/select/dist/registered.js +2 -2
  45. package/custom-elements.json +1507 -1507
  46. package/package.json +1 -1
@@ -1275,7 +1275,7 @@ class AuroHelpText extends i$2 {
1275
1275
  }
1276
1276
  }
1277
1277
 
1278
- var formkitVersion = '202607082244';
1278
+ var formkitVersion = '202607090129';
1279
1279
 
1280
1280
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1281
1281
  // See LICENSE in the project root for license information.
@@ -1275,7 +1275,7 @@ class AuroHelpText extends i$2 {
1275
1275
  }
1276
1276
  }
1277
1277
 
1278
- var formkitVersion = '202607082244';
1278
+ var formkitVersion = '202607090129';
1279
1279
 
1280
1280
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1281
1281
  // See LICENSE in the project root for license information.
@@ -1275,7 +1275,7 @@ class AuroHelpText extends i$2 {
1275
1275
  }
1276
1276
  }
1277
1277
 
1278
- var formkitVersion = '202607082244';
1278
+ var formkitVersion = '202607090129';
1279
1279
 
1280
1280
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1281
1281
  // See LICENSE in the project root for license information.
@@ -1228,7 +1228,7 @@ class AuroHelpText extends LitElement {
1228
1228
  }
1229
1229
  }
1230
1230
 
1231
- var formkitVersion = '202607082244';
1231
+ var formkitVersion = '202607090129';
1232
1232
 
1233
1233
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1234
1234
  // See LICENSE in the project root for license information.
@@ -1228,7 +1228,7 @@ class AuroHelpText extends LitElement {
1228
1228
  }
1229
1229
  }
1230
1230
 
1231
- var formkitVersion = '202607082244';
1231
+ var formkitVersion = '202607090129';
1232
1232
 
1233
1233
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1234
1234
  // See LICENSE in the project root for license information.
@@ -825,6 +825,188 @@ function navigateArrow(component, direction, options = {}) {
825
825
  }
826
826
  }
827
827
 
828
+ // Selectors for focusable elements
829
+ const FOCUSABLE_SELECTORS$1 = [
830
+ "a[href]",
831
+ "button:not([disabled])",
832
+ "textarea:not([disabled])",
833
+ "input:not([disabled])",
834
+ "select:not([disabled])",
835
+ '[role="tab"]:not([disabled])',
836
+ '[role="link"]:not([disabled])',
837
+ '[role="button"]:not([disabled])',
838
+ '[tabindex]:not([tabindex="-1"])',
839
+ '[contenteditable]:not([contenteditable="false"])',
840
+ ];
841
+
842
+ // List of custom components that are known to be focusable
843
+ const FOCUSABLE_COMPONENTS$1 = [
844
+ "auro-checkbox",
845
+ "auro-radio",
846
+ "auro-dropdown",
847
+ "auro-button",
848
+ "auro-combobox",
849
+ "auro-input",
850
+ "auro-counter",
851
+ // 'auro-menu', // Auro menu is not focusable by default, it uses a different interaction model
852
+ "auro-select",
853
+ "auro-datepicker",
854
+ "auro-hyperlink",
855
+ "auro-accordion",
856
+ ];
857
+
858
+ /**
859
+ * Determines if a given element is a custom focusable component.
860
+ * Returns true if the element matches a known focusable component and is not disabled.
861
+ *
862
+ * @param {HTMLElement} element The element to check for focusability.
863
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
864
+ */
865
+ function isFocusableComponent$1(element) {
866
+ const componentName = element.tagName.toLowerCase();
867
+
868
+ // Guard Clause: Element is a focusable component
869
+ if (
870
+ !FOCUSABLE_COMPONENTS$1.some(
871
+ (name) => element.hasAttribute(name) || componentName === name,
872
+ )
873
+ )
874
+ return false;
875
+
876
+ // Guard Clause: Element is not disabled
877
+ if (element.hasAttribute("disabled")) return false;
878
+
879
+ // Guard Clause: The element is a hyperlink and has no href attribute
880
+ if (componentName.match("hyperlink") && !element.hasAttribute("href"))
881
+ return false;
882
+
883
+ // If all guard clauses pass, the element is a focusable component
884
+ return true;
885
+ }
886
+
887
+ /**
888
+ * Safely get a numeric tabindex for an element.
889
+ * Returns a number if the tabindex is a valid integer, otherwise null.
890
+ *
891
+ * @param {HTMLElement} element The element whose tabindex to read.
892
+ * @returns {?number} The numeric tabindex or null if missing/invalid.
893
+ */
894
+ function getNumericTabIndex$1(element) {
895
+ const raw = element.getAttribute("tabindex");
896
+ if (raw == null) return null;
897
+
898
+ const value = Number.parseInt(raw, 10);
899
+ return Number.isNaN(value) ? null : value;
900
+ }
901
+
902
+ /**
903
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
904
+ * Returns a unique, ordered array of elements that can receive focus.
905
+ * Also sorts elements with tabindex first, preserving their order.
906
+ *
907
+ * @param {HTMLElement} container The container to search within
908
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
909
+ */
910
+ function getFocusableElements$1(container) {
911
+ // Get elements in DOM order by walking the tree
912
+ const orderedFocusableElements = [];
913
+
914
+ // Define a recursive function to collect focusable elements in DOM order
915
+ const collectFocusableElements = (root) => {
916
+ // Check if current element is focusable
917
+ if (root.nodeType === Node.ELEMENT_NODE) {
918
+ // Check if this is a custom component that is focusable
919
+ const isComponentFocusable = isFocusableComponent$1(root);
920
+
921
+ if (isComponentFocusable) {
922
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
923
+ orderedFocusableElements.push(root);
924
+ return; // Skip traversing inside this component
925
+ }
926
+
927
+ // Check if the element itself matches any selector
928
+ for (const selector of FOCUSABLE_SELECTORS$1) {
929
+ if (root.matches?.(selector)) {
930
+ orderedFocusableElements.push(root);
931
+ break; // Once we know it's focusable, no need to check other selectors
932
+ }
933
+ }
934
+
935
+ // Process shadow DOM only for non-Auro components
936
+ if (root.shadowRoot) {
937
+ // Process shadow DOM children in order
938
+ if (root.shadowRoot.children) {
939
+ Array.from(root.shadowRoot.children).forEach((child) => {
940
+ collectFocusableElements(child);
941
+ });
942
+ }
943
+ }
944
+
945
+ // Process slots and their assigned nodes in order
946
+ if (root.tagName === "SLOT") {
947
+ const assignedNodes = root.assignedNodes({ flatten: true });
948
+ for (const node of assignedNodes) {
949
+ collectFocusableElements(node);
950
+ }
951
+ } else {
952
+ // Process light DOM children in order
953
+ if (root.children) {
954
+ Array.from(root.children).forEach((child) => {
955
+ collectFocusableElements(child);
956
+ });
957
+ }
958
+ }
959
+ }
960
+ };
961
+
962
+ // Start the traversal from the container
963
+ collectFocusableElements(container);
964
+
965
+ // Remove duplicates that might have been collected through different paths
966
+ // while preserving order
967
+ const uniqueElements = [];
968
+ const seen = new Set();
969
+
970
+ for (const element of orderedFocusableElements) {
971
+ if (!seen.has(element)) {
972
+ seen.add(element);
973
+ uniqueElements.push(element);
974
+ }
975
+ }
976
+
977
+ // Move tab-indexed elements to the front while preserving their order
978
+ // This ensures that elements with tabindex are prioritized in the focus order
979
+
980
+ // First extract elements with valid positive tabindex
981
+ const elementsWithTabindex = uniqueElements.filter((el) => {
982
+ const tabindex = getNumericTabIndex$1(el);
983
+ return tabindex !== null && tabindex > 0;
984
+ });
985
+
986
+ // Sort these elements by their tabindex value
987
+ elementsWithTabindex.sort((a, b) => {
988
+ const aIndex = getNumericTabIndex$1(a) ?? 0;
989
+ const bIndex = getNumericTabIndex$1(b) ?? 0;
990
+ return aIndex - bIndex;
991
+ });
992
+
993
+ // Elements without tabindex (preserving their original order)
994
+ const elementsWithoutTabindex = uniqueElements.filter((el) => {
995
+ const tabindex = getNumericTabIndex$1(el);
996
+
997
+ // Elements without tabindex or with tabindex of 0 stay in DOM order
998
+ return tabindex === null || tabindex === 0;
999
+ });
1000
+
1001
+ // Combine both arrays with tabindex elements first
1002
+ const tabIndexedUniqueElements = [
1003
+ ...elementsWithTabindex,
1004
+ ...elementsWithoutTabindex,
1005
+ ];
1006
+
1007
+ return tabIndexedUniqueElements;
1008
+ }
1009
+
828
1010
  /* eslint-disable no-underscore-dangle */
829
1011
 
830
1012
  /**
@@ -870,6 +1052,82 @@ function reconcileMenuIndex(menu) {
870
1052
  }
871
1053
  }
872
1054
 
1055
+ /**
1056
+ * Commit the highlighted option and close the bib.
1057
+ * @param {Element} component - The auro-combobox host element.
1058
+ */
1059
+ function selectAndClose(component) {
1060
+ reconcileMenuIndex(component.menu);
1061
+ component.menu.makeSelection();
1062
+ component.hideBib();
1063
+ }
1064
+
1065
+ /**
1066
+ * Whether `el` is currently visible enough to receive focus. Prefers the
1067
+ * browser's `checkVisibility()` (Chrome/Safari; Firefox behind a flag until
1068
+ * recently); otherwise combines a display/visibility check with an
1069
+ * ancestor-hidden probe that keeps position:fixed elements visible.
1070
+ * @param {Element} el - The element to test.
1071
+ * @returns {boolean}
1072
+ */
1073
+ function isVisibleForFocus(el) {
1074
+ if (typeof el.checkVisibility === 'function') {
1075
+ return el.checkVisibility();
1076
+ }
1077
+ const style = el.ownerDocument.defaultView.getComputedStyle(el);
1078
+ if (style.display === 'none' || style.visibility === 'hidden') {
1079
+ return false;
1080
+ }
1081
+ return el.offsetParent !== null || style.position === 'fixed';
1082
+ }
1083
+
1084
+ /**
1085
+ * Return the tab stop that comes before `component` in page tab order,
1086
+ * skipping any hidden entries the walker doesn't filter itself.
1087
+ * @param {Element} component - The auro-combobox host element.
1088
+ * @returns {Element|null}
1089
+ */
1090
+ function getPreviousTabStop(component) {
1091
+ const tabStops = getFocusableElements$1(component.ownerDocument.body);
1092
+ const componentIndex = tabStops.indexOf(component);
1093
+ for (let index = componentIndex - 1; index >= 0; index -= 1) {
1094
+ if (isVisibleForFocus(tabStops[index])) {
1095
+ return tabStops[index];
1096
+ }
1097
+ }
1098
+ return null;
1099
+ }
1100
+
1101
+ /**
1102
+ * Commit the highlighted option, close the bib, and move focus to the tab
1103
+ * stop before the combobox — the Shift+Tab exit path (AB#1592239).
1104
+ * Returns true when this function moved focus and the caller should
1105
+ * preventDefault; false when no previous tab stop was found and the browser's
1106
+ * native traversal should run.
1107
+ * @param {Element} component - The auro-combobox host element.
1108
+ * @returns {boolean}
1109
+ */
1110
+ function selectAndExitBackward(component) {
1111
+ const previousTabStop = getPreviousTabStop(component);
1112
+
1113
+ // Opts this selection out of setClearBtnFocus so the focus move below
1114
+ // isn't clobbered. Consumed by auro-combobox's selection listener; also
1115
+ // cleared via microtask in case makeSelection is a no-op and the listener
1116
+ // never fires (microtasks run before the next user event, so this can't
1117
+ // leak into an unrelated selection).
1118
+ component._suppressClearBtnFocusOnSelection = true;
1119
+ selectAndClose(component);
1120
+ queueMicrotask(() => {
1121
+ component._suppressClearBtnFocusOnSelection = false;
1122
+ });
1123
+
1124
+ if (!previousTabStop) {
1125
+ return false;
1126
+ }
1127
+ doubleRaf(() => previousTabStop.focus());
1128
+ return true;
1129
+ }
1130
+
873
1131
  const comboboxKeyboardStrategy = {
874
1132
  ArrowDown(component, evt, ctx) {
875
1133
  // If the clear button has focus, let the browser handle ArrowDown normally.
@@ -968,36 +1226,18 @@ const comboboxKeyboardStrategy = {
968
1226
  },
969
1227
 
970
1228
  Tab(component, evt, ctx) {
971
- // Runs for both Tab and Shift+Tab.
972
- //
973
- // Current behavior:
974
- // Tab — select the active option, close the bib, and (in fullscreen
975
- // modal mode only) explicitly move focus to the trigger's
976
- // clear button. In desktop popover mode the browser's native
977
- // tab traversal takes focus forward from the input.
978
- // Shift+Tab — select the active option and close the bib. Focus then
979
- // lands on the trigger's clear button as a byproduct of the
980
- // shadow-DOM tab order, so keyboard users must press
981
- // Shift+Tab three times to exit the component (clear button
982
- // → input → previous element on the page).
983
- //
984
- // Intended behavior for Shift+Tab (per team decision, tracked in
985
- // AB#1590650): a single Shift+Tab should select the active option, close
986
- // the bib, and move focus directly to the previous focusable element on
987
- // the page — symmetric with Tab.
988
1229
  if (ctx.isExpanded && !isClearBtnFocused(ctx)) {
989
- // When the clear button is focused, Tab events do not bubble out of
990
- // its shadow DOM, so this handler only fires when the clear button
991
- // is NOT focused. In that case, select the active option and close.
992
- reconcileMenuIndex(component.menu);
993
- component.menu.makeSelection();
994
- component.hideBib();
1230
+ if (evt.shiftKey) {
1231
+ if (selectAndExitBackward(component)) {
1232
+ evt.preventDefault();
1233
+ }
1234
+ return;
1235
+ }
1236
+
1237
+ selectAndClose(component);
995
1238
 
996
- // In fullscreen modal mode, closing the dialog does not
997
- // automatically restores focus to the input. In the tab case,
998
- // Explicitly move focus to the trigger's clear button so the
999
- // user can continues tabbing through the page normally.
1000
- if (ctx.isModal && !evt.shiftKey) {
1239
+ if (ctx.isModal) {
1240
+ // Fullscreen close does not automatically restore focus to the input.
1001
1241
  component.setClearBtnFocus();
1002
1242
  }
1003
1243
  }
@@ -4896,7 +5136,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
4896
5136
  }
4897
5137
  };
4898
5138
 
4899
- var formkitVersion$2 = '202607082244';
5139
+ var formkitVersion$2 = '202607090129';
4900
5140
 
4901
5141
  let AuroElement$2 = class AuroElement extends i$3 {
4902
5142
  static get properties() {
@@ -18521,7 +18761,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
18521
18761
  }
18522
18762
  };
18523
18763
 
18524
- var formkitVersion$1 = '202607082244';
18764
+ var formkitVersion$1 = '202607090129';
18525
18765
 
18526
18766
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
18527
18767
  // See LICENSE in the project root for license information.
@@ -19642,7 +19882,7 @@ class AuroBibtemplate extends i$3 {
19642
19882
  }
19643
19883
  }
19644
19884
 
19645
- var formkitVersion = '202607082244';
19885
+ var formkitVersion = '202607090129';
19646
19886
 
19647
19887
  var styleCss$3 = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
19648
19888
 
@@ -21174,8 +21414,11 @@ class AuroCombobox extends AuroElement {
21174
21414
  // do not close while typing in suggestion mode with no value selected, to allow freeform input
21175
21415
  this.hideBib();
21176
21416
 
21177
- // Move focus to the clear button when the user makes a selection.
21178
- if (!isEcho && this.menu.value !== undefined) {
21417
+ // Move focus to the clear button when the user makes a selection,
21418
+ // unless the Shift+Tab handler opted this selection out.
21419
+ if (this._suppressClearBtnFocusOnSelection) {
21420
+ this._suppressClearBtnFocusOnSelection = false;
21421
+ } else if (!isEcho && this.menu.value !== undefined) {
21179
21422
  this.setClearBtnFocus();
21180
21423
  }
21181
21424