@zag-js/popover 0.0.0-dev-20220703123907 → 0.0.0-dev-20220704094417

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
@@ -46,38 +46,6 @@ module.exports = __toCommonJS(src_exports);
46
46
  var dataAttr = (guard) => {
47
47
  return guard ? "" : void 0;
48
48
  };
49
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
50
- var runIfFn = (v, ...a) => {
51
- const res = typeof v === "function" ? v(...a) : v;
52
- return res != null ? res : void 0;
53
- };
54
- var isRef = (v) => hasProp(v, "current");
55
- function addDomEvent(target, eventName, handler, options) {
56
- const node = isRef(target) ? target.current : runIfFn(target);
57
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
58
- return () => {
59
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
60
- };
61
- }
62
- function nextTick(fn) {
63
- const set = /* @__PURE__ */ new Set();
64
- function raf2(fn2) {
65
- const id = globalThis.requestAnimationFrame(fn2);
66
- set.add(() => globalThis.cancelAnimationFrame(id));
67
- }
68
- raf2(() => raf2(fn));
69
- return function cleanup() {
70
- set.forEach(function(fn2) {
71
- fn2();
72
- });
73
- };
74
- }
75
- function raf(fn) {
76
- const id = globalThis.requestAnimationFrame(fn);
77
- return function cleanup() {
78
- globalThis.cancelAnimationFrame(id);
79
- };
80
- }
81
49
  function isWindow(value) {
82
50
  return (value == null ? void 0 : value.toString()) === "[object Window]";
83
51
  }
@@ -165,6 +133,38 @@ function getLastTabbable(container, includeContainer) {
165
133
  const elements = getTabbables(container, includeContainer);
166
134
  return elements[elements.length - 1] || null;
167
135
  }
136
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
137
+ var runIfFn = (v, ...a) => {
138
+ const res = typeof v === "function" ? v(...a) : v;
139
+ return res != null ? res : void 0;
140
+ };
141
+ var isRef = (v) => hasProp(v, "current");
142
+ function addDomEvent(target, eventName, handler, options) {
143
+ const node = isRef(target) ? target.current : runIfFn(target);
144
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
145
+ return () => {
146
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
147
+ };
148
+ }
149
+ function nextTick(fn) {
150
+ const set = /* @__PURE__ */ new Set();
151
+ function raf2(fn2) {
152
+ const id = globalThis.requestAnimationFrame(fn2);
153
+ set.add(() => globalThis.cancelAnimationFrame(id));
154
+ }
155
+ raf2(() => raf2(fn));
156
+ return function cleanup() {
157
+ set.forEach(function(fn2) {
158
+ fn2();
159
+ });
160
+ };
161
+ }
162
+ function raf(fn) {
163
+ const id = globalThis.requestAnimationFrame(fn);
164
+ return function cleanup() {
165
+ globalThis.cancelAnimationFrame(id);
166
+ };
167
+ }
168
168
 
169
169
  // src/popover.connect.ts
170
170
  var import_popper = require("@zag-js/popper");
@@ -344,19 +344,6 @@ var import_aria_hidden = require("@zag-js/aria-hidden");
344
344
  var import_core = require("@zag-js/core");
345
345
 
346
346
  // ../../utilities/interact-outside/dist/index.mjs
347
- var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
348
- var runIfFn3 = (v, ...a) => {
349
- const res = typeof v === "function" ? v(...a) : v;
350
- return res != null ? res : void 0;
351
- };
352
- var isRef2 = (v) => hasProp2(v, "current");
353
- function addDomEvent2(target, eventName, handler, options) {
354
- const node = isRef2(target) ? target.current : runIfFn3(target);
355
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
356
- return () => {
357
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
358
- };
359
- }
360
347
  function isWindow2(value) {
361
348
  return (value == null ? void 0 : value.toString()) === "[object Window]";
362
349
  }
@@ -399,6 +386,19 @@ function isFocusable2(element) {
399
386
  return false;
400
387
  return element.matches(focusableSelector2) && isVisible2(element);
401
388
  }
389
+ var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
390
+ var runIfFn3 = (v, ...a) => {
391
+ const res = typeof v === "function" ? v(...a) : v;
392
+ return res != null ? res : void 0;
393
+ };
394
+ var isRef2 = (v) => hasProp2(v, "current");
395
+ function addDomEvent2(target, eventName, handler, options) {
396
+ const node = isRef2(target) ? target.current : runIfFn3(target);
397
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
398
+ return () => {
399
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
400
+ };
401
+ }
402
402
  var isDom = () => typeof window !== "undefined";
