@zag-js/aria-hidden 1.2.1 → 1.3.1

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.js CHANGED
@@ -22,7 +22,7 @@ var isIgnoredNode = (node) => {
22
22
  return node.matches("[data-live-announcer]");
23
23
  };
24
24
  var walkTreeOutside = (originalTarget, props) => {
25
- const { parentNode, markerName, controlAttribute, explicitBooleanValue } = props;
25
+ const { parentNode, markerName, controlAttribute} = props;
26
26
  const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
27
27
  markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap());
28
28
  const markerCounter = markerMap[markerName];
@@ -46,7 +46,7 @@ var walkTreeOutside = (originalTarget, props) => {
46
46
  try {
47
47
  if (isIgnoredNode(node)) return;
48
48
  const attr = node.getAttribute(controlAttribute);
49
- const alreadyHidden = explicitBooleanValue ? attr === "true" : attr !== null && attr !== "false";
49
+ const alreadyHidden = attr === "true" ;
50
50
  const counterValue = (counterMap.get(node) || 0) + 1;
51
51
  const markerValue = (markerCounter.get(node) || 0) + 1;
52
52
  counterMap.set(node, counterValue);
@@ -59,7 +59,7 @@ var walkTreeOutside = (originalTarget, props) => {
59
59
  node.setAttribute(markerName, "");
60
60
  }
61
61
  if (!alreadyHidden) {
62
- node.setAttribute(controlAttribute, explicitBooleanValue ? "true" : "");
62
+ node.setAttribute(controlAttribute, "true" );
63
63
  }
64
64
  } catch (e) {
65
65
  console.error("[zag-js > ariaHidden] cannot operate on ", node, e);
@@ -106,9 +106,7 @@ var hideOthers = (originalTarget, parentNode = getParentNode(originalTarget), ma
106
106
  return walkTreeOutside(originalTarget, {
107
107
  parentNode,
108
108
  markerName,
109
- controlAttribute: "aria-hidden",
110
- explicitBooleanValue: true
111
- });
109
+ controlAttribute: "aria-hidden"});
112
110
  };
113
111
 
114
112
  // src/index.ts
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ var isIgnoredNode = (node) => {
20
20
  return node.matches("[data-live-announcer]");
21
21
  };
22
22
  var walkTreeOutside = (originalTarget, props) => {
23
- const { parentNode, markerName, controlAttribute, explicitBooleanValue } = props;
23
+ const { parentNode, markerName, controlAttribute} = props;
24
24
  const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
25
25
  markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap());
26
26
  const markerCounter = markerMap[markerName];
@@ -44,7 +44,7 @@ var walkTreeOutside = (originalTarget, props) => {
44
44
  try {
45
45
  if (isIgnoredNode(node)) return;
46
46
  const attr = node.getAttribute(controlAttribute);
47
- const alreadyHidden = explicitBooleanValue ? attr === "true" : attr !== null && attr !== "false";
47
+ const alreadyHidden = attr === "true" ;
48
48
  const counterValue = (counterMap.get(node) || 0) + 1;
49
49
  const markerValue = (markerCounter.get(node) || 0) + 1;
50
50
  counterMap.set(node, counterValue);
@@ -57,7 +57,7 @@ var walkTreeOutside = (originalTarget, props) => {
57
57
  node.setAttribute(markerName, "");
58
58
  }
59
59
  if (!alreadyHidden) {
60
- node.setAttribute(controlAttribute, explicitBooleanValue ? "true" : "");
60
+ node.setAttribute(controlAttribute, "true" );
61
61
  }
62
62
  } catch (e) {
63
63
  console.error("[zag-js > ariaHidden] cannot operate on ", node, e);
@@ -104,9 +104,7 @@ var hideOthers = (originalTarget, parentNode = getParentNode(originalTarget), ma
104
104
  return walkTreeOutside(originalTarget, {
105
105
  parentNode,
106
106
  markerName,
107
- controlAttribute: "aria-hidden",
108
- explicitBooleanValue: true
109
- });
107
+ controlAttribute: "aria-hidden"});
110
108
  };
111
109
 
112
110
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/aria-hidden",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Hide targets from screen readers",
5
5
  "keywords": [
6
6
  "js",