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