@zag-js/dismissable 0.0.0-dev-20220710093812

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,26 @@
1
+ # @zag-js/dismissable
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ yarn add @zag-js/dismissable
7
+ # or
8
+ npm i @zag-js/dismissable
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - Provides a layering system with built-in dismiss mechanism
14
+ - Closess when user interacts outside or focus is called programmatically outside the layer
15
+ - Tracks its descendant and ensure focus remains within the layer even if the previously focused descendant is removed
16
+ from the DOM
17
+ - Allows for nesting multiple layers
18
+ - Dismiss mechanism only works for the topmost layer
19
+
20
+ ## Contribution
21
+
22
+ Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.
23
+
24
+ ## Licence
25
+
26
+ This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
@@ -0,0 +1,13 @@
1
+ import { InteractOutsideHandlers } from "@zag-js/interact-outside";
2
+ declare type Container = HTMLElement | null | Array<HTMLElement | null>;
3
+ export declare type DismissableElementHandlers = InteractOutsideHandlers & {
4
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
5
+ };
6
+ export declare type DismissableElementOptions = DismissableElementHandlers & {
7
+ debug?: boolean;
8
+ pointerBlocking?: boolean;
9
+ onDismiss: () => void;
10
+ exclude?: Container | (() => Container);
11
+ };
12
+ export declare function trackDismissableElement(node: HTMLElement | null, options: DismissableElementOptions): () => void;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare function trackEscapeKeydown(fn?: (event: KeyboardEvent) => void): () => void;
@@ -0,0 +1 @@
1
+ export * from "./dismissable-layer";
package/dist/index.js ADDED
@@ -0,0 +1,251 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ trackDismissableElement: () => trackDismissableElement
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // ../dom/dist/index.mjs
28
+ var runIfFn = (v, ...a) => {
29
+ const res = typeof v === "function" ? v(...a) : v;
30
+ return res != null ? res : void 0;
31
+ };
32
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
33
+ function isDocument(el) {
34
+ return el.nodeType === Node.DOCUMENT_NODE;
35
+ }
36
+ function isWindow(value) {
37
+ return (value == null ? void 0 : value.toString()) === "[object Window]";
38
+ }
39
+ function getDocument(el) {
40
+ var _a;
41
+ if (isWindow(el))
42
+ return el.document;
43
+ if (isDocument(el))
44
+ return el;
45
+ return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
46
+ }
47
+ function getEventTarget(event) {
48
+ var _a, _b;
49
+ return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
50
+ }
51
+ function contains(parent, child) {
52
+ if (!parent)
53
+ return false;
54
+ return parent === child || isHTMLElement(parent) && isHTMLElement(child) && parent.contains(child);
55
+ }
56
+ function isHTMLElement(v) {
57
+ return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
58
+ }
59
+ var isRef = (v) => hasProp(v, "current");
60
+ function addDomEvent(target, eventName, handler, options) {
61
+ const node = isRef(target) ? target.current : runIfFn(target);
62
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
63
+ return () => {
64
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
65
+ };
66
+ }
67
+
68
+ // src/dismissable-layer.ts
69
+ var import_interact_outside = require("@zag-js/interact-outside");
70
+
71
+ // ../core/dist/index.mjs
72
+ function warn(...a) {
73
+ const m = a.length === 1 ? a[0] : a[1];
74
+ const c = a.length === 2 ? a[0] : true;
75
+ if (c && void 0 !== "production") {
76
+ console.warn(m);
77
+ }
78
+ }
79
+
80
+ // src/escape-keydown.ts
81
+ function trackEscapeKeydown(fn) {
82
+ const handleKeyDown = (event) => {
83
+ if (event.key === "Escape")
84
+ fn == null ? void 0 : fn(event);
85
+ };
86
+ return addDomEvent(document, "keydown", handleKeyDown);
87
+ }
88
+
89
+ // src/layer-stack.ts
90
+ var layerStack = {
91
+ layers: [],
92
+ branches: [],
93
+ count() {
94
+ return this.layers.length;
95
+ },
96
+ pointerBlockingLayers() {
97
+ return this.layers.filter((layer) => layer.pointerBlocking);
98
+ },
99
+ topMostPointerBlockingLayer() {
100
+ return [...this.pointerBlockingLayers()].slice(-1)[0];
101
+ },
102
+ hasPointerBlockingLayer() {
103
+ return this.pointerBlockingLayers().length > 0;
104
+ },
105
+ isBelowPointerBlockingLayer(node) {
106
+ var _a;
107
+ const index = this.indexOf(node);
108
+ const highestBlockingIndex = this.topMostPointerBlockingLayer() ? this.indexOf((_a = this.topMostPointerBlockingLayer()) == null ? void 0 : _a.node) : -1;
109
+ return index < highestBlockingIndex;
110
+ },
111
+ isTopMost(node) {
112
+ const layer = this.layers[this.count() - 1];
113
+ return (layer == null ? void 0 : layer.node) === node;
114
+ },
115
+ getNestedLayers(node) {
116
+ return Array.from(this.layers).slice(this.indexOf(node) + 1);
117
+ },
118
+ isInNestedLayer(node, target) {
119
+ return this.getNestedLayers(node).some((layer) => contains(layer.node, target));
120
+ },
121
+ isInBranch(target) {
122
+ return Array.from(this.branches).some((branch) => contains(branch, target));
123
+ },
124
+ add(layer) {
125
+ this.layers.push(layer);
126
+ },
127
+ addBranch(node) {
128
+ this.branches.push(node);
129
+ },
130
+ remove(node) {
131
+ const index = this.indexOf(node);
132
+ if (index < 0)
133
+ return;
134
+ if (index < this.count() - 1) {
135
+ const _layers = this.getNestedLayers(node);
136
+ _layers.forEach((layer) => layer.dismiss());
137
+ }
138
+ this.layers.splice(index, 1);
139
+ },
140
+ removeBranch(node) {
141
+ const index = this.branches.indexOf(node);
142
+ if (index >= 0)
143
+ this.branches.splice(index, 1);
144
+ },
145
+ indexOf(node) {
146
+ return this.layers.findIndex((layer) => layer.node === node);
147
+ },
148
+ dismiss(node) {
149
+ var _a;
150
+ (_a = this.layers[this.indexOf(node)]) == null ? void 0 : _a.dismiss();
151
+ },
152
+ clear() {
153
+ this.remove(this.layers[0].node);
154
+ }
155
+ };
156
+
157
+ // src/pointer-event-outside.ts
158
+ var originalBodyPointerEvents;
159
+ function assignPointerEventToLayers() {
160
+ layerStack.layers.forEach(({ node }) => {
161
+ node.style.pointerEvents = layerStack.isBelowPointerBlockingLayer(node) ? "none" : "auto";
162
+ });
163
+ }
164
+ function clearPointerEvent(node) {
165
+ node.style.pointerEvents = "";
166
+ }
167
+ var DATA_ATTR = "data-inert";
168
+ function disablePointerEventsOutside(node) {
169
+ const doc = getDocument(node);
170
+ if (layerStack.hasPointerBlockingLayer() && !doc.body.hasAttribute(DATA_ATTR)) {
171
+ originalBodyPointerEvents = document.body.style.pointerEvents;
172
+ doc.body.style.pointerEvents = "none";
173
+ doc.body.setAttribute(DATA_ATTR, "");
174
+ }
175
+ return () => {
176
+ if (layerStack.hasPointerBlockingLayer())
177
+ return;
178
+ doc.body.style.pointerEvents = originalBodyPointerEvents;
179
+ doc.body.removeAttribute(DATA_ATTR);
180
+ if (doc.body.style.length === 0)
181
+ doc.body.removeAttribute("style");
182
+ };
183
+ }
184
+
185
+ // src/dismissable-layer.ts
186
+ function trackDismissableElement(node, options) {
187
+ if (!node) {
188
+ warn("[@zag-js/dismissable] node is `null` or `undefined`");
189
+ return;
190
+ }
191
+ const { onDismiss, pointerBlocking, exclude: excludeContainers, debug } = options;
192
+ const layer = { dismiss: onDismiss, node, pointerBlocking };
193
+ layerStack.add(layer);
194
+ assignPointerEventToLayers();
195
+ function onPointerDownOutside(event) {
196
+ var _a, _b;
197
+ const target = getEventTarget(event.detail.originalEvent);
198
+ if (layerStack.isBelowPointerBlockingLayer(node) || layerStack.isInBranch(target))
199
+ return;
200
+ (_a = options.onPointerDownOutside) == null ? void 0 : _a.call(options, event);
201
+ (_b = options.onInteractOutside) == null ? void 0 : _b.call(options, event);
202
+ if (event.defaultPrevented)
203
+ return;
204
+ if (debug) {
205
+ console.log("onPointerDownOutside:", event.detail.originalEvent);
206
+ }
207
+ onDismiss == null ? void 0 : onDismiss();
208
+ }
209
+ function onFocusOutside(event) {
210
+ var _a, _b;
211
+ const target = getEventTarget(event.detail.originalEvent);
212
+ if (layerStack.isInBranch(target))
213
+ return;
214
+ (_a = options.onFocusOutside) == null ? void 0 : _a.call(options, event);
215
+ (_b = options.onInteractOutside) == null ? void 0 : _b.call(options, event);
216
+ if (event.defaultPrevented)
217
+ return;
218
+ if (debug) {
219
+ console.log("onFocusOutside:", event.detail.originalEvent);
220
+ }
221
+ onDismiss == null ? void 0 : onDismiss();
222
+ }
223
+ function onEscapeKeyDown(event) {
224
+ var _a;
225
+ if (!layerStack.isTopMost(node))
226
+ return;
227
+ (_a = options.onEscapeKeyDown) == null ? void 0 : _a.call(options, event);
228
+ if (!event.defaultPrevented && onDismiss) {
229
+ event.preventDefault();
230
+ onDismiss();
231
+ }
232
+ }
233
+ function exclude(target) {
234
+ if (!node)
235
+ return false;
236
+ const containers = typeof excludeContainers === "function" ? excludeContainers() : excludeContainers;
237
+ const _containers = Array.isArray(containers) ? containers : [containers];
238
+ return _containers.some((node2) => contains(node2, target)) || layerStack.isInNestedLayer(node, target);
239
+ }
240
+ const cleanups = [
241
+ pointerBlocking ? disablePointerEventsOutside(node) : void 0,
242
+ trackEscapeKeydown(onEscapeKeyDown),
243
+ (0, import_interact_outside.trackInteractOutside)(node, { exclude, onFocusOutside, onPointerDownOutside })
244
+ ];
245
+ return () => {
246
+ layerStack.remove(node);
247
+ assignPointerEventToLayers();
248
+ clearPointerEvent(node);
249
+ cleanups.forEach((fn) => fn == null ? void 0 : fn());
250
+ };
251
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,230 @@
1
+ // ../dom/dist/index.mjs
2
+ var runIfFn = (v, ...a) => {
3
+ const res = typeof v === "function" ? v(...a) : v;
4
+ return res != null ? res : void 0;
5
+ };
6
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
7
+ function isDocument(el) {
8
+ return el.nodeType === Node.DOCUMENT_NODE;
9
+ }
10
+ function isWindow(value) {
11
+ return (value == null ? void 0 : value.toString()) === "[object Window]";
12
+ }
13
+ function getDocument(el) {
14
+ var _a;
15
+ if (isWindow(el))
16
+ return el.document;
17
+ if (isDocument(el))
18
+ return el;
19
+ return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
20
+ }
21
+ function getEventTarget(event) {
22
+ var _a, _b;
23
+ return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
24
+ }
25
+ function contains(parent, child) {
26
+ if (!parent)
27
+ return false;
28
+ return parent === child || isHTMLElement(parent) && isHTMLElement(child) && parent.contains(child);
29
+ }
30
+ function isHTMLElement(v) {
31
+ return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
32
+ }
33
+ var isRef = (v) => hasProp(v, "current");
34
+ function addDomEvent(target, eventName, handler, options) {
35
+ const node = isRef(target) ? target.current : runIfFn(target);
36
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
37
+ return () => {
38
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
39
+ };
40
+ }
41
+
42
+ // src/dismissable-layer.ts
43
+ import {
44
+ trackInteractOutside
45
+ } from "@zag-js/interact-outside";
46
+
47
+ // ../core/dist/index.mjs
48
+ function warn(...a) {
49
+ const m = a.length === 1 ? a[0] : a[1];
50
+ const c = a.length === 2 ? a[0] : true;
51
+ if (c && void 0 !== "production") {
52
+ console.warn(m);
53
+ }
54
+ }
55
+
56
+ // src/escape-keydown.ts
57
+ function trackEscapeKeydown(fn) {
58
+ const handleKeyDown = (event) => {
59
+ if (event.key === "Escape")
60
+ fn == null ? void 0 : fn(event);
61
+ };
62
+ return addDomEvent(document, "keydown", handleKeyDown);
63
+ }
64
+
65
+ // src/layer-stack.ts
66
+ var layerStack = {
67
+ layers: [],
68
+ branches: [],
69
+ count() {
70
+ return this.layers.length;
71
+ },
72
+ pointerBlockingLayers() {
73
+ return this.layers.filter((layer) => layer.pointerBlocking);
74
+ },
75
+ topMostPointerBlockingLayer() {
76
+ return [...this.pointerBlockingLayers()].slice(-1)[0];
77
+ },
78
+ hasPointerBlockingLayer() {
79
+ return this.pointerBlockingLayers().length > 0;
80
+ },
81
+ isBelowPointerBlockingLayer(node) {
82
+ var _a;
83
+ const index = this.indexOf(node);
84
+ const highestBlockingIndex = this.topMostPointerBlockingLayer() ? this.indexOf((_a = this.topMostPointerBlockingLayer()) == null ? void 0 : _a.node) : -1;
85
+ return index < highestBlockingIndex;
86
+ },
87
+ isTopMost(node) {
88
+ const layer = this.layers[this.count() - 1];
89
+ return (layer == null ? void 0 : layer.node) === node;
90
+ },
91
+ getNestedLayers(node) {
92
+ return Array.from(this.layers).slice(this.indexOf(node) + 1);
93
+ },
94
+ isInNestedLayer(node, target) {
95
+ return this.getNestedLayers(node).some((layer) => contains(layer.node, target));
96
+ },
97
+ isInBranch(target) {
98
+ return Array.from(this.branches).some((branch) => contains(branch, target));
99
+ },
100
+ add(layer) {
101
+ this.layers.push(layer);
102
+ },
103
+ addBranch(node) {
104
+ this.branches.push(node);
105
+ },
106
+ remove(node) {
107
+ const index = this.indexOf(node);
108
+ if (index < 0)
109
+ return;
110
+ if (index < this.count() - 1) {
111
+ const _layers = this.getNestedLayers(node);
112
+ _layers.forEach((layer) => layer.dismiss());
113
+ }
114
+ this.layers.splice(index, 1);
115
+ },
116
+ removeBranch(node) {
117
+ const index = this.branches.indexOf(node);
118
+ if (index >= 0)
119
+ this.branches.splice(index, 1);
120
+ },
121
+ indexOf(node) {
122
+ return this.layers.findIndex((layer) => layer.node === node);
123
+ },
124
+ dismiss(node) {
125
+ var _a;
126
+ (_a = this.layers[this.indexOf(node)]) == null ? void 0 : _a.dismiss();
127
+ },
128
+ clear() {
129
+ this.remove(this.layers[0].node);
130
+ }
131
+ };
132
+
133
+ // src/pointer-event-outside.ts
134
+ var originalBodyPointerEvents;
135
+ function assignPointerEventToLayers() {
136
+ layerStack.layers.forEach(({ node }) => {
137
+ node.style.pointerEvents = layerStack.isBelowPointerBlockingLayer(node) ? "none" : "auto";
138
+ });
139
+ }
140
+ function clearPointerEvent(node) {
141
+ node.style.pointerEvents = "";
142
+ }
143
+ var DATA_ATTR = "data-inert";
144
+ function disablePointerEventsOutside(node) {
145
+ const doc = getDocument(node);
146
+ if (layerStack.hasPointerBlockingLayer() && !doc.body.hasAttribute(DATA_ATTR)) {
147
+ originalBodyPointerEvents = document.body.style.pointerEvents;
148
+ doc.body.style.pointerEvents = "none";
149
+ doc.body.setAttribute(DATA_ATTR, "");
150
+ }
151
+ return () => {
152
+ if (layerStack.hasPointerBlockingLayer())
153
+ return;
154
+ doc.body.style.pointerEvents = originalBodyPointerEvents;
155
+ doc.body.removeAttribute(DATA_ATTR);
156
+ if (doc.body.style.length === 0)
157
+ doc.body.removeAttribute("style");
158
+ };
159
+ }
160
+
161
+ // src/dismissable-layer.ts
162
+ function trackDismissableElement(node, options) {
163
+ if (!node) {
164
+ warn("[@zag-js/dismissable] node is `null` or `undefined`");
165
+ return;
166
+ }
167
+ const { onDismiss, pointerBlocking, exclude: excludeContainers, debug } = options;
168
+ const layer = { dismiss: onDismiss, node, pointerBlocking };
169
+ layerStack.add(layer);
170
+ assignPointerEventToLayers();
171
+ function onPointerDownOutside(event) {
172
+ var _a, _b;
173
+ const target = getEventTarget(event.detail.originalEvent);
174
+ if (layerStack.isBelowPointerBlockingLayer(node) || layerStack.isInBranch(target))
175
+ return;
176
+ (_a = options.onPointerDownOutside) == null ? void 0 : _a.call(options, event);
177
+ (_b = options.onInteractOutside) == null ? void 0 : _b.call(options, event);
178
+ if (event.defaultPrevented)
179
+ return;
180
+ if (debug) {
181
+ console.log("onPointerDownOutside:", event.detail.originalEvent);
182
+ }
183
+ onDismiss == null ? void 0 : onDismiss();
184
+ }
185
+ function onFocusOutside(event) {
186
+ var _a, _b;
187
+ const target = getEventTarget(event.detail.originalEvent);
188
+ if (layerStack.isInBranch(target))
189
+ return;
190
+ (_a = options.onFocusOutside) == null ? void 0 : _a.call(options, event);
191
+ (_b = options.onInteractOutside) == null ? void 0 : _b.call(options, event);
192
+ if (event.defaultPrevented)
193
+ return;
194
+ if (debug) {
195
+ console.log("onFocusOutside:", event.detail.originalEvent);
196
+ }
197
+ onDismiss == null ? void 0 : onDismiss();
198
+ }
199
+ function onEscapeKeyDown(event) {
200
+ var _a;
201
+ if (!layerStack.isTopMost(node))
202
+ return;
203
+ (_a = options.onEscapeKeyDown) == null ? void 0 : _a.call(options, event);
204
+ if (!event.defaultPrevented && onDismiss) {
205
+ event.preventDefault();
206
+ onDismiss();
207
+ }
208
+ }
209
+ function exclude(target) {
210
+ if (!node)
211
+ return false;
212
+ const containers = typeof excludeContainers === "function" ? excludeContainers() : excludeContainers;
213
+ const _containers = Array.isArray(containers) ? containers : [containers];
214
+ return _containers.some((node2) => contains(node2, target)) || layerStack.isInNestedLayer(node, target);
215
+ }
216
+ const cleanups = [
217
+ pointerBlocking ? disablePointerEventsOutside(node) : void 0,
218
+ trackEscapeKeydown(onEscapeKeyDown),
219
+ trackInteractOutside(node, { exclude, onFocusOutside, onPointerDownOutside })
220
+ ];
221
+ return () => {
222
+ layerStack.remove(node);
223
+ assignPointerEventToLayers();
224
+ clearPointerEvent(node);
225
+ cleanups.forEach((fn) => fn == null ? void 0 : fn());
226
+ };
227
+ }
228
+ export {
229
+ trackDismissableElement
230
+ };
@@ -0,0 +1,25 @@
1
+ export declare type Layer = {
2
+ dismiss: VoidFunction;
3
+ node: HTMLElement;
4
+ pointerBlocking?: boolean;
5
+ };
6
+ export declare const layerStack: {
7
+ layers: Layer[];
8
+ branches: HTMLElement[];
9
+ count(): number;
10
+ pointerBlockingLayers(): Layer[];
11
+ topMostPointerBlockingLayer(): Layer | undefined;
12
+ hasPointerBlockingLayer(): boolean;
13
+ isBelowPointerBlockingLayer(node: HTMLElement): boolean;
14
+ isTopMost(node: HTMLElement | null): boolean;
15
+ getNestedLayers(node: HTMLElement): unknown[];
16
+ isInNestedLayer(node: HTMLElement, target: HTMLElement | EventTarget | null): any;
17
+ isInBranch(target: HTMLElement | EventTarget | null): boolean;
18
+ add(layer: Layer): void;
19
+ addBranch(node: HTMLElement): void;
20
+ remove(node: HTMLElement): void;
21
+ removeBranch(node: HTMLElement): void;
22
+ indexOf(node: HTMLElement | undefined): any;
23
+ dismiss(node: HTMLElement): void;
24
+ clear(): void;
25
+ };
@@ -0,0 +1,3 @@
1
+ export declare function assignPointerEventToLayers(): void;
2
+ export declare function clearPointerEvent(node: HTMLElement): void;
3
+ export declare function disablePointerEventsOutside(node: HTMLElement): () => void;
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@zag-js/dismissable",
3
+ "version": "0.0.0-dev-20220710093812",
4
+ "description": "Dismissable layer utilities for the DOM",
5
+ "keywords": [
6
+ "js",
7
+ "utils",
8
+ "dimissable",
9
+ "layer",
10
+ "close",
11
+ "signal",
12
+ "outside-click"
13
+ ],
14
+ "author": "Segun Adebayo <sage@adebayosegun.com>",
15
+ "homepage": "https://github.com/chakra-ui/zag#readme",
16
+ "license": "MIT",
17
+ "main": "dist/index.js",
18
+ "module": "dist/index.mjs",
19
+ "types": "dist/index.d.ts",
20
+ "repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/interact-outside",
21
+ "sideEffects": false,
22
+ "files": [
23
+ "dist/**/*"
24
+ ],
25
+ "scripts": {
26
+ "build:fast": "yarn zag build",
27
+ "start": "yarn zag build --watch",
28
+ "build": "yarn zag build --prod",
29
+ "test": "jest --config ../../../jest.config.js --rootDir tests",
30
+ "lint": "eslint src --ext .ts,.tsx",
31
+ "test:ci": "yarn test --ci --runInBand --updateSnapshot",
32
+ "test:watch": "yarn test --watchAll"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@zag-js/interact-outside": "0.0.0-dev-20220710093812"
39
+ },
40
+ "devDependencies": {
41
+ "@zag-js/dom-utils": "0.0.0-dev-20220710093812"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/chakra-ui/zag/issues"
45
+ }
46
+ }