@y14e/accordion 2.1.6 → 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 +3 -3
- package/dist/index.bundle.cjs +11 -10
- package/dist/index.bundle.js +11 -10
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/package.json +2 -2
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.
|
|
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.
|
|
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.
|
|
20
|
+
import { Accordion } from 'https://esm.unpkg.com/@y14e/accordion@2.1.7';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -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 (!
|
|
688
|
+
if (!DIRECTIONS.includes(direction)) {
|
|
688
689
|
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
689
690
|
direction = "both";
|
|
690
691
|
}
|
|
@@ -1009,16 +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 [
|
|
1013
|
+
for (const [name, value] of Object.entries(defaults.selector)) {
|
|
1013
1014
|
const { selector } = merged;
|
|
1014
|
-
const
|
|
1015
|
+
const n = name;
|
|
1015
1016
|
try {
|
|
1016
|
-
document.querySelector(selector[
|
|
1017
|
+
document.querySelector(selector[n]);
|
|
1017
1018
|
} catch {
|
|
1018
1019
|
console.warn(
|
|
1019
|
-
`Invalid ${
|
|
1020
|
+
`Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
1020
1021
|
);
|
|
1021
|
-
selector[
|
|
1022
|
+
selector[n] = value;
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1024
1025
|
return merged;
|
|
@@ -1033,7 +1034,7 @@ var Accordion = class _Accordion {
|
|
|
1033
1034
|
}
|
|
1034
1035
|
};
|
|
1035
1036
|
function waitAnimationFinish(animation) {
|
|
1036
|
-
return ["
|
|
1037
|
+
return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
|
|
1037
1038
|
(resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
|
|
1038
1039
|
);
|
|
1039
1040
|
}
|
|
@@ -1041,7 +1042,7 @@ function waitAnimationFinish(animation) {
|
|
|
1041
1042
|
* Accordion
|
|
1042
1043
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
1043
1044
|
*
|
|
1044
|
-
* @version 2.1.
|
|
1045
|
+
* @version 2.1.7
|
|
1045
1046
|
* @author Yusuke Kamiyamane
|
|
1046
1047
|
* @license MIT
|
|
1047
1048
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1066,7 +1067,7 @@ power-focusable/dist/index.js:
|
|
|
1066
1067
|
* High-precision focus management utility with full composed tree support.
|
|
1067
1068
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
1068
1069
|
*
|
|
1069
|
-
* @version 4.4.
|
|
1070
|
+
* @version 4.4.3
|
|
1070
1071
|
* @author Yusuke Kamiyamane
|
|
1071
1072
|
* @license MIT
|
|
1072
1073
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1090,7 +1091,7 @@ power-focusable/dist/index.js:
|
|
|
1090
1091
|
* Lightweight roving tabindex utility with fully focus management.
|
|
1091
1092
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
1092
1093
|
*
|
|
1093
|
-
* @version 3.3.
|
|
1094
|
+
* @version 3.3.2
|
|
1094
1095
|
* @author Yusuke Kamiyamane
|
|
1095
1096
|
* @license MIT
|
|
1096
1097
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -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 (!
|
|
686
|
+
if (!DIRECTIONS.includes(direction)) {
|
|
686
687
|
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
687
688
|
direction = "both";
|
|
688
689
|
}
|
|
@@ -1007,16 +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 [
|
|
1011
|
+
for (const [name, value] of Object.entries(defaults.selector)) {
|
|
1011
1012
|
const { selector } = merged;
|
|
1012
|
-
const
|
|
1013
|
+
const n = name;
|
|
1013
1014
|
try {
|
|
1014
|
-
document.querySelector(selector[
|
|
1015
|
+
document.querySelector(selector[n]);
|
|
1015
1016
|
} catch {
|
|
1016
1017
|
console.warn(
|
|
1017
|
-
`Invalid ${
|
|
1018
|
+
`Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
1018
1019
|
);
|
|
1019
|
-
selector[
|
|
1020
|
+
selector[n] = value;
|
|
1020
1021
|
}
|
|
1021
1022
|
}
|
|
1022
1023
|
return merged;
|
|
@@ -1031,7 +1032,7 @@ var Accordion = class _Accordion {
|
|
|
1031
1032
|
}
|
|
1032
1033
|
};
|
|
1033
1034
|
function waitAnimationFinish(animation) {
|
|
1034
|
-
return ["
|
|
1035
|
+
return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
|
|
1035
1036
|
(resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
|
|
1036
1037
|
);
|
|
1037
1038
|
}
|
|
@@ -1039,7 +1040,7 @@ function waitAnimationFinish(animation) {
|
|
|
1039
1040
|
* Accordion
|
|
1040
1041
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
1041
1042
|
*
|
|
1042
|
-
* @version 2.1.
|
|
1043
|
+
* @version 2.1.7
|
|
1043
1044
|
* @author Yusuke Kamiyamane
|
|
1044
1045
|
* @license MIT
|
|
1045
1046
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1064,7 +1065,7 @@ power-focusable/dist/index.js:
|
|
|
1064
1065
|
* High-precision focus management utility with full composed tree support.
|
|
1065
1066
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
1066
1067
|
*
|
|
1067
|
-
* @version 4.4.
|
|
1068
|
+
* @version 4.4.3
|
|
1068
1069
|
* @author Yusuke Kamiyamane
|
|
1069
1070
|
* @license MIT
|
|
1070
1071
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1088,7 +1089,7 @@ power-focusable/dist/index.js:
|
|
|
1088
1089
|
* Lightweight roving tabindex utility with fully focus management.
|
|
1089
1090
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
1090
1091
|
*
|
|
1091
|
-
* @version 3.3.
|
|
1092
|
+
* @version 3.3.2
|
|
1092
1093
|
* @author Yusuke Kamiyamane
|
|
1093
1094
|
* @license MIT
|
|
1094
1095
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -285,16 +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 [
|
|
288
|
+
for (const [name, value] of Object.entries(defaults.selector)) {
|
|
289
289
|
const { selector } = merged;
|
|
290
|
-
const
|
|
290
|
+
const n = name;
|
|
291
291
|
try {
|
|
292
|
-
document.querySelector(selector[
|
|
292
|
+
document.querySelector(selector[n]);
|
|
293
293
|
} catch {
|
|
294
294
|
console.warn(
|
|
295
|
-
`Invalid ${
|
|
295
|
+
`Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
296
296
|
);
|
|
297
|
-
selector[
|
|
297
|
+
selector[n] = value;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
return merged;
|
|
@@ -309,7 +309,7 @@ var Accordion = class _Accordion {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
function waitAnimationFinish(animation) {
|
|
312
|
-
return ["
|
|
312
|
+
return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
|
|
313
313
|
(resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
|
|
314
314
|
);
|
|
315
315
|
}
|
|
@@ -317,7 +317,7 @@ function waitAnimationFinish(animation) {
|
|
|
317
317
|
* Accordion
|
|
318
318
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
319
319
|
*
|
|
320
|
-
* @version 2.1.
|
|
320
|
+
* @version 2.1.7
|
|
321
321
|
* @author Yusuke Kamiyamane
|
|
322
322
|
* @license MIT
|
|
323
323
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -283,16 +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 [
|
|
286
|
+
for (const [name, value] of Object.entries(defaults.selector)) {
|
|
287
287
|
const { selector } = merged;
|
|
288
|
-
const
|
|
288
|
+
const n = name;
|
|
289
289
|
try {
|
|
290
|
-
document.querySelector(selector[
|
|
290
|
+
document.querySelector(selector[n]);
|
|
291
291
|
} catch {
|
|
292
292
|
console.warn(
|
|
293
|
-
`Invalid ${
|
|
293
|
+
`Invalid ${n.replace(/[A-Z]/g, (c) => ` ${c.toLowerCase()}`)} selector. Fallback: '${value}'.`
|
|
294
294
|
);
|
|
295
|
-
selector[
|
|
295
|
+
selector[n] = value;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
return merged;
|
|
@@ -307,7 +307,7 @@ var Accordion = class _Accordion {
|
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
309
|
function waitAnimationFinish(animation) {
|
|
310
|
-
return ["
|
|
310
|
+
return ["finished", "idle"].includes(animation.playState) ? Promise.resolve() : new Promise(
|
|
311
311
|
(resolve) => animation.addEventListener("finish", () => resolve(), { once: true })
|
|
312
312
|
);
|
|
313
313
|
}
|
|
@@ -315,7 +315,7 @@ function waitAnimationFinish(animation) {
|
|
|
315
315
|
* Accordion
|
|
316
316
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
317
317
|
*
|
|
318
|
-
* @version 2.1.
|
|
318
|
+
* @version 2.1.7
|
|
319
319
|
* @author Yusuke Kamiyamane
|
|
320
320
|
* @license MIT
|
|
321
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.
|
|
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.
|
|
59
|
+
"@y14e/roving-tabindex": "^3.3.2"
|
|
60
60
|
}
|
|
61
61
|
}
|