@verifiedinc-public/shared-ui-elements 0.13.2-beta.7 → 0.14.0
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/package.json
CHANGED
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
import {
|
10
10
|
closeSnackbar,
|
11
11
|
type CustomContentProps,
|
12
|
-
enqueueSnackbar,
|
12
|
+
enqueueSnackbar as _enqueueSnackbar,
|
13
13
|
SnackbarContent,
|
14
14
|
type SnackbarKey,
|
15
15
|
SnackbarProvider,
|
@@ -51,30 +51,24 @@ interface CustomAlertComponentProps extends Partial<CustomContentProps> {
|
|
51
51
|
* Hook to manage snackbar messages
|
52
52
|
* It wraps the enqueueSnackbar and closeSnackbar functions from the notistack library
|
53
53
|
* @returns
|
54
|
-
* -
|
54
|
+
* - enqueueSnackbar: Function to enqueue a snackbar message
|
55
55
|
* - closeSnackbar: Function to close one or all snackbar messages
|
56
56
|
* @see https://notistack.com/api-reference
|
57
57
|
*/
|
58
58
|
export function useSnackbar(): {
|
59
|
-
|
59
|
+
enqueueSnackbar: (
|
60
60
|
message: string,
|
61
61
|
severity?: AlertColor,
|
62
62
|
options?: Omit<CustomAlertComponentProps, 'severity'>,
|
63
63
|
) => void;
|
64
64
|
closeSnackbar: (key?: SnackbarKey) => void;
|
65
65
|
} {
|
66
|
-
const
|
66
|
+
const enqueueSnackbar = (
|
67
67
|
message: string,
|
68
68
|
severity: AlertColor = 'success',
|
69
69
|
options?: Omit<CustomAlertComponentProps, 'severity'>,
|
70
70
|
): void => {
|
71
|
-
|
72
|
-
severity,
|
73
|
-
variant: 'customAlertComponent',
|
74
|
-
persist: true,
|
75
|
-
...options,
|
76
|
-
});
|
77
|
-
enqueueSnackbar(message, {
|
71
|
+
_enqueueSnackbar(message, {
|
78
72
|
severity,
|
79
73
|
variant: 'customAlertComponent',
|
80
74
|
persist: true,
|
@@ -82,7 +76,7 @@ export function useSnackbar(): {
|
|
82
76
|
});
|
83
77
|
};
|
84
78
|
|
85
|
-
return {
|
79
|
+
return { enqueueSnackbar, closeSnackbar };
|
86
80
|
}
|
87
81
|
|
88
82
|
/**
|