@up42/up-components 2.8.0 → 2.9.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.
@@ -1,2 +1,3 @@
1
1
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
+ export declare const CONTAINER_MAX_WIDTH = 1280;
2
3
  export declare const MuiContainer: OverridesStyleRules;
@@ -1,4 +1,5 @@
1
1
  import { ElementType, ReactNode } from 'react';
2
+ import { Fade, GrowProps, SnackbarProps as MUISnackbarProps, SlideProps } from '@mui/material';
2
3
  import { AlertColor } from '../../../components/Alert/Alert';
3
4
  export declare type CreateAlertProps = {
4
5
  title?: string;
@@ -9,6 +10,36 @@ export declare type CreateAlertProps = {
9
10
  */
10
11
  duration?: number;
11
12
  };
13
+ /**
14
+ * Props for creating a snackbar.
15
+ */
16
+ export declare type CreateSnackbarProps = {
17
+ /**
18
+ * The message to be displayed in the snackbar.
19
+ */
20
+ message: string | ReactNode;
21
+ /**
22
+ * The type of the snackbar. Optional.
23
+ */
24
+ type?: AlertColor;
25
+ /**
26
+ * The duration for which the snackbar should be displayed. Optional.
27
+ */
28
+ duration?: number;
29
+ /**
30
+ * The number of columns the snackbar should occupy. Optional.
31
+ */
32
+ columns?: 2 | 4 | 6 | 8;
33
+ /**
34
+ * The transition effect for the snackbar. Optional.
35
+ */
36
+ transition?: 'slide' | 'grow' | 'fade';
37
+ } & MUISnackbarProps;
38
+ export declare const transitionComponents: {
39
+ slide: (props: SlideProps) => JSX.Element;
40
+ grow: (props: GrowProps) => JSX.Element;
41
+ fade: typeof Fade;
42
+ };
12
43
  export declare type DisplayAlertProps = CreateAlertProps & {
13
44
  id: string;
14
45
  onClose?: (id: string) => void;
@@ -18,7 +49,11 @@ declare type ContextState = {
18
49
  alertStack: DisplayAlertProps[];
19
50
  removeFromStack: (id: string) => void;
20
51
  animationTime: number;
52
+ createSnackbar: (props: CreateSnackbarProps) => void;
53
+ currentSnackbar: CreateSnackbarProps;
54
+ closeSnackbar: (props: CreateSnackbarProps) => void;
21
55
  };
56
+ export declare const defaultSnackbarState: CreateSnackbarProps;
22
57
  export declare const AlertProvider: ({ children }: {
23
58
  children: ReactNode;
24
59
  }) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const AlertStack: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SnackbarWrapper: () => JSX.Element;
@@ -55,4 +55,4 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
55
55
  export { useQueryParams } from './utils/hooks/useQueryParams';
56
56
  export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
57
57
  export { useDebounce } from './utils/hooks/useDebounce';
58
- export { useAlert, type CreateAlertProps } from './global/providers/AlertProvider/AlertProvider';
58
+ export { useAlert, type CreateAlertProps, type CreateSnackbarProps, } from './global/providers/AlertProvider/AlertProvider';