@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.1 → 0.0.0-pr1423.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 (35) 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 +165 -275
  6. package/components/combobox/demo/index.min.js +165 -275
  7. package/components/combobox/dist/index.js +165 -275
  8. package/components/combobox/dist/registered.js +165 -275
  9. package/components/counter/demo/api.min.js +164 -274
  10. package/components/counter/demo/index.min.js +164 -274
  11. package/components/counter/dist/index.js +164 -274
  12. package/components/counter/dist/registered.js +164 -274
  13. package/components/datepicker/demo/api.min.js +165 -275
  14. package/components/datepicker/demo/index.min.js +165 -275
  15. package/components/datepicker/dist/index.js +165 -275
  16. package/components/datepicker/dist/registered.js +165 -275
  17. package/components/dropdown/demo/api.min.js +164 -274
  18. package/components/dropdown/demo/index.min.js +164 -274
  19. package/components/dropdown/dist/index.js +164 -274
  20. package/components/dropdown/dist/registered.js +164 -274
  21. package/components/form/demo/api.min.js +661 -1101
  22. package/components/form/demo/index.min.js +661 -1101
  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 +164 -274
  32. package/components/select/demo/index.min.js +164 -274
  33. package/components/select/dist/index.js +164 -274
  34. package/components/select/dist/registered.js +164 -274
  35. package/package.json +2 -2
