@namuna-nur/ui-kit 1.4.0 → 1.4.3
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/atoms/index.js +8 -9
- package/lib/index.js +125 -126
- package/lib/molecules/index.js +6 -6
- package/lib/shared/Avatar.tokens.js +3091 -3087
- package/lib/shared/FloorItem.tokens.js +3741 -14691
- package/lib/shared/TabDots.tokens.js +403 -542
- package/lib/shared/twMerge.js +27 -22
- package/lib/src/_shared/index.d.ts +1 -0
- package/lib/src/atoms/Notification/index.d.ts +0 -1
- package/lib/src/atoms/Select/Select.d.ts +1 -1
- package/lib/src/hooks/use-toast.types.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.data.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.stories.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.types.d.ts +1 -1
- package/lib/src/molecules/DateOfBirth/DateOfBirth.stories.d.ts +3 -5
- package/lib/src/molecules/DateOfBirth/DateOfBirth.types.d.ts +4 -3
- package/lib/src/molecules/DateOfBirth/DateOfBirth.utils.d.ts +5 -0
- package/lib/src/molecules/DatePicker/DatePicker.tokens.d.ts +1 -1
- package/lib/src/molecules/DatePicker/DatePicker.utils.d.ts +15 -0
- package/lib/src/molecules/SelectGroup/SelectGroup.d.ts +1 -1
- package/lib/src/molecules/SelectGroup/SelectGroup.types.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- /package/lib/src/{atoms/Notification → _shared}/Notification.utils.d.ts +0 -0
- /package/lib/src/{_shared/types.d.ts → types/index.d.ts} +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { p as s, P as
|
|
1
|
+
import { p as s, P as S, q as et, u as Ce, v as U, w as tt, x as Pe, y as ce, z as R, D as q, 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
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default: /* @__PURE__ */ s.jsx(Se, { className: "text-success-10 fill-success-10" })
|
|
3
|
+
import * as ht from "react-dom";
|
|
4
|
+
import { b as wt, a as P } from "./twMerge.js";
|
|
5
|
+
const Tt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 19, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.6 8a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6.5h6a.75.75 0 0 1 .75.75v6A.75.75 0 0 1 7.6 8zm10.5 0a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 12.1.5h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zM1.6 18.5a.75.75 0 0 1-.75-.75v-6A.75.75 0 0 1 1.6 11h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75zm10.5 0a.75.75 0 0 1-.75-.75v-6a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-.75.75z" })), gt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 13, fill: "currentFill", ...e }, /* @__PURE__ */ n.createElement("path", { fillOpacity: 0.8, d: "M1.45 12.45a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.42.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.27.3.7a1 1 0 0 1-1 1zm0-5a1 1 0 0 1-.72-.28 1 1 0 0 1-.28-.72q0-.43.28-.7.3-.3.72-.3h16q.43 0 .7.3.3.28.3.7a1 1 0 0 1-1 1z" })), Te = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M9.73 18.24a1.2 1.2 0 0 1-.85-.35l-4.53-4.53a1.2 1.2 0 0 1 0-1.7 1.2 1.2 0 0 1 1.7 0l3.68 3.69 8.23-8.23a1.2 1.2 0 0 1 1.7 0 1.2 1.2 0 0 1 0 1.7l-9.08 9.07a1.2 1.2 0 0 1-.85.35" })), yt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.36, d: "m7 17.5 10-10M17 17.5 7 7.5" })), bt = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 9.49a1.4 1.4 0 0 0-1.4 1.39v9.73c0 .76.64 1.39 1.4 1.39a1.4 1.4 0 0 0 1.39-1.39v-9.73a1.4 1.4 0 0 0-1.4-1.4M12.37 3c-.5 0-.97.19-1.32.54q-.25.28-.4.6-.14.35-.14.71c0 .49.2.97.54 1.32.69.69 1.95.69 2.63 0a1.84 1.84 0 0 0 .39-2.02q-.14-.34-.39-.61A1.8 1.8 0 0 0 12.37 3" })), Et = (e) => /* @__PURE__ */ n.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 25, fill: "none", ...e }, /* @__PURE__ */ n.createElement("path", { fill: "currentFill", d: "M12.37 15.51a1.4 1.4 0 0 1-1.4-1.39V4.4c0-.76.64-1.39 1.4-1.39s1.39.63 1.39 1.39v9.73a1.4 1.4 0 0 1-1.4 1.4M12.37 22c-.5 0-.97-.19-1.32-.54a3 3 0 0 1-.4-.6q-.14-.35-.14-.71c0-.49.2-.97.54-1.32a1.94 1.94 0 0 1 2.63 0 1.84 1.84 0 0 1 .39 2.02q-.14.33-.39.61-.54.53-1.31.54" })), Ct = {
|
|
6
|
+
success: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" }),
|
|
7
|
+
danger: /* @__PURE__ */ s.jsx(yt, { className: "text-danger-10 fill-danger-10" }),
|
|
8
|
+
info: /* @__PURE__ */ s.jsx(bt, { className: "text-info-10 fill-info-10" }),
|
|
9
|
+
warning: /* @__PURE__ */ s.jsx(Et, { className: "text-sidebar-20 fill-sidebar-20" }),
|
|
10
|
+
default: /* @__PURE__ */ s.jsx(Te, { className: "text-success-10 fill-success-10" })
|
|
12
11
|
};
|
|
13
|
-
var
|
|
12
|
+
var Pt = "VisuallyHidden", G = n.forwardRef(
|
|
14
13
|
(e, r) => /* @__PURE__ */ s.jsx(
|
|
15
|
-
|
|
14
|
+
S.span,
|
|
16
15
|
{
|
|
17
16
|
...e,
|
|
18
17
|
ref: r,
|
|
@@ -33,134 +32,103 @@ var Vt = "VisuallyHidden", Q = n.forwardRef(
|
|
|
33
32
|
}
|
|
34
33
|
)
|
|
35
34
|
);
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
const {
|
|
39
|
-
__scopeToast: r,
|
|
40
|
-
label: t = "Notification",
|
|
41
|
-
duration: o = 5e3,
|
|
42
|
-
swipeDirection: a = "right",
|
|
43
|
-
swipeThreshold: i = 50,
|
|
44
|
-
children: l
|
|
45
|
-
} = e, [v, d] = n.useState(null), [c, p] = n.useState(0), m = n.useRef(!1), w = n.useRef(!1);
|
|
46
|
-
return t.trim() || console.error(
|
|
47
|
-
`Invalid prop \`label\` supplied to \`${me}\`. Expected non-empty \`string\`.`
|
|
48
|
-
), /* @__PURE__ */ s.jsx(xe.Provider, { scope: r, children: /* @__PURE__ */ s.jsx(
|
|
49
|
-
Wt,
|
|
50
|
-
{
|
|
51
|
-
scope: r,
|
|
52
|
-
label: t,
|
|
53
|
-
duration: o,
|
|
54
|
-
swipeDirection: a,
|
|
55
|
-
swipeThreshold: i,
|
|
56
|
-
toastCount: c,
|
|
57
|
-
viewport: v,
|
|
58
|
-
onViewportChange: d,
|
|
59
|
-
onToastAdd: n.useCallback(() => p((h) => h + 1), []),
|
|
60
|
-
onToastRemove: n.useCallback(() => p((h) => h - 1), []),
|
|
61
|
-
isFocusedToastEscapeKeyDownRef: m,
|
|
62
|
-
isClosePausedRef: w,
|
|
63
|
-
children: l
|
|
64
|
-
}
|
|
65
|
-
) });
|
|
66
|
-
};
|
|
67
|
-
Fe.displayName = me;
|
|
68
|
-
var Ve = "ToastViewport", zt = ["F8"], le = "toast.viewportPause", de = "toast.viewportResume", $e = n.forwardRef(
|
|
35
|
+
G.displayName = Pt;
|
|
36
|
+
var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toast", [At]), [Ar, X] = Ae(Nt), ke = "ToastViewport", kt = ["F8"], oe = "toast.viewportPause", ne = "toast.viewportResume", Se = n.forwardRef(
|
|
69
37
|
(e, r) => {
|
|
70
38
|
const {
|
|
71
39
|
__scopeToast: t,
|
|
72
|
-
hotkey: o =
|
|
40
|
+
hotkey: o = kt,
|
|
73
41
|
label: a = "Notifications ({hotkey})",
|
|
74
|
-
...
|
|
75
|
-
} = e, l =
|
|
42
|
+
...c
|
|
43
|
+
} = e, l = X(ke, t), m = jt(t), u = n.useRef(null), i = n.useRef(null), p = n.useRef(null), x = n.useRef(null), g = U(r, x, l.onViewportChange), w = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = l.toastCount > 0;
|
|
76
44
|
n.useEffect(() => {
|
|
77
|
-
const
|
|
78
|
-
var
|
|
79
|
-
o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((
|
|
45
|
+
const d = (b) => {
|
|
46
|
+
var T;
|
|
47
|
+
o.length !== 0 && o.every((E) => b[E] || b.code === E) && ((T = x.current) == null || T.focus());
|
|
80
48
|
};
|
|
81
|
-
return document.addEventListener("keydown",
|
|
49
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
82
50
|
}, [o]), n.useEffect(() => {
|
|
83
|
-
const
|
|
84
|
-
if (y &&
|
|
85
|
-
const
|
|
51
|
+
const d = u.current, b = x.current;
|
|
52
|
+
if (y && d && b) {
|
|
53
|
+
const h = () => {
|
|
86
54
|
if (!l.isClosePausedRef.current) {
|
|
87
|
-
const
|
|
88
|
-
b.dispatchEvent(
|
|
55
|
+
const N = new CustomEvent(oe);
|
|
56
|
+
b.dispatchEvent(N), l.isClosePausedRef.current = !0;
|
|
89
57
|
}
|
|
90
|
-
},
|
|
58
|
+
}, T = () => {
|
|
91
59
|
if (l.isClosePausedRef.current) {
|
|
92
|
-
const
|
|
93
|
-
b.dispatchEvent(
|
|
60
|
+
const N = new CustomEvent(ne);
|
|
61
|
+
b.dispatchEvent(N), l.isClosePausedRef.current = !1;
|
|
94
62
|
}
|
|
95
|
-
}, E = (
|
|
96
|
-
!
|
|
63
|
+
}, E = (N) => {
|
|
64
|
+
!d.contains(N.relatedTarget) && T();
|
|
97
65
|
}, C = () => {
|
|
98
|
-
|
|
66
|
+
d.contains(document.activeElement) || T();
|
|
99
67
|
};
|
|
100
|
-
return
|
|
101
|
-
|
|
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", T), () => {
|
|
69
|
+
d.removeEventListener("focusin", h), d.removeEventListener("focusout", E), d.removeEventListener("pointermove", h), d.removeEventListener("pointerleave", C), window.removeEventListener("blur", h), window.removeEventListener("focus", T);
|
|
102
70
|
};
|
|
103
71
|
}
|
|
104
72
|
}, [y, l.isClosePausedRef]);
|
|
105
73
|
const f = n.useCallback(
|
|
106
|
-
({ tabbingDirection:
|
|
107
|
-
const
|
|
108
|
-
const E =
|
|
109
|
-
return
|
|
74
|
+
({ tabbingDirection: d }) => {
|
|
75
|
+
const h = m().map((T) => {
|
|
76
|
+
const E = T.ref.current, C = [E, ...Wt(E)];
|
|
77
|
+
return d === "forwards" ? C : C.reverse();
|
|
110
78
|
});
|
|
111
|
-
return (
|
|
79
|
+
return (d === "forwards" ? h.reverse() : h).flat();
|
|
112
80
|
},
|
|
113
|
-
[
|
|
81
|
+
[m]
|
|
114
82
|
);
|
|
115
83
|
return n.useEffect(() => {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const b = (
|
|
119
|
-
var C,
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const F = document.activeElement,
|
|
123
|
-
if (
|
|
124
|
-
(C =
|
|
84
|
+
const d = x.current;
|
|
85
|
+
if (d) {
|
|
86
|
+
const b = (h) => {
|
|
87
|
+
var C, N, A;
|
|
88
|
+
const T = h.altKey || h.ctrlKey || h.metaKey;
|
|
89
|
+
if (h.key === "Tab" && !T) {
|
|
90
|
+
const F = document.activeElement, O = h.shiftKey;
|
|
91
|
+
if (h.target === d && O) {
|
|
92
|
+
(C = i.current) == null || C.focus();
|
|
125
93
|
return;
|
|
126
94
|
}
|
|
127
|
-
const
|
|
128
|
-
|
|
95
|
+
const _ = f({ tabbingDirection: O ? "backwards" : "forwards" }), H = _.findIndex((v) => v === F);
|
|
96
|
+
te(_.slice(H + 1)) ? h.preventDefault() : O ? (N = i.current) == null || N.focus() : (A = p.current) == null || A.focus();
|
|
129
97
|
}
|
|
130
98
|
};
|
|
131
|
-
return
|
|
99
|
+
return d.addEventListener("keydown", b), () => d.removeEventListener("keydown", b);
|
|
132
100
|
}
|
|
133
|
-
}, [
|
|
134
|
-
|
|
101
|
+
}, [m, f]), /* @__PURE__ */ s.jsxs(
|
|
102
|
+
tt,
|
|
135
103
|
{
|
|
136
|
-
ref:
|
|
104
|
+
ref: u,
|
|
137
105
|
role: "region",
|
|
138
|
-
"aria-label": a.replace("{hotkey}",
|
|
106
|
+
"aria-label": a.replace("{hotkey}", w),
|
|
139
107
|
tabIndex: -1,
|
|
140
108
|
style: { pointerEvents: y ? void 0 : "none" },
|
|
141
109
|
children: [
|
|
142
110
|
y && /* @__PURE__ */ s.jsx(
|
|
143
|
-
|
|
111
|
+
se,
|
|
144
112
|
{
|
|
145
|
-
ref:
|
|
113
|
+
ref: i,
|
|
146
114
|
onFocusFromOutsideViewport: () => {
|
|
147
|
-
const
|
|
115
|
+
const d = f({
|
|
148
116
|
tabbingDirection: "forwards"
|
|
149
117
|
});
|
|
150
|
-
|
|
118
|
+
te(d);
|
|
151
119
|
}
|
|
152
120
|
}
|
|
153
121
|
),
|
|
154
|
-
/* @__PURE__ */ s.jsx(
|
|
122
|
+
/* @__PURE__ */ s.jsx(je.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(S.ol, { tabIndex: -1, ...c, ref: g }) }),
|
|
155
123
|
y && /* @__PURE__ */ s.jsx(
|
|
156
|
-
|
|
124
|
+
se,
|
|
157
125
|
{
|
|
158
126
|
ref: p,
|
|
159
127
|
onFocusFromOutsideViewport: () => {
|
|
160
|
-
const
|
|
128
|
+
const d = f({
|
|
161
129
|
tabbingDirection: "backwards"
|
|
162
130
|
});
|
|
163
|
-
|
|
131
|
+
te(d);
|
|
164
132
|
}
|
|
165
133
|
}
|
|
166
134
|
)
|
|
@@ -169,12 +137,12 @@ var Ve = "ToastViewport", zt = ["F8"], le = "toast.viewportPause", de = "toast.v
|
|
|
169
137
|
);
|
|
170
138
|
}
|
|
171
139
|
);
|
|
172
|
-
|
|
173
|
-
var
|
|
140
|
+
Se.displayName = ke;
|
|
141
|
+
var _e = "ToastFocusProxy", se = n.forwardRef(
|
|
174
142
|
(e, r) => {
|
|
175
|
-
const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e,
|
|
143
|
+
const { __scopeToast: t, onFocusFromOutsideViewport: o, ...a } = e, c = X(_e, t);
|
|
176
144
|
return /* @__PURE__ */ s.jsx(
|
|
177
|
-
|
|
145
|
+
G,
|
|
178
146
|
{
|
|
179
147
|
"aria-hidden": !0,
|
|
180
148
|
tabIndex: 0,
|
|
@@ -182,155 +150,155 @@ var He = "ToastFocusProxy", ue = n.forwardRef(
|
|
|
182
150
|
ref: r,
|
|
183
151
|
style: { position: "fixed" },
|
|
184
152
|
onFocus: (l) => {
|
|
185
|
-
var
|
|
186
|
-
const
|
|
187
|
-
!((
|
|
153
|
+
var i;
|
|
154
|
+
const m = l.relatedTarget;
|
|
155
|
+
!((i = c.viewport) != null && i.contains(m)) && o();
|
|
188
156
|
}
|
|
189
157
|
}
|
|
190
158
|
);
|
|
191
159
|
}
|
|
192
160
|
);
|
|
193
|
-
|
|
194
|
-
var
|
|
161
|
+
se.displayName = _e;
|
|
162
|
+
var Y = "Toast", St = "toast.swipeStart", _t = "toast.swipeMove", Dt = "toast.swipeCancel", Ot = "toast.swipeEnd", De = n.forwardRef(
|
|
195
163
|
(e, r) => {
|
|
196
|
-
const { forceMount: t, open: o, defaultOpen: a, onOpenChange:
|
|
164
|
+
const { forceMount: t, open: o, defaultOpen: a, onOpenChange: c, ...l } = e, [m = !0, u] = Pe({
|
|
197
165
|
prop: o,
|
|
198
166
|
defaultProp: a,
|
|
199
|
-
onChange:
|
|
167
|
+
onChange: c
|
|
200
168
|
});
|
|
201
|
-
return /* @__PURE__ */ s.jsx(
|
|
202
|
-
|
|
169
|
+
return /* @__PURE__ */ s.jsx(ce, { present: t || m, children: /* @__PURE__ */ s.jsx(
|
|
170
|
+
Ft,
|
|
203
171
|
{
|
|
204
|
-
open:
|
|
172
|
+
open: m,
|
|
205
173
|
...l,
|
|
206
174
|
ref: r,
|
|
207
|
-
onClose: () =>
|
|
208
|
-
onPause:
|
|
209
|
-
onResume:
|
|
210
|
-
onSwipeStart: R(e.onSwipeStart, (
|
|
211
|
-
|
|
175
|
+
onClose: () => u(!1),
|
|
176
|
+
onPause: q(e.onPause),
|
|
177
|
+
onResume: q(e.onResume),
|
|
178
|
+
onSwipeStart: R(e.onSwipeStart, (i) => {
|
|
179
|
+
i.currentTarget.setAttribute("data-swipe", "start");
|
|
212
180
|
}),
|
|
213
|
-
onSwipeMove: R(e.onSwipeMove, (
|
|
214
|
-
const { x: p, y:
|
|
215
|
-
|
|
181
|
+
onSwipeMove: R(e.onSwipeMove, (i) => {
|
|
182
|
+
const { x: p, y: x } = i.detail.delta;
|
|
183
|
+
i.currentTarget.setAttribute("data-swipe", "move"), i.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${x}px`);
|
|
216
184
|
}),
|
|
217
|
-
onSwipeCancel: R(e.onSwipeCancel, (
|
|
218
|
-
|
|
185
|
+
onSwipeCancel: R(e.onSwipeCancel, (i) => {
|
|
186
|
+
i.currentTarget.setAttribute("data-swipe", "cancel"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
219
187
|
}),
|
|
220
|
-
onSwipeEnd: R(e.onSwipeEnd, (
|
|
221
|
-
const { x: p, y:
|
|
222
|
-
|
|
188
|
+
onSwipeEnd: R(e.onSwipeEnd, (i) => {
|
|
189
|
+
const { x: p, y: x } = i.detail.delta;
|
|
190
|
+
i.currentTarget.setAttribute("data-swipe", "end"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${p}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${x}px`), u(!1);
|
|
223
191
|
})
|
|
224
192
|
}
|
|
225
193
|
) });
|
|
226
194
|
}
|
|
227
195
|
);
|
|
228
|
-
|
|
229
|
-
var [
|
|
196
|
+
De.displayName = Y;
|
|
197
|
+
var [Lt, It] = Ae(Y, {
|
|
230
198
|
onClose() {
|
|
231
199
|
}
|
|
232
|
-
}),
|
|
200
|
+
}), Ft = n.forwardRef(
|
|
233
201
|
(e, r) => {
|
|
234
202
|
const {
|
|
235
203
|
__scopeToast: t,
|
|
236
204
|
type: o = "foreground",
|
|
237
205
|
duration: a,
|
|
238
|
-
open:
|
|
206
|
+
open: c,
|
|
239
207
|
onClose: l,
|
|
240
|
-
onEscapeKeyDown:
|
|
241
|
-
onPause:
|
|
242
|
-
onResume:
|
|
208
|
+
onEscapeKeyDown: m,
|
|
209
|
+
onPause: u,
|
|
210
|
+
onResume: i,
|
|
243
211
|
onSwipeStart: p,
|
|
244
|
-
onSwipeMove:
|
|
245
|
-
onSwipeCancel:
|
|
246
|
-
onSwipeEnd:
|
|
212
|
+
onSwipeMove: x,
|
|
213
|
+
onSwipeCancel: g,
|
|
214
|
+
onSwipeEnd: w,
|
|
247
215
|
...y
|
|
248
|
-
} = e, f =
|
|
249
|
-
var
|
|
250
|
-
(
|
|
251
|
-
}),
|
|
252
|
-
(
|
|
253
|
-
!
|
|
216
|
+
} = e, f = X(Y, t), [d, b] = n.useState(null), h = U(r, (v) => b(v)), T = n.useRef(null), E = n.useRef(null), C = a || f.duration, N = n.useRef(0), A = n.useRef(C), F = n.useRef(0), { onToastAdd: O, onToastRemove: Z } = f, L = q(() => {
|
|
217
|
+
var j;
|
|
218
|
+
(d == null ? void 0 : d.contains(document.activeElement)) && ((j = f.viewport) == null || j.focus()), l();
|
|
219
|
+
}), _ = n.useCallback(
|
|
220
|
+
(v) => {
|
|
221
|
+
!v || v === 1 / 0 || (window.clearTimeout(F.current), N.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(L, v));
|
|
254
222
|
},
|
|
255
|
-
[
|
|
223
|
+
[L]
|
|
256
224
|
);
|
|
257
225
|
n.useEffect(() => {
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
},
|
|
263
|
-
const
|
|
264
|
-
|
|
226
|
+
const v = f.viewport;
|
|
227
|
+
if (v) {
|
|
228
|
+
const j = () => {
|
|
229
|
+
_(A.current), i == null || i();
|
|
230
|
+
}, k = () => {
|
|
231
|
+
const M = (/* @__PURE__ */ new Date()).getTime() - N.current;
|
|
232
|
+
A.current = A.current - M, window.clearTimeout(F.current), u == null || u();
|
|
265
233
|
};
|
|
266
|
-
return
|
|
267
|
-
|
|
234
|
+
return v.addEventListener(oe, k), v.addEventListener(ne, j), () => {
|
|
235
|
+
v.removeEventListener(oe, k), v.removeEventListener(ne, j);
|
|
268
236
|
};
|
|
269
237
|
}
|
|
270
|
-
}, [f.viewport, C,
|
|
271
|
-
|
|
272
|
-
}, [
|
|
273
|
-
const
|
|
238
|
+
}, [f.viewport, C, u, i, _]), n.useEffect(() => {
|
|
239
|
+
c && !f.isClosePausedRef.current && _(C);
|
|
240
|
+
}, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (O(), () => Z()), [O, Z]);
|
|
241
|
+
const H = n.useMemo(() => d ? $e(d) : null, [d]);
|
|
274
242
|
return f.viewport ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
275
|
-
|
|
276
|
-
|
|
243
|
+
H && /* @__PURE__ */ s.jsx(
|
|
244
|
+
Mt,
|
|
277
245
|
{
|
|
278
246
|
__scopeToast: t,
|
|
279
247
|
role: "status",
|
|
280
248
|
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
281
249
|
"aria-atomic": !0,
|
|
282
|
-
children:
|
|
250
|
+
children: H
|
|
283
251
|
}
|
|
284
252
|
),
|
|
285
|
-
/* @__PURE__ */ s.jsx(
|
|
286
|
-
/* @__PURE__ */ s.jsx(
|
|
287
|
-
|
|
253
|
+
/* @__PURE__ */ s.jsx(Lt, { scope: t, onClose: L, children: ht.createPortal(
|
|
254
|
+
/* @__PURE__ */ s.jsx(je.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
|
|
255
|
+
rt,
|
|
288
256
|
{
|
|
289
257
|
asChild: !0,
|
|
290
|
-
onEscapeKeyDown: R(
|
|
291
|
-
f.isFocusedToastEscapeKeyDownRef.current ||
|
|
258
|
+
onEscapeKeyDown: R(m, () => {
|
|
259
|
+
f.isFocusedToastEscapeKeyDownRef.current || L(), f.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
292
260
|
}),
|
|
293
261
|
children: /* @__PURE__ */ s.jsx(
|
|
294
|
-
|
|
262
|
+
S.li,
|
|
295
263
|
{
|
|
296
264
|
role: "status",
|
|
297
265
|
"aria-live": "off",
|
|
298
266
|
"aria-atomic": !0,
|
|
299
267
|
tabIndex: 0,
|
|
300
|
-
"data-state":
|
|
268
|
+
"data-state": c ? "open" : "closed",
|
|
301
269
|
"data-swipe-direction": f.swipeDirection,
|
|
302
270
|
...y,
|
|
303
|
-
ref:
|
|
271
|
+
ref: h,
|
|
304
272
|
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
305
|
-
onKeyDown: R(e.onKeyDown, (
|
|
306
|
-
|
|
273
|
+
onKeyDown: R(e.onKeyDown, (v) => {
|
|
274
|
+
v.key === "Escape" && (m == null || m(v.nativeEvent), v.nativeEvent.defaultPrevented || (f.isFocusedToastEscapeKeyDownRef.current = !0, L()));
|
|
307
275
|
}),
|
|
308
|
-
onPointerDown: R(e.onPointerDown, (
|
|
309
|
-
|
|
276
|
+
onPointerDown: R(e.onPointerDown, (v) => {
|
|
277
|
+
v.button === 0 && (T.current = { x: v.clientX, y: v.clientY });
|
|
310
278
|
}),
|
|
311
|
-
onPointerMove: R(e.onPointerMove, (
|
|
312
|
-
if (!
|
|
313
|
-
const
|
|
314
|
-
|
|
279
|
+
onPointerMove: R(e.onPointerMove, (v) => {
|
|
280
|
+
if (!T.current) return;
|
|
281
|
+
const j = v.clientX - T.current.x, k = v.clientY - T.current.y, M = !!E.current, V = ["left", "right"].includes(f.swipeDirection), K = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, Qe = V ? K(0, j) : 0, Ze = V ? 0 : K(0, k), ee = v.pointerType === "touch" ? 10 : 2, W = { x: Qe, y: Ze }, we = { originalEvent: v, delta: W };
|
|
282
|
+
M ? (E.current = W, z(_t, x, we, {
|
|
315
283
|
discrete: !1
|
|
316
|
-
})) :
|
|
284
|
+
})) : ge(W, f.swipeDirection, ee) ? (E.current = W, z(St, p, we, {
|
|
317
285
|
discrete: !1
|
|
318
|
-
}),
|
|
286
|
+
}), v.target.setPointerCapture(v.pointerId)) : (Math.abs(j) > ee || Math.abs(k) > ee) && (T.current = null);
|
|
319
287
|
}),
|
|
320
|
-
onPointerUp: R(e.onPointerUp, (
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const
|
|
324
|
-
|
|
288
|
+
onPointerUp: R(e.onPointerUp, (v) => {
|
|
289
|
+
const j = E.current, k = v.target;
|
|
290
|
+
if (k.hasPointerCapture(v.pointerId) && k.releasePointerCapture(v.pointerId), E.current = null, T.current = null, j) {
|
|
291
|
+
const M = v.currentTarget, V = { originalEvent: v, delta: j };
|
|
292
|
+
ge(j, f.swipeDirection, f.swipeThreshold) ? z(Ot, w, V, {
|
|
325
293
|
discrete: !0
|
|
326
|
-
}) :
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
294
|
+
}) : z(
|
|
295
|
+
Dt,
|
|
296
|
+
g,
|
|
297
|
+
V,
|
|
330
298
|
{
|
|
331
299
|
discrete: !0
|
|
332
300
|
}
|
|
333
|
-
),
|
|
301
|
+
), M.addEventListener("click", (K) => K.preventDefault(), {
|
|
334
302
|
once: !0
|
|
335
303
|
});
|
|
336
304
|
}
|
|
@@ -343,44 +311,44 @@ var [Yt, Bt] = Le(Z, {
|
|
|
343
311
|
) })
|
|
344
312
|
] }) : null;
|
|
345
313
|
}
|
|
346
|
-
),
|
|
347
|
-
const { __scopeToast: r, children: t, ...o } = e, a =
|
|
348
|
-
return
|
|
349
|
-
const
|
|
350
|
-
return () => window.clearTimeout(
|
|
351
|
-
}, []),
|
|
314
|
+
), Mt = (e) => {
|
|
315
|
+
const { __scopeToast: r, children: t, ...o } = e, a = X(Y, r), [c, l] = n.useState(!1), [m, u] = n.useState(!1);
|
|
316
|
+
return Ht(() => l(!0)), n.useEffect(() => {
|
|
317
|
+
const i = window.setTimeout(() => u(!0), 1e3);
|
|
318
|
+
return () => window.clearTimeout(i);
|
|
319
|
+
}, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(G, { ...o, children: c && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
352
320
|
a.label,
|
|
353
321
|
" ",
|
|
354
322
|
t
|
|
355
323
|
] }) }) });
|
|
356
|
-
},
|
|
324
|
+
}, Vt = "ToastTitle", Oe = n.forwardRef(
|
|
357
325
|
(e, r) => {
|
|
358
326
|
const { __scopeToast: t, ...o } = e;
|
|
359
|
-
return /* @__PURE__ */ s.jsx(
|
|
327
|
+
return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
|
|
360
328
|
}
|
|
361
329
|
);
|
|
362
|
-
|
|
363
|
-
var
|
|
330
|
+
Oe.displayName = Vt;
|
|
331
|
+
var $t = "ToastDescription", Le = n.forwardRef(
|
|
364
332
|
(e, r) => {
|
|
365
333
|
const { __scopeToast: t, ...o } = e;
|
|
366
|
-
return /* @__PURE__ */ s.jsx(
|
|
334
|
+
return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
|
|
367
335
|
}
|
|
368
336
|
);
|
|
369
|
-
|
|
370
|
-
var
|
|
337
|
+
Le.displayName = $t;
|
|
338
|
+
var Ie = "ToastAction", Fe = n.forwardRef(
|
|
371
339
|
(e, r) => {
|
|
372
340
|
const { altText: t, ...o } = e;
|
|
373
|
-
return t.trim() ? /* @__PURE__ */ s.jsx(
|
|
374
|
-
`Invalid prop \`altText\` supplied to \`${
|
|
341
|
+
return t.trim() ? /* @__PURE__ */ s.jsx(Ve, { altText: t, asChild: !0, children: /* @__PURE__ */ s.jsx(le, { ...o, ref: r }) }) : (console.error(
|
|
342
|
+
`Invalid prop \`altText\` supplied to \`${Ie}\`. Expected non-empty \`string\`.`
|
|
375
343
|
), null);
|
|
376
344
|
}
|
|
377
345
|
);
|
|
378
|
-
|
|
379
|
-
var
|
|
346
|
+
Fe.displayName = Ie;
|
|
347
|
+
var Me = "ToastClose", le = n.forwardRef(
|
|
380
348
|
(e, r) => {
|
|
381
|
-
const { __scopeToast: t, ...o } = e, a =
|
|
382
|
-
return /* @__PURE__ */ s.jsx(
|
|
383
|
-
|
|
349
|
+
const { __scopeToast: t, ...o } = e, a = It(Me, t);
|
|
350
|
+
return /* @__PURE__ */ s.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ s.jsx(
|
|
351
|
+
S.button,
|
|
384
352
|
{
|
|
385
353
|
type: "button",
|
|
386
354
|
...o,
|
|
@@ -390,11 +358,11 @@ var Ge = "ToastClose", Te = n.forwardRef(
|
|
|
390
358
|
) });
|
|
391
359
|
}
|
|
392
360
|
);
|
|
393
|
-
|
|
394
|
-
var
|
|
361
|
+
le.displayName = Me;
|
|
362
|
+
var Ve = n.forwardRef((e, r) => {
|
|
395
363
|
const { __scopeToast: t, altText: o, ...a } = e;
|
|
396
364
|
return /* @__PURE__ */ s.jsx(
|
|
397
|
-
|
|
365
|
+
S.div,
|
|
398
366
|
{
|
|
399
367
|
"data-radix-toast-announce-exclude": "",
|
|
400
368
|
"data-radix-toast-announce-alt": o || void 0,
|
|
@@ -403,42 +371,42 @@ var Xe = n.forwardRef((e, r) => {
|
|
|
403
371
|
}
|
|
404
372
|
);
|
|
405
373
|
});
|
|
406
|
-
function
|
|
374
|
+
function $e(e) {
|
|
407
375
|
const r = [];
|
|
408
376
|
return Array.from(e.childNodes).forEach((o) => {
|
|
409
|
-
if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent),
|
|
410
|
-
const a = o.ariaHidden || o.hidden || o.style.display === "none",
|
|
377
|
+
if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Kt(o)) {
|
|
378
|
+
const a = o.ariaHidden || o.hidden || o.style.display === "none", c = o.dataset.radixToastAnnounceExclude === "";
|
|
411
379
|
if (!a)
|
|
412
|
-
if (
|
|
380
|
+
if (c) {
|
|
413
381
|
const l = o.dataset.radixToastAnnounceAlt;
|
|
414
382
|
l && r.push(l);
|
|
415
383
|
} else
|
|
416
|
-
r.push(
|
|
384
|
+
r.push(...$e(o));
|
|
417
385
|
}
|
|
418
386
|
}), r;
|
|
419
387
|
}
|
|
420
|
-
function
|
|
421
|
-
const a = t.originalEvent.currentTarget,
|
|
422
|
-
r && a.addEventListener(e, r, { once: !0 }), o ?
|
|
388
|
+
function z(e, r, t, { discrete: o }) {
|
|
389
|
+
const a = t.originalEvent.currentTarget, c = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
|
|
390
|
+
r && a.addEventListener(e, r, { once: !0 }), o ? ot(a, c) : a.dispatchEvent(c);
|
|
423
391
|
}
|
|
424
|
-
var
|
|
425
|
-
const o = Math.abs(e.x), a = Math.abs(e.y),
|
|
426
|
-
return r === "left" || r === "right" ?
|
|
392
|
+
var ge = (e, r, t = 0) => {
|
|
393
|
+
const o = Math.abs(e.x), a = Math.abs(e.y), c = o > a;
|
|
394
|
+
return r === "left" || r === "right" ? c && o > t : !c && a > t;
|
|
427
395
|
};
|
|
428
|
-
function
|
|
396
|
+
function Ht(e = () => {
|
|
429
397
|
}) {
|
|
430
|
-
const r =
|
|
431
|
-
|
|
398
|
+
const r = q(e);
|
|
399
|
+
nt(() => {
|
|
432
400
|
let t = 0, o = 0;
|
|
433
401
|
return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
|
|
434
402
|
window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
|
|
435
403
|
};
|
|
436
404
|
}, [r]);
|
|
437
405
|
}
|
|
438
|
-
function
|
|
406
|
+
function Kt(e) {
|
|
439
407
|
return e.nodeType === e.ELEMENT_NODE;
|
|
440
408
|
}
|
|
441
|
-
function
|
|
409
|
+
function Wt(e) {
|
|
442
410
|
const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
443
411
|
acceptNode: (o) => {
|
|
444
412
|
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
@@ -448,130 +416,42 @@ function or(e) {
|
|
|
448
416
|
for (; t.nextNode(); ) r.push(t.currentNode);
|
|
449
417
|
return r;
|
|
450
418
|
}
|
|
451
|
-
function
|
|
419
|
+
function te(e) {
|
|
452
420
|
const r = document.activeElement;
|
|
453
421
|
return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
|
|
454
422
|
}
|
|
455
|
-
var
|
|
456
|
-
const
|
|
423
|
+
var He = Se, Ke = De, We = Oe, ze = Le, qe = Fe, Ue = le;
|
|
424
|
+
const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, zt = (e, r) => (t) => {
|
|
457
425
|
var o;
|
|
458
|
-
if ((r == null ? void 0 : r.variants) == null) return
|
|
459
|
-
const { variants: a, defaultVariants:
|
|
460
|
-
const p = t == null ? void 0 : t[
|
|
426
|
+
if ((r == null ? void 0 : r.variants) == null) return be(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
427
|
+
const { variants: a, defaultVariants: c } = r, l = Object.keys(a).map((i) => {
|
|
428
|
+
const p = t == null ? void 0 : t[i], x = c == null ? void 0 : c[i];
|
|
461
429
|
if (p === null) return null;
|
|
462
|
-
const
|
|
463
|
-
return a[
|
|
464
|
-
}),
|
|
465
|
-
let [
|
|
466
|
-
return
|
|
467
|
-
}, {}),
|
|
468
|
-
let { class:
|
|
469
|
-
return Object.entries(
|
|
470
|
-
let [f,
|
|
471
|
-
return Array.isArray(
|
|
472
|
-
...
|
|
473
|
-
...
|
|
430
|
+
const g = ye(p) || ye(x);
|
|
431
|
+
return a[i][g];
|
|
432
|
+
}), m = t && Object.entries(t).reduce((i, p) => {
|
|
433
|
+
let [x, g] = p;
|
|
434
|
+
return g === void 0 || (i[x] = g), i;
|
|
435
|
+
}, {}), u = r == null || (o = r.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((i, p) => {
|
|
436
|
+
let { class: x, className: g, ...w } = p;
|
|
437
|
+
return Object.entries(w).every((y) => {
|
|
438
|
+
let [f, d] = y;
|
|
439
|
+
return Array.isArray(d) ? d.includes({
|
|
440
|
+
...c,
|
|
441
|
+
...m
|
|
474
442
|
}[f]) : {
|
|
475
|
-
...
|
|
476
|
-
...
|
|
477
|
-
}[f] ===
|
|
443
|
+
...c,
|
|
444
|
+
...m
|
|
445
|
+
}[f] === d;
|
|
478
446
|
}) ? [
|
|
479
|
-
...
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
] :
|
|
447
|
+
...i,
|
|
448
|
+
x,
|
|
449
|
+
g
|
|
450
|
+
] : i;
|
|
483
451
|
}, []);
|
|
484
|
-
return
|
|
485
|
-
},
|
|
486
|
-
|
|
487
|
-
let ae = 0;
|
|
488
|
-
const cr = () => (ae = (ae + 1) % Number.MAX_SAFE_INTEGER, ae.toString()), ie = /* @__PURE__ */ new Map(), je = (e) => {
|
|
489
|
-
if (ie.has(e))
|
|
490
|
-
return;
|
|
491
|
-
const r = setTimeout(() => {
|
|
492
|
-
ie.delete(e), H({
|
|
493
|
-
type: k.REMOVE_TOAST,
|
|
494
|
-
toastId: e
|
|
495
|
-
});
|
|
496
|
-
}, ir);
|
|
497
|
-
ie.set(e, r);
|
|
498
|
-
}, lr = (e, r) => {
|
|
499
|
-
switch (r.type) {
|
|
500
|
-
case "ADD_TOAST":
|
|
501
|
-
return {
|
|
502
|
-
...e,
|
|
503
|
-
toasts: [r.toast, ...e.toasts].slice(0, ar)
|
|
504
|
-
};
|
|
505
|
-
case "UPDATE_TOAST":
|
|
506
|
-
return {
|
|
507
|
-
...e,
|
|
508
|
-
toasts: e.toasts.map(
|
|
509
|
-
(t) => t.id === r.toast.id ? { ...t, ...r.toast } : t
|
|
510
|
-
)
|
|
511
|
-
};
|
|
512
|
-
case "DISMISS_TOAST": {
|
|
513
|
-
const { toastId: t } = r;
|
|
514
|
-
return t ? je(t) : e.toasts.forEach((o) => {
|
|
515
|
-
je(o.id);
|
|
516
|
-
}), {
|
|
517
|
-
...e,
|
|
518
|
-
toasts: e.toasts.map(
|
|
519
|
-
(o) => o.id === t || t === void 0 ? {
|
|
520
|
-
...o,
|
|
521
|
-
open: !1
|
|
522
|
-
} : o
|
|
523
|
-
)
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
case k.REMOVE_TOAST:
|
|
527
|
-
return r.toastId === void 0 ? {
|
|
528
|
-
...e,
|
|
529
|
-
toasts: []
|
|
530
|
-
} : {
|
|
531
|
-
...e,
|
|
532
|
-
toasts: e.toasts.filter((t) => t.id !== r.toastId)
|
|
533
|
-
};
|
|
534
|
-
default:
|
|
535
|
-
return e;
|
|
536
|
-
}
|
|
537
|
-
}, G = [];
|
|
538
|
-
let X = { toasts: [] };
|
|
539
|
-
const H = (e) => {
|
|
540
|
-
X = lr(X, e), G.forEach((r) => {
|
|
541
|
-
r(X);
|
|
542
|
-
});
|
|
543
|
-
}, dr = ({ ...e }) => {
|
|
544
|
-
const r = cr(), t = (a) => H({
|
|
545
|
-
type: k.UPDATE_TOAST,
|
|
546
|
-
toast: { ...a, id: r }
|
|
547
|
-
}), o = () => H({ type: k.DISMISS_TOAST, toastId: r });
|
|
548
|
-
return H({
|
|
549
|
-
type: k.ADD_TOAST,
|
|
550
|
-
toast: {
|
|
551
|
-
...e,
|
|
552
|
-
id: r,
|
|
553
|
-
open: !0,
|
|
554
|
-
onOpenChange: (a) => {
|
|
555
|
-
a || o();
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}), {
|
|
559
|
-
id: r,
|
|
560
|
-
dismiss: o,
|
|
561
|
-
update: t
|
|
562
|
-
};
|
|
563
|
-
}, ur = () => {
|
|
564
|
-
const [e, r] = _t(X);
|
|
565
|
-
return Nt(() => (G.push(r), () => {
|
|
566
|
-
const t = G.indexOf(r);
|
|
567
|
-
t > -1 && G.splice(t, 1);
|
|
568
|
-
}), [e]), {
|
|
569
|
-
...e,
|
|
570
|
-
toast: dr,
|
|
571
|
-
dismiss: (t) => H({ type: k.DISMISS_TOAST, toastId: t })
|
|
572
|
-
};
|
|
573
|
-
}, pr = nr, rt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
574
|
-
Be,
|
|
452
|
+
return be(e, l, u, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
453
|
+
}, qt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
454
|
+
He,
|
|
575
455
|
{
|
|
576
456
|
ref: t,
|
|
577
457
|
className: P(
|
|
@@ -581,8 +461,8 @@ const H = (e) => {
|
|
|
581
461
|
...r
|
|
582
462
|
}
|
|
583
463
|
));
|
|
584
|
-
|
|
585
|
-
const
|
|
464
|
+
qt.displayName = He.displayName;
|
|
465
|
+
const Ut = zt(
|
|
586
466
|
"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",
|
|
587
467
|
{
|
|
588
468
|
variants: {
|
|
@@ -598,17 +478,17 @@ const fr = sr(
|
|
|
598
478
|
variant: "default"
|
|
599
479
|
}
|
|
600
480
|
}
|
|
601
|
-
),
|
|
602
|
-
|
|
481
|
+
), Gt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
|
|
482
|
+
Ke,
|
|
603
483
|
{
|
|
604
484
|
ref: o,
|
|
605
|
-
className: P(
|
|
485
|
+
className: P(Ut({ variant: r }), e),
|
|
606
486
|
...t
|
|
607
487
|
}
|
|
608
488
|
));
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
|
|
489
|
+
Gt.displayName = Ke.displayName;
|
|
490
|
+
const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
491
|
+
qe,
|
|
612
492
|
{
|
|
613
493
|
ref: t,
|
|
614
494
|
className: P(
|
|
@@ -618,9 +498,9 @@ const vr = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
|
618
498
|
...r
|
|
619
499
|
}
|
|
620
500
|
));
|
|
621
|
-
|
|
622
|
-
const
|
|
623
|
-
|
|
501
|
+
Xt.displayName = qe.displayName;
|
|
502
|
+
const Yt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
|
|
503
|
+
Ue,
|
|
624
504
|
{
|
|
625
505
|
ref: o,
|
|
626
506
|
className: P(
|
|
@@ -629,47 +509,29 @@ const nt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__
|
|
|
629
509
|
),
|
|
630
510
|
"toast-close": "",
|
|
631
511
|
...t,
|
|
632
|
-
children: /* @__PURE__ */ s.jsx(
|
|
512
|
+
children: /* @__PURE__ */ s.jsx(st, { className: P(`size-4 text-${r}-10`) })
|
|
633
513
|
}
|
|
634
514
|
));
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
|
|
515
|
+
Yt.displayName = Ue.displayName;
|
|
516
|
+
const Ge = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
517
|
+
We,
|
|
638
518
|
{
|
|
639
519
|
ref: t,
|
|
640
520
|
className: P("text-base font-semibold [&+div]:text-xs", e),
|
|
641
521
|
...r
|
|
642
522
|
}
|
|
643
523
|
));
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
524
|
+
Ge.displayName = We.displayName;
|
|
525
|
+
const Xe = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
526
|
+
ze,
|
|
647
527
|
{
|
|
648
528
|
ref: t,
|
|
649
529
|
className: P("text-xs font-normal opacity-90", e),
|
|
650
530
|
...r
|
|
651
531
|
}
|
|
652
532
|
));
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
const { toasts: r } = ur();
|
|
656
|
-
return /* @__PURE__ */ s.jsxs(pr, { children: [
|
|
657
|
-
r.map(({ id: t, title: o, description: a, action: i, ...l }) => /* @__PURE__ */ s.jsxs(ot, { duration: e * 1e3, ...l, children: [
|
|
658
|
-
/* @__PURE__ */ s.jsx("div", { className: "grid gap-1", children: /* @__PURE__ */ s.jsx(
|
|
659
|
-
mr,
|
|
660
|
-
{
|
|
661
|
-
withIcon: l.withIcon,
|
|
662
|
-
type: l.variant,
|
|
663
|
-
title: o,
|
|
664
|
-
description: a
|
|
665
|
-
}
|
|
666
|
-
) }),
|
|
667
|
-
i,
|
|
668
|
-
/* @__PURE__ */ s.jsx(nt, { variant: l.variant })
|
|
669
|
-
] }, t)),
|
|
670
|
-
/* @__PURE__ */ s.jsx(rt, {})
|
|
671
|
-
] });
|
|
672
|
-
}, mr = ({
|
|
533
|
+
Xe.displayName = ze.displayName;
|
|
534
|
+
const kr = ({
|
|
673
535
|
type: e = "info",
|
|
674
536
|
title: r,
|
|
675
537
|
description: t,
|
|
@@ -682,16 +544,16 @@ const Br = ({ duration: e = 5 }) => {
|
|
|
682
544
|
"flex items-center gap-1.5"
|
|
683
545
|
),
|
|
684
546
|
children: [
|
|
685
|
-
o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e &&
|
|
547
|
+
o && /* @__PURE__ */ s.jsx("div", { "data-testid": "notification-icon", children: e && Ct[e] }),
|
|
686
548
|
/* @__PURE__ */ s.jsxs("div", { className: "flex flex-col", children: [
|
|
687
|
-
/* @__PURE__ */ s.jsx(
|
|
688
|
-
/* @__PURE__ */ s.jsx(
|
|
549
|
+
/* @__PURE__ */ s.jsx(Ge, { className: o ? "text-left" : "text-center", children: r }),
|
|
550
|
+
/* @__PURE__ */ s.jsx(Xe, { className: o ? "text-left" : "text-center", children: t })
|
|
689
551
|
] })
|
|
690
552
|
]
|
|
691
553
|
}
|
|
692
|
-
), { Root:
|
|
554
|
+
), { Root: Bt, Thumb: Jt } = at, Sr = n.forwardRef(({ classNames: e, ...r }, t) => {
|
|
693
555
|
const o = r.checked ?? !1;
|
|
694
|
-
return /* @__PURE__ */ s.jsxs(
|
|
556
|
+
return /* @__PURE__ */ s.jsxs(Bt, { ref: t, className: P(D.base, e == null ? void 0 : e.root), ...r, children: [
|
|
695
557
|
/* @__PURE__ */ s.jsx(
|
|
696
558
|
"div",
|
|
697
559
|
{
|
|
@@ -701,7 +563,7 @@ const Br = ({ duration: e = 5 }) => {
|
|
|
701
563
|
!o && D.iconWrapper.checked
|
|
702
564
|
),
|
|
703
565
|
children: /* @__PURE__ */ s.jsx(
|
|
704
|
-
|
|
566
|
+
gt,
|
|
705
567
|
{
|
|
706
568
|
"data-testid": "list-icon",
|
|
707
569
|
className: P(o ? "fill-dark-30/25" : "fill-dark-30/[.80]")
|
|
@@ -718,7 +580,7 @@ const Br = ({ duration: e = 5 }) => {
|
|
|
718
580
|
o && D.iconWrapper.checked
|
|
719
581
|
),
|
|
720
582
|
children: /* @__PURE__ */ s.jsx(
|
|
721
|
-
|
|
583
|
+
Tt,
|
|
722
584
|
{
|
|
723
585
|
"data-testid": "grid-icon",
|
|
724
586
|
className: P(o ? "fill-dark-30/[.80]" : "fill-dark-30/25")
|
|
@@ -727,7 +589,7 @@ const Br = ({ duration: e = 5 }) => {
|
|
|
727
589
|
}
|
|
728
590
|
),
|
|
729
591
|
/* @__PURE__ */ s.jsx("div", { className: P(D.borderLine) }),
|
|
730
|
-
/* @__PURE__ */ s.jsx(
|
|
592
|
+
/* @__PURE__ */ s.jsx(Jt, { tabIndex: 1, className: P(D.thumb, e == null ? void 0 : e.thumb) })
|
|
731
593
|
] });
|
|
732
594
|
}), D = {
|
|
733
595
|
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",
|
|
@@ -738,84 +600,84 @@ const Br = ({ duration: e = 5 }) => {
|
|
|
738
600
|
},
|
|
739
601
|
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"
|
|
740
602
|
};
|
|
741
|
-
var [
|
|
742
|
-
|
|
743
|
-
]),
|
|
603
|
+
var [B, Qt] = Ce("Tooltip", [
|
|
604
|
+
Ne
|
|
605
|
+
]), J = Ne(), Ye = "TooltipProvider", Zt = 700, ae = "tooltip.open", [er, de] = B(Ye), ue = (e) => {
|
|
744
606
|
const {
|
|
745
607
|
__scopeTooltip: r,
|
|
746
|
-
delayDuration: t =
|
|
608
|
+
delayDuration: t = Zt,
|
|
747
609
|
skipDelayDuration: o = 300,
|
|
748
610
|
disableHoverableContent: a = !1,
|
|
749
|
-
children:
|
|
750
|
-
} = e, [l,
|
|
611
|
+
children: c
|
|
612
|
+
} = e, [l, m] = n.useState(!0), u = n.useRef(!1), i = n.useRef(0);
|
|
751
613
|
return n.useEffect(() => {
|
|
752
|
-
const p =
|
|
614
|
+
const p = i.current;
|
|
753
615
|
return () => window.clearTimeout(p);
|
|
754
616
|
}, []), /* @__PURE__ */ s.jsx(
|
|
755
|
-
|
|
617
|
+
er,
|
|
756
618
|
{
|
|
757
619
|
scope: r,
|
|
758
620
|
isOpenDelayed: l,
|
|
759
621
|
delayDuration: t,
|
|
760
622
|
onOpen: n.useCallback(() => {
|
|
761
|
-
window.clearTimeout(
|
|
623
|
+
window.clearTimeout(i.current), m(!1);
|
|
762
624
|
}, []),
|
|
763
625
|
onClose: n.useCallback(() => {
|
|
764
|
-
window.clearTimeout(
|
|
765
|
-
() =>
|
|
626
|
+
window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
627
|
+
() => m(!0),
|
|
766
628
|
o
|
|
767
629
|
);
|
|
768
630
|
}, [o]),
|
|
769
|
-
isPointerInTransitRef:
|
|
631
|
+
isPointerInTransitRef: u,
|
|
770
632
|
onPointerInTransitChange: n.useCallback((p) => {
|
|
771
|
-
|
|
633
|
+
u.current = p;
|
|
772
634
|
}, []),
|
|
773
635
|
disableHoverableContent: a,
|
|
774
|
-
children:
|
|
636
|
+
children: c
|
|
775
637
|
}
|
|
776
638
|
);
|
|
777
639
|
};
|
|
778
|
-
|
|
779
|
-
var
|
|
640
|
+
ue.displayName = Ye;
|
|
641
|
+
var Q = "Tooltip", [tr, $] = B(Q), pe = (e) => {
|
|
780
642
|
const {
|
|
781
643
|
__scopeTooltip: r,
|
|
782
644
|
children: t,
|
|
783
645
|
open: o,
|
|
784
646
|
defaultOpen: a = !1,
|
|
785
|
-
onOpenChange:
|
|
647
|
+
onOpenChange: c,
|
|
786
648
|
disableHoverableContent: l,
|
|
787
|
-
delayDuration:
|
|
788
|
-
} = e,
|
|
649
|
+
delayDuration: m
|
|
650
|
+
} = e, u = de(Q, e.__scopeTooltip), i = J(r), [p, x] = n.useState(null), g = ct(), w = n.useRef(0), y = l ?? u.disableHoverableContent, f = m ?? u.delayDuration, d = n.useRef(!1), [b = !1, h] = Pe({
|
|
789
651
|
prop: o,
|
|
790
652
|
defaultProp: a,
|
|
791
|
-
onChange: (
|
|
792
|
-
|
|
653
|
+
onChange: (A) => {
|
|
654
|
+
A ? (u.onOpen(), document.dispatchEvent(new CustomEvent(ae))) : u.onClose(), c == null || c(A);
|
|
793
655
|
}
|
|
794
|
-
}),
|
|
795
|
-
window.clearTimeout(
|
|
796
|
-
}, [
|
|
797
|
-
window.clearTimeout(
|
|
798
|
-
}, [
|
|
799
|
-
window.clearTimeout(
|
|
800
|
-
|
|
656
|
+
}), T = n.useMemo(() => b ? d.current ? "delayed-open" : "instant-open" : "closed", [b]), E = n.useCallback(() => {
|
|
657
|
+
window.clearTimeout(w.current), w.current = 0, d.current = !1, h(!0);
|
|
658
|
+
}, [h]), C = n.useCallback(() => {
|
|
659
|
+
window.clearTimeout(w.current), w.current = 0, h(!1);
|
|
660
|
+
}, [h]), N = n.useCallback(() => {
|
|
661
|
+
window.clearTimeout(w.current), w.current = window.setTimeout(() => {
|
|
662
|
+
d.current = !0, h(!0), w.current = 0;
|
|
801
663
|
}, f);
|
|
802
|
-
}, [f,
|
|
664
|
+
}, [f, h]);
|
|
803
665
|
return n.useEffect(() => () => {
|
|
804
|
-
|
|
805
|
-
}, []), /* @__PURE__ */ s.jsx(
|
|
806
|
-
|
|
666
|
+
w.current && (window.clearTimeout(w.current), w.current = 0);
|
|
667
|
+
}, []), /* @__PURE__ */ s.jsx(lt, { ...i, children: /* @__PURE__ */ s.jsx(
|
|
668
|
+
tr,
|
|
807
669
|
{
|
|
808
670
|
scope: r,
|
|
809
|
-
contentId:
|
|
671
|
+
contentId: g,
|
|
810
672
|
open: b,
|
|
811
|
-
stateAttribute:
|
|
673
|
+
stateAttribute: T,
|
|
812
674
|
trigger: p,
|
|
813
|
-
onTriggerChange:
|
|
675
|
+
onTriggerChange: x,
|
|
814
676
|
onTriggerEnter: n.useCallback(() => {
|
|
815
|
-
|
|
816
|
-
}, [
|
|
677
|
+
u.isOpenDelayed ? N() : E();
|
|
678
|
+
}, [u.isOpenDelayed, N, E]),
|
|
817
679
|
onTriggerLeave: n.useCallback(() => {
|
|
818
|
-
y ? C() : (window.clearTimeout(
|
|
680
|
+
y ? C() : (window.clearTimeout(w.current), w.current = 0);
|
|
819
681
|
}, [C, y]),
|
|
820
682
|
onOpen: E,
|
|
821
683
|
onClose: C,
|
|
@@ -824,28 +686,28 @@ var re = "Tooltip", [yr, K] = ee(re), ge = (e) => {
|
|
|
824
686
|
}
|
|
825
687
|
) });
|
|
826
688
|
};
|
|
827
|
-
|
|
828
|
-
var
|
|
689
|
+
pe.displayName = Q;
|
|
690
|
+
var ie = "TooltipTrigger", fe = n.forwardRef(
|
|
829
691
|
(e, r) => {
|
|
830
|
-
const { __scopeTooltip: t, ...o } = e, a =
|
|
831
|
-
return n.useEffect(() => () => document.removeEventListener("pointerup",
|
|
832
|
-
|
|
692
|
+
const { __scopeTooltip: t, ...o } = e, a = $(ie, t), c = de(ie, t), l = J(t), m = n.useRef(null), u = U(r, m, a.onTriggerChange), i = n.useRef(!1), p = n.useRef(!1), x = n.useCallback(() => i.current = !1, []);
|
|
693
|
+
return n.useEffect(() => () => document.removeEventListener("pointerup", x), [x]), /* @__PURE__ */ s.jsx(dt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
|
|
694
|
+
S.button,
|
|
833
695
|
{
|
|
834
696
|
"aria-describedby": a.open ? a.contentId : void 0,
|
|
835
697
|
"data-state": a.stateAttribute,
|
|
836
698
|
...o,
|
|
837
|
-
ref:
|
|
838
|
-
onPointerMove: R(e.onPointerMove, (
|
|
839
|
-
|
|
699
|
+
ref: u,
|
|
700
|
+
onPointerMove: R(e.onPointerMove, (g) => {
|
|
701
|
+
g.pointerType !== "touch" && !p.current && !c.isPointerInTransitRef.current && (a.onTriggerEnter(), p.current = !0);
|
|
840
702
|
}),
|
|
841
703
|
onPointerLeave: R(e.onPointerLeave, () => {
|
|
842
704
|
a.onTriggerLeave(), p.current = !1;
|
|
843
705
|
}),
|
|
844
706
|
onPointerDown: R(e.onPointerDown, () => {
|
|
845
|
-
|
|
707
|
+
i.current = !0, document.addEventListener("pointerup", x, { once: !0 });
|
|
846
708
|
}),
|
|
847
709
|
onFocus: R(e.onFocus, () => {
|
|
848
|
-
|
|
710
|
+
i.current || a.onOpen();
|
|
849
711
|
}),
|
|
850
712
|
onBlur: R(e.onBlur, a.onClose),
|
|
851
713
|
onClick: R(e.onClick, a.onClose)
|
|
@@ -853,81 +715,81 @@ var fe = "TooltipTrigger", ye = n.forwardRef(
|
|
|
853
715
|
) });
|
|
854
716
|
}
|
|
855
717
|
);
|
|
856
|
-
|
|
857
|
-
var
|
|
718
|
+
fe.displayName = ie;
|
|
719
|
+
var ve = "TooltipPortal", [rr, or] = B(ve, {
|
|
858
720
|
forceMount: void 0
|
|
859
|
-
}),
|
|
860
|
-
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e,
|
|
861
|
-
return /* @__PURE__ */ s.jsx(
|
|
721
|
+
}), me = (e) => {
|
|
722
|
+
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c = $(ve, r);
|
|
723
|
+
return /* @__PURE__ */ s.jsx(rr, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ce, { present: t || c.open, children: /* @__PURE__ */ s.jsx(Re, { asChild: !0, container: a, children: o }) }) });
|
|
862
724
|
};
|
|
863
|
-
|
|
864
|
-
var
|
|
725
|
+
me.displayName = ve;
|
|
726
|
+
var I = "TooltipContent", xe = n.forwardRef(
|
|
865
727
|
(e, r) => {
|
|
866
|
-
const t =
|
|
867
|
-
return /* @__PURE__ */ s.jsx(
|
|
728
|
+
const t = or(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l = $(I, e.__scopeTooltip);
|
|
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(nr, { side: a, ...c, ref: r }) });
|
|
868
730
|
}
|
|
869
|
-
),
|
|
870
|
-
const t =
|
|
871
|
-
|
|
872
|
-
}, [
|
|
731
|
+
), nr = n.forwardRef((e, r) => {
|
|
732
|
+
const t = $(I, e.__scopeTooltip), o = de(I, e.__scopeTooltip), a = n.useRef(null), c = U(r, a), [l, m] = n.useState(null), { trigger: u, onClose: i } = t, p = a.current, { onPointerInTransitChange: x } = o, g = n.useCallback(() => {
|
|
733
|
+
m(null), x(!1);
|
|
734
|
+
}, [x]), w = n.useCallback(
|
|
873
735
|
(y, f) => {
|
|
874
|
-
const
|
|
875
|
-
|
|
736
|
+
const d = y.currentTarget, b = { x: y.clientX, y: y.clientY }, h = ir(b, d.getBoundingClientRect()), T = cr(b, h), E = lr(f.getBoundingClientRect()), C = ur([...T, ...E]);
|
|
737
|
+
m(C), x(!0);
|
|
876
738
|
},
|
|
877
|
-
[
|
|
739
|
+
[x]
|
|
878
740
|
);
|
|
879
|
-
return n.useEffect(() => () =>
|
|
880
|
-
if (
|
|
881
|
-
const y = (
|
|
882
|
-
return
|
|
883
|
-
|
|
741
|
+
return n.useEffect(() => () => g(), [g]), n.useEffect(() => {
|
|
742
|
+
if (u && p) {
|
|
743
|
+
const y = (d) => w(d, p), f = (d) => w(d, u);
|
|
744
|
+
return u.addEventListener("pointerleave", y), p.addEventListener("pointerleave", f), () => {
|
|
745
|
+
u.removeEventListener("pointerleave", y), p.removeEventListener("pointerleave", f);
|
|
884
746
|
};
|
|
885
747
|
}
|
|
886
|
-
}, [
|
|
748
|
+
}, [u, p, w, g]), n.useEffect(() => {
|
|
887
749
|
if (l) {
|
|
888
750
|
const y = (f) => {
|
|
889
|
-
const
|
|
890
|
-
|
|
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)), T = !dr(b, l);
|
|
752
|
+
h ? g() : T && (g(), i());
|
|
891
753
|
};
|
|
892
754
|
return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
|
|
893
755
|
}
|
|
894
|
-
}, [
|
|
895
|
-
}), [
|
|
756
|
+
}, [u, p, l, i, g]), /* @__PURE__ */ s.jsx(Be, { ...e, ref: c });
|
|
757
|
+
}), [sr, ar] = B(Q, { isInside: !1 }), Be = n.forwardRef(
|
|
896
758
|
(e, r) => {
|
|
897
759
|
const {
|
|
898
760
|
__scopeTooltip: t,
|
|
899
761
|
children: o,
|
|
900
762
|
"aria-label": a,
|
|
901
|
-
onEscapeKeyDown:
|
|
763
|
+
onEscapeKeyDown: c,
|
|
902
764
|
onPointerDownOutside: l,
|
|
903
|
-
...
|
|
904
|
-
} = e,
|
|
905
|
-
return n.useEffect(() => (document.addEventListener(
|
|
906
|
-
if (
|
|
907
|
-
const
|
|
908
|
-
const
|
|
909
|
-
|
|
765
|
+
...m
|
|
766
|
+
} = e, u = $(I, t), i = J(t), { onClose: p } = u;
|
|
767
|
+
return n.useEffect(() => (document.addEventListener(ae, p), () => document.removeEventListener(ae, p)), [p]), n.useEffect(() => {
|
|
768
|
+
if (u.trigger) {
|
|
769
|
+
const x = (g) => {
|
|
770
|
+
const w = g.target;
|
|
771
|
+
w != null && w.contains(u.trigger) && p();
|
|
910
772
|
};
|
|
911
|
-
return window.addEventListener("scroll",
|
|
773
|
+
return window.addEventListener("scroll", x, { capture: !0 }), () => window.removeEventListener("scroll", x, { capture: !0 });
|
|
912
774
|
}
|
|
913
|
-
}, [
|
|
914
|
-
|
|
775
|
+
}, [u.trigger, p]), /* @__PURE__ */ s.jsx(
|
|
776
|
+
ut,
|
|
915
777
|
{
|
|
916
778
|
asChild: !0,
|
|
917
779
|
disableOutsidePointerEvents: !1,
|
|
918
|
-
onEscapeKeyDown:
|
|
780
|
+
onEscapeKeyDown: c,
|
|
919
781
|
onPointerDownOutside: l,
|
|
920
|
-
onFocusOutside: (
|
|
782
|
+
onFocusOutside: (x) => x.preventDefault(),
|
|
921
783
|
onDismiss: p,
|
|
922
784
|
children: /* @__PURE__ */ s.jsxs(
|
|
923
|
-
|
|
785
|
+
pt,
|
|
924
786
|
{
|
|
925
|
-
"data-state":
|
|
926
|
-
...
|
|
927
|
-
...
|
|
787
|
+
"data-state": u.stateAttribute,
|
|
788
|
+
...i,
|
|
789
|
+
...m,
|
|
928
790
|
ref: r,
|
|
929
791
|
style: {
|
|
930
|
-
...
|
|
792
|
+
...m.style,
|
|
931
793
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
932
794
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
933
795
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -935,8 +797,8 @@ var L = "TooltipContent", Ce = n.forwardRef(
|
|
|
935
797
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
936
798
|
},
|
|
937
799
|
children: [
|
|
938
|
-
/* @__PURE__ */ s.jsx(
|
|
939
|
-
/* @__PURE__ */ s.jsx(
|
|
800
|
+
/* @__PURE__ */ s.jsx(ft, { children: o }),
|
|
801
|
+
/* @__PURE__ */ s.jsx(sr, { scope: t, isInside: !0, children: /* @__PURE__ */ s.jsx(Rt, { id: u.contentId, role: "tooltip", children: a || o }) })
|
|
940
802
|
]
|
|
941
803
|
}
|
|
942
804
|
)
|
|
@@ -944,21 +806,21 @@ var L = "TooltipContent", Ce = n.forwardRef(
|
|
|
944
806
|
);
|
|
945
807
|
}
|
|
946
808
|
);
|
|
947
|
-
|
|
948
|
-
var
|
|
809
|
+
xe.displayName = I;
|
|
810
|
+
var Je = "TooltipArrow", he = n.forwardRef(
|
|
949
811
|
(e, r) => {
|
|
950
|
-
const { __scopeTooltip: t, ...o } = e, a =
|
|
951
|
-
return
|
|
952
|
-
|
|
812
|
+
const { __scopeTooltip: t, ...o } = e, a = J(t);
|
|
813
|
+
return ar(
|
|
814
|
+
Je,
|
|
953
815
|
t
|
|
954
|
-
).isInside ? null : /* @__PURE__ */ s.jsx(
|
|
816
|
+
).isInside ? null : /* @__PURE__ */ s.jsx(it, { ...a, ...o, ref: r });
|
|
955
817
|
}
|
|
956
818
|
);
|
|
957
|
-
|
|
958
|
-
function
|
|
959
|
-
const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x),
|
|
960
|
-
switch (Math.min(t, o, a,
|
|
961
|
-
case
|
|
819
|
+
he.displayName = Je;
|
|
820
|
+
function ir(e, r) {
|
|
821
|
+
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
|
+
switch (Math.min(t, o, a, c)) {
|
|
823
|
+
case c:
|
|
962
824
|
return "left";
|
|
963
825
|
case a:
|
|
964
826
|
return "right";
|
|
@@ -970,7 +832,7 @@ function Sr(e, r) {
|
|
|
970
832
|
throw new Error("unreachable");
|
|
971
833
|
}
|
|
972
834
|
}
|
|
973
|
-
function
|
|
835
|
+
function cr(e, r, t = 5) {
|
|
974
836
|
const o = [];
|
|
975
837
|
switch (r) {
|
|
976
838
|
case "top":
|
|
@@ -1000,7 +862,7 @@ function Ar(e, r, t = 5) {
|
|
|
1000
862
|
}
|
|
1001
863
|
return o;
|
|
1002
864
|
}
|
|
1003
|
-
function
|
|
865
|
+
function lr(e) {
|
|
1004
866
|
const { top: r, right: t, bottom: o, left: a } = e;
|
|
1005
867
|
return [
|
|
1006
868
|
{ x: a, y: r },
|
|
@@ -1009,27 +871,27 @@ function _r(e) {
|
|
|
1009
871
|
{ x: a, y: o }
|
|
1010
872
|
];
|
|
1011
873
|
}
|
|
1012
|
-
function
|
|
874
|
+
function dr(e, r) {
|
|
1013
875
|
const { x: t, y: o } = e;
|
|
1014
876
|
let a = !1;
|
|
1015
|
-
for (let
|
|
1016
|
-
const
|
|
1017
|
-
|
|
877
|
+
for (let c = 0, l = r.length - 1; c < r.length; l = c++) {
|
|
878
|
+
const m = r[c].x, u = r[c].y, i = r[l].x, p = r[l].y;
|
|
879
|
+
u > o != p > o && t < (i - m) * (o - u) / (p - u) + m && (a = !a);
|
|
1018
880
|
}
|
|
1019
881
|
return a;
|
|
1020
882
|
}
|
|
1021
|
-
function
|
|
883
|
+
function ur(e) {
|
|
1022
884
|
const r = e.slice();
|
|
1023
|
-
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),
|
|
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), pr(r);
|
|
1024
886
|
}
|
|
1025
|
-
function
|
|
887
|
+
function pr(e) {
|
|
1026
888
|
if (e.length <= 1) return e.slice();
|
|
1027
889
|
const r = [];
|
|
1028
890
|
for (let o = 0; o < e.length; o++) {
|
|
1029
891
|
const a = e[o];
|
|
1030
892
|
for (; r.length >= 2; ) {
|
|
1031
|
-
const
|
|
1032
|
-
if ((
|
|
893
|
+
const c = r[r.length - 1], l = r[r.length - 2];
|
|
894
|
+
if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) r.pop();
|
|
1033
895
|
else break;
|
|
1034
896
|
}
|
|
1035
897
|
r.push(a);
|
|
@@ -1039,53 +901,53 @@ function Or(e) {
|
|
|
1039
901
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
1040
902
|
const a = e[o];
|
|
1041
903
|
for (; t.length >= 2; ) {
|
|
1042
|
-
const
|
|
1043
|
-
if ((
|
|
904
|
+
const c = t[t.length - 1], l = t[t.length - 2];
|
|
905
|
+
if ((c.x - l.x) * (a.y - l.y) >= (c.y - l.y) * (a.x - l.x)) t.pop();
|
|
1044
906
|
else break;
|
|
1045
907
|
}
|
|
1046
908
|
t.push(a);
|
|
1047
909
|
}
|
|
1048
910
|
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);
|
|
1049
911
|
}
|
|
1050
|
-
var
|
|
1051
|
-
const
|
|
912
|
+
var fr = ue, vr = pe, mr = fe, xr = me, hr = xe, wr = he;
|
|
913
|
+
const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1052
914
|
__proto__: null,
|
|
1053
|
-
Arrow:
|
|
1054
|
-
Content:
|
|
1055
|
-
Portal:
|
|
1056
|
-
Provider:
|
|
1057
|
-
Root:
|
|
1058
|
-
Tooltip:
|
|
1059
|
-
TooltipArrow:
|
|
1060
|
-
TooltipContent:
|
|
1061
|
-
TooltipPortal:
|
|
1062
|
-
TooltipProvider:
|
|
1063
|
-
TooltipTrigger:
|
|
1064
|
-
Trigger:
|
|
1065
|
-
createTooltipScope:
|
|
1066
|
-
}, Symbol.toStringTag, { value: "Module" })), { Provider:
|
|
915
|
+
Arrow: wr,
|
|
916
|
+
Content: hr,
|
|
917
|
+
Portal: xr,
|
|
918
|
+
Provider: fr,
|
|
919
|
+
Root: vr,
|
|
920
|
+
Tooltip: pe,
|
|
921
|
+
TooltipArrow: he,
|
|
922
|
+
TooltipContent: xe,
|
|
923
|
+
TooltipPortal: me,
|
|
924
|
+
TooltipProvider: ue,
|
|
925
|
+
TooltipTrigger: fe,
|
|
926
|
+
Trigger: mr,
|
|
927
|
+
createTooltipScope: Qt
|
|
928
|
+
}, Symbol.toStringTag, { value: "Module" })), { Provider: gr, Root: yr, Trigger: br, Portal: Er, Content: Cr, Arrow: Pr } = Tr, _r = ({
|
|
1067
929
|
children: e,
|
|
1068
930
|
className: r,
|
|
1069
931
|
defaultOpen: t,
|
|
1070
932
|
side: o,
|
|
1071
933
|
content: a,
|
|
1072
|
-
delayDuration:
|
|
934
|
+
delayDuration: c = 0,
|
|
1073
935
|
isDisabled: l = !1
|
|
1074
|
-
}) => /* @__PURE__ */ s.jsx(
|
|
1075
|
-
/* @__PURE__ */ s.jsx(
|
|
1076
|
-
!l && /* @__PURE__ */ s.jsx(
|
|
1077
|
-
|
|
936
|
+
}) => /* @__PURE__ */ s.jsx(gr, { children: /* @__PURE__ */ s.jsxs(yr, { defaultOpen: t, delayDuration: c, children: [
|
|
937
|
+
/* @__PURE__ */ s.jsx(br, { asChild: !0, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
|
|
938
|
+
!l && /* @__PURE__ */ s.jsx(Er, { children: /* @__PURE__ */ s.jsxs(
|
|
939
|
+
Cr,
|
|
1078
940
|
{
|
|
1079
941
|
side: o,
|
|
1080
942
|
sideOffset: 5,
|
|
1081
|
-
className: P(
|
|
943
|
+
className: P(Ee.content, r),
|
|
1082
944
|
children: [
|
|
1083
945
|
a,
|
|
1084
|
-
/* @__PURE__ */ s.jsx(
|
|
946
|
+
/* @__PURE__ */ s.jsx(Pr, { className: Ee.arrow })
|
|
1085
947
|
]
|
|
1086
948
|
}
|
|
1087
949
|
) })
|
|
1088
|
-
] }) }),
|
|
950
|
+
] }) }), Ee = {
|
|
1089
951
|
content: P(
|
|
1090
952
|
"font-mono select-none w-auto h-auto max-size-32 rounded-[5px] bg-dark-30 px-4 py-2 text-[10px] text-start leading-none text-sidebar-10 z-50",
|
|
1091
953
|
"animate-tooltipFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade",
|
|
@@ -1094,42 +956,41 @@ const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1094
956
|
"data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade"
|
|
1095
957
|
),
|
|
1096
958
|
arrow: "fill-dark-30"
|
|
1097
|
-
},
|
|
959
|
+
}, Dr = ({
|
|
1098
960
|
value: e,
|
|
1099
961
|
onValueChange: r,
|
|
1100
962
|
classNames: t = {},
|
|
1101
963
|
count: o = 3,
|
|
1102
964
|
...a
|
|
1103
|
-
}) => /* @__PURE__ */ s.jsx(
|
|
1104
|
-
|
|
965
|
+
}) => /* @__PURE__ */ s.jsx(vt, { value: e, onValueChange: r, children: /* @__PURE__ */ s.jsx(
|
|
966
|
+
mt,
|
|
1105
967
|
{
|
|
1106
|
-
className: P(
|
|
968
|
+
className: P(re.container, t.container),
|
|
1107
969
|
...a,
|
|
1108
|
-
children: Array.from({ length: o }).map((
|
|
1109
|
-
|
|
970
|
+
children: Array.from({ length: o }).map((c, l) => /* @__PURE__ */ s.jsx(
|
|
971
|
+
xt,
|
|
1110
972
|
{
|
|
1111
973
|
value: String(l),
|
|
1112
974
|
className: P(
|
|
1113
|
-
|
|
1114
|
-
l <= Number(e) &&
|
|
975
|
+
re.dot,
|
|
976
|
+
l <= Number(e) && re.dotActive,
|
|
1115
977
|
t.trigger
|
|
1116
978
|
)
|
|
1117
979
|
},
|
|
1118
980
|
l
|
|
1119
981
|
))
|
|
1120
982
|
}
|
|
1121
|
-
) }),
|
|
983
|
+
) }), re = {
|
|
1122
984
|
container: "flex items-center gap-1",
|
|
1123
985
|
dot: "size-2 rounded-full bg-dark-30/[.20] transition-colors focus:outline-none focus:ring-offset-0 focus:ring-primary-10",
|
|
1124
986
|
dotActive: "bg-primary-10"
|
|
1125
987
|
};
|
|
1126
988
|
export {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
ce as c,
|
|
989
|
+
kr as N,
|
|
990
|
+
Sr as S,
|
|
991
|
+
_r as T,
|
|
992
|
+
Dr as a,
|
|
993
|
+
re as b,
|
|
1133
994
|
D as s,
|
|
1134
|
-
|
|
995
|
+
Ee as t
|
|
1135
996
|
};
|