@gustavo-valsechi/client 1.4.182 → 1.4.184
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.
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { ITheme } from "../interfaces";
|
|
1
2
|
export declare class Toaster {
|
|
2
|
-
static
|
|
3
|
-
type: "success" | "error";
|
|
4
|
-
message: string;
|
|
5
|
-
}) => Promise<void>;
|
|
3
|
+
static provider: (theme: keyof ITheme) => import("react/jsx-runtime").JSX.Element;
|
|
6
4
|
static success: (message?: string) => string;
|
|
7
5
|
static error: (message?: string) => string;
|
|
8
|
-
static buildMessage
|
|
6
|
+
private static buildMessage;
|
|
9
7
|
}
|
|
@@ -32,13 +32,25 @@ __export(toaster_exports, {
|
|
|
32
32
|
Toaster: () => Toaster
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(toaster_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react_hot_toast = require("react-hot-toast");
|
|
36
37
|
var import_lodash = __toESM(require("lodash"));
|
|
37
38
|
const _Toaster = class _Toaster {
|
|
38
39
|
};
|
|
39
|
-
_Toaster.
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
_Toaster.provider = (theme) => {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_react_hot_toast.Toaster,
|
|
43
|
+
{
|
|
44
|
+
position: "top-center",
|
|
45
|
+
reverseOrder: false,
|
|
46
|
+
containerStyle: {
|
|
47
|
+
fontSize: ".85rem",
|
|
48
|
+
fontWeight: "500",
|
|
49
|
+
background: theme === "light" ? "#fff" : "#333",
|
|
50
|
+
color: theme === "light" ? "#333" : "#fff"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
42
54
|
};
|
|
43
55
|
_Toaster.success = (message = "") => {
|
|
44
56
|
return import_react_hot_toast.toast.success(_Toaster.buildMessage(message));
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { toast, Toaster as Provider } from "react-hot-toast";
|
|
3
4
|
import _ from "lodash";
|
|
4
5
|
const _Toaster = class _Toaster {
|
|
5
6
|
};
|
|
6
|
-
_Toaster.
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_Toaster.provider = (theme) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Provider,
|
|
10
|
+
{
|
|
11
|
+
position: "top-center",
|
|
12
|
+
reverseOrder: false,
|
|
13
|
+
containerStyle: {
|
|
14
|
+
fontSize: ".85rem",
|
|
15
|
+
fontWeight: "500",
|
|
16
|
+
background: theme === "light" ? "#fff" : "#333",
|
|
17
|
+
color: theme === "light" ? "#333" : "#fff"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
9
21
|
};
|
|
10
22
|
_Toaster.success = (message = "") => {
|
|
11
23
|
return toast.success(_Toaster.buildMessage(message));
|