@lax-wp/design-system 0.3.37 → 0.3.39

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.
@@ -0,0 +1,134 @@
1
+ import React from "react";
2
+ import type { LabelType } from "../../data-display/label/Label";
3
+ /**
4
+ * Risk details interface
5
+ */
6
+ export interface RiskDetails {
7
+ color?: string;
8
+ description?: string;
9
+ hexBgColor?: string;
10
+ hexBorderColor?: string;
11
+ [key: string]: any;
12
+ }
13
+ /**
14
+ * Risk details card component props
15
+ */
16
+ export interface RiskDetailsCardProps {
17
+ riskDetails: RiskDetails;
18
+ maxWidth?: string;
19
+ showAllRisksSuggestions?: boolean;
20
+ }
21
+ /**
22
+ * Props for the BaseInputField component
23
+ */
24
+ export type TBaseInputFieldProps = any & {
25
+ /** Current value of the input */
26
+ value: string;
27
+ /** Callback function called when the input value changes */
28
+ onChange(data: any): void;
29
+ /** Callback function for key down events */
30
+ onKeyDown?: void;
31
+ /** Error message to display */
32
+ errorMessage: string;
33
+ /** Default value for the input */
34
+ defaultValue?: string;
35
+ /** Whether the input is disabled */
36
+ disabled?: boolean;
37
+ /** Maximum value for number inputs */
38
+ max?: number;
39
+ /** Minimum value for number inputs */
40
+ min?: number;
41
+ /** Whether the field is required */
42
+ required?: boolean;
43
+ /** Whether the required indicator shows as conditional */
44
+ isRequiredConditional?: boolean;
45
+ /** Background color class */
46
+ bg?: string;
47
+ /** Tags to display with the label */
48
+ tags?: (string | LabelType)[];
49
+ /** Text color class */
50
+ color?: string;
51
+ /** Unique identifier for the input */
52
+ id: string;
53
+ /** Label text for the input */
54
+ label?: string;
55
+ /** Input type (text, email, password, number, etc.) */
56
+ type?: string;
57
+ /** Value to revert back to */
58
+ revertBackValue?: any;
59
+ /** Placeholder text */
60
+ placeholder?: string;
61
+ /** Whether this is a password field with visibility toggle */
62
+ isPasswordField?: boolean;
63
+ /** Callback to set password visibility */
64
+ setIsPasswordVisible?: any;
65
+ /** Tooltip text */
66
+ tooltip?: string;
67
+ /** Whether to preserve original case in the label */
68
+ originalCase?: boolean;
69
+ /** Icon or element to display at the end of the input */
70
+ suffixIcon?: React.ReactNode;
71
+ /** Text size class */
72
+ textSize?: string;
73
+ /** Whether the value was AI extracted */
74
+ isAiExtracted?: boolean;
75
+ /** Whether this is a GTN field */
76
+ isGTN?: boolean;
77
+ /** GTN name for document integration */
78
+ gtnName?: any;
79
+ /** Success message to display */
80
+ successMessage?: string;
81
+ /** Additional CSS classes for the input element */
82
+ inputClassName?: string;
83
+ /** Inline styles for the input element */
84
+ inputStyle?: React.CSSProperties;
85
+ /** Additional CSS classes for the label */
86
+ labelClassName?: string;
87
+ /** Whether this is a live field */
88
+ isLiveField?: boolean;
89
+ /** Callback function for blur events */
90
+ onBlur?: () => void;
91
+ /** Whether the input is clearable */
92
+ isClearable?: boolean;
93
+ /** Additional CSS classes for the wrapper */
94
+ className?: string;
95
+ /** Ref for the input element */
96
+ inputRef?: React.RefObject<HTMLInputElement>;
97
+ /** Risk details data */
98
+ riskDetails?: RiskDetails;
99
+ /** Whether risk analysis is open */
100
+ isRiskAnalysisOpen?: boolean;
101
+ /** Custom risk details card component */
102
+ RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
103
+ /** Required indicator component */
104
+ RequiredIndicator?: React.ComponentType<{
105
+ isConditional?: boolean;
106
+ }>;
107
+ /** Handler for adding GTN to document */
108
+ onAddGTNToDocument?: (keyValuePair: {
109
+ key: string;
110
+ value: string;
111
+ }) => void;
112
+ /** Translation function */
113
+ t?: (key: string) => string;
114
+ };
115
+ /**
116
+ * A feature-rich input field component with label, validation, GTN integration,
117
+ * risk analysis support, and comprehensive styling options.
118
+ *
119
+ * @example
120
+ * ```tsx
121
+ * <BaseInputField
122
+ * id="email"
123
+ * label="Email Address"
124
+ * type="email"
125
+ * value={email}
126
+ * onChange={setEmail}
127
+ * placeholder="Enter your email"
128
+ * required
129
+ * errorMessage={emailError}
130
+ * />
131
+ * ```
132
+ */
133
+ export declare const BaseInputField: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLInputElement>>;
134
+ export default BaseInputField;
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Option type for CustomizableSelectField
3
+ */
4
+ export interface CustomizableSelectOption {
5
+ label: string;
6
+ value: string;
7
+ [key: string]: any;
8
+ }
9
+ /**
10
+ * Option config for customizing option rendering
11
+ */
12
+ export interface OptionConfig {
13
+ /** Custom component to render for options */
14
+ component?: React.ComponentType<any>;
15
+ /** Props to pass to the custom component */
16
+ componentProps?: Record<string, any>;
17
+ /** Indicator to show when option is selected */
18
+ selectIndecator?: React.ReactNode;
19
+ }
20
+ /**
21
+ * Menu config for customizing menu rendering
22
+ */
23
+ export interface MenuConfig {
24
+ /** Additional CSS class for the menu */
25
+ className?: string;
26
+ /** Additional CSS class for each option */
27
+ optionClassName?: string;
28
+ }
29
+ /**
30
+ * Props for the CustomizableSelectField component
31
+ */
32
+ export interface CustomizableSelectFieldProps {
33
+ /** Unique identifier for the select */
34
+ id: string;
35
+ /** Label text to display above the select */
36
+ label?: string;
37
+ /** Array of select options */
38
+ options: CustomizableSelectOption[];
39
+ /** Placeholder text for the select */
40
+ placeholder: string;
41
+ /** Callback function called when selection changes */
42
+ onChange: (_value: any) => void;
43
+ /** Whether the select is in loading state */
44
+ isLoading?: boolean;
45
+ /** Whether to hide the label */
46
+ hideLabel?: boolean;
47
+ /** Error message to display */
48
+ errorMessage?: string;
49
+ /** Whether the field is required */
50
+ required?: boolean;
51
+ /** Configuration for option rendering */
52
+ optionConfig?: OptionConfig;
53
+ /** Configuration for menu rendering */
54
+ menuConfig?: MenuConfig;
55
+ /** Parent container selector (deprecated, not used) */
56
+ parentContainer?: string;
57
+ /** Current value of the select */
58
+ value?: any;
59
+ /** Whether multiple selections are allowed */
60
+ isMulti?: boolean;
61
+ /** Whether the select is clearable */
62
+ isClearable?: boolean;
63
+ /** Whether the select is disabled */
64
+ disabled?: boolean;
65
+ /** Additional CSS classes */
66
+ className?: string;
67
+ /** Whether dark mode is enabled */
68
+ isDark?: boolean;
69
+ /** Primary color shades for styling */
70
+ primaryColorShades?: Record<number, string>;
71
+ /** Required indicator component */
72
+ RequiredIndicator?: React.ComponentType;
73
+ /** Additional props */
74
+ [key: string]: any;
75
+ }
76
+ /**
77
+ * A highly customizable select field component with custom option and menu rendering support.
78
+ * Features dark mode support, multi-select capability, and comprehensive prop support.
79
+ * Built on top of react-select for advanced functionality.
80
+ *
81
+ * @example
82
+ * ```tsx
83
+ * <CustomizableSelectField
84
+ * id="country"
85
+ * label="Country"
86
+ * options={[
87
+ * { label: 'United States', value: 'us' },
88
+ * { label: 'Canada', value: 'ca' }
89
+ * ]}
90
+ * placeholder="Select a country"
91
+ * onChange={(value) => console.log(value)}
92
+ * />
93
+ *
94
+ * // With custom option rendering
95
+ * <CustomizableSelectField
96
+ * id="user"
97
+ * label="User"
98
+ * options={users}
99
+ * placeholder="Select a user"
100
+ * onChange={(value) => console.log(value)}
101
+ * optionConfig={{
102
+ * component: UserOption,
103
+ * componentProps: { showAvatar: true },
104
+ * selectIndecator: <CheckIcon />
105
+ * }}
106
+ * />
107
+ * ```
108
+ */
109
+ export declare const CustomizableSelectField: {
110
+ ({ id, label, options, placeholder, onChange, isLoading, hideLabel, errorMessage, required, optionConfig, menuConfig, value, isMulti, isClearable, disabled, className, isDark, primaryColorShades, RequiredIndicator, }: CustomizableSelectFieldProps): import("react/jsx-runtime").JSX.Element;
111
+ displayName: string;
112
+ };
@@ -110,8 +110,6 @@ export interface SelectFieldProps extends Omit<SelectProps, 'onChange'> {
110
110
  isRiskAnalysisOpen?: boolean;
111
111
  /** Custom risk details card component */
112
112
  RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
113
- /** AI extracted indicator component */
114
- AIExtractedIndicator?: React.ComponentType;
115
113
  /** Required indicator component */
116
114
  RequiredIndicator?: React.ComponentType;
117
115
  /** Add to document icon component */
@@ -78,8 +78,6 @@ export interface TextAreaFieldProps extends Omit<React.TextareaHTMLAttributes<HT
78
78
  isRiskAnalysisOpen?: boolean;
79
79
  /** Custom risk details card component */
80
80
  RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
81
- /** AI extracted indicator component */
82
- AIExtractedIndicator?: React.ComponentType;
83
81
  /** Required indicator component */
84
82
  RequiredIndicator?: React.ComponentType<{
85
83
  isConditional?: boolean;
@@ -1,12 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { TToggleDirection } from "../../../constants/toggle";
3
- /**
4
- * Label type for tags
5
- */
6
- export type LabelType = {
7
- label: string;
8
- color?: string;
9
- };
3
+ import { type LabelType } from "../../data-display/label/Label";
4
+ export type { LabelType };
10
5
  /**
11
6
  * Props for the Toggle component
12
7
  */
@@ -0,0 +1,7 @@
1
+ import { type TooltipPlacement } from "../tooltip/Tooltip";
2
+ type TProps = {
3
+ position?: TooltipPlacement;
4
+ title?: string;
5
+ };
6
+ export declare const AIExtractedIndicator: ({ position, title, }: TProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type FC, type SVGAttributes } from 'react';
2
+ type TProps = SVGAttributes<SVGElement> & {
3
+ size?: number;
4
+ fill?: string;
5
+ fillSecondary?: string;
6
+ };
7
+ export declare const AIStarIcon: FC<TProps>;
8
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { InputField } from "./components/forms/input-field/InputField";
2
2
  export type { InputFieldProps } from "./components/forms/input-field/InputField";
3
+ export { BaseInputField, default as BaseInputFieldDefault } from "./components/forms/base-input-field/BaseInputField";
4
+ export type { TBaseInputFieldProps, RiskDetails as BaseInputFieldRiskDetails, RiskDetailsCardProps as BaseInputFieldRiskDetailsCardProps, } from "./components/forms/base-input-field/BaseInputField";
3
5
  export * from "./components/data-display/typography/Typography";
4
6
  export { TextField } from "./components/forms/text-field/TextField";
5
7
  export type { TextFieldProps } from "./components/forms/text-field/TextField";
@@ -13,6 +15,8 @@ export { ColorPicker } from "./components/forms/color-picker/ColorPicker";
13
15
  export type { ColorPickerProps, ColorPickerComponentProps, } from "./components/forms/color-picker/ColorPicker";
14
16
  export { CreatableSelectField } from "./components/forms/creatable-select/CreatableSelect";
15
17
  export type { CreatableSelectProps, SelectOption, TProps, } from "./components/forms/creatable-select/CreatableSelect";
18
+ export { CustomizableSelectField } from "./components/forms/customizable-select-field/CustomizableSelectField";
19
+ export type { CustomizableSelectFieldProps, CustomizableSelectOption, OptionConfig, MenuConfig, } from "./components/forms/customizable-select-field/CustomizableSelectField";
16
20
  export { CurrencyInputField } from "./components/forms/currency-input/CurrencyInputField";
17
21
  export type { CurrencyInputFieldProps } from "./components/forms/currency-input/CurrencyInputField";
18
22
  export { CURRENCIES, CURRENCY_SYMBOLS } from "./components/forms/currency-input/currency.constant";