@serendie/ui 3.5.1-dev.202606091509 → 3.5.1
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/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
- package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +1 -1
- package/dist/components/Tabs/TabItem.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/i18n/provider.d.ts +1 -1
- package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +50 -49
- package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +68 -70
- package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +308 -322
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +79 -93
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +43 -35
- package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +35 -36
- package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +37 -27
- package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +41 -56
- package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +31 -51
- package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +25 -46
- package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +21 -13
- package/dist/node_modules/@zag-js/live-region/dist/index.js +19 -29
- package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +135 -138
- package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
- package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
- package/dist/node_modules/@zag-js/popper/dist/get-placement.js +71 -82
- package/dist/node_modules/@zag-js/react/dist/machine.js +96 -105
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +26 -34
- package/dist/node_modules/@zag-js/select/dist/select.connect.js +101 -104
- package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
- package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +60 -63
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +25 -27
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +14 -15
- package/dist/theme/initColorScheme.d.ts +1 -1
- package/package.json +8 -8
- package/dist/node_modules/@zag-js/date-utils/dist/locale.js +0 -12
- package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +0 -11
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { flushSync as
|
|
3
|
-
import { useBindable as
|
|
4
|
-
import { useRefs as
|
|
5
|
-
import { useTrack as
|
|
6
|
-
import { useSafeLayoutEffect as
|
|
7
|
-
import { createScope as
|
|
8
|
-
import { compact as
|
|
9
|
-
import { ensure as
|
|
10
|
-
import { MachineStatus as E, INIT_STATE as
|
|
11
|
-
import { getExitEnterStates as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const S = P(() => {
|
|
1
|
+
import { useMemo as Y, useRef as d } from "react";
|
|
2
|
+
import { flushSync as Q } from "react-dom";
|
|
3
|
+
import { useBindable as D } from "./bindable.js";
|
|
4
|
+
import { useRefs as Z } from "./refs.js";
|
|
5
|
+
import { useTrack as P } from "./track.js";
|
|
6
|
+
import { useSafeLayoutEffect as h } from "./use-layout-effect.js";
|
|
7
|
+
import { createScope as tt } from "../../core/dist/scope.js";
|
|
8
|
+
import { compact as rt } from "../../utils/dist/object.js";
|
|
9
|
+
import { ensure as et, warn as G } from "../../utils/dist/warning.js";
|
|
10
|
+
import { MachineStatus as E, INIT_STATE as w } from "../../core/dist/types.js";
|
|
11
|
+
import { getExitEnterStates as nt, resolveStateValue as H, findTransition as ot, hasTag as st, matchesState as ut } from "../../core/dist/state.js";
|
|
12
|
+
import { isFunction as q, isString as ct } from "../../utils/dist/guard.js";
|
|
13
|
+
import { toArray as ft } from "../../utils/dist/array.js";
|
|
14
|
+
function yt(e, a = {}) {
|
|
15
|
+
var O, V, B, F;
|
|
16
|
+
const l = Y(() => {
|
|
18
17
|
const { id: r, ids: t, getRootNode: n } = a;
|
|
19
|
-
return
|
|
18
|
+
return tt({ id: r, ids: t, getRootNode: n });
|
|
20
19
|
}, [a]), R = (...r) => {
|
|
21
20
|
e.debug && console.log(...r);
|
|
22
|
-
},
|
|
23
|
-
prop:
|
|
24
|
-
bindable:
|
|
25
|
-
scope:
|
|
26
|
-
flush:
|
|
21
|
+
}, W = ((O = e.props) == null ? void 0 : O.call(e, { props: rt(a), scope: l })) ?? a, S = it(W), X = (V = e.context) == null ? void 0 : V.call(e, {
|
|
22
|
+
prop: S,
|
|
23
|
+
bindable: D,
|
|
24
|
+
scope: l,
|
|
25
|
+
flush: K,
|
|
27
26
|
getContext() {
|
|
28
|
-
return
|
|
27
|
+
return M;
|
|
29
28
|
},
|
|
30
29
|
getComputed() {
|
|
31
30
|
return j;
|
|
@@ -36,7 +35,7 @@ function jt(e, a = {}) {
|
|
|
36
35
|
getEvent() {
|
|
37
36
|
return T();
|
|
38
37
|
}
|
|
39
|
-
}), v = X
|
|
38
|
+
}), v = U(X), M = {
|
|
40
39
|
get(r) {
|
|
41
40
|
var t;
|
|
42
41
|
return (t = v.current) == null ? void 0 : t[r].ref.current;
|
|
@@ -54,164 +53,156 @@ function jt(e, a = {}) {
|
|
|
54
53
|
const t = (n = v.current) == null ? void 0 : n[r].get();
|
|
55
54
|
return (u = v.current) == null ? void 0 : u[r].hash(t);
|
|
56
55
|
}
|
|
57
|
-
},
|
|
56
|
+
}, m = d(/* @__PURE__ */ new Map()), N = d(null), z = d(null), y = d({ type: "" }), T = () => ({
|
|
58
57
|
...y.current,
|
|
59
58
|
current() {
|
|
60
59
|
return y.current;
|
|
61
60
|
},
|
|
62
61
|
previous() {
|
|
63
|
-
return
|
|
62
|
+
return z.current;
|
|
64
63
|
}
|
|
65
|
-
}),
|
|
64
|
+
}), C = () => ({
|
|
66
65
|
...i,
|
|
67
66
|
matches(...r) {
|
|
68
|
-
return r.some((t) =>
|
|
67
|
+
return r.some((t) => ut(i.ref.current, t));
|
|
69
68
|
},
|
|
70
69
|
hasTag(r) {
|
|
71
|
-
return
|
|
70
|
+
return st(e, i.ref.current, r);
|
|
72
71
|
}
|
|
73
|
-
}), b =
|
|
74
|
-
state:
|
|
75
|
-
context:
|
|
72
|
+
}), b = Z(((B = e.refs) == null ? void 0 : B.call(e, { prop: S, context: M })) ?? {}), p = () => ({
|
|
73
|
+
state: C(),
|
|
74
|
+
context: M,
|
|
76
75
|
event: T(),
|
|
77
|
-
prop:
|
|
76
|
+
prop: S,
|
|
78
77
|
send: L,
|
|
79
|
-
action:
|
|
78
|
+
action: g,
|
|
80
79
|
guard: k,
|
|
81
|
-
track:
|
|
80
|
+
track: P,
|
|
82
81
|
refs: b,
|
|
83
82
|
computed: j,
|
|
84
|
-
flush:
|
|
85
|
-
scope:
|
|
86
|
-
choose:
|
|
87
|
-
}),
|
|
88
|
-
const t = q(r) ? r(
|
|
83
|
+
flush: K,
|
|
84
|
+
scope: l,
|
|
85
|
+
choose: A
|
|
86
|
+
}), g = (r) => {
|
|
87
|
+
const t = q(r) ? r(p()) : r;
|
|
89
88
|
if (!t) return;
|
|
90
89
|
const n = t.map((u) => {
|
|
91
90
|
var f, s;
|
|
92
91
|
const o = (s = (f = e.implementations) == null ? void 0 : f.actions) == null ? void 0 : s[u];
|
|
93
|
-
return o ||
|
|
92
|
+
return o || G(`[zag-js] No implementation found for action "${JSON.stringify(u)}"`), o;
|
|
94
93
|
});
|
|
95
94
|
for (const u of n)
|
|
96
|
-
u == null || u(
|
|
95
|
+
u == null || u(p());
|
|
97
96
|
}, k = (r) => {
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, A = (r) => {
|
|
103
|
-
const t = q(r) ? r(g()) : r;
|
|
97
|
+
var t, n;
|
|
98
|
+
return q(r) ? r(p()) : (n = (t = e.implementations) == null ? void 0 : t.guards) == null ? void 0 : n[r](p());
|
|
99
|
+
}, $ = (r) => {
|
|
100
|
+
const t = q(r) ? r(p()) : r;
|
|
104
101
|
if (!t) return;
|
|
105
102
|
const n = t.map((o) => {
|
|
106
103
|
var s, c;
|
|
107
104
|
const f = (c = (s = e.implementations) == null ? void 0 : s.effects) == null ? void 0 : c[o];
|
|
108
|
-
return f ||
|
|
105
|
+
return f || G(`[zag-js] No implementation found for effect "${JSON.stringify(o)}"`), f;
|
|
109
106
|
}), u = [];
|
|
110
107
|
for (const o of n) {
|
|
111
|
-
const f = o == null ? void 0 : o(
|
|
108
|
+
const f = o == null ? void 0 : o(p());
|
|
112
109
|
f && u.push(f);
|
|
113
110
|
}
|
|
114
111
|
return () => u.forEach((o) => o == null ? void 0 : o());
|
|
115
|
-
},
|
|
112
|
+
}, A = (r) => ft(r).find((t) => {
|
|
116
113
|
let n = !t.guard;
|
|
117
|
-
return
|
|
114
|
+
return ct(t.guard) ? n = !!k(t.guard) : q(t.guard) && (n = t.guard(p())), n;
|
|
118
115
|
}), j = (r) => {
|
|
119
|
-
|
|
116
|
+
et(e.computed, () => "[zag-js] No computed object found on machine");
|
|
120
117
|
const t = e.computed[r];
|
|
121
118
|
return t({
|
|
122
|
-
context:
|
|
119
|
+
context: M,
|
|
123
120
|
event: T(),
|
|
124
|
-
prop:
|
|
121
|
+
prop: S,
|
|
125
122
|
refs: b,
|
|
126
|
-
scope:
|
|
123
|
+
scope: l,
|
|
127
124
|
computed: j
|
|
128
125
|
});
|
|
129
|
-
}, i =
|
|
130
|
-
defaultValue:
|
|
126
|
+
}, i = D(() => ({
|
|
127
|
+
defaultValue: H(e, e.initialState({ prop: S })),
|
|
131
128
|
onChange(r, t) {
|
|
132
129
|
var o, f;
|
|
133
|
-
const { exiting: n, entering: u } =
|
|
130
|
+
const { exiting: n, entering: u } = nt(e, t, r, (o = N.current) == null ? void 0 : o.reenter);
|
|
134
131
|
if (n.forEach((s) => {
|
|
135
|
-
const c =
|
|
136
|
-
c == null || c(),
|
|
132
|
+
const c = m.current.get(s.path);
|
|
133
|
+
c == null || c(), m.current.delete(s.path);
|
|
137
134
|
}), n.forEach((s) => {
|
|
138
135
|
var c;
|
|
139
|
-
|
|
140
|
-
}),
|
|
141
|
-
var
|
|
142
|
-
const c =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
d(e.entry);
|
|
149
|
-
const s = A(e.effects);
|
|
150
|
-
if (s) {
|
|
151
|
-
const c = p.current.get(z);
|
|
152
|
-
p.current.set(z, c ? Q(c, s) : s);
|
|
153
|
-
}
|
|
136
|
+
g((c = s.state) == null ? void 0 : c.exit);
|
|
137
|
+
}), g((f = N.current) == null ? void 0 : f.actions), u.forEach((s) => {
|
|
138
|
+
var _;
|
|
139
|
+
const c = $((_ = s.state) == null ? void 0 : _.effects);
|
|
140
|
+
c && m.current.set(s.path, c);
|
|
141
|
+
}), t === w) {
|
|
142
|
+
g(e.entry);
|
|
143
|
+
const s = $(e.effects);
|
|
144
|
+
s && m.current.set(w, s);
|
|
154
145
|
}
|
|
155
146
|
u.forEach((s) => {
|
|
156
147
|
var c;
|
|
157
|
-
|
|
148
|
+
g((c = s.state) == null ? void 0 : c.entry);
|
|
158
149
|
});
|
|
159
150
|
}
|
|
160
|
-
})),
|
|
161
|
-
|
|
151
|
+
})), I = d(void 0), x = d(E.NotStarted);
|
|
152
|
+
h(() => {
|
|
162
153
|
queueMicrotask(() => {
|
|
163
154
|
const t = x.current === E.Started;
|
|
164
155
|
x.current = E.Started, R(t ? "rehydrating..." : "initializing...");
|
|
165
|
-
const n =
|
|
166
|
-
i.invoke(n, t ? i.get() :
|
|
156
|
+
const n = I.current ?? i.initial;
|
|
157
|
+
i.invoke(n, t ? i.get() : w);
|
|
167
158
|
});
|
|
168
|
-
const r =
|
|
159
|
+
const r = m.current;
|
|
169
160
|
return () => {
|
|
170
|
-
const t =
|
|
171
|
-
R("unmounting..."),
|
|
172
|
-
|
|
161
|
+
const t = J();
|
|
162
|
+
R("unmounting..."), I.current = t, x.current = E.Stopped, r.forEach((n) => n == null ? void 0 : n()), m.current = /* @__PURE__ */ new Map(), N.current = null, queueMicrotask(() => {
|
|
163
|
+
g(e.exit), x.current = E.Stopped;
|
|
173
164
|
});
|
|
174
165
|
};
|
|
175
166
|
}, []);
|
|
176
|
-
const
|
|
167
|
+
const J = () => "ref" in i ? i.ref.current : i.get(), L = (r) => {
|
|
177
168
|
queueMicrotask(() => {
|
|
178
169
|
if (x.current !== E.Started) return;
|
|
179
|
-
|
|
180
|
-
let t =
|
|
181
|
-
const { transitions: n, source: u } =
|
|
170
|
+
z.current = y.current, y.current = r;
|
|
171
|
+
let t = J();
|
|
172
|
+
const { transitions: n, source: u } = ot(e, t, r.type), o = A(n);
|
|
182
173
|
if (!o) return;
|
|
183
|
-
|
|
184
|
-
const f =
|
|
185
|
-
R("transition", r.type, o.target || t, `(${o.actions})`), f !== t ?
|
|
174
|
+
N.current = o;
|
|
175
|
+
const f = H(e, o.target ?? t, u);
|
|
176
|
+
R("transition", r.type, o.target || t, `(${o.actions})`), f !== t ? Q(() => i.set(f)) : o.reenter ? i.invoke(t, t) : g(o.actions ?? []);
|
|
186
177
|
});
|
|
187
178
|
};
|
|
188
|
-
return (
|
|
189
|
-
state:
|
|
179
|
+
return (F = e.watch) == null || F.call(e, p()), {
|
|
180
|
+
state: C(),
|
|
190
181
|
send: L,
|
|
191
|
-
context:
|
|
192
|
-
prop:
|
|
193
|
-
scope:
|
|
182
|
+
context: M,
|
|
183
|
+
prop: S,
|
|
184
|
+
scope: l,
|
|
194
185
|
refs: b,
|
|
195
186
|
computed: j,
|
|
196
187
|
event: T(),
|
|
197
188
|
getStatus: () => x.current
|
|
198
189
|
};
|
|
199
190
|
}
|
|
200
|
-
function
|
|
201
|
-
const a =
|
|
191
|
+
function U(e) {
|
|
192
|
+
const a = d(e);
|
|
202
193
|
return a.current = e, a;
|
|
203
194
|
}
|
|
204
|
-
function
|
|
205
|
-
const a =
|
|
195
|
+
function it(e) {
|
|
196
|
+
const a = U(e);
|
|
206
197
|
return function(R) {
|
|
207
198
|
return a.current[R];
|
|
208
199
|
};
|
|
209
200
|
}
|
|
210
|
-
function
|
|
201
|
+
function K(e) {
|
|
211
202
|
queueMicrotask(() => {
|
|
212
|
-
|
|
203
|
+
Q(() => e());
|
|
213
204
|
});
|
|
214
205
|
}
|
|
215
206
|
export {
|
|
216
|
-
|
|
207
|
+
yt as useMachine
|
|
217
208
|
};
|
|
@@ -1,51 +1,43 @@
|
|
|
1
|
-
import { isIos as
|
|
2
|
-
import { getComputedStyle as
|
|
3
|
-
import { setStyleProperty as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return Math.round(
|
|
1
|
+
import { isIos as A } from "../../dom-query/dist/platform.js";
|
|
2
|
+
import { getComputedStyle as P } from "../../dom-query/dist/computed-style.js";
|
|
3
|
+
import { setStyleProperty as W, setStyle as h } from "../../dom-query/dist/set.js";
|
|
4
|
+
var i = "data-scroll-lock";
|
|
5
|
+
function $(r) {
|
|
6
|
+
const e = r.getBoundingClientRect().left;
|
|
7
|
+
return Math.round(e) + r.scrollLeft ? "paddingLeft" : "paddingRight";
|
|
8
8
|
}
|
|
9
|
-
function b(
|
|
10
|
-
const
|
|
9
|
+
function b(r) {
|
|
10
|
+
const e = P(r), t = e == null ? void 0 : e.scrollbarGutter;
|
|
11
11
|
return t === "stable" || (t == null ? void 0 : t.startsWith("stable ")) === !0;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
13
|
+
function k(r) {
|
|
14
|
+
const e = r ?? document, t = e.defaultView ?? window, { documentElement: l, body: n } = e;
|
|
15
|
+
if (n.hasAttribute(i)) return;
|
|
16
|
+
const f = b(l) || b(n), c = t.innerWidth - l.clientWidth;
|
|
17
|
+
n.setAttribute(i, "");
|
|
18
|
+
const y = () => W(l, "--scrollbar-width", `${c}px`), a = $(l), S = () => {
|
|
19
|
+
const o = {
|
|
18
20
|
overflow: "hidden"
|
|
19
21
|
};
|
|
20
|
-
return !
|
|
22
|
+
return !f && c > 0 && (o[a] = `${c}px`), h(n, o);
|
|
21
23
|
}, g = () => {
|
|
22
|
-
const { scrollX:
|
|
24
|
+
const { scrollX: o, scrollY: p, visualViewport: s } = t, x = (s == null ? void 0 : s.offsetLeft) ?? 0, L = (s == null ? void 0 : s.offsetTop) ?? 0, u = {
|
|
23
25
|
position: "fixed",
|
|
24
26
|
overflow: "hidden",
|
|
25
|
-
top: `${-(
|
|
26
|
-
left: `${-(
|
|
27
|
+
top: `${-(p - Math.floor(L))}px`,
|
|
28
|
+
left: `${-(o - Math.floor(x))}px`,
|
|
27
29
|
right: "0"
|
|
28
30
|
};
|
|
29
|
-
!
|
|
30
|
-
const
|
|
31
|
+
!f && c > 0 && (u[a] = `${c}px`);
|
|
32
|
+
const d = h(n, u);
|
|
31
33
|
return () => {
|
|
32
|
-
|
|
34
|
+
d == null || d(), t.scrollTo({ left: o, top: p, behavior: "instant" });
|
|
33
35
|
};
|
|
34
|
-
}, m = [y(),
|
|
36
|
+
}, m = [y(), A() ? g() : S()];
|
|
35
37
|
return () => {
|
|
36
|
-
m.forEach((
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function B(e) {
|
|
40
|
-
const o = e ?? document;
|
|
41
|
-
let t = i.get(o);
|
|
42
|
-
t || (t = { count: 0, cleanup: P(o) }, i.set(o, t)), t.count++;
|
|
43
|
-
const r = t;
|
|
44
|
-
let s = !1;
|
|
45
|
-
return () => {
|
|
46
|
-
s || (s = !0, r.count--, r.count === 0 && (r.cleanup(), i.delete(o)));
|
|
38
|
+
m.forEach((o) => o == null ? void 0 : o()), n.removeAttribute(i);
|
|
47
39
|
};
|
|
48
40
|
}
|
|
49
41
|
export {
|
|
50
|
-
|
|
42
|
+
k as preventBodyScroll
|
|
51
43
|
};
|