@trackunit/react-core-contexts-api 0.2.18 → 0.2.19

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-contexts-api",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "module": "./index.js",
@@ -1,21 +1,20 @@
1
1
  /// <reference types="react" />
2
- export type AlertColors = "info" | "warning" | "danger" | "success";
3
- export type AlertAction = {
2
+ export type ToastColors = "info" | "warning" | "danger" | "success";
3
+ export type ToastAction = {
4
4
  label: string;
5
5
  onClick: () => void;
6
6
  loading?: boolean;
7
7
  };
8
8
  export interface Toast {
9
- dedupeKey?: string;
10
- intent: AlertColors;
9
+ id?: string;
10
+ intent: ToastColors;
11
11
  title: string;
12
12
  description?: string;
13
- primaryAction?: AlertAction;
14
- secondaryAction?: AlertAction;
13
+ primaryAction?: ToastAction;
14
+ secondaryAction?: ToastAction;
15
15
  duration?: number;
16
16
  }
17
- export type AddToast = (toast: Toast) => void;
18
17
  export interface IToastContext {
19
- addToast: AddToast;
18
+ addToast: (toast: Toast) => Promise<void | "primaryAction" | "secondaryAction">;
20
19
  setIsManifestError?: React.Dispatch<React.SetStateAction<boolean>>;
21
20
  }