@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.
- package/dist/cjs/index.js +400 -310
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/common/index.d.ts +1 -0
- package/dist/cjs/types/src/components/index.d.ts +0 -1
- package/dist/cjs/types/src/hooks/toast.d.ts +64 -0
- package/dist/cjs/types/src/index.d.ts +1 -0
- package/dist/esm/index.js +398 -313
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/common/index.d.ts +1 -0
- package/dist/esm/types/src/components/index.d.ts +0 -1
- package/dist/esm/types/src/hooks/toast.d.ts +64 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/dist/index.d.ts +57 -32
- package/dist/styles.css +400 -460
- package/package.json +87 -86
- package/dist/cjs/types/src/components/authentication/LoginForm/index.d.ts +0 -45
- package/dist/cjs/types/src/components/authentication/LoginForm/use-login.d.ts +0 -8
- package/dist/cjs/types/src/components/authentication/index.d.ts +0 -1
- package/dist/esm/types/src/components/authentication/LoginForm/index.d.ts +0 -45
- package/dist/esm/types/src/components/authentication/LoginForm/use-login.d.ts +0 -8
- package/dist/esm/types/src/components/authentication/index.d.ts +0 -1
|
@@ -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 {};
|