@verifiedinc-public/shared-ui-elements 0.13.1 → 0.13.2-beta.2
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/dist/components/Snackbar/index.d.ts +52 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/shared-ui-elements.mjs +4753 -4695
- package/dist/stories/components/Alert.stories.d.ts +11 -0
- package/dist/stories/components/CredentialRequestsEditor.stories.d.ts +35 -0
- package/dist/stories/components/QRCodeDisplay.stories.d.ts +41 -0
- package/dist/stories/components/TextField.stories.d.ts +44 -0
- package/dist/stories/components/Typography.stories.d.ts +54 -0
- package/dist/stories/components/VerifiedImage.stories.d.ts +28 -0
- package/dist/stories/components/form/PhoneInput.stories.d.ts +16 -0
- package/dist/stories/hooks/useCopyToClipboard.stories.d.ts +14 -0
- package/package.json +5 -3
- package/src/components/Snackbar/index.tsx +146 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +8 -0
@@ -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>>;
|
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';
|