@aurodesignsystem-dev/auro-formkit 0.0.0-pr1425.0 → 0.0.0-pr1428.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 (36) 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 +276 -165
  6. package/components/combobox/demo/index.min.js +276 -165
  7. package/components/combobox/dist/index.js +276 -165
  8. package/components/combobox/dist/registered.js +276 -165
  9. package/components/counter/demo/api.min.js +275 -164
  10. package/components/counter/demo/index.min.js +275 -164
  11. package/components/counter/dist/index.js +275 -164
  12. package/components/counter/dist/registered.js +275 -164
  13. package/components/datepicker/demo/api.min.js +276 -165
  14. package/components/datepicker/demo/index.min.js +276 -165
  15. package/components/datepicker/dist/index.js +276 -165
  16. package/components/datepicker/dist/registered.js +276 -165
  17. package/components/dropdown/demo/api.min.js +275 -164
  18. package/components/dropdown/demo/index.min.js +275 -164
  19. package/components/dropdown/dist/index.js +275 -164
  20. package/components/dropdown/dist/registered.js +275 -164
  21. package/components/form/demo/api.min.js +1105 -661
  22. package/components/form/demo/index.min.js +1105 -661
  23. package/components/input/demo/api.min.js +1 -1
  24. package/components/input/demo/index.min.js +1 -1
  25. package/components/input/dist/index.js +1 -1
  26. package/components/input/dist/registered.js +1 -1
  27. package/components/radio/demo/api.min.js +1 -1
  28. package/components/radio/demo/index.min.js +1 -1
  29. package/components/radio/dist/index.js +1 -1
  30. package/components/radio/dist/registered.js +1 -1
  31. package/components/select/demo/api.min.js +275 -164
  32. package/components/select/demo/index.min.js +275 -164
  33. package/components/select/dist/index.js +275 -164
  34. package/components/select/dist/registered.js +275 -164
  35. package/custom-elements.json +244 -244
  36. package/package.json +2 -2
