@zag-js/aria-hidden
Advanced tools
Comparing version 0.1.4 to 0.2.0
@@ -31,2 +31,3 @@ "use strict"; | ||
function ariaHidden(targets, rootEl) { | ||
var _a; | ||
const exclude = targets.filter(Boolean); | ||
@@ -36,6 +37,6 @@ if (exclude.length === 0) | ||
const doc = exclude[0].ownerDocument || document; | ||
const win = doc.defaultView ?? window; | ||
const win = (_a = doc.defaultView) != null ? _a : window; | ||
const visibleNodes = new Set(exclude); | ||
const hiddenNodes = /* @__PURE__ */ new Set(); | ||
const root = rootEl ?? doc.body; | ||
const root = rootEl != null ? rootEl : doc.body; | ||
const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { | ||
@@ -59,3 +60,4 @@ acceptNode(node2) { | ||
const hide = (node2) => { | ||
let refCount = elementCountMap.get(node2) ?? 0; | ||
var _a2; | ||
let refCount = (_a2 = elementCountMap.get(node2)) != null ? _a2 : 0; | ||
if (node2.getAttribute("aria-hidden") === "true" && refCount === 0) { | ||
@@ -62,0 +64,0 @@ return; |
{ | ||
"name": "@zag-js/aria-hidden", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Hide targets from screen readers", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8878
192