@appcorp/app-corp-vista 0.1.86 → 0.1.89
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/package.json +1 -1
- package/utils/generate-toast.d.ts +2 -0
- package/utils/generate-toast.js +37 -3
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { VISTA_NOTIFICATION_V1_VARIANT } from "../type/vista-notification-type";
|
|
2
3
|
interface Params {
|
|
3
4
|
description: string;
|
|
4
5
|
variant: VISTA_NOTIFICATION_V1_VARIANT;
|
|
5
6
|
}
|
|
6
7
|
export declare const generateToast: ({ variant, description }: Params) => void;
|
|
8
|
+
export declare const VistaToaster: React.FC<import("react-hot-toast").ToasterProps>;
|
|
7
9
|
export {};
|
package/utils/generate-toast.js
CHANGED
|
@@ -1,14 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateToast = void 0;
|
|
39
|
+
exports.VistaToaster = exports.generateToast = void 0;
|
|
7
40
|
var react_1 = __importDefault(require("react"));
|
|
8
41
|
var vista_notification_v1_1 = require("../molecules/vista-notification-v1/vista-notification-v1");
|
|
9
|
-
var react_hot_toast_1 = require("react-hot-toast");
|
|
42
|
+
var react_hot_toast_1 = __importStar(require("react-hot-toast"));
|
|
10
43
|
var generateToast = function (_a) {
|
|
11
44
|
var variant = _a.variant, description = _a.description;
|
|
12
|
-
var toastId = react_hot_toast_1.
|
|
45
|
+
var toastId = react_hot_toast_1.default.custom(react_1.default.createElement(vista_notification_v1_1.VistaNotificationV1, { description: description, handleIsVisible: function () { return react_hot_toast_1.default.dismiss(toastId); }, isVisible: true, variant: variant }));
|
|
13
46
|
};
|
|
14
47
|
exports.generateToast = generateToast;
|
|
48
|
+
exports.VistaToaster = react_hot_toast_1.Toaster;
|