@zag-js/aria-hidden
Advanced tools
Comparing version 0.0.0-dev-20220427162539 to 0.0.0-dev-20220714091855
@@ -1,2 +0,3 @@ | ||
export declare function ariaHidden(targets: Array<HTMLElement | null>, rootEl?: HTMLElement): () => void; | ||
//# sourceMappingURL=index.d.ts.map | ||
declare function ariaHidden(targets: Array<HTMLElement | null>, rootEl?: HTMLElement): (() => void) | undefined; | ||
export { ariaHidden }; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
@@ -30,3 +31,2 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
function ariaHidden(targets, rootEl) { | ||
var _a; | ||
const exclude = targets.filter(Boolean); | ||
@@ -36,6 +36,6 @@ if (exclude.length === 0) | ||
const doc = exclude[0].ownerDocument || document; | ||
const win = (_a = doc.defaultView) != null ? _a : window; | ||
const win = doc.defaultView ?? window; | ||
const visibleNodes = new Set(exclude); | ||
const hiddenNodes = /* @__PURE__ */ new Set(); | ||
const root = rootEl != null ? rootEl : doc.body; | ||
const root = rootEl ?? doc.body; | ||
const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { | ||
@@ -59,4 +59,3 @@ acceptNode(node2) { | ||
const hide = (node2) => { | ||
var _a2; | ||
let refCount = (_a2 = elementCountMap.get(node2)) != null ? _a2 : 0; | ||
let refCount = elementCountMap.get(node2) ?? 0; | ||
if (node2.getAttribute("aria-hidden") === "true" && refCount === 0) { | ||
@@ -107,2 +106,5 @@ return; | ||
} | ||
//# sourceMappingURL=index.js.map | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
ariaHidden | ||
}); |
{ | ||
"name": "@zag-js/aria-hidden", | ||
"version": "0.0.0-dev-20220427162539", | ||
"version": "0.0.0-dev-20220714091855", | ||
"description": "Hide targets from screen readers", | ||
@@ -21,11 +21,2 @@ "keywords": [ | ||
], | ||
"scripts": { | ||
"build:fast": "yarn zag build", | ||
"start": "yarn zag build --watch", | ||
"build": "yarn zag build --prod", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test:ci": "yarn test --ci --runInBand --updateSnapshot", | ||
"test:watch": "yarn test --watchAll" | ||
}, | ||
"publishConfig": { | ||
@@ -36,3 +27,12 @@ "access": "public" | ||
"url": "https://github.com/chakra-ui/zag/issues" | ||
}, | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test-ci": "pnpm test --ci --runInBand -u", | ||
"test-watch": "pnpm test --watchAll" | ||
} | ||
} | ||
} |
@@ -15,9 +15,6 @@ # @zag-js/aria-hidden | ||
Yes please! See the | ||
[contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) | ||
for details. | ||
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details. | ||
## Licence | ||
This project is licensed under the terms of the | ||
[MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE). | ||
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE). |
Sorry, the diff of this file is not supported yet
8739
6
20