@@ -3228,19 +3228,11 @@ class AuroFloatingUI {
3228
3228
  * This ensures that the bib content has the same dimensions as the sizer element.
3229
3229
  */
3230
3230
  mirrorSize() {
3231
- const element = this.element;
3232
- if (!element) {
3233
- return;
3234
- }
3235
-
3236
3231
  // mirror the boxsize from bibSizer
3237
- if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
3238
- const sizerStyle = window.getComputedStyle(element.bibSizer);
3239
- const bibContent = element.bib.shadowRoot.querySelector(".container");
3240
- if (!bibContent) {
3241
- return;
3242
- }
3243
-
3232
+ if (this.element.bibSizer && this.element.matchWidth) {
3233
+ const sizerStyle = window.getComputedStyle(this.element.bibSizer);
3234
+ const bibContent =
3235
+ this.element.bib.shadowRoot.querySelector(".container");
3244
3236
  if (sizerStyle.width !== "0px") {
3245
3237
  bibContent.style.width = sizerStyle.width;
3246
3238
  }
@@ -3262,14 +3254,9 @@ class AuroFloatingUI {
3262
3254
  * @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
3263
3255
  */
3264
3256
  getPositioningStrategy() {
3265
- const element = this.element;
3266
- if (!element) {
3267
- return this.behavior || "floating";
3268
- }
3269
-
3270
3257
  const breakpoint =
3271
- element.bib?.mobileFullscreenBreakpoint ||
3272
- element.floaterConfig?.fullscreenBreakpoint;
3258
+ this.element.bib.mobileFullscreenBreakpoint ||
3259
+ this.element.floaterConfig?.fullscreenBreakpoint;
3273
3260
  switch (this.behavior) {
3274
3261
  case "tooltip":
3275
3262
  return "floating";
@@ -3280,9 +3267,9 @@ class AuroFloatingUI {
3280
3267
  `(max-width: ${breakpoint})`,
3281
3268
  ).matches;
3282
3269
 
3283
- element.expanded = smallerThanBreakpoint;
3270
+ this.element.expanded = smallerThanBreakpoint;
3284
3271
  }
3285
- if (element.nested) {
3272
+ if (this.element.nested) {
3286
3273
  return "cover";
3287
3274
  }
3288
3275
  return "fullscreen";
@@ -3312,65 +3299,42 @@ class AuroFloatingUI {
3312
3299
  * and applies the calculated position to the bib's style.
3313
3300
  */
3314
3301
  position() {
3315
- const element = this.element;
3316
- if (!element) {
3317
- return;
3318
- }
3319
-
3320
3302
  const strategy = this.getPositioningStrategy();
3321
3303
  this.configureBibStrategy(strategy);
3322
3304
 
3323
3305
  if (strategy === "floating") {
3324
- if (!element.trigger || !element.bib) {
3325
- return;
3326
- }
3327
-
3328
3306
  this.mirrorSize();
3329
3307
  // Define the middlware for the floater configuration
3330
3308
  const middleware = [
3331
- offset(element.floaterConfig?.offset || 0),
3332
- ...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3333
- ...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3334
- ...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3309
+ offset(this.element.floaterConfig?.offset || 0),
3310
+ ...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3311
+ ...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3312
+ ...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3335
3313
  ];
3336
3314
 
3337
3315
  // Compute the position of the bib
3338
- computePosition(element.trigger, element.bib, {
3339
- strategy: element.floaterConfig?.strategy || "fixed",
3340
- placement: element.floaterConfig?.placement,
3316
+ computePosition(this.element.trigger, this.element.bib, {
3317
+ strategy: this.element.floaterConfig?.strategy || "fixed",
3318
+ placement: this.element.floaterConfig?.placement,
3341
3319
  middleware: middleware || [],
3342
3320
  }).then(({ x, y }) => {
3343
3321
  // eslint-disable-line id-length
3344
- const currentElement = this.element;
3345
- if (!currentElement?.bib) {
3346
- return;
3347
- }
3348
-
3349
- Object.assign(currentElement.bib.style, {
3322
+ Object.assign(this.element.bib.style, {
3350
3323
  left: `${x}px`,
3351
3324
  top: `${y}px`,
3352
3325
  });
3353
3326
  });
3354
3327
  } else if (strategy === "cover") {
3355
- if (!element.parentNode || !element.bib) {
3356
- return;
3357
- }
3358
-
3359
3328
  // Compute the position of the bib
3360
- computePosition(element.parentNode, element.bib, {
3329
+ computePosition(this.element.parentNode, this.element.bib, {
3361
3330
  placement: "bottom-start",
3362
3331
  }).then(({ x, y }) => {
3363
3332
  // eslint-disable-line id-length
3364
- const currentElement = this.element;
3365
- if (!currentElement?.bib || !currentElement.parentNode) {
3366
- return;
3367
- }
3368
-
3369
- Object.assign(currentElement.bib.style, {
3333
+ Object.assign(this.element.bib.style, {
3370
3334
  left: `${x}px`,
3371
- top: `${y - currentElement.parentNode.offsetHeight}px`,
3372
- width: `${currentElement.parentNode.offsetWidth}px`,
3373
- height: `${currentElement.parentNode.offsetHeight}px`,
3335
+ top: `${y - this.element.parentNode.offsetHeight}px`,
3336
+ width: `${this.element.parentNode.offsetWidth}px`,
3337
+ height: `${this.element.parentNode.offsetHeight}px`,
3374
3338
  });
3375
3339
  });
3376
3340
  }
@@ -3382,17 +3346,11 @@ class AuroFloatingUI {
3382
3346
  * @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
3383
3347
  */
3384
3348
  lockScroll(lock = true) {
3385
- const element = this.element;
3386
-
3387
3349
  if (lock) {
3388
- if (!element?.bib) {
3389
- return;
3390
- }
3391
-
3392
3350
  document.body.style.overflow = "hidden"; // hide body's scrollbar
3393
3351
 
3394
3352
  // Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
3395
- element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3353
+ this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3396
3354
  } else {
3397
3355
  document.body.style.overflow = "";
3398
3356
  }
@@ -3408,24 +3366,20 @@ class AuroFloatingUI {
3408
3366
  * @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
3409
3367
  */
3410
3368
  configureBibStrategy(value) {
3411
- const element = this.element;
3412
- if (!element?.bib) {
3413
- return;
3414
- }
3415
-
3416
3369
  if (value === "fullscreen") {
3417
- element.isBibFullscreen = true;
3370
+ this.element.isBibFullscreen = true;
3418
3371
  // reset the prev position
3419
- element.bib.setAttribute("isfullscreen", "");
3420
- element.bib.style.position = "fixed";
3421
- element.bib.style.top = "0px";
3422
- element.bib.style.left = "0px";
3423
- element.bib.style.width = "";
3424
- element.bib.style.height = "";
3425
- element.style.contain = "";
3372
+ this.element.bib.setAttribute("isfullscreen", "");
3373
+ this.element.bib.style.position = "fixed";
3374
+ this.element.bib.style.top = "0px";
3375
+ this.element.bib.style.left = "0px";
3376
+ this.element.bib.style.width = "";
3377
+ this.element.bib.style.height = "";
3378
+ this.element.style.contain = "";
3426
3379
 
3427
3380
  // reset the size that was mirroring `size` css-part
3428
- const bibContent = element.bib.shadowRoot?.querySelector(".container");
3381
+ const bibContent =
3382
+ this.element.bib.shadowRoot.querySelector(".container");
3429
3383
  if (bibContent) {
3430
3384
  bibContent.style.width = "";
3431
3385
  bibContent.style.height = "";
@@ -3440,14 +3394,14 @@ class AuroFloatingUI {
3440
3394
  }, 0);
3441
3395
  }
3442
3396
 
3443
- if (element.isPopoverVisible) {
3397
+ if (this.element.isPopoverVisible) {
3444
3398
  this.lockScroll(true);
3445
3399
  }
3446
3400
  } else {
3447
- element.bib.style.position = "";
3448
- element.bib.removeAttribute("isfullscreen");
3449
- element.isBibFullscreen = false;
3450
- element.style.contain = "layout";
3401
+ this.element.bib.style.position = "";
3402
+ this.element.bib.removeAttribute("isfullscreen");
3403
+ this.element.isBibFullscreen = false;
3404
+ this.element.style.contain = "layout";
3451
3405
  }
3452
3406
 
3453
3407
  const isChanged = this.strategy && this.strategy !== value;
@@ -3465,21 +3419,16 @@ class AuroFloatingUI {
3465
3419
  },
3466
3420
  );
3467
3421
 
3468
- element.dispatchEvent(event);
3422
+ this.element.dispatchEvent(event);
3469
3423
  }
3470
3424
  }
3471
3425
 
3472
3426
  updateState() {
3473
- const element = this.element;
3474
- if (!element) {
3475
- return;
3476
- }
3477
-
3478
- const isVisible = element.isPopoverVisible;
3427
+ const isVisible = this.element.isPopoverVisible;
3479
3428
  if (!isVisible) {
3480
3429
  this.cleanupHideHandlers();
3481
3430
  try {
3482
- element.cleanup?.();
3431
+ this.element.cleanup?.();
3483
3432
  } catch (error) {
3484
3433
  // Do nothing
3485
3434
  }
@@ -3495,30 +3444,28 @@ class AuroFloatingUI {
3495
3444
  * If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
3496
3445
  */
3497
3446
  handleFocusLoss() {
3498
- const element = this.element;
3499
- if (!element?.bib) {
3500
- return;
3501
- }
3502
-
3503
3447
  // if mouse is being pressed, skip and let click event to handle the action
3504
3448
  if (AuroFloatingUI.isMousePressed) {
3505
3449
  return;
3506
3450
  }
3507
3451
 
3508
3452
  if (
3509
- element.noHideOnThisFocusLoss ||
3510
- element.hasAttribute("noHideOnThisFocusLoss")
3453
+ this.element.noHideOnThisFocusLoss ||
3454
+ this.element.hasAttribute("noHideOnThisFocusLoss")
3511
3455
  ) {
3512
3456
  return;
3513
3457
  }
3514
3458
 
3515
3459
  // if focus is still inside of trigger or bib, do not close
3516
- if (element.matches(":focus") || element.matches(":focus-within")) {
3460
+ if (
3461
+ this.element.matches(":focus") ||
3462
+ this.element.matches(":focus-within")
3463
+ ) {
3517
3464
  return;
3518
3465
  }
3519
3466
 
3520
3467
  // if fullscreen bib is in fullscreen mode, do not close
3521
- if (element.bib.hasAttribute("isfullscreen")) {
3468
+ if (this.element.bib.hasAttribute("isfullscreen")) {
3522
3469
  return;
3523
3470
  }
3524
3471
 
@@ -3526,32 +3473,23 @@ class AuroFloatingUI {
3526
3473
  }
3527
3474
 
3528
3475
  setupHideHandlers() {
3529
- if (!this.element) {
3530
- return;
3531
- }
3532
-
3533
3476
  // Define handlers & store references
3534
3477
  this.focusHandler = () => this.handleFocusLoss();
3535
3478
 
3536
3479
  this.clickHandler = (evt) => {
3537
- const element = this.element;
3538
- if (!element?.bib) {
3539
- return;
3540
- }
3541
-
3542
3480
  // When the bib is fullscreen (modal dialog), don't close on outside
3543
3481
  // clicks. VoiceOver's synthetic click events inside a top-layer modal
3544
3482
  // <dialog> may not include the bib in composedPath(), causing false
3545
3483
  // positives. This mirrors the fullscreen guard in handleFocusLoss().
3546
- if (element.bib.hasAttribute("isfullscreen")) {
3484
+ if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
3547
3485
  return;
3548
3486
  }
3549
3487
 
3550
3488
  if (
3551
- (!evt.composedPath().includes(element.trigger) &&
3552
- !evt.composedPath().includes(element.bib)) ||
3553
- (element.bib.backdrop &&
3554
- evt.composedPath().includes(element.bib.backdrop))
3489
+ (!evt.composedPath().includes(this.element.trigger) &&
3490
+ !evt.composedPath().includes(this.element.bib)) ||
3491
+ (this.element.bib.backdrop &&
3492
+ evt.composedPath().includes(this.element.bib.backdrop))
3555
3493
  ) {
3556
3494
  const existedVisibleFloatingUI =
3557
3495
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3572,12 +3510,7 @@ class AuroFloatingUI {
3572
3510
 
3573
3511
  // ESC key handler
3574
3512
  this.keyDownHandler = (evt) => {
3575
- const element = this.element;
3576
- if (!element) {
3577
- return;
3578
- }
3579
-
3580
- if (evt.key === "Escape" && element.isPopoverVisible) {
3513
+ if (evt.key === "Escape" && this.element.isPopoverVisible) {
3581
3514
  const existedVisibleFloatingUI =
3582
3515
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
3583
3516
  if (
@@ -3634,10 +3567,6 @@ class AuroFloatingUI {
3634
3567
  }
3635
3568
 
3636
3569
  updateCurrentExpandedDropdown() {
3637
- if (!this.element) {
3638
- return;
3639
- }
3640
-
3641
3570
  // Close any other dropdown that is already open
3642
3571
  const existedVisibleFloatingUI =
3643
3572
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3654,34 +3583,25 @@ class AuroFloatingUI {
3654
3583
  }
3655
3584
 
3656
3585
  showBib() {
3657
- const element = this.element;
3658
- if (!element) {
3659
- return;
3660
- }
3661
-
3662
- if (!element.disabled && !this.showing) {
3586
+ if (!this.element.disabled && !this.showing) {
3663
3587
  this.updateCurrentExpandedDropdown();
3664
- element.triggerChevron?.setAttribute("data-expanded", true);
3588
+ this.element.triggerChevron?.setAttribute("data-expanded", true);
3665
3589
 
3666
3590
  // prevent double showing: isPopovervisible gets first and showBib gets called later
3667
3591
  if (!this.showing) {
3668
- if (!element.modal) {
3592
+ if (!this.element.modal) {
3669
3593
  this.setupHideHandlers();
3670
3594
  }
3671
3595
  this.showing = true;
3672
- element.isPopoverVisible = true;
3596
+ this.element.isPopoverVisible = true;
3673
3597
  this.position();
3674
3598
  this.dispatchEventDropdownToggle();
3675
3599
  }
3676
3600
 
3677
- if (!element.bib || (!element.trigger && !element.parentNode)) {
3678
- return;
3679
- }
3680
-
3681
3601
  // Setup auto update to handle resize and scroll
3682
- element.cleanup = autoUpdate(
3683
- element.trigger || element.parentNode,
3684
- element.bib,
3602
+ this.element.cleanup = autoUpdate(
3603
+ this.element.trigger || this.element.parentNode,
3604
+ this.element.bib,
3685
3605
  () => {
3686
3606
  this.position();
3687
3607
  },
@@ -3694,27 +3614,22 @@ class AuroFloatingUI {
3694
3614
  * @param {String} eventType - The event type that triggered the hiding action.
3695
3615
  */
3696
3616
  hideBib(eventType = "unknown") {
3697
- const element = this.element;
3698
- if (!element) {
3699
- return;
3700
- }
3701
-
3702
- if (element.disabled) {
3617
+ if (this.element.disabled) {
3703
3618
  return;
3704
3619
  }
3705
3620
 
3706
3621
  // noToggle dropdowns should not close when the trigger is clicked (the
3707
3622
  // "toggle" behavior), but they CAN still close via other interactions like
3708
3623
  // Escape key or focus loss.
3709
- if (element.noToggle && eventType === "click") {
3624
+ if (this.element.noToggle && eventType === "click") {
3710
3625
  return;
3711
3626
  }
3712
3627
 
3713
3628
  this.lockScroll(false);
3714
- element.triggerChevron?.removeAttribute("data-expanded");
3629
+ this.element.triggerChevron?.removeAttribute("data-expanded");
3715
3630
 
3716
- if (element.isPopoverVisible) {
3717
- element.isPopoverVisible = false;
3631
+ if (this.element.isPopoverVisible) {
3632
+ this.element.isPopoverVisible = false;
3718
3633
  }
3719
3634
  if (this.showing) {
3720
3635
  this.cleanupHideHandlers();
@@ -3734,11 +3649,6 @@ class AuroFloatingUI {
3734
3649
  * @param {String} eventType - The event type that triggered the toggle action.
3735
3650
  */
3736
3651
  dispatchEventDropdownToggle(eventType) {
3737
- const element = this.element;
3738
- if (!element) {
3739
- return;
3740
- }
3741
-
3742
3652
  const event = new CustomEvent(
3743
3653
  this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
3744
3654
  {
@@ -3750,16 +3660,11 @@ class AuroFloatingUI {
3750
3660
  },
3751
3661
  );
3752
3662
 
3753
- element.dispatchEvent(event);
3663
+ this.element.dispatchEvent(event);
3754
3664
  }
3755
3665
 
3756
3666
  handleClick() {
3757
- const element = this.element;
3758
- if (!element) {
3759
- return;
3760
- }
3761
-
3762
- if (element.isPopoverVisible) {
3667
+ if (this.element.isPopoverVisible) {
3763
3668
  this.hideBib("click");
3764
3669
  } else {
3765
3670
  this.showBib();
@@ -3770,66 +3675,63 @@ class AuroFloatingUI {
3770
3675
  {
3771
3676
  composed: true,
3772
3677
  detail: {
3773
- expanded: element.isPopoverVisible,
3678
+ expanded: this.element.isPopoverVisible,
3774
3679
  },
3775
3680
  },
3776
3681
  );
3777
3682
 
3778
- element.dispatchEvent(event);
3683
+ this.element.dispatchEvent(event);
3779
3684
  }
3780
3685
 
3781
3686
  handleEvent(event) {
3782
- const element = this.element;
3783
- if (!element || element.disableEventShow) {
3784
- return;
3785
- }
3786
-
3787
- switch (event.type) {
3788
- case "keydown": {
3789
- // Support both Enter and Space keys for accessibility
3790
- // Space is included as it's expected behavior for interactive elements
3791
-
3792
- const origin = event.composedPath()[0];
3793
- if (
3794
- event.key === "Enter" ||
3795
- (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3796
- ) {
3797
- event.preventDefault();
3798
- this.handleClick();
3687
+ if (!this.element.disableEventShow) {
3688
+ switch (event.type) {
3689
+ case "keydown": {
3690
+ // Support both Enter and Space keys for accessibility
3691
+ // Space is included as it's expected behavior for interactive elements
3692
+
3693
+ const origin = event.composedPath()[0];
3694
+ if (
3695
+ event.key === "Enter" ||
3696
+ (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3697
+ ) {
3698
+ event.preventDefault();
3699
+ this.handleClick();
3700
+ }
3701
+ break;
3799
3702
  }
3800
- break;
3703
+ case "mouseenter":
3704
+ if (this.element.hoverToggle) {
3705
+ this.showBib();
3706
+ }
3707
+ break;
3708
+ case "mouseleave":
3709
+ if (this.element.hoverToggle) {
3710
+ this.hideBib("mouseleave");
3711
+ }
3712
+ break;
3713
+ case "focus":
3714
+ if (this.element.focusShow) {
3715
+ /*
3716
+ This needs to better handle clicking that gives focus -
3717
+ currently it shows and then immediately hides the bib
3718
+ */
3719
+ this.showBib();
3720
+ }
3721
+ break;
3722
+ case "blur":
3723
+ // send this task 100ms later queue to
3724
+ // wait a frame in case focus moves within the floating element/bib
3725
+ setTimeout(() => this.handleFocusLoss(), 0);
3726
+ break;
3727
+ case "click":
3728
+ if (document.activeElement === document.body) {
3729
+ event.currentTarget.focus();
3730
+ }
3731
+ this.handleClick();
3732
+ break;
3733
+ // Do nothing
3801
3734
  }
3802
- case "mouseenter":
3803
- if (element.hoverToggle) {
3804
- this.showBib();
3805
- }
3806
- break;
3807
- case "mouseleave":
3808
- if (element.hoverToggle) {
3809
- this.hideBib("mouseleave");
3810
- }
3811
- break;
3812
- case "focus":
3813
- if (element.focusShow) {
3814
- /*
3815
- This needs to better handle clicking that gives focus -
3816
- currently it shows and then immediately hides the bib
3817
- */
3818
- this.showBib();
3819
- }
3820
- break;
3821
- case "blur":
3822
- // send this task 100ms later queue to
3823
- // wait a frame in case focus moves within the floating element/bib
3824
- setTimeout(() => this.handleFocusLoss(), 0);
3825
- break;
3826
- case "click":
3827
- if (document.activeElement === document.body) {
3828
- event.currentTarget.focus();
3829
- }
3830
- this.handleClick();
3831
- break;
3832
- // Do nothing
3833
3735
  }
3834
3736
  }
3835
3737
 
@@ -3840,11 +3742,6 @@ class AuroFloatingUI {
3840
3742
  * This prevents the component itself from being focusable when the trigger element already handles focus.
3841
3743
  */
3842
3744
  handleTriggerTabIndex() {
3843
- const element = this.element;
3844
- if (!element) {
3845
- return;
3846
- }
3847
-
3848
3745
  const focusableElementSelectors = [
3849
3746
  "a",
3850
3747
  "button",
@@ -3857,7 +3754,7 @@ class AuroFloatingUI {
3857
3754
  "auro-hyperlink",
3858
3755
  ];
3859
3756
 
3860
- const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
3757
+ const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
3861
3758
  if (!triggerNode) {
3862
3759
  return;
3863
3760
  }
@@ -3866,13 +3763,13 @@ class AuroFloatingUI {
3866
3763
  focusableElementSelectors.forEach((selector) => {
3867
3764
  // Check if the trigger node element is focusable
3868
3765
  if (triggerNodeTagName === selector) {
3869
- element.tabIndex = -1;
3766
+ this.element.tabIndex = -1;
3870
3767
  return;
3871
3768
  }
3872
3769
 
3873
3770
  // Check if any child is focusable
3874
3771
  if (triggerNode.querySelector(selector)) {
3875
- element.tabIndex = -1;
3772
+ this.element.tabIndex = -1;
3876
3773
  }
3877
3774
  });
3878
3775
  }
@@ -3882,18 +3779,13 @@ class AuroFloatingUI {
3882
3779
  * @param {*} eventPrefix
3883
3780
  */
3884
3781
  regenerateBibId() {
3885
- const element = this.element;
3886
- if (!element) {
3887
- return;
3888
- }
3889
-
3890
- this.id = element.getAttribute("id");
3782
+ this.id = this.element.getAttribute("id");
3891
3783
  if (!this.id) {
3892
3784
  this.id = window.crypto.randomUUID();
3893
- element.setAttribute("id", this.id);
3785
+ this.element.setAttribute("id", this.id);
3894
3786
  }
3895
3787
 
3896
- element.bib?.setAttribute("id", `${this.id}-floater-bib`);
3788
+ this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
3897
3789
  }
3898
3790
 
3899
3791
  configure(elem, eventPrefix, enableKeyboardHandling = true) {
@@ -3905,69 +3797,67 @@ class AuroFloatingUI {
3905
3797
  this.element = elem;
3906
3798
  }
3907
3799
 
3908
- const element = this.element;
3909
- if (!element) {
3910
- return;
3800
+ if (this.behavior !== this.element.behavior) {
3801
+ this.behavior = this.element.behavior;
3911
3802
  }
3912
3803
 
3913
- if (this.behavior !== element.behavior) {
3914
- this.behavior = element.behavior;
3915
- }
3916
-
3917
- if (element.trigger) {
3804
+ if (this.element.trigger) {
3918
3805
  this.disconnect();
3919
3806
  }
3920
- element.trigger =
3921
- element.triggerElement ||
3922
- element.shadowRoot?.querySelector("#trigger") ||
3923
- element.trigger;
3924
- element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
3925
- element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
3926
- element.triggerChevron =
3927
- element.shadowRoot?.querySelector("#showStateIcon");
3807
+ this.element.trigger =
3808
+ this.element.triggerElement ||
3809
+ this.element.shadowRoot.querySelector("#trigger") ||
3810
+ this.element.trigger;
3811
+ this.element.bib =
3812
+ this.element.shadowRoot.querySelector("#bib") || this.element.bib;
3813
+ this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
3814
+ this.element.triggerChevron =
3815
+ this.element.shadowRoot.querySelector("#showStateIcon");
3928
3816
 
3929
- if (element.floaterConfig) {
3930
- element.hoverToggle = element.floaterConfig.hoverToggle;
3817
+ if (this.element.floaterConfig) {
3818
+ this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
3931
3819
  }
3932
3820
 
3933
3821
  this.regenerateBibId();
3934
3822
  this.handleTriggerTabIndex();
3935
3823
 
3936
3824
  this.handleEvent = this.handleEvent.bind(this);
3937
- if (element.trigger) {
3825
+ if (this.element.trigger) {
3938
3826
  if (this.enableKeyboardHandling) {
3939
- element.trigger.addEventListener("keydown", this.handleEvent);
3827
+ this.element.trigger.addEventListener("keydown", this.handleEvent);
3940
3828
  }
3941
- element.trigger.addEventListener("click", this.handleEvent);
3942
- element.trigger.addEventListener("mouseenter", this.handleEvent);
3943
- element.trigger.addEventListener("mouseleave", this.handleEvent);
3944
- element.trigger.addEventListener("focus", this.handleEvent);
3945
- element.trigger.addEventListener("blur", this.handleEvent);
3829
+ this.element.trigger.addEventListener("click", this.handleEvent);
3830
+ this.element.trigger.addEventListener("mouseenter", this.handleEvent);
3831
+ this.element.trigger.addEventListener("mouseleave", this.handleEvent);
3832
+ this.element.trigger.addEventListener("focus", this.handleEvent);
3833
+ this.element.trigger.addEventListener("blur", this.handleEvent);
3946
3834
  }
3947
3835
  }
3948
3836
 
3949
3837
  disconnect() {
3950
3838
  this.cleanupHideHandlers();
3839
+ if (this.element) {
3840
+ this.element.cleanup?.();
3951
3841
 
3952
- const element = this.element;
3953
- if (!element) {
3954
- return;
3955
- }
3956
-
3957
- element.cleanup?.();
3958
-
3959
- if (element.bib && element.shadowRoot) {
3960
- element.shadowRoot.append(element.bib);
3961
- }
3842
+ if (this.element.bib) {
3843
+ this.element.shadowRoot.append(this.element.bib);
3844
+ }
3962
3845
 
3963
- // Remove event & keyboard listeners
3964
- if (element.trigger) {
3965
- element.trigger.removeEventListener("keydown", this.handleEvent);
3966
- element.trigger.removeEventListener("click", this.handleEvent);
3967
- element.trigger.removeEventListener("mouseenter", this.handleEvent);
3968
- element.trigger.removeEventListener("mouseleave", this.handleEvent);
3969
- element.trigger.removeEventListener("focus", this.handleEvent);
3970
- element.trigger.removeEventListener("blur", this.handleEvent);
3846
+ // Remove event & keyboard listeners
3847
+ if (this.element?.trigger) {
3848
+ this.element.trigger.removeEventListener("keydown", this.handleEvent);
3849
+ this.element.trigger.removeEventListener("click", this.handleEvent);
3850
+ this.element.trigger.removeEventListener(
3851
+ "mouseenter",
3852
+ this.handleEvent,
3853
+ );
3854
+ this.element.trigger.removeEventListener(
3855
+ "mouseleave",
3856
+ this.handleEvent,
3857
+ );
3858
+ this.element.trigger.removeEventListener("focus", this.handleEvent);
3859
+ this.element.trigger.removeEventListener("blur", this.handleEvent);
3860
+ }
3971
3861
  }
3972
3862
  }
3973
3863
  }
@@ -5095,7 +4985,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
5095
4985
  }
5096
4986
  };
5097
4987
 
5098
- var formkitVersion$1 = '202604070549';
4988
+ var formkitVersion$1 = '202604071525';
5099
4989
 
5100
4990
  class AuroElement extends LitElement {
5101
4991
  static get properties() {
@@ -6848,7 +6738,7 @@ class AuroHelpText extends LitElement {
6848
6738
  }
6849
6739
  }
6850
6740
 
6851
- var formkitVersion = '202604070549';
6741
+ var formkitVersion = '202604071525';
6852
6742
 
6853
6743
  var styleCss = css`.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}`;
6854
6744