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.
Files changed (72) hide show
  1. package/dist/Accordion.js +1 -0
  2. package/dist/Alert.css +1 -1
  3. package/dist/Alert.js +85 -87
  4. package/dist/AspectRatio.js +1 -0
  5. package/dist/Avatar.js +1 -0
  6. package/dist/Badge.js +1 -0
  7. package/dist/Breadcrumb.js +1 -0
  8. package/dist/Button.js +1 -0
  9. package/dist/ButtonGroup.js +1 -0
  10. package/dist/Card.js +1 -0
  11. package/dist/Checkbox.js +1 -0
  12. package/dist/CloseButton.css +1 -1
  13. package/dist/CloseButton.js +13 -12
  14. package/dist/DatePicker.js +1 -0
  15. package/dist/Drawer.js +1 -0
  16. package/dist/DropdownMenu.js +1 -0
  17. package/dist/Field.js +1 -0
  18. package/dist/FieldGroup.js +1 -0
  19. package/dist/FileDrop.js +1 -0
  20. package/dist/FileUpload.js +1 -0
  21. package/dist/Hint.js +1 -0
  22. package/dist/Icon.js +9 -4
  23. package/dist/InputText.js +1 -0
  24. package/dist/Label.js +1 -0
  25. package/dist/Link.js +20 -18
  26. package/dist/Loader.js +1 -0
  27. package/dist/Logo.js +1 -0
  28. package/dist/Modal.js +1 -0
  29. package/dist/Pagination.css +1 -1
  30. package/dist/Pagination.js +156 -76
  31. package/dist/Popover.js +1 -0
  32. package/dist/Radio.js +1 -0
  33. package/dist/RadioGroup.js +1 -0
  34. package/dist/RadioTab.js +1 -0
  35. package/dist/Search.js +1 -0
  36. package/dist/Select.js +1 -0
  37. package/dist/Slider.js +1 -0
  38. package/dist/Stepper.js +1 -0
  39. package/dist/StickyNote.css +1 -0
  40. package/dist/StickyNote.js +43 -0
  41. package/dist/Swiper.js +1 -0
  42. package/dist/Table.js +1 -0
  43. package/dist/Tabs.js +1 -0
  44. package/dist/Tag.css +1 -1
  45. package/dist/Tag.js +41 -40
  46. package/dist/Text.js +1 -0
  47. package/dist/Textarea.js +1 -0
  48. package/dist/Toast.css +1 -1
  49. package/dist/Toast.js +287 -222
  50. package/dist/Toggle.js +1 -0
  51. package/dist/Tooltip.js +1 -0
  52. package/dist/VariantIcon.js +1 -0
  53. package/dist/VisuallyHidden.js +1 -0
  54. package/dist/theme.css +1 -1
  55. package/dist/theme.js +1 -0
  56. package/dist/types/components/Alert/components/Buttons.d.ts +3 -0
  57. package/dist/types/components/Alert/components/Title.d.ts +2 -0
  58. package/dist/types/components/Alert/index.d.ts +4 -3
  59. package/dist/types/components/Alert/types.d.ts +3 -9
  60. package/dist/types/components/Icon/icons.d.ts +2 -2
  61. package/dist/types/components/Pagination/types.d.ts +11 -0
  62. package/dist/types/components/StickyNote/components/Button.d.ts +2 -0
  63. package/dist/types/components/StickyNote/components/Title.d.ts +2 -0
  64. package/dist/types/components/StickyNote/index.d.ts +5 -0
  65. package/dist/types/components/StickyNote/index.test.d.ts +1 -0
  66. package/dist/types/components/StickyNote/types.d.ts +15 -0
  67. package/dist/types/components/Toast/components/Growl.d.ts +2 -0
  68. package/dist/types/components/Toast/index.d.ts +4 -1
  69. package/dist/types/components/Toast/types.d.ts +8 -9
  70. package/dist/types/theme/types.d.ts +233 -218
  71. package/dist/utils.js +1 -0
  72. package/package.json +2 -2
package/dist/Toast.js CHANGED
@@ -1,78 +1,81 @@
1
1
  "use client";
