@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.
@@ -1,41 +1,23 @@
1
- import React from 'react';
2
- import { type IButtonStatus } from '../../button/Button';
3
- export interface ConfirmationModalProps {
4
- /** Child element that triggers the popup when clicked (optional) */
5
- children?: React.ReactElement;
6
- /** Callback when cancel is triggered */
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: string;
14
- /** Footer configuration */
15
- footer?: {
16
- /** Justify content alignment (e.g., 'justify-end', 'justify-center') */
17
- justify?: string;
18
- /** Text for OK button */
19
- okText?: string;
20
- /** Text for cancel button */
21
- cancelText?: string;
22
- /** Button style for OK button */
23
- okBtnType?: IButtonStatus;
24
- /** Button style for cancel button */
25
- cancelBtnType?: IButtonStatus;
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
- * onOk={() => console.log('Confirmed')}
49
- * onCancel={() => console.log('Cancelled')}
50
- * >
51
- * <button>Delete</button>
52
- * </ConfirmationModal>
31
+ * onConfirm={() => handleDelete()}
32
+ * onClose={() => setIsOpen(false)}
33
+ * variant="destructive"
34
+ * />
53
35
  * ```
54
36
  */
55
- export declare const ConfirmationModal: React.FC<ConfirmationModalProps>;
37
+ export declare const ConfirmationModal: FC<IConfirmationModalProps>;
56
38
  export default ConfirmationModal;
@@ -1,9 +1,14 @@
1
- import React, { type ReactNode } from 'react';
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?: 'top' | 'bottom' | 'left' | 'right';
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
- export declare const Tooltip: React.FC<TooltipProps>;
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 { ConfirmationModalProps, } from "./components/feedback/confirmation-modal/ConfirmationModal";
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";