@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.
- package/dist/components/CheckBox/CheckBox.js +36 -35
- package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
- package/dist/components/DataTable/DataTableComponent.js +38 -36
- package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +34 -33
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +47 -41
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.js +70 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
- package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
- package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
- package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
- package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
- package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
- package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
- package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
- package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
- package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
- package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
- package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
- package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
- package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
- package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
- package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
- package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
- package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
- package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
- package/dist/node_modules/proxy-compare/dist/index.js +4 -106
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
- package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
- package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
- package/dist/node_modules/klona/full/index.js +0 -21
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,114 +1,266 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
87
|
-
|
|
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
|
|
90
|
-
const
|
|
91
|
-
return
|
|
246
|
+
function W(t) {
|
|
247
|
+
const o = g(t);
|
|
248
|
+
return o.current = t, o;
|
|
92
249
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
107
|
-
|
|
108
|
-
|
|
256
|
+
function Q(t) {
|
|
257
|
+
queueMicrotask(() => {
|
|
258
|
+
$(() => t());
|
|
259
|
+
});
|
|
109
260
|
}
|
|
261
|
+
var vt = ot((t) => t);
|
|
110
262
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
263
|
+
yt as mergeProps,
|
|
264
|
+
vt as normalizeProps,
|
|
265
|
+
St as useMachine
|
|
114
266
|
};
|
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
c.
|
|
25
|
-
|
|
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
|
-
}),
|
|
29
|
-
const { scrollX:
|
|
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: `${-(
|
|
20
|
+
left: `${-(t - Math.floor(g))}px`,
|
|
34
21
|
right: "0",
|
|
35
22
|
[f]: `${l}px`
|
|
36
23
|
});
|
|
37
24
|
return () => {
|
|
38
|
-
|
|
25
|
+
d == null || d(), c.scrollTo({ left: t, top: a, behavior: "instant" });
|
|
39
26
|
};
|
|
40
|
-
},
|
|
27
|
+
}, b = [h(), L() ? y() : u()];
|
|
41
28
|
return () => {
|
|
42
|
-
|
|
29
|
+
b.forEach((t) => t == null ? void 0 : t()), e.removeAttribute(i);
|
|
43
30
|
};
|
|
44
31
|
}
|
|
45
32
|
export {
|
|
46
|
-
|
|
33
|
+
$ as preventBodyScroll
|
|
47
34
|
};
|