@undp/data-viz 2.5.1 → 2.5.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/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +297 -289
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +307 -299
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +281 -279
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +4 -4
- package/dist/CsvDownloadButton.cjs.map +1 -1
- package/dist/CsvDownloadButton.js +268 -266
- package/dist/CsvDownloadButton.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +277 -269
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.cjs.map +1 -1
- package/dist/ExcelDownloadButton.js +21 -19
- package/dist/ExcelDownloadButton.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +299 -291
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.cjs.map +1 -1
- package/dist/ImageDownloadButton.js +19 -17
- package/dist/ImageDownloadButton.js.map +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.cjs.map +1 -1
- package/dist/SVGDownloadButton.js +20 -18
- package/dist/SVGDownloadButton.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +1 -1
- package/dist/ScatterPlot.js +107 -107
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/CopyTextButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as R, a as
|
|
1
|
+
import { _ as R, a as c, m as P, b as pe, c as ze, j as $ } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
2
|
import { f as We, u as Ue } from "./index-ApTBN0kp.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as d from "react";
|
|
4
4
|
import S, { createElement as Xe } from "react";
|
|
5
5
|
import * as Ye from "react-dom";
|
|
6
6
|
import { g as Ze, P as me, $ as Ge, w as D, a as fe, _ as He, E as Be, j as _, c as Y, Z as Je, u as Qe, N as et, b as tt } from "./index-w64Zl8io-ihagHOdP.js";
|
|
@@ -11,116 +11,116 @@ let H = 0;
|
|
|
11
11
|
function ot() {
|
|
12
12
|
return H = (H + 1) % Number.MAX_SAFE_INTEGER, H.toString();
|
|
13
13
|
}
|
|
14
|
-
const B = /* @__PURE__ */ new Map(), de = (
|
|
15
|
-
if (B.has(
|
|
14
|
+
const B = /* @__PURE__ */ new Map(), de = (r) => {
|
|
15
|
+
if (B.has(r))
|
|
16
16
|
return;
|
|
17
|
-
const
|
|
18
|
-
B.delete(
|
|
17
|
+
const t = setTimeout(() => {
|
|
18
|
+
B.delete(r), O({
|
|
19
19
|
type: "REMOVE_TOAST",
|
|
20
|
-
toastId:
|
|
20
|
+
toastId: r
|
|
21
21
|
});
|
|
22
22
|
}, nt);
|
|
23
|
-
B.set(
|
|
24
|
-
}, it = (
|
|
25
|
-
switch (
|
|
23
|
+
B.set(r, t);
|
|
24
|
+
}, it = (r, t) => {
|
|
25
|
+
switch (t.type) {
|
|
26
26
|
case "ADD_TOAST":
|
|
27
27
|
return {
|
|
28
|
-
...
|
|
29
|
-
toasts: [
|
|
28
|
+
...r,
|
|
29
|
+
toasts: [t.toast, ...r.toasts].slice(0, at)
|
|
30
30
|
};
|
|
31
31
|
case "UPDATE_TOAST":
|
|
32
32
|
return {
|
|
33
|
-
...
|
|
34
|
-
toasts:
|
|
33
|
+
...r,
|
|
34
|
+
toasts: r.toasts.map((e) => e.id === t.toast.id ? {
|
|
35
35
|
...e,
|
|
36
|
-
...
|
|
36
|
+
...t.toast
|
|
37
37
|
} : e)
|
|
38
38
|
};
|
|
39
39
|
case "DISMISS_TOAST": {
|
|
40
40
|
const {
|
|
41
41
|
toastId: e
|
|
42
|
-
} =
|
|
43
|
-
return e ? de(e) :
|
|
42
|
+
} = t;
|
|
43
|
+
return e ? de(e) : r.toasts.forEach((s) => {
|
|
44
44
|
de(s.id);
|
|
45
45
|
}), {
|
|
46
|
-
...
|
|
47
|
-
toasts:
|
|
46
|
+
...r,
|
|
47
|
+
toasts: r.toasts.map((s) => s.id === e || e === void 0 ? {
|
|
48
48
|
...s,
|
|
49
49
|
open: !1
|
|
50
50
|
} : s)
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
case "REMOVE_TOAST":
|
|
54
|
-
return
|
|
55
|
-
...
|
|
54
|
+
return t.toastId === void 0 ? {
|
|
55
|
+
...r,
|
|
56
56
|
toasts: []
|
|
57
57
|
} : {
|
|
58
|
-
...
|
|
59
|
-
toasts:
|
|
58
|
+
...r,
|
|
59
|
+
toasts: r.toasts.filter((e) => e.id !== t.toastId)
|
|
60
60
|
};
|
|
61
61
|
default:
|
|
62
62
|
return {
|
|
63
|
-
...
|
|
63
|
+
...r
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
}, U = [];
|
|
67
67
|
let X = {
|
|
68
68
|
toasts: []
|
|
69
69
|
};
|
|
70
|
-
function O(
|
|
71
|
-
X = it(X,
|
|
72
|
-
|
|
70
|
+
function O(r) {
|
|
71
|
+
X = it(X, r), U.forEach((t) => {
|
|
72
|
+
t(X);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function ct({
|
|
76
|
-
...
|
|
76
|
+
...r
|
|
77
77
|
}) {
|
|
78
|
-
const
|
|
78
|
+
const t = ot(), e = (a) => O({
|
|
79
79
|
type: "UPDATE_TOAST",
|
|
80
80
|
toast: {
|
|
81
81
|
...a,
|
|
82
|
-
id:
|
|
82
|
+
id: t
|
|
83
83
|
}
|
|
84
84
|
}), s = () => O({
|
|
85
85
|
type: "DISMISS_TOAST",
|
|
86
|
-
toastId:
|
|
86
|
+
toastId: t
|
|
87
87
|
});
|
|
88
88
|
return O({
|
|
89
89
|
type: "ADD_TOAST",
|
|
90
90
|
toast: {
|
|
91
|
-
...
|
|
92
|
-
id:
|
|
91
|
+
...r,
|
|
92
|
+
id: t,
|
|
93
93
|
open: !0,
|
|
94
94
|
onOpenChange: (a) => {
|
|
95
95
|
a || s();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}), {
|
|
99
|
-
id:
|
|
99
|
+
id: t,
|
|
100
100
|
dismiss: s,
|
|
101
101
|
update: e
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
function ye() {
|
|
105
|
-
const
|
|
105
|
+
const r = R.c(5), [t, e] = S.useState(X);
|
|
106
106
|
let s;
|
|
107
|
-
|
|
107
|
+
r[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => (U.push(e), () => {
|
|
108
108
|
const o = U.indexOf(e);
|
|
109
109
|
o > -1 && U.splice(o, 1);
|
|
110
|
-
}),
|
|
110
|
+
}), r[0] = s) : s = r[0];
|
|
111
111
|
let a;
|
|
112
|
-
|
|
112
|
+
r[1] !== t ? (a = [t], r[1] = t, r[2] = a) : a = r[2], S.useEffect(s, a);
|
|
113
113
|
let n;
|
|
114
|
-
return
|
|
115
|
-
...
|
|
114
|
+
return r[3] !== t ? (n = {
|
|
115
|
+
...t,
|
|
116
116
|
toast: ct,
|
|
117
117
|
dismiss: lt
|
|
118
|
-
},
|
|
118
|
+
}, r[3] = t, r[4] = n) : n = r[4], n;
|
|
119
119
|
}
|
|
120
|
-
function lt(
|
|
120
|
+
function lt(r) {
|
|
121
121
|
return O({
|
|
122
122
|
type: "DISMISS_TOAST",
|
|
123
|
-
toastId:
|
|
123
|
+
toastId: r
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
const dt = [
|
|
@@ -141,53 +141,53 @@ const dt = [
|
|
|
141
141
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
142
142
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
143
143
|
], yt = re("triangle-alert", ft);
|
|
144
|
-
var se = "ToastProvider", [ae, vt, xt] = rt("Toast"), [ve] = Ze("Toast", [xt]), [wt, Z] = ve(se), xe = (
|
|
144
|
+
var se = "ToastProvider", [ae, vt, xt] = rt("Toast"), [ve] = Ze("Toast", [xt]), [wt, Z] = ve(se), xe = (r) => {
|
|
145
145
|
const {
|
|
146
|
-
__scopeToast:
|
|
146
|
+
__scopeToast: t,
|
|
147
147
|
label: e = "Notification",
|
|
148
148
|
duration: s = 5e3,
|
|
149
149
|
swipeDirection: a = "right",
|
|
150
150
|
swipeThreshold: n = 50,
|
|
151
151
|
children: o
|
|
152
|
-
} =
|
|
152
|
+
} = r, [u, f] = d.useState(null), [i, x] = d.useState(0), m = d.useRef(!1), E = d.useRef(!1);
|
|
153
153
|
return e.trim() || console.error(
|
|
154
154
|
`Invalid prop \`label\` supplied to \`${se}\`. Expected non-empty \`string\`.`
|
|
155
|
-
), /* @__PURE__ */
|
|
155
|
+
), /* @__PURE__ */ c.jsx(ae.Provider, { scope: t, children: /* @__PURE__ */ c.jsx(
|
|
156
156
|
wt,
|
|
157
157
|
{
|
|
158
|
-
scope:
|
|
158
|
+
scope: t,
|
|
159
159
|
label: e,
|
|
160
160
|
duration: s,
|
|
161
161
|
swipeDirection: a,
|
|
162
162
|
swipeThreshold: n,
|
|
163
|
-
toastCount:
|
|
163
|
+
toastCount: i,
|
|
164
164
|
viewport: u,
|
|
165
|
-
onViewportChange:
|
|
166
|
-
onToastAdd:
|
|
167
|
-
onToastRemove:
|
|
165
|
+
onViewportChange: f,
|
|
166
|
+
onToastAdd: d.useCallback(() => x((T) => T + 1), []),
|
|
167
|
+
onToastRemove: d.useCallback(() => x((T) => T - 1), []),
|
|
168
168
|
isFocusedToastEscapeKeyDownRef: m,
|
|
169
|
-
isClosePausedRef:
|
|
169
|
+
isClosePausedRef: E,
|
|
170
170
|
children: o
|
|
171
171
|
}
|
|
172
172
|
) });
|
|
173
173
|
};
|
|
174
174
|
xe.displayName = se;
|
|
175
|
-
var we = "ToastViewport", ht = ["F8"], Q = "toast.viewportPause", ee = "toast.viewportResume", he =
|
|
176
|
-
(
|
|
175
|
+
var we = "ToastViewport", ht = ["F8"], Q = "toast.viewportPause", ee = "toast.viewportResume", he = d.forwardRef(
|
|
176
|
+
(r, t) => {
|
|
177
177
|
const {
|
|
178
178
|
__scopeToast: e,
|
|
179
179
|
hotkey: s = ht,
|
|
180
180
|
label: a = "Notifications ({hotkey})",
|
|
181
181
|
...n
|
|
182
|
-
} =
|
|
183
|
-
|
|
184
|
-
const
|
|
182
|
+
} = r, o = Z(we, e), u = vt(e), f = d.useRef(null), i = d.useRef(null), x = d.useRef(null), m = d.useRef(null), E = me(t, m, o.onViewportChange), T = s.join("+").replace(/Key/g, "").replace(/Digit/g, ""), g = o.toastCount > 0;
|
|
183
|
+
d.useEffect(() => {
|
|
184
|
+
const l = (w) => {
|
|
185
185
|
s.length !== 0 && s.every((v) => w[v] || w.code === v) && m.current?.focus();
|
|
186
186
|
};
|
|
187
|
-
return document.addEventListener("keydown",
|
|
188
|
-
}, [s]),
|
|
189
|
-
const
|
|
190
|
-
if (g &&
|
|
187
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
188
|
+
}, [s]), d.useEffect(() => {
|
|
189
|
+
const l = f.current, w = m.current;
|
|
190
|
+
if (g && l && w) {
|
|
191
191
|
const v = () => {
|
|
192
192
|
if (!o.isClosePausedRef.current) {
|
|
193
193
|
const N = new CustomEvent(Q);
|
|
@@ -198,74 +198,74 @@ var we = "ToastViewport", ht = ["F8"], Q = "toast.viewportPause", ee = "toast.vi
|
|
|
198
198
|
const N = new CustomEvent(ee);
|
|
199
199
|
w.dispatchEvent(N), o.isClosePausedRef.current = !1;
|
|
200
200
|
}
|
|
201
|
-
},
|
|
202
|
-
!
|
|
201
|
+
}, b = (N) => {
|
|
202
|
+
!l.contains(N.relatedTarget) && h();
|
|
203
203
|
}, k = () => {
|
|
204
|
-
|
|
204
|
+
l.contains(document.activeElement) || h();
|
|
205
205
|
};
|
|
206
|
-
return
|
|
207
|
-
|
|
206
|
+
return l.addEventListener("focusin", v), l.addEventListener("focusout", b), l.addEventListener("pointermove", v), l.addEventListener("pointerleave", k), window.addEventListener("blur", v), window.addEventListener("focus", h), () => {
|
|
207
|
+
l.removeEventListener("focusin", v), l.removeEventListener("focusout", b), l.removeEventListener("pointermove", v), l.removeEventListener("pointerleave", k), window.removeEventListener("blur", v), window.removeEventListener("focus", h);
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
}, [g, o.isClosePausedRef]);
|
|
211
|
-
const
|
|
212
|
-
({ tabbingDirection:
|
|
211
|
+
const y = d.useCallback(
|
|
212
|
+
({ tabbingDirection: l }) => {
|
|
213
213
|
const w = u().map((v) => {
|
|
214
|
-
const h = v.ref.current,
|
|
215
|
-
return
|
|
214
|
+
const h = v.ref.current, b = [h, ...Dt(h)];
|
|
215
|
+
return l === "forwards" ? b : b.reverse();
|
|
216
216
|
});
|
|
217
|
-
return (
|
|
217
|
+
return (l === "forwards" ? w.reverse() : w).flat();
|
|
218
218
|
},
|
|
219
219
|
[u]
|
|
220
220
|
);
|
|
221
|
-
return
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
221
|
+
return d.useEffect(() => {
|
|
222
|
+
const l = m.current;
|
|
223
|
+
if (l) {
|
|
224
224
|
const w = (v) => {
|
|
225
225
|
const h = v.altKey || v.ctrlKey || v.metaKey;
|
|
226
226
|
if (v.key === "Tab" && !h) {
|
|
227
|
-
const
|
|
228
|
-
if (v.target ===
|
|
229
|
-
|
|
227
|
+
const b = document.activeElement, k = v.shiftKey;
|
|
228
|
+
if (v.target === l && k) {
|
|
229
|
+
i.current?.focus();
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
const N =
|
|
233
|
-
J(N.slice(A + 1)) ? v.preventDefault() : k ?
|
|
232
|
+
const N = y({ tabbingDirection: k ? "backwards" : "forwards" }), A = N.findIndex((I) => I === b);
|
|
233
|
+
J(N.slice(A + 1)) ? v.preventDefault() : k ? i.current?.focus() : x.current?.focus();
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
return
|
|
236
|
+
return l.addEventListener("keydown", w), () => l.removeEventListener("keydown", w);
|
|
237
237
|
}
|
|
238
|
-
}, [u,
|
|
238
|
+
}, [u, y]), /* @__PURE__ */ c.jsxs(
|
|
239
239
|
Ge,
|
|
240
240
|
{
|
|
241
|
-
ref:
|
|
241
|
+
ref: f,
|
|
242
242
|
role: "region",
|
|
243
|
-
"aria-label": a.replace("{hotkey}",
|
|
243
|
+
"aria-label": a.replace("{hotkey}", T),
|
|
244
244
|
tabIndex: -1,
|
|
245
245
|
style: { pointerEvents: g ? void 0 : "none" },
|
|
246
246
|
children: [
|
|
247
|
-
g && /* @__PURE__ */
|
|
247
|
+
g && /* @__PURE__ */ c.jsx(
|
|
248
248
|
te,
|
|
249
249
|
{
|
|
250
|
-
ref:
|
|
250
|
+
ref: i,
|
|
251
251
|
onFocusFromOutsideViewport: () => {
|
|
252
|
-
const
|
|
252
|
+
const l = y({
|
|
253
253
|
tabbingDirection: "forwards"
|
|
254
254
|
});
|
|
255
|
-
J(
|
|
255
|
+
J(l);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
g && /* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ c.jsx(ae.Slot, { scope: e, children: /* @__PURE__ */ c.jsx(D.ol, { tabIndex: -1, ...n, ref: E }) }),
|
|
260
|
+
g && /* @__PURE__ */ c.jsx(
|
|
261
261
|
te,
|
|
262
262
|
{
|
|
263
263
|
ref: x,
|
|
264
264
|
onFocusFromOutsideViewport: () => {
|
|
265
|
-
const
|
|
265
|
+
const l = y({
|
|
266
266
|
tabbingDirection: "backwards"
|
|
267
267
|
});
|
|
268
|
-
J(
|
|
268
|
+
J(l);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
)
|
|
@@ -275,15 +275,15 @@ var we = "ToastViewport", ht = ["F8"], Q = "toast.viewportPause", ee = "toast.vi
|
|
|
275
275
|
}
|
|
276
276
|
);
|
|
277
277
|
he.displayName = we;
|
|
278
|
-
var Te = "ToastFocusProxy", te =
|
|
279
|
-
(
|
|
280
|
-
const { __scopeToast: e, onFocusFromOutsideViewport: s, ...a } =
|
|
281
|
-
return /* @__PURE__ */
|
|
278
|
+
var Te = "ToastFocusProxy", te = d.forwardRef(
|
|
279
|
+
(r, t) => {
|
|
280
|
+
const { __scopeToast: e, onFocusFromOutsideViewport: s, ...a } = r, n = Z(Te, e);
|
|
281
|
+
return /* @__PURE__ */ c.jsx(
|
|
282
282
|
fe,
|
|
283
283
|
{
|
|
284
284
|
tabIndex: 0,
|
|
285
285
|
...a,
|
|
286
|
-
ref:
|
|
286
|
+
ref: t,
|
|
287
287
|
style: { position: "fixed" },
|
|
288
288
|
onFocus: (o) => {
|
|
289
289
|
const u = o.relatedTarget;
|
|
@@ -294,36 +294,36 @@ var Te = "ToastFocusProxy", te = l.forwardRef(
|
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
te.displayName = Te;
|
|
297
|
-
var K = "Toast", Tt = "toast.swipeStart", bt = "toast.swipeMove", Et = "toast.swipeCancel", gt = "toast.swipeEnd", be =
|
|
298
|
-
(
|
|
299
|
-
const { forceMount: e, open: s, defaultOpen: a, onOpenChange: n, ...o } =
|
|
297
|
+
var K = "Toast", Tt = "toast.swipeStart", bt = "toast.swipeMove", Et = "toast.swipeCancel", gt = "toast.swipeEnd", be = d.forwardRef(
|
|
298
|
+
(r, t) => {
|
|
299
|
+
const { forceMount: e, open: s, defaultOpen: a, onOpenChange: n, ...o } = r, [u, f] = He({
|
|
300
300
|
prop: s,
|
|
301
301
|
defaultProp: a ?? !0,
|
|
302
302
|
onChange: n,
|
|
303
303
|
caller: K
|
|
304
304
|
});
|
|
305
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ c.jsx(Be, { present: e || u, children: /* @__PURE__ */ c.jsx(
|
|
306
306
|
_t,
|
|
307
307
|
{
|
|
308
308
|
open: u,
|
|
309
309
|
...o,
|
|
310
|
-
ref:
|
|
311
|
-
onClose: () =>
|
|
312
|
-
onPause: Y(
|
|
313
|
-
onResume: Y(
|
|
314
|
-
onSwipeStart: _(
|
|
315
|
-
|
|
310
|
+
ref: t,
|
|
311
|
+
onClose: () => f(!1),
|
|
312
|
+
onPause: Y(r.onPause),
|
|
313
|
+
onResume: Y(r.onResume),
|
|
314
|
+
onSwipeStart: _(r.onSwipeStart, (i) => {
|
|
315
|
+
i.currentTarget.setAttribute("data-swipe", "start");
|
|
316
316
|
}),
|
|
317
|
-
onSwipeMove: _(
|
|
318
|
-
const { x, y: m } =
|
|
319
|
-
|
|
317
|
+
onSwipeMove: _(r.onSwipeMove, (i) => {
|
|
318
|
+
const { x, y: m } = i.detail.delta;
|
|
319
|
+
i.currentTarget.setAttribute("data-swipe", "move"), i.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${x}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${m}px`);
|
|
320
320
|
}),
|
|
321
|
-
onSwipeCancel: _(
|
|
322
|
-
|
|
321
|
+
onSwipeCancel: _(r.onSwipeCancel, (i) => {
|
|
322
|
+
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");
|
|
323
323
|
}),
|
|
324
|
-
onSwipeEnd: _(
|
|
325
|
-
const { x, y: m } =
|
|
326
|
-
|
|
324
|
+
onSwipeEnd: _(r.onSwipeEnd, (i) => {
|
|
325
|
+
const { x, y: m } = i.detail.delta;
|
|
326
|
+
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", `${x}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), f(!1);
|
|
327
327
|
})
|
|
328
328
|
}
|
|
329
329
|
) });
|
|
@@ -333,8 +333,8 @@ be.displayName = K;
|
|
|
333
333
|
var [kt, Nt] = ve(K, {
|
|
334
334
|
onClose() {
|
|
335
335
|
}
|
|
336
|
-
}), _t =
|
|
337
|
-
(
|
|
336
|
+
}), _t = d.forwardRef(
|
|
337
|
+
(r, t) => {
|
|
338
338
|
const {
|
|
339
339
|
__scopeToast: e,
|
|
340
340
|
type: s = "foreground",
|
|
@@ -342,40 +342,40 @@ var [kt, Nt] = ve(K, {
|
|
|
342
342
|
open: n,
|
|
343
343
|
onClose: o,
|
|
344
344
|
onEscapeKeyDown: u,
|
|
345
|
-
onPause:
|
|
346
|
-
onResume:
|
|
345
|
+
onPause: f,
|
|
346
|
+
onResume: i,
|
|
347
347
|
onSwipeStart: x,
|
|
348
348
|
onSwipeMove: m,
|
|
349
|
-
onSwipeCancel:
|
|
350
|
-
onSwipeEnd:
|
|
349
|
+
onSwipeCancel: E,
|
|
350
|
+
onSwipeEnd: T,
|
|
351
351
|
...g
|
|
352
|
-
} =
|
|
353
|
-
|
|
354
|
-
}), V =
|
|
352
|
+
} = r, y = Z(K, e), [l, w] = d.useState(null), v = me(t, (p) => w(p)), h = d.useRef(null), b = d.useRef(null), k = a || y.duration, N = d.useRef(0), A = d.useRef(k), I = d.useRef(0), { onToastAdd: oe, onToastRemove: ie } = y, L = Y(() => {
|
|
353
|
+
l?.contains(document.activeElement) && y.viewport?.focus(), o();
|
|
354
|
+
}), V = d.useCallback(
|
|
355
355
|
(p) => {
|
|
356
356
|
!p || p === 1 / 0 || (window.clearTimeout(I.current), N.current = (/* @__PURE__ */ new Date()).getTime(), I.current = window.setTimeout(L, p));
|
|
357
357
|
},
|
|
358
358
|
[L]
|
|
359
359
|
);
|
|
360
|
-
|
|
361
|
-
const p =
|
|
360
|
+
d.useEffect(() => {
|
|
361
|
+
const p = y.viewport;
|
|
362
362
|
if (p) {
|
|
363
363
|
const j = () => {
|
|
364
|
-
V(A.current),
|
|
364
|
+
V(A.current), i?.();
|
|
365
365
|
}, C = () => {
|
|
366
366
|
const M = (/* @__PURE__ */ new Date()).getTime() - N.current;
|
|
367
|
-
A.current = A.current - M, window.clearTimeout(I.current),
|
|
367
|
+
A.current = A.current - M, window.clearTimeout(I.current), f?.();
|
|
368
368
|
};
|
|
369
369
|
return p.addEventListener(Q, C), p.addEventListener(ee, j), () => {
|
|
370
370
|
p.removeEventListener(Q, C), p.removeEventListener(ee, j);
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
}, [
|
|
374
|
-
n && !
|
|
375
|
-
}, [n, k,
|
|
376
|
-
const ce =
|
|
377
|
-
return
|
|
378
|
-
ce && /* @__PURE__ */
|
|
373
|
+
}, [y.viewport, k, f, i, V]), d.useEffect(() => {
|
|
374
|
+
n && !y.isClosePausedRef.current && V(k);
|
|
375
|
+
}, [n, k, y.isClosePausedRef, V]), d.useEffect(() => (oe(), () => ie()), [oe, ie]);
|
|
376
|
+
const ce = d.useMemo(() => l ? je(l) : null, [l]);
|
|
377
|
+
return y.viewport ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
378
|
+
ce && /* @__PURE__ */ c.jsx(
|
|
379
379
|
St,
|
|
380
380
|
{
|
|
381
381
|
__scopeToast: e,
|
|
@@ -384,47 +384,47 @@ var [kt, Nt] = ve(K, {
|
|
|
384
384
|
children: ce
|
|
385
385
|
}
|
|
386
386
|
),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ c.jsx(kt, { scope: e, onClose: L, children: Ye.createPortal(
|
|
388
|
+
/* @__PURE__ */ c.jsx(ae.ItemSlot, { scope: e, children: /* @__PURE__ */ c.jsx(
|
|
389
389
|
Je,
|
|
390
390
|
{
|
|
391
391
|
asChild: !0,
|
|
392
392
|
onEscapeKeyDown: _(u, () => {
|
|
393
|
-
|
|
393
|
+
y.isFocusedToastEscapeKeyDownRef.current || L(), y.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
394
394
|
}),
|
|
395
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ c.jsx(
|
|
396
396
|
D.li,
|
|
397
397
|
{
|
|
398
398
|
tabIndex: 0,
|
|
399
399
|
"data-state": n ? "open" : "closed",
|
|
400
|
-
"data-swipe-direction":
|
|
400
|
+
"data-swipe-direction": y.swipeDirection,
|
|
401
401
|
...g,
|
|
402
402
|
ref: v,
|
|
403
|
-
style: { userSelect: "none", touchAction: "none", ...
|
|
404
|
-
onKeyDown: _(
|
|
405
|
-
p.key === "Escape" && (u?.(p.nativeEvent), p.nativeEvent.defaultPrevented || (
|
|
403
|
+
style: { userSelect: "none", touchAction: "none", ...r.style },
|
|
404
|
+
onKeyDown: _(r.onKeyDown, (p) => {
|
|
405
|
+
p.key === "Escape" && (u?.(p.nativeEvent), p.nativeEvent.defaultPrevented || (y.isFocusedToastEscapeKeyDownRef.current = !0, L()));
|
|
406
406
|
}),
|
|
407
|
-
onPointerDown: _(
|
|
407
|
+
onPointerDown: _(r.onPointerDown, (p) => {
|
|
408
408
|
p.button === 0 && (h.current = { x: p.clientX, y: p.clientY });
|
|
409
409
|
}),
|
|
410
|
-
onPointerMove: _(
|
|
410
|
+
onPointerMove: _(r.onPointerMove, (p) => {
|
|
411
411
|
if (!h.current) return;
|
|
412
|
-
const j = p.clientX - h.current.x, C = p.clientY - h.current.y, M = !!
|
|
413
|
-
M ? (
|
|
412
|
+
const j = p.clientX - h.current.x, C = p.clientY - h.current.y, M = !!b.current, F = ["left", "right"].includes(y.swipeDirection), q = ["left", "up"].includes(y.swipeDirection) ? Math.min : Math.max, Ve = F ? q(0, j) : 0, qe = F ? 0 : q(0, C), G = p.pointerType === "touch" ? 10 : 2, z = { x: Ve, y: qe }, le = { originalEvent: p, delta: z };
|
|
413
|
+
M ? (b.current = z, W(bt, m, le, {
|
|
414
414
|
discrete: !1
|
|
415
|
-
})) : ue(z,
|
|
415
|
+
})) : ue(z, y.swipeDirection, G) ? (b.current = z, W(Tt, x, le, {
|
|
416
416
|
discrete: !1
|
|
417
417
|
}), p.target.setPointerCapture(p.pointerId)) : (Math.abs(j) > G || Math.abs(C) > G) && (h.current = null);
|
|
418
418
|
}),
|
|
419
|
-
onPointerUp: _(
|
|
420
|
-
const j =
|
|
421
|
-
if (C.hasPointerCapture(p.pointerId) && C.releasePointerCapture(p.pointerId),
|
|
419
|
+
onPointerUp: _(r.onPointerUp, (p) => {
|
|
420
|
+
const j = b.current, C = p.target;
|
|
421
|
+
if (C.hasPointerCapture(p.pointerId) && C.releasePointerCapture(p.pointerId), b.current = null, h.current = null, j) {
|
|
422
422
|
const M = p.currentTarget, F = { originalEvent: p, delta: j };
|
|
423
|
-
ue(j,
|
|
423
|
+
ue(j, y.swipeDirection, y.swipeThreshold) ? W(gt, T, F, {
|
|
424
424
|
discrete: !0
|
|
425
425
|
}) : W(
|
|
426
426
|
Et,
|
|
427
|
-
|
|
427
|
+
E,
|
|
428
428
|
F,
|
|
429
429
|
{
|
|
430
430
|
discrete: !0
|
|
@@ -438,131 +438,131 @@ var [kt, Nt] = ve(K, {
|
|
|
438
438
|
)
|
|
439
439
|
}
|
|
440
440
|
) }),
|
|
441
|
-
|
|
441
|
+
y.viewport
|
|
442
442
|
) })
|
|
443
443
|
] }) : null;
|
|
444
444
|
}
|
|
445
|
-
), St = (
|
|
446
|
-
const { __scopeToast:
|
|
447
|
-
return Rt(() => o(!0)),
|
|
448
|
-
const
|
|
449
|
-
return () => window.clearTimeout(
|
|
450
|
-
}, []), u ? null : /* @__PURE__ */
|
|
445
|
+
), St = (r) => {
|
|
446
|
+
const { __scopeToast: t, children: e, ...s } = r, a = Z(K, t), [n, o] = d.useState(!1), [u, f] = d.useState(!1);
|
|
447
|
+
return Rt(() => o(!0)), d.useEffect(() => {
|
|
448
|
+
const i = window.setTimeout(() => f(!0), 1e3);
|
|
449
|
+
return () => window.clearTimeout(i);
|
|
450
|
+
}, []), u ? null : /* @__PURE__ */ c.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ c.jsx(fe, { ...s, children: n && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
451
451
|
a.label,
|
|
452
452
|
" ",
|
|
453
453
|
e
|
|
454
454
|
] }) }) });
|
|
455
|
-
}, jt = "ToastTitle", Ee =
|
|
456
|
-
(
|
|
457
|
-
const { __scopeToast: e, ...s } =
|
|
458
|
-
return /* @__PURE__ */
|
|
455
|
+
}, jt = "ToastTitle", Ee = d.forwardRef(
|
|
456
|
+
(r, t) => {
|
|
457
|
+
const { __scopeToast: e, ...s } = r;
|
|
458
|
+
return /* @__PURE__ */ c.jsx(D.div, { ...s, ref: t });
|
|
459
459
|
}
|
|
460
460
|
);
|
|
461
461
|
Ee.displayName = jt;
|
|
462
|
-
var Ct = "ToastDescription", ge =
|
|
463
|
-
(
|
|
464
|
-
const { __scopeToast: e, ...s } =
|
|
465
|
-
return /* @__PURE__ */
|
|
462
|
+
var Ct = "ToastDescription", ge = d.forwardRef(
|
|
463
|
+
(r, t) => {
|
|
464
|
+
const { __scopeToast: e, ...s } = r;
|
|
465
|
+
return /* @__PURE__ */ c.jsx(D.div, { ...s, ref: t });
|
|
466
466
|
}
|
|
467
467
|
);
|
|
468
468
|
ge.displayName = Ct;
|
|
469
|
-
var ke = "ToastAction", Ne =
|
|
470
|
-
(
|
|
471
|
-
const { altText: e, ...s } =
|
|
472
|
-
return e.trim() ? /* @__PURE__ */
|
|
469
|
+
var ke = "ToastAction", Ne = d.forwardRef(
|
|
470
|
+
(r, t) => {
|
|
471
|
+
const { altText: e, ...s } = r;
|
|
472
|
+
return e.trim() ? /* @__PURE__ */ c.jsx(Se, { altText: e, asChild: !0, children: /* @__PURE__ */ c.jsx(ne, { ...s, ref: t }) }) : (console.error(
|
|
473
473
|
`Invalid prop \`altText\` supplied to \`${ke}\`. Expected non-empty \`string\`.`
|
|
474
474
|
), null);
|
|
475
475
|
}
|
|
476
476
|
);
|
|
477
477
|
Ne.displayName = ke;
|
|
478
|
-
var _e = "ToastClose", ne =
|
|
479
|
-
(
|
|
480
|
-
const { __scopeToast: e, ...s } =
|
|
481
|
-
return /* @__PURE__ */
|
|
478
|
+
var _e = "ToastClose", ne = d.forwardRef(
|
|
479
|
+
(r, t) => {
|
|
480
|
+
const { __scopeToast: e, ...s } = r, a = Nt(_e, e);
|
|
481
|
+
return /* @__PURE__ */ c.jsx(Se, { asChild: !0, children: /* @__PURE__ */ c.jsx(
|
|
482
482
|
D.button,
|
|
483
483
|
{
|
|
484
484
|
type: "button",
|
|
485
485
|
...s,
|
|
486
|
-
ref:
|
|
487
|
-
onClick: _(
|
|
486
|
+
ref: t,
|
|
487
|
+
onClick: _(r.onClick, a.onClose)
|
|
488
488
|
}
|
|
489
489
|
) });
|
|
490
490
|
}
|
|
491
491
|
);
|
|
492
492
|
ne.displayName = _e;
|
|
493
|
-
var Se =
|
|
494
|
-
const { __scopeToast: e, altText: s, ...a } =
|
|
495
|
-
return /* @__PURE__ */
|
|
493
|
+
var Se = d.forwardRef((r, t) => {
|
|
494
|
+
const { __scopeToast: e, altText: s, ...a } = r;
|
|
495
|
+
return /* @__PURE__ */ c.jsx(
|
|
496
496
|
D.div,
|
|
497
497
|
{
|
|
498
498
|
"data-radix-toast-announce-exclude": "",
|
|
499
499
|
"data-radix-toast-announce-alt": s || void 0,
|
|
500
500
|
...a,
|
|
501
|
-
ref:
|
|
501
|
+
ref: t
|
|
502
502
|
}
|
|
503
503
|
);
|
|
504
504
|
});
|
|
505
|
-
function je(
|
|
506
|
-
const
|
|
507
|
-
return Array.from(
|
|
508
|
-
if (e.nodeType === e.TEXT_NODE && e.textContent &&
|
|
505
|
+
function je(r) {
|
|
506
|
+
const t = [];
|
|
507
|
+
return Array.from(r.childNodes).forEach((e) => {
|
|
508
|
+
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), Pt(e)) {
|
|
509
509
|
const s = e.ariaHidden || e.hidden || e.style.display === "none", a = e.dataset.radixToastAnnounceExclude === "";
|
|
510
510
|
if (!s)
|
|
511
511
|
if (a) {
|
|
512
512
|
const n = e.dataset.radixToastAnnounceAlt;
|
|
513
|
-
n &&
|
|
513
|
+
n && t.push(n);
|
|
514
514
|
} else
|
|
515
|
-
|
|
515
|
+
t.push(...je(e));
|
|
516
516
|
}
|
|
517
|
-
}),
|
|
517
|
+
}), t;
|
|
518
518
|
}
|
|
519
|
-
function W(
|
|
520
|
-
const a = e.originalEvent.currentTarget, n = new CustomEvent(
|
|
521
|
-
|
|
519
|
+
function W(r, t, e, { discrete: s }) {
|
|
520
|
+
const a = e.originalEvent.currentTarget, n = new CustomEvent(r, { bubbles: !0, cancelable: !0, detail: e });
|
|
521
|
+
t && a.addEventListener(r, t, { once: !0 }), s ? et(a, n) : a.dispatchEvent(n);
|
|
522
522
|
}
|
|
523
|
-
var ue = (
|
|
524
|
-
const s = Math.abs(
|
|
525
|
-
return
|
|
523
|
+
var ue = (r, t, e = 0) => {
|
|
524
|
+
const s = Math.abs(r.x), a = Math.abs(r.y), n = s > a;
|
|
525
|
+
return t === "left" || t === "right" ? n && s > e : !n && a > e;
|
|
526
526
|
};
|
|
527
|
-
function Rt(
|
|
527
|
+
function Rt(r = () => {
|
|
528
528
|
}) {
|
|
529
|
-
const
|
|
529
|
+
const t = Y(r);
|
|
530
530
|
tt(() => {
|
|
531
531
|
let e = 0, s = 0;
|
|
532
|
-
return e = window.requestAnimationFrame(() => s = window.requestAnimationFrame(
|
|
532
|
+
return e = window.requestAnimationFrame(() => s = window.requestAnimationFrame(t)), () => {
|
|
533
533
|
window.cancelAnimationFrame(e), window.cancelAnimationFrame(s);
|
|
534
534
|
};
|
|
535
|
-
}, [
|
|
535
|
+
}, [t]);
|
|
536
536
|
}
|
|
537
|
-
function Pt(
|
|
538
|
-
return
|
|
537
|
+
function Pt(r) {
|
|
538
|
+
return r.nodeType === r.ELEMENT_NODE;
|
|
539
539
|
}
|
|
540
|
-
function Dt(
|
|
541
|
-
const
|
|
540
|
+
function Dt(r) {
|
|
541
|
+
const t = [], e = document.createTreeWalker(r, NodeFilter.SHOW_ELEMENT, {
|
|
542
542
|
acceptNode: (s) => {
|
|
543
543
|
const a = s.tagName === "INPUT" && s.type === "hidden";
|
|
544
544
|
return s.disabled || s.hidden || a ? NodeFilter.FILTER_SKIP : s.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
545
545
|
}
|
|
546
546
|
});
|
|
547
|
-
for (; e.nextNode(); )
|
|
548
|
-
return
|
|
547
|
+
for (; e.nextNode(); ) t.push(e.currentNode);
|
|
548
|
+
return t;
|
|
549
549
|
}
|
|
550
|
-
function J(
|
|
551
|
-
const
|
|
552
|
-
return
|
|
550
|
+
function J(r) {
|
|
551
|
+
const t = document.activeElement;
|
|
552
|
+
return r.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
553
553
|
}
|
|
554
554
|
var At = xe, Ce = he, Re = be, Pe = Ee, De = ge, Ae = Ne, Ie = ne;
|
|
555
|
-
const It = At, Le = S.createContext(null), Me = S.forwardRef((
|
|
555
|
+
const It = At, Le = S.createContext(null), Me = S.forwardRef((r, t) => {
|
|
556
556
|
const e = R.c(9);
|
|
557
557
|
let s, a;
|
|
558
|
-
e[0] !==
|
|
558
|
+
e[0] !== r ? ({
|
|
559
559
|
className: s,
|
|
560
560
|
...a
|
|
561
|
-
} =
|
|
561
|
+
} = r, e[0] = r, e[1] = s, e[2] = a) : (s = e[1], a = e[2]);
|
|
562
562
|
let n;
|
|
563
563
|
e[3] !== s ? (n = P("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", s), e[3] = s, e[4] = n) : n = e[4];
|
|
564
564
|
let o;
|
|
565
|
-
return e[5] !== a || e[6] !==
|
|
565
|
+
return e[5] !== a || e[6] !== t || e[7] !== n ? (o = /* @__PURE__ */ c.jsx(Ce, { ...a, ref: t, className: n }), e[5] = a, e[6] = t, e[7] = n, e[8] = o) : o = e[8], o;
|
|
566
566
|
});
|
|
567
567
|
Me.displayName = Ce.displayName;
|
|
568
568
|
const Lt = pe("group pointer-events-auto relative shadow-xs bg-primary-white dark:bg-primary-gray-650 flex w-full text-primary-black dark:text-primary-white items-center justify-between flex gap-2 overflow-hidden rounded-sm border border-primary-gray-400 p-2 pr-6 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 sm:data-[state=open]:slide-in-from-bottom-full", {
|
|
@@ -589,14 +589,14 @@ const Lt = pe("group pointer-events-auto relative shadow-xs bg-primary-white dar
|
|
|
589
589
|
defaultVariants: {
|
|
590
590
|
variant: "default"
|
|
591
591
|
}
|
|
592
|
-
}), Fe = S.forwardRef((
|
|
592
|
+
}), Fe = S.forwardRef((r, t) => {
|
|
593
593
|
const e = R.c(16);
|
|
594
594
|
let s, a, n;
|
|
595
|
-
e[0] !==
|
|
595
|
+
e[0] !== r ? ({
|
|
596
596
|
className: s,
|
|
597
597
|
variant: n,
|
|
598
598
|
...a
|
|
599
|
-
} =
|
|
599
|
+
} = r, e[0] = r, e[1] = s, e[2] = a, e[3] = n) : (s = e[1], a = e[2], n = e[3]);
|
|
600
600
|
let o;
|
|
601
601
|
e[4] !== n ? (o = {
|
|
602
602
|
variant: n
|
|
@@ -605,155 +605,157 @@ const Lt = pe("group pointer-events-auto relative shadow-xs bg-primary-white dar
|
|
|
605
605
|
e[6] !== s || e[7] !== n ? (u = P(Lt({
|
|
606
606
|
variant: n
|
|
607
607
|
}), s), e[6] = s, e[7] = n, e[8] = u) : u = e[8];
|
|
608
|
-
let
|
|
609
|
-
e[9] !== a || e[10] !==
|
|
610
|
-
let
|
|
611
|
-
return e[13] !== o || e[14] !==
|
|
608
|
+
let f;
|
|
609
|
+
e[9] !== a || e[10] !== t || e[11] !== u ? (f = /* @__PURE__ */ c.jsx(Re, { ...a, ref: t, className: u }), e[9] = a, e[10] = t, e[11] = u, e[12] = f) : f = e[12];
|
|
610
|
+
let i;
|
|
611
|
+
return e[13] !== o || e[14] !== f ? (i = /* @__PURE__ */ c.jsx(Le.Provider, { value: o, children: f }), e[13] = o, e[14] = f, e[15] = i) : i = e[15], i;
|
|
612
612
|
});
|
|
613
613
|
Fe.displayName = Re.displayName;
|
|
614
|
-
const Ft = S.forwardRef((
|
|
614
|
+
const Ft = S.forwardRef((r, t) => {
|
|
615
615
|
const e = R.c(9);
|
|
616
616
|
let s, a;
|
|
617
|
-
e[0] !==
|
|
617
|
+
e[0] !== r ? ({
|
|
618
618
|
className: s,
|
|
619
619
|
...a
|
|
620
|
-
} =
|
|
620
|
+
} = r, e[0] = r, e[1] = s, e[2] = a) : (s = e[1], a = e[2]);
|
|
621
621
|
let n;
|
|
622
622
|
e[3] !== s ? (n = P("inline-flex h-8 shrink-0 items-center text-primary-gray-700 dark:text-primary-gray-100 justify-center rounded-none bg-transparent px-3 text-sm font-medium transition-colors hover:bg-primary-gray-200 dark:hover:bg-primary-gray-600 focus:outline-hidden focus:ring-1 disabled:pointer-events-none disabled:opacity-50", s), e[3] = s, e[4] = n) : n = e[4];
|
|
623
623
|
let o;
|
|
624
|
-
return e[5] !== a || e[6] !==
|
|
624
|
+
return e[5] !== a || e[6] !== t || e[7] !== n ? (o = /* @__PURE__ */ c.jsx(Ae, { ...a, ref: t, className: n }), e[5] = a, e[6] = t, e[7] = n, e[8] = o) : o = e[8], o;
|
|
625
625
|
});
|
|
626
626
|
Ft.displayName = Ae.displayName;
|
|
627
|
-
const $e = S.forwardRef((
|
|
627
|
+
const $e = S.forwardRef((r, t) => {
|
|
628
628
|
const e = R.c(10);
|
|
629
629
|
let s, a;
|
|
630
|
-
e[0] !==
|
|
630
|
+
e[0] !== r ? ({
|
|
631
631
|
className: s,
|
|
632
632
|
...a
|
|
633
|
-
} =
|
|
633
|
+
} = r, e[0] = r, e[1] = s, e[2] = a) : (s = e[1], a = e[2]);
|
|
634
634
|
let n;
|
|
635
635
|
e[3] !== s ? (n = P("absolute right-1 top-1 rounded-md p-1 text-primary-gray-700/50 dark:text-primary-gray-100/50 opacity-0 transition-opacity hover:text-primary-gray-700 dark:hover:text-primary-gray-100 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100", s), e[3] = s, e[4] = n) : n = e[4];
|
|
636
636
|
let o;
|
|
637
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */
|
|
637
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c.jsx(st, { className: "h-4 w-4" }), e[5] = o) : o = e[5];
|
|
638
638
|
let u;
|
|
639
|
-
return e[6] !== a || e[7] !==
|
|
639
|
+
return e[6] !== a || e[7] !== t || e[8] !== n ? (u = /* @__PURE__ */ c.jsx(Ie, { ...a, ref: t, className: n, "toast-close": "", children: o }), e[6] = a, e[7] = t, e[8] = n, e[9] = u) : u = e[9], u;
|
|
640
640
|
});
|
|
641
641
|
$e.displayName = Ie.displayName;
|
|
642
|
-
const Oe = S.forwardRef((
|
|
642
|
+
const Oe = S.forwardRef((r, t) => {
|
|
643
643
|
const e = R.c(16);
|
|
644
644
|
let s, a;
|
|
645
|
-
e[0] !==
|
|
645
|
+
e[0] !== r ? ({
|
|
646
646
|
className: s,
|
|
647
647
|
...a
|
|
648
|
-
} =
|
|
648
|
+
} = r, e[0] = r, e[1] = s, e[2] = a) : (s = e[1], a = e[2]);
|
|
649
649
|
const n = S.useContext(Le);
|
|
650
650
|
let o;
|
|
651
651
|
e[3] !== s || e[4] !== n?.variant ? (o = P(Mt({
|
|
652
652
|
variant: n?.variant
|
|
653
653
|
}), "text-lg font-bold [&+div]:text-xs", s), e[3] = s, e[4] = n?.variant, e[5] = o) : o = e[5];
|
|
654
654
|
const u = o;
|
|
655
|
-
let
|
|
655
|
+
let f;
|
|
656
656
|
e: switch (n?.variant) {
|
|
657
657
|
case "destructive": {
|
|
658
658
|
let m;
|
|
659
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */
|
|
659
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c.jsx(mt, { className: "h-4 w-4 stroke-accent-dark-red", strokeWidth: 2 }), e[6] = m) : m = e[6], f = m;
|
|
660
660
|
break e;
|
|
661
661
|
}
|
|
662
662
|
case "success": {
|
|
663
663
|
let m;
|
|
664
|
-
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */
|
|
664
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c.jsx(ut, { className: "h-4 w-4 stroke-accent-dark-green", strokeWidth: 2 }), e[7] = m) : m = e[7], f = m;
|
|
665
665
|
break e;
|
|
666
666
|
}
|
|
667
667
|
case "warning": {
|
|
668
668
|
let m;
|
|
669
|
-
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */
|
|
669
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c.jsx(yt, { className: "h-4 w-4 stroke-accent-dark-yellow", strokeWidth: 2 }), e[8] = m) : m = e[8], f = m;
|
|
670
670
|
break e;
|
|
671
671
|
}
|
|
672
672
|
default:
|
|
673
|
-
|
|
673
|
+
f = null;
|
|
674
674
|
}
|
|
675
|
-
let
|
|
676
|
-
e[9] !== u || e[10] !== a || e[11] !==
|
|
675
|
+
let i;
|
|
676
|
+
e[9] !== u || e[10] !== a || e[11] !== t ? (i = /* @__PURE__ */ c.jsx(Pe, { ...a, ref: t, className: u }), e[9] = u, e[10] = a, e[11] = t, e[12] = i) : i = e[12];
|
|
677
677
|
let x;
|
|
678
|
-
return e[13] !==
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
] }), e[13] =
|
|
678
|
+
return e[13] !== f || e[14] !== i ? (x = /* @__PURE__ */ c.jsxs("div", { className: "flex gap-x-1 items-center", children: [
|
|
679
|
+
f,
|
|
680
|
+
i
|
|
681
|
+
] }), e[13] = f, e[14] = i, e[15] = x) : x = e[15], x;
|
|
682
682
|
});
|
|
683
683
|
Oe.displayName = Pe.displayName;
|
|
684
|
-
const Ke = S.forwardRef((
|
|
684
|
+
const Ke = S.forwardRef((r, t) => {
|
|
685
685
|
const e = R.c(9);
|
|
686
686
|
let s, a;
|
|
687
|
-
e[0] !==
|
|
687
|
+
e[0] !== r ? ({
|
|
688
688
|
className: s,
|
|
689
689
|
...a
|
|
690
|
-
} =
|
|
690
|
+
} = r, e[0] = r, e[1] = s, e[2] = a) : (s = e[1], a = e[2]);
|
|
691
691
|
let n;
|
|
692
692
|
e[3] !== s ? (n = P("text-base opacity-90 dark:text-primary-white", s), e[3] = s, e[4] = n) : n = e[4];
|
|
693
693
|
let o;
|
|
694
|
-
return e[5] !== a || e[6] !==
|
|
694
|
+
return e[5] !== a || e[6] !== t || e[7] !== n ? (o = /* @__PURE__ */ c.jsx(De, { ...a, ref: t, className: n }), e[5] = a, e[6] = t, e[7] = n, e[8] = o) : o = e[8], o;
|
|
695
695
|
});
|
|
696
696
|
Ke.displayName = De.displayName;
|
|
697
697
|
function $t() {
|
|
698
|
-
const
|
|
699
|
-
toasts:
|
|
698
|
+
const r = R.c(5), {
|
|
699
|
+
toasts: t
|
|
700
700
|
} = ye();
|
|
701
701
|
let e;
|
|
702
|
-
|
|
702
|
+
r[0] !== t ? (e = t.map(Ot), r[0] = t, r[1] = e) : e = r[1];
|
|
703
703
|
let s;
|
|
704
|
-
|
|
704
|
+
r[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ c.jsx(Me, {}), r[2] = s) : s = r[2];
|
|
705
705
|
let a;
|
|
706
|
-
return
|
|
706
|
+
return r[3] !== e ? (a = /* @__PURE__ */ c.jsxs(It, { children: [
|
|
707
707
|
e,
|
|
708
708
|
s
|
|
709
|
-
] }),
|
|
709
|
+
] }), r[3] = e, r[4] = a) : a = r[4], a;
|
|
710
710
|
}
|
|
711
|
-
function Ot(
|
|
711
|
+
function Ot(r) {
|
|
712
712
|
const {
|
|
713
|
-
id:
|
|
713
|
+
id: t,
|
|
714
714
|
title: e,
|
|
715
715
|
description: s,
|
|
716
716
|
action: a,
|
|
717
717
|
...n
|
|
718
|
-
} =
|
|
719
|
-
return /* @__PURE__ */ Xe(Fe, { ...n, key:
|
|
720
|
-
e && /* @__PURE__ */
|
|
721
|
-
s && /* @__PURE__ */
|
|
722
|
-
] }), a, /* @__PURE__ */
|
|
718
|
+
} = r;
|
|
719
|
+
return /* @__PURE__ */ Xe(Fe, { ...n, key: t }, /* @__PURE__ */ c.jsxs("div", { className: "grid gap-1", children: [
|
|
720
|
+
e && /* @__PURE__ */ c.jsx(Oe, { children: e }),
|
|
721
|
+
s && /* @__PURE__ */ c.jsx(Ke, { children: s })
|
|
722
|
+
] }), a, /* @__PURE__ */ c.jsx($e, {}));
|
|
723
723
|
}
|
|
724
|
-
function Xt(
|
|
725
|
-
const
|
|
724
|
+
function Xt(r) {
|
|
725
|
+
const t = ze.c(15), {
|
|
726
726
|
text: e,
|
|
727
727
|
successMessage: s,
|
|
728
728
|
buttonText: a,
|
|
729
729
|
buttonSmall: n,
|
|
730
730
|
className: o
|
|
731
|
-
} =
|
|
731
|
+
} = r, u = s === void 0 ? "Text copied" : s, f = n === void 0 ? !1 : n, i = o === void 0 ? "" : o, {
|
|
732
732
|
toast: x
|
|
733
|
-
} = ye(), m =
|
|
734
|
-
let
|
|
735
|
-
|
|
733
|
+
} = ye(), m = f ? "p-2" : "py-4 px-6";
|
|
734
|
+
let E;
|
|
735
|
+
t[0] !== i || t[1] !== m ? (E = P(m, i), t[0] = i, t[1] = m, t[2] = E) : E = t[2];
|
|
736
|
+
let T;
|
|
737
|
+
t[3] !== u || t[4] !== e || t[5] !== x ? (T = () => {
|
|
736
738
|
navigator.clipboard.writeText(e), x({
|
|
737
739
|
variant: "success",
|
|
738
740
|
description: u,
|
|
739
741
|
duration: 1e3
|
|
740
742
|
});
|
|
741
|
-
},
|
|
742
|
-
let
|
|
743
|
-
|
|
744
|
-
const
|
|
745
|
-
let
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
] }),
|
|
750
|
-
let d;
|
|
751
|
-
r[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ $.jsx($t, {}), r[9] = d) : d = r[9];
|
|
743
|
+
}, t[3] = u, t[4] = e, t[5] = x, t[6] = T) : T = t[6];
|
|
744
|
+
let g;
|
|
745
|
+
t[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ $.jsx(We, {}), t[7] = g) : g = t[7];
|
|
746
|
+
const y = a || null;
|
|
747
|
+
let l;
|
|
748
|
+
t[8] !== E || t[9] !== T || t[10] !== y ? (l = /* @__PURE__ */ $.jsxs(Ue, { variant: "tertiary", className: E, onClick: T, "aria-label": "Click to copy the text", children: [
|
|
749
|
+
g,
|
|
750
|
+
y
|
|
751
|
+
] }), t[8] = E, t[9] = T, t[10] = y, t[11] = l) : l = t[11];
|
|
752
752
|
let w;
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
753
|
+
t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ $.jsx($t, {}), t[12] = w) : w = t[12];
|
|
754
|
+
let v;
|
|
755
|
+
return t[13] !== l ? (v = /* @__PURE__ */ $.jsxs($.Fragment, { children: [
|
|
756
|
+
l,
|
|
757
|
+
w
|
|
758
|
+
] }), t[13] = l, t[14] = v) : v = t[14], v;
|
|
757
759
|
}
|
|
758
760
|
export {
|
|
759
761
|
Xt as CopyTextButton
|