@kala-ui/react 0.0.1-beta.2 → 0.0.1-beta.3
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,12 +1,30 @@
|
|
|
1
|
+
import { toast as sonnerToast } from "sonner";
|
|
2
|
+
type ToastOptions = Parameters<typeof sonnerToast>[1];
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Toast API that supports all Sonner options including custom icons
|
|
5
|
+
*
|
|
6
|
+
* @example Basic usage
|
|
7
|
+
* toast.success('Success message');
|
|
8
|
+
*
|
|
9
|
+
* @example With custom icon
|
|
10
|
+
* toast.success('Success message', { icon: <CustomIcon /> });
|
|
11
|
+
*
|
|
12
|
+
* @example Remove icon
|
|
13
|
+
* toast.success('Success message', { icon: null });
|
|
14
|
+
*
|
|
15
|
+
* @example Full options
|
|
16
|
+
* toast.success('Success message', {
|
|
17
|
+
* icon: <CustomIcon />,
|
|
18
|
+
* duration: 5000,
|
|
19
|
+
* position: 'top-right',
|
|
20
|
+
* });
|
|
3
21
|
*/
|
|
4
22
|
declare const toast: {
|
|
5
|
-
success: (message: string) => string | number;
|
|
6
|
-
error: (message: string) => string | number;
|
|
7
|
-
warning: (message: string) => string | number;
|
|
8
|
-
info: (message: string) => string | number;
|
|
9
|
-
loading: (message: string) => string | number;
|
|
23
|
+
success: (message: string, options?: ToastOptions) => string | number;
|
|
24
|
+
error: (message: string, options?: ToastOptions) => string | number;
|
|
25
|
+
warning: (message: string, options?: ToastOptions) => string | number;
|
|
26
|
+
info: (message: string, options?: ToastOptions) => string | number;
|
|
27
|
+
loading: (message: string, options?: ToastOptions) => string | number;
|
|
10
28
|
};
|
|
11
29
|
export { toast };
|
|
12
30
|
export { Toaster } from "./toaster";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,KAAK;uBACS,MAAM,YAAY,YAAY;qBAGhC,MAAM,YAAY,YAAY;uBAG5B,MAAM,YAAY,YAAY;oBAGjC,MAAM,YAAY,YAAY;uBAG3B,MAAM,YAAY,YAAY;CAGjD,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
import { toast as sonnerToast } from "sonner";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Toast API that supports all Sonner options including custom icons
|
|
4
|
+
*
|
|
5
|
+
* @example Basic usage
|
|
6
|
+
* toast.success('Success message');
|
|
7
|
+
*
|
|
8
|
+
* @example With custom icon
|
|
9
|
+
* toast.success('Success message', { icon: <CustomIcon /> });
|
|
10
|
+
*
|
|
11
|
+
* @example Remove icon
|
|
12
|
+
* toast.success('Success message', { icon: null });
|
|
13
|
+
*
|
|
14
|
+
* @example Full options
|
|
15
|
+
* toast.success('Success message', {
|
|
16
|
+
* icon: <CustomIcon />,
|
|
17
|
+
* duration: 5000,
|
|
18
|
+
* position: 'top-right',
|
|
19
|
+
* });
|
|
4
20
|
*/
|
|
5
21
|
const toast = {
|
|
6
|
-
success: (message) => {
|
|
7
|
-
return sonnerToast.success(message);
|
|
22
|
+
success: (message, options) => {
|
|
23
|
+
return sonnerToast.success(message, options);
|
|
8
24
|
},
|
|
9
|
-
error: (message) => {
|
|
10
|
-
return sonnerToast.error(message);
|
|
25
|
+
error: (message, options) => {
|
|
26
|
+
return sonnerToast.error(message, options);
|
|
11
27
|
},
|
|
12
|
-
warning: (message) => {
|
|
13
|
-
return sonnerToast.warning(message);
|
|
28
|
+
warning: (message, options) => {
|
|
29
|
+
return sonnerToast.warning(message, options);
|
|
14
30
|
},
|
|
15
|
-
info: (message) => {
|
|
16
|
-
return sonnerToast.info(message);
|
|
31
|
+
info: (message, options) => {
|
|
32
|
+
return sonnerToast.info(message, options);
|
|
17
33
|
},
|
|
18
|
-
loading: (message) => {
|
|
19
|
-
return sonnerToast.loading(message);
|
|
34
|
+
loading: (message, options) => {
|
|
35
|
+
return sonnerToast.loading(message, options);
|
|
20
36
|
},
|
|
21
37
|
};
|
|
22
38
|
export { toast };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,KAAK,GAAG;IACb,OAAO,EAAE,CAAC,OAAe,EAAE,OAAsB,EAAE,EAAE;QACpD,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,KAAK,EAAE,CAAC,OAAe,EAAE,OAAsB,EAAE,EAAE;QAClD,OAAO,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,EAAE,CAAC,OAAe,EAAE,OAAsB,EAAE,EAAE;QACpD,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,EAAE,CAAC,OAAe,EAAE,OAAsB,EAAE,EAAE;QACjD,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,CAAC,OAAe,EAAE,OAAsB,EAAE,EAAE;QACpD,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CACD,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kala-ui/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "65+ accessible React components built with Radix UI and Tailwind CSS. Includes DataTable with server-side support, charts, drag-and-drop, and comprehensive form controls.",
|
|
6
6
|
"keywords": [
|