@aurodesignsystem-dev/auro-formkit 0.0.0-pr1411.3 → 0.0.0-pr1413.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 (45) hide show
  1. package/components/checkbox/demo/api.min.js +1 -1
  2. package/components/checkbox/demo/index.min.js +1 -1
  3. package/components/checkbox/dist/index.js +1 -1
  4. package/components/checkbox/dist/registered.js +1 -1
  5. package/components/combobox/demo/api.min.js +109 -127
  6. package/components/combobox/demo/index.min.js +109 -127
  7. package/components/combobox/demo/keyboardBehavior.md +9 -36
  8. package/components/combobox/dist/auro-combobox.d.ts +13 -0
  9. package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +4 -2
  10. package/components/combobox/dist/index.js +109 -127
  11. package/components/combobox/dist/registered.js +109 -127
  12. package/components/counter/demo/api.min.js +2 -2
  13. package/components/counter/demo/index.min.js +2 -2
  14. package/components/counter/dist/index.js +2 -2
  15. package/components/counter/dist/registered.js +2 -2
  16. package/components/datepicker/demo/api.min.js +51 -141
  17. package/components/datepicker/demo/index.min.js +51 -141
  18. package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +1 -4
  19. package/components/datepicker/dist/index.js +51 -141
  20. package/components/datepicker/dist/registered.js +51 -141
  21. package/components/dropdown/demo/api.min.js +1 -1
  22. package/components/dropdown/demo/index.min.js +1 -1
  23. package/components/dropdown/dist/index.js +1 -1
  24. package/components/dropdown/dist/registered.js +1 -1
  25. package/components/form/demo/api.min.js +263 -358
  26. package/components/form/demo/index.min.js +263 -358
  27. package/components/input/demo/api.min.js +102 -77
  28. package/components/input/demo/index.min.js +102 -77
  29. package/components/input/dist/auro-input.d.ts +11 -0
  30. package/components/input/dist/base-input.d.ts +1 -0
  31. package/components/input/dist/index.js +32 -18
  32. package/components/input/dist/registered.js +32 -18
  33. package/components/menu/demo/keyboardBehavior.md +0 -0
  34. package/components/radio/demo/api.min.js +1 -1
  35. package/components/radio/demo/index.min.js +1 -1
  36. package/components/radio/demo/keyboardBehavior.md +0 -0
  37. package/components/radio/dist/index.js +1 -1
  38. package/components/radio/dist/registered.js +1 -1
  39. package/components/select/demo/api.min.js +2 -2
  40. package/components/select/demo/index.min.js +2 -2
  41. package/components/select/dist/index.js +2 -2
  42. package/components/select/dist/registered.js +2 -2
  43. package/custom-elements.json +43 -4
  44. package/package.json +3 -3
  45. /package/components/datepicker/demo/{keyboardBehavior.html → keyboard-behavior.html} +0 -0
@@ -1687,7 +1687,7 @@ class AuroHelpText extends i$2 {
1687
1687
  }
1688
1688
  }
1689
1689
 
1690
- var formkitVersion = '202604021808';
1690
+ var formkitVersion = '202604031553';
1691
1691
 
1692
1692
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1693
1693
  // See LICENSE in the project root for license information.
@@ -1679,7 +1679,7 @@ class AuroHelpText extends i$2 {
1679
1679
  }
1680
1680
  }
1681
1681
 
1682
- var formkitVersion = '202604021808';
1682
+ var formkitVersion = '202604031553';
1683
1683
 
1684
1684
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1685
1685
  // See LICENSE in the project root for license information.
@@ -1632,7 +1632,7 @@ class AuroHelpText extends LitElement {
1632
1632
  }
1633
1633
  }
1634
1634
 
1635
- var formkitVersion = '202604021808';
1635
+ var formkitVersion = '202604031553';
1636
1636
 
1637
1637
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1638
1638
  // See LICENSE in the project root for license information.
@@ -1632,7 +1632,7 @@ class AuroHelpText extends LitElement {
1632
1632
  }
1633
1633
  }
1634
1634
 
1635
- var formkitVersion = '202604021808';
1635
+ var formkitVersion = '202604031553';
1636
1636
 
1637
1637
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1638
1638
  // See LICENSE in the project root for license information.
