hiinformer 1.0.0 → 1.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/README.md CHANGED
@@ -0,0 +1,13 @@
1
+ CSS link `hiinformer/dist/styles/main.css`
2
+
3
+ Useage
4
+
5
+ import { useToast } from "hiinformer";
6
+
7
+ const toast = useToast();
8
+
9
+ toast.add({
10
+ title: "hello",
11
+ message: "World",
12
+ status: "warning"
13
+ });
package/dist/index.d.mts CHANGED
@@ -5,15 +5,16 @@ declare enum Status {
5
5
  Info = "info",
6
6
  Danger = "danger"
7
7
  }
8
+ type ToastStatus = Status | "default" | "success" | "warning" | "info" | "danger";
8
9
  type Toast = {
9
- status: Status;
10
+ status?: ToastStatus;
10
11
  title: string;
11
12
  message: string;
12
- timeout: number;
13
- multiple: boolean;
13
+ timeout?: number | 3;
14
+ multiple?: boolean | true;
14
15
  };
15
16
  declare const useToast: () => {
16
17
  add: (toast: Toast) => void;
17
18
  };
18
19
 
19
- export { Status, type Toast, useToast };
20
+ export { Status, type Toast, type ToastStatus, useToast };
package/dist/index.d.ts CHANGED
@@ -5,15 +5,16 @@ declare enum Status {
5
5
  Info = "info",
6
6
  Danger = "danger"
7
7
  }
8
+ type ToastStatus = Status | "default" | "success" | "warning" | "info" | "danger";
8
9
  type Toast = {
9
- status: Status;
10
+ status?: ToastStatus;
10
11
  title: string;
11
12
  message: string;
12
- timeout: number;
13
- multiple: boolean;
13
+ timeout?: number | 3;
14
+ multiple?: boolean | true;
14
15
  };
15
16
  declare const useToast: () => {
16
17
  add: (toast: Toast) => void;
17
18
  };
18
19
 
19
- export { Status, type Toast, useToast };
20
+ export { Status, type Toast, type ToastStatus, useToast };
@@ -100,7 +100,7 @@ var notify = (() => {
100
100
  );
101
101
  }
102
102
  } else {
103
- if (toast.multiple && !toast.multiple) {
103
+ if (!toast.multiple) {
104
104
  toastMain.innerHTML = alertHtmlTags;
105
105
  } else {
106
106
  toastMain.insertAdjacentHTML("beforeend", alertHtmlTags);
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ var useToast = () => {
100
100
  );
101
101
  }
102
102
  } else {
103
- if (toast.multiple && !toast.multiple) {
103
+ if (!toast.multiple) {
104
104
  toastMain.innerHTML = alertHtmlTags;
105
105
  } else {
106
106
  toastMain.insertAdjacentHTML("beforeend", alertHtmlTags);
package/dist/index.mjs CHANGED
@@ -74,7 +74,7 @@ var useToast = () => {
74
74
  );
75
75
  }
76
76
  } else {
77
- if (toast.multiple && !toast.multiple) {
77
+ if (!toast.multiple) {
78
78
  toastMain.innerHTML = alertHtmlTags;
79
79
  } else {
80
80
  toastMain.insertAdjacentHTML("beforeend", alertHtmlTags);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hiinformer",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Easy-to-use, non-intrusive toast notifications for your application.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -12,6 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "tsup src/index.ts --format esm,cjs,iife --globalName notify --dts && cpy 'src/**/*.css' dist",
15
+ "publish-package": "npm publish --access public",
15
16
  "test": "echo \"Error: no test specified\" && exit 1"
16
17
  },
17
18
  "files": [