@zag-js/aria-hidden 0.0.0
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 +22 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +77 -0
- package/dist/index.mjs.map +7 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @zag-js/aria-hidden
|
|
2
|
+
|
|
3
|
+
Hide targets from screen readers
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
yarn add @zag-js/aria-hidden
|
|
9
|
+
# or
|
|
10
|
+
npm i @zag-js/aria-hidden
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Contribution
|
|
14
|
+
|
|
15
|
+
Yes please! See the
|
|
16
|
+
[contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md)
|
|
17
|
+
for details.
|
|
18
|
+
|
|
19
|
+
## Licence
|
|
20
|
+
|
|
21
|
+
This project is licensed under the terms of the
|
|
22
|
+
[MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB,CAAA;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,cAiGpD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
ariaHidden: () => ariaHidden
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(src_exports);
|
|
25
|
+
var map = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
function ariaHidden(options) {
|
|
27
|
+
var _a;
|
|
28
|
+
const { exclude, document: doc, root = doc.body } = options;
|
|
29
|
+
const win = (_a = doc.defaultView) != null ? _a : window;
|
|
30
|
+
const visibleNodes = new Set(exclude);
|
|
31
|
+
const hiddenNodes = /* @__PURE__ */ new Set();
|
|
32
|
+
const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
33
|
+
acceptNode(node2) {
|
|
34
|
+
if (node2 instanceof win.HTMLElement && node2.dataset.liveAnnouncer === "true") {
|
|
35
|
+
visibleNodes.add(node2);
|
|
36
|
+
}
|
|
37
|
+
if (visibleNodes.has(node2) || hiddenNodes.has(node2.parentElement)) {
|
|
38
|
+
return NodeFilter.FILTER_REJECT;
|
|
39
|
+
}
|
|
40
|
+
if (node2 instanceof win.HTMLElement && node2.getAttribute("role") === "row") {
|
|
41
|
+
return NodeFilter.FILTER_SKIP;
|
|
42
|
+
}
|
|
43
|
+
if (exclude.some((target) => node2.contains(target))) {
|
|
44
|
+
return NodeFilter.FILTER_SKIP;
|
|
45
|
+
}
|
|
46
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const hide = (node2) => {
|
|
50
|
+
var _a2;
|
|
51
|
+
let refCount = (_a2 = map.get(node2)) != null ? _a2 : 0;
|
|
52
|
+
if (node2.getAttribute("aria-hidden") === "true" && refCount === 0) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (refCount === 0) {
|
|
56
|
+
node2.setAttribute("aria-hidden", "true");
|
|
57
|
+
}
|
|
58
|
+
hiddenNodes.add(node2);
|
|
59
|
+
map.set(node2, refCount + 1);
|
|
60
|
+
};
|
|
61
|
+
let node = walker.nextNode();
|
|
62
|
+
while (node != null) {
|
|
63
|
+
hide(node);
|
|
64
|
+
node = walker.nextNode();
|
|
65
|
+
}
|
|
66
|
+
const observer = new win.MutationObserver((changes) => {
|
|
67
|
+
for (let change of changes) {
|
|
68
|
+
if (change.type !== "childList" || change.addedNodes.length === 0)
|
|
69
|
+
continue;
|
|
70
|
+
if (![...visibleNodes, ...hiddenNodes].some((node2) => node2.contains(change.target))) {
|
|
71
|
+
for (const node2 of change.addedNodes) {
|
|
72
|
+
if (node2 instanceof win.HTMLElement && node2.dataset.liveAnnouncer === "true") {
|
|
73
|
+
visibleNodes.add(node2);
|
|
74
|
+
} else if (node2 instanceof win.Element) {
|
|
75
|
+
hide(node2);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
82
|
+
return () => {
|
|
83
|
+
observer.disconnect();
|
|
84
|
+
for (let node2 of hiddenNodes) {
|
|
85
|
+
let count = map.get(node2);
|
|
86
|
+
if (count === 1) {
|
|
87
|
+
node2.removeAttribute("aria-hidden");
|
|
88
|
+
map.delete(node2);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (count !== void 0) {
|
|
92
|
+
map.set(node2, count - 1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Credits: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/overlays/src/ariaHideOutside.ts\n\nlet map = new WeakMap<Element, number>()\n\nexport type AriaHiddenOptions = {\n exclude: HTMLElement[]\n document: Document\n root?: HTMLElement\n}\n\nexport function ariaHidden(options: AriaHiddenOptions) {\n const { exclude, document: doc, root = doc.body } = options\n const win = doc.defaultView ?? window\n\n const visibleNodes = new Set<Element>(exclude)\n const hiddenNodes = new Set<Element>()\n\n const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n // If this node is a live announcer, add it to the set of nodes to keep visible.\n if (node instanceof win.HTMLElement && node.dataset.liveAnnouncer === \"true\") {\n visibleNodes.add(node)\n }\n\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive.\n if (visibleNodes.has(node as Element) || hiddenNodes.has(node.parentElement!)) {\n return NodeFilter.FILTER_REJECT\n }\n\n // VoiceOver on iOS has issues hiding elements with role=\"row\". Hide the cells inside instead.\n // https://bugs.webkit.org/show_bug.cgi?id=222623\n if (node instanceof win.HTMLElement && node.getAttribute(\"role\") === \"row\") {\n return NodeFilter.FILTER_SKIP\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n if (exclude.some((target) => node.contains(target))) {\n return NodeFilter.FILTER_SKIP\n }\n\n return NodeFilter.FILTER_ACCEPT\n },\n })\n\n const hide = (node: Element) => {\n let refCount = map.get(node) ?? 0\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute(\"aria-hidden\") === \"true\" && refCount === 0) {\n return\n }\n\n if (refCount === 0) {\n node.setAttribute(\"aria-hidden\", \"true\")\n }\n\n hiddenNodes.add(node)\n map.set(node, refCount + 1)\n }\n\n let node = walker.nextNode() as Element\n\n while (node != null) {\n hide(node)\n node = walker.nextNode() as Element\n }\n\n const observer = new win.MutationObserver((changes) => {\n for (let change of changes) {\n if (change.type !== \"childList\" || change.addedNodes.length === 0) continue\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some((node) => node.contains(change.target))) {\n //@ts-expect-error\n for (const node of change.addedNodes) {\n if (node instanceof win.HTMLElement && node.dataset.liveAnnouncer === \"true\") {\n visibleNodes.add(node)\n } else if (node instanceof win.Element) {\n hide(node)\n }\n }\n }\n }\n })\n\n observer.observe(root, { childList: true, subtree: true })\n\n return () => {\n observer.disconnect()\n\n for (let node of hiddenNodes) {\n let count = map.get(node)\n\n if (count === 1) {\n node.removeAttribute(\"aria-hidden\")\n map.delete(node)\n continue\n }\n\n if (count !== undefined) {\n map.set(node, count - 1)\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAI,MAAM,oBAAI,QAAyB;AAQhC,oBAAoB,SAA4B;AAVvD;AAWE,QAAM,EAAE,SAAS,UAAU,KAAK,OAAO,IAAI,SAAS;AACpD,QAAM,MAAM,UAAI,gBAAJ,YAAmB;AAE/B,QAAM,eAAe,IAAI,IAAa,OAAO;AAC7C,QAAM,cAAc,oBAAI,IAAa;AAErC,QAAM,SAAS,IAAI,iBAAiB,MAAM,WAAW,cAAc;AAAA,IACjE,WAAW,OAAM;AAEf,UAAI,iBAAgB,IAAI,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,KAAI;AAAA,UACX;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AAED,WAAS,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AAEzD,SAAO,MAAM;AACX,aAAS,WAAW;AAEpB,aAAS,SAAQ,aAAa;AAC5B,UAAI,QAAQ,IAAI,IAAI,KAAI;AAExB,UAAI,UAAU,GAAG;AACf,cAAK,gBAAgB,aAAa;AAClC,YAAI,OAAO,KAAI;AACf;AAAA,MACF;AAEA,UAAI,UAAU,QAAW;AACvB,YAAI,IAAI,OAAM,QAAQ,CAAC;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var map = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function ariaHidden(options) {
|
|
4
|
+
var _a;
|
|
5
|
+
const { exclude, document: doc, root = doc.body } = options;
|
|
6
|
+
const win = (_a = doc.defaultView) != null ? _a : window;
|
|
7
|
+
const visibleNodes = new Set(exclude);
|
|
8
|
+
const hiddenNodes = /* @__PURE__ */ new Set();
|
|
9
|
+
const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
10
|
+
acceptNode(node2) {
|
|
11
|
+
if (node2 instanceof win.HTMLElement && node2.dataset.liveAnnouncer === "true") {
|
|
12
|
+
visibleNodes.add(node2);
|
|
13
|
+
}
|
|
14
|
+
if (visibleNodes.has(node2) || hiddenNodes.has(node2.parentElement)) {
|
|
15
|
+
return NodeFilter.FILTER_REJECT;
|
|
16
|
+
}
|
|
17
|
+
if (node2 instanceof win.HTMLElement && node2.getAttribute("role") === "row") {
|
|
18
|
+
return NodeFilter.FILTER_SKIP;
|
|
19
|
+
}
|
|
20
|
+
if (exclude.some((target) => node2.contains(target))) {
|
|
21
|
+
return NodeFilter.FILTER_SKIP;
|
|
22
|
+
}
|
|
23
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const hide = (node2) => {
|
|
27
|
+
var _a2;
|
|
28
|
+
let refCount = (_a2 = map.get(node2)) != null ? _a2 : 0;
|
|
29
|
+
if (node2.getAttribute("aria-hidden") === "true" && refCount === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (refCount === 0) {
|
|
33
|
+
node2.setAttribute("aria-hidden", "true");
|
|
34
|
+
}
|
|
35
|
+
hiddenNodes.add(node2);
|
|
36
|
+
map.set(node2, refCount + 1);
|
|
37
|
+
};
|
|
38
|
+
let node = walker.nextNode();
|
|
39
|
+
while (node != null) {
|
|
40
|
+
hide(node);
|
|
41
|
+
node = walker.nextNode();
|
|
42
|
+
}
|
|
43
|
+
const observer = new win.MutationObserver((changes) => {
|
|
44
|
+
for (let change of changes) {
|
|
45
|
+
if (change.type !== "childList" || change.addedNodes.length === 0)
|
|
46
|
+
continue;
|
|
47
|
+
if (![...visibleNodes, ...hiddenNodes].some((node2) => node2.contains(change.target))) {
|
|
48
|
+
for (const node2 of change.addedNodes) {
|
|
49
|
+
if (node2 instanceof win.HTMLElement && node2.dataset.liveAnnouncer === "true") {
|
|
50
|
+
visibleNodes.add(node2);
|
|
51
|
+
} else if (node2 instanceof win.Element) {
|
|
52
|
+
hide(node2);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
59
|
+
return () => {
|
|
60
|
+
observer.disconnect();
|
|
61
|
+
for (let node2 of hiddenNodes) {
|
|
62
|
+
let count = map.get(node2);
|
|
63
|
+
if (count === 1) {
|
|
64
|
+
node2.removeAttribute("aria-hidden");
|
|
65
|
+
map.delete(node2);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (count !== void 0) {
|
|
69
|
+
map.set(node2, count - 1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
ariaHidden
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Credits: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/overlays/src/ariaHideOutside.ts\n\nlet map = new WeakMap<Element, number>()\n\nexport type AriaHiddenOptions = {\n exclude: HTMLElement[]\n document: Document\n root?: HTMLElement\n}\n\nexport function ariaHidden(options: AriaHiddenOptions) {\n const { exclude, document: doc, root = doc.body } = options\n const win = doc.defaultView ?? window\n\n const visibleNodes = new Set<Element>(exclude)\n const hiddenNodes = new Set<Element>()\n\n const walker = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n // If this node is a live announcer, add it to the set of nodes to keep visible.\n if (node instanceof win.HTMLElement && node.dataset.liveAnnouncer === \"true\") {\n visibleNodes.add(node)\n }\n\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive.\n if (visibleNodes.has(node as Element) || hiddenNodes.has(node.parentElement!)) {\n return NodeFilter.FILTER_REJECT\n }\n\n // VoiceOver on iOS has issues hiding elements with role=\"row\". Hide the cells inside instead.\n // https://bugs.webkit.org/show_bug.cgi?id=222623\n if (node instanceof win.HTMLElement && node.getAttribute(\"role\") === \"row\") {\n return NodeFilter.FILTER_SKIP\n }\n\n // Skip this node but continue to children if one of the targets is inside the node.\n if (exclude.some((target) => node.contains(target))) {\n return NodeFilter.FILTER_SKIP\n }\n\n return NodeFilter.FILTER_ACCEPT\n },\n })\n\n const hide = (node: Element) => {\n let refCount = map.get(node) ?? 0\n\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (node.getAttribute(\"aria-hidden\") === \"true\" && refCount === 0) {\n return\n }\n\n if (refCount === 0) {\n node.setAttribute(\"aria-hidden\", \"true\")\n }\n\n hiddenNodes.add(node)\n map.set(node, refCount + 1)\n }\n\n let node = walker.nextNode() as Element\n\n while (node != null) {\n hide(node)\n node = walker.nextNode() as Element\n }\n\n const observer = new win.MutationObserver((changes) => {\n for (let change of changes) {\n if (change.type !== \"childList\" || change.addedNodes.length === 0) continue\n\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![...visibleNodes, ...hiddenNodes].some((node) => node.contains(change.target))) {\n //@ts-expect-error\n for (const node of change.addedNodes) {\n if (node instanceof win.HTMLElement && node.dataset.liveAnnouncer === \"true\") {\n visibleNodes.add(node)\n } else if (node instanceof win.Element) {\n hide(node)\n }\n }\n }\n }\n })\n\n observer.observe(root, { childList: true, subtree: true })\n\n return () => {\n observer.disconnect()\n\n for (let node of hiddenNodes) {\n let count = map.get(node)\n\n if (count === 1) {\n node.removeAttribute(\"aria-hidden\")\n map.delete(node)\n continue\n }\n\n if (count !== undefined) {\n map.set(node, count - 1)\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAEA,IAAI,MAAM,oBAAI,QAAyB;AAQhC,oBAAoB,SAA4B;AAVvD;AAWE,QAAM,EAAE,SAAS,UAAU,KAAK,OAAO,IAAI,SAAS;AACpD,QAAM,MAAM,UAAI,gBAAJ,YAAmB;AAE/B,QAAM,eAAe,IAAI,IAAa,OAAO;AAC7C,QAAM,cAAc,oBAAI,IAAa;AAErC,QAAM,SAAS,IAAI,iBAAiB,MAAM,WAAW,cAAc;AAAA,IACjE,WAAW,OAAM;AAEf,UAAI,iBAAgB,IAAI,eAAe,MAAK,QAAQ,kBAAkB,QAAQ;AAC5E,qBAAa,IAAI,KAAI;AAAA,MACvB;AAIA,UAAI,aAAa,IAAI,KAAe,KAAK,YAAY,IAAI,MAAK,aAAc,GAAG;AAC7E,eAAO,WAAW;AAAA,M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EpB,aAAS,SAAQ,aAAa;AAC5B,UAAI,QAAQ,IAAI,IAAI,KAAI;AAExB,UAAI,UAAU,GAAG;AACf,cAAK,gBAAgB,aAAa;AAClC,YAAI,OAAO,KAAI;AACf;AAAA,MACF;AAEA,UAAI,UAAU,QAAW;AACvB,YAAI,IAAI,OAAM,QAAQ,CAAC;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zag-js/aria-hidden",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Hide targets from screen readers",
|
|
5
|
+
"keywords": ["js", "utils", "aria-hidden"],
|
|
6
|
+
"author": "Segun Adebayo <sage@adebayosegun.com>",
|
|
7
|
+
"homepage": "https://github.com/chakra-ui/zag#readme",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.mjs",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/aria-hidden",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"files": ["dist/**/*"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build:fast": "yarn zag build",
|
|
17
|
+
"start": "yarn zag build --watch",
|
|
18
|
+
"build": "yarn zag build --prod",
|
|
19
|
+
"test": "jest --config ../../../jest.config.js --rootDir tests",
|
|
20
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
21
|
+
"test:ci": "yarn test --ci --runInBand --updateSnapshot",
|
|
22
|
+
"test:watch": "yarn test --watchAll"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/chakra-ui/zag/issues"
|
|
29
|
+
}
|
|
30
|
+
}
|