welcome-ui 10.0.0-alpha.1 → 10.0.0-alpha.11

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 (179) hide show
  1. package/README.md +1 -1
  2. package/dist/2W3RN7C5-DMC82gDP.js +61 -0
  3. package/dist/4I4MLMKD-BO6Lcy7s.js +150 -0
  4. package/dist/Accordion.js +20 -18
  5. package/dist/Alert.css +1 -1
  6. package/dist/Alert.js +93 -87
  7. package/dist/AspectRatio.js +2 -1
  8. package/dist/Avatar.js +14 -12
  9. package/dist/{B7UTNDHN-BlIblHCu.js → B7UTNDHN-BghjolIs.js} +30 -30
  10. package/dist/Badge.js +2 -1
  11. package/dist/Breadcrumb.css +1 -1
  12. package/dist/Breadcrumb.js +175 -154
  13. package/dist/Button.css +1 -1
  14. package/dist/Button.js +43 -41
  15. package/dist/ButtonGroup.js +7 -5
  16. package/dist/Card.css +1 -1
  17. package/dist/Card.js +68 -15
  18. package/dist/Checkbox.js +32 -30
  19. package/dist/CloseButton.css +1 -1
  20. package/dist/CloseButton.js +15 -13
  21. package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
  22. package/dist/{DSAASPLT-BaaCUKsb.js → DSAASPLT-Fx1kuAsk.js} +3 -3
  23. package/dist/DatePicker.js +96 -91
  24. package/dist/DateTimePicker.js +21 -20
  25. package/dist/Drawer.js +141 -96
  26. package/dist/DropdownMenu.css +1 -1
  27. package/dist/DropdownMenu.js +902 -462
  28. package/dist/Field.css +1 -1
  29. package/dist/Field.js +50 -50
  30. package/dist/FieldGroup.js +9 -7
  31. package/dist/FileDrop.css +1 -1
  32. package/dist/FileDrop.js +433 -398
  33. package/dist/FileUpload.js +44 -41
  34. package/dist/GVVKDT6A-CF9ejW_c.js +619 -0
  35. package/dist/Hint.js +10 -8
  36. package/dist/Icon.css +1 -1
  37. package/dist/Icon.js +36 -22
  38. package/dist/InputText.css +1 -1
  39. package/dist/InputText.js +59 -57
  40. package/dist/{KPUWHTQJ-D2TPji47.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
  41. package/dist/Label.js +9 -7
  42. package/dist/Link.css +1 -1
  43. package/dist/Link.js +54 -49
  44. package/dist/Loader.js +13 -11
  45. package/dist/Logo.js +21 -13
  46. package/dist/Modal.js +153 -113
  47. package/dist/{NI3IVY7K-Ztb3-XAv.js → NI3IVY7K-Dy240mkD.js} +53 -53
  48. package/dist/{NMGNQVTG-C6TqBngP.js → NMGNQVTG-DRO2uXZT.js} +8 -8
  49. package/dist/{OE2EFRVA-C3721cM3.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
  50. package/dist/{OLVWQA7U-DysaSaZj.js → OLVWQA7U-Dia3UUnG.js} +51 -51
  51. package/dist/Pagination.css +1 -1
  52. package/dist/Pagination.js +157 -76
  53. package/dist/PasswordInput.js +20 -17
  54. package/dist/Popover.js +89 -72
  55. package/dist/{RTNCFSKZ-qpPg689E.js → RTNCFSKZ-BywELldk.js} +47 -47
  56. package/dist/Radio.css +1 -1
  57. package/dist/Radio.js +39 -40
  58. package/dist/RadioGroup.js +29 -27
  59. package/dist/RadioTab.js +3 -2
  60. package/dist/{SBSPVDDI-DJKkC1eb.js → SBSPVDDI-CmtnvvUX.js} +42 -42
  61. package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
  62. package/dist/Search.css +1 -1
  63. package/dist/Search.js +136 -129
  64. package/dist/Select.css +1 -1
  65. package/dist/Select.js +259 -257
  66. package/dist/Slider.js +67 -62
  67. package/dist/Stepper.js +34 -27
  68. package/dist/StickyNote.css +1 -0
  69. package/dist/StickyNote.js +49 -0
  70. package/dist/Swiper.js +53 -51
  71. package/dist/{T22PY7TE-C1N0q8Kn.js → T22PY7TE-gLuJpoOm.js} +46 -46
  72. package/dist/Table.js +34 -21
  73. package/dist/Tabs.js +165 -156
  74. package/dist/Tag.css +1 -1
  75. package/dist/Tag.js +67 -62
  76. package/dist/Text.js +5 -3
  77. package/dist/Textarea.css +1 -1
  78. package/dist/Textarea.js +26 -17
  79. package/dist/TimePicker.js +53 -51
  80. package/dist/Toast.css +1 -1
  81. package/dist/Toast.js +275 -165
  82. package/dist/Toggle.js +17 -15
  83. package/dist/Tooltip.css +1 -1
  84. package/dist/Tooltip.js +120 -129
  85. package/dist/VariantIcon.js +8 -6
  86. package/dist/VisuallyHidden.js +9 -7
  87. package/dist/WelcomeLoader.js +4 -3
  88. package/dist/XCKGTAUF-CJwwVibW.js +25 -0
  89. package/dist/{Y67KZUMI-DFEgrUv2.js → Y67KZUMI-BwLWwpNF.js} +5 -5
  90. package/dist/{ZTXFEM5L-CkrIQCN1.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
  91. package/dist/{downshift.esm-D_6pHXkq.js → downshift.esm-xtYanIDi.js} +1 -1
  92. package/dist/scss/breakpoints.scss +9 -0
  93. package/dist/scss/text-ellipsis.scss +5 -0
  94. package/dist/scss/texts.scss +108 -0
  95. package/dist/theme.css +1 -1
  96. package/dist/theme.js +1 -0
  97. package/dist/{tslib.es6-DpB4Y59c.js → tslib.es6-C80jYMbM.js} +1 -1
  98. package/dist/types/components/Alert/components/Buttons.d.ts +3 -0
  99. package/dist/types/components/Alert/components/Title.d.ts +5 -0
  100. package/dist/types/components/Alert/index.d.ts +7 -3
  101. package/dist/types/components/Alert/types.d.ts +3 -9
  102. package/dist/types/components/Breadcrumb/Item.d.ts +2 -2
  103. package/dist/types/components/Breadcrumb/index.d.ts +1 -1
  104. package/dist/types/components/Breadcrumb/types.d.ts +6 -3
  105. package/dist/types/components/Card/Body.d.ts +2 -3
  106. package/dist/types/components/Card/Footer.d.ts +6 -0
  107. package/dist/types/components/Card/Header.d.ts +5 -0
  108. package/dist/types/components/Card/index.d.ts +7 -8
  109. package/dist/types/components/Card/types.d.ts +16 -3
  110. package/dist/types/components/Checkbox/index.d.ts +1 -2
  111. package/dist/types/components/Checkbox/types.d.ts +3 -1
  112. package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
  113. package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
  114. package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
  115. package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
  116. package/dist/types/components/Drawer/AssetDrawer/types.d.ts +3 -0
  117. package/dist/types/components/Drawer/components/Backdrop.d.ts +1 -1
  118. package/dist/types/components/Drawer/components/Close.d.ts +4 -1
  119. package/dist/types/components/Drawer/components/Title.d.ts +4 -1
  120. package/dist/types/components/Drawer/index.d.ts +13 -4
  121. package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
  122. package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
  123. package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
  124. package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
  125. package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
  126. package/dist/types/components/DropdownMenu/index.d.ts +11 -0
  127. package/dist/types/components/DropdownMenu/types.d.ts +26 -5
  128. package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
  129. package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
  130. package/dist/types/components/FileDrop/types.d.ts +2 -0
  131. package/dist/types/components/Icon/icons.d.ts +6 -6
  132. package/dist/types/components/Icon/types.d.ts +2 -0
  133. package/dist/types/components/Loader/index.d.ts +4 -1
  134. package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
  135. package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
  136. package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
  137. package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
  138. package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
  139. package/dist/types/components/Modal/Assets/index.d.ts +16 -4
  140. package/dist/types/components/Modal/components/Close.d.ts +4 -1
  141. package/dist/types/components/Modal/components/Content.d.ts +1 -1
  142. package/dist/types/components/Modal/index.d.ts +17 -5
  143. package/dist/types/components/Modal/types.d.ts +1 -1
  144. package/dist/types/components/Pagination/types.d.ts +11 -0
  145. package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
  146. package/dist/types/components/Popover/Arrow.d.ts +4 -1
  147. package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
  148. package/dist/types/components/Radio/types.d.ts +1 -1
  149. package/dist/types/components/RadioGroup/index.d.ts +4 -1
  150. package/dist/types/components/Stepper/index.d.ts +8 -2
  151. package/dist/types/components/StickyNote/components/Button.d.ts +5 -0
  152. package/dist/types/components/StickyNote/components/Title.d.ts +5 -0
  153. package/dist/types/components/StickyNote/index.d.ts +11 -0
  154. package/dist/types/components/StickyNote/index.test.d.ts +1 -0
  155. package/dist/types/components/StickyNote/types.d.ts +15 -0
  156. package/dist/types/components/Swiper/index.d.ts +4 -1
  157. package/dist/types/components/Table/index.d.ts +20 -5
  158. package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
  159. package/dist/types/components/Tag/types.d.ts +4 -2
  160. package/dist/types/components/Textarea/types.d.ts +1 -0
  161. package/dist/types/components/Toast/components/Growl.d.ts +2 -0
  162. package/dist/types/components/Toast/index.d.ts +8 -2
  163. package/dist/types/components/Toast/types.d.ts +8 -9
  164. package/dist/types/components/Tooltip/types.d.ts +1 -1
  165. package/dist/types/theme/types.d.ts +255 -218
  166. package/dist/types/utils/index.d.ts +0 -1
  167. package/dist/{utils-DileZjMm.js → utils-BD597oo6.js} +1 -1
  168. package/dist/utils.js +3 -2
  169. package/package.json +3 -2
  170. package/dist/2W3RN7C5-bkX-rIa3.js +0 -61
  171. package/dist/4I4MLMKD-BLxAidnq.js +0 -43
  172. package/dist/GVVKDT6A-bET6V7Py.js +0 -724
  173. package/dist/SQZLCNLX-CHDXnZ16.js +0 -82
  174. package/dist/XCKGTAUF-DkxWCbaW.js +0 -25
  175. package/dist/index.css +0 -0
  176. package/dist/types/components/Icon/Icon.d.ts +0 -2
  177. package/dist/types/utils/theme/index.d.ts +0 -0
  178. /package/dist/{index-CdiHdiVB.js → index-PAaZGbyz.js} +0 -0
  179. /package/dist/types/components/Icon/{Icon.test.d.ts → index.test.d.ts} +0 -0
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 k, 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-CdiHdiVB.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) => {
5
+ import { useRef as Y, useCallback as j, useEffect as S, useState as fe, forwardRef as Z, cloneElement as ge } 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 C } from "./Text.js";
11
+ import { f as J } from "./forwardRefWithAs-8eP3ZN15.js";
12
+ let ye = { data: "" }, be = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || ye, he = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, ve = /\/\*[^]*?\*\/| +/g, W = /\n+/g, w = (e, t) => {
10
13
  let a = "", s = "", i = "";
11
14
  for (let o in e) {
12
15
  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 + ";");
16
+ o[0] == "@" ? o[1] == "i" ? a = o + " " + r + ";" : s += o[1] == "f" ? w(r, o) : o + "{" + w(r, o[1] == "k" ? "" : t) + "}" : typeof r == "object" ? s += w(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 += w.p ? w.p(o, r) : o + ":" + r + ";");
14
17
  }
15
18
  return a + (t && i ? t + "{" + i + "}" : i) + s;
16
- }, b = {}, Z = (e) => {
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 a in e) t += a + X(e[a]);
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
+ }, xe = (e, t, a, s, i) => {
27
+ let o = X(e), r = v[o] || (v[o] = ((l) => {
28
+ let p = 0, c = 11;
29
+ for (; p < l.length; ) c = 101 * c + l.charCodeAt(p++) >>> 0;
30
+ return "go" + c;
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();
32
+ if (!v[r]) {
33
+ let l = o !== e ? e : ((p) => {
34
+ let c, d, m = [{}];
35
+ for (; c = he.exec(p.replace(ve, "")); ) c[4] ? m.shift() : c[3] ? (d = c[3].replace(W, " ").trim(), m.unshift(m[0][d] = m[0][d] || {})) : m[0][c[1]] = c[2].replace(W, " ").trim();
33
36
  return m[0];
34
37
  })(e);
35
- b[r] = x(i ? { ["@keyframes " + r]: l } : l, a ? "" : "." + r);
38
+ v[r] = w(i ? { ["@keyframes " + r]: l } : l, a ? "" : "." + r);
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) => {
40
+ let n = a && v.g ? v.g : null;
41
+ return a && (v.g = v[r]), ((l, p, c, d) => {
42
+ d ? p.data = p.data.replace(d, l) : p.data.indexOf(l) === -1 && (p.data = c ? l + p.data : p.data + l);
43
+ })(v[r], t, s, n), r;
44
+ }, we = (e, t, a) => e.reduce((s, i, o) => {
42
45
  let r = t[o];
43
46
  if (r && r.call) {
44
47
  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;
48
+ r = l ? "." + l : n && typeof n == "object" ? n.props ? "" : w(n, "") : n === !1 ? "" : n;
46
49
  }
47
50
  return s + i + (r ?? "");
48
51
  }, "");
49
- function O(e) {
52
+ function A(e) {
50
53
  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);
54
+ return xe(a.unshift ? a.raw ? we(a, [].slice.call(arguments, 1), t.p) : a.reduce((s, i) => Object.assign(s, i && i.call ? i(t.p) : i), {}) : a, be(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
+ A.bind({ g: 1 });
58
+ let x = A.bind({ k: 1 });
59
+ function _e(e, t, a, s) {
60
+ w.p = t, ee = e, R = a, F = s;
58
61
  }
59
- function w(e, t) {
62
+ function _(e, t) {
60
63
  let a = this || {};
61
64
  return function() {
62
65
  let s = arguments;
63
66
  function i(o, r) {
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
+ a.p = Object.assign({ theme: R && R() }, n), a.o = / *go\d+/.test(l), n.className = A.apply(a, s) + (l ? " " + l : "");
69
+ let p = e;
70
+ return e[0] && (p = n.as || e, delete n.as), F && p[0] && F(n), ee(p, 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 Ne = (e) => typeof e == "function", D = (e, t) => Ne(e) ? e(t) : e, je = /* @__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,7 +84,7 @@ 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) => {
87
+ })(), ke = 20, M = "default", ae = (e, t) => {
85
88
  let { toastLimit: a } = e.settings;
86
89
  switch (t.type) {
87
90
  case 0:
@@ -90,7 +93,7 @@ var ge = (e) => typeof e == "function", C = (e, t) => ge(e) ? e(t) : e, ye = /*
90
93
  return { ...e, toasts: e.toasts.map((r) => r.id === t.toast.id ? { ...r, ...t.toast } : r) };
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 ae(e, { type: e.toasts.find((r) => r.id === s.id) ? 1 : 0, toast: s });
94
97
  case 3:
95
98
  let { toastId: i } = t;
96
99
  return { ...e, toasts: e.toasts.map((r) => r.id === i || i === void 0 ? { ...r, dismissed: !0, visible: !1 } : r) };
@@ -102,26 +105,26 @@ var ge = (e) => typeof e == "function", C = (e, t) => ge(e) ? e(t) : e, ye = /*
102
105
  let o = t.time - (e.pausedAt || 0);
103
106
  return { ...e, pausedAt: void 0, toasts: e.toasts.map((r) => ({ ...r, pauseDuration: r.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]) => {
108
+ }, O = [], re = { toasts: [], pausedAt: void 0, settings: { toastLimit: ke } }, h = {}, se = (e, t = M) => {
109
+ h[t] = ae(h[t] || re, e), O.forEach(([a, s]) => {
107
110
  a === 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)), ze = (e) => Object.keys(h).find((t) => h[t].toasts.some((a) => a.id === e)), q = (e = M) => (t) => {
113
+ se(t, e);
114
+ }, $e = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, Ee = (e = {}, t = M) => {
115
+ let [a, s] = fe(h[t] || re), i = Y(h[t]);
116
+ S(() => (i.current !== h[t] && s(h[t]), O.push([t, s]), () => {
117
+ let r = O.findIndex(([n]) => n === t);
118
+ r > -1 && O.splice(r, 1);
116
119
  }), [t]);
117
120
  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 } };
121
+ var n, l, p;
122
+ 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) || $e[r.type], style: { ...e.style, ...(p = e[r.type]) == null ? void 0 : p.style, ...r.style } };
120
123
  });
121
124
  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
+ }, Te = (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) || je() }), $ = (e) => (t, a) => {
126
+ let s = Te(t, e, a);
127
+ return q(s.toasterId || ze(s.id))({ type: 2, toast: s }), s.id;
125
128
  }, u = (e, t) => $("blank")(e, t);
126
129
  u.error = $("error");
127
130
  u.success = $("success");
@@ -129,37 +132,37 @@ u.loading = $("loading");
129
132
  u.custom = $("custom");
130
133
  u.dismiss = (e, t) => {
131
134
  let a = { type: 3, toastId: e };
132
- t ? D(t)(a) : X(a);
135
+ t ? q(t)(a) : oe(a);
133
136
  };
134
137
  u.dismissAll = (e) => u.dismiss(void 0, e);
135
138
  u.remove = (e, t) => {
136
139
  let a = { type: 4, toastId: e };
137
- t ? D(t)(a) : X(a);
140
+ t ? q(t)(a) : oe(a);
138
141
  };
139
142
  u.removeAll = (e) => u.remove(void 0, e);
140
143
  u.promise = (e, t, a) => {
141
144
  let s = u.loading(t.loading, { ...a, ...a == null ? void 0 : a.loading });
142
145
  return typeof e == "function" && (e = e()), e.then((i) => {
143
- let o = t.success ? C(t.success, i) : void 0;
146
+ let o = t.success ? D(t.success, i) : void 0;
144
147
  return o ? u.success(o, { id: s, ...a, ...a == null ? void 0 : a.success }) : u.dismiss(s), i;
145
148
  }).catch((i) => {
146
- let o = t.error ? C(t.error, i) : void 0;
149
+ let o = t.error ? D(t.error, i) : void 0;
147
150
  o ? u.error(o, { id: s, ...a, ...a == null ? void 0 : a.error }) : u.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 Oe = 1e3, De = (e, t = "default") => {
154
+ let { toasts: a, pausedAt: s } = Ee(e, t), i = Y(/* @__PURE__ */ new Map()).current, o = j((d, m = Oe) => {
155
+ if (i.has(d)) return;
153
156
  let g = setTimeout(() => {
154
- i.delete(c), r({ type: 4, toastId: c });
157
+ i.delete(d), r({ type: 4, toastId: d });
155
158
  }, m);
156
- i.set(c, g);
159
+ i.set(d, g);
157
160
  }, []);
158
- I(() => {
161
+ S(() => {
159
162
  if (s) return;
160
- let c = Date.now(), m = a.map((g) => {
163
+ let d = Date.now(), m = a.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 - (d - g.createdAt);
163
166
  if (E < 0) {
164
167
  g.visible && u.dismiss(g.id);
165
168
  return;
@@ -170,26 +173,26 @@ var ke = 1e3, _e = (e, t = "default") => {
170
173
  m.forEach((g) => g && clearTimeout(g));
171
174
  };
172
175
  }, [a, s, t]);
173
- let r = _(D(t), [t]), n = _(() => {
176
+ let r = j(q(t), [t]), n = j(() => {
174
177
  r({ type: 5, time: Date.now() });
175
- }, [r]), l = _((c, m) => {
176
- r({ type: 1, toast: { id: c, height: m } });
177
- }, [r]), d = _(() => {
178
+ }, [r]), l = j((d, m) => {
179
+ r({ type: 1, toast: { id: d, height: m } });
180
+ }, [r]), p = j(() => {
178
181
  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
+ }, [s, r]), c = j((d, m) => {
183
+ let { reverseOrder: g = !1, gutter: E = 8, defaultPosition: G } = m || {}, I = a.filter((b) => (b.position || G) === (d.position || G) && b.height), me = I.findIndex((b) => b.id === d.id), U = I.filter((b, P) => P < me && b.visible).length;
184
+ return I.filter((b) => b.visible).slice(...g ? [U + 1] : [0, U]).reduce((b, P) => b + (P.height || 0) + E, 0);
182
185
  }, [a]);
183
- return I(() => {
184
- a.forEach((c) => {
185
- if (c.dismissed) o(c.id, c.removeDelay);
186
+ return S(() => {
187
+ a.forEach((d) => {
188
+ if (d.dismissed) o(d.id, d.removeDelay);
186
189
  else {
187
- let m = i.get(c.id);
188
- m && (clearTimeout(m), i.delete(c.id));
190
+ let m = i.get(d.id);
191
+ m && (clearTimeout(m), i.delete(d.id));
189
192
  }
190
193
  });
191
- }, [a, o]), { toasts: a, handlers: { updateHeight: l, startPause: n, endPause: d, calculateOffset: p } };
192
- }, $e = v`
194
+ }, [a, o]), { toasts: a, handlers: { updateHeight: l, startPause: n, endPause: p, calculateOffset: c } };
195
+ }, Ae = 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
+ }`, qe = 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
+ }`, Ie = 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
+ }`, Pe = _("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: ${Ae} 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: ${qe} 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: ${Ie} 0.15s ease-out forwards;
246
249
  animation-delay: 180ms;
247
250
  transform: rotate(90deg);
248
251
  }
249
- `, Ce = v`
252
+ `, Se = 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
+ `, Ce = _("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: ${Se} 1s linear infinite;
268
+ `, Re = 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
+ }`, Fe = 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
+ }`, Le = _("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: ${Re} 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: ${Fe} 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
+ `, Me = _("div")`
315
318
  position: absolute;
316
- `, Se = w("div")`
319
+ `, He = _("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
+ `, Ge = 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
+ }`, Ue = _("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: ${Ge} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
337
340
  forwards;
338
- `, Fe = ({ toast: e }) => {
341
+ `, We = ({ toast: e }) => {
339
342
  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) => `
343
+ return t !== void 0 ? typeof t == "string" ? f.createElement(Ue, null, t) : t : a === "blank" ? null : f.createElement(He, null, f.createElement(Ce, { ...s }), a !== "loading" && f.createElement(Me, null, a === "error" ? f.createElement(Pe, { ...s }) : f.createElement(Le, { ...s })));
344
+ }, Be = (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
+ `, Ye = (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
+ `, Ze = "0%{opacity:0;} 100%{opacity:1;}", Ke = "0%{opacity:1;} 100%{opacity:0;}", Qe = _("div")`
348
351
  display: flex;
349
352
  align-items: center;
350
353
  background: #fff;
@@ -356,22 +359,22 @@ to {
356
359
  pointer-events: auto;
357
360
  padding: 8px 10px;
358
361
  border-radius: 8px;
359
- `, Ge = w("div")`
362
+ `, Ve = _("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
+ `, Je = (e, t) => {
370
+ let a = e.includes("top") ? 1 : -1, [s, i] = te() ? [Ze, Ke] : [Be(a), Ye(a)];
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
+ }, Xe = f.memo(({ toast: e, position: t, style: a, children: s }) => {
373
+ let i = e.height ? Je(e.position || t || "top-center", e.visible) : { opacity: 0 }, o = f.createElement(We, { toast: e }), r = f.createElement(Ve, { ...e.ariaProps }, D(e.message, e));
374
+ return f.createElement(Qe, { className: e.className, style: { ...i, ...a, ...e.style } }, typeof s == "function" ? s({ icon: o, message: r }) : f.createElement(f.Fragment, null, o, r));
372
375
  });
373
- fe(f.createElement);
374
- var Ye = ({ id: e, className: t, style: a, onHeightUpdate: s, children: i }) => {
376
+ _e(f.createElement);
377
+ var et = ({ id: e, className: t, style: a, onHeightUpdate: s, children: i }) => {
375
378
  let o = f.useCallback((r) => {
376
379
  if (r) {
377
380
  let n = () => {
@@ -382,80 +385,187 @@ var Ye = ({ id: e, className: t, style: a, onHeightUpdate: s, children: i }) =>
382
385
  }
383
386
  }, [e, s]);
384
387
  return f.createElement("div", { ref: o, className: t, style: a }, i);
385
- }, Ze = (e, t) => {
388
+ }, tt = (e, t) => {
386
389
  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`
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 * (a ? 1 : -1)}px)`, ...s, ...i };
391
+ }, at = A`
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
+ `, T = 16, ie = ({ reverseOrder: e, position: t = "top-center", toastOptions: a, gutter: s, children: i, toasterId: o, containerStyle: r, containerClassName: n }) => {
397
+ let { toasts: l, handlers: p } = De(a, o);
398
+ return f.createElement("div", { "data-rht-toaster": o || "", style: { position: "fixed", zIndex: 9999, top: T, left: T, right: T, bottom: T, pointerEvents: "none", ...r }, className: n, onMouseEnter: p.startPause, onMouseLeave: p.endPause }, l.map((c) => {
399
+ let d = c.position || t, m = p.calculateOffset(c, { reverseOrder: e, gutter: s, defaultPosition: t }), g = tt(d, m);
400
+ return f.createElement(et, { id: c.id, key: c.id, onHeightUpdate: p.updateHeight, className: c.visible ? at : "", style: g }, c.type === "custom" ? D(c.message, c) : i ? i(c) : f.createElement(Xe, { toast: c, position: d }));
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,
403
+ const rt = "_root_q0jyz_2", st = "_icon_q0jyz_17", ot = "_progress_q0jyz_40", it = "_snackbar_q0jyz_63", nt = "_growl_q0jyz_71", lt = "_content_q0jyz_79", ct = "_title_q0jyz_91", H = {
404
+ root: rt,
405
+ icon: st,
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: ot,
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: it,
415
+ growl: nt,
416
+ content: lt,
417
+ "close-button": "_close-button_q0jyz_85",
418
+ title: ct
419
+ }, N = L(H), ne = Z(
420
+ ({
421
+ children: e,
422
+ className: t,
423
+ cta: a,
424
+ duration: s,
425
+ hasCloseButton: i = !0,
426
+ onClose: o,
427
+ showProgressBar: r = !1,
428
+ title: n,
429
+ variant: l = "info",
430
+ ...p
431
+ }, c) => /* @__PURE__ */ k(
432
+ "div",
412
433
  {
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 })
434
+ className: N("root", `variant-${l}`, t),
435
+ "data-wui-persistent": !0,
436
+ onClick: (d) => d.stopPropagation(),
437
+ ref: c,
438
+ ...p,
439
+ children: [
440
+ /* @__PURE__ */ k("div", { className: N("growl"), children: [
441
+ l ? /* @__PURE__ */ y(V, { className: N("icon"), name: pe[l], size: "lg" }) : null,
442
+ /* @__PURE__ */ k("div", { className: N("content"), children: [
443
+ /* @__PURE__ */ k("span", { children: [
444
+ /* @__PURE__ */ y(C, { variant: "body-md-strong", children: n }),
445
+ /* @__PURE__ */ y(C, { variant: "body-md", children: e })
446
+ ] }),
447
+ a ? /* @__PURE__ */ y(B, { children: a }) : null
448
+ ] }),
449
+ i ? /* @__PURE__ */ y(
450
+ Q,
451
+ {
452
+ className: N("close-button"),
453
+ onClick: (d) => {
454
+ d.preventDefault(), d.stopPropagation(), o == null || o();
455
+ },
456
+ size: "sm"
457
+ }
458
+ ) : null
459
+ ] }),
460
+ /* @__PURE__ */ y(
461
+ "div",
462
+ {
463
+ className: N(r && "progress"),
464
+ style: {
465
+ "--duration": i ? `${s}ms` : "5000ms"
466
+ },
467
+ children: /* @__PURE__ */ y("div", { className: N("progress-bar") })
468
+ }
469
+ )
470
+ ]
419
471
  }
420
472
  )
421
473
  );
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,
474
+ ne.displayName = "Toast.Growl";
475
+ const le = J((e, t) => /* @__PURE__ */ y(K, { ref: t, size: "md", variant: "secondary", ...e }));
476
+ le.displayName = "Toast.GrowlAction";
477
+ const z = L(H), ce = Z(
478
+ ({
479
+ children: e,
480
+ className: t,
481
+ cta: a,
482
+ duration: s,
483
+ hasCloseButton: i = !0,
484
+ hideProgressBar: o = !1,
485
+ onClose: r,
486
+ variant: n = "info",
487
+ ...l
488
+ }, p) => /* @__PURE__ */ k(
489
+ "div",
426
490
  {
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
491
+ className: z("root", `variant-${n}`, t),
492
+ "data-wui-persistent": !0,
493
+ onClick: (c) => c.stopPropagation(),
494
+ ref: p,
495
+ ...l,
496
+ children: [
497
+ /* @__PURE__ */ k("div", { className: z("snackbar"), children: [
498
+ n ? /* @__PURE__ */ y(V, { className: z("icon"), name: pe[n], size: "lg" }) : null,
499
+ /* @__PURE__ */ y(C, { variant: "body-md-strong", children: e }),
500
+ a ? /* @__PURE__ */ y(B, { children: a }) : null,
501
+ i ? /* @__PURE__ */ y(
502
+ Q,
503
+ {
504
+ onClick: (c) => {
505
+ c.preventDefault(), c.stopPropagation(), r == null || r();
506
+ },
507
+ size: "sm"
508
+ }
509
+ ) : null
510
+ ] }),
511
+ /* @__PURE__ */ y(
512
+ "div",
513
+ {
514
+ className: z("progress", o && "hide-progress-bar"),
515
+ style: {
516
+ "--duration": i ? `${s}ms` : "5000ms"
517
+ },
518
+ children: /* @__PURE__ */ y("div", { className: z("progress-bar") })
519
+ }
520
+ )
521
+ ]
434
522
  }
435
523
  )
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) => {
524
+ );
525
+ ce.displayName = "Toast.Snackbar";
526
+ const de = J((e, t) => /* @__PURE__ */ y(K, { ref: t, size: "md", variant: "secondary", ...e }));
527
+ de.displayName = "Toast.SnackbarAction";
528
+ const dt = L(H), pe = {
529
+ error: "exclamation-octagon",
530
+ info: "info-circle",
531
+ success: "check-circle",
532
+ warning: "exclamation-triangle"
533
+ }, pt = {
534
+ error: 8e3,
535
+ info: 7e3,
536
+ success: 7e3,
537
+ warning: 8e3
538
+ }, ue = ({ children: e, className: t, ...a }) => /* @__PURE__ */ y("p", { className: dt("title", t), ...a, children: e });
539
+ ue.displayName = "Toast.Title";
540
+ const xt = (e, t) => {
439
541
  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,
542
+ t != null && t.onClose && t.onClose(), u.dismiss(t == null ? void 0 : t.id);
543
+ }, o = e.props.variant || "info", r = {
544
+ duration: pt[o],
443
545
  position: s,
444
546
  style: {
445
547
  backgroundColor: "transparent",
446
548
  boxShadow: "none",
549
+ maxWidth: "100%",
447
550
  padding: 0
448
551
  },
449
552
  ...t
450
553
  };
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
554
+ return u(
555
+ ge(e, { duration: r.duration, onClose: i }),
556
+ r
557
+ );
558
+ };
559
+ ie.displayName = "Toast";
560
+ const wt = Object.assign(ie, {
561
+ Growl: ne,
562
+ GrowlAction: le,
563
+ Snackbar: ce,
564
+ SnackbarAction: de,
565
+ Title: ue
457
566
  });
458
567
  export {
459
- mt as Toast,
460
- ut as toast
568
+ pe as ICON,
569
+ wt as Toast,
570
+ xt as toast
461
571
  };