@y14e/tabs 2.0.11 → 2.0.13

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
@@ -10,14 +10,14 @@ npm i @y14e/tabs
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import Tabs from "@y14e/tabs";
13
+ import { Tabs } from "@y14e/tabs";
14
14
 
15
15
  // CDNs
16
- import Tabs from "https://esm.sh/@y14e/tabs@2.0.11";
16
+ import { Tabs } from "https://esm.sh/@y14e/tabs@2.0.13";
17
17
  // or
18
- import Tabs from "https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.11/+esm";
18
+ import { Tabs } from "https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.13/+esm";
19
19
  // or
20
- import Tabs from "https://esm.unpkg.com/@y14e/tabs@2.0.11";
20
+ import { Tabs } from "https://esm.unpkg.com/@y14e/tabs@2.0.13";
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -68,7 +68,7 @@ If `true`, only the first tab list remains interactive; subsequent duplicates ar
68
68
  Override the global default settings applied to all accordion instances.
69
69
 
70
70
  ```ts
71
- import Tabs from "@y14e/tabs";
71
+ import { Tabs } from "@y14e/tabs";
72
72
 
73
73
  Tabs.defaults = {
74
74
  animation: {
@@ -368,56 +368,6 @@ var Button = class {
368
368
  };
369
369
  };
370
370
 
371
- // node_modules/@y14e/attributes-utils/dist/index.js
372
- var DEFAULT_PARSER2 = (value) => value.split(/\s+/);
373
- var DEFAULT_SERIALIZER2 = (tokens) => tokens.join(" ");
374
- function addTokenToAttribute(element, name, token, options = {}) {
375
- const value = element.getAttribute(name)?.trim();
376
- const {
377
- caseInsensitive = false,
378
- parse = DEFAULT_PARSER2,
379
- serialize = DEFAULT_SERIALIZER2
380
- } = options;
381
- const tokens = value ? parse(value).filter(Boolean) : [];
382
- if (caseInsensitive) {
383
- const lower = token.toLowerCase();
384
- if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
385
- tokens.push(token);
386
- element.setAttribute(name, serialize(tokens));
387
- }
388
- } else {
389
- const set = new Set(tokens);
390
- set.add(token);
391
- element.setAttribute(name, serialize([...set]));
392
- }
393
- }
394
- var snapshots2 = /* @__PURE__ */ new WeakMap();
395
- function restoreAttributes2(element_or_elements) {
396
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
397
- const snapshot = snapshots2.get(element);
398
- if (!snapshot) {
399
- continue;
400
- }
401
- for (const [name, value] of snapshot.entries()) {
402
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
403
- }
404
- snapshots2.delete(element);
405
- }
406
- }
407
- function saveAttributes2(element_or_elements, name_or_names) {
408
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
409
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
410
- let snapshot = snapshots2.get(element);
411
- if (!snapshot) {
412
- snapshot = /* @__PURE__ */ new Map();
413
- snapshots2.set(element, snapshot);
414
- }
415
- names.forEach((name) => {
416
- snapshot.set(name, element.getAttribute(name));
417
- });
418
- });
419
- }
420
-
421
371
  // node_modules/@y14e/roving-tabindex/dist/index.js
422
372
  function createRovingTabIndex(container, options = {}) {
423
373
  if (!(container instanceof Element)) {
@@ -509,7 +459,7 @@ var RovingTabIndex = class _RovingTabIndex {
509
459
  this.#controller = null;
510
460
  this.#focusables.forEach((focusable) => {
511
461
  _RovingTabIndex.#initialized.delete(focusable);
512
- restoreAttributes2(focusable);
462
+ restoreAttributes(focusable);
513
463
  });
514
464
  this.#focusables.clear();
515
465
  this.#focusablesByFirstChar.clear();
@@ -614,7 +564,7 @@ var RovingTabIndex = class _RovingTabIndex {
614
564
  for (const focusable of this.#focusables) {
615
565
  if (!current.has(focusable)) {
616
566
  _RovingTabIndex.#initialized.delete(focusable);
617
- restoreAttributes2(focusable);
567
+ restoreAttributes(focusable);
618
568
  this.#focusables.delete(focusable);
619
569
  for (const [key, focusables] of this.#focusablesByFirstChar) {
620
570
  const index = focusables.indexOf(focusable);
@@ -636,7 +586,7 @@ var RovingTabIndex = class _RovingTabIndex {
636
586
  this.#focusables.add(focusable);
637
587
  _RovingTabIndex.#initialized.add(focusable);
638
588
  if (!navigationOnly) {
639
- saveAttributes2(focusable, "tabindex");
589
+ saveAttributes(focusable, "tabindex");
640
590
  focusable.setAttribute("tabindex", "-1");
641
591
  }
642
592
  if (!typeahead) {
@@ -649,8 +599,8 @@ var RovingTabIndex = class _RovingTabIndex {
649
599
  );
650
600
  if (char) {
651
601
  keys.add(char);
652
- saveAttributes2(focusable, "aria-keyshortcuts");
653
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
602
+ saveAttributes(focusable, "aria-keyshortcuts");
603
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
654
604
  caseInsensitive: true
655
605
  });
656
606
  }
@@ -1205,7 +1155,7 @@ var TabsIndicator = class {
1205
1155
  * Tabs
1206
1156
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
1207
1157
  *
1208
- * @version 2.0.11
1158
+ * @version 2.0.13
1209
1159
  * @author Yusuke Kamiyamane
1210
1160
  * @license MIT
1211
1161
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1217,7 +1167,7 @@ var TabsIndicator = class {
1217
1167
  (**
1218
1168
  * Attribute Util
1219
1169
  *
1220
- * @version 2.0.0
1170
+ * @version 2.0.2
1221
1171
  * @author Yusuke Kamiyamane
1222
1172
  * @license MIT
1223
1173
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1230,7 +1180,7 @@ power-focusable/dist/index.js:
1230
1180
  * High-precision focus management utility with full composed tree support.
1231
1181
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
1232
1182
  *
1233
- * @version 4.3.23
1183
+ * @version 4.3.25
1234
1184
  * @author Yusuke Kamiyamane
1235
1185
  * @license MIT
1236
1186
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1241,31 +1191,20 @@ power-focusable/dist/index.js:
1241
1191
  (**
1242
1192
  * Button
1243
1193
  *
1244
- * @version 1.0.6
1194
+ * @version 1.0.8
1245
1195
  * @author Yusuke Kamiyamane
1246
1196
  * @license MIT
1247
1197
  * @copyright Copyright (c) Yusuke Kamiyamane
1248
1198
  * @see {@link https://github.com/y14e/button}
1249
1199
  *)
1250
1200
 
1251
- @y14e/attributes-utils/dist/index.js:
1252
- (**
1253
- * Attributes Utils
1254
- *
1255
- * @version 1.1.7
1256
- * @author Yusuke Kamiyamane
1257
- * @license MIT
1258
- * @copyright Copyright (c) Yusuke Kamiyamane
1259
- * @see {@link https://github.com/y14e/attributes-utils}
1260
- *)
1261
-
1262
1201
  @y14e/roving-tabindex/dist/index.js:
1263
1202
  (**
1264
1203
  * Roving Tabindex
1265
1204
  * Lightweight roving tabindex utility with fully focus management.
1266
1205
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1267
1206
  *
1268
- * @version 3.1.20
1207
+ * @version 3.1.22
1269
1208
  * @author Yusuke Kamiyamane
1270
1209
  * @license MIT
1271
1210
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1273,4 +1212,4 @@ power-focusable/dist/index.js:
1273
1212
  *)
1274
1213
  */
1275
1214
 
1276
- module.exports = Tabs;
1215
+ exports.Tabs = Tabs;
@@ -366,56 +366,6 @@ var Button = class {
366
366
  };
367
367
  };
368
368
 
369
- // node_modules/@y14e/attributes-utils/dist/index.js
370
- var DEFAULT_PARSER2 = (value) => value.split(/\s+/);
371
- var DEFAULT_SERIALIZER2 = (tokens) => tokens.join(" ");
372
- function addTokenToAttribute(element, name, token, options = {}) {
373
- const value = element.getAttribute(name)?.trim();
374
- const {
375
- caseInsensitive = false,
376
- parse = DEFAULT_PARSER2,
377
- serialize = DEFAULT_SERIALIZER2
378
- } = options;
379
- const tokens = value ? parse(value).filter(Boolean) : [];
380
- if (caseInsensitive) {
381
- const lower = token.toLowerCase();
382
- if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
383
- tokens.push(token);
384
- element.setAttribute(name, serialize(tokens));
385
- }
386
- } else {
387
- const set = new Set(tokens);
388
- set.add(token);
389
- element.setAttribute(name, serialize([...set]));
390
- }
391
- }
392
- var snapshots2 = /* @__PURE__ */ new WeakMap();
393
- function restoreAttributes2(element_or_elements) {
394
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
395
- const snapshot = snapshots2.get(element);
396
- if (!snapshot) {
397
- continue;
398
- }
399
- for (const [name, value] of snapshot.entries()) {
400
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
401
- }
402
- snapshots2.delete(element);
403
- }
404
- }
405
- function saveAttributes2(element_or_elements, name_or_names) {
406
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
407
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
408
- let snapshot = snapshots2.get(element);
409
- if (!snapshot) {
410
- snapshot = /* @__PURE__ */ new Map();
411
- snapshots2.set(element, snapshot);
412
- }
413
- names.forEach((name) => {
414
- snapshot.set(name, element.getAttribute(name));
415
- });
416
- });
417
- }
418
-
419
369
  // node_modules/@y14e/roving-tabindex/dist/index.js
420
370
  function createRovingTabIndex(container, options = {}) {
421
371
  if (!(container instanceof Element)) {
@@ -507,7 +457,7 @@ var RovingTabIndex = class _RovingTabIndex {
507
457
  this.#controller = null;
508
458
  this.#focusables.forEach((focusable) => {
509
459
  _RovingTabIndex.#initialized.delete(focusable);
510
- restoreAttributes2(focusable);
460
+ restoreAttributes(focusable);
511
461
  });
512
462
  this.#focusables.clear();
513
463
  this.#focusablesByFirstChar.clear();
@@ -612,7 +562,7 @@ var RovingTabIndex = class _RovingTabIndex {
612
562
  for (const focusable of this.#focusables) {
613
563
  if (!current.has(focusable)) {
614
564
  _RovingTabIndex.#initialized.delete(focusable);
615
- restoreAttributes2(focusable);
565
+ restoreAttributes(focusable);
616
566
  this.#focusables.delete(focusable);
617
567
  for (const [key, focusables] of this.#focusablesByFirstChar) {
618
568
  const index = focusables.indexOf(focusable);
@@ -634,7 +584,7 @@ var RovingTabIndex = class _RovingTabIndex {
634
584
  this.#focusables.add(focusable);
635
585
  _RovingTabIndex.#initialized.add(focusable);
636
586
  if (!navigationOnly) {
637
- saveAttributes2(focusable, "tabindex");
587
+ saveAttributes(focusable, "tabindex");
638
588
  focusable.setAttribute("tabindex", "-1");
639
589
  }
640
590
  if (!typeahead) {
@@ -647,8 +597,8 @@ var RovingTabIndex = class _RovingTabIndex {
647
597
  );
648
598
  if (char) {
649
599
  keys.add(char);
650
- saveAttributes2(focusable, "aria-keyshortcuts");
651
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
600
+ saveAttributes(focusable, "aria-keyshortcuts");
601
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
652
602
  caseInsensitive: true
653
603
  });
654
604
  }
@@ -1203,7 +1153,7 @@ var TabsIndicator = class {
1203
1153
  * Tabs
1204
1154
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
1205
1155
  *
1206
- * @version 2.0.11
1156
+ * @version 2.0.13
1207
1157
  * @author Yusuke Kamiyamane
1208
1158
  * @license MIT
1209
1159
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1215,7 +1165,7 @@ var TabsIndicator = class {
1215
1165
  (**
1216
1166
  * Attribute Util
1217
1167
  *
1218
- * @version 2.0.0
1168
+ * @version 2.0.2
1219
1169
  * @author Yusuke Kamiyamane
1220
1170
  * @license MIT
1221
1171
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1228,7 +1178,7 @@ power-focusable/dist/index.js:
1228
1178
  * High-precision focus management utility with full composed tree support.
1229
1179
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
1230
1180
  *
1231
- * @version 4.3.23
1181
+ * @version 4.3.25
1232
1182
  * @author Yusuke Kamiyamane
1233
1183
  * @license MIT
1234
1184
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1239,31 +1189,20 @@ power-focusable/dist/index.js:
1239
1189
  (**
1240
1190
  * Button
1241
1191
  *
1242
- * @version 1.0.6
1192
+ * @version 1.0.8
1243
1193
  * @author Yusuke Kamiyamane
1244
1194
  * @license MIT
1245
1195
  * @copyright Copyright (c) Yusuke Kamiyamane
1246
1196
  * @see {@link https://github.com/y14e/button}
1247
1197
  *)
1248
1198
 
1249
- @y14e/attributes-utils/dist/index.js:
1250
- (**
1251
- * Attributes Utils
1252
- *
1253
- * @version 1.1.7
1254
- * @author Yusuke Kamiyamane
1255
- * @license MIT
1256
- * @copyright Copyright (c) Yusuke Kamiyamane
1257
- * @see {@link https://github.com/y14e/attributes-utils}
1258
- *)
1259
-
1260
1199
  @y14e/roving-tabindex/dist/index.js:
1261
1200
  (**
1262
1201
  * Roving Tabindex
1263
1202
  * Lightweight roving tabindex utility with fully focus management.
1264
1203
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1265
1204
  *
1266
- * @version 3.1.20
1205
+ * @version 3.1.22
1267
1206
  * @author Yusuke Kamiyamane
1268
1207
  * @license MIT
1269
1208
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1271,4 +1210,4 @@ power-focusable/dist/index.js:
1271
1210
  *)
1272
1211
  */
1273
1212
 
1274
- export { Tabs as default };
1213
+ export { Tabs };
package/dist/index.cjs CHANGED
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var util = require('@y14e/attribute-util');
4
- var Button = require('@y14e/button');
4
+ var button = require('@y14e/button');
5
5
  var rovingTabindex = require('@y14e/roving-tabindex');
6
6
 
7
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
-
9
7
  function _interopNamespace(e) {
10
8
  if (e && e.__esModule) return e;
11
9
  var n = Object.create(null);
@@ -25,7 +23,6 @@ function _interopNamespace(e) {
25
23
  }
26
24
 
27
25
  var util__namespace = /*#__PURE__*/_interopNamespace(util);
28
- var Button__default = /*#__PURE__*/_interopDefault(Button);
29
26
 
30
27
  // src/index.ts
31
28
  var Tabs = class _Tabs {
@@ -360,7 +357,7 @@ var Tabs = class _Tabs {
360
357
  util__namespace.addAttributeToken(panel, "aria-labelledby", tab.id);
361
358
  tab.addEventListener("click", this.#onTabClick, { signal });
362
359
  tab.addEventListener("focus", this.#onTabFocus, { signal });
363
- this.#buttons.push(new Button__default.default(tab));
360
+ this.#buttons.push(new button.Button(tab));
364
361
  });
365
362
  this.#indicatorElements.forEach((indicator) => {
366
363
  indicator.closest(this.#settings.selector.list)?.style.setProperty("position", "relative");
@@ -546,11 +543,11 @@ var TabsIndicator = class {
546
543
  * Tabs
547
544
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
548
545
  *
549
- * @version 2.0.11
546
+ * @version 2.0.13
550
547
  * @author Yusuke Kamiyamane
551
548
  * @license MIT
552
549
  * @copyright Copyright (c) Yusuke Kamiyamane
553
550
  * @see {@link https://github.com/y14e/tabs}
554
551
  */
555
552
 
556
- module.exports = Tabs;
553
+ exports.Tabs = Tabs;
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.11
5
+ * @version 2.0.13
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -40,4 +40,4 @@ declare class Tabs {
40
40
  destroy(force?: boolean): Promise<void>;
41
41
  }
42
42
 
43
- export { type TabsOptions, Tabs as default };
43
+ export { Tabs, type TabsOptions };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.11
5
+ * @version 2.0.13
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -40,4 +40,4 @@ declare class Tabs {
40
40
  destroy(force?: boolean): Promise<void>;
41
41
  }
42
42
 
43
- export { type TabsOptions, Tabs as default };
43
+ export { Tabs, type TabsOptions };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as util from '@y14e/attribute-util';
2
- import Button from '@y14e/button';
2
+ import { Button } from '@y14e/button';
3
3
  import { createRovingTabIndex } from '@y14e/roving-tabindex';
4
4
 
5
5
  // src/index.ts
@@ -521,11 +521,11 @@ var TabsIndicator = class {
521
521
  * Tabs
522
522
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
523
523
  *
524
- * @version 2.0.11
524
+ * @version 2.0.13
525
525
  * @author Yusuke Kamiyamane
526
526
  * @license MIT
527
527
  * @copyright Copyright (c) Yusuke Kamiyamane
528
528
  * @see {@link https://github.com/y14e/tabs}
529
529
  */
530
530
 
531
- export { Tabs as default };
531
+ export { Tabs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/tabs",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "WAI-ARIA compliant tabs pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -49,9 +49,12 @@
49
49
  "engines": {
50
50
  "node": ">=18"
51
51
  },
52
+ "allowScripts": {
53
+ "esbuild": true
54
+ },
52
55
  "dependencies": {
53
- "@y14e/attribute-util": "^2.0.0",
54
- "@y14e/button": "^1.0.6",
55
- "@y14e/roving-tabindex": "^3.1.20"
56
+ "@y14e/attribute-util": "^2.0.2",
57
+ "@y14e/button": "^1.0.8",
58
+ "@y14e/roving-tabindex": "^3.1.22"
56
59
  }
57
60
  }