@verifiedinc-public/shared-ui-elements 0.13.0 → 0.13.2-beta.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,52 @@
1
+ import { AlertColor, SxProps } from '@mui/material';
2
+ import { CustomContentProps, SnackbarKey, SnackbarProvider } from 'notistack';
3
+ declare module 'notistack' {
4
+ interface VariantOverrides {
5
+ default: false;
6
+ success: false;
7
+ info: false;
8
+ warning: false;
9
+ error: false;
10
+ customAlertComponent: {
11
+ onAction?: (id: SnackbarKey) => void;
12
+ icon?: JSX.Element;
13
+ severity?: AlertColor;
14
+ };
15
+ }
16
+ }
17
+ export type { SnackbarKey };
18
+ export { SnackbarProvider };
19
+ interface AlertAction {
20
+ onAction?: (id: SnackbarKey) => void;
21
+ icon?: JSX.Element;
22
+ }
23
+ interface CustomAlertComponentProps extends Partial<CustomContentProps> {
24
+ severity: AlertColor;
25
+ alertAction?: AlertAction;
26
+ showCloseIcon?: boolean;
27
+ sx?: SxProps;
28
+ }
29
+ /**
30
+ * Hook to manage snackbar messages
31
+ * It wraps the enqueueSnackbar and closeSnackbar functions from the notistack library
32
+ * @returns
33
+ * - updateSnackbar: Function to enqueue a snackbar message
34
+ * - closeSnackbar: Function to close one or all snackbar messages
35
+ * @see https://notistack.com/api-reference
36
+ */
37
+ export declare function useSnackbar(): {
38
+ updateSnackbar: (message: string, severity?: AlertColor, options?: Omit<CustomAlertComponentProps, 'severity'>) => void;
39
+ closeSnackbar: (key?: SnackbarKey) => void;
40
+ };
41
+ /**
42
+ * Custom Alert component to show snackbar messages
43
+ * This is a wrapper around the notistack SnackbarContent component
44
+ *
45
+ * Use it in the SnackbarProvider Components prop:
46
+ * @see https://notistack.com/features/customization#custom-component
47
+ * @example
48
+ * <SnackbarProvider
49
+ * Components={{ customAlertComponent: CustomAlertComponent }}
50
+ * />
51
+ */
52
+ export declare const CustomAlertComponent: import('react').ForwardRefExoticComponent<CustomAlertComponentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -8,3 +8,4 @@ export * from './Image';
8
8
  export * from './form/';
9
9
  export * from './verified';
10
10
  export * from './QRCodeDisplay';
11
+ export * from './Snackbar';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * The shared-ui-elements library is a collection of reusable, customizable UI components developed for Verified Inc..
3
+ *
4
+ * @see https://github.com/VerifiedInc/shared-ui-elements
5
+ *
6
+ * @packageDocumentation
7
+ */
1
8
  export * from './components';
2
9
  export * from './hooks';
3
10
  export * from './styles';