@zag-js/focus-visible 0.0.0-dev-20220603082742

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 ADDED
@@ -0,0 +1,22 @@
1
+ # @zag-js/focus-visible
2
+
3
+
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ yarn add @zag-js/focus-visible
9
+ # or
10
+ npm i @zag-js/focus-visible
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).
@@ -0,0 +1,4 @@
1
+ declare type FocusVisibleCallback = (isFocusVisible: boolean) => void;
2
+ export declare function trackFocusVisible(fn: FocusVisibleCallback): () => boolean;
3
+ export {};
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,aAAK,oBAAoB,GAAG,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAA;AAkG7D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,oBAAoB,iBAQzD"}
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
+ trackFocusVisible: () => trackFocusVisible
23
+ });
24
+ module.exports = __toCommonJS(src_exports);
25
+ var hasSetup = false;
26
+ var modality = null;
27
+ var hasEventBeforeFocus = false;
28
+ var handlers = /* @__PURE__ */ new Set();
29
+ var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
30
+ function isValidKey(event) {
31
+ return !(event.metaKey || !isMac && event.altKey || event.ctrlKey);
32
+ }
33
+ function trigger(modality2, event) {
34
+ handlers.forEach((handler) => handler(modality2, event));
35
+ }
36
+ function onKeyboardEvent(event) {
37
+ hasEventBeforeFocus = true;
38
+ if (isValidKey(event)) {
39
+ modality = "keyboard";
40
+ trigger("keyboard", event);
41
+ }
42
+ }
43
+ function onPointerEvent(event) {
44
+ modality = "pointer";
45
+ if (event.type === "mousedown" || event.type === "pointerdown") {
46
+ hasEventBeforeFocus = true;
47
+ trigger("pointer", event);
48
+ }
49
+ }
50
+ function onWindowFocus(event) {
51
+ if (event.target === window || event.target === document) {
52
+ return;
53
+ }
54
+ if (!hasEventBeforeFocus) {
55
+ modality = "keyboard";
56
+ trigger("keyboard", event);
57
+ }
58
+ hasEventBeforeFocus = false;
59
+ }
60
+ function onWindowBlur() {
61
+ hasEventBeforeFocus = false;
62
+ }
63
+ function isFocusVisible() {
64
+ return modality !== "pointer";
65
+ }
66
+ function setupGlobalFocusEvents() {
67
+ if (typeof window === "undefined" || hasSetup) {
68
+ return;
69
+ }
70
+ const { focus } = HTMLElement.prototype;
71
+ HTMLElement.prototype.focus = function focusElement(...args) {
72
+ hasEventBeforeFocus = true;
73
+ focus.apply(this, args);
74
+ };
75
+ document.addEventListener("keydown", onKeyboardEvent, true);
76
+ document.addEventListener("keyup", onKeyboardEvent, true);
77
+ window.addEventListener("focus", onWindowFocus, true);
78
+ window.addEventListener("blur", onWindowBlur, false);
79
+ if (typeof PointerEvent !== "undefined") {
80
+ document.addEventListener("pointerdown", onPointerEvent, true);
81
+ document.addEventListener("pointermove", onPointerEvent, true);
82
+ document.addEventListener("pointerup", onPointerEvent, true);
83
+ } else {
84
+ document.addEventListener("mousedown", onPointerEvent, true);
85
+ document.addEventListener("mousemove", onPointerEvent, true);
86
+ document.addEventListener("mouseup", onPointerEvent, true);
87
+ }
88
+ hasSetup = true;
89
+ }
90
+ function trackFocusVisible(fn) {
91
+ setupGlobalFocusEvents();
92
+ fn(isFocusVisible());
93
+ const handler = () => fn(isFocusVisible());
94
+ handlers.add(handler);
95
+ return () => handlers.delete(handler);
96
+ }
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["type Modality = \"keyboard\" | \"pointer\"\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent\ntype Handler = (modality: Modality, e: HandlerEvent) => void\ntype FocusVisibleCallback = (isFocusVisible: boolean) => void\n\nlet hasSetup = false\nlet modality: Modality | null = null\nlet hasEventBeforeFocus = false\n\nconst handlers = new Set<Handler>()\n\nconst isMac = typeof window !== \"undefined\" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false\n\nfunction isValidKey(event: KeyboardEvent) {\n return !(event.metaKey || (!isMac && event.altKey) || event.ctrlKey)\n}\n\nfunction trigger(modality: Modality, event: HandlerEvent) {\n handlers.forEach((handler) => handler(modality, event))\n}\n\nfunction onKeyboardEvent(event: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(event)) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n}\n\nfunction onPointerEvent(event: PointerEvent | MouseEvent) {\n modality = \"pointer\"\n if (event.type === \"mousedown\" || event.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n trigger(\"pointer\", event)\n }\n}\n\nfunction onWindowFocus(event: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n if (event.target === window || event.target === document) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to keyboard modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n\n hasEventBeforeFocus = false\n}\n\nfunction onWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n}\n\nfunction isFocusVisible() {\n return modality !== \"pointer\"\n}\n\nfunction setupGlobalFocusEvents() {\n if (typeof window === \"undefined\" || hasSetup) {\n return\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n const { focus } = HTMLElement.prototype\n HTMLElement.prototype.focus = function focusElement(...args) {\n hasEventBeforeFocus = true\n focus.apply(this, args)\n }\n\n document.addEventListener(\"keydown\", onKeyboardEvent, true)\n document.addEventListener(\"keyup\", onKeyboardEvent, true)\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n window.addEventListener(\"focus\", onWindowFocus, true)\n window.addEventListener(\"blur\", onWindowBlur, false)\n\n if (typeof PointerEvent !== \"undefined\") {\n document.addEventListener(\"pointerdown\", onPointerEvent, true)\n document.addEventListener(\"pointermove\", onPointerEvent, true)\n document.addEventListener(\"pointerup\", onPointerEvent, true)\n } else {\n document.addEventListener(\"mousedown\", onPointerEvent, true)\n document.addEventListener(\"mousemove\", onPointerEvent, true)\n document.addEventListener(\"mouseup\", onPointerEvent, true)\n }\n\n hasSetup = true\n}\n\nexport function trackFocusVisible(fn: FocusVisibleCallback) {\n setupGlobalFocusEvents()\n\n fn(isFocusVisible())\n const handler = () => fn(isFocusVisible())\n\n handlers.add(handler)\n return () => handlers.delete(handler)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAI,WAAW;AACf,IAAI,WAA4B;AAChC,IAAI,sBAAsB;AAE1B,IAAM,WAAW,oBAAI,IAAa;AAElC,IAAM,QAAQ,OAAO,WAAW,eAAe,OAAO,aAAa,OAAO,OAAO,KAAK,OAAO,UAAU,QAAQ,IAAI;AAEnH,oBAAoB,OAAsB;AACxC,SAAO,CAAE,OAAM,WAAY,CAAC,SAAS,MAAM,UAAW,MAAM;AAC9D;AAEA,iBAAiB,WAAoB,OAAqB;AACxD,WAAS,QAAQ,CAAC,YAAY,QAAQ,WAAU,KAAK,CAAC;AACxD;AAEA,yBAAyB,OAAsB;AAC7C,wBAAsB;AACtB,MAAI,WAAW,KAAK,GAAG;AACrB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AACF;AAEA,wBAAwB,OAAkC;AACxD,aAAW;AACX,MAAI,MAAM,SAAS,eAAe,MAAM,SAAS,eAAe;AAC9D,0BAAsB;AACtB,YAAQ,WAAW,KAAK;AAAA,EAC1B;AACF;AAEA,uBAAuB,OAAmB;AAIxC,MAAI,MAAM,WAAW,UAAU,MAAM,WAAW,UAAU;AACxD;AAAA,EACF;AAIA,MAAI,CAAC,qBAAqB;AACxB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AAEA,wBAAsB;AACxB;AAEA,wBAAwB;AAGtB,wBAAsB;AACxB;AAEA,0BAA0B;AACxB,SAAO,aAAa;AACtB;AAEA,kCAAkC;AAChC,MAAI,OAAO,WAAW,eAAe,UAAU;AAC7C;AAAA,EACF;AAMA,QAAM,EAAE,UAAU,YAAY;AAC9B,cAAY,UAAU,QAAQ,yBAAyB,MAAM;AAC3D,0BAAsB;AACtB,UAAM,MAAM,MAAM,IAAI;AAAA,EACxB;AAEA,WAAS,iBAAiB,WAAW,iBAAiB,IAAI;AAC1D,WAAS,iBAAiB,SAAS,iBAAiB,IAAI;AAIxD,SAAO,iBAAiB,SAAS,eAAe,IAAI;AACpD,SAAO,iBAAiB,QAAQ,cAAc,KAAK;AAEnD,MAAI,OAAO,iBAAiB,aAAa;AACvC,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAAA,EAC7D,OAAO;AACL,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,WAAW,gBAAgB,IAAI;AAAA,EAC3D;AAEA,aAAW;AACb;AAEO,2BAA2B,IAA0B;AAC1D,yBAAuB;AAEvB,KAAG,eAAe,CAAC;AACnB,QAAM,UAAU,MAAM,GAAG,eAAe,CAAC;AAEzC,WAAS,IAAI,OAAO;AACpB,SAAO,MAAM,SAAS,OAAO,OAAO;AACtC;",
6
+ "names": []
7
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,77 @@
1
+ // src/index.ts
2
+ var hasSetup = false;
3
+ var modality = null;
4
+ var hasEventBeforeFocus = false;
5
+ var handlers = /* @__PURE__ */ new Set();
6
+ var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
7
+ function isValidKey(event) {
8
+ return !(event.metaKey || !isMac && event.altKey || event.ctrlKey);
9
+ }
10
+ function trigger(modality2, event) {
11
+ handlers.forEach((handler) => handler(modality2, event));
12
+ }
13
+ function onKeyboardEvent(event) {
14
+ hasEventBeforeFocus = true;
15
+ if (isValidKey(event)) {
16
+ modality = "keyboard";
17
+ trigger("keyboard", event);
18
+ }
19
+ }
20
+ function onPointerEvent(event) {
21
+ modality = "pointer";
22
+ if (event.type === "mousedown" || event.type === "pointerdown") {
23
+ hasEventBeforeFocus = true;
24
+ trigger("pointer", event);
25
+ }
26
+ }
27
+ function onWindowFocus(event) {
28
+ if (event.target === window || event.target === document) {
29
+ return;
30
+ }
31
+ if (!hasEventBeforeFocus) {
32
+ modality = "keyboard";
33
+ trigger("keyboard", event);
34
+ }
35
+ hasEventBeforeFocus = false;
36
+ }
37
+ function onWindowBlur() {
38
+ hasEventBeforeFocus = false;
39
+ }
40
+ function isFocusVisible() {
41
+ return modality !== "pointer";
42
+ }
43
+ function setupGlobalFocusEvents() {
44
+ if (typeof window === "undefined" || hasSetup) {
45
+ return;
46
+ }
47
+ const { focus } = HTMLElement.prototype;
48
+ HTMLElement.prototype.focus = function focusElement(...args) {
49
+ hasEventBeforeFocus = true;
50
+ focus.apply(this, args);
51
+ };
52
+ document.addEventListener("keydown", onKeyboardEvent, true);
53
+ document.addEventListener("keyup", onKeyboardEvent, true);
54
+ window.addEventListener("focus", onWindowFocus, true);
55
+ window.addEventListener("blur", onWindowBlur, false);
56
+ if (typeof PointerEvent !== "undefined") {
57
+ document.addEventListener("pointerdown", onPointerEvent, true);
58
+ document.addEventListener("pointermove", onPointerEvent, true);
59
+ document.addEventListener("pointerup", onPointerEvent, true);
60
+ } else {
61
+ document.addEventListener("mousedown", onPointerEvent, true);
62
+ document.addEventListener("mousemove", onPointerEvent, true);
63
+ document.addEventListener("mouseup", onPointerEvent, true);
64
+ }
65
+ hasSetup = true;
66
+ }
67
+ function trackFocusVisible(fn) {
68
+ setupGlobalFocusEvents();
69
+ fn(isFocusVisible());
70
+ const handler = () => fn(isFocusVisible());
71
+ handlers.add(handler);
72
+ return () => handlers.delete(handler);
73
+ }
74
+ export {
75
+ trackFocusVisible
76
+ };
77
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["type Modality = \"keyboard\" | \"pointer\"\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent\ntype Handler = (modality: Modality, e: HandlerEvent) => void\ntype FocusVisibleCallback = (isFocusVisible: boolean) => void\n\nlet hasSetup = false\nlet modality: Modality | null = null\nlet hasEventBeforeFocus = false\n\nconst handlers = new Set<Handler>()\n\nconst isMac = typeof window !== \"undefined\" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false\n\nfunction isValidKey(event: KeyboardEvent) {\n return !(event.metaKey || (!isMac && event.altKey) || event.ctrlKey)\n}\n\nfunction trigger(modality: Modality, event: HandlerEvent) {\n handlers.forEach((handler) => handler(modality, event))\n}\n\nfunction onKeyboardEvent(event: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(event)) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n}\n\nfunction onPointerEvent(event: PointerEvent | MouseEvent) {\n modality = \"pointer\"\n if (event.type === \"mousedown\" || event.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n trigger(\"pointer\", event)\n }\n}\n\nfunction onWindowFocus(event: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n if (event.target === window || event.target === document) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to keyboard modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n\n hasEventBeforeFocus = false\n}\n\nfunction onWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n}\n\nfunction isFocusVisible() {\n return modality !== \"pointer\"\n}\n\nfunction setupGlobalFocusEvents() {\n if (typeof window === \"undefined\" || hasSetup) {\n return\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n const { focus } = HTMLElement.prototype\n HTMLElement.prototype.focus = function focusElement(...args) {\n hasEventBeforeFocus = true\n focus.apply(this, args)\n }\n\n document.addEventListener(\"keydown\", onKeyboardEvent, true)\n document.addEventListener(\"keyup\", onKeyboardEvent, true)\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n window.addEventListener(\"focus\", onWindowFocus, true)\n window.addEventListener(\"blur\", onWindowBlur, false)\n\n if (typeof PointerEvent !== \"undefined\") {\n document.addEventListener(\"pointerdown\", onPointerEvent, true)\n document.addEventListener(\"pointermove\", onPointerEvent, true)\n document.addEventListener(\"pointerup\", onPointerEvent, true)\n } else {\n document.addEventListener(\"mousedown\", onPointerEvent, true)\n document.addEventListener(\"mousemove\", onPointerEvent, true)\n document.addEventListener(\"mouseup\", onPointerEvent, true)\n }\n\n hasSetup = true\n}\n\nexport function trackFocusVisible(fn: FocusVisibleCallback) {\n setupGlobalFocusEvents()\n\n fn(isFocusVisible())\n const handler = () => fn(isFocusVisible())\n\n handlers.add(handler)\n return () => handlers.delete(handler)\n}\n"],
5
+ "mappings": ";AAKA,IAAI,WAAW;AACf,IAAI,WAA4B;AAChC,IAAI,sBAAsB;AAE1B,IAAM,WAAW,oBAAI,IAAa;AAElC,IAAM,QAAQ,OAAO,WAAW,eAAe,OAAO,aAAa,OAAO,OAAO,KAAK,OAAO,UAAU,QAAQ,IAAI;AAEnH,oBAAoB,OAAsB;AACxC,SAAO,CAAE,OAAM,WAAY,CAAC,SAAS,MAAM,UAAW,MAAM;AAC9D;AAEA,iBAAiB,WAAoB,OAAqB;AACxD,WAAS,QAAQ,CAAC,YAAY,QAAQ,WAAU,KAAK,CAAC;AACxD;AAEA,yBAAyB,OAAsB;AAC7C,wBAAsB;AACtB,MAAI,WAAW,KAAK,GAAG;AACrB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AACF;AAEA,wBAAwB,OAAkC;AACxD,aAAW;AACX,MAAI,MAAM,SAAS,eAAe,MAAM,SAAS,eAAe;AAC9D,0BAAsB;AACtB,YAAQ,WAAW,KAAK;AAAA,EAC1B;AACF;AAEA,uBAAuB,OAAmB;AAIxC,MAAI,MAAM,WAAW,UAAU,MAAM,WAAW,UAAU;AACxD;AAAA,EACF;AAIA,MAAI,CAAC,qBAAqB;AACxB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AAEA,wBAAsB;AACxB;AAEA,wBAAwB;AAGtB,wBAAsB;AACxB;AAEA,0BAA0B;AACxB,SAAO,aAAa;AACtB;AAEA,kCAAkC;AAChC,MAAI,OAAO,WAAW,eAAe,UAAU;AAC7C;AAAA,EACF;AAMA,QAAM,EAAE,UAAU,YAAY;AAC9B,cAAY,UAAU,QAAQ,yBAAyB,MAAM;AAC3D,0BAAsB;AACtB,UAAM,MAAM,MAAM,IAAI;AAAA,EACxB;AAEA,WAAS,iBAAiB,WAAW,iBAAiB,IAAI;AAC1D,WAAS,iBAAiB,SAAS,iBAAiB,IAAI;AAIxD,SAAO,iBAAiB,SAAS,eAAe,IAAI;AACpD,SAAO,iBAAiB,QAAQ,cAAc,KAAK;AAEnD,MAAI,OAAO,iBAAiB,aAAa;AACvC,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAAA,EAC7D,OAAO;AACL,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,WAAW,gBAAgB,IAAI;AAAA,EAC3D;AAEA,aAAW;AACb;AAEO,2BAA2B,IAA0B;AAC1D,yBAAuB;AAEvB,KAAG,eAAe,CAAC;AACnB,QAAM,UAAU,MAAM,GAAG,eAAe,CAAC;AAEzC,WAAS,IAAI,OAAO;AACpB,SAAO,MAAM,SAAS,OAAO,OAAO;AACtC;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@zag-js/focus-visible",
3
+ "version": "0.0.0-dev-20220603082742",
4
+ "description": "Focus visible polyfill utility based on WICG",
5
+ "keywords": [
6
+ "js",
7
+ "utils",
8
+ "focus-visible",
9
+ "wicg"
10
+ ],
11
+ "author": "Segun Adebayo <sage@adebayosegun.com>",
12
+ "homepage": "https://github.com/chakra-ui/zag#readme",
13
+ "license": "MIT",
14
+ "main": "dist/index.js",
15
+ "module": "dist/index.mjs",
16
+ "types": "dist/index.d.ts",
17
+ "repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/focus-visible",
18
+ "sideEffects": false,
19
+ "files": [
20
+ "dist/**/*"
21
+ ],
22
+ "scripts": {
23
+ "build:fast": "yarn zag build",
24
+ "start": "yarn zag build --watch",
25
+ "build": "yarn zag build --prod",
26
+ "test": "jest --config ../../../jest.config.js --rootDir tests",
27
+ "lint": "eslint src --ext .ts,.tsx",
28
+ "test:ci": "yarn test --ci --runInBand --updateSnapshot",
29
+ "test:watch": "yarn test --watchAll"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/chakra-ui/zag/issues"
36
+ }
37
+ }