@@ -3367,11 +3367,19 @@ class AuroFloatingUI {
3367
3367
  * This ensures that the bib content has the same dimensions as the sizer element.
3368
3368
  */
3369
3369
  mirrorSize() {
3370
+ const element = this.element;
3371
+ if (!element) {
3372
+ return;
3373
+ }
3374
+
3370
3375
  // mirror the boxsize from bibSizer
3371
- if (this.element.bibSizer && this.element.matchWidth) {
3372
- const sizerStyle = window.getComputedStyle(this.element.bibSizer);
3373
- const bibContent =
3374
- this.element.bib.shadowRoot.querySelector(".container");
3376
+ if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
3377
+ const sizerStyle = window.getComputedStyle(element.bibSizer);
3378
+ const bibContent = element.bib.shadowRoot.querySelector(".container");
3379
+ if (!bibContent) {
3380
+ return;
3381
+ }
3382
+
3375
3383
  if (sizerStyle.width !== "0px") {
3376
3384
  bibContent.style.width = sizerStyle.width;
3377
3385
  }
@@ -3393,9 +3401,14 @@ class AuroFloatingUI {
3393
3401
  * @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
3394
3402
  */
3395
3403
  getPositioningStrategy() {
3404
+ const element = this.element;
3405
+ if (!element) {
3406
+ return "floating";
3407
+ }
3408
+
3396
3409
  const breakpoint =
3397
- this.element.bib.mobileFullscreenBreakpoint ||
3398
- this.element.floaterConfig?.fullscreenBreakpoint;
3410
+ element.bib?.mobileFullscreenBreakpoint ||
3411
+ element.floaterConfig?.fullscreenBreakpoint;
3399
3412
  switch (this.behavior) {
3400
3413
  case "tooltip":
3401
3414
  return "floating";
@@ -3406,9 +3419,9 @@ class AuroFloatingUI {
3406
3419
  `(max-width: ${breakpoint})`,
3407
3420
  ).matches;
3408
3421
 
3409
- this.element.expanded = smallerThanBreakpoint;
3422
+ element.expanded = smallerThanBreakpoint;
3410
3423
  }
3411
- if (this.element.nested) {
3424
+ if (element.nested) {
3412
3425
  return "cover";
3413
3426
  }
3414
3427
  return "fullscreen";
@@ -3438,42 +3451,65 @@ class AuroFloatingUI {
3438
3451
  * and applies the calculated position to the bib's style.
3439
3452
  */
3440
3453
  position() {
3454
+ const element = this.element;
3455
+ if (!element) {
3456
+ return;
3457
+ }
3458
+
3441
3459
  const strategy = this.getPositioningStrategy();
3442
3460
  this.configureBibStrategy(strategy);
3443
3461
 
3444
3462
  if (strategy === "floating") {
3463
+ if (!element.trigger || !element.bib) {
3464
+ return;
3465
+ }
3466
+
3445
3467
  this.mirrorSize();
3446
3468
  // Define the middlware for the floater configuration
3447
3469
  const middleware = [
3448
- offset(this.element.floaterConfig?.offset || 0),
3449
- ...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3450
- ...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3451
- ...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3470
+ offset(element.floaterConfig?.offset || 0),
3471
+ ...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3472
+ ...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3473
+ ...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3452
3474
  ];
3453
3475
 
3454
3476
  // Compute the position of the bib
3455
- computePosition(this.element.trigger, this.element.bib, {
3456
- strategy: this.element.floaterConfig?.strategy || "fixed",
3457
- placement: this.element.floaterConfig?.placement,
3477
+ computePosition(element.trigger, element.bib, {
3478
+ strategy: element.floaterConfig?.strategy || "fixed",
3479
+ placement: element.floaterConfig?.placement,
3458
3480
  middleware: middleware || [],
3459
3481
  }).then(({ x, y }) => {
3460
3482
  // eslint-disable-line id-length
3461
- Object.assign(this.element.bib.style, {
3483
+ const currentElement = this.element;
3484
+ if (!currentElement?.bib) {
3485
+ return;
3486
+ }
3487
+
3488
+ Object.assign(currentElement.bib.style, {
3462
3489
  left: `${x}px`,
3463
3490
  top: `${y}px`,
3464
3491
  });
3465
3492
  });
3466
3493
  } else if (strategy === "cover") {
3494
+ if (!element.parentNode || !element.bib) {
3495
+ return;
3496
+ }
3497
+
3467
3498
  // Compute the position of the bib
3468
- computePosition(this.element.parentNode, this.element.bib, {
3499
+ computePosition(element.parentNode, element.bib, {
3469
3500
  placement: "bottom-start",
3470
3501
  }).then(({ x, y }) => {
3471
3502
  // eslint-disable-line id-length
3472
- Object.assign(this.element.bib.style, {
3503
+ const currentElement = this.element;
3504
+ if (!currentElement?.bib || !currentElement.parentNode) {
3505
+ return;
3506
+ }
3507
+
3508
+ Object.assign(currentElement.bib.style, {
3473
3509
  left: `${x}px`,
3474
- top: `${y - this.element.parentNode.offsetHeight}px`,
3475
- width: `${this.element.parentNode.offsetWidth}px`,
3476
- height: `${this.element.parentNode.offsetHeight}px`,
3510
+ top: `${y - currentElement.parentNode.offsetHeight}px`,
3511
+ width: `${currentElement.parentNode.offsetWidth}px`,
3512
+ height: `${currentElement.parentNode.offsetHeight}px`,
3477
3513
  });
3478
3514
  });
3479
3515
  }
@@ -3485,11 +3521,17 @@ class AuroFloatingUI {
3485
3521
  * @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
3486
3522
  */
3487
3523
  lockScroll(lock = true) {
3524
+ const element = this.element;
3525
+
3488
3526
  if (lock) {
3527
+ if (!element?.bib) {
3528
+ return;
3529
+ }
3530
+
3489
3531
  document.body.style.overflow = "hidden"; // hide body's scrollbar
3490
3532
 
3491
3533
  // Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
3492
- this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3534
+ element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3493
3535
  } else {
3494
3536
  document.body.style.overflow = "";
3495
3537
  }
@@ -3505,20 +3547,24 @@ class AuroFloatingUI {
3505
3547
  * @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
3506
3548
  */
3507
3549
  configureBibStrategy(value) {
3550
+ const element = this.element;
3551
+ if (!element?.bib) {
3552
+ return;
3553
+ }
3554
+
3508
3555
  if (value === "fullscreen") {
3509
- this.element.isBibFullscreen = true;
3556
+ element.isBibFullscreen = true;
3510
3557
  // reset the prev position
3511
- this.element.bib.setAttribute("isfullscreen", "");
3512
- this.element.bib.style.position = "fixed";
3513
- this.element.bib.style.top = "0px";
3514
- this.element.bib.style.left = "0px";
3515
- this.element.bib.style.width = "";
3516
- this.element.bib.style.height = "";
3517
- this.element.style.contain = "";
3558
+ element.bib.setAttribute("isfullscreen", "");
3559
+ element.bib.style.position = "fixed";
3560
+ element.bib.style.top = "0px";
3561
+ element.bib.style.left = "0px";
3562
+ element.bib.style.width = "";
3563
+ element.bib.style.height = "";
3564
+ element.style.contain = "";
3518
3565
 
3519
3566
  // reset the size that was mirroring `size` css-part
3520
- const bibContent =
3521
- this.element.bib.shadowRoot.querySelector(".container");
3567
+ const bibContent = element.bib.shadowRoot?.querySelector(".container");
3522
3568
  if (bibContent) {
3523
3569
  bibContent.style.width = "";
3524
3570
  bibContent.style.height = "";
@@ -3533,14 +3579,14 @@ class AuroFloatingUI {
3533
3579
  }, 0);
3534
3580
  }
3535
3581
 
3536
- if (this.element.isPopoverVisible) {
3582
+ if (element.isPopoverVisible) {
3537
3583
  this.lockScroll(true);
3538
3584
  }
3539
3585
  } else {
3540
- this.element.bib.style.position = "";
3541
- this.element.bib.removeAttribute("isfullscreen");
3542
- this.element.isBibFullscreen = false;
3543
- this.element.style.contain = "layout";
3586
+ element.bib.style.position = "";
3587
+ element.bib.removeAttribute("isfullscreen");
3588
+ element.isBibFullscreen = false;
3589
+ element.style.contain = "layout";
3544
3590
  }
3545
3591
 
3546
3592
  const isChanged = this.strategy && this.strategy !== value;
@@ -3558,16 +3604,21 @@ class AuroFloatingUI {
3558
3604
  },
3559
3605
  );
3560
3606
 
3561
- this.element.dispatchEvent(event);
3607
+ element.dispatchEvent(event);
3562
3608
  }
3563
3609
  }
3564
3610
 
3565
3611
  updateState() {
3566
- const isVisible = this.element.isPopoverVisible;
3612
+ const element = this.element;
3613
+ if (!element) {
3614
+ return;
3615
+ }
3616
+
3617
+ const isVisible = element.isPopoverVisible;
3567
3618
  if (!isVisible) {
3568
3619
  this.cleanupHideHandlers();
3569
3620
  try {
3570
- this.element.cleanup?.();
3621
+ element.cleanup?.();
3571
3622
  } catch (error) {
3572
3623
  // Do nothing
3573
3624
  }
@@ -3583,28 +3634,30 @@ class AuroFloatingUI {
3583
3634
  * If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
3584
3635
  */
3585
3636
  handleFocusLoss() {
3637
+ const element = this.element;
3638
+ if (!element?.bib) {
3639
+ return;
3640
+ }
3641
+
3586
3642
  // if mouse is being pressed, skip and let click event to handle the action
3587
3643
  if (AuroFloatingUI.isMousePressed) {
3588
3644
  return;
3589
3645
  }
3590
3646
 
3591
3647
  if (
3592
- this.element.noHideOnThisFocusLoss ||
3593
- this.element.hasAttribute("noHideOnThisFocusLoss")
3648
+ element.noHideOnThisFocusLoss ||
3649
+ element.hasAttribute("noHideOnThisFocusLoss")
3594
3650
  ) {
3595
3651
  return;
3596
3652
  }
3597
3653
 
3598
3654
  // if focus is still inside of trigger or bib, do not close
3599
- if (
3600
- this.element.matches(":focus") ||
3601
- this.element.matches(":focus-within")
3602
- ) {
3655
+ if (element.matches(":focus") || element.matches(":focus-within")) {
3603
3656
  return;
3604
3657
  }
3605
3658
 
3606
3659
  // if fullscreen bib is in fullscreen mode, do not close
3607
- if (this.element.bib.hasAttribute("isfullscreen")) {
3660
+ if (element.bib.hasAttribute("isfullscreen")) {
3608
3661
  return;
3609
3662
  }
3610
3663
 
@@ -3612,23 +3665,33 @@ class AuroFloatingUI {
3612
3665
  }
3613
3666
 
3614
3667
  setupHideHandlers() {
3668
+ const element = this.element;
3669
+ if (!element) {
3670
+ return;
3671
+ }
3672
+
3615
3673
  // Define handlers & store references
3616
3674
  this.focusHandler = () => this.handleFocusLoss();
3617
3675
 
3618
3676
  this.clickHandler = (evt) => {
3677
+ const element = this.element;
3678
+ if (!element?.bib) {
3679
+ return;
3680
+ }
3681
+
3619
3682
  // When the bib is fullscreen (modal dialog), don't close on outside
3620
3683
  // clicks. VoiceOver's synthetic click events inside a top-layer modal
3621
3684
  // <dialog> may not include the bib in composedPath(), causing false
3622
3685
  // positives. This mirrors the fullscreen guard in handleFocusLoss().
3623
- if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
3686
+ if (element.bib.hasAttribute("isfullscreen")) {
3624
3687
  return;
3625
3688
  }
3626
3689
 
3627
3690
  if (
3628
- (!evt.composedPath().includes(this.element.trigger) &&
3629
- !evt.composedPath().includes(this.element.bib)) ||
3630
- (this.element.bib.backdrop &&
3631
- evt.composedPath().includes(this.element.bib.backdrop))
3691
+ (!evt.composedPath().includes(element.trigger) &&
3692
+ !evt.composedPath().includes(element.bib)) ||
3693
+ (element.bib.backdrop &&
3694
+ evt.composedPath().includes(element.bib.backdrop))
3632
3695
  ) {
3633
3696
  const existedVisibleFloatingUI =
3634
3697
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3649,7 +3712,12 @@ class AuroFloatingUI {
3649
3712
 
3650
3713
  // ESC key handler
3651
3714
  this.keyDownHandler = (evt) => {
3652
- if (evt.key === "Escape" && this.element.isPopoverVisible) {
3715
+ const element = this.element;
3716
+ if (!element) {
3717
+ return;
3718
+ }
3719
+
3720
+ if (evt.key === "Escape" && element.isPopoverVisible) {
3653
3721
  const existedVisibleFloatingUI =
3654
3722
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
3655
3723
  if (
@@ -3706,6 +3774,10 @@ class AuroFloatingUI {
3706
3774
  }
3707
3775
 
3708
3776
  updateCurrentExpandedDropdown() {
3777
+ if (!this.element) {
3778
+ return;
3779
+ }
3780
+
3709
3781
  // Close any other dropdown that is already open
3710
3782
  const existedVisibleFloatingUI =
3711
3783
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3722,25 +3794,34 @@ class AuroFloatingUI {
3722
3794
  }
3723
3795
 
3724
3796
  showBib() {
3725
- if (!this.element.disabled && !this.showing) {
3797
+ const element = this.element;
3798
+ if (!element) {
3799
+ return;
3800
+ }
3801
+
3802
+ if (!element.bib || (!element.trigger && !element.parentNode)) {
3803
+ return;
3804
+ }
3805
+
3806
+ if (!element.disabled && !this.showing) {
3726
3807
  this.updateCurrentExpandedDropdown();
3727
- this.element.triggerChevron?.setAttribute("data-expanded", true);
3808
+ element.triggerChevron?.setAttribute("data-expanded", true);
3728
3809
 
3729
3810
  // prevent double showing: isPopovervisible gets first and showBib gets called later
3730
3811
  if (!this.showing) {
3731
- if (!this.element.modal) {
3812
+ if (!element.modal) {
3732
3813
  this.setupHideHandlers();
3733
3814
  }
3734
3815
  this.showing = true;
3735
- this.element.isPopoverVisible = true;
3816
+ element.isPopoverVisible = true;
3736
3817
  this.position();
3737
3818
  this.dispatchEventDropdownToggle();
3738
3819
  }
3739
3820
 
3740
3821
  // Setup auto update to handle resize and scroll
3741
- this.element.cleanup = autoUpdate(
3742
- this.element.trigger || this.element.parentNode,
3743
- this.element.bib,
3822
+ element.cleanup = autoUpdate(
3823
+ element.trigger || element.parentNode,
3824
+ element.bib,
3744
3825
  () => {
3745
3826
  this.position();
3746
3827
  },
@@ -3753,22 +3834,27 @@ class AuroFloatingUI {
3753
3834
  * @param {String} eventType - The event type that triggered the hiding action.
3754
3835
  */
3755
3836
  hideBib(eventType = "unknown") {
3756
- if (this.element.disabled) {
3837
+ const element = this.element;
3838
+ if (!element) {
3839
+ return;
3840
+ }
3841
+
3842
+ if (element.disabled) {
3757
3843
  return;
3758
3844
  }
3759
3845
 
3760
3846
  // noToggle dropdowns should not close when the trigger is clicked (the
3761
3847
  // "toggle" behavior), but they CAN still close via other interactions like
3762
3848
  // Escape key or focus loss.
3763
- if (this.element.noToggle && eventType === "click") {
3849
+ if (element.noToggle && eventType === "click") {
3764
3850
  return;
3765
3851
  }
3766
3852
 
3767
3853
  this.lockScroll(false);
3768
- this.element.triggerChevron?.removeAttribute("data-expanded");
3854
+ element.triggerChevron?.removeAttribute("data-expanded");
3769
3855
 
3770
- if (this.element.isPopoverVisible) {
3771
- this.element.isPopoverVisible = false;
3856
+ if (element.isPopoverVisible) {
3857
+ element.isPopoverVisible = false;
3772
3858
  }
3773
3859
  if (this.showing) {
3774
3860
  this.cleanupHideHandlers();
@@ -3788,6 +3874,11 @@ class AuroFloatingUI {
3788
3874
  * @param {String} eventType - The event type that triggered the toggle action.
3789
3875
  */
3790
3876
  dispatchEventDropdownToggle(eventType) {
3877
+ const element = this.element;
3878
+ if (!element) {
3879
+ return;
3880
+ }
3881
+
3791
3882
  const event = new CustomEvent(
3792
3883
  this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
3793
3884
  {
@@ -3799,11 +3890,16 @@ class AuroFloatingUI {
3799
3890
  },
3800
3891
  );
3801
3892
 
3802
- this.element.dispatchEvent(event);
3893
+ element.dispatchEvent(event);
3803
3894
  }
3804
3895
 
3805
3896
  handleClick() {
3806
- if (this.element.isPopoverVisible) {
3897
+ const element = this.element;
3898
+ if (!element) {
3899
+ return;
3900
+ }
3901
+
3902
+ if (element.isPopoverVisible) {
3807
3903
  this.hideBib("click");
3808
3904
  } else {
3809
3905
  this.showBib();
@@ -3814,63 +3910,66 @@ class AuroFloatingUI {
3814
3910
  {
3815
3911
  composed: true,
3816
3912
  detail: {
3817
- expanded: this.element.isPopoverVisible,
3913
+ expanded: element.isPopoverVisible,
3818
3914
  },
3819
3915
  },
3820
3916
  );
3821
3917
 
3822
- this.element.dispatchEvent(event);
3918
+ element.dispatchEvent(event);
3823
3919
  }
3824
3920
 
3825
3921
  handleEvent(event) {
3826
- if (!this.element.disableEventShow) {
3827
- switch (event.type) {
3828
- case "keydown": {
3829
- // Support both Enter and Space keys for accessibility
3830
- // Space is included as it's expected behavior for interactive elements
3831
-
3832
- const origin = event.composedPath()[0];
3833
- if (
3834
- event.key === "Enter" ||
3835
- (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3836
- ) {
3837
- event.preventDefault();
3838
- this.handleClick();
3839
- }
3840
- break;
3841
- }
3842
- case "mouseenter":
3843
- if (this.element.hoverToggle) {
3844
- this.showBib();
3845
- }
3846
- break;
3847
- case "mouseleave":
3848
- if (this.element.hoverToggle) {
3849
- this.hideBib("mouseleave");
3850
- }
3851
- break;
3852
- case "focus":
3853
- if (this.element.focusShow) {
3854
- /*
3855
- This needs to better handle clicking that gives focus -
3856
- currently it shows and then immediately hides the bib
3857
- */
3858
- this.showBib();
3859
- }
3860
- break;
3861
- case "blur":
3862
- // send this task 100ms later queue to
3863
- // wait a frame in case focus moves within the floating element/bib
3864
- setTimeout(() => this.handleFocusLoss(), 0);
3865
- break;
3866
- case "click":
3867
- if (document.activeElement === document.body) {
3868
- event.currentTarget.focus();
3869
- }
3922
+ const element = this.element;
3923
+ if (!element || element.disableEventShow) {
3924
+ return;
3925
+ }
3926
+
3927
+ switch (event.type) {
3928
+ case "keydown": {
3929
+ // Support both Enter and Space keys for accessibility
3930
+ // Space is included as it's expected behavior for interactive elements
3931
+
3932
+ const origin = event.composedPath()[0];
3933
+ if (
3934
+ event.key === "Enter" ||
3935
+ (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3936
+ ) {
3937
+ event.preventDefault();
3870
3938
  this.handleClick();
3871
- break;
3872
- // Do nothing
3939
+ }
3940
+ break;
3873
3941
  }
3942
+ case "mouseenter":
3943
+ if (element.hoverToggle) {
3944
+ this.showBib();
3945
+ }
3946
+ break;
3947
+ case "mouseleave":
3948
+ if (element.hoverToggle) {
3949
+ this.hideBib("mouseleave");
3950
+ }
3951
+ break;
3952
+ case "focus":
3953
+ if (element.focusShow) {
3954
+ /*
3955
+ This needs to better handle clicking that gives focus -
3956
+ currently it shows and then immediately hides the bib
3957
+ */
3958
+ this.showBib();
3959
+ }
3960
+ break;
3961
+ case "blur":
3962
+ // send this task 100ms later queue to
3963
+ // wait a frame in case focus moves within the floating element/bib
3964
+ setTimeout(() => this.handleFocusLoss(), 0);
3965
+ break;
3966
+ case "click":
3967
+ if (document.activeElement === document.body) {
3968
+ event.currentTarget.focus();
3969
+ }
3970
+ this.handleClick();
3971
+ break;
3972
+ // Do nothing
3874
3973
  }
3875
3974
  }
3876
3975
 
@@ -3881,6 +3980,11 @@ class AuroFloatingUI {
3881
3980
  * This prevents the component itself from being focusable when the trigger element already handles focus.
3882
3981
  */
3883
3982
  handleTriggerTabIndex() {
3983
+ const element = this.element;
3984
+ if (!element) {
3985
+ return;
3986
+ }
3987
+
3884
3988
  const focusableElementSelectors = [
3885
3989
  "a",
3886
3990
  "button",
@@ -3893,7 +3997,7 @@ class AuroFloatingUI {
3893
3997
  "auro-hyperlink",
3894
3998
  ];
3895
3999
 
3896
- const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
4000
+ const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
3897
4001
  if (!triggerNode) {
3898
4002
  return;
3899
4003
  }
@@ -3902,13 +4006,13 @@ class AuroFloatingUI {
3902
4006
  focusableElementSelectors.forEach((selector) => {
3903
4007
  // Check if the trigger node element is focusable
3904
4008
  if (triggerNodeTagName === selector) {
3905
- this.element.tabIndex = -1;
4009
+ element.tabIndex = -1;
3906
4010
  return;
3907
4011
  }
3908
4012
 
3909
4013
  // Check if any child is focusable
3910
4014
  if (triggerNode.querySelector(selector)) {
3911
- this.element.tabIndex = -1;
4015
+ element.tabIndex = -1;
3912
4016
  }
3913
4017
  });
3914
4018
  }
@@ -3918,13 +4022,18 @@ class AuroFloatingUI {
3918
4022
  * @param {*} eventPrefix
3919
4023
  */
3920
4024
  regenerateBibId() {
3921
- this.id = this.element.getAttribute("id");
4025
+ const element = this.element;
4026
+ if (!element) {
4027
+ return;
4028
+ }
4029
+
4030
+ this.id = element.getAttribute("id");
3922
4031
  if (!this.id) {
3923
4032
  this.id = window.crypto.randomUUID();
3924
- this.element.setAttribute("id", this.id);
4033
+ element.setAttribute("id", this.id);
3925
4034
  }
3926
4035
 
3927
- this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
4036
+ element.bib?.setAttribute("id", `${this.id}-floater-bib`);
3928
4037
  }
3929
4038
 
3930
4039
  configure(elem, eventPrefix, enableKeyboardHandling = true) {
@@ -3936,67 +4045,69 @@ class AuroFloatingUI {
3936
4045
  this.element = elem;
3937
4046
  }
3938
4047
 
3939
- if (this.behavior !== this.element.behavior) {
3940
- this.behavior = this.element.behavior;
4048
+ const element = this.element;
4049
+ if (!element) {
4050
+ return;
3941
4051
  }
3942
4052
 
3943
- if (this.element.trigger) {
4053
+ if (this.behavior !== element.behavior) {
4054
+ this.behavior = element.behavior;
4055
+ }
4056
+
4057
+ if (element.trigger) {
3944
4058
  this.disconnect();
3945
4059
  }
3946
- this.element.trigger =
3947
- this.element.triggerElement ||
3948
- this.element.shadowRoot.querySelector("#trigger") ||
3949
- this.element.trigger;
3950
- this.element.bib =
3951
- this.element.shadowRoot.querySelector("#bib") || this.element.bib;
3952
- this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
3953
- this.element.triggerChevron =
3954
- this.element.shadowRoot.querySelector("#showStateIcon");
4060
+ element.trigger =
4061
+ element.triggerElement ||
4062
+ element.shadowRoot?.querySelector("#trigger") ||
4063
+ element.trigger;
4064
+ element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
4065
+ element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
4066
+ element.triggerChevron =
4067
+ element.shadowRoot?.querySelector("#showStateIcon");
3955
4068
 
3956
- if (this.element.floaterConfig) {
3957
- this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
4069
+ if (element.floaterConfig) {
4070
+ element.hoverToggle = element.floaterConfig.hoverToggle;
3958
4071
  }
3959
4072
 
3960
4073
  this.regenerateBibId();
3961
4074
  this.handleTriggerTabIndex();
3962
4075
 
3963
4076
  this.handleEvent = this.handleEvent.bind(this);
3964
- if (this.element.trigger) {
4077
+ if (element.trigger) {
3965
4078
  if (this.enableKeyboardHandling) {
3966
- this.element.trigger.addEventListener("keydown", this.handleEvent);
4079
+ element.trigger.addEventListener("keydown", this.handleEvent);
3967
4080
  }
3968
- this.element.trigger.addEventListener("click", this.handleEvent);
3969
- this.element.trigger.addEventListener("mouseenter", this.handleEvent);
3970
- this.element.trigger.addEventListener("mouseleave", this.handleEvent);
3971
- this.element.trigger.addEventListener("focus", this.handleEvent);
3972
- this.element.trigger.addEventListener("blur", this.handleEvent);
4081
+ element.trigger.addEventListener("click", this.handleEvent);
4082
+ element.trigger.addEventListener("mouseenter", this.handleEvent);
4083
+ element.trigger.addEventListener("mouseleave", this.handleEvent);
4084
+ element.trigger.addEventListener("focus", this.handleEvent);
4085
+ element.trigger.addEventListener("blur", this.handleEvent);
3973
4086
  }
3974
4087
  }
3975
4088
 
3976
4089
  disconnect() {
3977
4090
  this.cleanupHideHandlers();
3978
- if (this.element) {
3979
- this.element.cleanup?.();
3980
4091
 
3981
- if (this.element.bib) {
3982
- this.element.shadowRoot.append(this.element.bib);
3983
- }
4092
+ const element = this.element;
4093
+ if (!element) {
4094
+ return;
4095
+ }
3984
4096
 
3985
- // Remove event & keyboard listeners
3986
- if (this.element?.trigger) {
3987
- this.element.trigger.removeEventListener("keydown", this.handleEvent);
3988
- this.element.trigger.removeEventListener("click", this.handleEvent);
3989
- this.element.trigger.removeEventListener(
3990
- "mouseenter",
3991
- this.handleEvent,
3992
- );
3993
- this.element.trigger.removeEventListener(
3994
- "mouseleave",
3995
- this.handleEvent,
3996
- );
3997
- this.element.trigger.removeEventListener("focus", this.handleEvent);
3998
- this.element.trigger.removeEventListener("blur", this.handleEvent);
3999
- }
4097
+ element.cleanup?.();
4098
+
4099
+ if (element.bib && element.shadowRoot) {
4100
+ element.shadowRoot.append(element.bib);
4101
+ }
4102
+
4103
+ // Remove event & keyboard listeners
4104
+ if (element.trigger) {
4105
+ element.trigger.removeEventListener("keydown", this.handleEvent);
4106
+ element.trigger.removeEventListener("click", this.handleEvent);
4107
+ element.trigger.removeEventListener("mouseenter", this.handleEvent);
4108
+ element.trigger.removeEventListener("mouseleave", this.handleEvent);
4109
+ element.trigger.removeEventListener("focus", this.handleEvent);
4110
+ element.trigger.removeEventListener("blur", this.handleEvent);
4000
4111
  }
4001
4112
  }
4002
4113
  }
@@ -5124,7 +5235,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
5124
5235
  }
5125
5236
  };
5126
5237
 
5127
- var formkitVersion$1 = '202604072126';
5238
+ var formkitVersion$1 = '202604081417';
5128
5239
 
5129
5240
  class AuroElement extends i$3 {
5130
5241
  static get properties() {
@@ -6877,7 +6988,7 @@ class AuroHelpText extends i$3 {
6877
6988
  }
6878
6989
  }
6879
6990
 
6880
- var formkitVersion = '202604072126';
6991
+ var formkitVersion = '202604081417';
6881
6992
 
6882
6993
  var styleCss$2 = 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}.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-outline-color: var(--ds-auro-select-outline-color)}:host{display:inline-block;text-align:left;vertical-align:top}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}:host([layout*=emphasized]) .mainContent,:host([layout*=snowflake]) .mainContent{text-align:center}.mainContent{position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host([layout*=snowflake]) label{padding-block:var(--ds-size-25, 0.125rem)}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) .value{height:auto}label{color:var(--ds-auro-select-label-text-color)}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown],:host([appearance=inverse]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([fluid]){width:100%}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown],:host([disabled]:not([appearance=inverse])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown],:host(:not([layout*=classic])[disabled][appearance=inverse]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
6883
6994