@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.2 → 0.0.0-pr1424.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 (38) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +183 -133
  3. package/components/checkbox/demo/api.min.js +1 -1
  4. package/components/checkbox/demo/index.min.js +1 -1
  5. package/components/checkbox/dist/index.js +1 -1
  6. package/components/checkbox/dist/registered.js +1 -1
  7. package/components/combobox/demo/api.min.js +165 -276
  8. package/components/combobox/demo/index.min.js +165 -276
  9. package/components/combobox/dist/index.js +165 -276
  10. package/components/combobox/dist/registered.js +165 -276
  11. package/components/counter/demo/api.min.js +164 -275
  12. package/components/counter/demo/index.min.js +164 -275
  13. package/components/counter/dist/index.js +164 -275
  14. package/components/counter/dist/registered.js +164 -275
  15. package/components/datepicker/demo/api.min.js +165 -276
  16. package/components/datepicker/demo/index.min.js +165 -276
  17. package/components/datepicker/dist/index.js +165 -276
  18. package/components/datepicker/dist/registered.js +165 -276
  19. package/components/dropdown/demo/api.min.js +164 -275
  20. package/components/dropdown/demo/index.min.js +164 -275
  21. package/components/dropdown/dist/index.js +164 -275
  22. package/components/dropdown/dist/registered.js +164 -275
  23. package/components/form/demo/api.md +460 -76
  24. package/components/form/demo/api.min.js +661 -1105
  25. package/components/form/demo/index.min.js +661 -1105
  26. package/components/input/demo/api.min.js +1 -1
  27. package/components/input/demo/index.min.js +1 -1
  28. package/components/input/dist/index.js +1 -1
  29. package/components/input/dist/registered.js +1 -1
  30. package/components/radio/demo/api.min.js +1 -1
  31. package/components/radio/demo/index.min.js +1 -1
  32. package/components/radio/dist/index.js +1 -1
  33. package/components/radio/dist/registered.js +1 -1
  34. package/components/select/demo/api.min.js +164 -275
  35. package/components/select/demo/index.min.js +164 -275
  36. package/components/select/dist/index.js +164 -275
  37. package/components/select/dist/registered.js +164 -275
  38. package/package.json +3 -3
@@ -1471,7 +1471,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
1471
1471
  }
1472
1472
  };
1473
1473
 
1474
- var formkitVersion$1 = '202604071818';
1474
+ var formkitVersion$1 = '202604072118';
1475
1475
 
1476
1476
  // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1477
1477
  // See LICENSE in the project root for license information.
