@serendie/ui 3.5.1-dev.202605201240 → 3.5.1-dev.202606091509

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 (39) hide show
  1. package/dist/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  2. package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
  3. package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
  4. package/dist/components/Divider/Divider.d.ts +1 -1
  5. package/dist/components/List/List.d.ts +1 -1
  6. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  7. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +1 -1
  8. package/dist/components/Tabs/TabItem.d.ts +1 -1
  9. package/dist/components/Tabs/Tabs.d.ts +1 -1
  10. package/dist/i18n/provider.d.ts +1 -1
  11. package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +49 -50
  12. package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +70 -68
  13. package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
  14. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +322 -308
  15. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +93 -79
  16. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +35 -43
  17. package/dist/node_modules/@zag-js/date-utils/dist/locale.js +12 -0
  18. package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +36 -35
  19. package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +27 -37
  20. package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +56 -41
  21. package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +51 -31
  22. package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +46 -25
  23. package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
  24. package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +13 -21
  25. package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +11 -0
  26. package/dist/node_modules/@zag-js/live-region/dist/index.js +29 -19
  27. package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +138 -135
  28. package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
  29. package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
  30. package/dist/node_modules/@zag-js/popper/dist/get-placement.js +82 -71
  31. package/dist/node_modules/@zag-js/react/dist/machine.js +105 -96
  32. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +34 -26
  33. package/dist/node_modules/@zag-js/select/dist/select.connect.js +104 -101
  34. package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
  35. package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +63 -60
  36. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +27 -25
  37. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -14
  38. package/dist/theme/initColorScheme.d.ts +1 -1
  39. package/package.json +8 -8
@@ -1,30 +1,31 @@
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(() => {
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 tt({ id: r, ids: t, getRootNode: n });
19
+ return et({ id: r, ids: t, getRootNode: n });
19
20
  }, [a]), R = (...r) => {
20
21
  e.debug && console.log(...r);
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,
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 M;
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 = U(X), M = {
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
- }, m = d(/* @__PURE__ */ new Map()), N = d(null), z = d(null), y = d({ type: "" }), T = () => ({
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 z.current;
63
+ return C.current;
63
64
  }
64
- }), C = () => ({
65
+ }), $ = () => ({
65
66
  ...i,
66
67
  matches(...r) {
67
- return r.some((t) => ut(i.ref.current, t));
68
+ return r.some((t) => ft(i.ref.current, t));
68
69
  },
69
70
  hasTag(r) {
70
- return st(e, i.ref.current, r);
71
+ return ct(e, i.ref.current, r);
71
72
  }
72
- }), b = Z(((B = e.refs) == null ? void 0 : B.call(e, { prop: S, context: M })) ?? {}), p = () => ({
73
- state: C(),
74
- context: M,
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: S,
77
+ prop: m,
77
78
  send: L,
78
- action: g,
79
+ action: d,
79
80
  guard: k,
80
- track: P,
81
+ track: tt,
81
82
  refs: b,
82
83
  computed: j,
83
- flush: K,
84
- scope: l,
85
- choose: A
86
- }), g = (r) => {
87
- const t = q(r) ? r(p()) : 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 || G(`[zag-js] No implementation found for action "${JSON.stringify(u)}"`), 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(p());
96
+ u == null || u(g());
96
97
  }, k = (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;
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 || G(`[zag-js] No implementation found for effect "${JSON.stringify(o)}"`), 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(p());
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
- }, A = (r) => ft(r).find((t) => {
115
+ }, J = (r) => at(r).find((t) => {
113
116
  let n = !t.guard;
114
- return ct(t.guard) ? n = !!k(t.guard) : q(t.guard) && (n = t.guard(p())), n;
117
+ return it(t.guard) ? n = !!k(t.guard) : q(t.guard) && (n = t.guard(g())), n;
115
118
  }), j = (r) => {
116
- et(e.computed, () => "[zag-js] No computed object found on machine");
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: M,
122
+ context: N,
120
123
  event: T(),
121
- prop: S,
124
+ prop: m,
122
125
  refs: b,
123
- scope: l,
126
+ scope: S,
124
127
  computed: j
125
128
  });
126
- }, i = D(() => ({
127
- defaultValue: H(e, e.initialState({ prop: S })),
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 } = nt(e, t, r, (o = N.current) == null ? void 0 : o.reenter);
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 = m.current.get(s.path);
133
- c == null || c(), m.current.delete(s.path);
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
- 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);
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
- g((c = s.state) == null ? void 0 : c.entry);
157
+ d((c = s.state) == null ? void 0 : c.entry);
149
158
  });
150
159
  }
151
- })), I = d(void 0), x = d(E.NotStarted);
152
- h(() => {
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 = I.current ?? i.initial;
157
- i.invoke(n, t ? i.get() : w);
165
+ const n = O.current ?? i.initial;
166
+ i.invoke(n, t ? i.get() : z);
158
167
  });
159
- const r = m.current;
168
+ const r = p.current;
160
169
  return () => {
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;
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 J = () => "ref" in i ? i.ref.current : i.get(), L = (r) => {
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
- 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);
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
- 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 ?? []);
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 (F = e.watch) == null || F.call(e, p()), {
180
- state: C(),
188
+ return (_ = e.watch) == null || _.call(e, g()), {
189
+ state: $(),
181
190
  send: L,
182
- context: M,
183
- prop: S,
184
- scope: l,
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 U(e) {
192
- const a = d(e);
200
+ function X(e) {
201
+ const a = l(e);
193
202
  return a.current = e, a;
194
203
  }
195
- function it(e) {
196
- const a = U(e);
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 K(e) {
210
+ function U(e) {
202
211
  queueMicrotask(() => {
203
- Q(() => e());
212
+ W(() => e());
204
213
  });
205
214
  }
206
215
  export {
207
- yt as useMachine
216
+ jt as useMachine
208
217
  };
@@ -1,43 +1,51 @@
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";
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(r) {
10
- const e = P(r), t = e == null ? void 0 : e.scrollbarGutter;
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 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 = {
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 !f && c > 0 && (o[a] = `${c}px`), h(n, o);
20
+ return !s && l > 0 && (n[d] = `${l}px`), u(r, n);
23
21
  }, g = () => {
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 = {
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: `${-(p - Math.floor(L))}px`,
28
- left: `${-(o - Math.floor(x))}px`,
25
+ top: `${-(f - Math.floor(x))}px`,
26
+ left: `${-(n - Math.floor(L))}px`,
29
27
  right: "0"
30
28
  };
31
- !f && c > 0 && (u[a] = `${c}px`);
32
- const d = h(n, u);
29
+ !s && l > 0 && (p[d] = `${l}px`);
30
+ const a = u(r, p);
33
31
  return () => {
34
- d == null || d(), t.scrollTo({ left: o, top: p, behavior: "instant" });
32
+ a == null || a(), o.scrollTo({ left: n, top: f, behavior: "instant" });
35
33
  };
36
- }, m = [y(), A() ? g() : S()];
34
+ }, m = [y(), M() ? g() : S()];
37
35
  return () => {
38
- m.forEach((o) => o == null ? void 0 : o()), n.removeAttribute(i);
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
- k as preventBodyScroll
50
+ B as preventBodyScroll
43
51
  };