@y14e/disclosure 1.3.15 → 1.3.16
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 +4 -4
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ npm i @y14e/disclosure
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// npm
|
|
13
|
-
import Disclosure from '@y14e/disclosure@1.3.
|
|
13
|
+
import Disclosure from '@y14e/disclosure@1.3.16';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import Disclosure from 'https://esm.sh/@y14e/disclosure@1.3.
|
|
16
|
+
import Disclosure from 'https://esm.sh/@y14e/disclosure@1.3.16';
|
|
17
17
|
// or
|
|
18
|
-
import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure@1.3.
|
|
18
|
+
import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure@1.3.16/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure@1.3.
|
|
20
|
+
import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure@1.3.16';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.cjs
CHANGED
|
@@ -251,6 +251,16 @@ function getComposedChildren(node) {
|
|
|
251
251
|
}
|
|
252
252
|
return getChildren(node);
|
|
253
253
|
}
|
|
254
|
+
function focusElement(element) {
|
|
255
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
256
|
+
}
|
|
257
|
+
function getActiveElement() {
|
|
258
|
+
let current = document.activeElement;
|
|
259
|
+
while (current?.shadowRoot?.activeElement) {
|
|
260
|
+
current = current.shadowRoot.activeElement;
|
|
261
|
+
}
|
|
262
|
+
return current;
|
|
263
|
+
}
|
|
254
264
|
function getChildren(node) {
|
|
255
265
|
const elements = [];
|
|
256
266
|
for (let child = node.firstElementChild; child; child = child.nextElementSibling) {
|
|
@@ -509,16 +519,6 @@ var RovingTabIndex = class {
|
|
|
509
519
|
});
|
|
510
520
|
}
|
|
511
521
|
};
|
|
512
|
-
function focusElement(element) {
|
|
513
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
514
|
-
}
|
|
515
|
-
function getActiveElement() {
|
|
516
|
-
let current = document.activeElement;
|
|
517
|
-
while (current?.shadowRoot?.activeElement) {
|
|
518
|
-
current = current.shadowRoot.activeElement;
|
|
519
|
-
}
|
|
520
|
-
return current;
|
|
521
|
-
}
|
|
522
522
|
|
|
523
523
|
// src/index.ts
|
|
524
524
|
var Disclosure = class _Disclosure {
|
|
@@ -799,7 +799,7 @@ function waitAnimationFinish(animation) {
|
|
|
799
799
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
800
800
|
* Using the <details> and <summary> element.
|
|
801
801
|
*
|
|
802
|
-
* @version 1.3.
|
|
802
|
+
* @version 1.3.16
|
|
803
803
|
* @author Yusuke Kamiyamane
|
|
804
804
|
* @license MIT
|
|
805
805
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -813,7 +813,7 @@ function waitAnimationFinish(animation) {
|
|
|
813
813
|
* Lightweight roving tabindex utility with fully focus management.
|
|
814
814
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
815
815
|
*
|
|
816
|
-
* @version 3.0.
|
|
816
|
+
* @version 3.0.8
|
|
817
817
|
* @author Yusuke Kamiyamane
|
|
818
818
|
* @license MIT
|
|
819
819
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -249,6 +249,16 @@ function getComposedChildren(node) {
|
|
|
249
249
|
}
|
|
250
250
|
return getChildren(node);
|
|
251
251
|
}
|
|
252
|
+
function focusElement(element) {
|
|
253
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
254
|
+
}
|
|
255
|
+
function getActiveElement() {
|
|
256
|
+
let current = document.activeElement;
|
|
257
|
+
while (current?.shadowRoot?.activeElement) {
|
|
258
|
+
current = current.shadowRoot.activeElement;
|
|
259
|
+
}
|
|
260
|
+
return current;
|
|
261
|
+
}
|
|
252
262
|
function getChildren(node) {
|
|
253
263
|
const elements = [];
|
|
254
264
|
for (let child = node.firstElementChild; child; child = child.nextElementSibling) {
|
|
@@ -507,16 +517,6 @@ var RovingTabIndex = class {
|
|
|
507
517
|
});
|
|
508
518
|
}
|
|
509
519
|
};
|
|
510
|
-
function focusElement(element) {
|
|
511
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
512
|
-
}
|
|
513
|
-
function getActiveElement() {
|
|
514
|
-
let current = document.activeElement;
|
|
515
|
-
while (current?.shadowRoot?.activeElement) {
|
|
516
|
-
current = current.shadowRoot.activeElement;
|
|
517
|
-
}
|
|
518
|
-
return current;
|
|
519
|
-
}
|
|
520
520
|
|
|
521
521
|
// src/index.ts
|
|
522
522
|
var Disclosure = class _Disclosure {
|
|
@@ -797,7 +797,7 @@ function waitAnimationFinish(animation) {
|
|
|
797
797
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
798
798
|
* Using the <details> and <summary> element.
|
|
799
799
|
*
|
|
800
|
-
* @version 1.3.
|
|
800
|
+
* @version 1.3.16
|
|
801
801
|
* @author Yusuke Kamiyamane
|
|
802
802
|
* @license MIT
|
|
803
803
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -811,7 +811,7 @@ function waitAnimationFinish(animation) {
|
|
|
811
811
|
* Lightweight roving tabindex utility with fully focus management.
|
|
812
812
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
813
813
|
*
|
|
814
|
-
* @version 3.0.
|
|
814
|
+
* @version 3.0.8
|
|
815
815
|
* @author Yusuke Kamiyamane
|
|
816
816
|
* @license MIT
|
|
817
817
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/disclosure",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/y14e/disclosure#readme",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@y14e/roving-tabindex": "^3.0.
|
|
46
|
+
"@y14e/roving-tabindex": "^3.0.8",
|
|
47
47
|
"bun-types": "latest",
|
|
48
48
|
"tsup": "^8.0.0",
|
|
49
49
|
"typescript": "^5.6.0",
|