@lax-wp/design-system 0.3.6 → 0.3.7

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,17 +1,31 @@
1
1
  import React from 'react';
2
2
  import { type IButtonStatus } from '../../button/Button';
3
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;
4
+ /** Whether the modal is visible */
5
+ visible?: boolean;
6
+ /** Callback when modal is closed */
7
+ onClose?: () => void;
8
+ /** Callback when confirmed */
9
+ onConfirm?: () => void;
10
10
  /** Title of the confirmation popup */
11
- title: string;
11
+ title?: React.ReactNode;
12
12
  /** Content/message of the confirmation popup */
13
- content: string;
14
- /** Footer configuration */
13
+ content?: React.ReactNode;
14
+ /** Whether the action is in loading state */
15
+ isLoading?: boolean;
16
+ /** Variant of the modal ('destructive' for delete actions) */
17
+ variant?: 'destructive' | 'default';
18
+ /** Width of the modal in pixels */
19
+ width?: number;
20
+ /** Container element ID for portal rendering */
21
+ parentContainer?: string;
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 */
15
29
  footer?: {
16
30
  /** Justify content alignment (e.g., 'justify-end', 'justify-center') */
17
31
  justify?: string;
@@ -24,18 +38,14 @@ export interface ConfirmationModalProps {
24
38
  /** Button style for cancel button */
25
39
  cancelBtnType?: IButtonStatus;
26
40
  };
27
- /** Async handler that receives a callback with error status */
41
+ /** Async handler that receives a callback with error status - legacy support */
28
42
  async?: (cb: ({ error }: {
29
43
  error: boolean;
30
44
  }) => void) => Promise<void>;
31
- /** Width of the modal in pixels */
32
- width?: number;
33
- /** Control visibility from outside */
45
+ /** Control visibility from outside - legacy support */
34
46
  isVisibleOutside?: boolean;
35
- /** Whether clicking children can open the popup */
47
+ /** Whether clicking children can open the popup - legacy support */
36
48
  ableToConfirmByChildren?: boolean;
37
- /** Container element ID for portal rendering */
38
- parentContainer?: string;
39
49
  }
40
50
  /**
41
51
  * ConfirmationModal component for displaying confirmation dialogs
@@ -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,6 +42,8 @@ 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";