@trackunit/react-core-contexts-api 1.8.4 → 1.8.5
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/package.json +1 -1
- package/src/toastContext.d.ts +32 -0
package/package.json
CHANGED
package/src/toastContext.d.ts
CHANGED
|
@@ -6,11 +6,43 @@ export type ToastAction = {
|
|
|
6
6
|
};
|
|
7
7
|
export interface Toast {
|
|
8
8
|
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Visual intent of the toast.
|
|
11
|
+
*/
|
|
9
12
|
intent: ToastColors;
|
|
13
|
+
/**
|
|
14
|
+
* Toast title.
|
|
15
|
+
*/
|
|
10
16
|
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Toast description/message.
|
|
19
|
+
*/
|
|
11
20
|
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Controls dismissal model of the toast.
|
|
23
|
+
* - "timed": auto-dismiss after duration (default)
|
|
24
|
+
* - "persistent": user must close manually (X button)
|
|
25
|
+
*/
|
|
26
|
+
behavior?: "timed" | "persistent";
|
|
27
|
+
/**
|
|
28
|
+
* Optional single link rendered inside the toast (max 1).
|
|
29
|
+
* - If a link is present and behavior is omitted → treat as "persistent" (guideline)
|
|
30
|
+
* - If behavior is explicitly "timed" AND link is present → default duration is 10000ms
|
|
31
|
+
*/
|
|
32
|
+
link?: {
|
|
33
|
+
label: string;
|
|
34
|
+
onClick: (event: React.MouseEventHandler<HTMLButtonElement>) => void;
|
|
35
|
+
};
|
|
36
|
+
/** @deprecated not shown in UI; kept for backward compatibility */
|
|
12
37
|
primaryAction?: ToastAction;
|
|
38
|
+
/** @deprecated not shown in UI; kept for backward compatibility */
|
|
13
39
|
secondaryAction?: ToastAction;
|
|
40
|
+
/**
|
|
41
|
+
* Auto-dismiss timeout in milliseconds when behavior is "timed".
|
|
42
|
+
* Defaults:
|
|
43
|
+
* - 6000ms for regular timed toasts
|
|
44
|
+
* - 10000ms if a link is present and behavior is explicitly set to "timed"
|
|
45
|
+
*/
|
|
14
46
|
duration?: number;
|
|
15
47
|
}
|
|
16
48
|
export interface IToastContext {
|