@lax-wp/design-system 0.3.6 → 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 +25 -43
- package/dist/components/tooltip/Tooltip.d.ts +10 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +17067 -17106
- package/dist/index.umd.js +79 -79
- package/package.json +1 -1
|
@@ -1,41 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onCancel?: (closeByIcon?: boolean) => void;
|
|
8
|
-
/** Callback when OK is clicked */
|
|
9
|
-
onOk: () => void;
|
|
10
|
-
/** Title of the confirmation popup */
|
|
11
|
-
title: string;
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
export interface IConfirmationModalProps {
|
|
3
|
+
/** Whether the modal is visible */
|
|
4
|
+
visible: boolean;
|
|
5
|
+
/** Callback when modal is closed */
|
|
6
|
+
onClose: () => void;
|
|
12
7
|
/** Content/message of the confirmation popup */
|
|
13
|
-
content:
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
/** Async handler that receives a callback with error status */
|
|
28
|
-
async?: (cb: ({ error }: {
|
|
29
|
-
error: boolean;
|
|
30
|
-
}) => void) => Promise<void>;
|
|
31
|
-
/** Width of the modal in pixels */
|
|
32
|
-
width?: number;
|
|
33
|
-
/** Control visibility from outside */
|
|
34
|
-
isVisibleOutside?: boolean;
|
|
35
|
-
/** Whether clicking children can open the popup */
|
|
36
|
-
ableToConfirmByChildren?: boolean;
|
|
37
|
-
/** Container element ID for portal rendering */
|
|
38
|
-
parentContainer?: string;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** Title of the confirmation popup */
|
|
10
|
+
title: React.ReactNode;
|
|
11
|
+
/** Callback when confirmed */
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
/** Whether the action is in loading state */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
/** Variant of the modal ('destructive' for delete actions) */
|
|
16
|
+
variant?: 'destructive' | 'default';
|
|
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;
|
|
39
21
|
}
|
|
40
22
|
/**
|
|
41
23
|
* ConfirmationModal component for displaying confirmation dialogs
|
|
@@ -43,14 +25,14 @@ export interface ConfirmationModalProps {
|
|
|
43
25
|
* @example
|
|
44
26
|
* ```tsx
|
|
45
27
|
* <ConfirmationModal
|
|
28
|
+
* visible={isOpen}
|
|
46
29
|
* title="Delete Item"
|
|
47
30
|
* content="Are you sure you want to delete this item?"
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* </ConfirmationModal>
|
|
31
|
+
* onConfirm={() => handleDelete()}
|
|
32
|
+
* onClose={() => setIsOpen(false)}
|
|
33
|
+
* variant="destructive"
|
|
34
|
+
* />
|
|
53
35
|
* ```
|
|
54
36
|
*/
|
|
55
|
-
export declare const ConfirmationModal:
|
|
37
|
+
export declare const ConfirmationModal: FC<IConfirmationModalProps>;
|
|
56
38
|
export default ConfirmationModal;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './styles.css';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type TooltipPlacement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
2
4
|
export interface TooltipProps {
|
|
3
|
-
title: ReactNode;
|
|
4
|
-
placement?:
|
|
5
|
-
children: ReactNode;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
placement?: TooltipPlacement;
|
|
7
|
+
children: React.ReactNode;
|
|
6
8
|
className?: string;
|
|
9
|
+
hideTooltip?: boolean;
|
|
10
|
+
delayShow?: boolean;
|
|
11
|
+
whiteSpace?: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'initial' | 'inherit';
|
|
7
12
|
}
|
|
8
|
-
|
|
13
|
+
declare const Tooltip: ({ children, title, hideTooltip, delayShow, whiteSpace, placement, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
export default Tooltip;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,10 +42,12 @@ export { PdfViewer } from "./components/data-display/pdf-viewer/PdfViewer";
|
|
|
42
42
|
export type { PdfViewerProps } from "./components/data-display/pdf-viewer/PdfViewer";
|
|
43
43
|
export { Popper } from "./components/data-display/popper/Popper";
|
|
44
44
|
export type { PopperProps, PopperPlacement, } from "./components/data-display/popper/Popper";
|
|
45
|
+
export { default as Tooltip } from "./components/tooltip/Tooltip";
|
|
46
|
+
export type { TooltipProps, TooltipPlacement, } from "./components/tooltip/Tooltip";
|
|
45
47
|
export { default as Toast, toast } from "./components/feedback/toast/Toast";
|
|
46
48
|
export type { ToastContainerProps, ToastType, ToastPosition, } from "./components/feedback/toast/Toast";
|
|
47
49
|
export { ConfirmationModal } from "./components/feedback/confirmation-modal/ConfirmationModal";
|
|
48
|
-
export type {
|
|
50
|
+
export type { IConfirmationModalProps, } from "./components/feedback/confirmation-modal/ConfirmationModal";
|
|
49
51
|
export { CodeEditor } from "./components/data-display/code-editor/CodeEditor";
|
|
50
52
|
export type { CodeEditorProps } from "./types";
|
|
51
53
|
export { JsonGrid } from "./components/data-display/code-editor/JsonGrid";
|