@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.
Files changed (47) hide show
  1. package/dist/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  2. package/dist/components/DataTable/DataTable.sampleData.d.ts +12 -0
  3. package/dist/components/DataTable/DataTable.sampleData.test.d.ts +1 -0
  4. package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
  5. package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
  6. package/dist/components/Divider/Divider.d.ts +1 -1
  7. package/dist/components/List/List.d.ts +1 -1
  8. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +1 -0
  9. package/dist/components/ProgressIndicator/AnimatedArc.js +31 -34
  10. package/dist/components/ProgressIndicator/AnimatedArc.test.d.ts +1 -0
  11. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  12. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +2 -1
  13. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +49 -36
  14. package/dist/components/ProgressIndicator/animatedArcProps.d.ts +11 -0
  15. package/dist/components/ProgressIndicator/animatedArcProps.js +19 -0
  16. package/dist/components/Tabs/TabItem.d.ts +1 -1
  17. package/dist/components/Tabs/Tabs.d.ts +1 -1
  18. package/dist/i18n/provider.d.ts +1 -1
  19. package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +49 -50
  20. package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +70 -68
  21. package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
  22. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +322 -308
  23. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +93 -79
  24. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +35 -43
  25. package/dist/node_modules/@zag-js/date-utils/dist/locale.js +12 -0
  26. package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +36 -35
  27. package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +27 -37
  28. package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +56 -41
  29. package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +51 -31
  30. package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +46 -25
  31. package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
  32. package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +13 -21
  33. package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +11 -0
  34. package/dist/node_modules/@zag-js/live-region/dist/index.js +29 -19
  35. package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +138 -135
  36. package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
  37. package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
  38. package/dist/node_modules/@zag-js/popper/dist/get-placement.js +82 -71
  39. package/dist/node_modules/@zag-js/react/dist/machine.js +105 -96
  40. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +34 -26
  41. package/dist/node_modules/@zag-js/select/dist/select.connect.js +104 -101
  42. package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
  43. package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +63 -60
  44. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +27 -25
  45. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -14
  46. package/dist/theme/initColorScheme.d.ts +1 -1
  47. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- import { getByTypeahead as v } from "../../dom-query/dist/typeahead.js";
1
+ import { getByTypeahead as c } from "../../dom-query/dist/typeahead.js";
2
2
  import { getWindow as I, isHTMLElement as u, contains as f } from "../../dom-query/dist/node.js";
3
3
  import { prev as p, next as E, last as y, first as $ } from "../../utils/dist/array.js";
4
4
  import { isFunction as l } from "../../utils/dist/guard.js";
