@lax-wp/design-system 0.3.47 → 0.3.49

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,69 +1,52 @@
1
- import { type ReactNode, type MouseEvent } from "react";
2
- /**
3
- * Available button sizes
4
- */
5
- export type OptionButtonSize = "small" | "medium" | "large";
6
- /**
7
- * Available button variants
8
- */
9
- export type OptionButtonVariant = "default" | "highlight" | "destructive";
1
+ import { type FC, type ReactNode } from "react";
10
2
  /**
11
3
  * Props for the OptionButton component
12
4
  */
13
5
  export interface OptionButtonProps {
6
+ /** Unique identifier for the button */
7
+ id?: string;
8
+ /** Click handler for the button */
9
+ onClick?(e?: any): void;
10
+ /** Icon to display before the text */
11
+ icon?: ReactNode;
14
12
  /** Button text content */
15
13
  text: string;
16
- /** Click handler for the button */
17
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
18
- /** Whether the button is disabled */
19
- disabled?: boolean;
20
- /** Whether the button should be hidden */
21
- hidden?: boolean;
22
14
  /** Additional CSS classes */
23
15
  className?: string;
24
- /** Button size variant */
25
- size?: OptionButtonSize;
26
- /** Button visual variant */
27
- variant?: OptionButtonVariant;
28
- /** Icon to display before the text */
29
- icon?: ReactNode;
30
- /** Icon to display after the text (trailing) */
31
- trailingIcon?: ReactNode;
16
+ /** Whether the button is disabled */
17
+ isDisabled?: boolean;
18
+ /** Callback when the button is closed */
19
+ onClose?(): void;
20
+ /** Whether the button should be hidden */
21
+ notVisible?: boolean;
32
22
  /** Whether to hide hover effects */
33
23
  hideHoverEffect?: boolean;
34
- /** Callback when the button is closed */
35
- onClose?: () => void;
24
+ /** Icon to display after the text (trailing) */
25
+ leadingIcon?: ReactNode;
26
+ /** Suffix record object for badge content lookup by text */
27
+ suffixRecord?: Record<string, string | number>;
36
28
  /** Whether to stop event propagation on click */
37
29
  stopPropagation?: boolean;
38
- /** Toggle functionality props */
39
- onToggle?: (checked: boolean) => void;
30
+ /** Toggle functionality callback */
31
+ onToggle?: () => void;
40
32
  /** Whether the toggle is checked (if onToggle is provided) */
41
- checked?: boolean;
33
+ isChecked?: boolean;
42
34
  /** Text to highlight within the button text */
43
- highlightText?: string;
35
+ highlight?: string;
44
36
  /** Whether to truncate text */
45
37
  truncateText?: boolean;
46
38
  /** Whether to show a checkmark tick */
47
39
  showTick?: boolean;
48
40
  /** Custom width for the text container */
49
- textWidth?: string;
41
+ width?: string;
50
42
  /** Tooltip text to display */
51
43
  tooltip?: string;
52
- /** Suffix badge content */
53
- suffixBadge?: ReactNode;
54
- /** Custom aria-label for accessibility */
55
- "aria-label"?: string;
56
- /** Test ID for testing purposes */
57
- "data-testid"?: string;
58
- /** Whether the button should take full width */
59
- fullWidth?: boolean;
60
- /** Error state */
61
- error?: boolean;
62
- /** Loading state */
63
- loading?: boolean;
44
+ /** Whether the flow is available (controls button enabled state) */
45
+ isFlowAvailable?: boolean;
64
46
  }
65
47
  /**
66
- * OptionButton component provides a flexible button for lists, menus, and option selections
48
+ * OptionButton component provides a flexible button for lists, menus, and option selections.
49
+ * Based on the web portal implementation for consistency across apps.
67
50
  *
68
51
  * @example
69
52
  * ```tsx
@@ -71,9 +54,7 @@ export interface OptionButtonProps {
71
54
  * text="Save Document"
72
55
  * icon={<SaveIcon />}
73
56
  * onClick={() => console.log('Save clicked')}
74
- * size="medium"
75
- * variant="default"
76
57
  * />
77
58
  * ```
78
59
  */
79
- export declare const OptionButton: import("react").ForwardRefExoticComponent<OptionButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
60
+ export declare const OptionButton: FC<OptionButtonProps>;
@@ -1,4 +1,4 @@
1
- import { FC, HTMLAttributes } from 'react';
1
+ import { type FC, type HTMLAttributes } from 'react';
2
2
  export type TSearchConfig = {
3
3
  searchCount?: number;
4
4
  searchPointer?: number;
@@ -1,6 +1,9 @@
1
- import React, { SVGAttributes } from 'react';
2
- export interface SearchIconProps extends SVGAttributes<SVGElement> {
3
- size?: number;
1
+ import { type FC, type SVGAttributes } from 'react';
2
+ type TSVGProps = SVGAttributes<SVGElement> & {
3
+ width?: string | number;
4
+ height?: string | number;
5
+ fill?: string;
4
6
  className?: string;
5
- }
6
- export declare const SearchIcon: React.FC<SearchIconProps>;
7
+ };
8
+ export declare const SearchIcon: FC<TSVGProps>;
9
+ export {};
package/dist/index.d.ts CHANGED
@@ -106,7 +106,7 @@ export type { DiffViewerProps, DiffType, DiffTheme, } from "./components/data-di
106
106
  export { default as Button } from "./components/button/Button";
107
107
  export type { IButtonProps, IButtonStatus, IButtonAppearance, } from "./components/button/Button";
108
108
  export { OptionButton } from "./components/buttons/option-button/OptionButton";
109
- export type { OptionButtonProps, OptionButtonSize, OptionButtonVariant, } from "./components/buttons/option-button/OptionButton";
109
+ export type { OptionButtonProps, } from "./components/buttons/option-button/OptionButton";
110
110
  export { FloatingBar } from "./components/floating-bar/FloatingBar";
111
111
  export type { FloatingBarProps, FloatingBarActionConfig, FloatingBarDeleteConfig, FloatingBarSize, FloatingBarPosition, FloatingBarTheme, } from "./components/floating-bar/FloatingBar";
112
112
  export { SearchBar } from "./components/forms/search-bar/SearchBar";