@y14e/accordion 2.1.5 → 2.1.7

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
@@ -13,11 +13,11 @@ npm i @y14e/accordion
13
13
  import { Accordion } from '@y14e/accordion';
14
14
 
15
15
  // CDNs
16
- import { Accordion } from 'https://esm.sh/@y14e/accordion@2.1.5';
16
+ import { Accordion } from 'https://esm.sh/@y14e/accordion@2.1.7';
17
17
  // or
18
- import { Accordion } from 'https://cdn.jsdelivr.net/npm/@y14e/accordion@2.1.5/+esm';
18
+ import { Accordion } from 'https://cdn.jsdelivr.net/npm/@y14e/accordion@2.1.7/+esm';
19
19
  // or
20
- import { Accordion } from 'https://esm.unpkg.com/@y14e/accordion@2.1.5';
20
+ import { Accordion } from 'https://esm.unpkg.com/@y14e/accordion@2.1.7';
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -395,6 +395,7 @@ var Button = class {
395
395
  };
396
396
 
397
397
  // node_modules/@y14e/roving-tabindex/dist/index.js
398
+ var DIRECTIONS = ["both", "grid", "horizontal", "vertical"];
398
399
  function createRovingTabIndex(container, options = {}) {
399
400
  if (!(container instanceof Element)) {
400
401
  console.warn("Invalid container element");
@@ -684,7 +685,7 @@ var RovingTabIndex = class _RovingTabIndex {
684
685
  wrap = false
685
686
  } = options;
686
687
  direction = direction.toLowerCase();
687
- if (!["both", "grid", "horizontal", "vertical"].includes(direction)) {
688
+ if (!DIRECTIONS.includes(direction)) {
688
689
  console.warn("Invalid direction option. Fallback: 'both'.");
689
690
  direction = "both";
690
691
  }
@@ -1009,14 +1010,16 @@ var Accordion = class _Accordion {
1009
1010
  console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
1010
1011
  merged.collapsible = collapsible;
1011
1012
  }
1012
- for (const [key, value] of Object.entries(defaults.selector)) {
1013
+ for (const [name, value] of Object.entries(defaults.selector)) {
1014
+ const { selector } = merged;
1015
+ const n = name;
1013
1016
  try {
1014
- document.querySelector(value);
1017
+ document.querySelector(selector[n]);
1015
1018
  } catch {
1016
1019
  console.warn(
1017
- `Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
1020
+ `Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
1018
1021
  );
1019
- merged.selector[key] = value;
1022
+ selector[n] = value;
1020
1023
  }
1021
1024
  }
1022
1025
  return merged;
@@ -1031,7 +1034,7 @@ var Accordion = class _Accordion {
1031
1034
  }
1032
1035
  };
1033
1036
  function waitAnimationFinish(animation) {
1034
- return ["idle", "finished"].includes(animation.playState) ? Promise.resolve() : new Promise(
1037
+ return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
1035
1038
  (resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
1036
1039
  );
1037
1040
  }
@@ -1039,7 +1042,7 @@ function waitAnimationFinish(animation) {
1039
1042
  * Accordion
1040
1043
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
1041
1044
  *
1042
- * @version 2.1.5
1045
+ * @version 2.1.7
1043
1046
  * @author Yusuke Kamiyamane
1044
1047
  * @license MIT
1045
1048
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1064,7 +1067,7 @@ power-focusable/dist/index.js:
1064
1067
  * High-precision focus management utility with full composed tree support.
1065
1068
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
1066
1069
  *
1067
- * @version 4.4.2
1070
+ * @version 4.4.3
1068
1071
  * @author Yusuke Kamiyamane
1069
1072
  * @license MIT
1070
1073
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1088,7 +1091,7 @@ power-focusable/dist/index.js:
1088
1091
  * Lightweight roving tabindex utility with fully focus management.
1089
1092
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1090
1093
  *
1091
- * @version 3.3.1
1094
+ * @version 3.3.2
1092
1095
  * @author Yusuke Kamiyamane
1093
1096
  * @license MIT
1094
1097
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -393,6 +393,7 @@ var Button = class {
393
393
  };
394
394
 
395
395
  // node_modules/@y14e/roving-tabindex/dist/index.js
396
+ var DIRECTIONS = ["both", "grid", "horizontal", "vertical"];
396
397
  function createRovingTabIndex(container, options = {}) {
397
398
  if (!(container instanceof Element)) {
398
399
  console.warn("Invalid container element");
@@ -682,7 +683,7 @@ var RovingTabIndex = class _RovingTabIndex {
682
683
  wrap = false
683
684
  } = options;
684
685
  direction = direction.toLowerCase();
685
- if (!["both", "grid", "horizontal", "vertical"].includes(direction)) {
686
+ if (!DIRECTIONS.includes(direction)) {
686
687
  console.warn("Invalid direction option. Fallback: 'both'.");
687
688
  direction = "both";
688
689
  }
@@ -1007,14 +1008,16 @@ var Accordion = class _Accordion {
1007
1008
  console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
1008
1009
  merged.collapsible = collapsible;
1009
1010
  }
1010
- for (const [key, value] of Object.entries(defaults.selector)) {
1011
+ for (const [name, value] of Object.entries(defaults.selector)) {
1012
+ const { selector } = merged;
1013
+ const n = name;
1011
1014
  try {
1012
- document.querySelector(value);
1015
+ document.querySelector(selector[n]);
1013
1016
  } catch {
1014
1017
  console.warn(
1015
- `Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
1018
+ `Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
1016
1019
  );
1017
- merged.selector[key] = value;
1020
+ selector[n] = value;
1018
1021
  }
1019
1022
  }
1020
1023
  return merged;
@@ -1029,7 +1032,7 @@ var Accordion = class _Accordion {
1029
1032
  }
1030
1033
  };
1031
1034
  function waitAnimationFinish(animation) {
1032
- return ["idle", "finished"].includes(animation.playState) ? Promise.resolve() : new Promise(
1035
+ return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
1033
1036
  (resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
1034
1037
  );
1035
1038
  }
@@ -1037,7 +1040,7 @@ function waitAnimationFinish(animation) {
1037
1040
  * Accordion
1038
1041
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
1039
1042
  *
1040
- * @version 2.1.5
1043
+ * @version 2.1.7
1041
1044
  * @author Yusuke Kamiyamane
1042
1045
  * @license MIT
1043
1046
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1062,7 +1065,7 @@ power-focusable/dist/index.js:
1062
1065
  * High-precision focus management utility with full composed tree support.
1063
1066
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
1064
1067
  *
1065
- * @version 4.4.2
1068
+ * @version 4.4.3
1066
1069
  * @author Yusuke Kamiyamane
1067
1070
  * @license MIT
1068
1071
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1086,7 +1089,7 @@ power-focusable/dist/index.js:
1086
1089
  * Lightweight roving tabindex utility with fully focus management.
1087
1090
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1088
1091
  *
1089
- * @version 3.3.1
1092
+ * @version 3.3.2
1090
1093
  * @author Yusuke Kamiyamane
1091
1094
  * @license MIT
1092
1095
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -285,14 +285,16 @@ var Accordion = class _Accordion {
285
285
  console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
286
286
  merged.collapsible = collapsible;
287
287
  }
288
- for (const [key, value] of Object.entries(defaults.selector)) {
288
+ for (const [name, value] of Object.entries(defaults.selector)) {
289
+ const { selector } = merged;
290
+ const n = name;
289
291
  try {
290
- document.querySelector(value);
292
+ document.querySelector(selector[n]);
291
293
  } catch {
292
294
  console.warn(
293
- `Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
295
+ `Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
294
296
  );
295
- merged.selector[key] = value;
297
+ selector[n] = value;
296
298
  }
297
299
  }
298
300
  return merged;
@@ -307,7 +309,7 @@ var Accordion = class _Accordion {
307
309
  }
308
310
  };
309
311
  function waitAnimationFinish(animation) {
310
- return ["idle", "finished"].includes(animation.playState) ? Promise.resolve() : new Promise(
312
+ return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
311
313
  (resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
312
314
  );
313
315
  }
@@ -315,7 +317,7 @@ function waitAnimationFinish(animation) {
315
317
  * Accordion
316
318
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
317
319
  *
318
- * @version 2.1.5
320
+ * @version 2.1.7
319
321
  * @author Yusuke Kamiyamane
320
322
  * @license MIT
321
323
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Accordion
3
3
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.1.5
5
+ * @version 2.1.7
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Accordion
3
3
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.1.5
5
+ * @version 2.1.7
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -283,14 +283,16 @@ var Accordion = class _Accordion {
283
283
  console.warn(`Invalid collapsible option. Fallback: ${collapsible}.`);
284
284
  merged.collapsible = collapsible;
285
285
  }
286
- for (const [key, value] of Object.entries(defaults.selector)) {
286
+ for (const [name, value] of Object.entries(defaults.selector)) {
287
+ const { selector } = merged;
288
+ const n = name;
287
289
  try {
288
- document.querySelector(value);
290
+ document.querySelector(selector[n]);
289
291
  } catch {
290
292
  console.warn(
291
- `Invalid ${key.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
293
+ `Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
292
294
  );
293
- merged.selector[key] = value;
295
+ selector[n] = value;
294
296
  }
295
297
  }
296
298
  return merged;
@@ -305,7 +307,7 @@ var Accordion = class _Accordion {
305
307
  }
306
308
  };
307
309
  function waitAnimationFinish(animation) {
308
- return ["idle", "finished"].includes(animation.playState) ? Promise.resolve() : new Promise(
310
+ return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
309
311
  (resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
310
312
  );
311
313
  }
@@ -313,7 +315,7 @@ function waitAnimationFinish(animation) {
313
315
  * Accordion
314
316
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
315
317
  *
316
- * @version 2.1.5
318
+ * @version 2.1.7
317
319
  * @author Yusuke Kamiyamane
318
320
  * @license MIT
319
321
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/accordion",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "WAI-ARIA compliant accordion pattern implementation in TypeScript",
5
5
  "keywords": [
6
6
  "a11y",
@@ -56,6 +56,6 @@
56
56
  "dependencies": {
57
57
  "@y14e/attribute-utils": "^2.0.12",
58
58
  "@y14e/button": "^1.0.8",
59
- "@y14e/roving-tabindex": "^3.3.1"
59
+ "@y14e/roving-tabindex": "^3.3.2"
60
60
  }
61
61
  }