@lax-wp/design-system 0.3.7 → 0.3.8
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/components/feedback/confirmation-modal/ConfirmationModal.d.ts +19 -47
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +2209 -2249
- package/dist/index.umd.js +74 -74
- package/package.json +1 -1
|
@@ -1,51 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export interface ConfirmationModalProps {
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
export interface IConfirmationModalProps {
|
|
4
3
|
/** Whether the modal is visible */
|
|
5
|
-
visible
|
|
4
|
+
visible: boolean;
|
|
6
5
|
/** Callback when modal is closed */
|
|
7
|
-
onClose
|
|
8
|
-
/** Callback when confirmed */
|
|
9
|
-
onConfirm?: () => void;
|
|
10
|
-
/** Title of the confirmation popup */
|
|
11
|
-
title?: React.ReactNode;
|
|
6
|
+
onClose: () => void;
|
|
12
7
|
/** Content/message of the confirmation popup */
|
|
13
|
-
content
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** Title of the confirmation popup */
|
|
10
|
+
title: React.ReactNode;
|
|
11
|
+
/** Callback when confirmed */
|
|
12
|
+
onConfirm: () => void;
|
|
14
13
|
/** Whether the action is in loading state */
|
|
15
14
|
isLoading?: boolean;
|
|
16
15
|
/** Variant of the modal ('destructive' for delete actions) */
|
|
17
16
|
variant?: 'destructive' | 'default';
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
/** Child element that triggers the popup when clicked (optional) - legacy support */
|
|
23
|
-
children?: React.ReactElement;
|
|
24
|
-
/** Callback when cancel is triggered - legacy support */
|
|
25
|
-
onCancel?: (closeByIcon?: boolean) => void;
|
|
26
|
-
/** Callback when OK is clicked - legacy support */
|
|
27
|
-
onOk?: () => void;
|
|
28
|
-
/** Footer configuration - legacy support */
|
|
29
|
-
footer?: {
|
|
30
|
-
/** Justify content alignment (e.g., 'justify-end', 'justify-center') */
|
|
31
|
-
justify?: string;
|
|
32
|
-
/** Text for OK button */
|
|
33
|
-
okText?: string;
|
|
34
|
-
/** Text for cancel button */
|
|
35
|
-
cancelText?: string;
|
|
36
|
-
/** Button style for OK button */
|
|
37
|
-
okBtnType?: IButtonStatus;
|
|
38
|
-
/** Button style for cancel button */
|
|
39
|
-
cancelBtnType?: IButtonStatus;
|
|
40
|
-
};
|
|
41
|
-
/** Async handler that receives a callback with error status - legacy support */
|
|
42
|
-
async?: (cb: ({ error }: {
|
|
43
|
-
error: boolean;
|
|
44
|
-
}) => void) => Promise<void>;
|
|
45
|
-
/** Control visibility from outside - legacy support */
|
|
46
|
-
isVisibleOutside?: boolean;
|
|
47
|
-
/** Whether clicking children can open the popup - legacy support */
|
|
48
|
-
ableToConfirmByChildren?: boolean;
|
|
17
|
+
/** Text for the cancel button (default: 'Cancel') */
|
|
18
|
+
cancelText?: string;
|
|
19
|
+
/** Text for the confirm button (default: 'Confirm' or 'Delete' based on variant) */
|
|
20
|
+
confirmText?: string;
|
|
49
21
|
}
|
|
50
22
|
/**
|
|
51
23
|
* ConfirmationModal component for displaying confirmation dialogs
|
|
@@ -53,14 +25,14 @@ export interface ConfirmationModalProps {
|
|
|
53
25
|
* @example
|
|
54
26
|
* ```tsx
|
|
55
27
|
* <ConfirmationModal
|
|
28
|
+
* visible={isOpen}
|
|
56
29
|
* title="Delete Item"
|
|
57
30
|
* content="Are you sure you want to delete this item?"
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* </ConfirmationModal>
|
|
31
|
+
* onConfirm={() => handleDelete()}
|
|
32
|
+
* onClose={() => setIsOpen(false)}
|
|
33
|
+
* variant="destructive"
|
|
34
|
+
* />
|
|
63
35
|
* ```
|
|
64
36
|
*/
|
|
65
|
-
export declare const ConfirmationModal:
|
|
37
|
+
export declare const ConfirmationModal: FC<IConfirmationModalProps>;
|
|
66
38
|
export default ConfirmationModal;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export type { TooltipProps, TooltipPlacement, } from "./components/tooltip/Toolt
|
|
|
47
47
|
export { default as Toast, toast } from "./components/feedback/toast/Toast";
|
|
48
48
|
export type { ToastContainerProps, ToastType, ToastPosition, } from "./components/feedback/toast/Toast";
|
|
49
49
|
export { ConfirmationModal } from "./components/feedback/confirmation-modal/ConfirmationModal";
|
|
50
|
-
export type {
|
|
50
|
+
export type { IConfirmationModalProps, } from "./components/feedback/confirmation-modal/ConfirmationModal";
|
|
51
51
|
export { CodeEditor } from "./components/data-display/code-editor/CodeEditor";
|
|
52
52
|
export type { CodeEditorProps } from "./types";
|
|
53
53
|
export { JsonGrid } from "./components/data-display/code-editor/JsonGrid";
|