@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.
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- 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/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +1 -1
- 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 +50 -49
- package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +68 -70
- 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 +308 -322
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +79 -93
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +43 -35
- package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +35 -36
- package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +37 -27
- package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +41 -56
- package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +31 -51
- package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +25 -46
- package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +21 -13
- package/dist/node_modules/@zag-js/live-region/dist/index.js +19 -29
- package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +135 -138
- 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 +71 -82
- package/dist/node_modules/@zag-js/react/dist/machine.js +96 -105
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +26 -34
- package/dist/node_modules/@zag-js/select/dist/select.connect.js +101 -104
- package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
- package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +60 -63
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +25 -27
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +14 -15
- package/dist/theme/initColorScheme.d.ts +1 -1
- package/package.json +8 -8
- package/dist/node_modules/@zag-js/date-utils/dist/locale.js +0 -12
- package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getByTypeahead as
|
|
1
|
+
import { getByTypeahead as v } 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
|
+
}, M = (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}`, G = (e) => (e == null ? void 0 : e.dataset.value) ?? null, j = (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
|
+
}, 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) => {
|
|
30
30
|
const r = `[role^="menuitem"][data-ownedby=${CSS.escape(d(e))}]:not([data-disabled])`;
|
|
31
|
-
return a(
|
|
32
|
-
},
|
|
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) => {
|
|
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
|
+
}, Q = (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
|
+
}, R = (e, t) => {
|
|
39
39
|
const r = o(e), n = r.find((i) => g(i, t.value));
|
|
40
|
-
return
|
|
40
|
+
return v(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 c(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
|
+
O as getActiveTriggerEl,
|
|
67
|
+
M as getArrowId,
|
|
68
|
+
c as getContentEl,
|
|
69
69
|
d as getContentId,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
K as getContextTriggerEl,
|
|
71
|
+
N as getContextTriggerEls,
|
|
72
72
|
b as getContextTriggerId,
|
|
73
|
-
|
|
73
|
+
R as getElemByKey,
|
|
74
74
|
o as getElements,
|
|
75
|
-
|
|
75
|
+
V as getFirstEl,
|
|
76
76
|
W as getGroupId,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
j as getGroupLabelId,
|
|
78
|
+
H as getItemEl,
|
|
79
79
|
h as getItemId,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
G as getItemValue,
|
|
81
|
+
z as getLastEl,
|
|
82
|
+
J as getNextEl,
|
|
83
|
+
q as getPositionerEl,
|
|
84
84
|
T as getPositionerId,
|
|
85
|
-
|
|
85
|
+
Q 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/overflow.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 H } 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 U(e, t) {
|
|
26
26
|
const i = e.devicePixelRatio || 1;
|
|
27
27
|
return Math.round(t * i) / i;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function y(e, t) {
|
|
30
30
|
return e != null && Math.abs(e - t) < 0.5;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function b(e) {
|
|
33
33
|
return typeof e == "function" ? e() : e === "clipping-ancestors" ? "clippingAncestors" : e;
|
|
34
34
|
}
|
|
35
35
|
function le(e, t, i) {
|
|
@@ -39,65 +39,54 @@ 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 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;
|
|
44
44
|
return oe({
|
|
45
45
|
crossAxis: d,
|
|
46
|
-
mainAxis:
|
|
46
|
+
mainAxis: p,
|
|
47
47
|
alignmentAxis: t.shift
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
function ae(e) {
|
|
52
|
-
if (e.flip)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
});
|
|
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
|
+
});
|
|
61
59
|
}
|
|
62
60
|
function ce(e) {
|
|
63
|
-
if (!
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
});
|
|
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
|
+
});
|
|
74
70
|
}
|
|
75
71
|
function de(e) {
|
|
76
72
|
if (e.sizeMiddleware === !1 && !e.sameWidth && !e.fitViewport) return;
|
|
77
73
|
let t, i, o, f;
|
|
78
|
-
return Y(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
};
|
|
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
|
+
}
|
|
88
80
|
});
|
|
89
81
|
}
|
|
90
82
|
function ue(e) {
|
|
91
83
|
if (e.hideWhenDetached)
|
|
92
|
-
return G(()
|
|
93
|
-
strategy: "referenceHidden",
|
|
94
|
-
boundary: w(e.boundary) ?? "clippingAncestors"
|
|
95
|
-
}));
|
|
84
|
+
return G({ strategy: "referenceHidden", boundary: b(e.boundary) ?? "clippingAncestors" });
|
|
96
85
|
}
|
|
97
86
|
function pe(e) {
|
|
98
87
|
return e ? e === !0 ? { ancestorResize: !0, ancestorScroll: !0, elementResize: !0, layoutShift: !0 } : e : {};
|
|
99
88
|
}
|
|
100
|
-
var
|
|
89
|
+
var me = [
|
|
101
90
|
"transform",
|
|
102
91
|
"visibility",
|
|
103
92
|
"pointer-events",
|
|
@@ -109,9 +98,9 @@ var ye = [
|
|
|
109
98
|
"--available-width",
|
|
110
99
|
"--available-height",
|
|
111
100
|
"--transform-origin"
|
|
112
|
-
],
|
|
113
|
-
function
|
|
114
|
-
if (!e) return
|
|
101
|
+
], ye = ["top", "right", "bottom", "left"];
|
|
102
|
+
function $(e, t) {
|
|
103
|
+
if (!e) return H;
|
|
115
104
|
const i = new Map(t.map((o) => [o, e.style.getPropertyValue(o)]));
|
|
116
105
|
return () => {
|
|
117
106
|
i.forEach((o, f) => {
|
|
@@ -119,81 +108,81 @@ function F(e, t) {
|
|
|
119
108
|
}), e.style.length === 0 && e.removeAttribute("style");
|
|
120
109
|
};
|
|
121
110
|
}
|
|
122
|
-
function
|
|
111
|
+
function F(e) {
|
|
123
112
|
return e == null ? null : re(e) ? e : typeof e == "object" && e && "contextElement" in e && e.contextElement ? e.contextElement : e;
|
|
124
113
|
}
|
|
125
114
|
function ge(e, t, i = {}) {
|
|
126
115
|
const o = () => (typeof t == "function" ? t() : t) ?? null, f = () => {
|
|
127
|
-
var
|
|
116
|
+
var c;
|
|
128
117
|
const r = typeof e == "function" ? e() : e;
|
|
129
|
-
return ((
|
|
130
|
-
},
|
|
118
|
+
return ((c = i.getAnchorElement) == null ? void 0 : c.call(i)) ?? r;
|
|
119
|
+
}, p = () => {
|
|
131
120
|
const r = f();
|
|
132
121
|
return !r && !i.getAnchorRect ? null : K(r, i.getAnchorRect);
|
|
133
122
|
}, n = Object.assign({}, se, i);
|
|
134
|
-
let
|
|
123
|
+
let s = [], d = null, l, a;
|
|
135
124
|
function g(r) {
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
fe(
|
|
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),
|
|
140
129
|
ae(n),
|
|
141
130
|
ce(n),
|
|
142
|
-
le(
|
|
143
|
-
Z(
|
|
131
|
+
le(c, r.ownerDocument, n),
|
|
132
|
+
Z(c),
|
|
144
133
|
_(
|
|
145
134
|
{ gutter: n.gutter, offset: n.offset, overlap: n.overlap },
|
|
146
|
-
|
|
135
|
+
c
|
|
147
136
|
),
|
|
148
137
|
de(n),
|
|
149
138
|
ue(n),
|
|
150
139
|
Q
|
|
151
140
|
];
|
|
152
141
|
}
|
|
153
|
-
const { placement:
|
|
154
|
-
let
|
|
142
|
+
const { placement: W, strategy: I, onComplete: v, onPositioned: m } = n;
|
|
143
|
+
let E, z, w = !1, R, C, P = H;
|
|
155
144
|
const j = pe(n.listeners);
|
|
156
145
|
function q() {
|
|
157
146
|
if (!n.listeners) return;
|
|
158
|
-
const r = f(),
|
|
159
|
-
if (!
|
|
160
|
-
(
|
|
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));
|
|
161
150
|
}
|
|
162
|
-
async function
|
|
163
|
-
var
|
|
151
|
+
async function D() {
|
|
152
|
+
var S;
|
|
164
153
|
q();
|
|
165
154
|
const r = o();
|
|
166
155
|
if (!r) return;
|
|
167
|
-
r !== d && (g(r),
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
const
|
|
171
|
-
placement:
|
|
172
|
-
middleware:
|
|
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,
|
|
173
162
|
strategy: I
|
|
174
163
|
});
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
|
|
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);
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
|
-
async function
|
|
183
|
-
i.updatePosition ? (await i.updatePosition({ updatePosition:
|
|
171
|
+
async function O() {
|
|
172
|
+
i.updatePosition ? (await i.updatePosition({ updatePosition: D, floatingElement: o() }), m == null || m({ placed: !0 })) : await D();
|
|
184
173
|
}
|
|
185
|
-
return
|
|
186
|
-
|
|
174
|
+
return O(), () => {
|
|
175
|
+
P(), a == null || a(), l == null || l(), m == null || m({ placed: !1 });
|
|
187
176
|
};
|
|
188
177
|
}
|
|
189
178
|
function Re(e, t, i = {}) {
|
|
190
|
-
const { defer: o, ...f } = i,
|
|
179
|
+
const { defer: o, ...f } = i, p = o ? ee : (s) => s(), n = [];
|
|
191
180
|
return n.push(
|
|
192
|
-
|
|
181
|
+
p(() => {
|
|
193
182
|
n.push(ge(e, t, f));
|
|
194
183
|
})
|
|
195
184
|
), () => {
|
|
196
|
-
n.forEach((
|
|
185
|
+
n.forEach((s) => s == null ? void 0 : s());
|
|
197
186
|
};
|
|
198
187
|
}
|
|
199
188
|
export {
|