@js-smart/react-kit 5.21.0 → 5.22.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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * ToastContainer is a component that displays a toast notification.
3
+ * It is used to display a toast notification when a toast is shown.
4
+ * It is a wrapper around the Snackbar component from MUI.
5
+ *
6
+ * @author Pavan Kumar Jadda
7
+ * @since 5.20.0
8
+ */
9
+ export declare const ToastContainer: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { SnackbarOrigin } from '@mui/material';
2
+ type ToastType = 'success' | 'info' | 'warning' | 'error';
3
+ interface ToastState {
4
+ message: string;
5
+ open: boolean;
6
+ autoHideDuration: number;
7
+ anchorOrigin: SnackbarOrigin;
8
+ type: ToastType;
9
+ }
10
+ /**
11
+ * toastStore is a store that manages the toast notification.
12
+ * It is used to store the toast notification state and to notify listeners when the state changes.
13
+ *
14
+ * @author Pavan Kumar Jadda
15
+ * @since 5.20.0
16
+ */
17
+ export declare const toastStore: {
18
+ subscribe(callback: () => void): () => boolean;
19
+ getSnapshot(): ToastState;
20
+ show(message: string, type?: ToastType, autoHideDuration?: number): void;
21
+ close(): void;
22
+ };
23
+ export declare const toast: (msg: string, type?: ToastType) => void;
24
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@js-smart/react-kit",
3
3
  "private": false,
4
- "version": "5.21.0",
4
+ "version": "5.22.1",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "publishConfig": {