@trackunit/react-core-contexts-api 0.2.102 → 0.2.104
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/confirmationDialogContext.d.ts +32 -0
- package/src/index.d.ts +1 -0
package/package.json
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
export type UserInteractionType = "PRIMARY" | "SECONDARY" | "CLOSE";
|
2
|
+
export interface ConfirmationDialogProps {
|
3
|
+
/**
|
4
|
+
* The heading of the modal.
|
5
|
+
*/
|
6
|
+
title: string;
|
7
|
+
/**
|
8
|
+
* The content to show in the modal.
|
9
|
+
*/
|
10
|
+
message: string;
|
11
|
+
/**
|
12
|
+
* The type of the primary action button.
|
13
|
+
* For actions like delete, the primary action button should be primary-danger.
|
14
|
+
*/
|
15
|
+
primaryActionType: "primary" | "primary-danger";
|
16
|
+
/**
|
17
|
+
* The label of the primary action button.
|
18
|
+
* For example, "Delete user".
|
19
|
+
*/
|
20
|
+
primaryActionLabel: string;
|
21
|
+
/**
|
22
|
+
* The label of the secondary action button.
|
23
|
+
* For example, "Cancel".
|
24
|
+
*/
|
25
|
+
secondaryActionLabel: string;
|
26
|
+
}
|
27
|
+
export interface ConfirmationDialogContextValue {
|
28
|
+
/**
|
29
|
+
* confirm shows a confirmation dialog and returns a promise that resolves to the user interaction type.
|
30
|
+
*/
|
31
|
+
confirm: (props: ConfirmationDialogProps) => Promise<UserInteractionType>;
|
32
|
+
}
|
package/src/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
export * from "./IUserPreferencesContext";
|
2
2
|
export * from "./analyticsContext";
|
3
3
|
export * from "./assetSortingContext";
|
4
|
+
export * from "./confirmationDialogContext";
|
4
5
|
export * from "./currentUserContext";
|
5
6
|
export * from "./environmentContext";
|
6
7
|
export * from "./filterBarContext";
|