ingeniuscliq-core 0.4.28 → 0.4.30
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../../src/components/common/toast/Toaster.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE1C,KAAK,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,GAAI,cAAc,YAAY,
|
|
1
|
+
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../../src/components/common/toast/Toaster.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE1C,KAAK,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,GAAI,cAAc,YAAY,gCAsCjD,CAAA"}
|
|
@@ -12,15 +12,20 @@ const Toaster = ({ ...props }) => {
|
|
|
12
12
|
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
13
13
|
description: "group-[.toast]:text-muted-foreground",
|
|
14
14
|
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
15
|
-
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
|
|
15
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
16
|
+
success: "group-[.toaster]:!bg-green-600 group-[.toaster]:!text-white group-[.toaster]:!border-green-700",
|
|
17
|
+
error: "group-[.toaster]:!bg-red-600 group-[.toaster]:!text-white group-[.toaster]:!border-red-700",
|
|
18
|
+
info: "group-[.toaster]:!bg-blue-600 group-[.toaster]:!text-white group-[.toaster]:!border-blue-700",
|
|
19
|
+
warning: "group-[.toaster]:!bg-yellow-600 group-[.toaster]:!text-white group-[.toaster]:!border-yellow-700",
|
|
20
|
+
loading: "group-[.toaster]:!bg-gray-600 group-[.toaster]:!text-white group-[.toaster]:!border-gray-700"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
icons: {
|
|
19
|
-
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
20
|
-
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
21
|
-
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
22
|
-
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
23
|
-
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
|
|
24
|
+
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4 text-white" }),
|
|
25
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4 text-white" }),
|
|
26
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4 text-white" }),
|
|
27
|
+
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4 text-white" }),
|
|
28
|
+
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin text-white" })
|
|
24
29
|
},
|
|
25
30
|
style: {
|
|
26
31
|
"--normal-bg": "var(--popover)",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export type ToastType = 'default' | 'success' | 'error' | 'info' | 'warning' | 'loading';
|
|
1
2
|
export declare function useNotify(): {
|
|
2
|
-
notify: (title: string, description?: string, duration?: number, action?: {
|
|
3
|
+
notify: (title: string, description?: string, type?: ToastType, duration?: number, action?: {
|
|
3
4
|
label: string;
|
|
4
5
|
onClick: () => void;
|
|
5
6
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotification.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,IAAI;IACzB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotification.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzF,wBAAgB,SAAS,IAAI;IACzB,MAAM,EAAE,CACJ,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,SAAS,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACvB,KACA,IAAI,CAAC;CACb,CAoBA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { toast } from 'sonner';
|
|
2
2
|
|
|
3
3
|
function useNotify() {
|
|
4
|
-
const notify = (title, description, duration = 3e3, action) => {
|
|
5
|
-
toast
|
|
4
|
+
const notify = (title, description, type = "default", duration = 3e3, action) => {
|
|
5
|
+
const toastFn = type === "default" ? toast : toast[type];
|
|
6
|
+
toastFn(title, {
|
|
6
7
|
description,
|
|
7
8
|
duration,
|
|
8
9
|
action: action ? {
|