@aurodesignsystem/auro-library 5.1.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ ## [5.2.1](https://github.com/AlaskaAirlines/auro-library/compare/v5.2.0...v5.2.1) (2025-06-26)
4
+
5
+
6
+ ### Performance Improvements
7
+
8
+ * add deep nested focusable elements support in focustrap ([68b0262](https://github.com/AlaskaAirlines/auro-library/commit/68b0262157f0a2cad24d603e67c59e2b2ea0f76f))
9
+
10
+ # [5.2.0](https://github.com/AlaskaAirlines/auro-library/compare/v5.1.0...v5.2.0) (2025-06-24)
11
+
12
+
13
+ ### Features
14
+
15
+ * add support for component tag name attributes when detecting focusable components ([3a10af3](https://github.com/AlaskaAirlines/auro-library/commit/3a10af334c24bdc52404e7ecf85effb2a1afd574))
16
+
3
17
  # [5.1.0](https://github.com/AlaskaAirlines/auro-library/compare/v5.0.2...v5.1.0) (2025-06-18)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "5.1.0",
3
+ "version": "5.2.1",
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",
@@ -58,10 +58,12 @@ export class FocusTrap {
58
58
  // Get the active element(s) in the document and shadow root
59
59
  // This will include the active element in the shadow DOM if it exists
60
60
  // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
61
- const actives = [
62
- document.activeElement,
63
- ...document.activeElement.shadowRoot && [document.activeElement.shadowRoot.activeElement] || []
64
- ]
61
+ let activeElement = document.activeElement;
62
+ const actives = [activeElement];
63
+ while (activeElement?.shadowRoot?.activeElement) {
64
+ actives.push(activeElement.shadowRoot.activeElement);
65
+ activeElement = activeElement.shadowRoot.activeElement;
66
+ }
65
67
 
66
68
  // Update the focusable elements
67
69
  const focusables = this._getFocusableElements();
@@ -127,4 +129,4 @@ export class FocusTrap {
127
129
 
128
130
  this.container.removeEventListener('keydown', this._onKeydown);
129
131
  }
130
- }
132
+ }
@@ -39,7 +39,7 @@ export function isFocusableComponent(element) {
39
39
  const componentName = element.tagName.toLowerCase();
40
40
 
41
41
  // Guard Clause: Element is a focusable component
42
- if (!FOCUSABLE_COMPONENTS.includes(componentName)) return false;
42
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
43
43
 
44
44
  // Guard Clause: Element is not disabled
45
45
  if (element.hasAttribute('disabled')) return false;