403
403
  function getPlatform() {
404
404
  var _a;
package/dist/index.mjs CHANGED
@@ -23,38 +23,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
23
  var dataAttr = (guard) => {
24
24
  return guard ? "" : void 0;
25
25
  };
26
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
27
- var runIfFn = (v, ...a) => {
28
- const res = typeof v === "function" ? v(...a) : v;
29
- return res != null ? res : void 0;
30
- };
31
- var isRef = (v) => hasProp(v, "current");
32
- function addDomEvent(target, eventName, handler, options) {
33
- const node = isRef(target) ? target.current : runIfFn(target);
34
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
35
- return () => {
36
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
37
- };
38
- }
39
- function nextTick(fn) {
40
- const set = /* @__PURE__ */ new Set();
41
- function raf2(fn2) {
42
- const id = globalThis.requestAnimationFrame(fn2);
43
- set.add(() => globalThis.cancelAnimationFrame(id));
44
- }
45
- raf2(() => raf2(fn));
46
- return function cleanup() {
47
- set.forEach(function(fn2) {
48
- fn2();
49
- });
50
- };
51
- }
52
- function raf(fn) {
53
- const id = globalThis.requestAnimationFrame(fn);
54
- return function cleanup() {
55
- globalThis.cancelAnimationFrame(id);
56
- };
57
- }
58
26
  function isWindow(value) {
59
27
  return (value == null ? void 0 : value.toString()) === "[object Window]";
60
28
  }
@@ -142,6 +110,38 @@ function getLastTabbable(container, includeContainer) {
142
110
  const elements = getTabbables(container, includeContainer);
143
111
  return elements[elements.length - 1] || null;
144
112
  }
113
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
114
+ var runIfFn = (v, ...a) => {
115
+ const res = typeof v === "function" ? v(...a) : v;
116
+ return res != null ? res : void 0;
117
+ };
118
+ var isRef = (v) => hasProp(v, "current");
119
+ function addDomEvent(target, eventName, handler, options) {
120
+ const node = isRef(target) ? target.current : runIfFn(target);
121
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
122
+ return () => {
123
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
124
+ };
125
+ }
126
+ function nextTick(fn) {
127
+ const set = /* @__PURE__ */ new Set();
128
+ function raf2(fn2) {
129
+ const id = globalThis.requestAnimationFrame(fn2);
130
+ set.add(() => globalThis.cancelAnimationFrame(id));
131
+ }
132
+ raf2(() => raf2(fn));
133
+ return function cleanup() {
134
+ set.forEach(function(fn2) {
135
+ fn2();
136
+ });
137
+ };
138
+ }
139
+ function raf(fn) {
140
+ const id = globalThis.requestAnimationFrame(fn);
141
+ return function cleanup() {
142
+ globalThis.cancelAnimationFrame(id);
143
+ };
144
+ }
145
145
 
146
146
  // src/popover.connect.ts
147
147
  import { getPlacementStyles } from "@zag-js/popper";
@@ -321,19 +321,6 @@ import { ariaHidden } from "@zag-js/aria-hidden";
321
321
  import { createMachine, guards, ref } from "@zag-js/core";
322
322
 
323
323
  // ../../utilities/interact-outside/dist/index.mjs
324
- var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
325
- var runIfFn3 = (v, ...a) => {
326
- const res = typeof v === "function" ? v(...a) : v;
327
- return res != null ? res : void 0;
328
- };
329
- var isRef2 = (v) => hasProp2(v, "current");
330
- function addDomEvent2(target, eventName, handler, options) {
331
- const node = isRef2(target) ? target.current : runIfFn3(target);
332
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
333
- return () => {
334
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
335
- };
336
- }
337
324
  function isWindow2(value) {
338
325
  return (value == null ? void 0 : value.toString()) === "[object Window]";
339
326
  }
@@ -376,6 +363,19 @@ function isFocusable2(element) {
376
363
  return false;
377
364
  return element.matches(focusableSelector2) && isVisible2(element);
378
365
  }
366
+ var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
367
+ var runIfFn3 = (v, ...a) => {
368
+ const res = typeof v === "function" ? v(...a) : v;
369
+ return res != null ? res : void 0;
370
+ };
371
+ var isRef2 = (v) => hasProp2(v, "current");
372
+ function addDomEvent2(target, eventName, handler, options) {
373
+ const node = isRef2(target) ? target.current : runIfFn3(target);
374
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
375
+ return () => {
376
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
377
+ };
378
+ }
379
379
  var isDom = () => typeof window !== "undefined";
380
380
  function getPlatform() {
381
381
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/popover",
3
- "version": "0.0.0-dev-20220703123907",
3
+ "version": "0.0.0-dev-20220704094417",
4
4
  "description": "Core logic for the popover widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@zag-js/aria-hidden": "0.1.0",
33
- "@zag-js/core": "0.0.0-dev-20220703123907",
34
- "@zag-js/dom-utils": "0.0.0-dev-20220703123907",
35
- "@zag-js/popper": "0.0.0-dev-20220703123907",
33
+ "@zag-js/core": "0.0.0-dev-20220704094417",
34
+ "@zag-js/dom-utils": "0.0.0-dev-20220704094417",
35
+ "@zag-js/popper": "0.0.0-dev-20220704094417",
36
36
  "@zag-js/remove-scroll": "0.1.0",
37
- "@zag-js/types": "0.0.0-dev-20220703123907",
37
+ "@zag-js/types": "0.0.0-dev-20220704094417",
38
38
  "@zag-js/utils": "0.1.2",
39
39
  "focus-trap": "6.7.1"
40
40
  },