@serendie/ui 2.0.0 → 2.1.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.
Files changed (118) hide show
  1. package/dist/components/CheckBox/CheckBox.js +36 -35
  2. package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
  3. package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
  4. package/dist/components/DataTable/DataTableComponent.js +38 -36
  5. package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
  6. package/dist/components/Search/Search.d.ts +3 -1
  7. package/dist/components/Search/Search.js +34 -33
  8. package/dist/components/Select/Select.d.ts +2 -1
  9. package/dist/components/Select/Select.js +47 -41
  10. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  11. package/dist/components/Tooltip/Tooltip.js +70 -0
  12. package/dist/components/Tooltip/index.d.ts +1 -0
  13. package/dist/components/Tooltip/index.js +4 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +12 -10
  16. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
  17. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
  18. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
  19. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
  20. package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
  21. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
  22. package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
  23. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
  24. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
  25. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
  26. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
  27. package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
  28. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
  29. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
  30. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
  31. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
  32. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
  33. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
  34. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
  35. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
  36. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
  37. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
  38. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
  39. package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
  40. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
  41. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
  42. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
  43. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
  44. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
  45. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
  47. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
  48. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
  49. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
  50. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
  51. package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
  52. package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
  53. package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
  54. package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
  55. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
  56. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
  57. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
  58. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
  59. package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
  60. package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
  61. package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
  62. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
  63. package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
  64. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
  65. package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
  66. package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
  67. package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
  68. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
  69. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
  70. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
  71. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
  72. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
  73. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
  74. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
  75. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
  76. package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
  77. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
  78. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
  79. package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
  80. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
  81. package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
  82. package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
  83. package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
  84. package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
  85. package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
  86. package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
  87. package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
  88. package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
  89. package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
  90. package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
  91. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
  92. package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
  93. package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
  94. package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
  98. package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
  99. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
  100. package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
  101. package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
  102. package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
  103. package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
  104. package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
  105. package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
  106. package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
  107. package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
  108. package/dist/node_modules/proxy-compare/dist/index.js +4 -106
  109. package/dist/styles.css +1 -1
  110. package/package.json +5 -5
  111. package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
  112. package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
  113. package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
  114. package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
  115. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
  116. package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
  117. package/dist/node_modules/klona/full/index.js +0 -21
  118. package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
@@ -1,114 +1,266 @@
1
- import { createNormalizer as C } from "../../types/dist/index.js";
2
- import O, { useRef as f, useLayoutEffect as A, useEffect as i, useSyncExternalStore as _, useCallback as j, useMemo as S } from "react";
3
- import "react-dom";
1
+ import { createScope as Y, MachineStatus as V, INIT_STATE as O } from "../../core/dist/index.js";
2
+ import { mergeProps as yt } from "../../core/dist/index.js";
3
+ import { compact as Z, ensure as h, identity as tt, isFunction as j, warn as H, toArray as et, isString as rt } from "../../utils/dist/index.js";
4
+ import { useMemo as nt, useRef as g, useLayoutEffect as ut, useEffect as w, useState as K } from "react";
5
+ import { flushSync as $ } from "react-dom";
6
+ import { createNormalizer as ot } from "../../types/dist/index.js";
4
7
  import "react/jsx-runtime";
