@aurodesignsystem/auro-library 5.2.2 → 5.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ # [5.3.0](https://github.com/AlaskaAirlines/auro-library/compare/v5.2.3...v5.3.0) (2025-07-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * add event type to auroDropdown-toggled for keyboard detection ([d7ec5b7](https://github.com/AlaskaAirlines/auro-library/commit/d7ec5b755cee75d0371bf3202d5a382ce20cd47c))
9
+
10
+ ## [5.2.3](https://github.com/AlaskaAirlines/auro-library/compare/v5.2.2...v5.2.3) (2025-07-02)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * check for matchWidth before forcing dropdown width ([706f7ee](https://github.com/AlaskaAirlines/auro-library/commit/706f7eefe15d2ab5f5e208a14fe6e337d5b4e1c5))
16
+
3
17
  ## [5.2.2](https://github.com/AlaskaAirlines/auro-library/compare/v5.2.1...v5.2.2) (2025-06-27)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "description": "This repository holds shared scripts, utilities, and workflows utilized across repositories along the Auro Design System.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -95,7 +95,7 @@ export default class AuroFloatingUI {
95
95
  */
96
96
  mirrorSize() {
97
97
  // mirror the boxsize from bibSizer
98
- if (this.element.bibSizer) {
98
+ if (this.element.bibSizer && this.element.matchWidth) {
99
99
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
100
100
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
101
101
  if (sizerStyle.width !== '0px') {
@@ -307,13 +307,13 @@ export default class AuroFloatingUI {
307
307
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
308
308
  return;
309
309
  }
310
-
310
+
311
311
  // if fullscreen bib is in fullscreen mode, do not close
312
312
  if (this.element.bib.hasAttribute('isfullscreen')) {
313
313
  return;
314
314
  }
315
315
 
316
- this.hideBib();
316
+ this.hideBib("keydown");
317
317
  }
318
318
 
319
319
  setupHideHandlers() {
@@ -338,7 +338,7 @@ export default class AuroFloatingUI {
338
338
  document.expandedAuroFormkitDropdown = null;
339
339
  document.expandedAuroFloater = this;
340
340
  } else {
341
- this.hideBib();
341
+ this.hideBib("click");
342
342
  }
343
343
  }
344
344
  };
@@ -351,7 +351,7 @@ export default class AuroFloatingUI {
351
351
  // if something else is open, let it handle itself
352
352
  return;
353
353
  }
354
- this.hideBib();
354
+ this.hideBib("keydown");
355
355
  }
356
356
  };
357
357
 
@@ -434,7 +434,11 @@ export default class AuroFloatingUI {
434
434
  }
435
435
  }
436
436
 
437
- hideBib() {
437
+ /**
438
+ * Hides the floating UI element.
439
+ * @param {String} eventType - The event type that triggered the hiding action.
440
+ */
441
+ hideBib(eventType = "unknown") {
438
442
  if (!this.element.disabled && !this.element.noToggle) {
439
443
  this.lockScroll(false);
440
444
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -445,7 +449,7 @@ export default class AuroFloatingUI {
445
449
  if (this.showing) {
446
450
  this.cleanupHideHandlers();
447
451
  this.showing = false;
448
- this.dispatchEventDropdownToggle();
452
+ this.dispatchEventDropdownToggle(eventType);
449
453
  }
450
454
  }
451
455
  document.expandedAuroFloater = null;
@@ -454,11 +458,13 @@ export default class AuroFloatingUI {
454
458
  /**
455
459
  * @private
456
460
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
461
+ * @param {String} eventType - The event type that triggered the toggle action.
457
462
  */
458
- dispatchEventDropdownToggle() {
463
+ dispatchEventDropdownToggle(eventType) {
459
464
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
460
465
  detail: {
461
466
  expanded: this.showing,
467
+ eventType: eventType || "unknown",
462
468
  },
463
469
  composed: true
464
470
  });
@@ -468,7 +474,7 @@ export default class AuroFloatingUI {
468
474
 
469
475
  handleClick() {
470
476
  if (this.element.isPopoverVisible) {
471
- this.hideBib();
477
+ this.hideBib("click");
472
478
  } else {
473
479
  this.showBib();
474
480
  }
@@ -495,7 +501,7 @@ export default class AuroFloatingUI {
495
501
 
496
502
  event.preventDefault();
497
503
  this.handleClick();
498
- }
504
+ }
499
505
  break;
500
506
  case 'mouseenter':
501
507
  if (this.element.hoverToggle) {
@@ -504,7 +510,7 @@ export default class AuroFloatingUI {
504
510
  break;
505
511
  case 'mouseleave':
506
512
  if (this.element.hoverToggle) {
507
- this.hideBib();
513
+ this.hideBib("mouseleave");
508
514
  }
509
515
  break;
510
516
  case 'focus':