@alfadocs/ui-kit 0.2.2 → 0.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/dist/_chunks/{ai-prompt-input-BBiDlEIS.js → ai-prompt-input-DLgY8lrW.js} +2 -2
- package/dist/_chunks/{audio-recorder-B4U1LuiQ.js → audio-recorder-BdBbU-UK.js} +2 -2
- package/dist/_chunks/{command-palette-C_vgSgrI.js → command-palette-DkL-aW4O.js} +9 -2
- package/dist/_chunks/{dialog-BPD7wlGE.js → dialog-D5bK95-N.js} +24 -24
- package/dist/_chunks/{dropdown-menu-CpiF6CPz.js → dropdown-menu-dyV7gHh_.js} +2 -1
- package/dist/_chunks/{leo-sidebar-kHO45M6C.js → leo-sidebar-D1RdE54a.js} +2 -2
- package/dist/_chunks/{patient-shell-BlsEUKWB.js → patient-shell-IhMULVrt.js} +2 -2
- package/dist/_chunks/{select-y6bXV1f1.js → select-BOU_Osnf.js} +2 -1
- package/dist/_chunks/{sheet-4tgMFwj0.js → sheet-B9T3OQmz.js} +23 -23
- package/dist/_chunks/{tabs-DaFA3Muo.js → tabs-BZQy_Rmb.js} +2 -2
- package/dist/_chunks/{theme-toggle-B9zzCnvl.js → theme-toggle-B3UR6ouK.js} +2 -2
- package/dist/_chunks/{toast.agent-BwKXA0km.js → toast.agent-DihA6MON.js} +206 -203
- package/dist/_chunks/{workflow-map-C-nlogPC.js → workflow-map-Bi5liGzo.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/index.js +13 -13
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/safe-html/index.js +13 -12
- package/dist/tokens.css +1 -1
- package/package.json +2 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx as P, jsxs as Ht } from "react/jsx-runtime";
|
|
2
|
-
import s, { useState as Ot, useEffect as jt } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { I as
|
|
6
|
-
import { X as
|
|
7
|
-
import { C as
|
|
8
|
-
import { T as
|
|
9
|
-
import { C as
|
|
10
|
-
import { I as
|
|
11
|
-
function
|
|
2
|
+
import s, { useState as Ot, useRef as te, useEffect as jt } from "react";
|
|
3
|
+
import ee from "react-dom";
|
|
4
|
+
import { useTranslation as ae } from "react-i18next";
|
|
5
|
+
import { I as se } from "./icon-button-C4CGcYuz.js";
|
|
6
|
+
import { X as oe } from "./x-CCcI3eJp.js";
|
|
7
|
+
import { C as ne } from "./circle-x-Du2CmjaU.js";
|
|
8
|
+
import { T as re } from "./triangle-alert-CBPUIzQo.js";
|
|
9
|
+
import { C as ie } from "./circle-check-9AeSgJD_.js";
|
|
10
|
+
import { I as le } from "./info-B9XNKn05.js";
|
|
11
|
+
function de(o) {
|
|
12
12
|
if (typeof document > "u") return;
|
|
13
13
|
let a = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
|
|
14
14
|
e.type = "text/css", a.appendChild(e), e.styleSheet ? e.styleSheet.cssText = o : e.appendChild(document.createTextNode(o));
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const ce = (o) => {
|
|
17
17
|
switch (o) {
|
|
18
18
|
case "success":
|
|
19
|
-
return
|
|
19
|
+
return fe;
|
|
20
20
|
case "info":
|
|
21
|
-
return
|
|
21
|
+
return ge;
|
|
22
22
|
case "warning":
|
|
23
|
-
return
|
|
23
|
+
return pe;
|
|
24
24
|
case "error":
|
|
25
|
-
return
|
|
25
|
+
return he;
|
|
26
26
|
default:
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, ue = Array(12).fill(0), me = ({ visible: o, className: a }) => /* @__PURE__ */ s.createElement("div", {
|
|
30
30
|
className: [
|
|
31
31
|
"sonner-loading-wrapper",
|
|
32
32
|
a
|
|
@@ -34,10 +34,10 @@ const de = (o) => {
|
|
|
34
34
|
"data-visible": o
|
|
35
35
|
}, /* @__PURE__ */ s.createElement("div", {
|
|
36
36
|
className: "sonner-spinner"
|
|
37
|
-
},
|
|
37
|
+
}, ue.map((e, n) => /* @__PURE__ */ s.createElement("div", {
|
|
38
38
|
className: "sonner-loading-bar",
|
|
39
39
|
key: `spinner-bar-${n}`
|
|
40
|
-
})))),
|
|
40
|
+
})))), fe = /* @__PURE__ */ s.createElement("svg", {
|
|
41
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
42
|
viewBox: "0 0 20 20",
|
|
43
43
|
fill: "currentColor",
|
|
@@ -47,7 +47,7 @@ const de = (o) => {
|
|
|
47
47
|
fillRule: "evenodd",
|
|
48
48
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
49
49
|
clipRule: "evenodd"
|
|
50
|
-
})),
|
|
50
|
+
})), pe = /* @__PURE__ */ s.createElement("svg", {
|
|
51
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
52
52
|
viewBox: "0 0 24 24",
|
|
53
53
|
fill: "currentColor",
|
|
@@ -57,7 +57,7 @@ const de = (o) => {
|
|
|
57
57
|
fillRule: "evenodd",
|
|
58
58
|
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
59
59
|
clipRule: "evenodd"
|
|
60
|
-
})),
|
|
60
|
+
})), ge = /* @__PURE__ */ s.createElement("svg", {
|
|
61
61
|
xmlns: "http://www.w3.org/2000/svg",
|
|
62
62
|
viewBox: "0 0 20 20",
|
|
63
63
|
fill: "currentColor",
|
|
@@ -67,7 +67,7 @@ const de = (o) => {
|
|
|
67
67
|
fillRule: "evenodd",
|
|
68
68
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
69
69
|
clipRule: "evenodd"
|
|
70
|
-
})),
|
|
70
|
+
})), he = /* @__PURE__ */ s.createElement("svg", {
|
|
71
71
|
xmlns: "http://www.w3.org/2000/svg",
|
|
72
72
|
viewBox: "0 0 20 20",
|
|
73
73
|
fill: "currentColor",
|
|
@@ -77,7 +77,7 @@ const de = (o) => {
|
|
|
77
77
|
fillRule: "evenodd",
|
|
78
78
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
79
79
|
clipRule: "evenodd"
|
|
80
|
-
})),
|
|
80
|
+
})), be = /* @__PURE__ */ s.createElement("svg", {
|
|
81
81
|
xmlns: "http://www.w3.org/2000/svg",
|
|
82
82
|
width: "12",
|
|
83
83
|
height: "12",
|
|
@@ -97,7 +97,7 @@ const de = (o) => {
|
|
|
97
97
|
y1: "6",
|
|
98
98
|
x2: "18",
|
|
99
99
|
y2: "18"
|
|
100
|
-
})),
|
|
100
|
+
})), ve = () => {
|
|
101
101
|
const [o, a] = s.useState(document.hidden);
|
|
102
102
|
return s.useEffect(() => {
|
|
103
103
|
const e = () => {
|
|
@@ -107,7 +107,7 @@ const de = (o) => {
|
|
|
107
107
|
}, []), o;
|
|
108
108
|
};
|
|
109
109
|
let St = 1;
|
|
110
|
-
class
|
|
110
|
+
class ye {
|
|
111
111
|
constructor() {
|
|
112
112
|
this.subscribe = (a) => (this.subscribers.push(a), () => {
|
|
113
113
|
const e = this.subscribers.indexOf(a);
|
|
@@ -121,22 +121,22 @@ class ve {
|
|
|
121
121
|
];
|
|
122
122
|
}, this.create = (a) => {
|
|
123
123
|
var e;
|
|
124
|
-
const { message: n, ...
|
|
125
|
-
return this.dismissedToasts.has(d) && this.dismissedToasts.delete(d), c ? this.toasts = this.toasts.map((
|
|
126
|
-
...
|
|
124
|
+
const { message: n, ...y } = a, d = typeof (a == null ? void 0 : a.id) == "number" || ((e = a.id) == null ? void 0 : e.length) > 0 ? a.id : St++, c = this.toasts.find((v) => v.id === d), b = a.dismissible === void 0 ? !0 : a.dismissible;
|
|
125
|
+
return this.dismissedToasts.has(d) && this.dismissedToasts.delete(d), c ? this.toasts = this.toasts.map((v) => v.id === d ? (this.publish({
|
|
126
|
+
...v,
|
|
127
127
|
...a,
|
|
128
128
|
id: d,
|
|
129
129
|
title: n
|
|
130
130
|
}), {
|
|
131
|
-
...
|
|
131
|
+
...v,
|
|
132
132
|
...a,
|
|
133
133
|
id: d,
|
|
134
|
-
dismissible:
|
|
134
|
+
dismissible: b,
|
|
135
135
|
title: n
|
|
136
|
-
}) :
|
|
136
|
+
}) : v) : this.addToast({
|
|
137
137
|
title: n,
|
|
138
|
-
...
|
|
139
|
-
dismissible:
|
|
138
|
+
...y,
|
|
139
|
+
dismissible: b,
|
|
140
140
|
id: d
|
|
141
141
|
}), d;
|
|
142
142
|
}, this.dismiss = (a) => (a ? (this.dismissedToasts.add(a), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
|
|
@@ -181,9 +181,9 @@ class ve {
|
|
|
181
181
|
message: e.loading,
|
|
182
182
|
description: typeof e.description != "function" ? e.description : void 0
|
|
183
183
|
}));
|
|
184
|
-
const
|
|
184
|
+
const y = Promise.resolve(a instanceof Function ? a() : a);
|
|
185
185
|
let d = n !== void 0, c;
|
|
186
|
-
const
|
|
186
|
+
const b = y.then(async (i) => {
|
|
187
187
|
if (c = [
|
|
188
188
|
"resolve",
|
|
189
189
|
i
|
|
@@ -193,38 +193,38 @@ class ve {
|
|
|
193
193
|
type: "default",
|
|
194
194
|
message: i
|
|
195
195
|
});
|
|
196
|
-
else if (
|
|
196
|
+
else if (we(i) && !i.ok) {
|
|
197
197
|
d = !1;
|
|
198
|
-
const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error,
|
|
198
|
+
const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, k = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, N = typeof t == "object" && !s.isValidElement(t) ? t : {
|
|
199
199
|
message: t
|
|
200
200
|
};
|
|
201
201
|
this.create({
|
|
202
202
|
id: n,
|
|
203
203
|
type: "error",
|
|
204
|
-
description:
|
|
205
|
-
...
|
|
204
|
+
description: k,
|
|
205
|
+
...N
|
|
206
206
|
});
|
|
207
207
|
} else if (i instanceof Error) {
|
|
208
208
|
d = !1;
|
|
209
|
-
const t = typeof e.error == "function" ? await e.error(i) : e.error,
|
|
209
|
+
const t = typeof e.error == "function" ? await e.error(i) : e.error, k = typeof e.description == "function" ? await e.description(i) : e.description, N = typeof t == "object" && !s.isValidElement(t) ? t : {
|
|
210
210
|
message: t
|
|
211
211
|
};
|
|
212
212
|
this.create({
|
|
213
213
|
id: n,
|
|
214
214
|
type: "error",
|
|
215
|
-
description:
|
|
216
|
-
...
|
|
215
|
+
description: k,
|
|
216
|
+
...N
|
|
217
217
|
});
|
|
218
218
|
} else if (e.success !== void 0) {
|
|
219
219
|
d = !1;
|
|
220
|
-
const t = typeof e.success == "function" ? await e.success(i) : e.success,
|
|
220
|
+
const t = typeof e.success == "function" ? await e.success(i) : e.success, k = typeof e.description == "function" ? await e.description(i) : e.description, N = typeof t == "object" && !s.isValidElement(t) ? t : {
|
|
221
221
|
message: t
|
|
222
222
|
};
|
|
223
223
|
this.create({
|
|
224
224
|
id: n,
|
|
225
225
|
type: "success",
|
|
226
|
-
description:
|
|
227
|
-
...
|
|
226
|
+
description: k,
|
|
227
|
+
...N
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
}).catch(async (i) => {
|
|
@@ -233,8 +233,8 @@ class ve {
|
|
|
233
233
|
i
|
|
234
234
|
], e.error !== void 0) {
|
|
235
235
|
d = !1;
|
|
236
|
-
const
|
|
237
|
-
message:
|
|
236
|
+
const g = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, H = typeof g == "object" && !s.isValidElement(g) ? g : {
|
|
237
|
+
message: g
|
|
238
238
|
};
|
|
239
239
|
this.create({
|
|
240
240
|
id: n,
|
|
@@ -245,11 +245,11 @@ class ve {
|
|
|
245
245
|
}
|
|
246
246
|
}).finally(() => {
|
|
247
247
|
d && (this.dismiss(n), n = void 0), e.finally == null || e.finally.call(e);
|
|
248
|
-
}),
|
|
248
|
+
}), v = () => new Promise((i, g) => b.then(() => c[0] === "reject" ? g(c[1]) : i(c[1])).catch(g));
|
|
249
249
|
return typeof n != "string" && typeof n != "number" ? {
|
|
250
|
-
unwrap:
|
|
250
|
+
unwrap: v
|
|
251
251
|
} : Object.assign(n, {
|
|
252
|
-
unwrap:
|
|
252
|
+
unwrap: v
|
|
253
253
|
});
|
|
254
254
|
}, this.custom = (a, e) => {
|
|
255
255
|
const n = (e == null ? void 0 : e.id) || St++;
|
|
@@ -261,14 +261,14 @@ class ve {
|
|
|
261
261
|
}, this.getActiveToasts = () => this.toasts.filter((a) => !this.dismissedToasts.has(a.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
const S = new
|
|
264
|
+
const S = new ye(), xe = (o, a) => {
|
|
265
265
|
const e = (a == null ? void 0 : a.id) || St++;
|
|
266
266
|
return S.addToast({
|
|
267
267
|
title: o,
|
|
268
268
|
...a,
|
|
269
269
|
id: e
|
|
270
270
|
}), e;
|
|
271
|
-
},
|
|
271
|
+
}, we = (o) => o && typeof o == "object" && "ok" in o && typeof o.ok == "boolean" && "status" in o && typeof o.status == "number", Ee = xe, Te = () => S.toasts, ke = () => S.getActiveToasts(), Y = Object.assign(Ee, {
|
|
272
272
|
success: S.success,
|
|
273
273
|
info: S.info,
|
|
274
274
|
warning: S.warning,
|
|
@@ -279,24 +279,24 @@ const S = new ve(), ye = (o, a) => {
|
|
|
279
279
|
dismiss: S.dismiss,
|
|
280
280
|
loading: S.loading
|
|
281
281
|
}, {
|
|
282
|
-
getHistory:
|
|
283
|
-
getToasts:
|
|
282
|
+
getHistory: Te,
|
|
283
|
+
getToasts: ke
|
|
284
284
|
});
|
|
285
|
-
le("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
285
|
+
de("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
286
286
|
function ht(o) {
|
|
287
287
|
return o.label !== void 0;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const Ne = 3, Se = "24px", De = "16px", Pt = 4e3, _e = 356, Ce = 14, Re = 45, Ie = 200;
|
|
290
290
|
function z(...o) {
|
|
291
291
|
return o.filter(Boolean).join(" ");
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function Me(o) {
|
|
294
294
|
const [a, e] = o.split("-"), n = [];
|
|
295
295
|
return a && n.push(a), e && n.push(e), n;
|
|
296
296
|
}
|
|
297
|
-
const
|
|
298
|
-
var a, e, n,
|
|
299
|
-
const { invert:
|
|
297
|
+
const Be = (o) => {
|
|
298
|
+
var a, e, n, y, d, c, b, v, i;
|
|
299
|
+
const { invert: g, toast: t, unstyled: k, interacting: H, setHeights: N, visibleToasts: vt, heights: W, index: u, toasts: rt, expanded: K, removeToast: it, defaultRichColors: yt, closeButton: O, style: at, cancelButtonStyle: F, actionButtonStyle: xt, className: lt = "", descriptionClassName: wt = "", duration: st, position: A, gap: dt, expandByDefault: ot, classNames: m, icons: w, closeButtonAriaLabel: L = "Close toast" } = o, [V, I] = s.useState(null), [U, ct] = s.useState(null), [l, h] = s.useState(!1), [p, C] = s.useState(!1), [q, f] = s.useState(!1), [G, ut] = s.useState(!1), [mt, Q] = s.useState(!1), [Yt, Et] = s.useState(0), [Ft, Dt] = s.useState(0), nt = s.useRef(t.duration || st || Pt), _t = s.useRef(null), j = s.useRef(null), Vt = u === 0, Ut = u + 1 <= vt, D = t.type, J = t.dismissible !== !1, Xt = t.className || "", Wt = t.descriptionClassName || "", ft = s.useMemo(() => W.findIndex((r) => r.toastId === t.id) || 0, [
|
|
300
300
|
W,
|
|
301
301
|
t.id
|
|
302
302
|
]), Kt = s.useMemo(() => {
|
|
@@ -308,47 +308,47 @@ const Me = (o) => {
|
|
|
308
308
|
]), Ct = s.useMemo(() => t.duration || st || Pt, [
|
|
309
309
|
t.duration,
|
|
310
310
|
st
|
|
311
|
-
]), Tt = s.useRef(0), Z = s.useRef(0),
|
|
311
|
+
]), Tt = s.useRef(0), Z = s.useRef(0), Rt = s.useRef(0), tt = s.useRef(null), [qt, Gt] = A.split("-"), It = s.useMemo(() => W.reduce((r, x, T) => T >= ft ? r : r + x.height, 0), [
|
|
312
312
|
W,
|
|
313
313
|
ft
|
|
314
|
-
]), Mt =
|
|
315
|
-
Z.current = s.useMemo(() => ft * dt +
|
|
314
|
+
]), Mt = ve(), Qt = t.invert || g, kt = D === "loading";
|
|
315
|
+
Z.current = s.useMemo(() => ft * dt + It, [
|
|
316
316
|
ft,
|
|
317
|
-
|
|
317
|
+
It
|
|
318
318
|
]), s.useEffect(() => {
|
|
319
319
|
nt.current = Ct;
|
|
320
320
|
}, [
|
|
321
321
|
Ct
|
|
322
322
|
]), s.useEffect(() => {
|
|
323
|
-
|
|
323
|
+
h(!0);
|
|
324
324
|
}, []), s.useEffect(() => {
|
|
325
325
|
const r = j.current;
|
|
326
326
|
if (r) {
|
|
327
|
-
const
|
|
328
|
-
return Dt(
|
|
327
|
+
const x = r.getBoundingClientRect().height;
|
|
328
|
+
return Dt(x), N((T) => [
|
|
329
329
|
{
|
|
330
330
|
toastId: t.id,
|
|
331
|
-
height:
|
|
331
|
+
height: x,
|
|
332
332
|
position: t.position
|
|
333
333
|
},
|
|
334
|
-
...
|
|
335
|
-
]), () =>
|
|
334
|
+
...T
|
|
335
|
+
]), () => N((T) => T.filter((_) => _.toastId !== t.id));
|
|
336
336
|
}
|
|
337
337
|
}, [
|
|
338
|
-
|
|
338
|
+
N,
|
|
339
339
|
t.id
|
|
340
340
|
]), s.useLayoutEffect(() => {
|
|
341
341
|
if (!l) return;
|
|
342
|
-
const r = j.current,
|
|
342
|
+
const r = j.current, x = r.style.height;
|
|
343
343
|
r.style.height = "auto";
|
|
344
|
-
const
|
|
345
|
-
r.style.height =
|
|
346
|
-
...
|
|
347
|
-
height:
|
|
348
|
-
} :
|
|
344
|
+
const T = r.getBoundingClientRect().height;
|
|
345
|
+
r.style.height = x, Dt(T), N((_) => _.find((E) => E.toastId === t.id) ? _.map((E) => E.toastId === t.id ? {
|
|
346
|
+
...E,
|
|
347
|
+
height: T
|
|
348
|
+
} : E) : [
|
|
349
349
|
{
|
|
350
350
|
toastId: t.id,
|
|
351
|
-
height:
|
|
351
|
+
height: T,
|
|
352
352
|
position: t.position
|
|
353
353
|
},
|
|
354
354
|
..._
|
|
@@ -357,31 +357,31 @@ const Me = (o) => {
|
|
|
357
357
|
l,
|
|
358
358
|
t.title,
|
|
359
359
|
t.description,
|
|
360
|
-
|
|
360
|
+
N,
|
|
361
361
|
t.id,
|
|
362
362
|
t.jsx,
|
|
363
363
|
t.action,
|
|
364
364
|
t.cancel
|
|
365
365
|
]);
|
|
366
366
|
const $ = s.useCallback(() => {
|
|
367
|
-
C(!0), Et(Z.current),
|
|
367
|
+
C(!0), Et(Z.current), N((r) => r.filter((x) => x.toastId !== t.id)), setTimeout(() => {
|
|
368
368
|
it(t);
|
|
369
369
|
}, Ie);
|
|
370
370
|
}, [
|
|
371
371
|
t,
|
|
372
372
|
it,
|
|
373
|
-
|
|
373
|
+
N,
|
|
374
374
|
Z
|
|
375
375
|
]);
|
|
376
376
|
s.useEffect(() => {
|
|
377
377
|
if (t.promise && D === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
|
|
378
378
|
let r;
|
|
379
379
|
return K || H || Mt ? (() => {
|
|
380
|
-
if (
|
|
380
|
+
if (Rt.current < Tt.current) {
|
|
381
381
|
const _ = (/* @__PURE__ */ new Date()).getTime() - Tt.current;
|
|
382
382
|
nt.current = nt.current - _;
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
Rt.current = (/* @__PURE__ */ new Date()).getTime();
|
|
385
385
|
})() : (() => {
|
|
386
386
|
nt.current !== 1 / 0 && (Tt.current = (/* @__PURE__ */ new Date()).getTime(), r = setTimeout(() => {
|
|
387
387
|
t.onAutoClose == null || t.onAutoClose.call(t, t), $();
|
|
@@ -402,19 +402,19 @@ const Me = (o) => {
|
|
|
402
402
|
]);
|
|
403
403
|
function Jt() {
|
|
404
404
|
var r;
|
|
405
|
-
if (
|
|
406
|
-
var
|
|
405
|
+
if (w != null && w.loading) {
|
|
406
|
+
var x;
|
|
407
407
|
return /* @__PURE__ */ s.createElement("div", {
|
|
408
|
-
className: z(m == null ? void 0 : m.loader, t == null || (
|
|
408
|
+
className: z(m == null ? void 0 : m.loader, t == null || (x = t.classNames) == null ? void 0 : x.loader, "sonner-loader"),
|
|
409
409
|
"data-visible": D === "loading"
|
|
410
|
-
},
|
|
410
|
+
}, w.loading);
|
|
411
411
|
}
|
|
412
|
-
return /* @__PURE__ */ s.createElement(
|
|
412
|
+
return /* @__PURE__ */ s.createElement(me, {
|
|
413
413
|
className: z(m == null ? void 0 : m.loader, t == null || (r = t.classNames) == null ? void 0 : r.loader),
|
|
414
414
|
visible: D === "loading"
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
|
-
const Zt = t.icon || (
|
|
417
|
+
const Zt = t.icon || (w == null ? void 0 : w[D]) || ce(D);
|
|
418
418
|
var Bt, At;
|
|
419
419
|
return /* @__PURE__ */ s.createElement("li", {
|
|
420
420
|
tabIndex: 0,
|
|
@@ -422,7 +422,7 @@ const Me = (o) => {
|
|
|
422
422
|
className: z(lt, Xt, m == null ? void 0 : m.toast, t == null || (a = t.classNames) == null ? void 0 : a.toast, m == null ? void 0 : m.default, m == null ? void 0 : m[D], t == null || (e = t.classNames) == null ? void 0 : e[D]),
|
|
423
423
|
"data-sonner-toast": "",
|
|
424
424
|
"data-rich-colors": (Bt = t.richColors) != null ? Bt : yt,
|
|
425
|
-
"data-styled": !(t.jsx || t.unstyled ||
|
|
425
|
+
"data-styled": !(t.jsx || t.unstyled || k),
|
|
426
426
|
"data-mounted": l,
|
|
427
427
|
"data-promise": !!t.promise,
|
|
428
428
|
"data-swiped": mt,
|
|
@@ -450,7 +450,7 @@ const Me = (o) => {
|
|
|
450
450
|
...t.style
|
|
451
451
|
},
|
|
452
452
|
onDragEnd: () => {
|
|
453
|
-
f(!1),
|
|
453
|
+
f(!1), I(null), tt.current = null;
|
|
454
454
|
},
|
|
455
455
|
onPointerDown: (r) => {
|
|
456
456
|
r.button !== 2 && (kt || !J || (_t.current = /* @__PURE__ */ new Date(), Et(Z.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (f(!0), tt.current = {
|
|
@@ -459,26 +459,26 @@ const Me = (o) => {
|
|
|
459
459
|
})));
|
|
460
460
|
},
|
|
461
461
|
onPointerUp: () => {
|
|
462
|
-
var r,
|
|
462
|
+
var r, x, T;
|
|
463
463
|
if (G || !J) return;
|
|
464
464
|
tt.current = null;
|
|
465
|
-
const _ = Number(((r = j.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), pt = Number(((
|
|
466
|
-
if (Math.abs(
|
|
465
|
+
const _ = Number(((r = j.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), pt = Number(((x = j.current) == null ? void 0 : x.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), E = (/* @__PURE__ */ new Date()).getTime() - ((T = _t.current) == null ? void 0 : T.getTime()), R = V === "x" ? _ : pt, gt = Math.abs(R) / E;
|
|
466
|
+
if (Math.abs(R) >= Re || gt > 0.11) {
|
|
467
467
|
Et(Z.current), t.onDismiss == null || t.onDismiss.call(t, t), ct(V === "x" ? _ > 0 ? "right" : "left" : pt > 0 ? "down" : "up"), $(), ut(!0);
|
|
468
468
|
return;
|
|
469
469
|
} else {
|
|
470
470
|
var M, B;
|
|
471
471
|
(M = j.current) == null || M.style.setProperty("--swipe-amount-x", "0px"), (B = j.current) == null || B.style.setProperty("--swipe-amount-y", "0px");
|
|
472
472
|
}
|
|
473
|
-
Q(!1), f(!1),
|
|
473
|
+
Q(!1), f(!1), I(null);
|
|
474
474
|
},
|
|
475
475
|
onPointerMove: (r) => {
|
|
476
|
-
var
|
|
477
|
-
if (!tt.current || !J || ((
|
|
478
|
-
const
|
|
476
|
+
var x, T, _;
|
|
477
|
+
if (!tt.current || !J || ((x = window.getSelection()) == null ? void 0 : x.toString().length) > 0) return;
|
|
478
|
+
const E = r.clientY - tt.current.y, R = r.clientX - tt.current.x;
|
|
479
479
|
var gt;
|
|
480
|
-
const M = (gt = o.swipeDirections) != null ? gt :
|
|
481
|
-
!V && (Math.abs(
|
|
480
|
+
const M = (gt = o.swipeDirections) != null ? gt : Me(A);
|
|
481
|
+
!V && (Math.abs(R) > 1 || Math.abs(E) > 1) && I(Math.abs(R) > Math.abs(E) ? "x" : "y");
|
|
482
482
|
let B = {
|
|
483
483
|
x: 0,
|
|
484
484
|
y: 0
|
|
@@ -486,20 +486,20 @@ const Me = (o) => {
|
|
|
486
486
|
const zt = (X) => 1 / (1.5 + Math.abs(X) / 20);
|
|
487
487
|
if (V === "y") {
|
|
488
488
|
if (M.includes("top") || M.includes("bottom"))
|
|
489
|
-
if (M.includes("top") &&
|
|
490
|
-
B.y =
|
|
489
|
+
if (M.includes("top") && E < 0 || M.includes("bottom") && E > 0)
|
|
490
|
+
B.y = E;
|
|
491
491
|
else {
|
|
492
|
-
const X =
|
|
493
|
-
B.y = Math.abs(X) < Math.abs(
|
|
492
|
+
const X = E * zt(E);
|
|
493
|
+
B.y = Math.abs(X) < Math.abs(E) ? X : E;
|
|
494
494
|
}
|
|
495
495
|
} else if (V === "x" && (M.includes("left") || M.includes("right")))
|
|
496
|
-
if (M.includes("left") &&
|
|
497
|
-
B.x =
|
|
496
|
+
if (M.includes("left") && R < 0 || M.includes("right") && R > 0)
|
|
497
|
+
B.x = R;
|
|
498
498
|
else {
|
|
499
|
-
const X =
|
|
500
|
-
B.x = Math.abs(X) < Math.abs(
|
|
499
|
+
const X = R * zt(R);
|
|
500
|
+
B.x = Math.abs(X) < Math.abs(R) ? X : R;
|
|
501
501
|
}
|
|
502
|
-
(Math.abs(B.x) > 0 || Math.abs(B.y) > 0) && Q(!0), (
|
|
502
|
+
(Math.abs(B.x) > 0 || Math.abs(B.y) > 0) && Q(!0), (T = j.current) == null || T.style.setProperty("--swipe-amount-x", `${B.x}px`), (_ = j.current) == null || _.style.setProperty("--swipe-amount-y", `${B.y}px`);
|
|
503
503
|
}
|
|
504
504
|
}, Kt && !t.jsx && D !== "loading" ? /* @__PURE__ */ s.createElement("button", {
|
|
505
505
|
"aria-label": L,
|
|
@@ -510,9 +510,9 @@ const Me = (o) => {
|
|
|
510
510
|
$(), t.onDismiss == null || t.onDismiss.call(t, t);
|
|
511
511
|
},
|
|
512
512
|
className: z(m == null ? void 0 : m.closeButton, t == null || (n = t.classNames) == null ? void 0 : n.closeButton)
|
|
513
|
-
}, (At =
|
|
513
|
+
}, (At = w == null ? void 0 : w.close) != null ? At : be) : null, (D || t.icon || t.promise) && t.icon !== null && ((w == null ? void 0 : w[D]) !== null || t.icon) ? /* @__PURE__ */ s.createElement("div", {
|
|
514
514
|
"data-icon": "",
|
|
515
|
-
className: z(m == null ? void 0 : m.icon, t == null || (
|
|
515
|
+
className: z(m == null ? void 0 : m.icon, t == null || (y = t.classNames) == null ? void 0 : y.icon)
|
|
516
516
|
}, t.promise || t.type === "loading" && !t.icon ? t.icon || Jt() : null, t.type !== "loading" ? Zt : null) : null, /* @__PURE__ */ s.createElement("div", {
|
|
517
517
|
"data-content": "",
|
|
518
518
|
className: z(m == null ? void 0 : m.content, t == null || (d = t.classNames) == null ? void 0 : d.content)
|
|
@@ -521,7 +521,7 @@ const Me = (o) => {
|
|
|
521
521
|
className: z(m == null ? void 0 : m.title, t == null || (c = t.classNames) == null ? void 0 : c.title)
|
|
522
522
|
}, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ s.createElement("div", {
|
|
523
523
|
"data-description": "",
|
|
524
|
-
className: z(wt, Wt, m == null ? void 0 : m.description, t == null || (
|
|
524
|
+
className: z(wt, Wt, m == null ? void 0 : m.description, t == null || (b = t.classNames) == null ? void 0 : b.description)
|
|
525
525
|
}, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ s.isValidElement(t.cancel) ? t.cancel : t.cancel && ht(t.cancel) ? /* @__PURE__ */ s.createElement("button", {
|
|
526
526
|
"data-button": !0,
|
|
527
527
|
"data-cancel": !0,
|
|
@@ -529,7 +529,7 @@ const Me = (o) => {
|
|
|
529
529
|
onClick: (r) => {
|
|
530
530
|
ht(t.cancel) && J && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, r), $());
|
|
531
531
|
},
|
|
532
|
-
className: z(m == null ? void 0 : m.cancelButton, t == null || (
|
|
532
|
+
className: z(m == null ? void 0 : m.cancelButton, t == null || (v = t.classNames) == null ? void 0 : v.cancelButton)
|
|
533
533
|
}, t.cancel.label) : null, /* @__PURE__ */ s.isValidElement(t.action) ? t.action : t.action && ht(t.action) ? /* @__PURE__ */ s.createElement("button", {
|
|
534
534
|
"data-button": !0,
|
|
535
535
|
"data-action": !0,
|
|
@@ -545,38 +545,38 @@ function Lt() {
|
|
|
545
545
|
const o = document.documentElement.getAttribute("dir");
|
|
546
546
|
return o === "auto" || !o ? window.getComputedStyle(document.documentElement).direction : o;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Ae(o, a) {
|
|
549
549
|
const e = {};
|
|
550
550
|
return [
|
|
551
551
|
o,
|
|
552
552
|
a
|
|
553
|
-
].forEach((n,
|
|
554
|
-
const d =
|
|
555
|
-
function
|
|
553
|
+
].forEach((n, y) => {
|
|
554
|
+
const d = y === 1, c = d ? "--mobile-offset" : "--offset", b = d ? De : Se;
|
|
555
|
+
function v(i) {
|
|
556
556
|
[
|
|
557
557
|
"top",
|
|
558
558
|
"right",
|
|
559
559
|
"bottom",
|
|
560
560
|
"left"
|
|
561
|
-
].forEach((
|
|
562
|
-
e[`${c}-${
|
|
561
|
+
].forEach((g) => {
|
|
562
|
+
e[`${c}-${g}`] = typeof i == "number" ? `${i}px` : i;
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
|
-
typeof n == "number" || typeof n == "string" ?
|
|
565
|
+
typeof n == "number" || typeof n == "string" ? v(n) : typeof n == "object" ? [
|
|
566
566
|
"top",
|
|
567
567
|
"right",
|
|
568
568
|
"bottom",
|
|
569
569
|
"left"
|
|
570
570
|
].forEach((i) => {
|
|
571
|
-
n[i] === void 0 ? e[`${c}-${i}`] =
|
|
572
|
-
}) : b
|
|
571
|
+
n[i] === void 0 ? e[`${c}-${i}`] = b : e[`${c}-${i}`] = typeof n[i] == "number" ? `${n[i]}px` : n[i];
|
|
572
|
+
}) : v(b);
|
|
573
573
|
}), e;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
const { id: n, invert:
|
|
575
|
+
const ze = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
576
|
+
const { id: n, invert: y, position: d = "bottom-right", hotkey: c = [
|
|
577
577
|
"altKey",
|
|
578
578
|
"KeyT"
|
|
579
|
-
], expand:
|
|
579
|
+
], expand: b, closeButton: v, className: i, offset: g, mobileOffset: t, theme: k = "light", richColors: H, duration: N, style: vt, visibleToasts: W = Ne, toastOptions: u, dir: rt = Lt(), gap: K = Ce, icons: it, containerAriaLabel: yt = "Notifications" } = a, [O, at] = s.useState([]), F = s.useMemo(() => n ? O.filter((l) => l.toasterId === n) : O.filter((l) => !l.toasterId), [
|
|
580
580
|
O,
|
|
581
581
|
n
|
|
582
582
|
]), xt = s.useMemo(() => Array.from(new Set([
|
|
@@ -584,16 +584,16 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
584
584
|
].concat(F.filter((l) => l.position).map((l) => l.position)))), [
|
|
585
585
|
F,
|
|
586
586
|
d
|
|
587
|
-
]), [lt, wt] = s.useState([]), [st, A] = s.useState(!1), [dt, ot] = s.useState(!1), [m,
|
|
588
|
-
at((
|
|
587
|
+
]), [lt, wt] = s.useState([]), [st, A] = s.useState(!1), [dt, ot] = s.useState(!1), [m, w] = s.useState(k !== "system" ? k : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), L = s.useRef(null), V = c.join("+").replace(/Key/g, "").replace(/Digit/g, ""), I = s.useRef(null), U = s.useRef(!1), ct = s.useCallback((l) => {
|
|
588
|
+
at((h) => {
|
|
589
589
|
var p;
|
|
590
|
-
return (p =
|
|
590
|
+
return (p = h.find((C) => C.id === l.id)) != null && p.delete || S.dismiss(l.id), h.filter(({ id: C }) => C !== l.id);
|
|
591
591
|
});
|
|
592
592
|
}, []);
|
|
593
593
|
return s.useEffect(() => S.subscribe((l) => {
|
|
594
594
|
if (l.dismiss) {
|
|
595
595
|
requestAnimationFrame(() => {
|
|
596
|
-
at((
|
|
596
|
+
at((h) => h.map((p) => p.id === l.id ? {
|
|
597
597
|
...p,
|
|
598
598
|
delete: !0
|
|
599
599
|
} : p));
|
|
@@ -601,19 +601,19 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
603
|
setTimeout(() => {
|
|
604
|
-
|
|
605
|
-
at((
|
|
606
|
-
const p =
|
|
604
|
+
ee.flushSync(() => {
|
|
605
|
+
at((h) => {
|
|
606
|
+
const p = h.findIndex((C) => C.id === l.id);
|
|
607
607
|
return p !== -1 ? [
|
|
608
|
-
...
|
|
608
|
+
...h.slice(0, p),
|
|
609
609
|
{
|
|
610
|
-
...
|
|
610
|
+
...h[p],
|
|
611
611
|
...l
|
|
612
612
|
},
|
|
613
|
-
...
|
|
613
|
+
...h.slice(p + 1)
|
|
614
614
|
] : [
|
|
615
615
|
l,
|
|
616
|
-
...
|
|
616
|
+
...h
|
|
617
617
|
];
|
|
618
618
|
});
|
|
619
619
|
});
|
|
@@ -621,39 +621,39 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
621
621
|
}), [
|
|
622
622
|
O
|
|
623
623
|
]), s.useEffect(() => {
|
|
624
|
-
if (
|
|
625
|
-
|
|
624
|
+
if (k !== "system") {
|
|
625
|
+
w(k);
|
|
626
626
|
return;
|
|
627
627
|
}
|
|
628
|
-
if (
|
|
628
|
+
if (k === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? w("dark") : w("light")), typeof window > "u") return;
|
|
629
629
|
const l = window.matchMedia("(prefers-color-scheme: dark)");
|
|
630
630
|
try {
|
|
631
|
-
l.addEventListener("change", ({ matches:
|
|
632
|
-
|
|
631
|
+
l.addEventListener("change", ({ matches: h }) => {
|
|
632
|
+
w(h ? "dark" : "light");
|
|
633
633
|
});
|
|
634
634
|
} catch {
|
|
635
635
|
l.addListener(({ matches: p }) => {
|
|
636
636
|
try {
|
|
637
|
-
|
|
637
|
+
w(p ? "dark" : "light");
|
|
638
638
|
} catch (C) {
|
|
639
639
|
console.error(C);
|
|
640
640
|
}
|
|
641
641
|
});
|
|
642
642
|
}
|
|
643
643
|
}, [
|
|
644
|
-
|
|
644
|
+
k
|
|
645
645
|
]), s.useEffect(() => {
|
|
646
646
|
O.length <= 1 && A(!1);
|
|
647
647
|
}, [
|
|
648
648
|
O
|
|
649
649
|
]), s.useEffect(() => {
|
|
650
|
-
const l = (
|
|
650
|
+
const l = (h) => {
|
|
651
651
|
var p;
|
|
652
|
-
if (c.every((f) =>
|
|
652
|
+
if (c.every((f) => h[f] || h.code === f)) {
|
|
653
653
|
var q;
|
|
654
654
|
A(!0), (q = L.current) == null || q.focus();
|
|
655
655
|
}
|
|
656
|
-
|
|
656
|
+
h.code === "Escape" && (document.activeElement === L.current || (p = L.current) != null && p.contains(document.activeElement)) && A(!1);
|
|
657
657
|
};
|
|
658
658
|
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
659
659
|
}, [
|
|
@@ -661,9 +661,9 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
661
661
|
]), s.useEffect(() => {
|
|
662
662
|
if (L.current)
|
|
663
663
|
return () => {
|
|
664
|
-
|
|
664
|
+
I.current && (I.current.focus({
|
|
665
665
|
preventScroll: !0
|
|
666
|
-
}),
|
|
666
|
+
}), I.current = null, U.current = !1);
|
|
667
667
|
};
|
|
668
668
|
}, [
|
|
669
669
|
L.current
|
|
@@ -676,7 +676,7 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
676
676
|
"aria-relevant": "additions text",
|
|
677
677
|
"aria-atomic": "false",
|
|
678
678
|
suppressHydrationWarning: !0
|
|
679
|
-
}, xt.map((l,
|
|
679
|
+
}, xt.map((l, h) => {
|
|
680
680
|
var p;
|
|
681
681
|
const [C, q] = l.split("-");
|
|
682
682
|
return F.length ? /* @__PURE__ */ s.createElement("ol", {
|
|
@@ -691,18 +691,18 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
691
691
|
"data-x-position": q,
|
|
692
692
|
style: {
|
|
693
693
|
"--front-toast-height": `${((p = lt[0]) == null ? void 0 : p.height) || 0}px`,
|
|
694
|
-
"--width": `${
|
|
694
|
+
"--width": `${_e}px`,
|
|
695
695
|
"--gap": `${K}px`,
|
|
696
696
|
...vt,
|
|
697
|
-
...
|
|
697
|
+
...Ae(g, t)
|
|
698
698
|
},
|
|
699
699
|
onBlur: (f) => {
|
|
700
|
-
U.current && !f.currentTarget.contains(f.relatedTarget) && (U.current = !1,
|
|
700
|
+
U.current && !f.currentTarget.contains(f.relatedTarget) && (U.current = !1, I.current && (I.current.focus({
|
|
701
701
|
preventScroll: !0
|
|
702
|
-
}),
|
|
702
|
+
}), I.current = null));
|
|
703
703
|
},
|
|
704
704
|
onFocus: (f) => {
|
|
705
|
-
f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || U.current || (U.current = !0,
|
|
705
|
+
f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || U.current || (U.current = !0, I.current = f.relatedTarget);
|
|
706
706
|
},
|
|
707
707
|
onMouseEnter: () => A(!0),
|
|
708
708
|
onMouseMove: () => A(!0),
|
|
@@ -714,20 +714,20 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
714
714
|
f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || ot(!0);
|
|
715
715
|
},
|
|
716
716
|
onPointerUp: () => ot(!1)
|
|
717
|
-
}, F.filter((f) => !f.position &&
|
|
717
|
+
}, F.filter((f) => !f.position && h === 0 || f.position === l).map((f, G) => {
|
|
718
718
|
var ut, mt;
|
|
719
|
-
return /* @__PURE__ */ s.createElement(
|
|
719
|
+
return /* @__PURE__ */ s.createElement(Be, {
|
|
720
720
|
key: f.id,
|
|
721
721
|
icons: it,
|
|
722
722
|
index: G,
|
|
723
723
|
toast: f,
|
|
724
724
|
defaultRichColors: H,
|
|
725
|
-
duration: (ut = u == null ? void 0 : u.duration) != null ? ut :
|
|
725
|
+
duration: (ut = u == null ? void 0 : u.duration) != null ? ut : N,
|
|
726
726
|
className: u == null ? void 0 : u.className,
|
|
727
727
|
descriptionClassName: u == null ? void 0 : u.descriptionClassName,
|
|
728
|
-
invert:
|
|
728
|
+
invert: y,
|
|
729
729
|
visibleToasts: W,
|
|
730
|
-
closeButton: (mt = u == null ? void 0 : u.closeButton) != null ? mt :
|
|
730
|
+
closeButton: (mt = u == null ? void 0 : u.closeButton) != null ? mt : v,
|
|
731
731
|
interacting: dt,
|
|
732
732
|
position: l,
|
|
733
733
|
style: u == null ? void 0 : u.style,
|
|
@@ -740,16 +740,16 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
740
740
|
toasts: F.filter((Q) => Q.position == f.position),
|
|
741
741
|
heights: lt.filter((Q) => Q.position == f.position),
|
|
742
742
|
setHeights: wt,
|
|
743
|
-
expandByDefault:
|
|
743
|
+
expandByDefault: b,
|
|
744
744
|
gap: K,
|
|
745
745
|
expanded: st,
|
|
746
746
|
swipeDirections: a.swipeDirections
|
|
747
747
|
});
|
|
748
748
|
})) : null;
|
|
749
749
|
}));
|
|
750
|
-
}),
|
|
750
|
+
}), He = {
|
|
751
751
|
info: /* @__PURE__ */ P(
|
|
752
|
-
|
|
752
|
+
le,
|
|
753
753
|
{
|
|
754
754
|
"aria-hidden": "true",
|
|
755
755
|
size: 20,
|
|
@@ -757,7 +757,7 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
success: /* @__PURE__ */ P(
|
|
760
|
-
|
|
760
|
+
ie,
|
|
761
761
|
{
|
|
762
762
|
"aria-hidden": "true",
|
|
763
763
|
size: 20,
|
|
@@ -765,7 +765,7 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
765
765
|
}
|
|
766
766
|
),
|
|
767
767
|
warning: /* @__PURE__ */ P(
|
|
768
|
-
|
|
768
|
+
re,
|
|
769
769
|
{
|
|
770
770
|
"aria-hidden": "true",
|
|
771
771
|
size: 20,
|
|
@@ -773,7 +773,7 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
775
|
error: /* @__PURE__ */ P(
|
|
776
|
-
|
|
776
|
+
ne,
|
|
777
777
|
{
|
|
778
778
|
"aria-hidden": "true",
|
|
779
779
|
size: 20,
|
|
@@ -783,7 +783,7 @@ const Ae = /* @__PURE__ */ s.forwardRef(function(a, e) {
|
|
|
783
783
|
};
|
|
784
784
|
let $t = "Close", Nt = !1;
|
|
785
785
|
const et = /* @__PURE__ */ new Set();
|
|
786
|
-
function
|
|
786
|
+
function Oe(o) {
|
|
787
787
|
const a = typeof document < "u" && document.documentElement.dir === "rtl";
|
|
788
788
|
return {
|
|
789
789
|
"top-start": a ? "top-right" : "top-left",
|
|
@@ -794,39 +794,42 @@ function He(o) {
|
|
|
794
794
|
"bottom-end": a ? "bottom-left" : "bottom-right"
|
|
795
795
|
}[o];
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function je({
|
|
798
798
|
position: o = "bottom-end",
|
|
799
799
|
offset: a = "var(--spacing-lg)",
|
|
800
800
|
gap: e = 8,
|
|
801
801
|
visibleToasts: n = 3,
|
|
802
|
-
className:
|
|
802
|
+
className: y
|
|
803
803
|
}) {
|
|
804
|
-
const { t: d } =
|
|
804
|
+
const { t: d } = ae();
|
|
805
805
|
$t = d("ui.common.close", "Close");
|
|
806
|
-
const [c] = Ot(() => Nt ? !1 : (Nt = !0, !0)), [
|
|
806
|
+
const [c] = Ot(() => Nt ? !1 : (Nt = !0, !0)), b = te(null), [v, i] = Ot(
|
|
807
807
|
() => typeof document < "u" && document.documentElement.dir || "ltr"
|
|
808
808
|
);
|
|
809
809
|
return jt(() => () => {
|
|
810
810
|
c && (Nt = !1);
|
|
811
811
|
}, [c]), jt(() => {
|
|
812
812
|
if (!c) return;
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const g = new MutationObserver(() => {
|
|
814
|
+
i(document.documentElement.dir || "ltr");
|
|
815
815
|
});
|
|
816
|
-
return
|
|
816
|
+
return g.observe(document.documentElement, {
|
|
817
817
|
attributes: !0,
|
|
818
818
|
attributeFilter: ["dir"]
|
|
819
|
-
}), () =>
|
|
819
|
+
}), () => g.disconnect();
|
|
820
820
|
}, [c]), c ? /* @__PURE__ */ P(
|
|
821
|
-
|
|
821
|
+
ze,
|
|
822
822
|
{
|
|
823
|
-
|
|
824
|
-
|
|
823
|
+
ref: (g) => {
|
|
824
|
+
b.current = g, g && g.setAttribute("data-component", "toast-region");
|
|
825
|
+
},
|
|
826
|
+
dir: v,
|
|
827
|
+
position: Oe(o),
|
|
825
828
|
richColors: !1,
|
|
826
829
|
visibleToasts: n,
|
|
827
830
|
gap: e,
|
|
828
831
|
offset: a,
|
|
829
|
-
className:
|
|
832
|
+
className: y,
|
|
830
833
|
toastOptions: {
|
|
831
834
|
unstyled: !0,
|
|
832
835
|
classNames: {
|
|
@@ -850,10 +853,10 @@ function Oe({
|
|
|
850
853
|
}
|
|
851
854
|
) : null;
|
|
852
855
|
}
|
|
853
|
-
|
|
854
|
-
function
|
|
856
|
+
je.displayName = "Toaster";
|
|
857
|
+
function Pe(o, a, e, n) {
|
|
855
858
|
return /* @__PURE__ */ Ht("div", { className: "ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
856
|
-
|
|
859
|
+
He[o],
|
|
857
860
|
/* @__PURE__ */ Ht("div", { className: "ds:flex-1 ds:min-w-0 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
858
861
|
/* @__PURE__ */ P("span", { dir: "auto", className: "type-label ds:leading-snug ds:break-words", children: a }),
|
|
859
862
|
n && /* @__PURE__ */ P(
|
|
@@ -866,9 +869,9 @@ function je(o, a, e, n) {
|
|
|
866
869
|
)
|
|
867
870
|
] }),
|
|
868
871
|
/* @__PURE__ */ P(
|
|
869
|
-
|
|
872
|
+
se,
|
|
870
873
|
{
|
|
871
|
-
icon: /* @__PURE__ */ P(
|
|
874
|
+
icon: /* @__PURE__ */ P(oe, {}),
|
|
872
875
|
intent: "ghost",
|
|
873
876
|
size: "sm",
|
|
874
877
|
"aria-label": $t,
|
|
@@ -879,21 +882,21 @@ function je(o, a, e, n) {
|
|
|
879
882
|
] });
|
|
880
883
|
}
|
|
881
884
|
function bt(o, a, e) {
|
|
882
|
-
const n = o === "error" ? 1 / 0 : 4e3,
|
|
883
|
-
et.add(
|
|
885
|
+
const n = o === "error" ? 1 / 0 : 4e3, y = `${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, d = Pe(o, a, y, e == null ? void 0 : e.description);
|
|
886
|
+
et.add(y);
|
|
884
887
|
const c = {
|
|
885
|
-
id:
|
|
888
|
+
id: y,
|
|
886
889
|
icon: null,
|
|
887
890
|
duration: (e == null ? void 0 : e.duration) ?? n,
|
|
888
891
|
action: e != null && e.action ? { label: e.action.label, onClick: e.action.onClick } : void 0,
|
|
889
892
|
cancel: e != null && e.cancel ? { label: e.cancel.label, onClick: e.cancel.onClick } : void 0,
|
|
890
893
|
onDismiss: () => {
|
|
891
|
-
var
|
|
892
|
-
et.delete(
|
|
894
|
+
var b;
|
|
895
|
+
et.delete(y), (b = e == null ? void 0 : e.onDismiss) == null || b.call(e);
|
|
893
896
|
},
|
|
894
897
|
onAutoClose: () => {
|
|
895
|
-
var
|
|
896
|
-
et.delete(
|
|
898
|
+
var b;
|
|
899
|
+
et.delete(y), (b = e == null ? void 0 : e.onAutoClose) == null || b.call(e);
|
|
897
900
|
}
|
|
898
901
|
};
|
|
899
902
|
switch (o) {
|
|
@@ -909,19 +912,19 @@ function bt(o, a, e) {
|
|
|
909
912
|
return Y(d, c);
|
|
910
913
|
}
|
|
911
914
|
}
|
|
912
|
-
function
|
|
915
|
+
function Qe(o, a) {
|
|
913
916
|
return bt("info", o, a);
|
|
914
917
|
}
|
|
915
|
-
function
|
|
918
|
+
function Je(o, a) {
|
|
916
919
|
return bt("success", o, a);
|
|
917
920
|
}
|
|
918
|
-
function
|
|
921
|
+
function Ze(o, a) {
|
|
919
922
|
return bt("warning", o, a);
|
|
920
923
|
}
|
|
921
|
-
function
|
|
924
|
+
function ta(o, a) {
|
|
922
925
|
return bt("error", o, a);
|
|
923
926
|
}
|
|
924
|
-
const
|
|
927
|
+
const ea = {
|
|
925
928
|
getVisibleToasts: () => Array.from(et).map((o) => ({ id: o })),
|
|
926
929
|
dismiss: (o) => {
|
|
927
930
|
et.delete(o), Y.dismiss(o);
|
|
@@ -929,7 +932,7 @@ const ta = {
|
|
|
929
932
|
dismissAll: () => {
|
|
930
933
|
et.clear(), Y.dismiss();
|
|
931
934
|
}
|
|
932
|
-
},
|
|
935
|
+
}, aa = {
|
|
933
936
|
id: "toast",
|
|
934
937
|
capabilities: ["dismiss", "open", "close"],
|
|
935
938
|
state: {
|
|
@@ -972,12 +975,12 @@ const ta = {
|
|
|
972
975
|
}
|
|
973
976
|
};
|
|
974
977
|
export {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
978
|
+
je as T,
|
|
979
|
+
ea as a,
|
|
980
|
+
ta as b,
|
|
981
|
+
Qe as c,
|
|
982
|
+
Je as d,
|
|
983
|
+
Ze as e,
|
|
984
|
+
aa as t
|
|
982
985
|
};
|
|
983
|
-
//# sourceMappingURL=toast.agent-
|
|
986
|
+
//# sourceMappingURL=toast.agent-DihA6MON.js.map
|