@zag-js/aria-hidden 0.10.2 → 0.10.4
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/dist/index.d.ts +3 -4
- package/dist/index.js +10 -32
- package/dist/index.mjs +6 -7
- package/package.json +3 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
type AriaHiddenOptions = {
|
|
1
|
+
export type AriaHiddenOptions = {
|
|
2
2
|
rootEl?: HTMLElement;
|
|
3
3
|
defer?: boolean;
|
|
4
4
|
};
|
|
5
5
|
type MaybeElement = HTMLElement | null;
|
|
6
6
|
type Targets = Array<MaybeElement>;
|
|
7
7
|
type TargetsOrFn = Targets | (() => Targets);
|
|
8
|
-
declare function ariaHidden(targetsOrFn: TargetsOrFn, options?: AriaHiddenOptions): () => void;
|
|
9
|
-
|
|
10
|
-
export { AriaHiddenOptions, ariaHidden };
|
|
8
|
+
export declare function ariaHidden(targetsOrFn: TargetsOrFn, options?: AriaHiddenOptions): () => void;
|
|
9
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
19
4
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
var import_dom_query = require("@zag-js/dom-query");
|
|
27
|
-
var refCountMap = /* @__PURE__ */ new WeakMap();
|
|
28
|
-
var observerStack = [];
|
|
5
|
+
const domQuery = require('@zag-js/dom-query');
|
|
6
|
+
|
|
7
|
+
const refCountMap = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
const observerStack = [];
|
|
29
9
|
function ariaHiddenImpl(targets, options = {}) {
|
|
30
10
|
const { rootEl } = options;
|
|
31
11
|
const exclude = targets.filter(Boolean);
|
|
@@ -134,7 +114,7 @@ function ariaHiddenImpl(targets, options = {}) {
|
|
|
134
114
|
}
|
|
135
115
|
function ariaHidden(targetsOrFn, options = {}) {
|
|
136
116
|
const { defer } = options;
|
|
137
|
-
const func = defer ?
|
|
117
|
+
const func = defer ? domQuery.raf : (v) => v();
|
|
138
118
|
const cleanups = [];
|
|
139
119
|
cleanups.push(
|
|
140
120
|
func(() => {
|
|
@@ -146,7 +126,5 @@ function ariaHidden(targetsOrFn, options = {}) {
|
|
|
146
126
|
cleanups.forEach((fn) => fn?.());
|
|
147
127
|
};
|
|
148
128
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
ariaHidden
|
|
152
|
-
});
|
|
129
|
+
|
|
130
|
+
exports.ariaHidden = ariaHidden;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { raf } from '@zag-js/dom-query';
|
|
2
|
+
|
|
3
|
+
const refCountMap = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
const observerStack = [];
|
|
5
5
|
function ariaHiddenImpl(targets, options = {}) {
|
|
6
6
|
const { rootEl } = options;
|
|
7
7
|
const exclude = targets.filter(Boolean);
|
|
@@ -122,6 +122,5 @@ function ariaHidden(targetsOrFn, options = {}) {
|
|
|
122
122
|
cleanups.forEach((fn) => fn?.());
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
125
|
+
|
|
126
|
+
export { ariaHidden };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/aria-hidden",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Hide targets from screen readers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"clean-package": "../../../clean-package.config.json",
|
|
26
26
|
"main": "dist/index.js",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@zag-js/dom-query": "0.10.
|
|
28
|
+
"@zag-js/dom-query": "0.10.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"clean-package": "2.2.0"
|
|
@@ -41,9 +41,7 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build
|
|
45
|
-
"start": "pnpm build --watch",
|
|
46
|
-
"build": "tsup src --dts",
|
|
44
|
+
"build": "vite build -c ../../../vite.config.ts",
|
|
47
45
|
"test": "jest --config ../../../jest.config.js --rootDir tests",
|
|
48
46
|
"lint": "eslint src --ext .ts,.tsx",
|
|
49
47
|
"test-ci": "pnpm test --ci --runInBand -u",
|