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