@serendie/ui 2.0.0 → 2.1.0
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/CheckBox/CheckBox.js +36 -35
- package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
- package/dist/components/DataTable/DataTableComponent.js +38 -36
- package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +34 -33
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +47 -41
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.js +70 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
- package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
- package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
- package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
- package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
- package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
- package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
- package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
- package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
- package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
- package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
- package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
- package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
- package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
- package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
- package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
- package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
- package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
- package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
- package/dist/node_modules/proxy-compare/dist/index.js +4 -106
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
- package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
- package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
- package/dist/node_modules/klona/full/index.js +0 -21
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,141 +1,173 @@
|
|
|
1
|
-
import { addDomEvent as
|
|
2
|
-
import { raf as m, getDocument as F, getWindow as H, isFocusable as y, getEventTarget as p, isHTMLElement as I, contains as _ } from "../../dom-query/dist/index.js";
|
|
1
|
+
import { raf as p, getDocument as _, getWindow as U, isShadowRoot as V, addDomEvent as b, isTouchDevice as W, getEventTarget as x, isFocusable as X, isContextMenuEvent as M, isHTMLElement as k, contains as q, getNearestOverflowAncestor as I } from "../../dom-query/dist/index.js";
|
|
3
2
|
import { callAll as O } from "../../utils/dist/index.js";
|
|
4
|
-
function
|
|
3
|
+
function B(t) {
|
|
5
4
|
const e = {
|
|
6
|
-
each(
|
|
7
|
-
var
|
|
8
|
-
for (let
|
|
9
|
-
const
|
|
10
|
-
|
|
5
|
+
each(n) {
|
|
6
|
+
var r;
|
|
7
|
+
for (let i = 0; i < ((r = t.frames) == null ? void 0 : r.length); i += 1) {
|
|
8
|
+
const o = t.frames[i];
|
|
9
|
+
o && n(o);
|
|
11
10
|
}
|
|
12
11
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return e.each((n) => {
|
|
12
|
+
addEventListener(n, r, i) {
|
|
13
|
+
return e.each((o) => {
|
|
16
14
|
try {
|
|
17
|
-
o.
|
|
15
|
+
o.document.addEventListener(n, r, i);
|
|
18
16
|
} catch {
|
|
19
17
|
}
|
|
20
18
|
}), () => {
|
|
21
19
|
try {
|
|
22
|
-
|
|
20
|
+
e.removeEventListener(n, r, i);
|
|
23
21
|
} catch {
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
24
|
},
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
removeEventListener(n, r, i) {
|
|
26
|
+
e.each((o) => {
|
|
29
27
|
try {
|
|
30
|
-
|
|
28
|
+
o.document.removeEventListener(n, r, i);
|
|
31
29
|
} catch {
|
|
32
30
|
}
|
|
33
|
-
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return e;
|
|
35
|
+
}
|
|
36
|
+
function $(t) {
|
|
37
|
+
const e = t.frameElement != null ? t.parent : null;
|
|
38
|
+
return {
|
|
39
|
+
addEventListener: (n, r, i) => {
|
|
40
|
+
try {
|
|
41
|
+
e == null || e.addEventListener(n, r, i);
|
|
42
|
+
} catch {
|
|
43
|
+
}
|
|
44
|
+
return () => {
|
|
34
45
|
try {
|
|
35
|
-
e.removeEventListener(r, i
|
|
46
|
+
e == null || e.removeEventListener(n, r, i);
|
|
36
47
|
} catch {
|
|
37
48
|
}
|
|
38
49
|
};
|
|
39
50
|
},
|
|
40
|
-
removeEventListener(r, i
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
});
|
|
51
|
+
removeEventListener: (n, r, i) => {
|
|
52
|
+
try {
|
|
53
|
+
e == null || e.removeEventListener(n, r, i);
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
};
|
|
49
|
-
return e;
|
|
50
58
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
59
|
+
var C = "pointerdown.outside", D = "focus.outside";
|
|
60
|
+
function j(t) {
|
|
53
61
|
for (const e of t)
|
|
54
|
-
if (
|
|
62
|
+
if (k(e) && X(e)) return !0;
|
|
55
63
|
return !1;
|
|
56
64
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
return
|
|
65
|
+
var H = (t) => "clientY" in t;
|
|
66
|
+
function z(t, e) {
|
|
67
|
+
if (!H(e) || !t) return !1;
|
|
68
|
+
const n = t.getBoundingClientRect();
|
|
69
|
+
return n.width === 0 || n.height === 0 ? !1 : n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
|
|
62
70
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
if (!e || !W(t)) return !1;
|
|
66
|
-
const i = e.scrollHeight > e.clientHeight && t.clientX > e.clientWidth, n = e.scrollWidth > e.clientWidth && t.clientY > e.clientHeight;
|
|
67
|
-
return i || n;
|
|
71
|
+
function G(t, e) {
|
|
72
|
+
return t.y <= e.y && e.y <= t.y + t.height && t.x <= e.x && e.x <= t.x + t.width;
|
|
68
73
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
74
|
+
function Y(t, e) {
|
|
75
|
+
if (!e || !H(t)) return !1;
|
|
76
|
+
const n = e.scrollHeight > e.clientHeight, r = n && t.clientX > e.offsetLeft + e.clientWidth, i = e.scrollWidth > e.clientWidth, o = i && t.clientY > e.offsetTop + e.clientHeight, E = {
|
|
77
|
+
x: e.offsetLeft,
|
|
78
|
+
y: e.offsetTop,
|
|
79
|
+
width: e.clientWidth + (n ? 16 : 0),
|
|
80
|
+
height: e.clientHeight + (i ? 16 : 0)
|
|
81
|
+
}, l = {
|
|
82
|
+
x: t.clientX,
|
|
83
|
+
y: t.clientY
|
|
84
|
+
};
|
|
85
|
+
return G(E, l) ? r || o : !1;
|
|
86
|
+
}
|
|
87
|
+
function J(t, e) {
|
|
88
|
+
const { exclude: n, onFocusOutside: r, onPointerDownOutside: i, onInteractOutside: o, defer: E } = e;
|
|
71
89
|
if (!t) return;
|
|
72
|
-
const
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
const l = _(t), y = U(t), g = B(y), w = $(y);
|
|
91
|
+
function S(c, a) {
|
|
92
|
+
if (!k(a) || !a.isConnected || q(t, a) || z(t, c)) return !1;
|
|
93
|
+
const s = l.querySelector(`[aria-controls="${t.id}"]`);
|
|
94
|
+
if (s) {
|
|
95
|
+
const u = I(s);
|
|
96
|
+
if (Y(c, u)) return !1;
|
|
97
|
+
}
|
|
98
|
+
const h = I(t);
|
|
99
|
+
return Y(c, h) ? !1 : !(n != null && n(a));
|
|
76
100
|
}
|
|
77
|
-
const
|
|
78
|
-
function
|
|
79
|
-
function s
|
|
80
|
-
var
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
101
|
+
const d = /* @__PURE__ */ new Set(), N = V(t == null ? void 0 : t.getRootNode());
|
|
102
|
+
function L(c) {
|
|
103
|
+
function a(s) {
|
|
104
|
+
var P;
|
|
105
|
+
const h = E && !W() ? p : (m) => m(), u = s ?? c, T = ((P = u == null ? void 0 : u.composedPath) == null ? void 0 : P.call(u)) ?? [u == null ? void 0 : u.target];
|
|
106
|
+
h(() => {
|
|
107
|
+
const m = N ? T[0] : x(c);
|
|
108
|
+
if (!(!t || !S(c, m))) {
|
|
109
|
+
if (i || o) {
|
|
110
|
+
const F = O(i, o);
|
|
111
|
+
t.addEventListener(C, F, { once: !0 });
|
|
87
112
|
}
|
|
88
|
-
|
|
113
|
+
R(t, C, {
|
|
89
114
|
bubbles: !1,
|
|
90
115
|
cancelable: !0,
|
|
91
116
|
detail: {
|
|
92
|
-
originalEvent:
|
|
93
|
-
contextmenu:
|
|
94
|
-
focusable:
|
|
117
|
+
originalEvent: u,
|
|
118
|
+
contextmenu: M(u),
|
|
119
|
+
focusable: j(T),
|
|
120
|
+
target: m
|
|
95
121
|
}
|
|
96
122
|
});
|
|
97
123
|
}
|
|
98
124
|
});
|
|
99
125
|
}
|
|
100
|
-
c.pointerType === "touch" ? (
|
|
126
|
+
c.pointerType === "touch" ? (d.forEach((s) => s()), d.add(b(l, "click", a, { once: !0 })), d.add(w.addEventListener("click", a, { once: !0 })), d.add(g.addEventListener("click", a, { once: !0 }))) : a();
|
|
101
127
|
}
|
|
102
|
-
const
|
|
103
|
-
|
|
128
|
+
const f = /* @__PURE__ */ new Set(), A = setTimeout(() => {
|
|
129
|
+
f.add(b(l, "pointerdown", L, !0)), f.add(w.addEventListener("pointerdown", L, !0)), f.add(g.addEventListener("pointerdown", L, !0));
|
|
104
130
|
}, 0);
|
|
105
|
-
function
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
131
|
+
function v(c) {
|
|
132
|
+
(E ? p : (s) => s())(() => {
|
|
133
|
+
const s = x(c);
|
|
134
|
+
if (!(!t || !S(c, s))) {
|
|
135
|
+
if (r || o) {
|
|
136
|
+
const h = O(r, o);
|
|
137
|
+
t.addEventListener(D, h, { once: !0 });
|
|
111
138
|
}
|
|
112
|
-
|
|
139
|
+
R(t, D, {
|
|
113
140
|
bubbles: !1,
|
|
114
141
|
cancelable: !0,
|
|
115
142
|
detail: {
|
|
116
143
|
originalEvent: c,
|
|
117
144
|
contextmenu: !1,
|
|
118
|
-
focusable:
|
|
145
|
+
focusable: X(s),
|
|
146
|
+
target: s
|
|
119
147
|
}
|
|
120
148
|
});
|
|
121
149
|
}
|
|
122
150
|
});
|
|
123
151
|
}
|
|
124
|
-
return
|
|
125
|
-
clearTimeout(
|
|
152
|
+
return W() || (f.add(b(l, "focusin", v, !0)), f.add(w.addEventListener("focusin", v, !0)), f.add(g.addEventListener("focusin", v, !0))), () => {
|
|
153
|
+
clearTimeout(A), d.forEach((c) => c()), f.forEach((c) => c());
|
|
126
154
|
};
|
|
127
155
|
}
|
|
128
|
-
function
|
|
129
|
-
const { defer:
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
156
|
+
function Z(t, e) {
|
|
157
|
+
const { defer: n } = e, r = n ? p : (o) => o(), i = [];
|
|
158
|
+
return i.push(
|
|
159
|
+
r(() => {
|
|
160
|
+
const o = typeof t == "function" ? t() : t;
|
|
161
|
+
i.push(J(o, e));
|
|
134
162
|
})
|
|
135
163
|
), () => {
|
|
136
|
-
|
|
164
|
+
i.forEach((o) => o == null ? void 0 : o());
|
|
137
165
|
};
|
|
138
166
|
}
|
|
167
|
+
function R(t, e, n) {
|
|
168
|
+
const r = t.ownerDocument.defaultView || window, i = new r.CustomEvent(e, n);
|
|
169
|
+
return t.dispatchEvent(i);
|
|
170
|
+
}
|
|
139
171
|
export {
|
|
140
|
-
|
|
172
|
+
Z as trackInteractOutside
|
|
141
173
|
};
|