@y14e/tabs 2.0.1 → 2.0.3

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/dist/index.cjs CHANGED
@@ -1,580 +1,12 @@
1
1
  'use strict';
2
2
 
3
- // node_modules/@y14e/button/dist/index.js
4
- var Button = class {
5
- #element;
6
- #controller = null;
7
- #isDestroyed = false;
8
- constructor(element) {
9
- if (!(element instanceof HTMLElement)) {
10
- throw new TypeError("Invalid element");
11
- }
12
- if (element.hasAttribute("data-button-initialized")) {
13
- console.warn("Already initialized");
14
- return;
15
- }
16
- this.#element = element;
17
- this.#initialize();
18
- }
19
- destroy() {
20
- if (this.#isDestroyed) {
21
- return;
22
- }
23
- this.#isDestroyed = true;
24
- this.#controller?.abort();
25
- this.#controller = null;
26
- this.#element.removeAttribute("data-button-initialized");
27
- }
28
- #initialize() {
29
- this.#controller = new AbortController();
30
- this.#element.addEventListener("keydown", this.#onKeyDown, {
31
- signal: this.#controller.signal
32
- });
33
- this.#element.setAttribute("data-button-initialized", "");
34
- }
35
- #onKeyDown = (event) => {
36
- const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
37
- if (altKey || ctrlKey || metaKey || shiftKey) {
38
- return;
39
- }
40
- if (!["Enter", " "].includes(key)) {
41
- return;
42
- }
43
- const active = getActiveElement();
44
- if (!(active instanceof HTMLElement)) {
45
- return;
46
- }
47
- event.preventDefault();
48
- active.click();
49
- };
50
- };
51
- function getActiveElement() {
52
- let current = document.activeElement;
53
- while (current?.shadowRoot?.activeElement) {
54
- current = current.shadowRoot.activeElement;
55
- }
56
- return current;
57
- }
3
+ var attributesUtils = require('@y14e/attributes-utils');
4
+ var Button = require('@y14e/button');
5
+ var rovingTabindex = require('@y14e/roving-tabindex');
58
6
 