5
- import { subscribe as M, snapshot as g, makeGlobal as w } from "../../store/dist/index.js";
6
- import { isChanged as R, createProxy as W } from "../../../proxy-compare/dist/index.js";
7
- var Y = C((t) => t), E = (t) => (t == null ? void 0 : t.constructor.name) === "Array", z = (t, e) => {
8
- if (t.length !== e.length) return !1;
9
- for (let r = 0; r < t.length; r++)
10
- if (!p(t[r], e[r])) return !1;
11
- return !0;
12
- }, p = (t, e) => {
13
- if (Object.is(t, e)) return !0;
14
- if (t == null && e != null || t != null && e == null) return !1;
15
- if (typeof (t == null ? void 0 : t.isEqual) == "function" && typeof (e == null ? void 0 : e.isEqual) == "function")
16
- return t.isEqual(e);
17
- if (typeof t == "function" && typeof e == "function")
18
- return t.toString() === e.toString();
19
- if (E(t) && E(e))
20
- return z(Array.from(t), Array.from(e));
21
- if (typeof t != "object" || typeof e != "object") return !1;
22
- const r = Object.keys(e ?? /* @__PURE__ */ Object.create(null)), o = r.length;
23
- for (let n = 0; n < o; n++)
24
- if (!Reflect.has(t, r[n])) return !1;
25
- for (let n = 0; n < o; n++) {
26
- const c = r[n];
27
- if (!p(t[c], e[c])) return !1;
8
+ var U = typeof globalThis.document < "u" ? ut : w;
9
+ function L(t) {
10
+ const o = t().value ?? t().defaultValue, c = t().isEqual ?? Object.is, [i] = K(o), [v, y] = K(i), z = t().value !== void 0, b = g(v);
11
+ b.current = z ? t().value : v;
12
+ const R = g(b.current);
13
+ U(() => {
14
+ R.current = b.current;
15
+ }, [v, t().value]);
16
+ const M = (d) => {
17
+ var N, m;
18
+ const f = R.current, a = j(d) ? d(f) : d;
19
+ t().debug && console.log(`[bindable > ${t().debug}] setValue`, { next: a, prev: f }), z || y(a), c(a, f) || (m = (N = t()).onChange) == null || m.call(N, a, f);
20
+ };
21
+ function C() {
22
+ return z ? t().value : v;
28
23
  }
29
- return !0;
30
- }, K = () => process.env.NODE_ENV !== "production", L = Function.prototype.toString;
31
- L.call(Object);
32
- function k(t) {
33
- if (!N(t) || t === void 0)
34
- return t;
35
- const e = Reflect.ownKeys(t).filter((o) => typeof o == "string"), r = {};
36
- for (const o of e) {
37
- const n = t[o];
38
- n !== void 0 && (r[o] = k(n));
39
- }
40
- return r;
41
- }
42
- var N = (t) => t && typeof t == "object" && t.constructor === Object;
43
- function P(t, e) {
44
- const r = f(!1), o = f(!1);
45
- i(() => {
46
- if (r.current && o.current)
47
- return t();
48
- o.current = !0;
49
- }, e), i(() => (r.current = !0, () => {
50
- r.current = !1;
51
- }), []);
24
+ return {
25
+ initial: i,
26
+ ref: b,
27
+ get: C,
28
+ set(d) {
29
+ (t().sync ? $ : tt)(() => M(d));
30
+ },
31
+ invoke(d, f) {
32
+ var a, N;
33
+ (N = (a = t()).onChange) == null || N.call(a, d, f);
34
+ },
35
+ hash(d) {
36
+ var f, a;
37
+ return ((a = (f = t()).hash) == null ? void 0 : a.call(f, d)) ?? String(d);
38
+ }
39
+ };
52
40
  }
53
- var { use: x } = O, D = w("__zag__targetCache", () => /* @__PURE__ */ new WeakMap());
54
- function q(t, e) {
55
- const { actions: r, context: o, sync: n } = e ?? {}, c = f(), s = f(), y = _(
56
- j((u) => M(t.state, u, n), [n]),
57
- () => {
58
- const u = g(t.state, x);
59
- try {
60
- if (c.current && s.current && !R(c.current, u, s.current, /* @__PURE__ */ new WeakMap()))
61
- return c.current;
62
- } catch {
63
- }
64
- return u;
41
+ L.cleanup = (t) => {
42
+ w(() => t, []);
43
+ };
44
+ L.ref = (t) => {
45
+ const o = g(t);
46
+ return {
47
+ get: () => o.current,
48
+ set: (c) => {
49
+ o.current = c;
50
+ }
51
+ };
52
+ };
53
+ function st(t) {
54
+ const o = g(t);
55
+ return {
56
+ get(c) {
57
+ return o.current[c];
65
58
  },
66
- () => g(t.state, x)
67
- );
68
- t.setOptions({ actions: r });
69
- const l = S(() => k(o ?? {}), [o]);
70
- P(() => {
71
- const u = Object.entries(l), h = t.contextSnapshot ?? {};
72
- u.map(([a, m]) => ({
73
- key: a,
74
- curr: m,
75
- prev: h[a],
76
- equal: p(h[a], m)
77
- })).every(({ equal: a }) => a) || t.setContext(l);
78
- }, [l]);
79
- const d = /* @__PURE__ */ new WeakMap();
80
- i(() => {
81
- c.current = y, s.current = d;
82
- });
83
- const v = S(() => /* @__PURE__ */ new WeakMap(), []);
84
- return W(y, d, v, D);
59
+ set(c, i) {
60
+ o.current[c] = i;
61
+ }
62
+ };
85
63
  }
86
- function Z(t) {
87
- return [q(t), t.send];
64
+ var ct = (t, o) => {
65
+ const c = g(!1), i = g(!1);
66
+ w(() => {
67
+ if (c.current && i.current) return o();
68
+ i.current = !0;
69
+ }, [...(t ?? []).map((v) => typeof v == "function" ? v() : v)]), w(() => (c.current = !0, () => {
70
+ c.current = !1;
71
+ }), []);
72
+ };
73
+ function St(t, o = {}) {
74
+ var P, _, D, G;
75
+ const c = nt(() => {
76
+ const { id: r, ids: e, getRootNode: n } = o;
77
+ return Y({ id: r, ids: e, getRootNode: n });
78
+ }, [o]), i = (...r) => {
79
+ t.debug && console.log(...r);
80
+ }, v = ((P = t.props) == null ? void 0 : P.call(t, { props: Z(o), scope: c })) ?? o, y = ft(v), z = (_ = t.context) == null ? void 0 : _.call(t, {
81
+ prop: y,
82
+ bindable: L,
83
+ scope: c,
84
+ flush: Q,
85
+ getContext() {
86
+ return R;
87
+ },
88
+ getComputed() {
89
+ return k;
90
+ },
91
+ getRefs() {
92
+ return m;
93
+ }
94
+ }), b = W(z), R = {
95
+ get(r) {
96
+ var e;
97
+ return (e = b.current) == null ? void 0 : e[r].ref.current;
98
+ },
99
+ set(r, e) {
100
+ var n;
101
+ (n = b.current) == null || n[r].set(e);
102
+ },
103
+ initial(r) {
104
+ var e;
105
+ return (e = b.current) == null ? void 0 : e[r].initial;
106
+ },
107
+ hash(r) {
108
+ var n, u;
109
+ const e = (n = b.current) == null ? void 0 : n[r].get();
110
+ return (u = b.current) == null ? void 0 : u[r].hash(e);
111
+ }
112
+ }, M = g(/* @__PURE__ */ new Map()), C = g(null), d = g(null), f = g({ type: "" }), a = () => ({
113
+ ...f.current,
114
+ current() {
115
+ return f.current;
116
+ },
117
+ previous() {
118
+ return d.current;
119
+ }
120
+ }), N = () => ({
121
+ ...p,
122
+ matches(...r) {
123
+ return r.includes(p.ref.current);
124
+ },
125
+ hasTag(r) {
126
+ var e, n;
127
+ return !!((n = (e = t.states[p.ref.current]) == null ? void 0 : e.tags) != null && n.includes(r));
128
+ }
129
+ }), m = st(((D = t.refs) == null ? void 0 : D.call(t, { prop: y, context: R })) ?? {}), E = () => ({
130
+ state: N(),
131
+ context: R,
132
+ event: a(),
133
+ prop: y,
134
+ send: B,
135
+ action: q,
136
+ guard: A,
137
+ track: ct,
138
+ refs: m,
139
+ computed: k,
140
+ flush: Q,
141
+ scope: c,
142
+ choose: I
143
+ }), q = (r) => {
144
+ const e = j(r) ? r(E()) : r;
145
+ if (!e) return;
146
+ const n = e.map((u) => {
147
+ var l, x;
148
+ const s = (x = (l = t.implementations) == null ? void 0 : l.actions) == null ? void 0 : x[u];
149
+ return s || H(`[zag-js] No implementation found for action "${JSON.stringify(u)}"`), s;
150
+ });
151
+ for (const u of n)
152
+ u == null || u(E());
153
+ }, A = (r) => {
154
+ var e, n;
155
+ return j(r) ? r(E()) : (n = (e = t.implementations) == null ? void 0 : e.guards) == null ? void 0 : n[r](E());
156
+ }, F = (r) => {
157
+ const e = j(r) ? r(E()) : r;
158
+ if (!e) return;
159
+ const n = e.map((s) => {
160
+ var x, S;
161
+ const l = (S = (x = t.implementations) == null ? void 0 : x.effects) == null ? void 0 : S[s];
162
+ return l || H(`[zag-js] No implementation found for effect "${JSON.stringify(s)}"`), l;
163
+ }), u = [];
164
+ for (const s of n) {
165
+ const l = s == null ? void 0 : s(E());
166
+ l && u.push(l);
167
+ }
168
+ return () => u.forEach((s) => s == null ? void 0 : s());
169
+ }, I = (r) => et(r).find((e) => {
170
+ let n = !e.guard;
171
+ return rt(e.guard) ? n = !!A(e.guard) : j(e.guard) && (n = e.guard(E())), n;
172
+ }), k = (r) => {
173
+ h(t.computed, () => "[zag-js] No computed object found on machine");
174
+ const e = t.computed[r];
175
+ return e({
176
+ context: R,
177
+ event: a(),
178
+ prop: y,
179
+ refs: m,
180
+ scope: c,
181
+ computed: k
182
+ });
183
+ }, p = L(() => ({
184
+ defaultValue: t.initialState({ prop: y }),
185
+ onChange(r, e) {
186
+ var u, s, l, x;
187
+ if (e) {
188
+ const S = M.current.get(e);
189
+ S == null || S(), M.current.delete(e);
190
+ }
191
+ e && q((u = t.states[e]) == null ? void 0 : u.exit), q((s = C.current) == null ? void 0 : s.actions);
192
+ const n = F((l = t.states[r]) == null ? void 0 : l.effects);
193
+ if (n && M.current.set(r, n), e === O) {
194
+ q(t.entry);
195
+ const S = F(t.effects);
196
+ S && M.current.set(O, S);
197
+ }
198
+ q((x = t.states[r]) == null ? void 0 : x.entry);
199
+ }
200
+ })), J = g(void 0), T = g(V.NotStarted);
201
+ U(() => {
202
+ queueMicrotask(() => {
203
+ const n = T.current === V.Started;
204
+ T.current = V.Started, i(n ? "rehydrating..." : "initializing...");
205
+ const u = J.current ?? p.initial;
206
+ p.invoke(u, n ? p.get() : O);
207
+ });
208
+ const r = M.current, e = p.ref.current;
209
+ return () => {
210
+ i("unmounting..."), J.current = e, T.current = V.Stopped, r.forEach((n) => n == null ? void 0 : n()), M.current = /* @__PURE__ */ new Map(), C.current = null, queueMicrotask(() => {
211
+ q(t.exit);
212
+ });
213
+ };
214
+ }, []);
215
+ const X = () => "ref" in p ? p.ref.current : p.get(), B = (r) => {
216
+ queueMicrotask(() => {
217
+ var x, S;
218
+ if (T.current !== V.Started) return;
219
+ d.current = f.current, f.current = r, i("send", r);
220
+ let e = X();
221
+ const n = (
222
+ // @ts-ignore
223
+ ((x = t.states[e].on) == null ? void 0 : x[r.type]) ?? // @ts-ignore
224
+ ((S = t.on) == null ? void 0 : S[r.type])
225
+ ), u = I(n);
226
+ if (!u) return;
227
+ C.current = u;
228
+ const s = u.target ?? e;
229
+ i("transition", u);
230
+ const l = s !== e;
231
+ l ? $(() => p.set(s)) : u.reenter && !l ? p.invoke(e, e) : q(u.actions ?? []);
232
+ });
233
+ };
234
+ return (G = t.watch) == null || G.call(t, E()), {
235
+ state: N(),
236
+ send: B,
237
+ context: R,
238
+ prop: y,
239
+ scope: c,
240
+ refs: m,
241
+ computed: k,
242
+ event: a(),
243
+ getStatus: () => T.current
244
+ };
88
245
  }
89
- function I(t) {
90
- const e = f();
91
- return e.current || (e.current = { v: t() }), e.current.v;
246
+ function W(t) {
247
+ const o = g(t);
248
+ return o.current = t, o;
92
249
  }
93
- var F = typeof document < "u" ? A : i;
94
- function G(t, e) {
95
- const { state: r, context: o } = e ?? {}, n = I(() => {
96
- const s = typeof t == "function" ? t() : t;
97
- return o && s.setContext(o), s._created(), s;
98
- }), c = f();
99
- return F(() => {
100
- const s = r ?? c.current;
101
- return n.start(s), () => {
102
- K() && (c.current = n.getHydrationState()), n.stop();
103
- };
104
- }, []), n;
250
+ function ft(t) {
251
+ const o = W(t);
252
+ return function(i) {
253
+ return o.current[i];
254
+ };
105
255
  }
106
- function $(t, e) {
107
- const r = G(t, e);
108
- return [q(r, e), r.send, r];
256
+ function Q(t) {
257
+ queueMicrotask(() => {
258
+ $(() => t());
259
+ });
109
260
  }
261
+ var vt = ot((t) => t);
110
262
  export {
111
- Y as normalizeProps,
112
- Z as useActor,
113
- $ as useMachine
263
+ yt as mergeProps,
264
+ vt as normalizeProps,
265
+ St as useMachine
114
266
  };
@@ -1,47 +1,34 @@
1
- import { isIos as x } from "../../dom-query/dist/index.js";
2
- var d = "data-zag-scroll-lock";
3
- function u(t, o) {
4
- if (!t) return;
5
- const e = t.style.cssText;
6
- return Object.assign(t.style, o), () => {
7
- t.style.cssText = e;
8
- };
9
- }
10
- function P(t, o, e) {
11
- if (!t) return;
12
- const r = t.style.getPropertyValue(o);
13
- return t.style.setProperty(o, e), () => {
14
- r ? t.style.setProperty(o, r) : t.style.removeProperty(o);
15
- };
16
- }
17
- function L(t) {
18
- const o = t.getBoundingClientRect().left;
19
- return Math.round(o) + t.scrollLeft ? "paddingLeft" : "paddingRight";
1
+ import { setStyleProperty as x, setStyle as p, isIos as L } from "../../dom-query/dist/index.js";
2
+ var i = "data-scroll-lock";
3
+ function m(r) {
4
+ const n = r.getBoundingClientRect().left;
5
+ return Math.round(n) + r.scrollLeft ? "paddingLeft" : "paddingRight";
20
6
  }
21
- function A(t) {
22
- const o = t ?? document, e = o.defaultView ?? window, { documentElement: r, body: c } = o;
23
- if (c.hasAttribute(d)) return;
24
- c.setAttribute(d, "");
25
- const l = e.innerWidth - r.clientWidth, p = () => P(r, "--scrollbar-width", `${l}px`), f = L(r), y = () => u(c, {
7
+ function $(r) {
8
+ const n = r ?? document, c = n.defaultView ?? window, { documentElement: s, body: e } = n;
9
+ if (e.hasAttribute(i)) return;
10
+ const l = c.innerWidth - s.clientWidth;
11
+ e.setAttribute(i, "");
12
+ const h = () => x(s, "--scrollbar-width", `${l}px`), f = m(s), u = () => p(e, {
26
13
  overflow: "hidden",
27
14
  [f]: `${l}px`
28
- }), h = () => {
29
- const { scrollX: s, scrollY: a, visualViewport: n } = e, b = (n == null ? void 0 : n.offsetLeft) ?? 0, S = (n == null ? void 0 : n.offsetTop) ?? 0, i = u(c, {
15
+ }), y = () => {
16
+ const { scrollX: t, scrollY: a, visualViewport: o } = c, g = (o == null ? void 0 : o.offsetLeft) ?? 0, S = (o == null ? void 0 : o.offsetTop) ?? 0, d = p(e, {
30
17
  position: "fixed",
31
18
  overflow: "hidden",
32
19
  top: `${-(a - Math.floor(S))}px`,
33
- left: `${-(s - Math.floor(b))}px`,
20
+ left: `${-(t - Math.floor(g))}px`,
34
21
  right: "0",
35
22
  [f]: `${l}px`
36
23
  });
37
24
  return () => {
38
- i == null || i(), e.scrollTo({ left: s, top: a, behavior: "instant" });
25
+ d == null || d(), c.scrollTo({ left: t, top: a, behavior: "instant" });
39
26
  };
40
- }, g = [p(), x() ? h() : y()];
27
+ }, b = [h(), L() ? y() : u()];
41
28
  return () => {
42
- g.forEach((s) => s == null ? void 0 : s()), c.removeAttribute(d);
29
+ b.forEach((t) => t == null ? void 0 : t()), e.removeAttribute(i);
43
30
  };
44
31
  }
45
32
  export {
46
- A as preventBodyScroll
33
+ $ as preventBodyScroll
47
34
  };