@@ -1326,26 +1326,23 @@ function isClearBtnFocused(ctx, clearBtn = getClearBtn(ctx)) {
1326
1326
  if (!clearBtn) {
1327
1327
  return false;
1328
1328
  }
1329
- return Boolean(clearBtn.shadowRoot && clearBtn.shadowRoot.activeElement !== null);
1329
+ const isFocused = Boolean(clearBtn.shadowRoot && clearBtn.shadowRoot.activeElement !== null);
1330
+ return isFocused;
1330
1331
  }
1331
1332
 
1332
1333
  const comboboxKeyboardStrategy = {
1333
- async Enter(component, evt, ctx) {
1334
- // If the clear button has focus, let the browser activate it normally.
1335
- // stopPropagation prevents parent containers (e.g., forms) from treating
1336
- // Enter as a submit, but we must NOT call preventDefault — that would
1337
- // block the browser's built-in "Enter activates focused button" behavior.
1334
+ Enter(component, evt, ctx) {
1338
1335
  if (isClearBtnFocused(ctx)) {
1336
+ // If the clear button has focus, let the browser activate it normally.
1337
+ // stopPropagation prevents parent containers (e.g., forms) from treating
1338
+ // Enter as a submit, but we must NOT call preventDefault — that would
1339
+ // block the browser's built-in "Enter activates focused button" behavior.
1339
1340
  evt.stopPropagation();
1340
- return;
1341
- }
1342
-
1343
- if (ctx.isExpanded && component.optionActive) {
1341
+ } else if (ctx.isExpanded && component.menu.optionActive) {
1344
1342
  component.menu.makeSelection();
1345
- await component.updateComplete;
1343
+ component.setClearBtnFocus();
1346
1344
  evt.preventDefault();
1347
1345
  evt.stopPropagation();
1348
- component.setClearBtnFocus();
1349
1346
  } else {
1350
1347
  // Prevent the keypress from bubbling to parent containers (e.g., forms)
1351
1348
  // which could interpret Enter as a submit or trigger other unintended behavior.
@@ -1357,71 +1354,28 @@ const comboboxKeyboardStrategy = {
1357
1354
  }
1358
1355
  },
1359
1356
 
1360
- Tab(component, evt, ctx) {
1361
- if (!ctx.isExpanded) {
1362
- return;
1357
+ Tab(component, _evt, ctx) {
1358
+ if (ctx.isExpanded && !isClearBtnFocused(ctx)) {
1359
+ // ClearBtn will not bubble up tab key events when it's focused, so need to manage it here when focused
1360
+ component.menu.makeSelection();
1361
+ component.hideBib();
1363
1362
  }
1363
+ },
1364
1364
 
1365
- // Shift+Tab moves the highlight to the first non-disabled option
1366
- // without making a selection or closing the bib.
1367
- if (evt.shiftKey) {
1365
+ Home(component, evt, ctx) {
1366
+ if (ctx.isExpanded) {
1368
1367
  evt.preventDefault();
1369
- const firstActive = component.menu.menuService.menuOptions.find((option) => option.isActive);
1370
- if (firstActive) {
1371
- component.menu.updateActiveOption(firstActive);
1372
- }
1373
- return;
1374
- }
1375
-
1376
- if (ctx.isModal) {
1377
- if (!ctx.activeInput) {
1378
- return;
1379
- }
1380
- const clearBtn = getClearBtn(ctx);
1381
- const clearBtnHasFocus = isClearBtnFocused(ctx, clearBtn);
1382
-
1383
- // Tab from input: if clear button exists and doesn't have focus, focus it
1384
- if (clearBtn && !clearBtnHasFocus && ctx.activeInput.value) {
1385
- // Force clear button container visible to work around Safari not
1386
- // propagating :focus-within through shadow DOM boundaries, which
1387
- // causes .wrapper:not(:focus-within) to hide .notification.clear.
1388
- const clearContainer = clearBtn.closest('.clear');
1389
- if (clearContainer) {
1390
- clearContainer.style.display = 'flex';
1391
- clearBtn.addEventListener('focusout', () => {
1392
- // Delay cleanup so :focus-within settles when focus moves
1393
- // to a sibling (e.g., Shift+Tab back to the input).
1394
- requestAnimationFrame(() => {
1395
- clearContainer.style.display = '';
1396
- });
1397
- }, { once: true });
1398
- }
1399
-
1400
- // Focus the native button inside auro-button so the browser
1401
- // treats it as a real focusable element inside the dialog.
1402
- const nativeBtn = clearBtn.shadowRoot && clearBtn.shadowRoot.querySelector('button');
1403
- if (nativeBtn) {
1404
- nativeBtn.focus();
1405
- } else {
1406
- clearBtn.focus();
1407
- }
1408
- return;
1409
- }
1410
-
1411
- // Tab from clear button (or no clear button / no value) →
1412
- // select the highlighted option if any, then close
1413
- if (component.optionActive) {
1414
- component.menu.makeSelection();
1415
- }
1416
- component.hideBib();
1417
- return;
1368
+ evt.stopPropagation();
1369
+ component.activateFirstEnabledAvailableOption();
1418
1370
  }
1371
+ },
1419
1372
 
1420
- // Non-fullscreen: select + close
1421
- if (component.menu.optionActive && component.menu.optionActive.value) {
1422
- component.menu.value = component.menu.optionActive.value;
1373
+ End(component, evt, ctx) {
1374
+ if (ctx.isExpanded) {
1375
+ evt.preventDefault();
1376
+ evt.stopPropagation();
1377
+ component.activateLastEnabledAvailableOption();
1423
1378
  }
1424
- component.hideBib();
1425
1379
  },
1426
1380
 
1427
1381
  ArrowUp(component, evt, ctx) {
@@ -1430,14 +1384,15 @@ const comboboxKeyboardStrategy = {
1430
1384
  return;
1431
1385
  }
1432
1386
 
1387
+ // option display and navigation are prevented if there are no available options
1433
1388
  if (component.availableOptions.length > 0) {
1434
- component.showBib();
1435
- }
1436
- // Read live visibility — ctx.isExpanded was computed before showBib() above,
1437
- // so it wouldn't reflect the state change.
1438
- if (component.dropdown.isPopoverVisible) {
1439
- evt.preventDefault();
1440
- navigateArrow(component, 'up');
1389
+ // navigate if bib is open otherwise open it
1390
+ if (component.dropdown.isPopoverVisible) {
1391
+ evt.preventDefault();
1392
+ navigateArrow(component, 'up');
1393
+ } else {
1394
+ component.showBib();
1395
+ }
1441
1396
  }
1442
1397
  },
1443
1398
 
@@ -1447,16 +1402,17 @@ const comboboxKeyboardStrategy = {
1447
1402
  return;
1448
1403
  }
1449
1404
 
1405
+ // option display and navigation are prevented if there are no available options
1450
1406
  if (component.availableOptions.length > 0) {
1451
- component.showBib();
1452
- }
1453
- // Read live visibility — ctx.isExpanded was computed before showBib() above,
1454
- // so it wouldn't reflect the state change.
1455
- if (component.dropdown.isPopoverVisible) {
1456
- evt.preventDefault();
1457
- navigateArrow(component, 'down');
1407
+ // navigate if bib is open otherwise open it
1408
+ if (component.dropdown.isPopoverVisible) {
1409
+ evt.preventDefault();
1410
+ navigateArrow(component, 'down');
1411
+ } else {
1412
+ component.showBib();
1413
+ }
1458
1414
  }
1459
- },
1415
+ }
1460
1416
  };
1461
1417
 
1462
1418
  /**
@@ -5060,7 +5016,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
5060
5016
  }
5061
5017
  };
5062
5018
 
5063
- var formkitVersion$2 = '202604021808';
5019
+ var formkitVersion$2 = '202604031553';
5064
5020
 
5065
5021
  let AuroElement$2 = class AuroElement extends i$4 {
5066
5022
  static get properties() {
@@ -11801,6 +11757,12 @@ class BaseInput extends AuroElement$1 {
11801
11757
  this.wrapperElement = this.shadowRoot.querySelector('.wrapper');
11802
11758
  this.inputElement = this.renderRoot.querySelector('input');
11803
11759
  this.labelElement = this.shadowRoot.querySelector('label');
11760
+ this.clearBtn = this.clearButtonRef.value;
11761
+
11762
+ // This must get moved into inputKeyboardStrategy when implemented
11763
+ this.clearBtn.addEventListener('keydown', (evt) => {
11764
+ evt.stopPropagation();
11765
+ });
11804
11766
 
11805
11767
  this.patchInputEvent(this.inputElement);
11806
11768
 
@@ -12824,7 +12786,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
12824
12786
  }
12825
12787
  };
12826
12788
 
12827
- var formkitVersion$1 = '202604021808';
12789
+ var formkitVersion$1 = '202604031553';
12828
12790
 
12829
12791
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
12830
12792
  // See LICENSE in the project root for license information.
@@ -12881,6 +12843,11 @@ class AuroInput extends BaseInput {
12881
12843
  * @private
12882
12844
  */
12883
12845
  this.iconTag = versioning.generateTag('auro-formkit-input-icon', iconVersion$2, _$2);
12846
+
12847
+ /**
12848
+ * @private
12849
+ */
12850
+ this.clearButtonRef = e$1();
12884
12851
  }
12885
12852
 
12886
12853
  static get styles() {
@@ -12898,6 +12865,19 @@ class AuroInput extends BaseInput {
12898
12865
  ];
12899
12866
  }
12900
12867
 
12868
+ /**
12869
+ * Returns classmap configuration for the clear button visibility.
12870
+ * The button is hidden when the input has no value, is read-only, or is disabled.
12871
+ * @private
12872
+ * @returns {Record<string, boolean>} - Classmap object controlling clear button display state.
12873
+ */
12874
+ get clearBtnClassMap() {
12875
+ return {
12876
+ 'util_displayHidden': !this.hasValue || this.readyOnly || this.disabled
12877
+ };
12878
+ }
12879
+
12880
+
12901
12881
  /**
12902
12882
  * Determines if the HTML input element should be visually hidden.
12903
12883
  * Returns true when display value content exists without focus and has a value,
@@ -13217,10 +13197,11 @@ class AuroInput extends BaseInput {
13217
13197
  <${this.buttonTag}
13218
13198
  @click="${this.handleClickClear}"
13219
13199
  appearance="${this.onDark ? 'inverse' : this.appearance}"
13220
- class="notificationBtn clearBtn"
13200
+ class="notificationBtn clearBtn ${e$3(this.clearBtnClassMap)}"
13221
13201
  shape="circle"
13222
13202
  size="sm"
13223
- variant="ghost">
13203
+ variant="ghost"
13204
+ ${n$2(this.clearButtonRef)}>
13224
13205
  <span><slot name="ariaLabel.clear">Clear Input</slot></span>
13225
13206
  <${this.iconTag}
13226
13207
  aria-hidden="true"
@@ -13365,11 +13346,7 @@ class AuroInput extends BaseInput {
13365
13346
  <div part="accent-right" class="accents right">
13366
13347
  ${this.renderValidationErrorIconHtml()}
13367
13348
  ${this.hasValue && this.type === 'password' ? this.renderHtmlNotificationPassword() : undefined}
13368
- ${this.hasValue ? u$7`
13369
- ${!this.disabled && !this.readonly ? u$7`
13370
- ${this.renderHtmlActionClear()}
13371
- ` : undefined}
13372
- ` : undefined}
13349
+ ${this.renderHtmlActionClear()}
13373
13350
  </div>
13374
13351
  </div>
13375
13352
  <div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
@@ -13401,11 +13378,7 @@ class AuroInput extends BaseInput {
13401
13378
  ${this.layout.includes('right') || this.layout === "emphasized" ? u$7`
13402
13379
  ${this.renderValidationErrorIconHtml()}
13403
13380
  ` : undefined}
13404
- ${this.hasValue ? u$7`
13405
- ${!this.disabled && !this.readonly ? u$7`
13406
- ${this.renderHtmlActionClear()}
13407
- ` : undefined}
13408
- ` : undefined}
13381
+ ${this.renderHtmlActionClear()}
13409
13382
  </div>
13410
13383
  </div>
13411
13384
  <div class="${e$3(this.helpTextClasses)}" part="inputHelpText">
@@ -13433,11 +13406,7 @@ class AuroInput extends BaseInput {
13433
13406
  </div>
13434
13407
  <div class="accents right">
13435
13408
  ${this.renderValidationErrorIconHtml()}
13436
- ${this.hasValue ? u$7`
13437
- ${!this.disabled && !this.readonly ? u$7`
13438
- ${this.renderHtmlActionClear()}
13439
- ` : undefined}
13440
- ` : undefined}
13409
+ ${this.renderHtmlActionClear()}
13441
13410
  </div>
13442
13411
  </div>
13443
13412
  <div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
@@ -13863,7 +13832,7 @@ class AuroBibtemplate extends i$4 {
13863
13832
  }
13864
13833
  }
13865
13834
 
13866
- var formkitVersion = '202604021808';
13835
+ var formkitVersion = '202604031553';
13867
13836
 
13868
13837
  var styleCss$3 = i$7`.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}`;
13869
13838
 
@@ -14342,6 +14311,7 @@ class AuroCombobox extends AuroElement {
14342
14311
 
14343
14312
  /**
14344
14313
  * Array of available options to display in the dropdown.
14314
+ * This array contains all non-hidden options (e.g., hidden by filtering on input value).
14345
14315
  * @private
14346
14316
  */
14347
14317
  availableOptions: {
@@ -14719,12 +14689,40 @@ class AuroCombobox extends AuroElement {
14719
14689
  AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroCombobox);
14720
14690
  }
14721
14691
 
14692
+ /**
14693
+ * Mark the first available (non-hidden), enabled option as `active`.
14694
+ * @private
14695
+ * @returns {void}
14696
+ */
14697
+ activateFirstEnabledAvailableOption() {
14698
+ const firstEnabledOptionIndex = this.availableOptions.findIndex((opt) => !opt.disabled);
14699
+ this.updateActiveOption(firstEnabledOptionIndex);
14700
+ }
14701
+
14702
+ /**
14703
+ * Mark the last available (non-hidden), enabled option as `active`.
14704
+ * @private
14705
+ * @returns {void}
14706
+ */
14707
+ activateLastEnabledAvailableOption() {
14708
+ let lastEnabledOptionIndex = -1;
14709
+
14710
+ // Work backwards through the available options array to find the last enabled option
14711
+ for (let index = this.availableOptions.length - 1; index >= 0; index -= 1) {
14712
+ if (!this.availableOptions[index].disabled) {
14713
+ lastEnabledOptionIndex = index;
14714
+ break;
14715
+ }
14716
+ }
14717
+
14718
+ this.updateActiveOption(lastEnabledOptionIndex);
14719
+ }
14720
+
14722
14721
  /**
14723
14722
  * Updates the filter for the available options based on the input value.
14724
14723
  * @private
14725
14724
  */
14726
14725
  updateFilter() {
14727
-
14728
14726
  // Reset available options if noFilter is set to false after being true.
14729
14727
  if (this.noFilter) {
14730
14728
  this.availableOptions = [...this.options];
@@ -14843,6 +14841,10 @@ class AuroCombobox extends AuroElement {
14843
14841
  if (this.value && this.input.value && !this.menu.value) {
14844
14842
  this.syncValuesAndStates();
14845
14843
  }
14844
+
14845
+ if (!this.availableOptions.includes(this.menu.optionActive)) {
14846
+ this.activateFirstEnabledAvailableOption();
14847
+ }
14846
14848
  }
14847
14849
 
14848
14850
  /**
@@ -14916,9 +14918,6 @@ class AuroCombobox extends AuroElement {
14916
14918
  if (this.dropdownOpen) {
14917
14919
  const expandedDelay = 150;
14918
14920
  this._expandedTimeout = setTimeout(() => {
14919
- if (!this.value) {
14920
- this.updateActiveOption(0);
14921
- }
14922
14921
  this.triggerExpandedState = true;
14923
14922
  }, expandedDelay);
14924
14923
  } else {
@@ -14928,16 +14927,6 @@ class AuroCombobox extends AuroElement {
14928
14927
  // Clear aria-activedescendant when dropdown closes
14929
14928
  if (!this.dropdownOpen && this.input) {
14930
14929
  this.input.setActiveDescendant(null);
14931
- this.optionActive = null;
14932
-
14933
- // Remove the highlighted state from all menu options so re-opening
14934
- // the dropdown doesn't show a stale highlight.
14935
- if (this.options) {
14936
- this.options.forEach((opt) => {
14937
- opt.active = false;
14938
- opt.classList.remove('active');
14939
- });
14940
- }
14941
14930
 
14942
14931
  // Restore pointer events on the menu in case they were disabled
14943
14932
  // during fullscreen open to prevent touch pass-through.
@@ -14978,13 +14967,6 @@ class AuroCombobox extends AuroElement {
14978
14967
  this.setInputFocus();
14979
14968
  this._inFullscreenTransition = false;
14980
14969
  });
14981
- } else {
14982
- // wait a frame in case the bib gets hidden immediately after showing because there is no value
14983
- setTimeout(() => {
14984
- if (this.componentHasFocus) {
14985
- this.setInputFocus();
14986
- }
14987
- }, 0);
14988
14970
  }
14989
14971
  }
14990
14972
  });