@y14e/accordion 2.0.7 → 2.0.9
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 +8 -8
- package/dist/index.bundle.js +8 -8
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/package.json +3 -3
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.0.
|
|
16
|
+
import { Accordion } from "https://esm.sh/@y14e/accordion@2.0.9";
|
|
17
17
|
// or
|
|
18
|
-
import { Accordion } from "https://cdn.jsdelivr.net/npm/@y14e/accordion@2.0.
|
|
18
|
+
import { Accordion } from "https://cdn.jsdelivr.net/npm/@y14e/accordion@2.0.9/+esm";
|
|
19
19
|
// or
|
|
20
|
-
import { Accordion } from "https://esm.unpkg.com/@y14e/accordion@2.0.
|
|
20
|
+
import { Accordion } from "https://esm.unpkg.com/@y14e/accordion@2.0.9";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// node_modules/@y14e/attribute-
|
|
3
|
+
// node_modules/@y14e/attribute-utils/dist/index.js
|
|
4
4
|
var DEFAULT_PARSER = (value) => value.split(/\s+/);
|
|
5
5
|
var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
|
|
6
6
|
function addAttributeToken(element, name, token, options = {}) {
|
|
@@ -917,7 +917,7 @@ function waitAnimationFinish(animation) {
|
|
|
917
917
|
* Accordion
|
|
918
918
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
919
919
|
*
|
|
920
|
-
* @version 2.0.
|
|
920
|
+
* @version 2.0.9
|
|
921
921
|
* @author Yusuke Kamiyamane
|
|
922
922
|
* @license MIT
|
|
923
923
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -925,15 +925,15 @@ function waitAnimationFinish(animation) {
|
|
|
925
925
|
*/
|
|
926
926
|
/*! Bundled license information:
|
|
927
927
|
|
|
928
|
-
@y14e/attribute-
|
|
928
|
+
@y14e/attribute-utils/dist/index.js:
|
|
929
929
|
(**
|
|
930
|
-
* Attribute
|
|
930
|
+
* Attribute Utils
|
|
931
931
|
*
|
|
932
|
-
* @version 2.0.
|
|
932
|
+
* @version 2.0.5
|
|
933
933
|
* @author Yusuke Kamiyamane
|
|
934
934
|
* @license MIT
|
|
935
935
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
936
|
-
* @see {@link https://github.com/y14e/attribute-
|
|
936
|
+
* @see {@link https://github.com/y14e/attribute-utils}
|
|
937
937
|
*)
|
|
938
938
|
|
|
939
939
|
power-focusable/dist/index.js:
|
|
@@ -942,7 +942,7 @@ power-focusable/dist/index.js:
|
|
|
942
942
|
* High-precision focus management utility with full composed tree support.
|
|
943
943
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
944
944
|
*
|
|
945
|
-
* @version 4.3.
|
|
945
|
+
* @version 4.3.26
|
|
946
946
|
* @author Yusuke Kamiyamane
|
|
947
947
|
* @license MIT
|
|
948
948
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -966,7 +966,7 @@ power-focusable/dist/index.js:
|
|
|
966
966
|
* Lightweight roving tabindex utility with fully focus management.
|
|
967
967
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
968
968
|
*
|
|
969
|
-
* @version 3.1.
|
|
969
|
+
* @version 3.1.23
|
|
970
970
|
* @author Yusuke Kamiyamane
|
|
971
971
|
* @license MIT
|
|
972
972
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/@y14e/attribute-
|
|
1
|
+
// node_modules/@y14e/attribute-utils/dist/index.js
|
|
2
2
|
var DEFAULT_PARSER = (value) => value.split(/\s+/);
|
|
3
3
|
var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
|
|
4
4
|
function addAttributeToken(element, name, token, options = {}) {
|
|
@@ -915,7 +915,7 @@ function waitAnimationFinish(animation) {
|
|
|
915
915
|
* Accordion
|
|
916
916
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
917
917
|
*
|
|
918
|
-
* @version 2.0.
|
|
918
|
+
* @version 2.0.9
|
|
919
919
|
* @author Yusuke Kamiyamane
|
|
920
920
|
* @license MIT
|
|
921
921
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -923,15 +923,15 @@ function waitAnimationFinish(animation) {
|
|
|
923
923
|
*/
|
|
924
924
|
/*! Bundled license information:
|
|
925
925
|
|
|
926
|
-
@y14e/attribute-
|
|
926
|
+
@y14e/attribute-utils/dist/index.js:
|
|
927
927
|
(**
|
|
928
|
-
* Attribute
|
|
928
|
+
* Attribute Utils
|
|
929
929
|
*
|
|
930
|
-
* @version 2.0.
|
|
930
|
+
* @version 2.0.5
|
|
931
931
|
* @author Yusuke Kamiyamane
|
|
932
932
|
* @license MIT
|
|
933
933
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
934
|
-
* @see {@link https://github.com/y14e/attribute-
|
|
934
|
+
* @see {@link https://github.com/y14e/attribute-utils}
|
|
935
935
|
*)
|
|
936
936
|
|
|
937
937
|
power-focusable/dist/index.js:
|
|
@@ -940,7 +940,7 @@ power-focusable/dist/index.js:
|
|
|
940
940
|
* High-precision focus management utility with full composed tree support.
|
|
941
941
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
942
942
|
*
|
|
943
|
-
* @version 4.3.
|
|
943
|
+
* @version 4.3.26
|
|
944
944
|
* @author Yusuke Kamiyamane
|
|
945
945
|
* @license MIT
|
|
946
946
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -964,7 +964,7 @@ power-focusable/dist/index.js:
|
|
|
964
964
|
* Lightweight roving tabindex utility with fully focus management.
|
|
965
965
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
966
966
|
*
|
|
967
|
-
* @version 3.1.
|
|
967
|
+
* @version 3.1.23
|
|
968
968
|
* @author Yusuke Kamiyamane
|
|
969
969
|
* @license MIT
|
|
970
970
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var utils = require('@y14e/attribute-utils');
|
|
4
4
|
var button = require('@y14e/button');
|
|
5
5
|
var rovingTabindex = require('@y14e/roving-tabindex');
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ function _interopNamespace(e) {
|
|
|
22
22
|
return Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var utils__namespace = /*#__PURE__*/_interopNamespace(utils);
|
|
26
26
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
var Accordion = class _Accordion {
|
|
@@ -118,7 +118,7 @@ var Accordion = class _Accordion {
|
|
|
118
118
|
});
|
|
119
119
|
this.#animationController?.abort();
|
|
120
120
|
this.#animationController = null;
|
|
121
|
-
|
|
121
|
+
utils__namespace.restoreAttributes([
|
|
122
122
|
...this.#triggerElements,
|
|
123
123
|
...this.#contentElements
|
|
124
124
|
]);
|
|
@@ -137,14 +137,14 @@ var Accordion = class _Accordion {
|
|
|
137
137
|
this.#toggle(trigger, true);
|
|
138
138
|
}
|
|
139
139
|
#initialize() {
|
|
140
|
-
|
|
140
|
+
utils__namespace.saveAttributes(this.#triggerElements, [
|
|
141
141
|
"aria-controls",
|
|
142
142
|
"aria-disabled",
|
|
143
143
|
"id",
|
|
144
144
|
"style",
|
|
145
145
|
"tabindex"
|
|
146
146
|
]);
|
|
147
|
-
|
|
147
|
+
utils__namespace.saveAttributes(this.#contentElements, [
|
|
148
148
|
"aria-labelledby",
|
|
149
149
|
"id",
|
|
150
150
|
"role"
|
|
@@ -158,7 +158,7 @@ var Accordion = class _Accordion {
|
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
content2.id ||= `accordion-content-${id}`;
|
|
161
|
-
|
|
161
|
+
utils__namespace.addAttributeToken(trigger2, "aria-controls", content2.id);
|
|
162
162
|
trigger2.setAttribute(
|
|
163
163
|
"aria-expanded",
|
|
164
164
|
String(trigger2.ariaExpanded === "true")
|
|
@@ -170,7 +170,7 @@ var Accordion = class _Accordion {
|
|
|
170
170
|
trigger2.style.setProperty("pointer-events", "none");
|
|
171
171
|
}
|
|
172
172
|
trigger2.addEventListener("click", this.#onTriggerClick, { signal });
|
|
173
|
-
|
|
173
|
+
utils__namespace.addAttributeToken(content2, "aria-labelledby", trigger2.id);
|
|
174
174
|
content2.setAttribute("role", "region");
|
|
175
175
|
content2.addEventListener("beforematch", this.#onContentBeforeMatch, {
|
|
176
176
|
signal
|
|
@@ -305,7 +305,7 @@ function waitAnimationFinish(animation) {
|
|
|
305
305
|
* Accordion
|
|
306
306
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
307
307
|
*
|
|
308
|
-
* @version 2.0.
|
|
308
|
+
* @version 2.0.9
|
|
309
309
|
* @author Yusuke Kamiyamane
|
|
310
310
|
* @license MIT
|
|
311
311
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as utils from '@y14e/attribute-utils';
|
|
2
2
|
import { Button } from '@y14e/button';
|
|
3
3
|
import { createRovingTabIndex } from '@y14e/roving-tabindex';
|
|
4
4
|
|
|
@@ -96,7 +96,7 @@ var Accordion = class _Accordion {
|
|
|
96
96
|
});
|
|
97
97
|
this.#animationController?.abort();
|
|
98
98
|
this.#animationController = null;
|
|
99
|
-
|
|
99
|
+
utils.restoreAttributes([
|
|
100
100
|
...this.#triggerElements,
|
|
101
101
|
...this.#contentElements
|
|
102
102
|
]);
|
|
@@ -115,14 +115,14 @@ var Accordion = class _Accordion {
|
|
|
115
115
|
this.#toggle(trigger, true);
|
|
116
116
|
}
|
|
117
117
|
#initialize() {
|
|
118
|
-
|
|
118
|
+
utils.saveAttributes(this.#triggerElements, [
|
|
119
119
|
"aria-controls",
|
|
120
120
|
"aria-disabled",
|
|
121
121
|
"id",
|
|
122
122
|
"style",
|
|
123
123
|
"tabindex"
|
|
124
124
|
]);
|
|
125
|
-
|
|
125
|
+
utils.saveAttributes(this.#contentElements, [
|
|
126
126
|
"aria-labelledby",
|
|
127
127
|
"id",
|
|
128
128
|
"role"
|
|
@@ -136,7 +136,7 @@ var Accordion = class _Accordion {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
content2.id ||= `accordion-content-${id}`;
|
|
139
|
-
|
|
139
|
+
utils.addAttributeToken(trigger2, "aria-controls", content2.id);
|
|
140
140
|
trigger2.setAttribute(
|
|
141
141
|
"aria-expanded",
|
|
142
142
|
String(trigger2.ariaExpanded === "true")
|
|
@@ -148,7 +148,7 @@ var Accordion = class _Accordion {
|
|
|
148
148
|
trigger2.style.setProperty("pointer-events", "none");
|
|
149
149
|
}
|
|
150
150
|
trigger2.addEventListener("click", this.#onTriggerClick, { signal });
|
|
151
|
-
|
|
151
|
+
utils.addAttributeToken(content2, "aria-labelledby", trigger2.id);
|
|
152
152
|
content2.setAttribute("role", "region");
|
|
153
153
|
content2.addEventListener("beforematch", this.#onContentBeforeMatch, {
|
|
154
154
|
signal
|
|
@@ -283,7 +283,7 @@ function waitAnimationFinish(animation) {
|
|
|
283
283
|
* Accordion
|
|
284
284
|
* WAI-ARIA compliant accordion pattern implementation in TypeScript.
|
|
285
285
|
*
|
|
286
|
-
* @version 2.0.
|
|
286
|
+
* @version 2.0.9
|
|
287
287
|
* @author Yusuke Kamiyamane
|
|
288
288
|
* @license MIT
|
|
289
289
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/accordion",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "WAI-ARIA compliant accordion pattern implementation in TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"esbuild": true
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@y14e/attribute-
|
|
57
|
+
"@y14e/attribute-utils": "^2.0.5",
|
|
58
58
|
"@y14e/button": "^1.0.8",
|
|
59
|
-
"@y14e/roving-tabindex": "^3.1.
|
|
59
|
+
"@y14e/roving-tabindex": "^3.1.23"
|
|
60
60
|
}
|
|
61
61
|
}
|