@danxbot/ui 4.1.2 → 4.1.3
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/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/Toast.d.ts +9 -1
- package/package.json +1 -1
|
@@ -26,6 +26,14 @@ export interface ToastOptions {
|
|
|
26
26
|
label: string;
|
|
27
27
|
onClick: () => void;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Called when this toast leaves the stack — by its own close button, by
|
|
31
|
+
* swipe, by timeout, or by a caller's own `close(id)`. For a caller that
|
|
32
|
+
* needs to know WHETHER a toast it raised is still up (a reopen affordance
|
|
33
|
+
* beside a dismissed notification, say) without holding a reference to the
|
|
34
|
+
* manager itself.
|
|
35
|
+
*/
|
|
36
|
+
onClose?: () => void;
|
|
29
37
|
}
|
|
30
38
|
/**
|
|
31
39
|
* Raise toasts from anywhere under `ToastProvider`.
|
|
@@ -35,7 +43,7 @@ export interface ToastOptions {
|
|
|
35
43
|
* one operation makes the stack tell a story nobody asked for.
|
|
36
44
|
*/
|
|
37
45
|
export declare function useToast(): {
|
|
38
|
-
show({ title, description, tone, timeout, action }: ToastOptions): string;
|
|
46
|
+
show({ title, description, tone, timeout, action, onClose }: ToastOptions): string;
|
|
39
47
|
promise<T>(promise: Promise<T>, messages: {
|
|
40
48
|
loading: ReactNode;
|
|
41
49
|
success: ReactNode;
|