@bouku/notify 0.0.1
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/assets/icons/check-circle.svg +6 -0
- package/dist/assets/icons/x-circle.svg +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/toaster.d.ts +2 -0
- package/dist/toaster.js +26 -0
- package/package.json +60 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
|
|
2
|
+
<path
|
|
3
|
+
d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
|
|
2
|
+
<path
|
|
3
|
+
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.toast = void 0;
|
|
18
|
+
var react_hot_toast_1 = require("react-hot-toast");
|
|
19
|
+
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return react_hot_toast_1.toast; } });
|
|
20
|
+
__exportStar(require("./toaster"), exports);
|
package/dist/toaster.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isToasterMounted = exports.Toaster = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_hot_toast_1 = require("react-hot-toast");
|
|
10
|
+
const check_circle_svg_1 = __importDefault(require("./assets/icons/check-circle.svg"));
|
|
11
|
+
const x_circle_svg_1 = __importDefault(require("./assets/icons/x-circle.svg"));
|
|
12
|
+
let mounted = 0;
|
|
13
|
+
const Toaster = () => {
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
mounted++;
|
|
16
|
+
return () => { mounted--; };
|
|
17
|
+
}, []);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_hot_toast_1.Toaster, { toastOptions: {
|
|
19
|
+
className: "!pl-3 !pr-1 !py-1 !bg-surface-light !border !border-border !text-xs !text-primary-light",
|
|
20
|
+
success: { icon: (0, jsx_runtime_1.jsx)(check_circle_svg_1.default, { className: "text-success" }) },
|
|
21
|
+
error: { icon: (0, jsx_runtime_1.jsx)(x_circle_svg_1.default, { className: "text-error" }) }
|
|
22
|
+
} }));
|
|
23
|
+
};
|
|
24
|
+
exports.Toaster = Toaster;
|
|
25
|
+
const isToasterMounted = () => mounted > 0;
|
|
26
|
+
exports.isToasterMounted = isToasterMounted;
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bouku/notify",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
|
|
11
|
+
"files": [
|
|
12
|
+
|
|
13
|
+
"dist"
|
|
14
|
+
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
|
|
19
|
+
"access": "public"
|
|
20
|
+
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
"author": "",
|
|
24
|
+
|
|
25
|
+
"description": "",
|
|
26
|
+
|
|
27
|
+
"engines": {},
|
|
28
|
+
|
|
29
|
+
"scripts": {
|
|
30
|
+
|
|
31
|
+
"build": "tsc"
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
|
|
37
|
+
"react": "^19.1.1"
|
|
38
|
+
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"dependencies": {
|
|
42
|
+
|
|
43
|
+
"react-hot-toast": "^2.6.1"
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
|
|
49
|
+
"@types/react": "^19.1.10",
|
|
50
|
+
|
|
51
|
+
"dependency-cruiser": "^17.0.1",
|
|
52
|
+
|
|
53
|
+
"react": "^19.1.1",
|
|
54
|
+
|
|
55
|
+
"typescript": "^5.9.2"
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|