kitzo 2.3.43 → 2.3.45
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/react/components/toast/Toaster.js +97 -97
- package/dist/react/components/toast/helpers/addToastStyles.js +295 -295
- package/dist/react/components/toast/helpers/createToast.js +50 -50
- package/dist/react/components/toast/helpers/listenars.js +31 -24
- package/dist/react/components/toast/helpers/manageToasts/addToasts.js +11 -11
- package/dist/react/components/toast/helpers/manageToasts/dismissToasts.js +19 -19
- package/dist/react/components/toast/helpers/manageToasts/swipeClose.js +76 -76
- package/dist/react/components/toast/helpers/manageToasts/timers.js +73 -73
- package/dist/react/components/toast/helpers/manageToasts/updateToasts.js +14 -14
- package/dist/react/components/toast/helpers/triggerToasts.js +103 -99
- package/dist/react/components/toast/partials/Toast.js +84 -84
- package/package.json +1 -1
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { jsxs as x, jsx as t, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import { resumeToast as p, pauseToast as u } from "../helpers/manageToasts/timers.js";
|
|
3
|
-
import S from "../helpers/triggerToasts.js";
|
|
4
|
-
import { InfoSvg as w, ErrorSvg as I, WarningSvg as E, SuccessSvg as k, LoadingSvg as L } from "./Svgs.js";
|
|
5
|
-
import { useToasterContext as M } from "../context/ToasterContext.js";
|
|
6
|
-
function P({
|
|
7
|
-
t: d,
|
|
8
|
-
position: n,
|
|
9
|
-
shouldAnimateTransformOrigin: c,
|
|
10
|
-
swipeToClose: m
|
|
11
|
-
}) {
|
|
12
|
-
const { pauseOnHover: o } = M(), {
|
|
13
|
-
id: e,
|
|
14
|
-
type: r,
|
|
15
|
-
action: f,
|
|
16
|
-
content: i,
|
|
17
|
-
status: g,
|
|
18
|
-
showIcon: v,
|
|
19
|
-
icon: a,
|
|
20
|
-
toasterId: h,
|
|
21
|
-
updateState: y
|
|
22
|
-
} = d, l = {
|
|
23
|
-
loading: /* @__PURE__ */ t(L, {}),
|
|
24
|
-
success: /* @__PURE__ */ t(k, {}),
|
|
25
|
-
warning: /* @__PURE__ */ t(E, {}),
|
|
26
|
-
error: /* @__PURE__ */ t(I, {}),
|
|
27
|
-
info: /* @__PURE__ */ t(w, {}),
|
|
28
|
-
default: null,
|
|
29
|
-
custom: null
|
|
30
|
-
};
|
|
31
|
-
return /* @__PURE__ */ x(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
id: e,
|
|
35
|
-
style: {
|
|
36
|
-
pointerEvents: "all",
|
|
37
|
-
display: "flex",
|
|
38
|
-
alignItems: "center",
|
|
39
|
-
gap: 8,
|
|
40
|
-
whiteSpace: "pre-wrap"
|
|
41
|
-
},
|
|
42
|
-
"data-toaster-id": h,
|
|
43
|
-
"data-action": f,
|
|
44
|
-
"data-status": g,
|
|
45
|
-
"data-type": r,
|
|
46
|
-
"data-position": n,
|
|
47
|
-
"data-screen-x": n.split("-")[1],
|
|
48
|
-
"data-screen-y": n.split("-")[0],
|
|
49
|
-
"data-exit": "auto",
|
|
50
|
-
"data-swipeable": m,
|
|
51
|
-
"data-animate-transform-origin": c,
|
|
52
|
-
"data-update-state": y,
|
|
53
|
-
onPointerEnter: () => o && u(e),
|
|
54
|
-
onPointerLeave: () => o && p(e),
|
|
55
|
-
onMouseEnter: () => o && u(e),
|
|
56
|
-
onMouseLeave: () => o && p(e),
|
|
57
|
-
className: `kitzo-toast ${c ? `transform-origin-${n}` : ""}`,
|
|
58
|
-
children: [
|
|
59
|
-
v && /* @__PURE__ */ t(s, { children: a ? /* @__PURE__ */ t(s, { children: typeof a == "string" || typeof a == "number" ? /* @__PURE__ */ t(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
style: {
|
|
63
|
-
flexShrink: 0
|
|
64
|
-
},
|
|
65
|
-
className: "svg-container",
|
|
66
|
-
children: a
|
|
67
|
-
}
|
|
68
|
-
) : /* @__PURE__ */ t(s, { children: a }) }) : /* @__PURE__ */ t(s, { children: l[r] && /* @__PURE__ */ t("div", { style: { flexShrink: 0 }, className: "svg-container", children: l[r] }) }) }),
|
|
69
|
-
/* @__PURE__ */ t(
|
|
70
|
-
"div",
|
|
71
|
-
{
|
|
72
|
-
style: {
|
|
73
|
-
flex: 1
|
|
74
|
-
},
|
|
75
|
-
children: typeof i == "function" ? i(() => S.dismiss(e, d.toasterId)) : i
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
export {
|
|
83
|
-
P as default
|
|
84
|
-
};
|
|
1
|
+
import { jsxs as x, jsx as t, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { resumeToast as p, pauseToast as u } from "../helpers/manageToasts/timers.js";
|
|
3
|
+
import S from "../helpers/triggerToasts.js";
|
|
4
|
+
import { InfoSvg as w, ErrorSvg as I, WarningSvg as E, SuccessSvg as k, LoadingSvg as L } from "./Svgs.js";
|
|
5
|
+
import { useToasterContext as M } from "../context/ToasterContext.js";
|
|
6
|
+
function P({
|
|
7
|
+
t: d,
|
|
8
|
+
position: n,
|
|
9
|
+
shouldAnimateTransformOrigin: c,
|
|
10
|
+
swipeToClose: m
|
|
11
|
+
}) {
|
|
12
|
+
const { pauseOnHover: o } = M(), {
|
|
13
|
+
id: e,
|
|
14
|
+
type: r,
|
|
15
|
+
action: f,
|
|
16
|
+
content: i,
|
|
17
|
+
status: g,
|
|
18
|
+
showIcon: v,
|
|
19
|
+
icon: a,
|
|
20
|
+
toasterId: h,
|
|
21
|
+
updateState: y
|
|
22
|
+
} = d, l = {
|
|
23
|
+
loading: /* @__PURE__ */ t(L, {}),
|
|
24
|
+
success: /* @__PURE__ */ t(k, {}),
|
|
25
|
+
warning: /* @__PURE__ */ t(E, {}),
|
|
26
|
+
error: /* @__PURE__ */ t(I, {}),
|
|
27
|
+
info: /* @__PURE__ */ t(w, {}),
|
|
28
|
+
default: null,
|
|
29
|
+
custom: null
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ x(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
id: e,
|
|
35
|
+
style: {
|
|
36
|
+
pointerEvents: "all",
|
|
37
|
+
display: "flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
gap: 8,
|
|
40
|
+
whiteSpace: "pre-wrap"
|
|
41
|
+
},
|
|
42
|
+
"data-toaster-id": h,
|
|
43
|
+
"data-action": f,
|
|
44
|
+
"data-status": g,
|
|
45
|
+
"data-type": r,
|
|
46
|
+
"data-position": n,
|
|
47
|
+
"data-screen-x": n.split("-")[1],
|
|
48
|
+
"data-screen-y": n.split("-")[0],
|
|
49
|
+
"data-exit": "auto",
|
|
50
|
+
"data-swipeable": m,
|
|
51
|
+
"data-animate-transform-origin": c,
|
|
52
|
+
"data-update-state": y,
|
|
53
|
+
onPointerEnter: () => o && u(e),
|
|
54
|
+
onPointerLeave: () => o && p(e),
|
|
55
|
+
onMouseEnter: () => o && u(e),
|
|
56
|
+
onMouseLeave: () => o && p(e),
|
|
57
|
+
className: `kitzo-toast ${c ? `transform-origin-${n}` : ""}`,
|
|
58
|
+
children: [
|
|
59
|
+
v && /* @__PURE__ */ t(s, { children: a ? /* @__PURE__ */ t(s, { children: typeof a == "string" || typeof a == "number" ? /* @__PURE__ */ t(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
style: {
|
|
63
|
+
flexShrink: 0
|
|
64
|
+
},
|
|
65
|
+
className: "svg-container",
|
|
66
|
+
children: a
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ t(s, { children: a }) }) : /* @__PURE__ */ t(s, { children: l[r] && /* @__PURE__ */ t("div", { style: { flexShrink: 0 }, className: "svg-container", children: l[r] }) }) }),
|
|
69
|
+
/* @__PURE__ */ t(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
style: {
|
|
73
|
+
flex: 1
|
|
74
|
+
},
|
|
75
|
+
children: typeof i == "function" ? i(() => S.dismiss(e, d.toasterId)) : i
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
P as default
|
|
84
|
+
};
|