@y14e/roving-tabindex 2.0.1 → 2.0.2

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/README.md CHANGED
@@ -41,11 +41,11 @@ const cleanup = createRovingTabIndex(container, options);
41
41
 
42
42
  ```ts
43
43
  interface RovingTabIndexOptions {
44
- direction?: 'horizontal' | 'vertical' | undefined; // default: both (undefined)
45
- navigationOnly?: boolean; // default: false
46
- selector?: string | undefined;
47
- typeahead?: boolean; // default: false
48
- wrap?: boolean; // default: false
44
+ direction?: 'horizontal' | 'vertical'; // default: both (undefined)
45
+ navigationOnly?: boolean; // default: false
46
+ selector?: string;
47
+ typeahead?: boolean; // default: false
48
+ wrap?: boolean; // default: false
49
49
  }
50
50
  ```
51
51
 
package/dist/index.cjs CHANGED
@@ -326,13 +326,14 @@ function createRovingTabIndex(container, options = {}) {
326
326
  console.warn("Invalid wrap option. Fallback: false.");
327
327
  wrap = false;
328
328
  }
329
- const roving = new RovingTabIndex(container, {
330
- direction,
331
- navigationOnly,
332
- selector,
333
- typeahead,
334
- wrap
335
- });
329
+ const settings = { navigationOnly, typeahead, wrap };
330
+ if (direction !== void 0) {
331
+ Object.assign(settings, { direction });
332
+ }
333
+ if (selector !== void 0) {
334
+ Object.assign(settings, { selector });
335
+ }
336
+ const roving = new RovingTabIndex(container, settings);
336
337
  return () => roving.destroy();
337
338
  }
338
339
  var RovingTabIndex = class {
@@ -521,7 +522,7 @@ function getActiveElement() {
521
522
  * Lightweight roving tabindex utility with fully focus management.
522
523
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
523
524
  *
524
- * @version 2.0.1
525
+ * @version 2.0.2
525
526
  * @author Yusuke Kamiyamane
526
527
  * @license MIT
527
528
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -546,7 +547,7 @@ power-focusable/dist/index.js:
546
547
  * High-precision focus management utility with full composed tree support.
547
548
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
548
549
  *
549
- * @version 4.3.0
550
+ * @version 4.3.1
550
551
  * @author Yusuke Kamiyamane
551
552
  * @license MIT
552
553
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,16 +3,16 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.1
6
+ * @version 2.0.2
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
10
10
  * @see {@link https://github.com/y14e/roving-tabindex}
11
11
  */
12
12
  interface RovingTabIndexOptions {
13
- readonly direction?: 'horizontal' | 'vertical' | undefined;
13
+ readonly direction?: 'horizontal' | 'vertical';
14
14
  readonly navigationOnly?: boolean;
15
- readonly selector?: string | undefined;
15
+ readonly selector?: string;
16
16
  readonly typeahead?: boolean;
17
17
  readonly wrap?: boolean;
18
18
  }
package/dist/index.d.ts CHANGED
@@ -3,16 +3,16 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.1
6
+ * @version 2.0.2
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
10
10
  * @see {@link https://github.com/y14e/roving-tabindex}
11
11
  */
12
12
  interface RovingTabIndexOptions {
13
- readonly direction?: 'horizontal' | 'vertical' | undefined;
13
+ readonly direction?: 'horizontal' | 'vertical';
14
14
  readonly navigationOnly?: boolean;
15
- readonly selector?: string | undefined;
15
+ readonly selector?: string;
16
16
  readonly typeahead?: boolean;
17
17
  readonly wrap?: boolean;
18
18
  }
package/dist/index.js CHANGED
@@ -324,13 +324,14 @@ function createRovingTabIndex(container, options = {}) {
324
324
  console.warn("Invalid wrap option. Fallback: false.");
325
325
  wrap = false;
326
326
  }
327
- const roving = new RovingTabIndex(container, {
328
- direction,
329
- navigationOnly,
330
- selector,
331
- typeahead,
332
- wrap
333
- });
327
+ const settings = { navigationOnly, typeahead, wrap };
328
+ if (direction !== void 0) {
329
+ Object.assign(settings, { direction });
330
+ }
331
+ if (selector !== void 0) {
332
+ Object.assign(settings, { selector });
333
+ }
334
+ const roving = new RovingTabIndex(container, settings);
334
335
  return () => roving.destroy();
335
336
  }
336
337
  var RovingTabIndex = class {
@@ -519,7 +520,7 @@ function getActiveElement() {
519
520
  * Lightweight roving tabindex utility with fully focus management.
520
521
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
521
522
  *
522
- * @version 2.0.1
523
+ * @version 2.0.2
523
524
  * @author Yusuke Kamiyamane
524
525
  * @license MIT
525
526
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -544,7 +545,7 @@ power-focusable/dist/index.js:
544
545
  * High-precision focus management utility with full composed tree support.
545
546
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
546
547
  *
547
- * @version 4.3.0
548
+ * @version 4.3.1
548
549
  * @author Yusuke Kamiyamane
549
550
  * @license MIT
550
551
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/roving-tabindex",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@y14e/attributes-utils": "^1.0.5",
52
52
  "bun-types": "latest",
53
- "power-focusable": "^4.3.0",
53
+ "power-focusable": "^4.3.1",
54
54
  "tsup": "^8.0.0",
55
55
  "typescript": "^5.6.0"
56
56
  },