59
- // node_modules/@y14e/roving-tabindex/dist/index.js
60
- var DEFAULT_PARSER = (value) => value.split(/\s+/);
61
- var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
62
- function addTokenToAttribute(element, attribute, token, options = {}) {
63
- const {
64
- caseInsensitive = false,
65
- parse = DEFAULT_PARSER,
66
- serialize = DEFAULT_SERIALIZER
67
- } = options;
68
- const value = element.getAttribute(attribute)?.trim();
69
- const tokens = value ? parse(value).filter(Boolean) : [];
70
- if (caseInsensitive) {
71
- const lower = token.toLowerCase();
72
- if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
73
- tokens.push(token);
74
- element.setAttribute(attribute, serialize(tokens));
75
- }
76
- } else {
77
- const set = new Set(tokens);
78
- set.add(token);
79
- element.setAttribute(attribute, serialize([...set]));
80
- }
81
- }
82
- var snapshots = /* @__PURE__ */ new WeakMap();
83
- function restoreAttributes(elements) {
84
- for (const element of elements) {
85
- const snapshot = snapshots.get(element);
86
- if (!snapshot) {
87
- continue;
88
- }
89
- for (const [attribute, value] of snapshot.entries()) {
90
- value === null ? element.removeAttribute(attribute) : element.setAttribute(attribute, value);
91
- }
92
- snapshots.delete(element);
93
- }
94
- }
95
- function saveAttributes(elements, attributes) {
96
- elements.forEach((element) => {
97
- let snapshot = snapshots.get(element);
98
- if (!snapshot) {
99
- snapshot = /* @__PURE__ */ new Map();
100
- snapshots.set(element, snapshot);
101
- }
102
- attributes.forEach((attribute) => {
103
- snapshot.set(attribute, element.getAttribute(attribute));
104
- });
105
- });
106
- }
107
- var FOCUSABLE_SELECTOR = `:is(a[href], area[href], button, embed, iframe, input:not([type="hidden" i]), object, select, details > summary:first-of-type, textarea, [contenteditable]:not([contenteditable="false" i]), [controls], [tabindex]):not(:disabled, [hidden], [inert], [tabindex="-1"])`;
108
- function getFocusables(container = document.body, options = {}) {
109
- if (!(container instanceof Element)) {
110
- console.warn("Invalid container element. Fallback: <body> element.");
111
- container = document.body;
112
- }
113
- let {
114
- composed = false,
115
- filter,
116
- include,
117
- skipNegativeTabIndexCheck = false,
118
- skipVisibilityCheck = false
119
- } = options;
120
- if (typeof composed !== "boolean") {
121
- console.warn("Invalid composed option. Fallback: false.");
122
- composed = false;
123
- }
124
- if (typeof filter !== "undefined" && typeof filter !== "function") {
125
- console.warn(
126
- "Invalid filter function. Fallback: no filter function (undefined)."
127
- );
128
- filter = void 0;
129
- }
130
- if (typeof include !== "undefined" && typeof include !== "function") {
131
- console.warn(
132
- "Invalid include function. Fallback: no include function (undefined)."
133
- );
134
- include = void 0;
135
- }
136
- if (typeof skipNegativeTabIndexCheck !== "boolean") {
137
- console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
138
- skipNegativeTabIndexCheck = false;
139
- }
140
- if (typeof skipVisibilityCheck !== "boolean") {
141
- console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
142
- skipVisibilityCheck = false;
143
- }
144
- const elements = [];
145
- if (composed || include) {
146
- let traverse2 = function(node) {
147
- if (!(node instanceof Element)) {
148
- return;
149
- }
150
- if (isFocusable(node, { skipNegativeTabIndexCheck, skipVisibilityCheck }) || include?.(node)) {
151
- elements[elements.length] = node;
152
- }
153
- const children = getComposedChildren(node);
154
- for (let i = 0, l = children.length; i < l; i++) {
155
- const child = children[i];
156
- child && traverse2(child);
157
- }
158
- };
159
- traverse2(container);
160
- } else {
161
- const candidates = container.querySelectorAll(FOCUSABLE_SELECTOR);
162
- for (let i = 0, l = candidates.length; i < l; i++) {
163
- const candidate = candidates[i];
164
- if (candidate && isFocusable(candidate, {
165
- skipNegativeTabIndexCheck,
166
- skipVisibilityCheck
167
- })) {
168
- elements[elements.length] = candidate;
169
- }
170
- }
171
- }
172
- const unfiltered = normalizeRadioGroup(sortByTabIndex(elements));
173
- return filter ? unfiltered.filter(filter) : unfiltered;
174
- }
175
- function isFocusable(element, options = {}) {
176
- if (!(element instanceof Element)) {
177
- console.warn("Invalid element");
178
- return false;
179
- }
180
- let { skipNegativeTabIndexCheck = false, skipVisibilityCheck = false } = options;
181
- if (typeof skipNegativeTabIndexCheck !== "boolean") {
182
- console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
183
- skipNegativeTabIndexCheck = false;
184
- }
185
- if (typeof skipVisibilityCheck !== "boolean") {
186
- console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
187
- skipVisibilityCheck = false;
188
- }
189
- if (element.hasAttribute("hidden") || isInert(element)) {
190
- return false;
191
- }
192
- if (!skipNegativeTabIndexCheck && getTabIndex(element) < 0) {
193
- return false;
194
- }
195
- if (!element.matches(
196
- skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR.replace(/(,\s*)?\[tabindex="-1"\]/g, "") : FOCUSABLE_SELECTOR
197
- )) {
198
- return false;
199
- }
200
- if (isDisabledDeep(element)) {
201
- return false;
202
- }
203
- if (!skipVisibilityCheck && !element.checkVisibility({
204
- contentVisibilityAuto: true,
205
- opacityProperty: true,
206
- visibilityProperty: true
207
- })) {
208
- return false;
209
- }
210
- return true;
211
- }
212
- function isDisabledDeep(element) {
213
- let current = element;
214
- while (current) {
215
- if (current instanceof ShadowRoot) {
216
- if (current.mode !== "open") {
217
- return false;
218
- }
219
- current = current.host;
220
- continue;
221
- }
222
- if (!(current instanceof Element)) {
223
- current = current.parentNode;
224
- continue;
225
- }
226
- if (current === element && isFormControl(current) && isDisabled(current)) {
227
- return true;
228
- }
229
- if (isInert(current)) {
230
- return true;
231
- }
232
- if (isFormControl(element) && current.tagName === "FIELDSET" && isDisabled(current)) {
233
- if (!current.querySelector(":scope > legend:first-of-type")?.contains(element)) {
234
- return true;
235
- }
236
- }
237
- current = current.parentNode;
238
- }
239
- return false;
240
- }
241
- function normalizeRadioGroup(elements) {
242
- let map = null;
243
- for (let i = 0, l = elements.length; i < l; i++) {
244
- const element = elements[i];
245
- if (!(element instanceof HTMLInputElement)) {
246
- continue;
247
- }
248
- if (!isUngroupedRadio(element)) {
249
- continue;
250
- }
251
- if (!map) {
252
- map = /* @__PURE__ */ new Map();
253
- }
254
- const key = `${element.form?.id ?? "no-form"}::${element.name}`;
255
- const group = map.get(key) ?? map.set(key, []).get(key);
256
- if (group) {
257
- group[group.length] = element;
258
- }
259
- }
260
- if (!map) {
261
- return elements;
262
- }
263
- const placeholder = /* @__PURE__ */ new Set();
264
- for (const group of map.values()) {
265
- placeholder.add(group.find((radio) => radio.checked) ?? group[0]);
266
- }
267
- return elements.filter(
268
- (element) => isUngroupedRadio(element) ? placeholder.has(element) : true
269
- );
270
- }
271
- function sortByTabIndex(elements) {
272
- const ordered = [];
273
- const natural = [];
274
- for (let i = 0, l = elements.length; i < l; i++) {
275
- const element = elements[i];
276
- if (element) {
277
- const target = getTabIndex(element) > 0 ? ordered : natural;
278
- target[target.length] = element;
279
- }
280
- }
281
- ordered.sort((a, b) => getTabIndex(a) - getTabIndex(b));
282
- let count = 0;
283
- const sorted = new Array(ordered.length + natural.length);
284
- for (let i = 0, l = ordered.length; i < l; i++) {
285
- sorted[count++] = ordered[i];
286
- }
287
- for (let i = 0, l = natural.length; i < l; i++) {
288
- sorted[count++] = natural[i];
289
- }
290
- return sorted;
291
- }
292
- function getComposedChildren(node) {
293
- if (node instanceof ShadowRoot) {
294
- return getChildren(node);
295
- }
296
- if (!(node instanceof Element)) {
297
- return [];
298
- }
299
- if (node instanceof HTMLSlotElement) {
300
- const assigned = node.assignedElements({ flatten: true });
301
- if (assigned.length) {
302
- return assigned;
303
- }
304
- }
305
- if (node instanceof HTMLElement && node.shadowRoot?.mode === "open") {
306
- return getChildren(node.shadowRoot);
307
- }
308
- return getChildren(node);
309
- }
310
- function getChildren(node) {
311
- const elements = [];
312
- for (let child = node.firstElementChild; child; child = child.nextElementSibling) {
313
- elements[elements.length] = child;
314
- }
315
- return elements;
316
- }
317
- function getTabIndex(element) {
318
- return "tabIndex" in element ? Number(element.tabIndex) : 0;
319
- }
320
- function isDisabled(element) {
321
- return "disabled" in element && !!element.disabled;
322
- }
323
- function isFormControl(element) {
324
- const name = element.tagName;
325
- return name === "BUTTON" || name === "INPUT" || name === "SELECT" || name === "TEXTAREA";
326
- }
327
- function isInert(element) {
328
- return "inert" in element && !!element.inert;
329
- }
330
- function isUngroupedRadio(element) {
331
- return element instanceof HTMLInputElement && element.type === "radio" && !!element.name;
332
- }
333
- function createRovingTabIndex(container, options = {}) {
334
- if (!(container instanceof Element)) {
335
- console.warn("Invalid container element");
336
- return () => {
337
- };
338
- }
339
- const roving = new RovingTabIndex(container, options);
340
- return () => roving.destroy();
341
- }
342
- var RovingTabIndex = class {
343
- #container;
344
- #settings;
345
- #focusables = /* @__PURE__ */ new Set();
346
- #focusablesByFirstChar = /* @__PURE__ */ new Map();
347
- #selectorFilter;
348
- #controller = null;
349
- #isDestroyed = false;
350
- constructor(container, options = {}) {
351
- this.#container = container;
352
- let {
353
- direction,
354
- navigationOnly = false,
355
- noMemory = false,
356
- noStart = false,
357
- selector,
358
- typeahead = false,
359
- wrap = false
360
- } = options;
361
- if (typeof direction !== "undefined" && !["horizontal", "vertical"].includes(direction)) {
362
- console.warn("Invalid direction option. Fallback: both (undefined).");
363
- direction = void 0;
364
- }
365
- if (typeof navigationOnly !== "boolean") {
366
- console.warn("Invalid navigationOnly option. Fallback: false.");
367
- navigationOnly = false;
368
- }
369
- if (typeof noMemory !== "boolean") {
370
- console.warn("Invalid noMemory option. Fallback: false.");
371
- noMemory = false;
372
- }
373
- if (typeof noStart !== "boolean") {
374
- console.warn("Invalid noStart option. Fallback: false.");
375
- noStart = false;
376
- }
377
- if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
378
- console.warn(
379
- "Invalid selector. Fallback: all focusable elements (undefined)."
380
- );
381
- selector = void 0;
382
- }
383
- if (typeof typeahead !== "boolean") {
384
- console.warn("Invalid typeahead option. Fallback: false.");
385
- typeahead = false;
386
- }
387
- if (typeof wrap !== "boolean") {
388
- console.warn("Invalid wrap option. Fallback: false.");
389
- wrap = false;
390
- }
391
- this.#settings = {
392
- navigationOnly,
393
- noMemory,
394
- noStart,
395
- typeahead,
396
- wrap
397
- };
398
- direction && Object.assign(this.#settings, { direction });
399
- selector && Object.assign(this.#settings, { selector });
400
- this.#selectorFilter = this.#createSelectorFilter();
401
- this.#initialize();
402
- }
403
- destroy() {
404
- if (this.#isDestroyed) {
405
- return;
406
- }
407
- this.#isDestroyed = true;
408
- this.#controller?.abort();
409
- this.#controller = null;
410
- restoreAttributes([...this.#focusables]);
411
- this.#focusables.clear();
412
- this.#focusablesByFirstChar.clear();
413
- this.#container.removeAttribute("data-roving-tabindex-initialized");
414
- }
415
- #initialize() {
416
- this.#update(document.activeElement);
417
- this.#controller = new AbortController();
418
- const { signal } = this.#controller;
419
- document.addEventListener("focusin", this.#onFocusIn, {
420
- capture: true,
421
- signal
422
- });
423
- document.addEventListener("keydown", this.#onKeyDown, {
424
- capture: true,
425
- signal
426
- });
427
- this.#container.setAttribute("data-roving-tabindex-initialized", "");
428
- }
429
- #onFocusIn = (event) => {
430
- const { target } = event;
431
- if (!(target instanceof Element)) {
432
- return;
433
- }
434
- const isFocusable22 = this.#focusables.has(target);
435
- this.#settings.noMemory && !isFocusable22 ? this.#update(null) : isFocusable22 && this.#update(target);
436
- };
437
- #onKeyDown = (event) => {
438
- if (!event.composedPath().includes(this.#container)) {
439
- return;
440
- }
441
- const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
442
- if (altKey || ctrlKey || metaKey || shiftKey) {
443
- return;
444
- }
445
- const { direction, typeahead, wrap } = this.#settings;
446
- const isBoth = !direction;
447
- const isHorizontal = direction === "horizontal";
448
- if (![
449
- "End",
450
- "Home",
451
- ...isBoth ? ["ArrowLeft", "ArrowUp"] : [`Arrow${isHorizontal ? "Left" : "Up"}`],
452
- ...isBoth ? ["ArrowRight", "ArrowDown"] : [`Arrow${isHorizontal ? "Right" : "Down"}`]
453
- ].includes(key)) {
454
- if (!typeahead || !/^\S$/i.test(key) || !this.#focusablesByFirstChar.has(key.toUpperCase())) {
455
- return;
456
- }
457
- }
458
- const active = getActiveElement2();
459
- if (!(active instanceof HTMLElement)) {
460
- return;
461
- }
462
- const current = this.#getFocusables();
463
- if (!current.includes(active)) {
464
- return;
465
- }
466
- event.preventDefault();
467
- const currentIndex = current.indexOf(active);
468
- let newIndex;
469
- let target = current;
470
- switch (key) {
471
- case "End":
472
- newIndex = -1;
473
- break;
474
- case "Home":
475
- newIndex = 0;
476
- break;
477
- case "ArrowLeft":
478
- case "ArrowUp": {
479
- const rawIndex = currentIndex - 1;
480
- newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
481
- break;
482
- }
483
- case "ArrowRight":
484
- case "ArrowDown": {
485
- const rawIndex = currentIndex + 1;
486
- newIndex = wrap ? rawIndex % current.length : Math.min(rawIndex, current.length - 1);
487
- break;
488
- }
489
- default: {
490
- target = this.#focusablesByFirstChar.get(key.toUpperCase()) ?? [];
491
- const foundIndex = target.findIndex(
492
- (focusable2) => current.indexOf(focusable2) > currentIndex
493
- );
494
- newIndex = foundIndex >= 0 ? foundIndex : 0;
495
- }
496
- }
497
- const focusable = target.at(newIndex);
498
- focusable && focusElement(focusable);
499
- };
500
- #update(active) {
501
- const current = new Set(this.#getFocusables());
502
- for (const focusable of this.#focusables) {
503
- if (!current.has(focusable)) {
504
- focusable.isConnected && restoreAttributes([focusable]);
505
- this.#focusables.delete(focusable);
506
- this.#focusablesByFirstChar.forEach((focusables) => {
507
- const index = focusables.indexOf(focusable);
508
- index >= 0 && focusables.splice(index, 1);
509
- });
510
- }
511
- }
512
- const { navigationOnly, noStart, typeahead } = this.#settings;
513
- for (const focusable of current) {
514
- if (this.#focusables.has(focusable)) {
515
- continue;
516
- }
517
- this.#focusables.add(focusable);
518
- if (!navigationOnly) {
519
- saveAttributes([focusable], ["tabindex"]);
520
- focusable.setAttribute("tabindex", "-1");
521
- }
522
- if (!typeahead) {
523
- continue;
524
- }
525
- const char = focusable.textContent?.trim()?.at(0)?.toUpperCase();
526
- const value = focusable.ariaKeyShortcuts?.trim();
527
- const keys = new Set(
528
- value ? value.split(/\s+/).filter((key) => /^\S$/i.test(key)).map((key) => key.toUpperCase()) : []
529
- );
530
- if (char) {
531
- keys.add(char);
532
- saveAttributes([focusable], ["aria-keyshortcuts"]);
533
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
534
- caseInsensitive: true
535
- });
536
- }
537
- keys.forEach((key) => {
538
- const focusables = this.#focusablesByFirstChar.get(key) ?? [];
539
- focusables.push(focusable);
540
- this.#focusablesByFirstChar.set(key, focusables);
541
- });
542
- }
543
- if (!navigationOnly) {
544
- if (active && this.#focusables.has(active)) {
545
- this.#focusables.forEach((focusable) => {
546
- focusable.setAttribute("tabindex", focusable === active ? "0" : "-1");
547
- });
548
- } else {
549
- [...this.#focusables].forEach((focusable, i) => {
550
- focusable.setAttribute("tabindex", i || noStart ? "-1" : "0");
551
- });
552
- }
553
- }
554
- }
555
- #createSelectorFilter() {
556
- const { selector } = this.#settings;
557
- return (element) => !selector || [...this.#container.querySelectorAll(selector)].includes(element);
558
- }
559
- #getFocusables() {
560
- return getFocusables(this.#container, {
561
- composed: true,
562
- filter: this.#selectorFilter,
563
- skipNegativeTabIndexCheck: !this.#settings.navigationOnly,
564
- skipVisibilityCheck: true
565
- });
566
- }
567
- };
568
- function focusElement(element) {
569
- "focus" in element && typeof element.focus === "function" && element.focus();
570
- }
571
- function getActiveElement2() {
572
- let current = document.activeElement;
573
- while (current?.shadowRoot?.activeElement) {
574
- current = current.shadowRoot.activeElement;
575
- }
576
- return current;
577
- }
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var Button__default = /*#__PURE__*/_interopDefault(Button);
578
10
 