@@ -3769,19 +3769,11 @@ class AuroFloatingUI {
3769
3769
  * This ensures that the bib content has the same dimensions as the sizer element.
3770
3770
  */
3771
3771
  mirrorSize() {
3772
- const element = this.element;
3773
- if (!element) {
3774
- return;
3775
- }
3776
-
3777
3772
  // mirror the boxsize from bibSizer
3778
- if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
3779
- const sizerStyle = window.getComputedStyle(element.bibSizer);
3780
- const bibContent = element.bib.shadowRoot.querySelector(".container");
3781
- if (!bibContent) {
3782
- return;
3783
- }
3784
-
3773
+ if (this.element.bibSizer && this.element.matchWidth) {
3774
+ const sizerStyle = window.getComputedStyle(this.element.bibSizer);
3775
+ const bibContent =
3776
+ this.element.bib.shadowRoot.querySelector(".container");
3785
3777
  if (sizerStyle.width !== "0px") {
3786
3778
  bibContent.style.width = sizerStyle.width;
3787
3779
  }
@@ -3803,14 +3795,9 @@ class AuroFloatingUI {
3803
3795
  * @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
3804
3796
  */
3805
3797
  getPositioningStrategy() {
3806
- const element = this.element;
3807
- if (!element) {
3808
- return "floating";
3809
- }
3810
-
3811
3798
  const breakpoint =
3812
- element.bib?.mobileFullscreenBreakpoint ||
3813
- element.floaterConfig?.fullscreenBreakpoint;
3799
+ this.element.bib.mobileFullscreenBreakpoint ||
3800
+ this.element.floaterConfig?.fullscreenBreakpoint;
3814
3801
  switch (this.behavior) {
3815
3802
  case "tooltip":
3816
3803
  return "floating";
@@ -3821,9 +3808,9 @@ class AuroFloatingUI {
3821
3808
  `(max-width: ${breakpoint})`,
3822
3809
  ).matches;
3823
3810
 
3824
- element.expanded = smallerThanBreakpoint;
3811
+ this.element.expanded = smallerThanBreakpoint;
3825
3812
  }
3826
- if (element.nested) {
3813
+ if (this.element.nested) {
3827
3814
  return "cover";
3828
3815
  }
3829
3816
  return "fullscreen";
@@ -3853,65 +3840,42 @@ class AuroFloatingUI {
3853
3840
  * and applies the calculated position to the bib's style.
3854
3841
  */
3855
3842
  position() {
3856
- const element = this.element;
3857
- if (!element) {
3858
- return;
3859
- }
3860
-
3861
3843
  const strategy = this.getPositioningStrategy();
3862
3844
  this.configureBibStrategy(strategy);
3863
3845
 
3864
3846
  if (strategy === "floating") {
3865
- if (!element.trigger || !element.bib) {
3866
- return;
3867
- }
3868
-
3869
3847
  this.mirrorSize();
3870
3848
  // Define the middlware for the floater configuration
3871
3849
  const middleware = [
3872
- offset(element.floaterConfig?.offset || 0),
3873
- ...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3874
- ...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3875
- ...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3850
+ offset(this.element.floaterConfig?.offset || 0),
3851
+ ...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3852
+ ...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3853
+ ...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3876
3854
  ];
3877
3855
 
3878
3856
  // Compute the position of the bib
3879
- computePosition(element.trigger, element.bib, {
3880
- strategy: element.floaterConfig?.strategy || "fixed",
3881
- placement: element.floaterConfig?.placement,
3857
+ computePosition(this.element.trigger, this.element.bib, {
3858
+ strategy: this.element.floaterConfig?.strategy || "fixed",
3859
+ placement: this.element.floaterConfig?.placement,
3882
3860
  middleware: middleware || [],
3883
3861
  }).then(({ x, y }) => {
3884
3862
  // eslint-disable-line id-length
3885
- const currentElement = this.element;
3886
- if (!currentElement?.bib) {
3887
- return;
3888
- }
3889
-
3890
- Object.assign(currentElement.bib.style, {
3863
+ Object.assign(this.element.bib.style, {
3891
3864
  left: `${x}px`,
3892
3865
  top: `${y}px`,
3893
3866
  });
3894
3867
  });
3895
3868
  } else if (strategy === "cover") {
3896
- if (!element.parentNode || !element.bib) {
3897
- return;
3898
- }
3899
-
3900
3869
  // Compute the position of the bib
3901
- computePosition(element.parentNode, element.bib, {
3870
+ computePosition(this.element.parentNode, this.element.bib, {
3902
3871
  placement: "bottom-start",
3903
3872
  }).then(({ x, y }) => {
3904
3873
  // eslint-disable-line id-length
3905
- const currentElement = this.element;
3906
- if (!currentElement?.bib || !currentElement.parentNode) {
3907
- return;
3908
- }
3909
-
3910
- Object.assign(currentElement.bib.style, {
3874
+ Object.assign(this.element.bib.style, {
3911
3875
  left: `${x}px`,
3912
- top: `${y - currentElement.parentNode.offsetHeight}px`,
3913
- width: `${currentElement.parentNode.offsetWidth}px`,
3914
- height: `${currentElement.parentNode.offsetHeight}px`,
3876
+ top: `${y - this.element.parentNode.offsetHeight}px`,
3877
+ width: `${this.element.parentNode.offsetWidth}px`,
3878
+ height: `${this.element.parentNode.offsetHeight}px`,
3915
3879
  });
3916
3880
  });
3917
3881
  }
@@ -3923,17 +3887,11 @@ class AuroFloatingUI {
3923
3887
  * @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
3924
3888
  */
3925
3889
  lockScroll(lock = true) {
3926
- const element = this.element;
3927
-
3928
3890
  if (lock) {
3929
- if (!element?.bib) {
3930
- return;
3931
- }
3932
-
3933
3891
  document.body.style.overflow = "hidden"; // hide body's scrollbar
3934
3892
 
3935
3893
  // Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
3936
- element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3894
+ this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3937
3895
  } else {
3938
3896
  document.body.style.overflow = "";
3939
3897
  }
@@ -3949,24 +3907,20 @@ class AuroFloatingUI {
3949
3907
  * @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
3950
3908
  */
3951
3909
  configureBibStrategy(value) {
3952
- const element = this.element;
3953
- if (!element?.bib) {
3954
- return;
3955
- }
3956
-
3957
3910
  if (value === "fullscreen") {
3958
- element.isBibFullscreen = true;
3911
+ this.element.isBibFullscreen = true;
3959
3912
  // reset the prev position
3960
- element.bib.setAttribute("isfullscreen", "");
3961
- element.bib.style.position = "fixed";
3962
- element.bib.style.top = "0px";
3963
- element.bib.style.left = "0px";
3964
- element.bib.style.width = "";
3965
- element.bib.style.height = "";
3966
- element.style.contain = "";
3913
+ this.element.bib.setAttribute("isfullscreen", "");
3914
+ this.element.bib.style.position = "fixed";
3915
+ this.element.bib.style.top = "0px";
3916
+ this.element.bib.style.left = "0px";
3917
+ this.element.bib.style.width = "";
3918
+ this.element.bib.style.height = "";
3919
+ this.element.style.contain = "";
3967
3920
 
3968
3921
  // reset the size that was mirroring `size` css-part
3969
- const bibContent = element.bib.shadowRoot?.querySelector(".container");
3922
+ const bibContent =
3923
+ this.element.bib.shadowRoot.querySelector(".container");
3970
3924
  if (bibContent) {
3971
3925
  bibContent.style.width = "";
3972
3926
  bibContent.style.height = "";
@@ -3981,14 +3935,14 @@ class AuroFloatingUI {
3981
3935
  }, 0);
3982
3936
  }
3983
3937
 
3984
- if (element.isPopoverVisible) {
3938
+ if (this.element.isPopoverVisible) {
3985
3939
  this.lockScroll(true);
3986
3940
  }
3987
3941
  } else {
3988
- element.bib.style.position = "";
3989
- element.bib.removeAttribute("isfullscreen");
3990
- element.isBibFullscreen = false;
3991
- element.style.contain = "layout";
3942
+ this.element.bib.style.position = "";
3943
+ this.element.bib.removeAttribute("isfullscreen");
3944
+ this.element.isBibFullscreen = false;
3945
+ this.element.style.contain = "layout";
3992
3946
  }
3993
3947
 
3994
3948
  const isChanged = this.strategy && this.strategy !== value;
@@ -4006,21 +3960,16 @@ class AuroFloatingUI {
4006
3960
  },
4007
3961
  );
4008
3962
 
4009
- element.dispatchEvent(event);
3963
+ this.element.dispatchEvent(event);
4010
3964
  }
4011
3965
  }
4012
3966
 
4013
3967
  updateState() {
4014
- const element = this.element;
4015
- if (!element) {
4016
- return;
4017
- }
4018
-
4019
- const isVisible = element.isPopoverVisible;
3968
+ const isVisible = this.element.isPopoverVisible;
4020
3969
  if (!isVisible) {
4021
3970
  this.cleanupHideHandlers();
4022
3971
  try {
4023
- element.cleanup?.();
3972
+ this.element.cleanup?.();
4024
3973
  } catch (error) {
4025
3974
  // Do nothing
4026
3975
  }
@@ -4036,30 +3985,28 @@ class AuroFloatingUI {
4036
3985
  * If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
4037
3986
  */
4038
3987
  handleFocusLoss() {
4039
- const element = this.element;
4040
- if (!element?.bib) {
4041
- return;
4042
- }
4043
-
4044
3988
  // if mouse is being pressed, skip and let click event to handle the action
4045
3989
  if (AuroFloatingUI.isMousePressed) {
4046
3990
  return;
4047
3991
  }
4048
3992
 
4049
3993
  if (
4050
- element.noHideOnThisFocusLoss ||
4051
- element.hasAttribute("noHideOnThisFocusLoss")
3994
+ this.element.noHideOnThisFocusLoss ||
3995
+ this.element.hasAttribute("noHideOnThisFocusLoss")
4052
3996
  ) {
4053
3997
  return;
4054
3998
  }
4055
3999
 
4056
4000
  // if focus is still inside of trigger or bib, do not close
4057
- if (element.matches(":focus") || element.matches(":focus-within")) {
4001
+ if (
4002
+ this.element.matches(":focus") ||
4003
+ this.element.matches(":focus-within")
4004
+ ) {
4058
4005
  return;
4059
4006
  }
4060
4007
 
4061
4008
  // if fullscreen bib is in fullscreen mode, do not close
4062
- if (element.bib.hasAttribute("isfullscreen")) {
4009
+ if (this.element.bib.hasAttribute("isfullscreen")) {
4063
4010
  return;
4064
4011
  }
4065
4012
 
@@ -4067,33 +4014,23 @@ class AuroFloatingUI {
4067
4014
  }
4068
4015
 
4069
4016
  setupHideHandlers() {
4070
- const element = this.element;
4071
- if (!element) {
4072
- return;
4073
- }
4074
-
4075
4017
  // Define handlers & store references
4076
4018
  this.focusHandler = () => this.handleFocusLoss();
4077
4019
 
4078
4020
  this.clickHandler = (evt) => {
4079
- const element = this.element;
4080
- if (!element?.bib) {
4081
- return;
4082
- }
4083
-
4084
4021
  // When the bib is fullscreen (modal dialog), don't close on outside
4085
4022
  // clicks. VoiceOver's synthetic click events inside a top-layer modal
4086
4023
  // <dialog> may not include the bib in composedPath(), causing false
4087
4024
  // positives. This mirrors the fullscreen guard in handleFocusLoss().
4088
- if (element.bib.hasAttribute("isfullscreen")) {
4025
+ if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
4089
4026
  return;
4090
4027
  }
4091
4028
 
4092
4029
  if (
4093
- (!evt.composedPath().includes(element.trigger) &&
4094
- !evt.composedPath().includes(element.bib)) ||
4095
- (element.bib.backdrop &&
4096
- evt.composedPath().includes(element.bib.backdrop))
4030
+ (!evt.composedPath().includes(this.element.trigger) &&
4031
+ !evt.composedPath().includes(this.element.bib)) ||
4032
+ (this.element.bib.backdrop &&
4033
+ evt.composedPath().includes(this.element.bib.backdrop))
4097
4034
  ) {
4098
4035
  const existedVisibleFloatingUI =
4099
4036
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -4114,12 +4051,7 @@ class AuroFloatingUI {
4114
4051
 
4115
4052
  // ESC key handler
4116
4053
  this.keyDownHandler = (evt) => {
4117
- const element = this.element;
4118
- if (!element) {
4119
- return;
4120
- }
4121
-
4122
- if (evt.key === "Escape" && element.isPopoverVisible) {
4054
+ if (evt.key === "Escape" && this.element.isPopoverVisible) {
4123
4055
  const existedVisibleFloatingUI =
4124
4056
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
4125
4057
  if (
@@ -4176,10 +4108,6 @@ class AuroFloatingUI {
4176
4108
  }
4177
4109
 
4178
4110
  updateCurrentExpandedDropdown() {
4179
- if (!this.element) {
4180
- return;
4181
- }
4182
-
4183
4111
  // Close any other dropdown that is already open
4184
4112
  const existedVisibleFloatingUI =
4185
4113
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -4196,34 +4124,25 @@ class AuroFloatingUI {
4196
4124
  }
4197
4125
 
4198
4126
  showBib() {
4199
- const element = this.element;
4200
- if (!element) {
4201
- return;
4202
- }
4203
-
4204
- if (!element.bib || (!element.trigger && !element.parentNode)) {
4205
- return;
4206
- }
4207
-
4208
- if (!element.disabled && !this.showing) {
4127
+ if (!this.element.disabled && !this.showing) {
4209
4128
  this.updateCurrentExpandedDropdown();
4210
- element.triggerChevron?.setAttribute("data-expanded", true);
4129
+ this.element.triggerChevron?.setAttribute("data-expanded", true);
4211
4130
 
4212
4131
  // prevent double showing: isPopovervisible gets first and showBib gets called later
4213
4132
  if (!this.showing) {
4214
- if (!element.modal) {
4133
+ if (!this.element.modal) {
4215
4134
  this.setupHideHandlers();
4216
4135
  }
4217
4136
  this.showing = true;
4218
- element.isPopoverVisible = true;
4137
+ this.element.isPopoverVisible = true;
4219
4138
  this.position();
4220
4139
  this.dispatchEventDropdownToggle();
4221
4140
  }
4222
4141
 
4223
4142
  // Setup auto update to handle resize and scroll
4224
- element.cleanup = autoUpdate(
4225
- element.trigger || element.parentNode,
4226
- element.bib,
4143
+ this.element.cleanup = autoUpdate(
4144
+ this.element.trigger || this.element.parentNode,
4145
+ this.element.bib,
4227
4146
  () => {
4228
4147
  this.position();
4229
4148
  },
@@ -4236,27 +4155,22 @@ class AuroFloatingUI {
4236
4155
  * @param {String} eventType - The event type that triggered the hiding action.
4237
4156
  */
4238
4157
  hideBib(eventType = "unknown") {
4239
- const element = this.element;
4240
- if (!element) {
4241
- return;
4242
- }
4243
-
4244
- if (element.disabled) {
4158
+ if (this.element.disabled) {
4245
4159
  return;
4246
4160
  }
4247
4161
 
4248
4162
  // noToggle dropdowns should not close when the trigger is clicked (the
4249
4163
  // "toggle" behavior), but they CAN still close via other interactions like
4250
4164
  // Escape key or focus loss.
4251
- if (element.noToggle && eventType === "click") {
4165
+ if (this.element.noToggle && eventType === "click") {
4252
4166
  return;
4253
4167
  }
4254
4168
 
4255
4169
  this.lockScroll(false);
4256
- element.triggerChevron?.removeAttribute("data-expanded");
4170
+ this.element.triggerChevron?.removeAttribute("data-expanded");
4257
4171
 
4258
- if (element.isPopoverVisible) {
4259
- element.isPopoverVisible = false;
4172
+ if (this.element.isPopoverVisible) {
4173
+ this.element.isPopoverVisible = false;
4260
4174
  }
4261
4175
  if (this.showing) {
4262
4176
  this.cleanupHideHandlers();
@@ -4276,11 +4190,6 @@ class AuroFloatingUI {
4276
4190
  * @param {String} eventType - The event type that triggered the toggle action.
4277
4191
  */
4278
4192
  dispatchEventDropdownToggle(eventType) {
4279
- const element = this.element;
4280
- if (!element) {
4281
- return;
4282
- }
4283
-
4284
4193
  const event = new CustomEvent(
4285
4194
  this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
4286
4195
  {
@@ -4292,16 +4201,11 @@ class AuroFloatingUI {
4292
4201
  },
4293
4202
  );
4294
4203
 
4295
- element.dispatchEvent(event);
4204
+ this.element.dispatchEvent(event);
4296
4205
  }
4297
4206
 
4298
4207
  handleClick() {
4299
- const element = this.element;
4300
- if (!element) {
4301
- return;
4302
- }
4303
-
4304
- if (element.isPopoverVisible) {
4208
+ if (this.element.isPopoverVisible) {
4305
4209
  this.hideBib("click");
4306
4210
  } else {
4307
4211
  this.showBib();
@@ -4312,66 +4216,63 @@ class AuroFloatingUI {
4312
4216
  {
4313
4217
  composed: true,
4314
4218
  detail: {
4315
- expanded: element.isPopoverVisible,
4219
+ expanded: this.element.isPopoverVisible,
4316
4220
  },
4317
4221
  },
4318
4222
  );
4319
4223
 
4320
- element.dispatchEvent(event);
4224
+ this.element.dispatchEvent(event);
4321
4225
  }
4322
4226
 
4323
4227
  handleEvent(event) {
4324
- const element = this.element;
4325
- if (!element || element.disableEventShow) {
4326
- return;
4327
- }
4328
-
4329
- switch (event.type) {
4330
- case "keydown": {
4331
- // Support both Enter and Space keys for accessibility
4332
- // Space is included as it's expected behavior for interactive elements
4333
-
4334
- const origin = event.composedPath()[0];
4335
- if (
4336
- event.key === "Enter" ||
4337
- (event.key === " " && (!origin || origin.tagName !== "INPUT"))
4338
- ) {
4339
- event.preventDefault();
4340
- this.handleClick();
4228
+ if (!this.element.disableEventShow) {
4229
+ switch (event.type) {
4230
+ case "keydown": {
4231
+ // Support both Enter and Space keys for accessibility
4232
+ // Space is included as it's expected behavior for interactive elements
4233
+
4234
+ const origin = event.composedPath()[0];
4235
+ if (
4236
+ event.key === "Enter" ||
4237
+ (event.key === " " && (!origin || origin.tagName !== "INPUT"))
4238
+ ) {
4239
+ event.preventDefault();
4240
+ this.handleClick();
4241
+ }
4242
+ break;
4341
4243
  }
4342
- break;
4244
+ case "mouseenter":
4245
+ if (this.element.hoverToggle) {
4246
+ this.showBib();
4247
+ }
4248
+ break;
4249
+ case "mouseleave":
4250
+ if (this.element.hoverToggle) {
4251
+ this.hideBib("mouseleave");
4252
+ }
4253
+ break;
4254
+ case "focus":
4255
+ if (this.element.focusShow) {
4256
+ /*
4257
+ This needs to better handle clicking that gives focus -
4258
+ currently it shows and then immediately hides the bib
4259
+ */
4260
+ this.showBib();
4261
+ }
4262
+ break;
4263
+ case "blur":
4264
+ // send this task 100ms later queue to
4265
+ // wait a frame in case focus moves within the floating element/bib
4266
+ setTimeout(() => this.handleFocusLoss(), 0);
4267
+ break;
4268
+ case "click":
4269
+ if (document.activeElement === document.body) {
4270
+ event.currentTarget.focus();
4271
+ }
4272
+ this.handleClick();
4273
+ break;
4274
+ // Do nothing
4343
4275
  }
4344
- case "mouseenter":
4345
- if (element.hoverToggle) {
4346
- this.showBib();
4347
- }
4348
- break;
4349
- case "mouseleave":
4350
- if (element.hoverToggle) {
4351
- this.hideBib("mouseleave");
4352
- }
4353
- break;
4354
- case "focus":
4355
- if (element.focusShow) {
4356
- /*
4357
- This needs to better handle clicking that gives focus -
4358
- currently it shows and then immediately hides the bib
4359
- */
4360
- this.showBib();
4361
- }
4362
- break;
4363
- case "blur":
4364
- // send this task 100ms later queue to
4365
- // wait a frame in case focus moves within the floating element/bib
4366
- setTimeout(() => this.handleFocusLoss(), 0);
4367
- break;
4368
- case "click":
4369
- if (document.activeElement === document.body) {
4370
- event.currentTarget.focus();
4371
- }
4372
- this.handleClick();
4373
- break;
4374
- // Do nothing
4375
4276
  }
4376
4277
  }
4377
4278
 
@@ -4382,11 +4283,6 @@ class AuroFloatingUI {
4382
4283
  * This prevents the component itself from being focusable when the trigger element already handles focus.
4383
4284
  */
4384
4285
  handleTriggerTabIndex() {
4385
- const element = this.element;
4386
- if (!element) {
4387
- return;
4388
- }
4389
-
4390
4286
  const focusableElementSelectors = [
4391
4287
  "a",
4392
4288
  "button",
@@ -4399,7 +4295,7 @@ class AuroFloatingUI {
4399
4295
  "auro-hyperlink",
4400
4296
  ];
4401
4297
 
4402
- const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
4298
+ const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
4403
4299
  if (!triggerNode) {
4404
4300
  return;
4405
4301
  }
@@ -4408,13 +4304,13 @@ class AuroFloatingUI {
4408
4304
  focusableElementSelectors.forEach((selector) => {
4409
4305
  // Check if the trigger node element is focusable
4410
4306
  if (triggerNodeTagName === selector) {
4411
- element.tabIndex = -1;
4307
+ this.element.tabIndex = -1;
4412
4308
  return;
4413
4309
  }
4414
4310
 
4415
4311
  // Check if any child is focusable
4416
4312
  if (triggerNode.querySelector(selector)) {
4417
- element.tabIndex = -1;
4313
+ this.element.tabIndex = -1;
4418
4314
  }
4419
4315
  });
4420
4316
  }
@@ -4424,18 +4320,13 @@ class AuroFloatingUI {
4424
4320
  * @param {*} eventPrefix
4425
4321
  */
4426
4322
  regenerateBibId() {
4427
- const element = this.element;
4428
- if (!element) {
4429
- return;
4430
- }
4431
-
4432
- this.id = element.getAttribute("id");
4323
+ this.id = this.element.getAttribute("id");
4433
4324
  if (!this.id) {
4434
4325
  this.id = window.crypto.randomUUID();
4435
- element.setAttribute("id", this.id);
4326
+ this.element.setAttribute("id", this.id);
4436
4327
  }
4437
4328
 
4438
- element.bib?.setAttribute("id", `${this.id}-floater-bib`);
4329
+ this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
4439
4330
  }
4440
4331
 
4441
4332
  configure(elem, eventPrefix, enableKeyboardHandling = true) {
@@ -4447,69 +4338,67 @@ class AuroFloatingUI {
4447
4338
  this.element = elem;
4448
4339
  }
4449
4340
 
4450
- const element = this.element;
4451
- if (!element) {
4452
- return;
4341
+ if (this.behavior !== this.element.behavior) {
4342
+ this.behavior = this.element.behavior;
4453
4343
  }
4454
4344
 
4455
- if (this.behavior !== element.behavior) {
4456
- this.behavior = element.behavior;
4457
- }
4458
-
4459
- if (element.trigger) {
4345
+ if (this.element.trigger) {
4460
4346
  this.disconnect();
4461
4347
  }
4462
- element.trigger =
4463
- element.triggerElement ||
4464
- element.shadowRoot?.querySelector("#trigger") ||
4465
- element.trigger;
4466
- element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
4467
- element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
4468
- element.triggerChevron =
4469
- element.shadowRoot?.querySelector("#showStateIcon");
4348
+ this.element.trigger =
4349
+ this.element.triggerElement ||
4350
+ this.element.shadowRoot.querySelector("#trigger") ||
4351
+ this.element.trigger;
4352
+ this.element.bib =
4353
+ this.element.shadowRoot.querySelector("#bib") || this.element.bib;
4354
+ this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
4355
+ this.element.triggerChevron =
4356
+ this.element.shadowRoot.querySelector("#showStateIcon");
4470
4357
 
4471
- if (element.floaterConfig) {
4472
- element.hoverToggle = element.floaterConfig.hoverToggle;
4358
+ if (this.element.floaterConfig) {
4359
+ this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
4473
4360
  }
4474
4361
 
4475
4362
  this.regenerateBibId();
4476
4363
  this.handleTriggerTabIndex();
4477
4364
 
4478
4365
  this.handleEvent = this.handleEvent.bind(this);
4479
- if (element.trigger) {
4366
+ if (this.element.trigger) {
4480
4367
  if (this.enableKeyboardHandling) {
4481
- element.trigger.addEventListener("keydown", this.handleEvent);
4368
+ this.element.trigger.addEventListener("keydown", this.handleEvent);
4482
4369
  }
4483
- element.trigger.addEventListener("click", this.handleEvent);
4484
- element.trigger.addEventListener("mouseenter", this.handleEvent);
4485
- element.trigger.addEventListener("mouseleave", this.handleEvent);
4486
- element.trigger.addEventListener("focus", this.handleEvent);
4487
- element.trigger.addEventListener("blur", this.handleEvent);
4370
+ this.element.trigger.addEventListener("click", this.handleEvent);
4371
+ this.element.trigger.addEventListener("mouseenter", this.handleEvent);
4372
+ this.element.trigger.addEventListener("mouseleave", this.handleEvent);
4373
+ this.element.trigger.addEventListener("focus", this.handleEvent);
4374
+ this.element.trigger.addEventListener("blur", this.handleEvent);
4488
4375
  }
4489
4376
  }
4490
4377
 
4491
4378
  disconnect() {
4492
4379
  this.cleanupHideHandlers();
4380
+ if (this.element) {
4381
+ this.element.cleanup?.();
4493
4382
 
4494
- const element = this.element;
4495
- if (!element) {
4496
- return;
4497
- }
4498
-
4499
- element.cleanup?.();
4500
-
4501
- if (element.bib && element.shadowRoot) {
4502
- element.shadowRoot.append(element.bib);
4503
- }
4383
+ if (this.element.bib) {
4384
+ this.element.shadowRoot.append(this.element.bib);
4385
+ }
4504
4386
 
4505
- // Remove event & keyboard listeners
4506
- if (element.trigger) {
4507
- element.trigger.removeEventListener("keydown", this.handleEvent);
4508
- element.trigger.removeEventListener("click", this.handleEvent);
4509
- element.trigger.removeEventListener("mouseenter", this.handleEvent);
4510
- element.trigger.removeEventListener("mouseleave", this.handleEvent);
4511
- element.trigger.removeEventListener("focus", this.handleEvent);
4512
- element.trigger.removeEventListener("blur", this.handleEvent);
4387
+ // Remove event & keyboard listeners
4388
+ if (this.element?.trigger) {
4389
+ this.element.trigger.removeEventListener("keydown", this.handleEvent);
4390
+ this.element.trigger.removeEventListener("click", this.handleEvent);
4391
+ this.element.trigger.removeEventListener(
4392
+ "mouseenter",
4393
+ this.handleEvent,
4394
+ );
4395
+ this.element.trigger.removeEventListener(
4396
+ "mouseleave",
4397
+ this.handleEvent,
4398
+ );
4399
+ this.element.trigger.removeEventListener("focus", this.handleEvent);
4400
+ this.element.trigger.removeEventListener("blur", this.handleEvent);
4401
+ }
4513
4402
  }
4514
4403
  }
4515
4404
  }
@@ -5637,7 +5526,7 @@ class AuroHelpText extends LitElement {
5637
5526
  }
5638
5527
  }
5639
5528
 
5640
- var formkitVersion = '202604071818';
5529
+ var formkitVersion = '202604072118';
5641
5530
 
5642
5531
  let AuroElement$1 = class AuroElement extends LitElement {
5643
5532
  static get properties() {