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