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