@@ -14,7 +14,7 @@ var m = (e, t) => {
14
14
  }, d = (e) => {
15
15
  var t;
16
16
  return ((t = e.ids) == null ? void 0 : t.content) ?? `menu:${e.id}:content`;
17
- }, M = (e) => {
17
+ }, N = (e) => {
18
18
  var t;
19
19
  return ((t = e.ids) == null ? void 0 : t.arrow) ?? `menu:${e.id}:arrow`;
20
20
  }, T = (e) => {
@@ -23,21 +23,21 @@ var m = (e, t) => {
23
23
  }, W = (e, t) => {
24
24
  var r, n;
25
25
  return ((n = (r = e.ids) == null ? void 0 : r.group) == null ? void 0 : n.call(r, t)) ?? `menu:${e.id}:group:${t}`;
26
- }, h = (e, t) => `${e.id}/${t}`, G = (e) => (e == null ? void 0 : e.dataset.value) ?? null, j = (e, t) => {
26
+ }, h = (e, t) => `${e.id}/${t}`, D = (e) => (e == null ? void 0 : e.dataset.value) ?? null, G = (e, t) => {
27
27
  var r, n;
28
28
  return ((n = (r = e.ids) == null ? void 0 : r.groupLabel) == null ? void 0 : n.call(r, t)) ?? `menu:${e.id}:group-label:${t}`;
29
- }, c = (e) => e.getById(d(e)), q = (e) => e.getById(T(e)), w = (e) => e.getById(m(e)), H = (e, t) => t ? e.getById(h(e, t)) : null, K = (e) => e.getById(b(e)), B = (e) => a(e.getDoc(), `[data-scope="menu"][data-part="trigger"][data-ownedby="${e.id}"]`), N = (e) => a(e.getDoc(), `[data-scope="menu"][data-part="context-trigger"][data-ownedby="${e.id}"]`), O = (e, t) => t == null ? w(e) ?? B(e)[0] : e.getById(m(e, t)), o = (e) => {
29
+ }, v = (e) => e.getById(d(e)), R = (e) => e.getById(T(e)), w = (e) => e.getById(m(e)), j = (e, t) => t ? e.getById(h(e, t)) : null, q = (e) => e.getById(b(e)), B = (e) => a(e.getRootNode(), `[data-scope="menu"][data-part="trigger"][data-ownedby="${e.id}"]`), H = (e) => a(e.getRootNode(), `[data-scope="menu"][data-part="context-trigger"][data-ownedby="${e.id}"]`), K = (e, t) => t == null ? w(e) ?? B(e)[0] : e.getById(m(e, t)), o = (e) => {
30
30
  const r = `[role^="menuitem"][data-ownedby=${CSS.escape(d(e))}]:not([data-disabled])`;
31
- return a(c(e), r);
32
- }, V = (e) => $(o(e)), z = (e) => y(o(e)), g = (e, t) => t ? e.id === t || e.dataset.value === t : !1, J = (e, t) => {
31
+ return a(v(e), r);
32
+ }, O = (e) => $(o(e)), V = (e) => y(o(e)), g = (e, t) => t ? e.id === t || e.dataset.value === t : !1, z = (e, t) => {
33
33
  const r = o(e), n = r.findIndex((i) => g(i, t.value));
34
34
  return E(r, n, { loop: t.loop ?? t.loopFocus });
35
- }, Q = (e, t) => {
35
+ }, J = (e, t) => {
36
36
  const r = o(e), n = r.findIndex((i) => g(i, t.value));
37
37
  return p(r, n, { loop: t.loop ?? t.loopFocus });
38
- }, R = (e, t) => {
38
+ }, Q = (e, t) => {
39
39
  const r = o(e), n = r.find((i) => g(i, t.value));
40
- return v(r, { state: t.typeaheadState, key: t.key, activeId: (n == null ? void 0 : n.id) ?? null });
40
+ return c(r, { state: t.typeaheadState, key: t.key, activeId: (n == null ? void 0 : n.id) ?? null });
41
41
  }, U = (e) => u(e) && (e.dataset.disabled === "" || e.hasAttribute("disabled")), X = (e) => {
42
42
  var t;
43
43
  return !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem")) && !!(e != null && e.hasAttribute("data-controls"));
@@ -49,7 +49,7 @@ function Y(e, t) {
49
49
  }
50
50
  function A(e) {
51
51
  const t = d(e);
52
- return c(e) ?? e.getDoc().getElementById(t);
52
+ return v(e) ?? e.getDoc().getElementById(t);
53
53
  }
54
54
  function S(e, t) {
55
55
  if (!u(e)) return !1;
@@ -63,26 +63,26 @@ function S(e, t) {
63
63
  }
64
64
  export {
65
65
  Y as dispatchSelectionEvent,
66
- O as getActiveTriggerEl,
67
- M as getArrowId,
68
- c as getContentEl,
66
+ K as getActiveTriggerEl,
67
+ N as getArrowId,
68
+ v as getContentEl,
69
69
  d as getContentId,
70
- K as getContextTriggerEl,
71
- N as getContextTriggerEls,
70
+ q as getContextTriggerEl,
71
+ H as getContextTriggerEls,
72
72
  b as getContextTriggerId,
73
- R as getElemByKey,
73
+ Q as getElemByKey,
74
74
  o as getElements,
75
- V as getFirstEl,
75
+ O as getFirstEl,
76
76
  W as getGroupId,
77
- j as getGroupLabelId,
78
- H as getItemEl,
77
+ G as getGroupLabelId,
78
+ j as getItemEl,
79
79
  h as getItemId,
80
- G as getItemValue,
81
- z as getLastEl,
82
- J as getNextEl,
83
- q as getPositionerEl,
80
+ D as getItemValue,
81
+ V as getLastEl,
82
+ z as getNextEl,
83
+ R as getPositionerEl,
84
84
  T as getPositionerId,
85
- Q as getPrevEl,
85
+ J as getPrevEl,
86
86
  w as getTriggerEl,
87
87
  B as getTriggerEls,
88
88
  m as getTriggerId,
@@ -14,7 +14,7 @@ import { addDomEvent as te, getEventTarget as L } from "../../dom-query/dist/eve
14
14
  import { trackDismissableElement as ne } from "../../dismissable/dist/dismissable-layer.js";
15
15
  import { getByTypeahead as ie } from "../../dom-query/dist/typeahead.js";
16
16
  import { clickIfLink as oe } from "../../dom-query/dist/navigate.js";
17
- import { scrollIntoView as re } from "../../dom-query/dist/overflow.js";
17
+ import { scrollIntoView as re } from "../../dom-query/dist/scroll.js";
18
18
  var { not: a, and: O, or: se } = X(), Le = K({
19
19
  props({ props: e }) {
20
20
  return {
@@ -5,7 +5,7 @@ import { getPlacementDetails as V } from "./placement.js";
5
5
  import { raf as ee } from "../../dom-query/dist/raf.js";
6
6
  import { getWindow as te, isHTMLElement as re } from "../../dom-query/dist/node.js";
7
7
  import { getComputedStyle as ne } from "../../dom-query/dist/computed-style.js";
8
- import { noop as H } from "../../utils/dist/functions.js";
8
+ import { noop as W } from "../../utils/dist/functions.js";
9
9
  import { isNull as ie } from "../../utils/dist/guard.js";
10
10
  import { compact as oe } from "../../utils/dist/object.js";
11
11
  var se = {
@@ -22,14 +22,14 @@ var se = {
22
22
  overflowPadding: 8,
23
23
  arrowPadding: 4
24
24
  };
25
- function U(e, t) {
25
+ function $(e, t) {
26
26
  const i = e.devicePixelRatio || 1;
27
27
  return Math.round(t * i) / i;
28
28
  }
29
- function y(e, t) {
29
+ function m(e, t) {
30
30
  return e != null && Math.abs(e - t) < 0.5;
31
31
  }
32
- function b(e) {
32
+ function w(e) {
33
33
  return typeof e == "function" ? e() : e === "clipping-ancestors" ? "clippingAncestors" : e;
34
34
  }
35
35
  function le(e, t, i) {
@@ -39,54 +39,65 @@ function le(e, t, i) {
39
39
  function fe(e, t) {
40
40
  if (!ie(t.offset ?? t.gutter))
41
41
  return k(({ placement: i }) => {
42
- var l, a;
43
- const o = ((e == null ? void 0 : e.clientHeight) || 0) / 2, f = ((l = t.offset) == null ? void 0 : l.mainAxis) ?? t.gutter, p = typeof f == "number" ? f + o : f ?? o, { hasAlign: n } = V(i), s = n ? void 0 : t.shift, d = ((a = t.offset) == null ? void 0 : a.crossAxis) ?? s;
42
+ var s, l;
43
+ const o = ((e == null ? void 0 : e.clientHeight) || 0) / 2, f = ((s = t.offset) == null ? void 0 : s.mainAxis) ?? t.gutter, u = typeof f == "number" ? f + o : f ?? o, { hasAlign: n } = V(i), c = n ? void 0 : t.shift, d = ((l = t.offset) == null ? void 0 : l.crossAxis) ?? c;
44
44
  return oe({
45
45
  crossAxis: d,
46
- mainAxis: p,
46
+ mainAxis: u,
47
47
  alignmentAxis: t.shift
48
48
  });
49
49
  });
50
50
  }
51
51
  function ae(e) {
52
- if (!e.flip) return;
53
- const t = b(e.boundary);
54
- return L({
55
- ...t ? { boundary: t } : void 0,
56
- padding: e.overflowPadding,
57
- fallbackPlacements: e.flip === !0 ? void 0 : e.flip
58
- });
52
+ if (e.flip)
53
+ return L(() => {
54
+ const t = w(e.boundary);
55
+ return {
56
+ ...t ? { boundary: t } : void 0,
57
+ padding: e.overflowPadding,
58
+ fallbackPlacements: e.flip === !0 ? void 0 : e.flip
59
+ };
60
+ });
59
61
  }
60
62
  function ce(e) {
61
- if (!e.slide && !e.overlap) return;
62
- const t = b(e.boundary);
63
- return N({
64
- ...t ? { boundary: t } : void 0,
65
- mainAxis: e.slide,
66
- crossAxis: e.overlap,
67
- padding: e.overflowPadding,
68
- limiter: J()
69
- });
63
+ if (!(!e.slide && !e.overlap))
64
+ return N(() => {
65
+ const t = w(e.boundary);
66
+ return {
67
+ ...t ? { boundary: t } : void 0,
68
+ mainAxis: e.slide,
69
+ crossAxis: e.overlap,
70
+ padding: e.overflowPadding,
71
+ limiter: J()
72
+ };
73
+ });
70
74
  }
71
75
  function de(e) {
72
76
  if (e.sizeMiddleware === !1 && !e.sameWidth && !e.fitViewport) return;
73
77
  let t, i, o, f;
74
- return Y({
75
- padding: e.overflowPadding,
76
- apply({ elements: p, rects: n, availableHeight: s, availableWidth: d }) {
77
- const l = p.floating, a = Math.round(n.reference.width), g = Math.round(n.reference.height);
78
- d = Math.floor(d), s = Math.floor(s), y(t, a) || (l.style.setProperty("--reference-width", `${a}px`), t = a), y(i, g) || (l.style.setProperty("--reference-height", `${g}px`), i = g), y(o, d) || (l.style.setProperty("--available-width", `${d}px`), o = d), y(f, s) || (l.style.setProperty("--available-height", `${s}px`), f = s);
79
- }
78
+ return Y(() => {
79
+ const u = w(e.boundary);
80
+ return {
81
+ padding: e.overflowPadding,
82
+ ...u ? { boundary: u } : void 0,
83
+ apply({ elements: n, rects: c, availableHeight: d, availableWidth: s }) {
84
+ const l = n.floating, g = Math.round(c.reference.width), h = Math.round(c.reference.height);
85
+ s = Math.floor(s), d = Math.floor(d), m(t, g) || (l.style.setProperty("--reference-width", `${g}px`), t = g), m(i, h) || (l.style.setProperty("--reference-height", `${h}px`), i = h), m(o, s) || (l.style.setProperty("--available-width", `${s}px`), o = s), m(f, d) || (l.style.setProperty("--available-height", `${d}px`), f = d);
86
+ }
87
+ };
80
88
  });
81
89
  }
82
90
  function ue(e) {
83
91
  if (e.hideWhenDetached)
84
- return G({ strategy: "referenceHidden", boundary: b(e.boundary) ?? "clippingAncestors" });
92
+ return G(() => ({
93
+ strategy: "referenceHidden",
94
+ boundary: w(e.boundary) ?? "clippingAncestors"
95
+ }));
85
96
  }
86
97
  function pe(e) {
87
98
  return e ? e === !0 ? { ancestorResize: !0, ancestorScroll: !0, elementResize: !0, layoutShift: !0 } : e : {};
88
99
  }
89
- var me = [
100
+ var ye = [
90
101
  "transform",
91
102
  "visibility",
92
103
  "pointer-events",
@@ -98,9 +109,9 @@ var me = [
98
109
  "--available-width",
99
110
  "--available-height",
100
111
  "--transform-origin"
101
- ], ye = ["top", "right", "bottom", "left"];
102
- function $(e, t) {
103
- if (!e) return H;
112
+ ], me = ["top", "right", "bottom", "left"];
113
+ function F(e, t) {
114
+ if (!e) return W;
104
115
  const i = new Map(t.map((o) => [o, e.style.getPropertyValue(o)]));
105
116
  return () => {
106
117
  i.forEach((o, f) => {
@@ -108,81 +119,81 @@ function $(e, t) {
108
119
  }), e.style.length === 0 && e.removeAttribute("style");
109
120
  };
110
121
  }
111
- function F(e) {
122
+ function H(e) {
112
123
  return e == null ? null : re(e) ? e : typeof e == "object" && e && "contextElement" in e && e.contextElement ? e.contextElement : e;
113
124
  }
114
125
  function ge(e, t, i = {}) {
115
126
  const o = () => (typeof t == "function" ? t() : t) ?? null, f = () => {
116
- var c;
127
+ var a;
117
128
  const r = typeof e == "function" ? e() : e;
118
- return ((c = i.getAnchorElement) == null ? void 0 : c.call(i)) ?? r;
119
- }, p = () => {
129
+ return ((a = i.getAnchorElement) == null ? void 0 : a.call(i)) ?? r;
130
+ }, u = () => {
120
131
  const r = f();
121
132
  return !r && !i.getAnchorRect ? null : K(r, i.getAnchorRect);
122
133
  }, n = Object.assign({}, se, i);
123
- let s = [], d = null, l, a;
134
+ let c = [], d = null, s, l;
124
135
  function g(r) {
125
- l == null || l(), a == null || a(), d = r, l = n.restoreStyles ? $(r, me) : void 0;
126
- const c = r.querySelector("[data-part=arrow]");
127
- a = n.restoreStyles ? $(c, ye) : void 0, s = [
128
- fe(c, n),
136
+ s == null || s(), l == null || l(), d = r, s = n.restoreStyles ? F(r, ye) : void 0;
137
+ const a = r.querySelector("[data-part=arrow]");
138
+ l = n.restoreStyles ? F(a, me) : void 0, c = [
139
+ fe(a, n),
129
140
  ae(n),
130
141
  ce(n),
131
- le(c, r.ownerDocument, n),
132
- Z(c),
142
+ le(a, r.ownerDocument, n),
143
+ Z(a),
133
144
  _(
134
145
  { gutter: n.gutter, offset: n.offset, overlap: n.overlap },
135
- c
146
+ a
136
147
  ),
137
148
  de(n),
138
149
  ue(n),
139
150
  Q
140
151
  ];
141
152
  }
142
- const { placement: W, strategy: I, onComplete: v, onPositioned: m } = n;
143
- let E, z, w = !1, R, C, P = H;
153
+ const { placement: h, strategy: I, onComplete: P, onPositioned: y } = n;
154
+ let z, R, x = !1, C, D, A = W;
144
155
  const j = pe(n.listeners);
145
156
  function q() {
146
157
  if (!n.listeners) return;
147
- const r = f(), c = p(), u = o();
148
- if (!c || !u) return;
149
- (F(r) !== F(R) || u !== C) && (P(), R = r, C = u, P = T(c, u, O, j));
158
+ const r = f(), a = u(), p = o();
159
+ if (!a || !p) return;
160
+ (H(r) !== H(C) || p !== D) && (A(), C = r, D = p, A = T(a, p, S, j));
150
161
  }
151
- async function D() {
152
- var S;
162
+ async function O() {
163
+ var U;
153
164
  q();
154
165
  const r = o();
155
166
  if (!r) return;
156
- r !== d && (g(r), w = !1);
157
- const c = p();
158
- if (!c) return;
159
- const u = await B(c, r, {
160
- placement: W,
161
- middleware: s,
167
+ r !== d && (g(r), x = !1);
168
+ const a = u();
169
+ if (!a) return;
170
+ const p = await B(a, r, {
171
+ placement: h,
172
+ middleware: c,
162
173
  strategy: I
163
174
  });
164
- v == null || v(u);
165
- const x = te(r), h = U(x, u.x), A = U(x, u.y);
166
- if (y(E, h) || (r.style.setProperty("--x", `${h}px`), E = h), y(z, A) || (r.style.setProperty("--y", `${A}px`), z = A), n.hideWhenDetached && (((S = u.middlewareData.hide) == null ? void 0 : S.referenceHidden) ? (r.style.setProperty("visibility", "hidden"), r.style.setProperty("pointer-events", "none")) : (r.style.removeProperty("visibility"), r.style.removeProperty("pointer-events"))), !w) {
167
- const M = r.firstElementChild;
168
- M && (r.style.setProperty("--z-index", ne(M).zIndex), w = !0);
175
+ P == null || P(p);
176
+ const M = te(r), v = $(M, p.x), b = $(M, p.y);
177
+ if (m(z, v) || (r.style.setProperty("--x", `${v}px`), z = v), m(R, b) || (r.style.setProperty("--y", `${b}px`), R = b), n.hideWhenDetached && (((U = p.middlewareData.hide) == null ? void 0 : U.referenceHidden) ? (r.style.setProperty("visibility", "hidden"), r.style.setProperty("pointer-events", "none")) : (r.style.removeProperty("visibility"), r.style.removeProperty("pointer-events"))), !x) {
178
+ const E = r.firstElementChild;
179
+ E && (r.style.setProperty("--z-index", ne(E).zIndex), x = !0);
169
180
  }
170
181
  }
171
- async function O() {
172
- i.updatePosition ? (await i.updatePosition({ updatePosition: D, floatingElement: o() }), m == null || m({ placed: !0 })) : await D();
182
+ async function S() {
183
+ i.updatePosition ? (await i.updatePosition({ updatePosition: O, floatingElement: o() }), y == null || y({ placed: !0 })) : await O();
173
184
  }
174
- return O(), () => {
175
- P(), a == null || a(), l == null || l(), m == null || m({ placed: !1 });
185
+ return S(), () => {
186
+ A(), l == null || l(), s == null || s(), y == null || y({ placed: !1 });
176
187
  };
177
188
  }
178
189
  function Re(e, t, i = {}) {
179
- const { defer: o, ...f } = i, p = o ? ee : (s) => s(), n = [];
190
+ const { defer: o, ...f } = i, u = o ? ee : (c) => c(), n = [];
180
191
  return n.push(
181
- p(() => {
192
+ u(() => {
182
193
  n.push(ge(e, t, f));
183
194
  })
184
195
  ), () => {
185
- n.forEach((s) => s == null ? void 0 : s());
196
+ n.forEach((c) => c == null ? void 0 : c());
186
197
  };
187
198
  }
188
199
  export {