@tmlmobilidade/ui 0.0.4 → 20250124.1545.56

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.
@@ -11,3 +11,4 @@ export { default as Switch } from './Switch';
11
11
  export { default as Slider } from './Slider';
12
12
  export { default as ActionIcon } from './ActionIcon';
13
13
  export { default as Menu } from './Menu';
14
+ export * from './AppLogos';
@@ -2,4 +2,3 @@ export * from './common';
2
2
  export * from './layout';
3
3
  export * from './datatable';
4
4
  export * from './theme';
5
- export * from './authentication';
@@ -0,0 +1,64 @@
1
+ import { NotificationData } from '@mantine/notifications';
2
+ export interface ToastProps extends NotificationData {
3
+ type?: 'error' | 'info' | 'success' | 'warning';
4
+ }
5
+ export interface ToastPromiseParams {
6
+ error?: string;
7
+ pending?: string;
8
+ success?: string;
9
+ }
10
+ declare class Toast {
11
+ /**
12
+ * Hides all toasts
13
+ */
14
+ clean(): void;
15
+ /**
16
+ * Shows an error toast
17
+ * @param props - The toast props
18
+ */
19
+ error(props: Omit<ToastProps, 'type'>): string;
20
+ /**
21
+ * Hides specific toast
22
+ * @param id - The toast id
23
+ */
24
+ hide(id: string): void;
25
+ /**
26
+ * Shows an info toast
27
+ * @param props - The toast props
28
+ */
29
+ info(props: Omit<ToastProps, 'type'>): string;
30
+ /**
31
+ * Shows a loading toast
32
+ * @param props - The toast props
33
+ */
34
+ loading(props: Omit<ToastProps, 'loading' | 'type'>): string;
35
+ /**
36
+ * Promise wrapper for toast
37
+ * @param promise - The promise to be wrapped
38
+ * @param statusMessages - The status messages for the promise
39
+ */
40
+ promise<T>(promise: (() => Promise<T>) | Promise<T>, { error, pending, success }: ToastPromiseParams): void;
41
+ /**
42
+ * Shows a toast
43
+ * @param props - The toast props
44
+ */
45
+ show(props: ToastProps): string;
46
+ /**
47
+ * Shows a success toast
48
+ * @param props - The toast props
49
+ */
50
+ success(props: Omit<ToastProps, 'type'>): string;
51
+ /**
52
+ * Updates a toast given its id
53
+ * @param id - The toast id
54
+ * @param props - The toast props
55
+ */
56
+ update(id: string, props: ToastProps): void;
57
+ /**
58
+ * Shows a warning toast
59
+ * @param props - The toast props
60
+ */
61
+ warning(props: Omit<ToastProps, 'type'>): string;
62
+ }
63
+ export declare const useToast: Toast;
64
+ export {};
@@ -1,4 +1,5 @@
1
1
  import "./styles/index.css";
2
2
  export * from "./components";
3
3
  export * from "./hooks/use-screen-size";
4
+ export * from "./hooks/toast";
4
5
  export * from "@mantine/hooks";