@namuna-nur/ui-kit 1.6.3 → 1.7.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/lib/index.js +114 -112
- package/lib/molecules/index.js +101 -99
- package/lib/shared/Avatar.tokens.js +2816 -4184
- package/lib/shared/CardPie.tokens.js +59973 -0
- package/lib/shared/TabDots.tokens.js +205 -209
- package/lib/src/assets/icons/index.d.ts +2 -1
- package/lib/src/molecules/ApartmentCard/ApartmentCard.types.d.ts +2 -2
- package/lib/src/molecules/CardFiles/index.d.ts +1 -1
- package/lib/src/molecules/CardPie/CardPie.d.ts +2 -0
- package/lib/src/molecules/CardPie/CardPie.stories.d.ts +6 -0
- package/lib/src/molecules/CardPie/CardPie.test.d.ts +1 -0
- package/lib/src/molecules/CardPie/CardPie.tokens.d.ts +11 -0
- package/lib/src/molecules/CardPie/CardPie.types.d.ts +32 -0
- package/lib/src/molecules/CardPie/CardPie.utils.d.ts +77 -0
- package/lib/src/molecules/CardPie/index.d.ts +3 -0
- package/lib/src/molecules/CheckboxGroup/CheckboxGroup.types.d.ts +1 -1
- package/lib/src/molecules/SelectList/SelectList.tokens.d.ts +1 -0
- package/lib/src/molecules/index.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +5 -3
- package/lib/shared/FloorSelect.tokens.js +0 -11436
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as s, P as
|
|
1
|
+
import { p as s, P as k, q as et, u as Ce, v as G, w as tt, x as Pe, y as ce, z as R, D as Y, E as rt, F as Re, G as ot, J as nt, K as st, N as at, O as Ne, Q as it, U as ct, V as lt, W as dt, X as ut, Y as pt, Z as ft, _ as vt, $ as mt, a0 as xt } from "./Avatar.tokens.js";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import * as ht from "react-dom";
|
|
4
4
|
import { b as wt, a as P } from "./twMerge.js";
|
|
@@ -9,42 +9,41 @@ const Tt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3
|
|
|
9
9
|
warning: /* @__PURE__ */ s.jsx(Et, { className: "text-sidebar-20 fill-sidebar-20" }),
|
|
10
10
|
default: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" })
|
|
11
11
|
};
|
|
12
|
-
var Pt =
|
|
12
|
+
var Pt = Object.freeze({
|
|
13
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
14
|
+
position: "absolute",
|
|
15
|
+
border: 0,
|
|
16
|
+
width: 1,
|
|
17
|
+
height: 1,
|
|
18
|
+
padding: 0,
|
|
19
|
+
margin: -1,
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
clip: "rect(0, 0, 0, 0)",
|
|
22
|
+
whiteSpace: "nowrap",
|
|
23
|
+
wordWrap: "normal"
|
|
24
|
+
}), Rt = "VisuallyHidden", X = n.forwardRef(
|
|
13
25
|
(e, r) => /* @__PURE__ */ s.jsx(
|
|
14
|
-
|
|
26
|
+
k.span,
|
|
15
27
|
{
|
|
16
28
|
...e,
|
|
17
29
|
ref: r,
|
|
18
|
-
style: {
|
|
19
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
20
|
-
position: "absolute",
|
|
21
|
-
border: 0,
|
|
22
|
-
width: 1,
|
|
23
|
-
height: 1,
|
|
24
|
-
padding: 0,
|
|
25
|
-
margin: -1,
|
|
26
|
-
overflow: "hidden",
|
|
27
|
-
clip: "rect(0, 0, 0, 0)",
|
|
28
|
-
whiteSpace: "nowrap",
|
|
29
|
-
wordWrap: "normal",
|
|
30
|
-
...e.style
|
|
31
|
-
}
|
|
30
|
+
style: { ...Pt, ...e.style }
|
|
32
31
|
}
|
|
33
32
|
)
|
|
34
33
|
);
|
|
35
|
-
|
|
36
|
-
var
|
|
34
|
+
X.displayName = Rt;
|
|
35
|
+
var Nt = X, jt = "ToastProvider", [je, At, St] = et("Toast"), [Ae] = Ce("Toast", [St]), [Sr, B] = Ae(jt), Se = "ToastViewport", kt = ["F8"], oe = "toast.viewportPause", ne = "toast.viewportResume", ke = n.forwardRef(
|
|
37
36
|
(e, r) => {
|
|
38
37
|
const {
|
|
39
38
|
__scopeToast: t,
|
|
40
39
|
hotkey: o = kt,
|
|
41
40
|
label: a = "Notifications ({hotkey})",
|
|
42
41
|
...c
|
|
43
|
-
} = e, l =
|
|
42
|
+
} = e, l = B(Se, t), m = At(t), u = n.useRef(null), i = n.useRef(null), p = n.useRef(null), x = n.useRef(null), T = G(r, x, l.onViewportChange), w = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
|
|
44
43
|
n.useEffect(() => {
|
|
45
44
|
const d = (b) => {
|
|
46
|
-
var
|
|
47
|
-
o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((
|
|
45
|
+
var g;
|
|
46
|
+
o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((g = x.current) == null || g.focus());
|
|
48
47
|
};
|
|
49
48
|
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
50
49
|
}, [o]), n.useEffect(() => {
|
|
@@ -55,25 +54,25 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
|
|
|
55
54
|
const N = new CustomEvent(oe);
|
|
56
55
|
b.dispatchEvent(N), l.isClosePausedRef.current = !0;
|
|
57
56
|
}
|
|
58
|
-
},
|
|
57
|
+
}, g = () => {
|
|
59
58
|
if (l.isClosePausedRef.current) {
|
|
60
59
|
const N = new CustomEvent(ne);
|
|
61
60
|
b.dispatchEvent(N), l.isClosePausedRef.current = !1;
|
|
62
61
|
}
|
|
63
62
|
}, E = (N) => {
|
|
64
|
-
!d.contains(N.relatedTarget) &&
|
|
63
|
+
!d.contains(N.relatedTarget) && g();
|
|
65
64
|
}, C = () => {
|
|
66
|
-
d.contains(document.activeElement) ||
|
|
65
|
+
d.contains(document.activeElement) || g();
|
|
67
66
|
};
|
|
68
|
-
return d.addEventListener("focusin", h), d.addEventListener("focusout", E), d.addEventListener("pointermove", h), d.addEventListener("pointerleave", C), window.addEventListener("blur", h), window.addEventListener("focus",
|
|
69
|
-
d.removeEventListener("focusin", h), d.removeEventListener("focusout", E), d.removeEventListener("pointermove", h), d.removeEventListener("pointerleave", C), window.removeEventListener("blur", h), window.removeEventListener("focus",
|
|
67
|
+
return d.addEventListener("focusin", h), d.addEventListener("focusout", E), d.addEventListener("pointermove", h), d.addEventListener("pointerleave", C), window.addEventListener("blur", h), window.addEventListener("focus", g), () => {
|
|
68
|
+
d.removeEventListener("focusin", h), d.removeEventListener("focusout", E), d.removeEventListener("pointermove", h), d.removeEventListener("pointerleave", C), window.removeEventListener("blur", h), window.removeEventListener("focus", g);
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
71
|
}, [y, l.isClosePausedRef]);
|
|
73
72
|
const f = n.useCallback(
|
|
74
73
|
({ tabbingDirection: d }) => {
|
|
75
|
-
const h = m().map((
|
|
76
|
-
const E =
|
|
74
|
+
const h = m().map((g) => {
|
|
75
|
+
const E = g.ref.current, C = [E, ...zt(E)];
|
|
77
76
|
return d === "forwards" ? C : C.reverse();
|
|
78
77
|
});
|
|
79
78
|
return (d === "forwards" ? h.reverse() : h).flat();
|
|
@@ -85,15 +84,15 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
|
|
|
85
84
|
if (d) {
|
|
86
85
|
const b = (h) => {
|
|
87
86
|
var C, N, A;
|
|
88
|
-
const
|
|
89
|
-
if (h.key === "Tab" && !
|
|
90
|
-
const F = document.activeElement,
|
|
91
|
-
if (h.target === d &&
|
|
87
|
+
const g = h.altKey || h.ctrlKey || h.metaKey;
|
|
88
|
+
if (h.key === "Tab" && !g) {
|
|
89
|
+
const F = document.activeElement, L = h.shiftKey;
|
|
90
|
+
if (h.target === d && L) {
|
|
92
91
|
(C = i.current) == null || C.focus();
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
const _ = f({ tabbingDirection:
|
|
96
|
-
te(_.slice(
|
|
94
|
+
const _ = f({ tabbingDirection: L ? "backwards" : "forwards" }), W = _.findIndex((v) => v === F);
|
|
95
|
+
te(_.slice(W + 1)) ? h.preventDefault() : L ? (N = i.current) == null || N.focus() : (A = p.current) == null || A.focus();
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
return d.addEventListener("keydown", b), () => d.removeEventListener("keydown", b);
|
|
@@ -119,7 +118,7 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
|
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
),
|
|
122
|
-
/* @__PURE__ */ s.jsx(je.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(
|
|
121
|
+
/* @__PURE__ */ s.jsx(je.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(k.ol, { tabIndex: -1, ...c, ref: T }) }),
|
|
123
122
|
y && /* @__PURE__ */ s.jsx(
|
|
124
123
|
se,
|
|
125
124
|
{
|
|
@@ -137,14 +136,13 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
|
|
|
137
136
|
);
|
|
138
137
|
}
|
|
139
138
|
);
|
|
140
|
-
|
|
139
|
+
ke.displayName = Se;
|
|
141
140
|
var _e = "ToastFocusProxy", se = n.forwardRef(
|
|
142
141
|
(e, r) => {
|
|
143
|
-
const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, c =
|
|
142
|
+
const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, c = B(_e, t);
|
|
144
143
|
return /* @__PURE__ */ s.jsx(
|
|
145
|
-
|
|
144
|
+
X,
|
|
146
145
|
{
|
|
147
|
-
"aria-hidden": !0,
|
|
148
146
|
tabIndex: 0,
|
|
149
147
|
...a,
|
|
150
148
|
ref: r,
|
|
@@ -159,22 +157,23 @@ var _e = "ToastFocusProxy", se = n.forwardRef(
|
|
|
159
157
|
}
|
|
160
158
|
);
|
|
161
159
|
se.displayName = _e;
|
|
162
|
-
var
|
|
160
|
+
var $ = "Toast", _t = "toast.swipeStart", Dt = "toast.swipeMove", Lt = "toast.swipeCancel", Ot = "toast.swipeEnd", De = n.forwardRef(
|
|
163
161
|
(e, r) => {
|
|
164
|
-
const { forceMount: t, open: o, defaultOpen: a, onOpenChange: c, ...l } = e, [m
|
|
162
|
+
const { forceMount: t, open: o, defaultOpen: a, onOpenChange: c, ...l } = e, [m, u] = Pe({
|
|
165
163
|
prop: o,
|
|
166
|
-
defaultProp: a,
|
|
167
|
-
onChange: c
|
|
164
|
+
defaultProp: a ?? !0,
|
|
165
|
+
onChange: c,
|
|
166
|
+
caller: $
|
|
168
167
|
});
|
|
169
168
|
return /* @__PURE__ */ s.jsx(ce, { present: t || m, children: /* @__PURE__ */ s.jsx(
|
|
170
|
-
|
|
169
|
+
Mt,
|
|
171
170
|
{
|
|
172
171
|
open: m,
|
|
173
172
|
...l,
|
|
174
173
|
ref: r,
|
|
175
174
|
onClose: () => u(!1),
|
|
176
|
-
onPause:
|
|
177
|
-
onResume:
|
|
175
|
+
onPause: Y(e.onPause),
|
|
176
|
+
onResume: Y(e.onResume),
|
|
178
177
|
onSwipeStart: R(e.onSwipeStart, (i) => {
|
|
179
178
|
i.currentTarget.setAttribute("data-swipe", "start");
|
|
180
179
|
}),
|
|
@@ -193,11 +192,11 @@ var Y = "Toast", St = "toast.swipeStart", _t = "toast.swipeMove", Dt = "toast.sw
|
|
|
193
192
|
) });
|
|
194
193
|
}
|
|
195
194
|
);
|
|
196
|
-
De.displayName =
|
|
197
|
-
var [
|
|
195
|
+
De.displayName = $;
|
|
196
|
+
var [It, Ft] = Ae($, {
|
|
198
197
|
onClose() {
|
|
199
198
|
}
|
|
200
|
-
}),
|
|
199
|
+
}), Mt = n.forwardRef(
|
|
201
200
|
(e, r) => {
|
|
202
201
|
const {
|
|
203
202
|
__scopeToast: t,
|
|
@@ -210,60 +209,56 @@ var [Lt, It] = Ae(Y, {
|
|
|
210
209
|
onResume: i,
|
|
211
210
|
onSwipeStart: p,
|
|
212
211
|
onSwipeMove: x,
|
|
213
|
-
onSwipeCancel:
|
|
212
|
+
onSwipeCancel: T,
|
|
214
213
|
onSwipeEnd: w,
|
|
215
214
|
...y
|
|
216
|
-
} = e, f =
|
|
215
|
+
} = e, f = B($, t), [d, b] = n.useState(null), h = G(r, (v) => b(v)), g = n.useRef(null), E = n.useRef(null), C = a || f.duration, N = n.useRef(0), A = n.useRef(C), F = n.useRef(0), { onToastAdd: L, onToastRemove: Z } = f, O = Y(() => {
|
|
217
216
|
var j;
|
|
218
217
|
(d == null ? void 0 : d.contains(document.activeElement)) && ((j = f.viewport) == null || j.focus()), l();
|
|
219
218
|
}), _ = n.useCallback(
|
|
220
219
|
(v) => {
|
|
221
|
-
!v || v === 1 / 0 || (window.clearTimeout(F.current), N.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(
|
|
220
|
+
!v || v === 1 / 0 || (window.clearTimeout(F.current), N.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(O, v));
|
|
222
221
|
},
|
|
223
|
-
[
|
|
222
|
+
[O]
|
|
224
223
|
);
|
|
225
224
|
n.useEffect(() => {
|
|
226
225
|
const v = f.viewport;
|
|
227
226
|
if (v) {
|
|
228
227
|
const j = () => {
|
|
229
228
|
_(A.current), i == null || i();
|
|
230
|
-
},
|
|
229
|
+
}, S = () => {
|
|
231
230
|
const M = (/* @__PURE__ */ new Date()).getTime() - N.current;
|
|
232
231
|
A.current = A.current - M, window.clearTimeout(F.current), u == null || u();
|
|
233
232
|
};
|
|
234
|
-
return v.addEventListener(oe,
|
|
235
|
-
v.removeEventListener(oe,
|
|
233
|
+
return v.addEventListener(oe, S), v.addEventListener(ne, j), () => {
|
|
234
|
+
v.removeEventListener(oe, S), v.removeEventListener(ne, j);
|
|
236
235
|
};
|
|
237
236
|
}
|
|
238
237
|
}, [f.viewport, C, u, i, _]), n.useEffect(() => {
|
|
239
238
|
c && !f.isClosePausedRef.current && _(C);
|
|
240
|
-
}, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (
|
|
241
|
-
const
|
|
239
|
+
}, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (L(), () => Z()), [L, Z]);
|
|
240
|
+
const W = n.useMemo(() => d ? He(d) : null, [d]);
|
|
242
241
|
return f.viewport ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
W && /* @__PURE__ */ s.jsx(
|
|
243
|
+
Vt,
|
|
245
244
|
{
|
|
246
245
|
__scopeToast: t,
|
|
247
246
|
role: "status",
|
|
248
247
|
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
249
|
-
|
|
250
|
-
children: H
|
|
248
|
+
children: W
|
|
251
249
|
}
|
|
252
250
|
),
|
|
253
|
-
/* @__PURE__ */ s.jsx(
|
|
251
|
+
/* @__PURE__ */ s.jsx(It, { scope: t, onClose: O, children: ht.createPortal(
|
|
254
252
|
/* @__PURE__ */ s.jsx(je.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
|
|
255
253
|
rt,
|
|
256
254
|
{
|
|
257
255
|
asChild: !0,
|
|
258
256
|
onEscapeKeyDown: R(m, () => {
|
|
259
|
-
f.isFocusedToastEscapeKeyDownRef.current ||
|
|
257
|
+
f.isFocusedToastEscapeKeyDownRef.current || O(), f.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
260
258
|
}),
|
|
261
259
|
children: /* @__PURE__ */ s.jsx(
|
|
262
|
-
|
|
260
|
+
k.li,
|
|
263
261
|
{
|
|
264
|
-
role: "status",
|
|
265
|
-
"aria-live": "off",
|
|
266
|
-
"aria-atomic": !0,
|
|
267
262
|
tabIndex: 0,
|
|
268
263
|
"data-state": c ? "open" : "closed",
|
|
269
264
|
"data-swipe-direction": f.swipeDirection,
|
|
@@ -271,34 +266,34 @@ var [Lt, It] = Ae(Y, {
|
|
|
271
266
|
ref: h,
|
|
272
267
|
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
273
268
|
onKeyDown: R(e.onKeyDown, (v) => {
|
|
274
|
-
v.key === "Escape" && (m == null || m(v.nativeEvent), v.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0,
|
|
269
|
+
v.key === "Escape" && (m == null || m(v.nativeEvent), v.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, O()));
|
|
275
270
|
}),
|
|
276
271
|
onPointerDown: R(e.onPointerDown, (v) => {
|
|
277
|
-
v.button === 0 && (
|
|
272
|
+
v.button === 0 && (g.current = { x: v.clientX, y: v.clientY });
|
|
278
273
|
}),
|
|
279
274
|
onPointerMove: R(e.onPointerMove, (v) => {
|
|
280
|
-
if (!
|
|
281
|
-
const j = v.clientX -
|
|
282
|
-
M ? (E.current =
|
|
275
|
+
if (!g.current) return;
|
|
276
|
+
const j = v.clientX - g.current.x, S = v.clientY - g.current.y, M = !!E.current, V = ["left", "right"].includes(f.swipeDirection), z = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, Qe = V ? z(0, j) : 0, Ze = V ? 0 : z(0, S), ee = v.pointerType === "touch" ? 10 : 2, q = { x: Qe, y: Ze }, we = { originalEvent: v, delta: q };
|
|
277
|
+
M ? (E.current = q, U(Dt, x, we, {
|
|
283
278
|
discrete: !1
|
|
284
|
-
})) : ge(
|
|
279
|
+
})) : ge(q, f.swipeDirection, ee) ? (E.current = q, U(_t, p, we, {
|
|
285
280
|
discrete: !1
|
|
286
|
-
}), v.target.setPointerCapture(v.pointerId)) : (Math.abs(j) > ee || Math.abs(
|
|
281
|
+
}), v.target.setPointerCapture(v.pointerId)) : (Math.abs(j) > ee || Math.abs(S) > ee) && (g.current = null);
|
|
287
282
|
}),
|
|
288
283
|
onPointerUp: R(e.onPointerUp, (v) => {
|
|
289
|
-
const j = E.current,
|
|
290
|
-
if (
|
|
284
|
+
const j = E.current, S = v.target;
|
|
285
|
+
if (S.hasPointerCapture(v.pointerId) && S.releasePointerCapture(v.pointerId), E.current = null, g.current = null, j) {
|
|
291
286
|
const M = v.currentTarget, V = { originalEvent: v, delta: j };
|
|
292
|
-
ge(j, f.swipeDirection, f.swipeThreshold) ?
|
|
287
|
+
ge(j, f.swipeDirection, f.swipeThreshold) ? U(Ot, w, V, {
|
|
293
288
|
discrete: !0
|
|
294
|
-
}) :
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
}) : U(
|
|
290
|
+
Lt,
|
|
291
|
+
T,
|
|
297
292
|
V,
|
|
298
293
|
{
|
|
299
294
|
discrete: !0
|
|
300
295
|
}
|
|
301
|
-
), M.addEventListener("click", (
|
|
296
|
+
), M.addEventListener("click", (z) => z.preventDefault(), {
|
|
302
297
|
once: !0
|
|
303
298
|
});
|
|
304
299
|
}
|
|
@@ -311,30 +306,30 @@ var [Lt, It] = Ae(Y, {
|
|
|
311
306
|
) })
|
|
312
307
|
] }) : null;
|
|
313
308
|
}
|
|
314
|
-
),
|
|
315
|
-
const { __scopeToast: r, children: t, ...o } = e, a =
|
|
316
|
-
return
|
|
309
|
+
), Vt = (e) => {
|
|
310
|
+
const { __scopeToast: r, children: t, ...o } = e, a = B($, r), [c, l] = n.useState(!1), [m, u] = n.useState(!1);
|
|
311
|
+
return Kt(() => l(!0)), n.useEffect(() => {
|
|
317
312
|
const i = window.setTimeout(() => u(!0), 1e3);
|
|
318
313
|
return () => window.clearTimeout(i);
|
|
319
|
-
}, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(
|
|
314
|
+
}, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(X, { ...o, children: c && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
320
315
|
a.label,
|
|
321
316
|
" ",
|
|
322
317
|
t
|
|
323
318
|
] }) }) });
|
|
324
|
-
},
|
|
319
|
+
}, Ht = "ToastTitle", Le = n.forwardRef(
|
|
325
320
|
(e, r) => {
|
|
326
321
|
const { __scopeToast: t, ...o } = e;
|
|
327
|
-
return /* @__PURE__ */ s.jsx(
|
|
322
|
+
return /* @__PURE__ */ s.jsx(k.div, { ...o, ref: r });
|
|
328
323
|
}
|
|
329
324
|
);
|
|
330
|
-
|
|
331
|
-
var $t = "ToastDescription",
|
|
325
|
+
Le.displayName = Ht;
|
|
326
|
+
var $t = "ToastDescription", Oe = n.forwardRef(
|
|
332
327
|
(e, r) => {
|
|
333
328
|
const { __scopeToast: t, ...o } = e;
|
|
334
|
-
return /* @__PURE__ */ s.jsx(
|
|
329
|
+
return /* @__PURE__ */ s.jsx(k.div, { ...o, ref: r });
|
|
335
330
|
}
|
|
336
331
|
);
|
|
337
|
-
|
|
332
|
+
Oe.displayName = $t;
|
|
338
333
|
var Ie = "ToastAction", Fe = n.forwardRef(
|
|
339
334
|
(e, r) => {
|
|
340
335
|
const { altText: t, ...o } = e;
|
|
@@ -346,9 +341,9 @@ var Ie = "ToastAction", Fe = n.forwardRef(
|
|
|
346
341
|
Fe.displayName = Ie;
|
|
347
342
|
var Me = "ToastClose", le = n.forwardRef(
|
|
348
343
|
(e, r) => {
|
|
349
|
-
const { __scopeToast: t, ...o } = e, a =
|
|
344
|
+
const { __scopeToast: t, ...o } = e, a = Ft(Me, t);
|
|
350
345
|
return /* @__PURE__ */ s.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ s.jsx(
|
|
351
|
-
|
|
346
|
+
k.button,
|
|
352
347
|
{
|
|
353
348
|
type: "button",
|
|
354
349
|
...o,
|
|
@@ -362,7 +357,7 @@ le.displayName = Me;
|
|
|
362
357
|
var Ve = n.forwardRef((e, r) => {
|
|
363
358
|
const { __scopeToast: t, altText: o, ...a } = e;
|
|
364
359
|
return /* @__PURE__ */ s.jsx(
|
|
365
|
-
|
|
360
|
+
k.div,
|
|
366
361
|
{
|
|
367
362
|
"data-radix-toast-announce-exclude": "",
|
|
368
363
|
"data-radix-toast-announce-alt": o || void 0,
|
|
@@ -371,21 +366,21 @@ var Ve = n.forwardRef((e, r) => {
|
|
|
371
366
|
}
|
|
372
367
|
);
|
|
373
368
|
});
|
|
374
|
-
function
|
|
369
|
+
function He(e) {
|
|
375
370
|
const r = [];
|
|
376
371
|
return Array.from(e.childNodes).forEach((o) => {
|
|
377
|
-
if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent),
|
|
372
|
+
if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Wt(o)) {
|
|
378
373
|
const a = o.ariaHidden || o.hidden || o.style.display === "none", c = o.dataset.radixToastAnnounceExclude === "";
|
|
379
374
|
if (!a)
|
|
380
375
|
if (c) {
|
|
381
376
|
const l = o.dataset.radixToastAnnounceAlt;
|
|
382
377
|
l && r.push(l);
|
|
383
378
|
} else
|
|
384
|
-
r.push(
|
|
379
|
+
r.push(...He(o));
|
|
385
380
|
}
|
|
386
381
|
}), r;
|
|
387
382
|
}
|
|
388
|
-
function
|
|
383
|
+
function U(e, r, t, { discrete: o }) {
|
|
389
384
|
const a = t.originalEvent.currentTarget, c = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
|
|
390
385
|
r && a.addEventListener(e, r, { once: !0 }), o ? ot(a, c) : a.dispatchEvent(c);
|
|
391
386
|
}
|
|
@@ -393,9 +388,9 @@ var ge = (e, r, t = 0) => {
|
|
|
393
388
|
const o = Math.abs(e.x), a = Math.abs(e.y), c = o > a;
|
|
394
389
|
return r === "left" || r === "right" ? c && o > t : !c && a > t;
|
|
395
390
|
};
|
|
396
|
-
function
|
|
391
|
+
function Kt(e = () => {
|
|
397
392
|
}) {
|
|
398
|
-
const r =
|
|
393
|
+
const r = Y(e);
|
|
399
394
|
nt(() => {
|
|
400
395
|
let t = 0, o = 0;
|
|
401
396
|
return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
|
|
@@ -403,10 +398,10 @@ function Ht(e = () => {
|
|
|
403
398
|
};
|
|
404
399
|
}, [r]);
|
|
405
400
|
}
|
|
406
|
-
function
|
|
401
|
+
function Wt(e) {
|
|
407
402
|
return e.nodeType === e.ELEMENT_NODE;
|
|
408
403
|
}
|
|
409
|
-
function
|
|
404
|
+
function zt(e) {
|
|
410
405
|
const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
411
406
|
acceptNode: (o) => {
|
|
412
407
|
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
@@ -420,20 +415,20 @@ function te(e) {
|
|
|
420
415
|
const r = document.activeElement;
|
|
421
416
|
return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
|
|
422
417
|
}
|
|
423
|
-
var
|
|
424
|
-
const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt,
|
|
418
|
+
var $e = ke, Ke = De, We = Le, ze = Oe, qe = Fe, Ue = le;
|
|
419
|
+
const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, qt = (e, r) => (t) => {
|
|
425
420
|
var o;
|
|
426
421
|
if ((r == null ? void 0 : r.variants) == null) return be(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
427
422
|
const { variants: a, defaultVariants: c } = r, l = Object.keys(a).map((i) => {
|
|
428
423
|
const p = t == null ? void 0 : t[i], x = c == null ? void 0 : c[i];
|
|
429
424
|
if (p === null) return null;
|
|
430
|
-
const
|
|
431
|
-
return a[i][
|
|
425
|
+
const T = ye(p) || ye(x);
|
|
426
|
+
return a[i][T];
|
|
432
427
|
}), m = t && Object.entries(t).reduce((i, p) => {
|
|
433
|
-
let [x,
|
|
434
|
-
return
|
|
428
|
+
let [x, T] = p;
|
|
429
|
+
return T === void 0 || (i[x] = T), i;
|
|
435
430
|
}, {}), u = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((i, p) => {
|
|
436
|
-
let { class: x, className:
|
|
431
|
+
let { class: x, className: T, ...w } = p;
|
|
437
432
|
return Object.entries(w).every((y) => {
|
|
438
433
|
let [f, d] = y;
|
|
439
434
|
return Array.isArray(d) ? d.includes({
|
|
@@ -446,12 +441,12 @@ const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, z
|
|
|
446
441
|
}) ? [
|
|
447
442
|
...i,
|
|
448
443
|
x,
|
|
449
|
-
|
|
444
|
+
T
|
|
450
445
|
] : i;
|
|
451
446
|
}, []);
|
|
452
447
|
return be(e, l, u, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
453
|
-
},
|
|
454
|
-
|
|
448
|
+
}, Ut = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
449
|
+
$e,
|
|
455
450
|
{
|
|
456
451
|
ref: t,
|
|
457
452
|
className: P(
|
|
@@ -461,8 +456,8 @@ const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, z
|
|
|
461
456
|
...r
|
|
462
457
|
}
|
|
463
458
|
));
|
|
464
|
-
|
|
465
|
-
const
|
|
459
|
+
Ut.displayName = $e.displayName;
|
|
460
|
+
const Yt = qt(
|
|
466
461
|
"group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden py-3 px-[15px] transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-neutral-800",
|
|
467
462
|
{
|
|
468
463
|
variants: {
|
|
@@ -482,7 +477,7 @@ const Ut = zt(
|
|
|
482
477
|
Ke,
|
|
483
478
|
{
|
|
484
479
|
ref: o,
|
|
485
|
-
className: P(
|
|
480
|
+
className: P(Yt({ variant: r }), e),
|
|
486
481
|
...t
|
|
487
482
|
}
|
|
488
483
|
));
|
|
@@ -499,7 +494,7 @@ const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
|
499
494
|
}
|
|
500
495
|
));
|
|
501
496
|
Xt.displayName = qe.displayName;
|
|
502
|
-
const
|
|
497
|
+
const Bt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
|
|
503
498
|
Ue,
|
|
504
499
|
{
|
|
505
500
|
ref: o,
|
|
@@ -512,8 +507,8 @@ const Yt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__
|
|
|
512
507
|
children: /* @__PURE__ */ s.jsx(st, { className: P(`size-4 text-${r}-10`) })
|
|
513
508
|
}
|
|
514
509
|
));
|
|
515
|
-
|
|
516
|
-
const
|
|
510
|
+
Bt.displayName = Ue.displayName;
|
|
511
|
+
const Ye = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
517
512
|
We,
|
|
518
513
|
{
|
|
519
514
|
ref: t,
|
|
@@ -521,8 +516,8 @@ const Ge = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
|
521
516
|
...r
|
|
522
517
|
}
|
|
523
518
|
));
|
|
524
|
-
|
|
525
|
-
const
|
|
519
|
+
Ye.displayName = We.displayName;
|
|
520
|
+
const Ge = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
526
521
|
ze,
|
|
527
522
|
{
|
|
528
523
|
ref: t,
|
|
@@ -530,7 +525,7 @@ const Xe = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
|
530
525
|
...r
|
|
531
526
|
}
|
|
532
527
|
));
|
|
533
|
-
|
|
528
|
+
Ge.displayName = ze.displayName;
|
|
534
529
|
const kr = ({
|
|
535
530
|
type: e = "info",
|
|
536
531
|
title: r,
|
|
@@ -546,14 +541,14 @@ const kr = ({
|
|
|
546
541
|
children: [
|
|
547
542
|
o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ct[e] }),
|
|
548
543
|
/* @__PURE__ */ s.jsxs("div", { className: "flex flex-col", children: [
|
|
549
|
-
/* @__PURE__ */ s.jsx(
|
|
550
|
-
/* @__PURE__ */ s.jsx(
|
|
544
|
+
/* @__PURE__ */ s.jsx(Ye, { className: o ? "text-left" : "text-center", children: r }),
|
|
545
|
+
/* @__PURE__ */ s.jsx(Ge, { className: o ? "text-left" : "text-center", children: t })
|
|
551
546
|
] })
|
|
552
547
|
]
|
|
553
548
|
}
|
|
554
|
-
), { Root:
|
|
549
|
+
), { Root: Jt, Thumb: Qt } = at, _r = n.forwardRef(({ classNames: e, ...r }, t) => {
|
|
555
550
|
const o = r.checked ?? !1;
|
|
556
|
-
return /* @__PURE__ */ s.jsxs(
|
|
551
|
+
return /* @__PURE__ */ s.jsxs(Jt, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
|
|
557
552
|
/* @__PURE__ */ s.jsx(
|
|
558
553
|
"div",
|
|
559
554
|
{
|
|
@@ -589,7 +584,7 @@ const kr = ({
|
|
|
589
584
|
}
|
|
590
585
|
),
|
|
591
586
|
/* @__PURE__ */ s.jsx("div", { className: P(D.borderLine) }),
|
|
592
|
-
/* @__PURE__ */ s.jsx(
|
|
587
|
+
/* @__PURE__ */ s.jsx(Qt, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
|
|
593
588
|
] });
|
|
594
589
|
}), D = {
|
|
595
590
|
base: "group relative inline-flex w-20 h-[38px] shrink-0 cursor-pointer items-center bg-gray-50 rounded-[10px] transition-colors duration-200 transition-colors",
|
|
@@ -600,60 +595,61 @@ const kr = ({
|
|
|
600
595
|
},
|
|
601
596
|
borderLine: "pointer-events-none absolute z-0 left-0 top-0 w-full h-full group-hover:border group-hover:border-primary-20/[.30] rounded-[10px] transition-colors duration-200"
|
|
602
597
|
};
|
|
603
|
-
var [
|
|
598
|
+
var [J, Zt] = Ce("Tooltip", [
|
|
604
599
|
Ne
|
|
605
|
-
]),
|
|
600
|
+
]), Q = Ne(), Xe = "TooltipProvider", er = 700, ae = "tooltip.open", [tr, de] = J(Xe), ue = (e) => {
|
|
606
601
|
const {
|
|
607
602
|
__scopeTooltip: r,
|
|
608
|
-
delayDuration: t =
|
|
603
|
+
delayDuration: t = er,
|
|
609
604
|
skipDelayDuration: o = 300,
|
|
610
605
|
disableHoverableContent: a = !1,
|
|
611
606
|
children: c
|
|
612
|
-
} = e,
|
|
607
|
+
} = e, l = n.useRef(!0), m = n.useRef(!1), u = n.useRef(0);
|
|
613
608
|
return n.useEffect(() => {
|
|
614
|
-
const
|
|
615
|
-
return () => window.clearTimeout(
|
|
609
|
+
const i = u.current;
|
|
610
|
+
return () => window.clearTimeout(i);
|
|
616
611
|
}, []), /* @__PURE__ */ s.jsx(
|
|
617
|
-
|
|
612
|
+
tr,
|
|
618
613
|
{
|
|
619
614
|
scope: r,
|
|
620
|
-
|
|
615
|
+
isOpenDelayedRef: l,
|
|
621
616
|
delayDuration: t,
|
|
622
617
|
onOpen: n.useCallback(() => {
|
|
623
|
-
window.clearTimeout(
|
|
618
|
+
window.clearTimeout(u.current), l.current = !1;
|
|
624
619
|
}, []),
|
|
625
620
|
onClose: n.useCallback(() => {
|
|
626
|
-
window.clearTimeout(
|
|
627
|
-
() =>
|
|
621
|
+
window.clearTimeout(u.current), u.current = window.setTimeout(
|
|
622
|
+
() => l.current = !0,
|
|
628
623
|
o
|
|
629
624
|
);
|
|
630
625
|
}, [o]),
|
|
631
|
-
isPointerInTransitRef:
|
|
632
|
-
onPointerInTransitChange: n.useCallback((
|
|
633
|
-
|
|
626
|
+
isPointerInTransitRef: m,
|
|
627
|
+
onPointerInTransitChange: n.useCallback((i) => {
|
|
628
|
+
m.current = i;
|
|
634
629
|
}, []),
|
|
635
630
|
disableHoverableContent: a,
|
|
636
631
|
children: c
|
|
637
632
|
}
|
|
638
633
|
);
|
|
639
634
|
};
|
|
640
|
-
ue.displayName =
|
|
641
|
-
var
|
|
635
|
+
ue.displayName = Xe;
|
|
636
|
+
var H = "Tooltip", [rr, K] = J(H), pe = (e) => {
|
|
642
637
|
const {
|
|
643
638
|
__scopeTooltip: r,
|
|
644
639
|
children: t,
|
|
645
640
|
open: o,
|
|
646
|
-
defaultOpen: a
|
|
641
|
+
defaultOpen: a,
|
|
647
642
|
onOpenChange: c,
|
|
648
643
|
disableHoverableContent: l,
|
|
649
644
|
delayDuration: m
|
|
650
|
-
} = e, u = de(
|
|
645
|
+
} = e, u = de(H, e.__scopeTooltip), i = Q(r), [p, x] = n.useState(null), T = ct(), w = n.useRef(0), y = l ?? u.disableHoverableContent, f = m ?? u.delayDuration, d = n.useRef(!1), [b, h] = Pe({
|
|
651
646
|
prop: o,
|
|
652
|
-
defaultProp: a,
|
|
647
|
+
defaultProp: a ?? !1,
|
|
653
648
|
onChange: (A) => {
|
|
654
649
|
A ? (u.onOpen(), document.dispatchEvent(new CustomEvent(ae))) : u.onClose(), c == null || c(A);
|
|
655
|
-
}
|
|
656
|
-
|
|
650
|
+
},
|
|
651
|
+
caller: H
|
|
652
|
+
}), g = n.useMemo(() => b ? d.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
|
|
657
653
|
window.clearTimeout(w.current), w.current = 0, d.current = !1, h(!0);
|
|
658
654
|
}, [h]), C = n.useCallback(() => {
|
|
659
655
|
window.clearTimeout(w.current), w.current = 0, h(!1);
|
|
@@ -665,17 +661,17 @@ var Q = "Tooltip", [tr, $] = B(Q), pe = (e) => {
|
|
|
665
661
|
return n.useEffect(() => () => {
|
|
666
662
|
w.current && (window.clearTimeout(w.current), w.current = 0);
|
|
667
663
|
}, []), /* @__PURE__ */ s.jsx(lt, { ...i, children: /* @__PURE__ */ s.jsx(
|
|
668
|
-
|
|
664
|
+
rr,
|
|
669
665
|
{
|
|
670
666
|
scope: r,
|
|
671
|
-
contentId:
|
|
667
|
+
contentId: T,
|
|
672
668
|
open: b,
|
|
673
|
-
stateAttribute:
|
|
669
|
+
stateAttribute: g,
|
|
674
670
|
trigger: p,
|
|
675
671
|
onTriggerChange: x,
|
|
676
672
|
onTriggerEnter: n.useCallback(() => {
|
|
677
|
-
u.
|
|
678
|
-
}, [u.
|
|
673
|
+
u.isOpenDelayedRef.current ? N() : E();
|
|
674
|
+
}, [u.isOpenDelayedRef, N, E]),
|
|
679
675
|
onTriggerLeave: n.useCallback(() => {
|
|
680
676
|
y ? C() : (window.clearTimeout(w.current), w.current = 0);
|
|
681
677
|
}, [C, y]),
|
|
@@ -686,25 +682,25 @@ var Q = "Tooltip", [tr, $] = B(Q), pe = (e) => {
|
|
|
686
682
|
}
|
|
687
683
|
) });
|
|
688
684
|
};
|
|
689
|
-
pe.displayName =
|
|
685
|
+
pe.displayName = H;
|
|
690
686
|
var ie = "TooltipTrigger", fe = n.forwardRef(
|
|
691
687
|
(e, r) => {
|
|
692
|
-
const { __scopeTooltip: t, ...o } = e, a =
|
|
688
|
+
const { __scopeTooltip: t, ...o } = e, a = K(ie, t), c = de(ie, t), l = Q(t), m = n.useRef(null), u = G(r, m, a.onTriggerChange), i = n.useRef(!1), p = n.useRef(!1), x = n.useCallback(() => i.current = !1, []);
|
|
693
689
|
return n.useEffect(() => () => document.removeEventListener("pointerup", x), [x]), /* @__PURE__ */ s.jsx(dt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
|
|
694
|
-
|
|
690
|
+
k.button,
|
|
695
691
|
{
|
|
696
692
|
"aria-describedby": a.open ? a.contentId : void 0,
|
|
697
693
|
"data-state": a.stateAttribute,
|
|
698
694
|
...o,
|
|
699
695
|
ref: u,
|
|
700
|
-
onPointerMove: R(e.onPointerMove, (
|
|
701
|
-
|
|
696
|
+
onPointerMove: R(e.onPointerMove, (T) => {
|
|
697
|
+
T.pointerType !== "touch" && !p.current && !c.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
|
|
702
698
|
}),
|
|
703
699
|
onPointerLeave: R(e.onPointerLeave, () => {
|
|
704
700
|
a.onTriggerLeave(), p.current = !1;
|
|
705
701
|
}),
|
|
706
702
|
onPointerDown: R(e.onPointerDown, () => {
|
|
707
|
-
i.current = !0, document.addEventListener("pointerup", x, { once: !0 });
|
|
703
|
+
a.open && a.onClose(), i.current = !0, document.addEventListener("pointerup", x, { once: !0 });
|
|
708
704
|
}),
|
|
709
705
|
onFocus: R(e.onFocus, () => {
|
|
710
706
|
i.current || a.onOpen();
|
|
@@ -716,45 +712,45 @@ var ie = "TooltipTrigger", fe = n.forwardRef(
|
|
|
716
712
|
}
|
|
717
713
|
);
|
|
718
714
|
fe.displayName = ie;
|
|
719
|
-
var ve = "TooltipPortal", [
|
|
715
|
+
var ve = "TooltipPortal", [or, nr] = J(ve, {
|
|
720
716
|
forceMount: void 0
|
|
721
717
|
}), me = (e) => {
|
|
722
|
-
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c =
|
|
723
|
-
return /* @__PURE__ */ s.jsx(
|
|
718
|
+
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c = K(ve, r);
|
|
719
|
+
return /* @__PURE__ */ s.jsx(or, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ce, { present: t || c.open, children: /* @__PURE__ */ s.jsx(Re, { asChild: !0, container: a, children: o }) }) });
|
|
724
720
|
};
|
|
725
721
|
me.displayName = ve;
|
|
726
722
|
var I = "TooltipContent", xe = n.forwardRef(
|
|
727
723
|
(e, r) => {
|
|
728
|
-
const t =
|
|
729
|
-
return /* @__PURE__ */ s.jsx(ce, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(Be, { side: a, ...c, ref: r }) : /* @__PURE__ */ s.jsx(
|
|
724
|
+
const t = nr(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l = K(I, e.__scopeTooltip);
|
|
725
|
+
return /* @__PURE__ */ s.jsx(ce, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(Be, { side: a, ...c, ref: r }) : /* @__PURE__ */ s.jsx(sr, { side: a, ...c, ref: r }) });
|
|
730
726
|
}
|
|
731
|
-
),
|
|
732
|
-
const t =
|
|
727
|
+
), sr = n.forwardRef((e, r) => {
|
|
728
|
+
const t = K(I, e.__scopeTooltip), o = de(I, e.__scopeTooltip), a = n.useRef(null), c = G(r, a), [l, m] = n.useState(null), { trigger: u, onClose: i } = t, p = a.current, { onPointerInTransitChange: x } = o, T = n.useCallback(() => {
|
|
733
729
|
m(null), x(!1);
|
|
734
730
|
}, [x]), w = n.useCallback(
|
|
735
731
|
(y, f) => {
|
|
736
|
-
const d = y.currentTarget, b = { x: y.clientX, y: y.clientY }, h =
|
|
732
|
+
const d = y.currentTarget, b = { x: y.clientX, y: y.clientY }, h = lr(b, d.getBoundingClientRect()), g = dr(b, h), E = ur(f.getBoundingClientRect()), C = fr([...g, ...E]);
|
|
737
733
|
m(C), x(!0);
|
|
738
734
|
},
|
|
739
735
|
[x]
|
|
740
736
|
);
|
|
741
|
-
return n.useEffect(() => () =>
|
|
737
|
+
return n.useEffect(() => () => T(), [T]), n.useEffect(() => {
|
|
742
738
|
if (u && p) {
|
|
743
739
|
const y = (d) => w(d, p), f = (d) => w(d, u);
|
|
744
740
|
return u.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
|
|
745
741
|
u.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
|
|
746
742
|
};
|
|
747
743
|
}
|
|
748
|
-
}, [u, p, w,
|
|
744
|
+
}, [u, p, w, T]), n.useEffect(() => {
|
|
749
745
|
if (l) {
|
|
750
746
|
const y = (f) => {
|
|
751
|
-
const d = f.target, b = { x: f.clientX, y: f.clientY }, h = (u == null ? void 0 : u.contains(d)) || (p == null ? void 0 : p.contains(d)),
|
|
752
|
-
h ?
|
|
747
|
+
const d = f.target, b = { x: f.clientX, y: f.clientY }, h = (u == null ? void 0 : u.contains(d)) || (p == null ? void 0 : p.contains(d)), g = !pr(b, l);
|
|
748
|
+
h ? T() : g && (T(), i());
|
|
753
749
|
};
|
|
754
750
|
return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
|
|
755
751
|
}
|
|
756
|
-
}, [u, p, l, i,
|
|
757
|
-
}), [
|
|
752
|
+
}, [u, p, l, i, T]), /* @__PURE__ */ s.jsx(Be, { ...e, ref: c });
|
|
753
|
+
}), [ar, ir] = J(H, { isInside: !1 }), cr = ft("TooltipContent"), Be = n.forwardRef(
|
|
758
754
|
(e, r) => {
|
|
759
755
|
const {
|
|
760
756
|
__scopeTooltip: t,
|
|
@@ -763,11 +759,11 @@ var I = "TooltipContent", xe = n.forwardRef(
|
|
|
763
759
|
onEscapeKeyDown: c,
|
|
764
760
|
onPointerDownOutside: l,
|
|
765
761
|
...m
|
|
766
|
-
} = e, u =
|
|
762
|
+
} = e, u = K(I, t), i = Q(t), { onClose: p } = u;
|
|
767
763
|
return n.useEffect(() => (document.addEventListener(ae, p), () => document.removeEventListener(ae, p)), [p]), n.useEffect(() => {
|
|
768
764
|
if (u.trigger) {
|
|
769
|
-
const x = (
|
|
770
|
-
const w =
|
|
765
|
+
const x = (T) => {
|
|
766
|
+
const w = T.target;
|
|
771
767
|
w != null && w.contains(u.trigger) && p();
|
|
772
768
|
};
|
|
773
769
|
return window.addEventListener("scroll", x, { capture: !0 }), () => window.removeEventListener("scroll", x, { capture: !0 });
|
|
@@ -797,8 +793,8 @@ var I = "TooltipContent", xe = n.forwardRef(
|
|
|
797
793
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
798
794
|
},
|
|
799
795
|
children: [
|
|
800
|
-
/* @__PURE__ */ s.jsx(
|
|
801
|
-
/* @__PURE__ */ s.jsx(
|
|
796
|
+
/* @__PURE__ */ s.jsx(cr, { children: o }),
|
|
797
|
+
/* @__PURE__ */ s.jsx(ar, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx(Nt, { id: u.contentId, role: "tooltip", children: a || o }) })
|
|
802
798
|
]
|
|
803
799
|
}
|
|
804
800
|
)
|
|
@@ -809,15 +805,15 @@ var I = "TooltipContent", xe = n.forwardRef(
|
|
|
809
805
|
xe.displayName = I;
|
|
810
806
|
var Je = "TooltipArrow", he = n.forwardRef(
|
|
811
807
|
(e, r) => {
|
|
812
|
-
const { __scopeTooltip: t, ...o } = e, a =
|
|
813
|
-
return
|
|
808
|
+
const { __scopeTooltip: t, ...o } = e, a = Q(t);
|
|
809
|
+
return ir(
|
|
814
810
|
Je,
|
|
815
811
|
t
|
|
816
812
|
).isInside ? null : /* @__PURE__ */ s.jsx(it, { ...a, ...o, ref: r });
|
|
817
813
|
}
|
|
818
814
|
);
|
|
819
815
|
he.displayName = Je;
|
|
820
|
-
function
|
|
816
|
+
function lr(e, r) {
|
|
821
817
|
const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), c = Math.abs(r.left - e.x);
|
|
822
818
|
switch (Math.min(t, o, a, c)) {
|
|
823
819
|
case c:
|
|
@@ -832,7 +828,7 @@ function ir(e, r) {
|
|
|
832
828
|
throw new Error("unreachable");
|
|
833
829
|
}
|
|
834
830
|
}
|
|
835
|
-
function
|
|
831
|
+
function dr(e, r, t = 5) {
|
|
836
832
|
const o = [];
|
|
837
833
|
switch (r) {
|
|
838
834
|
case "top":
|
|
@@ -862,7 +858,7 @@ function cr(e, r, t = 5) {
|
|
|
862
858
|
}
|
|
863
859
|
return o;
|
|
864
860
|
}
|
|
865
|
-
function
|
|
861
|
+
function ur(e) {
|
|
866
862
|
const { top: r, right: t, bottom: o, left: a } = e;
|
|
867
863
|
return [
|
|
868
864
|
{ x: a, y: r },
|
|
@@ -871,20 +867,20 @@ function lr(e) {
|
|
|
871
867
|
{ x: a, y: o }
|
|
872
868
|
];
|
|
873
869
|
}
|
|
874
|
-
function
|
|
870
|
+
function pr(e, r) {
|
|
875
871
|
const { x: t, y: o } = e;
|
|
876
872
|
let a = !1;
|
|
877
873
|
for (let c = 0, l = r.length - 1; c < r.length; l = c++) {
|
|
878
|
-
const m = r[c]
|
|
879
|
-
|
|
874
|
+
const m = r[c], u = r[l], i = m.x, p = m.y, x = u.x, T = u.y;
|
|
875
|
+
p > o != T > o && t < (x - i) * (o - p) / (T - p) + i && (a = !a);
|
|
880
876
|
}
|
|
881
877
|
return a;
|
|
882
878
|
}
|
|
883
|
-
function
|
|
879
|
+
function fr(e) {
|
|
884
880
|
const r = e.slice();
|
|
885
|
-
return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0),
|
|
881
|
+
return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), vr(r);
|
|
886
882
|
}
|
|
887
|
-
function
|
|
883
|
+
function vr(e) {
|
|
888
884
|
if (e.length <= 1) return e.slice();
|
|
889
885
|
const r = [];
|
|
890
886
|
for (let o = 0; o < e.length; o++) {
|
|
@@ -909,23 +905,23 @@ function pr(e) {
|
|
|
909
905
|
}
|
|
910
906
|
return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
|
|
911
907
|
}
|
|
912
|
-
var
|
|
913
|
-
const
|
|
908
|
+
var mr = ue, xr = pe, hr = fe, wr = me, Tr = xe, gr = he;
|
|
909
|
+
const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
914
910
|
__proto__: null,
|
|
915
|
-
Arrow:
|
|
916
|
-
Content:
|
|
917
|
-
Portal:
|
|
918
|
-
Provider:
|
|
919
|
-
Root:
|
|
911
|
+
Arrow: gr,
|
|
912
|
+
Content: Tr,
|
|
913
|
+
Portal: wr,
|
|
914
|
+
Provider: mr,
|
|
915
|
+
Root: xr,
|
|
920
916
|
Tooltip: pe,
|
|
921
917
|
TooltipArrow: he,
|
|
922
918
|
TooltipContent: xe,
|
|
923
919
|
TooltipPortal: me,
|
|
924
920
|
TooltipProvider: ue,
|
|
925
921
|
TooltipTrigger: fe,
|
|
926
|
-
Trigger:
|
|
927
|
-
createTooltipScope:
|
|
928
|
-
}, Symbol.toStringTag, { value: "Module" })), { Provider:
|
|
922
|
+
Trigger: hr,
|
|
923
|
+
createTooltipScope: Zt
|
|
924
|
+
}, Symbol.toStringTag, { value: "Module" })), { Provider: br, Root: Er, Trigger: Cr, Portal: Pr, Content: Rr, Arrow: Nr } = yr, Dr = ({
|
|
929
925
|
children: e,
|
|
930
926
|
className: r,
|
|
931
927
|
defaultOpen: t,
|
|
@@ -933,17 +929,17 @@ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
933
929
|
content: a,
|
|
934
930
|
delayDuration: c = 0,
|
|
935
931
|
isDisabled: l = !1
|
|
936
|
-
}) => /* @__PURE__ */ s.jsx(
|
|
937
|
-
/* @__PURE__ */ s.jsx(
|
|
938
|
-
!l && /* @__PURE__ */ s.jsx(
|
|
939
|
-
|
|
932
|
+
}) => /* @__PURE__ */ s.jsx(br, { children: /* @__PURE__ */ s.jsxs(Er, { defaultOpen: t, delayDuration: c, children: [
|
|
933
|
+
/* @__PURE__ */ s.jsx(Cr, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
|
|
934
|
+
!l && /* @__PURE__ */ s.jsx(Pr, { children: /* @__PURE__ */ s.jsxs(
|
|
935
|
+
Rr,
|
|
940
936
|
{
|
|
941
937
|
side: o,
|
|
942
938
|
sideOffset: 5,
|
|
943
939
|
className: P(Ee.content, r),
|
|
944
940
|
children: [
|
|
945
941
|
a,
|
|
946
|
-
/* @__PURE__ */ s.jsx(
|
|
942
|
+
/* @__PURE__ */ s.jsx(Nr, { className: Ee.arrow })
|
|
947
943
|
]
|
|
948
944
|
}
|
|
949
945
|
) })
|
|
@@ -956,7 +952,7 @@ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
956
952
|
"data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade"
|
|
957
953
|
),
|
|
958
954
|
arrow: "fill-dark-30"
|
|
959
|
-
},
|
|
955
|
+
}, Lr = ({
|
|
960
956
|
value: e,
|
|
961
957
|
onValueChange: r,
|
|
962
958
|
classNames: t = {},
|
|
@@ -987,9 +983,9 @@ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
987
983
|
};
|
|
988
984
|
export {
|
|
989
985
|
kr as N,
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
986
|
+
_r as S,
|
|
987
|
+
Dr as T,
|
|
988
|
+
Lr as a,
|
|
993
989
|
re as b,
|
|
994
990
|
D as s,
|
|
995
991
|
Ee as t
|