welcome-ui 10.0.0-alpha.1 → 10.0.0-alpha.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/README.md +1 -1
- package/dist/{2W3RN7C5-bkX-rIa3.js → 2W3RN7C5-uG7eBeTQ.js} +11 -11
- package/dist/4I4MLMKD-z3Xm3qCo.js +150 -0
- package/dist/Accordion.js +4 -4
- package/dist/Alert.js +1 -1
- package/dist/AspectRatio.js +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/{B7UTNDHN-BlIblHCu.js → B7UTNDHN-BDa2-8JK.js} +2 -2
- package/dist/Badge.js +1 -1
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +165 -151
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup.js +1 -1
- package/dist/Card.js +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/CloseButton.css +1 -1
- package/dist/CloseButton.js +12 -12
- package/dist/{DSAASPLT-BaaCUKsb.js → DSAASPLT-C-2xDjIv.js} +3 -3
- package/dist/DatePicker.js +2 -2
- package/dist/DateTimePicker.js +2 -2
- package/dist/Drawer.js +25 -22
- package/dist/DropdownMenu.js +41 -41
- package/dist/Field.js +1 -1
- package/dist/FieldGroup.js +1 -1
- package/dist/FileDrop.js +2 -2
- package/dist/FileUpload.js +1 -1
- package/dist/GVVKDT6A-C66-lr0B.js +619 -0
- package/dist/Hint.js +1 -1
- package/dist/Icon.css +1 -1
- package/dist/Icon.js +32 -24
- package/dist/InputText.js +1 -1
- package/dist/{KPUWHTQJ-D2TPji47.js → KPUWHTQJ-Byij2al4.js} +11 -11
- package/dist/Label.js +1 -1
- package/dist/Link.js +20 -19
- package/dist/Loader.js +1 -1
- package/dist/Logo.js +1 -1
- package/dist/Modal.js +5 -5
- package/dist/{NI3IVY7K-Ztb3-XAv.js → NI3IVY7K-DpF3td-7.js} +115 -115
- package/dist/{NMGNQVTG-C6TqBngP.js → NMGNQVTG-BgAqqGOq.js} +6 -6
- package/dist/{OE2EFRVA-C3721cM3.js → OE2EFRVA-DkdhQLJL.js} +27 -27
- package/dist/{OLVWQA7U-DysaSaZj.js → OLVWQA7U-wHytlFYu.js} +30 -30
- package/dist/Pagination.css +1 -1
- package/dist/Pagination.js +155 -76
- package/dist/Popover.js +21 -21
- package/dist/{RTNCFSKZ-qpPg689E.js → RTNCFSKZ-LcIdBwa8.js} +16 -16
- package/dist/Radio.js +2 -2
- package/dist/RadioGroup.js +4 -4
- package/dist/RadioTab.js +2 -2
- package/dist/{SBSPVDDI-DJKkC1eb.js → SBSPVDDI-BoxPz2JY.js} +22 -22
- package/dist/{SQZLCNLX-CHDXnZ16.js → SQZLCNLX-CUlXoT69.js} +8 -8
- package/dist/Search.js +2 -2
- package/dist/Select.js +2 -2
- package/dist/Slider.js +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Swiper.js +1 -1
- package/dist/{T22PY7TE-C1N0q8Kn.js → T22PY7TE-CzEDuEn1.js} +21 -21
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +23 -23
- package/dist/Tag.js +1 -1
- package/dist/Text.js +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/TimePicker.js +2 -2
- package/dist/Toast.css +1 -1
- package/dist/Toast.js +286 -222
- package/dist/Toggle.js +2 -2
- package/dist/Tooltip.css +1 -1
- package/dist/Tooltip.js +118 -129
- package/dist/VariantIcon.js +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/WelcomeLoader.js +1 -1
- package/dist/{XCKGTAUF-DkxWCbaW.js → XCKGTAUF-CahZE721.js} +4 -4
- package/dist/{Y67KZUMI-DFEgrUv2.js → Y67KZUMI-BDyUNSJw.js} +5 -5
- package/dist/{ZTXFEM5L-CkrIQCN1.js → ZTXFEM5L-CjFLRObi.js} +3 -3
- package/dist/{downshift.esm-D_6pHXkq.js → downshift.esm-xtYanIDi.js} +1 -1
- package/dist/scss/breakpoints.scss +9 -0
- package/dist/scss/text-ellipsis.scss +5 -0
- package/dist/scss/texts.scss +108 -0
- package/dist/theme.css +1 -1
- package/dist/{tslib.es6-DpB4Y59c.js → tslib.es6-C80jYMbM.js} +1 -1
- package/dist/types/components/Breadcrumb/types.d.ts +5 -1
- package/dist/types/components/Drawer/AssetDrawer/types.d.ts +3 -0
- package/dist/types/components/Drawer/components/Backdrop.d.ts +1 -1
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Icon/icons.d.ts +4 -5
- package/dist/types/components/Icon/types.d.ts +2 -0
- package/dist/types/components/Pagination/types.d.ts +11 -0
- package/dist/types/components/Toast/components/Growl.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +4 -1
- package/dist/types/components/Toast/types.d.ts +8 -9
- package/dist/types/components/Tooltip/types.d.ts +1 -1
- package/dist/types/theme/types.d.ts +22 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/{utils-DileZjMm.js → utils-BD597oo6.js} +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -1
- package/dist/4I4MLMKD-BLxAidnq.js +0 -43
- package/dist/GVVKDT6A-bET6V7Py.js +0 -724
- package/dist/index.css +0 -0
- package/dist/types/components/Icon/Icon.d.ts +0 -2
- package/dist/types/utils/theme/index.d.ts +0 -0
- /package/dist/{index-CdiHdiVB.js → index-PAaZGbyz.js} +0 -0
- /package/dist/types/components/Icon/{Icon.test.d.ts → index.test.d.ts} +0 -0
package/dist/Toast.js
CHANGED
|
@@ -1,78 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsxs as N, jsx as y, Fragment as B } from "react/jsx-runtime";
|
|
3
3
|
import * as f from "react";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { useRef as Y, useCallback as z, useEffect as S, useState as de, forwardRef as Z, cloneElement as pe } from "react";
|
|
5
|
+
import { c as L } from "./index-PAaZGbyz.js";
|
|
6
|
+
import { Button as K } from "./Button.js";
|
|
7
|
+
import { CloseButton as Q } from "./CloseButton.js";
|
|
8
|
+
import { Icon as V } from "./Icon.js";
|
|
9
|
+
import { Text as P } from "./Text.js";
|
|
10
|
+
import { f as J } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
11
|
+
let me = { data: "" }, ue = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || me, fe = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, ge = /\/\*[^]*?\*\/| +/g, W = /\n+/g, w = (e, t) => {
|
|
12
|
+
let r = "", s = "", i = "";
|
|
11
13
|
for (let o in e) {
|
|
12
|
-
let
|
|
13
|
-
o[0] == "@" ? o[1] == "i" ?
|
|
14
|
+
let a = e[o];
|
|
15
|
+
o[0] == "@" ? o[1] == "i" ? r = o + " " + a + ";" : s += o[1] == "f" ? w(a, o) : o + "{" + w(a, o[1] == "k" ? "" : t) + "}" : typeof a == "object" ? s += w(a, t ? t.replace(/([^,])+/g, (n) => o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, n) : n ? n + " " + l : l)) : o) : a != null && (o = /^--/.test(o) ? o : o.replace(/[A-Z]/g, "-$&").toLowerCase(), i += w.p ? w.p(o, a) : o + ":" + a + ";");
|
|
14
16
|
}
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
+
return r + (t && i ? t + "{" + i + "}" : i) + s;
|
|
18
|
+
}, v = {}, X = (e) => {
|
|
17
19
|
if (typeof e == "object") {
|
|
18
20
|
let t = "";
|
|
19
|
-
for (let
|
|
21
|
+
for (let r in e) t += r + X(e[r]);
|
|
20
22
|
return t;
|
|
21
23
|
}
|
|
22
24
|
return e;
|
|
23
|
-
},
|
|
24
|
-
let o =
|
|
25
|
-
let
|
|
26
|
-
for (;
|
|
27
|
-
return "go" +
|
|
25
|
+
}, ye = (e, t, r, s, i) => {
|
|
26
|
+
let o = X(e), a = v[o] || (v[o] = ((l) => {
|
|
27
|
+
let c = 0, d = 11;
|
|
28
|
+
for (; c < l.length; ) d = 101 * d + l.charCodeAt(c++) >>> 0;
|
|
29
|
+
return "go" + d;
|
|
28
30
|
})(o));
|
|
29
|
-
if (!
|
|
30
|
-
let l = o !== e ? e : ((
|
|
31
|
-
let
|
|
32
|
-
for (;
|
|
33
|
-
return
|
|
31
|
+
if (!v[a]) {
|
|
32
|
+
let l = o !== e ? e : ((c) => {
|
|
33
|
+
let d, p, u = [{}];
|
|
34
|
+
for (; d = fe.exec(c.replace(ge, "")); ) d[4] ? u.shift() : d[3] ? (p = d[3].replace(W, " ").trim(), u.unshift(u[0][p] = u[0][p] || {})) : u[0][d[1]] = d[2].replace(W, " ").trim();
|
|
35
|
+
return u[0];
|
|
34
36
|
})(e);
|
|
35
|
-
|
|
37
|
+
v[a] = w(i ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
|
|
36
38
|
}
|
|
37
|
-
let n =
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
})(
|
|
41
|
-
},
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
44
|
-
let n = r
|
|
45
|
-
|
|
39
|
+
let n = r && v.g ? v.g : null;
|
|
40
|
+
return r && (v.g = v[a]), ((l, c, d, p) => {
|
|
41
|
+
p ? c.data = c.data.replace(p, l) : c.data.indexOf(l) === -1 && (c.data = d ? l + c.data : c.data + l);
|
|
42
|
+
})(v[a], t, s, n), a;
|
|
43
|
+
}, be = (e, t, r) => e.reduce((s, i, o) => {
|
|
44
|
+
let a = t[o];
|
|
45
|
+
if (a && a.call) {
|
|
46
|
+
let n = a(r), l = n && n.props && n.props.className || /^go/.test(n) && n;
|
|
47
|
+
a = l ? "." + l : n && typeof n == "object" ? n.props ? "" : w(n, "") : n === !1 ? "" : n;
|
|
46
48
|
}
|
|
47
|
-
return s + i + (
|
|
49
|
+
return s + i + (a ?? "");
|
|
48
50
|
}, "");
|
|
49
|
-
function
|
|
50
|
-
let t = this || {},
|
|
51
|
-
return
|
|
51
|
+
function q(e) {
|
|
52
|
+
let t = this || {}, r = e.call ? e(t.p) : e;
|
|
53
|
+
return ye(r.unshift ? r.raw ? be(r, [].slice.call(arguments, 1), t.p) : r.reduce((s, i) => Object.assign(s, i && i.call ? i(t.p) : i), {}) : r, ue(t.target), t.g, t.o, t.k);
|
|
52
54
|
}
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
function
|
|
57
|
-
|
|
55
|
+
let ee, R, F;
|
|
56
|
+
q.bind({ g: 1 });
|
|
57
|
+
let x = q.bind({ k: 1 });
|
|
58
|
+
function he(e, t, r, s) {
|
|
59
|
+
w.p = t, ee = e, R = r, F = s;
|
|
58
60
|
}
|
|
59
|
-
function
|
|
60
|
-
let
|
|
61
|
+
function _(e, t) {
|
|
62
|
+
let r = this || {};
|
|
61
63
|
return function() {
|
|
62
64
|
let s = arguments;
|
|
63
|
-
function i(o,
|
|
65
|
+
function i(o, a) {
|
|
64
66
|
let n = Object.assign({}, o), l = n.className || i.className;
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
return e[0] && (
|
|
67
|
+
r.p = Object.assign({ theme: R && R() }, n), r.o = / *go\d+/.test(l), n.className = q.apply(r, s) + (l ? " " + l : "");
|
|
68
|
+
let c = e;
|
|
69
|
+
return e[0] && (c = n.as || e, delete n.as), F && c[0] && F(n), ee(c, n);
|
|
68
70
|
}
|
|
69
71
|
return i;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
|
-
var
|
|
74
|
+
var ve = (e) => typeof e == "function", D = (e, t) => ve(e) ? e(t) : e, xe = /* @__PURE__ */ (() => {
|
|
73
75
|
let e = 0;
|
|
74
76
|
return () => (++e).toString();
|
|
75
|
-
})(),
|
|
77
|
+
})(), te = /* @__PURE__ */ (() => {
|
|
76
78
|
let e;
|
|
77
79
|
return () => {
|
|
78
80
|
if (e === void 0 && typeof window < "u") {
|
|
@@ -81,115 +83,115 @@ var ge = (e) => typeof e == "function", C = (e, t) => ge(e) ? e(t) : e, ye = /*
|
|
|
81
83
|
}
|
|
82
84
|
return e;
|
|
83
85
|
};
|
|
84
|
-
})(),
|
|
85
|
-
let { toastLimit:
|
|
86
|
+
})(), we = 20, M = "default", re = (e, t) => {
|
|
87
|
+
let { toastLimit: r } = e.settings;
|
|
86
88
|
switch (t.type) {
|
|
87
89
|
case 0:
|
|
88
|
-
return { ...e, toasts: [t.toast, ...e.toasts].slice(0,
|
|
90
|
+
return { ...e, toasts: [t.toast, ...e.toasts].slice(0, r) };
|
|
89
91
|
case 1:
|
|
90
|
-
return { ...e, toasts: e.toasts.map((
|
|
92
|
+
return { ...e, toasts: e.toasts.map((a) => a.id === t.toast.id ? { ...a, ...t.toast } : a) };
|
|
91
93
|
case 2:
|
|
92
94
|
let { toast: s } = t;
|
|
93
|
-
return
|
|
95
|
+
return re(e, { type: e.toasts.find((a) => a.id === s.id) ? 1 : 0, toast: s });
|
|
94
96
|
case 3:
|
|
95
97
|
let { toastId: i } = t;
|
|
96
|
-
return { ...e, toasts: e.toasts.map((
|
|
98
|
+
return { ...e, toasts: e.toasts.map((a) => a.id === i || i === void 0 ? { ...a, dismissed: !0, visible: !1 } : a) };
|
|
97
99
|
case 4:
|
|
98
|
-
return t.toastId === void 0 ? { ...e, toasts: [] } : { ...e, toasts: e.toasts.filter((
|
|
100
|
+
return t.toastId === void 0 ? { ...e, toasts: [] } : { ...e, toasts: e.toasts.filter((a) => a.id !== t.toastId) };
|
|
99
101
|
case 5:
|
|
100
102
|
return { ...e, pausedAt: t.time };
|
|
101
103
|
case 6:
|
|
102
104
|
let o = t.time - (e.pausedAt || 0);
|
|
103
|
-
return { ...e, pausedAt: void 0, toasts: e.toasts.map((
|
|
105
|
+
return { ...e, pausedAt: void 0, toasts: e.toasts.map((a) => ({ ...a, pauseDuration: a.pauseDuration + o })) };
|
|
104
106
|
}
|
|
105
|
-
},
|
|
106
|
-
h[t] =
|
|
107
|
-
|
|
107
|
+
}, C = [], ae = { toasts: [], pausedAt: void 0, settings: { toastLimit: we } }, h = {}, se = (e, t = M) => {
|
|
108
|
+
h[t] = re(h[t] || ae, e), C.forEach(([r, s]) => {
|
|
109
|
+
r === t && s(h[t]);
|
|
108
110
|
});
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
let [
|
|
113
|
-
|
|
114
|
-
let
|
|
115
|
-
|
|
111
|
+
}, oe = (e) => Object.keys(h).forEach((t) => se(e, t)), _e = (e) => Object.keys(h).find((t) => h[t].toasts.some((r) => r.id === e)), A = (e = M) => (t) => {
|
|
112
|
+
se(t, e);
|
|
113
|
+
}, je = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, ze = (e = {}, t = M) => {
|
|
114
|
+
let [r, s] = de(h[t] || ae), i = Y(h[t]);
|
|
115
|
+
S(() => (i.current !== h[t] && s(h[t]), C.push([t, s]), () => {
|
|
116
|
+
let a = C.findIndex(([n]) => n === t);
|
|
117
|
+
a > -1 && C.splice(a, 1);
|
|
116
118
|
}), [t]);
|
|
117
|
-
let o =
|
|
118
|
-
var n, l,
|
|
119
|
-
return { ...e, ...e[
|
|
119
|
+
let o = r.toasts.map((a) => {
|
|
120
|
+
var n, l, c;
|
|
121
|
+
return { ...e, ...e[a.type], ...a, removeDelay: a.removeDelay || ((n = e[a.type]) == null ? void 0 : n.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: a.duration || ((l = e[a.type]) == null ? void 0 : l.duration) || (e == null ? void 0 : e.duration) || je[a.type], style: { ...e.style, ...(c = e[a.type]) == null ? void 0 : c.style, ...a.style } };
|
|
120
122
|
});
|
|
121
|
-
return { ...
|
|
122
|
-
},
|
|
123
|
-
let s =
|
|
124
|
-
return
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
let
|
|
132
|
-
t ?
|
|
123
|
+
return { ...r, toasts: o };
|
|
124
|
+
}, Ne = (e, t = "blank", r) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: t, ariaProps: { role: "status", "aria-live": "polite" }, message: e, pauseDuration: 0, ...r, id: (r == null ? void 0 : r.id) || xe() }), $ = (e) => (t, r) => {
|
|
125
|
+
let s = Ne(t, e, r);
|
|
126
|
+
return A(s.toasterId || _e(s.id))({ type: 2, toast: s }), s.id;
|
|
127
|
+
}, m = (e, t) => $("blank")(e, t);
|
|
128
|
+
m.error = $("error");
|
|
129
|
+
m.success = $("success");
|
|
130
|
+
m.loading = $("loading");
|
|
131
|
+
m.custom = $("custom");
|
|
132
|
+
m.dismiss = (e, t) => {
|
|
133
|
+
let r = { type: 3, toastId: e };
|
|
134
|
+
t ? A(t)(r) : oe(r);
|
|
133
135
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
let
|
|
137
|
-
t ?
|
|
136
|
+
m.dismissAll = (e) => m.dismiss(void 0, e);
|
|
137
|
+
m.remove = (e, t) => {
|
|
138
|
+
let r = { type: 4, toastId: e };
|
|
139
|
+
t ? A(t)(r) : oe(r);
|
|
138
140
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
let s =
|
|
141
|
+
m.removeAll = (e) => m.remove(void 0, e);
|
|
142
|
+
m.promise = (e, t, r) => {
|
|
143
|
+
let s = m.loading(t.loading, { ...r, ...r == null ? void 0 : r.loading });
|
|
142
144
|
return typeof e == "function" && (e = e()), e.then((i) => {
|
|
143
|
-
let o = t.success ?
|
|
144
|
-
return o ?
|
|
145
|
+
let o = t.success ? D(t.success, i) : void 0;
|
|
146
|
+
return o ? m.success(o, { id: s, ...r, ...r == null ? void 0 : r.success }) : m.dismiss(s), i;
|
|
145
147
|
}).catch((i) => {
|
|
146
|
-
let o = t.error ?
|
|
147
|
-
o ?
|
|
148
|
+
let o = t.error ? D(t.error, i) : void 0;
|
|
149
|
+
o ? m.error(o, { id: s, ...r, ...r == null ? void 0 : r.error }) : m.dismiss(s);
|
|
148
150
|
}), e;
|
|
149
151
|
};
|
|
150
|
-
var ke = 1e3,
|
|
151
|
-
let { toasts:
|
|
152
|
-
if (i.has(
|
|
152
|
+
var ke = 1e3, $e = (e, t = "default") => {
|
|
153
|
+
let { toasts: r, pausedAt: s } = ze(e, t), i = Y(/* @__PURE__ */ new Map()).current, o = z((p, u = ke) => {
|
|
154
|
+
if (i.has(p)) return;
|
|
153
155
|
let g = setTimeout(() => {
|
|
154
|
-
i.delete(
|
|
155
|
-
},
|
|
156
|
-
i.set(
|
|
156
|
+
i.delete(p), a({ type: 4, toastId: p });
|
|
157
|
+
}, u);
|
|
158
|
+
i.set(p, g);
|
|
157
159
|
}, []);
|
|
158
|
-
|
|
160
|
+
S(() => {
|
|
159
161
|
if (s) return;
|
|
160
|
-
let
|
|
162
|
+
let p = Date.now(), u = r.map((g) => {
|
|
161
163
|
if (g.duration === 1 / 0) return;
|
|
162
|
-
let E = (g.duration || 0) + g.pauseDuration - (
|
|
164
|
+
let E = (g.duration || 0) + g.pauseDuration - (p - g.createdAt);
|
|
163
165
|
if (E < 0) {
|
|
164
|
-
g.visible &&
|
|
166
|
+
g.visible && m.dismiss(g.id);
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
|
-
return setTimeout(() =>
|
|
169
|
+
return setTimeout(() => m.dismiss(g.id, t), E);
|
|
168
170
|
});
|
|
169
171
|
return () => {
|
|
170
|
-
|
|
172
|
+
u.forEach((g) => g && clearTimeout(g));
|
|
171
173
|
};
|
|
172
|
-
}, [
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
}, [
|
|
176
|
-
|
|
177
|
-
}, [
|
|
178
|
-
s &&
|
|
179
|
-
}, [s,
|
|
180
|
-
let { reverseOrder: g = !1, gutter: E = 8, defaultPosition:
|
|
181
|
-
return
|
|
182
|
-
}, [
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
if (
|
|
174
|
+
}, [r, s, t]);
|
|
175
|
+
let a = z(A(t), [t]), n = z(() => {
|
|
176
|
+
a({ type: 5, time: Date.now() });
|
|
177
|
+
}, [a]), l = z((p, u) => {
|
|
178
|
+
a({ type: 1, toast: { id: p, height: u } });
|
|
179
|
+
}, [a]), c = z(() => {
|
|
180
|
+
s && a({ type: 6, time: Date.now() });
|
|
181
|
+
}, [s, a]), d = z((p, u) => {
|
|
182
|
+
let { reverseOrder: g = !1, gutter: E = 8, defaultPosition: G } = u || {}, I = r.filter((b) => (b.position || G) === (p.position || G) && b.height), ce = I.findIndex((b) => b.id === p.id), U = I.filter((b, T) => T < ce && b.visible).length;
|
|
183
|
+
return I.filter((b) => b.visible).slice(...g ? [U + 1] : [0, U]).reduce((b, T) => b + (T.height || 0) + E, 0);
|
|
184
|
+
}, [r]);
|
|
185
|
+
return S(() => {
|
|
186
|
+
r.forEach((p) => {
|
|
187
|
+
if (p.dismissed) o(p.id, p.removeDelay);
|
|
186
188
|
else {
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
+
let u = i.get(p.id);
|
|
190
|
+
u && (clearTimeout(u), i.delete(p.id));
|
|
189
191
|
}
|
|
190
192
|
});
|
|
191
|
-
}, [
|
|
192
|
-
},
|
|
193
|
+
}, [r, o]), { toasts: r, handlers: { updateHeight: l, startPause: n, endPause: c, calculateOffset: d } };
|
|
194
|
+
}, Ee = x`
|
|
193
195
|
from {
|
|
194
196
|
transform: scale(0) rotate(45deg);
|
|
195
197
|
opacity: 0;
|
|
@@ -197,7 +199,7 @@ from {
|
|
|
197
199
|
to {
|
|
198
200
|
transform: scale(1) rotate(45deg);
|
|
199
201
|
opacity: 1;
|
|
200
|
-
}`,
|
|
202
|
+
}`, Oe = x`
|
|
201
203
|
from {
|
|
202
204
|
transform: scale(0);
|
|
203
205
|
opacity: 0;
|
|
@@ -205,7 +207,7 @@ from {
|
|
|
205
207
|
to {
|
|
206
208
|
transform: scale(1);
|
|
207
209
|
opacity: 1;
|
|
208
|
-
}`,
|
|
210
|
+
}`, Ce = x`
|
|
209
211
|
from {
|
|
210
212
|
transform: scale(0) rotate(90deg);
|
|
211
213
|
opacity: 0;
|
|
@@ -213,7 +215,7 @@ from {
|
|
|
213
215
|
to {
|
|
214
216
|
transform: scale(1) rotate(90deg);
|
|
215
217
|
opacity: 1;
|
|
216
|
-
}`,
|
|
218
|
+
}`, De = _("div")`
|
|
217
219
|
width: 20px;
|
|
218
220
|
opacity: 0;
|
|
219
221
|
height: 20px;
|
|
@@ -222,14 +224,14 @@ to {
|
|
|
222
224
|
position: relative;
|
|
223
225
|
transform: rotate(45deg);
|
|
224
226
|
|
|
225
|
-
animation: ${
|
|
227
|
+
animation: ${Ee} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
226
228
|
forwards;
|
|
227
229
|
animation-delay: 100ms;
|
|
228
230
|
|
|
229
231
|
&:after,
|
|
230
232
|
&:before {
|
|
231
233
|
content: '';
|
|
232
|
-
animation: ${
|
|
234
|
+
animation: ${Oe} 0.15s ease-out forwards;
|
|
233
235
|
animation-delay: 150ms;
|
|
234
236
|
position: absolute;
|
|
235
237
|
border-radius: 3px;
|
|
@@ -242,18 +244,18 @@ to {
|
|
|
242
244
|
}
|
|
243
245
|
|
|
244
246
|
&:before {
|
|
245
|
-
animation: ${
|
|
247
|
+
animation: ${Ce} 0.15s ease-out forwards;
|
|
246
248
|
animation-delay: 180ms;
|
|
247
249
|
transform: rotate(90deg);
|
|
248
250
|
}
|
|
249
|
-
`,
|
|
251
|
+
`, qe = x`
|
|
250
252
|
from {
|
|
251
253
|
transform: rotate(0deg);
|
|
252
254
|
}
|
|
253
255
|
to {
|
|
254
256
|
transform: rotate(360deg);
|
|
255
257
|
}
|
|
256
|
-
`,
|
|
258
|
+
`, Ae = _("div")`
|
|
257
259
|
width: 12px;
|
|
258
260
|
height: 12px;
|
|
259
261
|
box-sizing: border-box;
|
|
@@ -261,8 +263,8 @@ to {
|
|
|
261
263
|
border-radius: 100%;
|
|
262
264
|
border-color: ${(e) => e.secondary || "#e0e0e0"};
|
|
263
265
|
border-right-color: ${(e) => e.primary || "#616161"};
|
|
264
|
-
animation: ${
|
|
265
|
-
`,
|
|
266
|
+
animation: ${qe} 1s linear infinite;
|
|
267
|
+
`, Ie = x`
|
|
266
268
|
from {
|
|
267
269
|
transform: scale(0) rotate(45deg);
|
|
268
270
|
opacity: 0;
|
|
@@ -270,7 +272,7 @@ from {
|
|
|
270
272
|
to {
|
|
271
273
|
transform: scale(1) rotate(45deg);
|
|
272
274
|
opacity: 1;
|
|
273
|
-
}`,
|
|
275
|
+
}`, Te = x`
|
|
274
276
|
0% {
|
|
275
277
|
height: 0;
|
|
276
278
|
width: 0;
|
|
@@ -284,7 +286,7 @@ to {
|
|
|
284
286
|
100% {
|
|
285
287
|
opacity: 1;
|
|
286
288
|
height: 10px;
|
|
287
|
-
}`,
|
|
289
|
+
}`, Se = _("div")`
|
|
288
290
|
width: 20px;
|
|
289
291
|
opacity: 0;
|
|
290
292
|
height: 20px;
|
|
@@ -293,13 +295,13 @@ to {
|
|
|
293
295
|
position: relative;
|
|
294
296
|
transform: rotate(45deg);
|
|
295
297
|
|
|
296
|
-
animation: ${
|
|
298
|
+
animation: ${Ie} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
297
299
|
forwards;
|
|
298
300
|
animation-delay: 100ms;
|
|
299
301
|
&:after {
|
|
300
302
|
content: '';
|
|
301
303
|
box-sizing: border-box;
|
|
302
|
-
animation: ${
|
|
304
|
+
animation: ${Te} 0.2s ease-out forwards;
|
|
303
305
|
opacity: 0;
|
|
304
306
|
animation-delay: 200ms;
|
|
305
307
|
position: absolute;
|
|
@@ -311,16 +313,16 @@ to {
|
|
|
311
313
|
height: 10px;
|
|
312
314
|
width: 6px;
|
|
313
315
|
}
|
|
314
|
-
`,
|
|
316
|
+
`, Pe = _("div")`
|
|
315
317
|
position: absolute;
|
|
316
|
-
`,
|
|
318
|
+
`, Re = _("div")`
|
|
317
319
|
position: relative;
|
|
318
320
|
display: flex;
|
|
319
321
|
justify-content: center;
|
|
320
322
|
align-items: center;
|
|
321
323
|
min-width: 20px;
|
|
322
324
|
min-height: 20px;
|
|
323
|
-
`,
|
|
325
|
+
`, Fe = x`
|
|
324
326
|
from {
|
|
325
327
|
transform: scale(0.6);
|
|
326
328
|
opacity: 0.4;
|
|
@@ -328,23 +330,23 @@ from {
|
|
|
328
330
|
to {
|
|
329
331
|
transform: scale(1);
|
|
330
332
|
opacity: 1;
|
|
331
|
-
}`,
|
|
333
|
+
}`, Le = _("div")`
|
|
332
334
|
position: relative;
|
|
333
335
|
transform: scale(0.6);
|
|
334
336
|
opacity: 0.4;
|
|
335
337
|
min-width: 20px;
|
|
336
|
-
animation: ${
|
|
338
|
+
animation: ${Fe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
337
339
|
forwards;
|
|
338
|
-
`,
|
|
339
|
-
let { icon: t, type:
|
|
340
|
-
return t !== void 0 ? typeof t == "string" ? f.createElement(
|
|
341
|
-
},
|
|
340
|
+
`, Me = ({ toast: e }) => {
|
|
341
|
+
let { icon: t, type: r, iconTheme: s } = e;
|
|
342
|
+
return t !== void 0 ? typeof t == "string" ? f.createElement(Le, null, t) : t : r === "blank" ? null : f.createElement(Re, null, f.createElement(Ae, { ...s }), r !== "loading" && f.createElement(Pe, null, r === "error" ? f.createElement(De, { ...s }) : f.createElement(Se, { ...s })));
|
|
343
|
+
}, He = (e) => `
|
|
342
344
|
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
|
|
343
345
|
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
344
|
-
`,
|
|
346
|
+
`, Ge = (e) => `
|
|
345
347
|
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
346
348
|
100% {transform: translate3d(0,${e * -150}%,-1px) scale(.6); opacity:0;}
|
|
347
|
-
`,
|
|
349
|
+
`, Ue = "0%{opacity:0;} 100%{opacity:1;}", We = "0%{opacity:1;} 100%{opacity:0;}", Be = _("div")`
|
|
348
350
|
display: flex;
|
|
349
351
|
align-items: center;
|
|
350
352
|
background: #fff;
|
|
@@ -356,106 +358,168 @@ to {
|
|
|
356
358
|
pointer-events: auto;
|
|
357
359
|
padding: 8px 10px;
|
|
358
360
|
border-radius: 8px;
|
|
359
|
-
`,
|
|
361
|
+
`, Ye = _("div")`
|
|
360
362
|
display: flex;
|
|
361
363
|
justify-content: center;
|
|
362
364
|
margin: 4px 10px;
|
|
363
365
|
color: inherit;
|
|
364
366
|
flex: 1 1 auto;
|
|
365
367
|
white-space: pre-line;
|
|
366
|
-
`,
|
|
367
|
-
let
|
|
368
|
-
return { animation: t ? `${
|
|
369
|
-
},
|
|
370
|
-
let i = e.height ?
|
|
371
|
-
return f.createElement(Be, { className: e.className, style: { ...i, ...
|
|
368
|
+
`, Ze = (e, t) => {
|
|
369
|
+
let r = e.includes("top") ? 1 : -1, [s, i] = te() ? [Ue, We] : [He(r), Ge(r)];
|
|
370
|
+
return { animation: t ? `${x(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${x(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
|
|
371
|
+
}, Ke = f.memo(({ toast: e, position: t, style: r, children: s }) => {
|
|
372
|
+
let i = e.height ? Ze(e.position || t || "top-center", e.visible) : { opacity: 0 }, o = f.createElement(Me, { toast: e }), a = f.createElement(Ye, { ...e.ariaProps }, D(e.message, e));
|
|
373
|
+
return f.createElement(Be, { className: e.className, style: { ...i, ...r, ...e.style } }, typeof s == "function" ? s({ icon: o, message: a }) : f.createElement(f.Fragment, null, o, a));
|
|
372
374
|
});
|
|
373
|
-
|
|
374
|
-
var
|
|
375
|
-
let o = f.useCallback((
|
|
376
|
-
if (
|
|
375
|
+
he(f.createElement);
|
|
376
|
+
var Qe = ({ id: e, className: t, style: r, onHeightUpdate: s, children: i }) => {
|
|
377
|
+
let o = f.useCallback((a) => {
|
|
378
|
+
if (a) {
|
|
377
379
|
let n = () => {
|
|
378
|
-
let l =
|
|
380
|
+
let l = a.getBoundingClientRect().height;
|
|
379
381
|
s(e, l);
|
|
380
382
|
};
|
|
381
|
-
n(), new MutationObserver(n).observe(
|
|
383
|
+
n(), new MutationObserver(n).observe(a, { subtree: !0, childList: !0, characterData: !0 });
|
|
382
384
|
}
|
|
383
385
|
}, [e, s]);
|
|
384
|
-
return f.createElement("div", { ref: o, className: t, style:
|
|
385
|
-
},
|
|
386
|
-
let
|
|
387
|
-
return { left: 0, right: 0, display: "flex", position: "absolute", transition:
|
|
388
|
-
},
|
|
386
|
+
return f.createElement("div", { ref: o, className: t, style: r }, i);
|
|
387
|
+
}, Ve = (e, t) => {
|
|
388
|
+
let r = e.includes("top"), s = r ? { top: 0 } : { bottom: 0 }, i = e.includes("center") ? { justifyContent: "center" } : e.includes("right") ? { justifyContent: "flex-end" } : {};
|
|
389
|
+
return { left: 0, right: 0, display: "flex", position: "absolute", transition: te() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t * (r ? 1 : -1)}px)`, ...s, ...i };
|
|
390
|
+
}, Je = q`
|
|
389
391
|
z-index: 9999;
|
|
390
392
|
> * {
|
|
391
393
|
pointer-events: auto;
|
|
392
394
|
}
|
|
393
|
-
`,
|
|
394
|
-
let { toasts: l, handlers:
|
|
395
|
-
return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top:
|
|
396
|
-
let
|
|
397
|
-
return f.createElement(
|
|
395
|
+
`, O = 16, Xe = ({ reverseOrder: e, position: t = "top-center", toastOptions: r, gutter: s, children: i, toasterId: o, containerStyle: a, containerClassName: n }) => {
|
|
396
|
+
let { toasts: l, handlers: c } = $e(r, o);
|
|
397
|
+
return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top: O, left: O, right: O, bottom: O, pointerEvents: "none", ...a }, className: n, onMouseEnter: c.startPause, onMouseLeave: c.endPause }, l.map((d) => {
|
|
398
|
+
let p = d.position || t, u = c.calculateOffset(d, { reverseOrder: e, gutter: s, defaultPosition: t }), g = Ve(p, u);
|
|
399
|
+
return f.createElement(Qe, { id: d.id, key: d.id, onHeightUpdate: c.updateHeight, className: d.visible ? Je : "", style: g }, d.type === "custom" ? D(d.message, d) : i ? i(d) : f.createElement(Ke, { toast: d, position: p }));
|
|
398
400
|
}));
|
|
399
401
|
};
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
"
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
402
|
+
const et = "_root_q0jyz_2", tt = "_icon_q0jyz_17", rt = "_progress_q0jyz_40", at = "_snackbar_q0jyz_63", st = "_growl_q0jyz_71", ot = "_content_q0jyz_79", it = "_title_q0jyz_91", H = {
|
|
403
|
+
root: et,
|
|
404
|
+
icon: tt,
|
|
405
|
+
"variant-error": "_variant-error_q0jyz_24",
|
|
406
|
+
"variant-warning": "_variant-warning_q0jyz_28",
|
|
407
|
+
"variant-success": "_variant-success_q0jyz_32",
|
|
408
|
+
"variant-info": "_variant-info_q0jyz_36",
|
|
409
|
+
progress: rt,
|
|
410
|
+
"progress-bar": "_progress-bar_q0jyz_45",
|
|
411
|
+
"toast-progress": "_toast-progress_q0jyz_1",
|
|
412
|
+
"hide-progress-bar": "_hide-progress-bar_q0jyz_52",
|
|
413
|
+
snackbar: at,
|
|
414
|
+
growl: st,
|
|
415
|
+
content: ot,
|
|
416
|
+
"close-button": "_close-button_q0jyz_85",
|
|
417
|
+
title: it
|
|
418
|
+
}, j = L(H), ie = Z(
|
|
419
|
+
({
|
|
420
|
+
children: e,
|
|
421
|
+
className: t,
|
|
422
|
+
cta: r,
|
|
423
|
+
duration: s,
|
|
424
|
+
hasCloseButton: i = !0,
|
|
425
|
+
onClose: o,
|
|
426
|
+
showProgressBar: a = !1,
|
|
427
|
+
title: n,
|
|
428
|
+
variant: l = "info",
|
|
429
|
+
...c
|
|
430
|
+
}, d) => /* @__PURE__ */ N("div", { className: j("root", `variant-${l}`, t), ref: d, ...c, children: [
|
|
431
|
+
/* @__PURE__ */ N("div", { className: j("growl"), children: [
|
|
432
|
+
l ? /* @__PURE__ */ y(V, { className: j("icon"), name: le[l], size: "lg" }) : null,
|
|
433
|
+
/* @__PURE__ */ N("div", { className: j("content"), children: [
|
|
434
|
+
/* @__PURE__ */ N("span", { children: [
|
|
435
|
+
/* @__PURE__ */ y(P, { variant: "body-md-strong", children: n }),
|
|
436
|
+
/* @__PURE__ */ y(P, { variant: "body-md", children: e })
|
|
437
|
+
] }),
|
|
438
|
+
r ? /* @__PURE__ */ y(B, { children: r }) : null
|
|
439
|
+
] }),
|
|
440
|
+
i ? /* @__PURE__ */ y(Q, { className: j("close-button"), onClick: o, size: "sm" }) : null
|
|
441
|
+
] }),
|
|
442
|
+
/* @__PURE__ */ y(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
className: j(a && "progress"),
|
|
446
|
+
style: {
|
|
447
|
+
"--duration": i ? `${s}ms` : "5000ms"
|
|
448
|
+
},
|
|
449
|
+
children: /* @__PURE__ */ y("div", { className: j("progress-bar") })
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
] })
|
|
453
|
+
), nt = J((e, t) => /* @__PURE__ */ y(K, { ref: t, size: "md", variant: "secondary", ...e }));
|
|
454
|
+
ie.displayName = "Growl";
|
|
455
|
+
const k = L(H), ne = Z(
|
|
456
|
+
({
|
|
457
|
+
children: e,
|
|
458
|
+
className: t,
|
|
459
|
+
cta: r,
|
|
460
|
+
duration: s,
|
|
461
|
+
hasCloseButton: i = !0,
|
|
462
|
+
hideProgressBar: o = !1,
|
|
463
|
+
onClose: a,
|
|
464
|
+
variant: n = "info",
|
|
465
|
+
...l
|
|
466
|
+
}, c) => /* @__PURE__ */ N("div", { className: k("root", `variant-${n}`, t), ref: c, ...l, children: [
|
|
467
|
+
/* @__PURE__ */ N("div", { className: k("snackbar"), children: [
|
|
468
|
+
n ? /* @__PURE__ */ y(V, { className: k("icon"), name: le[n], size: "lg" }) : null,
|
|
469
|
+
/* @__PURE__ */ y(P, { variant: "body-md-strong", children: e }),
|
|
470
|
+
r ? /* @__PURE__ */ y(B, { children: r }) : null,
|
|
471
|
+
i ? /* @__PURE__ */ y(Q, { onClick: a, size: "sm" }) : null
|
|
472
|
+
] }),
|
|
473
|
+
/* @__PURE__ */ y(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
className: k("progress", o && "hide-progress-bar"),
|
|
477
|
+
style: {
|
|
478
|
+
"--duration": i ? `${s}ms` : "5000ms"
|
|
479
|
+
},
|
|
480
|
+
children: /* @__PURE__ */ y("div", { className: k("progress-bar") })
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
] })
|
|
484
|
+
), lt = J((e, t) => /* @__PURE__ */ y(K, { ref: t, size: "md", variant: "secondary", ...e }));
|
|
485
|
+
ne.displayName = "Snackbar";
|
|
486
|
+
const ct = L(H), le = {
|
|
487
|
+
error: "exclamation-octagon",
|
|
488
|
+
info: "info-circle",
|
|
489
|
+
success: "check-circle",
|
|
490
|
+
warning: "exclamation-triangle"
|
|
491
|
+
}, dt = {
|
|
492
|
+
error: 8e3,
|
|
493
|
+
info: 7e3,
|
|
494
|
+
success: 7e3,
|
|
495
|
+
warning: 8e3
|
|
496
|
+
}, pt = ({ children: e, className: t, ...r }) => /* @__PURE__ */ y("p", { className: ct("title", t), ...r, children: e }), xt = (e, t) => {
|
|
439
497
|
const s = ("type" in e ? e.type.displayName || e.type.name : void 0) === "Growl" ? "top-right" : "bottom-center", i = () => {
|
|
440
|
-
t.onClose && t.onClose(),
|
|
441
|
-
}, o = {
|
|
442
|
-
duration:
|
|
498
|
+
t.onClose && t.onClose(), m.dismiss(t.id);
|
|
499
|
+
}, o = e.props.variant || "info", a = {
|
|
500
|
+
duration: dt[o],
|
|
443
501
|
position: s,
|
|
444
502
|
style: {
|
|
445
503
|
backgroundColor: "transparent",
|
|
446
504
|
boxShadow: "none",
|
|
505
|
+
maxWidth: "100%",
|
|
447
506
|
padding: 0
|
|
448
507
|
},
|
|
449
508
|
...t
|
|
450
509
|
};
|
|
451
|
-
return
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
510
|
+
return m(
|
|
511
|
+
pe(e, { duration: a.duration, onClose: i }),
|
|
512
|
+
a
|
|
513
|
+
);
|
|
514
|
+
}, wt = Object.assign(Xe, {
|
|
515
|
+
Growl: ie,
|
|
516
|
+
GrowlAction: nt,
|
|
517
|
+
Snackbar: ne,
|
|
518
|
+
SnackbarAction: lt,
|
|
519
|
+
Title: pt
|
|
457
520
|
});
|
|
458
521
|
export {
|
|
459
|
-
|
|
460
|
-
|
|
522
|
+
le as ICON,
|
|
523
|
+
wt as Toast,
|
|
524
|
+
xt as toast
|
|
461
525
|
};
|