2
- import { jsx as k, Fragment as re } from "react/jsx-runtime";
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 U, useCallback as _, useEffect as I, useState as se, forwardRef as W, cloneElement as oe } from "react";
5
- import { c as P } from "./index-PAaZGbyz.js";
6
- import { Alert as Y } from "./Alert.js";
7
- import { Button as ie } from "./Button.js";
8
- import { f as ne } from "./forwardRefWithAs-8eP3ZN15.js";
9
- let le = { data: "" }, ce = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || le, de = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, pe = /\/\*[^]*?\*\/| +/g, H = /\n+/g, x = (e, t) => {
10
- let a = "", s = "", i = "";
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 r = e[o];
13
- o[0] == "@" ? o[1] == "i" ? a = o + " " + r + ";" : s += o[1] == "f" ? x(r, o) : o + "{" + x(r, o[1] == "k" ? "" : t) + "}" : typeof r == "object" ? s += x(r, t ? t.replace(/([^,])+/g, (n) => o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, n) : n ? n + " " + l : l)) : o) : r != null && (o = /^--/.test(o) ? o : o.replace(/[A-Z]/g, "-$&").toLowerCase(), i += x.p ? x.p(o, r) : o + ":" + r + ";");
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 a + (t && i ? t + "{" + i + "}" : i) + s;
16
- }, b = {}, Z = (e) => {
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 a in e) t += a + Z(e[a]);
22
+ for (let r in e) t += r + X(e[r]);
20
23
  return t;
21
24
  }
22
25
  return e;