579
11
  // src/index.ts
580
12
  var Tabs = class _Tabs {
@@ -738,7 +170,7 @@ var Tabs = class _Tabs {
738
170
  p.removeAttribute("hidden");
739
171
  } else {
740
172
  const tab2 = this.#tabElements[i];
741
- tab2 && p.setAttribute("hidden", isFocusable2(tab2) ? "until-found" : "");
173
+ tab2 && p.setAttribute("hidden", isFocusable(tab2) ? "until-found" : "");
742
174
  }
743
175
  });
744
176
  this.#animation?.cancel();
@@ -851,7 +283,7 @@ var Tabs = class _Tabs {
851
283
  this.#onAnimationFinish();
852
284
  this.#animationController?.abort();
853
285
  this.#animationController = null;
854
- restoreAttributes([
286
+ attributesUtils.restoreAttributes([
855
287
  ...this.#listElements,
856
288
  ...this.#tabElements,
857
289
  ...this.#indicatorElements,
@@ -864,21 +296,21 @@ var Tabs = class _Tabs {
864
296
  this.#rootElement.removeAttribute("data-tabs-initialized");
865
297
  }
866
298
  #initialize() {
867
- saveAttributes(this.#listElements, [
299
+ attributesUtils.saveAttributes(this.#listElements, [
868
300
  "aria-hidden",
869
301
  "aria-orientation",
870
302
  "role",
871
303
  "style"
872
304
  ]);
873
- saveAttributes(this.#tabElements, [
305
+ attributesUtils.saveAttributes(this.#tabElements, [
874
306
  "aria-controls",
875
307
  "id",
876
308
  "role",
877
309
  "style",
878
310
  "tabindex"
879
311
  ]);
880
- saveAttributes(this.#indicatorElements, ["style"]);
881
- saveAttributes(this.#panelElements, [
312
+ attributesUtils.saveAttributes(this.#indicatorElements, ["style"]);
313
+ attributesUtils.saveAttributes(this.#panelElements, [
882
314
  "aria-controls",
883
315
  "aria-labelledby",
884
316
  "id",
@@ -899,18 +331,18 @@ var Tabs = class _Tabs {
899
331
  return;
900
332
  }
901
333
  panel.id ||= `tabs-panel-${id}`;
902
- addTokenToAttribute(tab, "aria-controls", panel.id);
334
+ attributesUtils.addTokenToAttribute(tab, "aria-controls", panel.id);
903
335
  !tab.hasAttribute("aria-selected") && tab.setAttribute("aria-selected", "false");
904
336
  const isAvoided = this.#isAvoidedTab(tab);
905
337
  if (!isAvoided) {
906
338
  tab.id ||= `tabs-tab-${id}`;
907
339
  }
908
340
  tab.setAttribute("role", "tab");
909
- !isFocusable2(tab) && tab.style.setProperty("pointer-events", "none");
910
- addTokenToAttribute(panel, "aria-labelledby", tab.id);
341
+ !isFocusable(tab) && tab.style.setProperty("pointer-events", "none");
342
+ attributesUtils.addTokenToAttribute(panel, "aria-labelledby", tab.id);
911
343
  tab.addEventListener("click", this.#onTabClick, { signal });
912
344
  tab.addEventListener("focus", this.#onTabFocus, { signal });
913
- this.#buttons.push(new Button(tab));
345
+ this.#buttons.push(new Button__default.default(tab));
914
346
  });
915
347
  this.#indicatorElements.forEach((indicator) => {
916
348
  indicator.closest(this.#settings.selector.list)?.style.setProperty("position", "relative");
@@ -931,7 +363,7 @@ var Tabs = class _Tabs {
931
363
  list.ariaOrientation !== "undefined" && Object.assign(options, {
932
364
  direction: this.#settings.vertical ? "vertical" : "horizontal"
933
365
  });
934
- this.#cleanupsRovingTabIndex.push(createRovingTabIndex(list, options));
366
+ this.#cleanupsRovingTabIndex.push(rovingTabindex.createRovingTabIndex(list, options));
935
367
  list.querySelectorAll(this.#settings.selector.tab).forEach((tab) => {
936
368
  tab.setAttribute(
937
369
  "tabindex",
@@ -1088,70 +520,18 @@ function hasFocusable(container) {
1088
520
  )
1089
521
  ].filter((element) => element.checkVisibility()).length;
1090
522
  }
1091
- function isFocusable2(element) {
523
+ function isFocusable(element) {
1092
524
  return !element.hasAttribute("disabled");
1093
525
  }
1094
526
  /**
1095
527
  * Tabs
1096
528
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
1097
529
  *
1098
- * @version 2.0.1
530
+ * @version 2.0.3
1099
531
  * @author Yusuke Kamiyamane
1100
532
  * @license MIT
1101
533
  * @copyright Copyright (c) Yusuke Kamiyamane
1102
534
  * @see {@link https://github.com/y14e/tabs}
1103
535
  */
1104
- /*! Bundled license information:
1105
-
1106
- @y14e/button/dist/index.js:
1107
- (**
1108
- * Button
1109
- *
1110
- * @version 1.0.2
1111
- * @author Yusuke Kamiyamane
1112
- * @license MIT
1113
- * @copyright Copyright (c) Yusuke Kamiyamane
1114
- * @see {@link https://github.com/y14e/button}
1115
- *)
1116
-
1117
- @y14e/roving-tabindex/dist/index.js:
1118
- (**
1119
- * Roving Tabindex
1120
- * Lightweight roving tabindex utility with fully focus management.
1121
- * Designed for accessible menus, tabs, toolbars, and composite widgets.
1122
- *
1123
- * @version 3.0.7
1124
- * @author Yusuke Kamiyamane
1125
- * @license MIT
1126
- * @copyright Copyright (c) Yusuke Kamiyamane
1127
- * @see {@link https://github.com/y14e/roving-tabindex}
1128
- *)
1129
- (*! Bundled license information:
1130
-
1131
- @y14e/attributes-utils/dist/index.js:
1132
- (**
1133
- * Attributes Utils
1134
- *
1135
- * @version 1.1.2
1136
- * @author Yusuke Kamiyamane
1137
- * @license MIT
1138
- * @copyright Copyright (c) Yusuke Kamiyamane
1139
- * @see {@link https://github.com/y14e/attributes-utils}
1140
- *)
1141
-
1142
- power-focusable/dist/index.js:
1143
- (**
1144
- * Power Focusable
1145
- * High-precision focus management utility with full composed tree support.
1146
- * Handles complex focus rules including tabindex ordering, radio groups, inert.
1147
- *
1148
- * @version 4.3.3
1149
- * @author Yusuke Kamiyamane
1150
- * @license MIT
1151
- * @copyright Copyright (c) Yusuke Kamiyamane
1152
- * @see {@link https://github.com/y14e/power-focusable}
1153
- *)
1154
- *)
1155
- */
1156
536
 
1157
537
  module.exports = Tabs;