@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,4 +1,4 @@
|
|
|
1
|
-
import { getByTypeahead as
|
|
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
|
-
},
|
|
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}`,
|
|
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
|
-
},
|
|
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(
|
|
32
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
38
|
+
}, Q = (e, t) => {
|
|
39
39
|
const r = o(e), n = r.find((i) => g(i, t.value));
|
|
40
|
-
return
|
|
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
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
K as getActiveTriggerEl,
|
|
67
|
+
N as getArrowId,
|
|
68
|
+
v as getContentEl,
|
|
69
69
|
d as getContentId,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
q as getContextTriggerEl,
|
|
71
|
+
H as getContextTriggerEls,
|
|
72
72
|
b as getContextTriggerId,
|
|
73
|
-
|
|
73
|
+
Q as getElemByKey,
|
|
74
74
|
o as getElements,
|
|
75
|
-
|
|
75
|
+
O as getFirstEl,
|
|
76
76
|
W as getGroupId,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
G as getGroupLabelId,
|
|
78
|
+
j as getItemEl,
|
|
79
79
|
h as getItemId,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
D as getItemValue,
|
|
81
|
+
V as getLastEl,
|
|
82
|
+
z as getNextEl,
|
|
83
|
+
R as getPositionerEl,
|
|
84
84
|
T as getPositionerId,
|
|
85
|
-
|
|
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/
|
|
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
|
|
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
|
|
25
|
+
function $(e, t) {
|
|
26
26
|
const i = e.devicePixelRatio || 1;
|
|
27
27
|
return Math.round(t * i) / i;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function m(e, t) {
|
|
30
30
|
return e != null && Math.abs(e - t) < 0.5;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
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
|
|
43
|
-
const o = ((e == null ? void 0 : e.clientHeight) || 0) / 2, f = ((
|
|
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:
|
|
46
|
+
mainAxis: u,
|
|
47
47
|
alignmentAxis: t.shift
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
function ae(e) {
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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(
|
|
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
|
|
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
|
-
],
|
|
102
|
-
function
|
|
103
|
-
if (!e) return
|
|
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
|
|
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
|
|
127
|
+
var a;
|
|
117
128
|
const r = typeof e == "function" ? e() : e;
|
|
118
|
-
return ((
|
|
119
|
-
},
|
|
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
|
|
134
|
+
let c = [], d = null, s, l;
|
|
124
135
|
function g(r) {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
fe(
|
|
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(
|
|
132
|
-
Z(
|
|
142
|
+
le(a, r.ownerDocument, n),
|
|
143
|
+
Z(a),
|
|
133
144
|
_(
|
|
134
145
|
{ gutter: n.gutter, offset: n.offset, overlap: n.overlap },
|
|
135
|
-
|
|
146
|
+
a
|
|
136
147
|
),
|
|
137
148
|
de(n),
|
|
138
149
|
ue(n),
|
|
139
150
|
Q
|
|
140
151
|
];
|
|
141
152
|
}
|
|
142
|
-
const { placement:
|
|
143
|
-
let
|
|
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(),
|
|
148
|
-
if (!
|
|
149
|
-
(
|
|
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
|
|
152
|
-
var
|
|
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),
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
159
|
-
const
|
|
160
|
-
placement:
|
|
161
|
-
middleware:
|
|
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
|
-
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
const
|
|
168
|
-
|
|
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
|
|
172
|
-
i.updatePosition ? (await i.updatePosition({ updatePosition:
|
|
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
|
|
175
|
-
|
|
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,
|
|
190
|
+
const { defer: o, ...f } = i, u = o ? ee : (c) => c(), n = [];
|
|
180
191
|
return n.push(
|
|
181
|
-
|
|
192
|
+
u(() => {
|
|
182
193
|
n.push(ge(e, t, f));
|
|
183
194
|
})
|
|
184
195
|
), () => {
|
|
185
|
-
n.forEach((
|
|
196
|
+
n.forEach((c) => c == null ? void 0 : c());
|
|
186
197
|
};
|
|
187
198
|
}
|
|
188
199
|
export {
|