23
- }, ue = (e, t, a, s, i) => {
24
- let o = Z(e), r = b[o] || (b[o] = ((l) => {
25
- let d = 0, p = 11;
26
- for (; d < l.length; ) p = 101 * p + l.charCodeAt(d++) >>> 0;
27
- return "go" + p;
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 (!b[r]) {
30
- let l = o !== e ? e : ((d) => {
31
- let p, c, m = [{}];
32
- for (; p = de.exec(d.replace(pe, "")); ) p[4] ? m.shift() : p[3] ? (c = p[3].replace(H, " ").trim(), m.unshift(m[0][c] = m[0][c] || {})) : m[0][p[1]] = p[2].replace(H, " ").trim();
33
- return m[0];
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
- b[r] = x(i ? { ["@keyframes " + r]: l } : l, a ? "" : "." + r);
38
+ v[a] = w(i ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
36
39
  }
37
- let n = a && b.g ? b.g : null;
38
- return a && (b.g = b[r]), ((l, d, p, c) => {
39
- c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = p ? l + d.data : d.data + l);
40
- })(b[r], t, s, n), r;
41
- }, me = (e, t, a) => e.reduce((s, i, o) => {
42
- let r = t[o];
43
- if (r && r.call) {
44
- let n = r(a), l = n && n.props && n.props.className || /^go/.test(n) && n;
45
- r = l ? "." + l : n && typeof n == "object" ? n.props ? "" : x(n, "") : n === !1 ? "" : n;
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 + (r ?? "");
50
+ return s + i + (a ?? "");
48
51
  }, "");
49
- function O(e) {
50
- let t = this || {}, a = e.call ? e(t.p) : e;
51
- return ue(a.unshift ? a.raw ? me(a, [].slice.call(arguments, 1), t.p) : a.reduce((s, i) => Object.assign(s, i && i.call ? i(t.p) : i), {}) : a, ce(t.target), t.g, t.o, t.k);
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 q, S, T;
54
- O.bind({ g: 1 });
55
- let v = O.bind({ k: 1 });
56
- function fe(e, t, a, s) {
57
- x.p = t, q = e, S = a, T = s;
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 w(e, t) {
60
- let a = this || {};
62
+ function _(e, t) {
63
+ let r = this || {};
61
64
  return function() {
62
65
  let s = arguments;
63
- function i(o, r) {
66
+ function i(o, a) {
64
67
  let n = Object.assign({}, o), l = n.className || i.className;
65
- a.p = Object.assign({ theme: S && S() }, n), a.o = / *go\d+/.test(l), n.className = O.apply(a, s) + (l ? " " + l : "");
66
- let d = e;
67
- return e[0] && (d = n.as || e, delete n.as), T && d[0] && T(n), q(d, n);
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 ge = (e) => typeof e == "function", C = (e, t) => ge(e) ? e(t) : e, ye = /* @__PURE__ */ (() => {
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
- })(), K = /* @__PURE__ */ (() => {
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
- })(), he = 20, F = "default", Q = (e, t) => {
85
- let { toastLimit: a } = e.settings;
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, a) };
91
+ return { ...e, toasts: [t.toast, ...e.toasts].slice(0, r) };
89
92
  case 1:
90
- return { ...e, toasts: e.toasts.map((r) => r.id === t.toast.id ? { ...r, ...t.toast } : r) };
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 Q(e, { type: e.toasts.find((r) => r.id === s.id) ? 1 : 0, toast: s });
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((r) => r.id === i || i === void 0 ? { ...r, dismissed: !0, visible: !1 } : r) };
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((r) => r.id !== t.toastId) };
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((r) => ({ ...r, pauseDuration: r.pauseDuration + o })) };
106
+ return { ...e, pausedAt: void 0, toasts: e.toasts.map((a) => ({ ...a, pauseDuration: a.pauseDuration + o })) };
104
107
  }
105
- }, j = [], V = { toasts: [], pausedAt: void 0, settings: { toastLimit: he } }, h = {}, J = (e, t = F) => {
106
- h[t] = Q(h[t] || V, e), j.forEach(([a, s]) => {
107
- a === t && s(h[t]);
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
- }, X = (e) => Object.keys(h).forEach((t) => J(e, t)), be = (e) => Object.keys(h).find((t) => h[t].toasts.some((a) => a.id === e)), D = (e = F) => (t) => {
110
- J(t, e);
111
- }, ve = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, xe = (e = {}, t = F) => {
112
- let [a, s] = se(h[t] || V), i = U(h[t]);
113
- I(() => (i.current !== h[t] && s(h[t]), j.push([t, s]), () => {
114
- let r = j.findIndex(([n]) => n === t);
115
- r > -1 && j.splice(r, 1);
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 = a.toasts.map((r) => {
118
- var n, l, d;
119
- return { ...e, ...e[r.type], ...r, removeDelay: r.removeDelay || ((n = e[r.type]) == null ? void 0 : n.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: r.duration || ((l = e[r.type]) == null ? void 0 : l.duration) || (e == null ? void 0 : e.duration) || ve[r.type], style: { ...e.style, ...(d = e[r.type]) == null ? void 0 : d.style, ...r.style } };
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 { ...a, toasts: o };
122
- }, we = (e, t = "blank", a) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: t, ariaProps: { role: "status", "aria-live": "polite" }, message: e, pauseDuration: 0, ...a, id: (a == null ? void 0 : a.id) || ye() }), $ = (e) => (t, a) => {
123
- let s = we(t, e, a);
124
- return D(s.toasterId || be(s.id))({ type: 2, toast: s }), s.id;
125
- }, u = (e, t) => $("blank")(e, t);
126
- u.error = $("error");
127
- u.success = $("success");
128
- u.loading = $("loading");
129
- u.custom = $("custom");
130
- u.dismiss = (e, t) => {
131
- let a = { type: 3, toastId: e };
132
- t ? D(t)(a) : X(a);
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
- u.dismissAll = (e) => u.dismiss(void 0, e);
135
- u.remove = (e, t) => {
136
- let a = { type: 4, toastId: e };
137
- t ? D(t)(a) : X(a);
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
- u.removeAll = (e) => u.remove(void 0, e);
140
- u.promise = (e, t, a) => {
141
- let s = u.loading(t.loading, { ...a, ...a == null ? void 0 : a.loading });
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 ? C(t.success, i) : void 0;
144
- return o ? u.success(o, { id: s, ...a, ...a == null ? void 0 : a.success }) : u.dismiss(s), i;
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 ? C(t.error, i) : void 0;
147
- o ? u.error(o, { id: s, ...a, ...a == null ? void 0 : a.error }) : u.dismiss(s);
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, _e = (e, t = "default") => {
151
- let { toasts: a, pausedAt: s } = xe(e, t), i = U(/* @__PURE__ */ new Map()).current, o = _((c, m = ke) => {
152
- if (i.has(c)) return;
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(c), r({ type: 4, toastId: c });
155
- }, m);
156
- i.set(c, g);
157
+ i.delete(p), a({ type: 4, toastId: p });
158
+ }, u);
159
+ i.set(p, g);
157
160
  }, []);
158
- I(() => {
161
+ S(() => {
159
162
  if (s) return;
160
- let c = Date.now(), m = a.map((g) => {
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 - (c - g.createdAt);
165
+ let E = (g.duration || 0) + g.pauseDuration - (p - g.createdAt);
163
166
  if (E < 0) {
164
- g.visible && u.dismiss(g.id);
167
+ g.visible && m.dismiss(g.id);
165
168
  return;
166
169
  }
167
- return setTimeout(() => u.dismiss(g.id, t), E);
170
+ return setTimeout(() => m.dismiss(g.id, t), E);
168
171
  });
169
172
  return () => {
170
- m.forEach((g) => g && clearTimeout(g));
173
+ u.forEach((g) => g && clearTimeout(g));
171
174
  };
172
- }, [a, s, t]);
173
- let r = _(D(t), [t]), n = _(() => {
174
- r({ type: 5, time: Date.now() });
175
- }, [r]), l = _((c, m) => {
176
- r({ type: 1, toast: { id: c, height: m } });
177
- }, [r]), d = _(() => {
178
- s && r({ type: 6, time: Date.now() });
179
- }, [s, r]), p = _((c, m) => {
180
- let { reverseOrder: g = !1, gutter: E = 8, defaultPosition: L } = m || {}, A = a.filter((y) => (y.position || L) === (c.position || L) && y.height), ae = A.findIndex((y) => y.id === c.id), M = A.filter((y, z) => z < ae && y.visible).length;
181
- return A.filter((y) => y.visible).slice(...g ? [M + 1] : [0, M]).reduce((y, z) => y + (z.height || 0) + E, 0);
182
- }, [a]);
183
- return I(() => {
184
- a.forEach((c) => {
185
- if (c.dismissed) o(c.id, c.removeDelay);
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 m = i.get(c.id);
188
- m && (clearTimeout(m), i.delete(c.id));
190
+ let u = i.get(p.id);
191
+ u && (clearTimeout(u), i.delete(p.id));
189
192
  }
190
193
  });
191
- }, [a, o]), { toasts: a, handlers: { updateHeight: l, startPause: n, endPause: d, calculateOffset: p } };
192
- }, $e = v`
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
- }`, Ee = v`
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
- }`, Ne = v`
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
- }`, je = w("div")`
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: ${$e} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
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: ${Ee} 0.15s ease-out forwards;
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: ${Ne} 0.15s ease-out forwards;
248
+ animation: ${Ce} 0.15s ease-out forwards;
246
249
  animation-delay: 180ms;
247
250
  transform: rotate(90deg);
248
251
  }
249
- `, Ce = v`
252
+ `, qe = x`
250
253
  from {
251
254
  transform: rotate(0deg);
252
255
  }
253
256
  to {
254
257
  transform: rotate(360deg);
255
258
  }
256
- `, Oe = w("div")`
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: ${Ce} 1s linear infinite;
265
- `, De = v`
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
- }`, Ae = v`
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
- }`, ze = w("div")`
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: ${De} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
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: ${Ae} 0.2s ease-out forwards;
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
- `, Ie = w("div")`
317
+ `, Pe = _("div")`
315
318
  position: absolute;
316
- `, Se = w("div")`
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
- `, Te = v`
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
- }`, Pe = w("div")`
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: ${Te} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
339
+ animation: ${Fe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
337
340
  forwards;
338
- `, Fe = ({ toast: e }) => {
339
- let { icon: t, type: a, iconTheme: s } = e;
340
- return t !== void 0 ? typeof t == "string" ? f.createElement(Pe, null, t) : t : a === "blank" ? null : f.createElement(Se, null, f.createElement(Oe, { ...s }), a !== "loading" && f.createElement(Ie, null, a === "error" ? f.createElement(je, { ...s }) : f.createElement(ze, { ...s })));
341
- }, Re = (e) => `
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
- `, Le = (e) => `
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
- `, Me = "0%{opacity:0;} 100%{opacity:1;}", He = "0%{opacity:1;} 100%{opacity:0;}", Be = w("div")`
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
- `, Ge = w("div")`
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
- `, Ue = (e, t) => {
367
- let a = e.includes("top") ? 1 : -1, [s, i] = K() ? [Me, He] : [Re(a), Le(a)];
368
- return { animation: t ? `${v(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${v(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
369
- }, We = f.memo(({ toast: e, position: t, style: a, children: s }) => {
370
- let i = e.height ? Ue(e.position || t || "top-center", e.visible) : { opacity: 0 }, o = f.createElement(Fe, { toast: e }), r = f.createElement(Ge, { ...e.ariaProps }, C(e.message, e));
371
- return f.createElement(Be, { className: e.className, style: { ...i, ...a, ...e.style } }, typeof s == "function" ? s({ icon: o, message: r }) : f.createElement(f.Fragment, null, o, r));
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
- fe(f.createElement);
374
- var Ye = ({ id: e, className: t, style: a, onHeightUpdate: s, children: i }) => {
375
- let o = f.useCallback((r) => {
376
- if (r) {
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 = r.getBoundingClientRect().height;
381
+ let l = a.getBoundingClientRect().height;
379
382
  s(e, l);
380
383
  };
381
- n(), new MutationObserver(n).observe(r, { subtree: !0, childList: !0, characterData: !0 });
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: a }, i);
385
- }, Ze = (e, t) => {
386
- let a = e.includes("top"), s = a ? { top: 0 } : { bottom: 0 }, i = e.includes("center") ? { justifyContent: "center" } : e.includes("right") ? { justifyContent: "flex-end" } : {};
387
- return { left: 0, right: 0, display: "flex", position: "absolute", transition: K() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t * (a ? 1 : -1)}px)`, ...s, ...i };
388
- }, qe = O`
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
- `, N = 16, Ke = ({ reverseOrder: e, position: t = "top-center", toastOptions: a, gutter: s, children: i, toasterId: o, containerStyle: r, containerClassName: n }) => {
394
- let { toasts: l, handlers: d } = _e(a, o);
395
- return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top: N, left: N, right: N, bottom: N, pointerEvents: "none", ...r }, className: n, onMouseEnter: d.startPause, onMouseLeave: d.endPause }, l.map((p) => {
396
- let c = p.position || t, m = d.calculateOffset(p, { reverseOrder: e, gutter: s, defaultPosition: t }), g = Ze(c, m);
397
- return f.createElement(Ye, { id: p.id, key: p.id, onHeightUpdate: d.updateHeight, className: p.visible ? qe : "", style: g }, p.type === "custom" ? C(p.message, p) : i ? i(p) : f.createElement(We, { toast: p, position: c }));
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 Qe = "_title_1trg0_2", Ve = "_growl_1trg0_12", Je = "_snackbar_1trg0_27", Xe = "_info_1trg0_48", et = "_success_1trg0_51", tt = "_warning_1trg0_54", at = "_danger_1trg0_57", R = {
401
- title: Qe,
402
- growl: Ve,
403
- snackbar: Je,
404
- "snackbar-separator": "_snackbar-separator_1trg0_43",
405
- info: Xe,
406
- success: et,
407
- warning: tt,
408
- danger: at
409
- }, B = P(R), ee = W(
410
- ({ children: e, className: t, hasCloseButton: a = !0, onClose: s, variant: i, ...o }, r) => /* @__PURE__ */ k(
411
- Y,
412
- {
413
- className: B("growl", t),
414
- handleClose: a ? s : void 0,
415
- ref: r,
416
- variant: i,
417
- ...o,
418
- children: /* @__PURE__ */ k("div", { className: B("pr-xl"), children: e })
419
- }
420
- )
421
- );
422
- ee.displayName = "Growl";
423
- const G = P(R), te = W(
424
- ({ children: e, className: t, cta: a, hasCloseButton: s = !0, onClose: i, variant: o, ...r }, n) => /* @__PURE__ */ k(
425
- Y,
426
- {
427
- className: G("snackbar", t),
428
- cta: a ? /* @__PURE__ */ k(re, { children: /* @__PURE__ */ k("div", { className: G("snackbar-separator", `${o}`, "pr-xl"), children: a }) }) : null,
429
- handleClose: s ? i : void 0,
430
- ref: n,
431
- variant: o,
432
- ...r,
433
- children: e
434
- }
435
- )
436
- ), rt = ne((e, t) => /* @__PURE__ */ k(ie, { ref: t, size: "sm", variant: "tertiary", ...e }));
437
- te.displayName = "Snackbar";
438
- const st = P(R), ot = ({ children: e, className: t, ...a }) => /* @__PURE__ */ k("p", { className: st("title", t), ...a, children: e }), ut = (e, t) => {
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(), u.dismiss(t.id);
441
- }, o = {
442
- duration: 7e3,
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 u(oe(e, { onClose: i }), o);
452
- }, mt = Object.assign(Ke, {
453
- Growl: ee,
454
- Snackbar: te,
455
- SnackbarAction: rt,
456
- Title: ot
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
- mt as Toast,
460
- ut as toast
523
+ le as ICON,
524
+ wt as Toast,
525
+ xt as toast
461
526
  };