@lax-wp/design-system 0.3.46 → 0.3.48
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/buttons/option-button/OptionButton.d.ts +27 -46
- package/dist/components/forms/currency-input/CurrencyInputField.d.ts +0 -3
- package/dist/components/forms/master-data-input/MasterDataInputField.d.ts +137 -0
- package/dist/components/forms/search-bar/SearchBar.d.ts +1 -1
- package/dist/components/icons/SearchIcon.d.ts +8 -5
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +17785 -17560
- package/dist/index.umd.js +55 -55
- package/package.json +1 -1
|
@@ -1,69 +1,52 @@
|
|
|
1
|
-
import { type
|
|
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
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
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
|
-
/**
|
|
35
|
-
|
|
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
|
|
39
|
-
onToggle?: (
|
|
30
|
+
/** Toggle functionality callback */
|
|
31
|
+
onToggle?: () => void;
|
|
40
32
|
/** Whether the toggle is checked (if onToggle is provided) */
|
|
41
|
-
|
|
33
|
+
isChecked?: boolean;
|
|
42
34
|
/** Text to highlight within the button text */
|
|
43
|
-
|
|
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
|
-
|
|
41
|
+
width?: string;
|
|
50
42
|
/** Tooltip text to display */
|
|
51
43
|
tooltip?: string;
|
|
52
|
-
/**
|
|
53
|
-
|
|
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:
|
|
60
|
+
export declare const OptionButton: FC<OptionButtonProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
1
|
import type { LabelType } from "../../data-display/label/Label";
|
|
3
2
|
/**
|
|
4
3
|
* Risk details interface for risk analysis integration
|
|
@@ -91,8 +90,6 @@ export interface CurrencyInputFieldProps {
|
|
|
91
90
|
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;
|
|
92
91
|
/** Translation function */
|
|
93
92
|
t?: (key: string) => string;
|
|
94
|
-
/** Function to get flag component for currency */
|
|
95
|
-
getFlagComponent?: (currencyCode: string) => ReactNode;
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
98
95
|
* A highly customizable currency input component with label, validation, and styling support.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { LabelType } from "../../data-display/label/Label";
|
|
2
|
+
/**
|
|
3
|
+
* Risk details interface for risk analysis integration
|
|
4
|
+
*/
|
|
5
|
+
export interface RiskDetails {
|
|
6
|
+
color?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
hexBgColor?: string;
|
|
9
|
+
hexBorderColor?: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Risk details card component props - generic to allow consumer-specific risk types
|
|
14
|
+
*/
|
|
15
|
+
export interface RiskDetailsCardProps<T = any> {
|
|
16
|
+
riskDetails: T;
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
showAllRisksSuggestions?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for the MasterDataModal component
|
|
22
|
+
*/
|
|
23
|
+
export interface MasterDataModalProps {
|
|
24
|
+
isVisible: boolean;
|
|
25
|
+
onSelected: (masterDataValue: any, masterDataRow?: any) => void;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
masterDataColumnName: string;
|
|
28
|
+
masterDataFilters?: any;
|
|
29
|
+
masterDataName: string;
|
|
30
|
+
masterDataId: string;
|
|
31
|
+
showFilters?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props for the MasterDataInputField component
|
|
35
|
+
*/
|
|
36
|
+
export interface MasterDataInputFieldProps {
|
|
37
|
+
/** Unique identifier for the input */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Label text to display above the input */
|
|
40
|
+
label: string;
|
|
41
|
+
/** Placeholder text for the input */
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/** Current value of the input */
|
|
44
|
+
value: any;
|
|
45
|
+
/** Callback function called when value changes */
|
|
46
|
+
onChange: (value: any, masterDataRowValue?: any) => void;
|
|
47
|
+
/** Error message to display below the input */
|
|
48
|
+
errorMessage?: string;
|
|
49
|
+
/** Callback to set error message */
|
|
50
|
+
setErrorMessage: (message: string) => void;
|
|
51
|
+
/** Callback to remove error message */
|
|
52
|
+
removeErrorMessage: () => void;
|
|
53
|
+
/** Default value for the input */
|
|
54
|
+
defaultValue?: any;
|
|
55
|
+
/** Whether the field is required */
|
|
56
|
+
required?: boolean;
|
|
57
|
+
/** Whether the required indicator shows as conditional (yellow instead of red) */
|
|
58
|
+
isRequiredConditional?: boolean;
|
|
59
|
+
/** Name of the master data source */
|
|
60
|
+
masterDataName: string;
|
|
61
|
+
/** Column name in the master data */
|
|
62
|
+
masterDataColumnName: string;
|
|
63
|
+
/** Formula for computing master data value */
|
|
64
|
+
masterDataFormula?: string;
|
|
65
|
+
/** Filters for master data */
|
|
66
|
+
masterDataFilters?: any;
|
|
67
|
+
/** Tags/labels to display next to the label */
|
|
68
|
+
tags?: (string | LabelType)[];
|
|
69
|
+
/** Index for array fields */
|
|
70
|
+
index?: number;
|
|
71
|
+
/** Tooltip text for the help icon */
|
|
72
|
+
tooltip?: string;
|
|
73
|
+
/** Whether to preserve original case in the label */
|
|
74
|
+
originalCase?: boolean;
|
|
75
|
+
/** Color for the input text */
|
|
76
|
+
color?: string;
|
|
77
|
+
/** Whether this is a GTN (Global Term Name) field */
|
|
78
|
+
isGTN?: boolean;
|
|
79
|
+
/** GTN field name for document integration */
|
|
80
|
+
gtnName?: any;
|
|
81
|
+
/** Whether the value was AI extracted */
|
|
82
|
+
isAiExtracted?: boolean;
|
|
83
|
+
/** Reference data for formula computation */
|
|
84
|
+
reference?: any;
|
|
85
|
+
/** Whether the input is disabled */
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
/** Additional CSS classes for the label */
|
|
88
|
+
labelClassName?: string;
|
|
89
|
+
/** Whether this is a live field */
|
|
90
|
+
isLiveField?: boolean;
|
|
91
|
+
/** Callback function called when input loses focus */
|
|
92
|
+
onBlur?: () => void;
|
|
93
|
+
/** Handler for adding GTN to document */
|
|
94
|
+
onAddGTNToDocument?: (keyValuePair: {
|
|
95
|
+
key: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}) => void;
|
|
98
|
+
/** Risk details data */
|
|
99
|
+
riskDetails?: RiskDetails;
|
|
100
|
+
/** Whether risk analysis is open */
|
|
101
|
+
isRiskAnalysisOpen?: boolean;
|
|
102
|
+
/** Custom risk details card component */
|
|
103
|
+
RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;
|
|
104
|
+
/** Primary color shades for styling */
|
|
105
|
+
primaryColorShades?: Record<number, string>;
|
|
106
|
+
/** Translation function */
|
|
107
|
+
t?: (key: string) => string;
|
|
108
|
+
/** Callback to set disable actions state */
|
|
109
|
+
setDisableActions?: (disabled: boolean) => void;
|
|
110
|
+
/** Toast function for deprecated field warning */
|
|
111
|
+
showDeprecatedFieldWarning?: () => void;
|
|
112
|
+
/** Master data modal component */
|
|
113
|
+
MasterDataModal?: React.ComponentType<MasterDataModalProps>;
|
|
114
|
+
/** Function to parse master data formula */
|
|
115
|
+
parseMasterDataFormula?: (formula: string, row: any) => string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A highly customizable master data input component with label, validation, and styling support.
|
|
119
|
+
* Features master data modal integration, GTN support, risk analysis support,
|
|
120
|
+
* and comprehensive prop support for various use cases.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* <MasterDataInputField
|
|
125
|
+
* id="master-field"
|
|
126
|
+
* label="Master Field"
|
|
127
|
+
* value={fieldValue}
|
|
128
|
+
* onChange={(value, rowValue) => setFieldValue(value)}
|
|
129
|
+
* setErrorMessage={(msg) => setError(msg)}
|
|
130
|
+
* removeErrorMessage={() => setError('')}
|
|
131
|
+
* masterDataName="customers"
|
|
132
|
+
* masterDataColumnName="name"
|
|
133
|
+
* required
|
|
134
|
+
* />
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export declare const MasterDataInputField: import("react").ForwardRefExoticComponent<MasterDataInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
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:
|
|
7
|
+
};
|
|
8
|
+
export declare const SearchIcon: FC<TSVGProps>;
|
|
9
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { TextField } from "./components/forms/text-field/TextField";
|
|
|
7
7
|
export type { TextFieldProps } from "./components/forms/text-field/TextField";
|
|
8
8
|
export { TextAreaField } from "./components/forms/text-area-field/TextAreaField";
|
|
9
9
|
export type { TextAreaFieldProps, RiskDetails as TextAreaFieldRiskDetails, RiskDetailsCardProps as TextAreaFieldRiskDetailsCardProps, } from "./components/forms/text-area-field/TextAreaField";
|
|
10
|
+
export { MasterDataInputField } from "./components/forms/master-data-input/MasterDataInputField";
|
|
11
|
+
export type { MasterDataInputFieldProps, RiskDetails as MasterDataInputFieldRiskDetails, RiskDetailsCardProps as MasterDataInputFieldRiskDetailsCardProps, } from "./components/forms/master-data-input/MasterDataInputField";
|
|
10
12
|
export { SelectField } from "./components/forms/select-field/SelectField";
|
|
11
13
|
export type { SelectFieldProps, SelectOption as SelectFieldOption, TLabelValue, } from "./components/forms/select-field/SelectField";
|
|
12
14
|
export { Checkbox } from "./components/forms/checkbox/Checkbox";
|
|
@@ -104,7 +106,7 @@ export type { DiffViewerProps, DiffType, DiffTheme, } from "./components/data-di
|
|
|
104
106
|
export { default as Button } from "./components/button/Button";
|
|
105
107
|
export type { IButtonProps, IButtonStatus, IButtonAppearance, } from "./components/button/Button";
|
|
106
108
|
export { OptionButton } from "./components/buttons/option-button/OptionButton";
|
|
107
|
-
export type { OptionButtonProps,
|
|
109
|
+
export type { OptionButtonProps, } from "./components/buttons/option-button/OptionButton";
|
|
108
110
|
export { FloatingBar } from "./components/floating-bar/FloatingBar";
|
|
109
111
|
export type { FloatingBarProps, FloatingBarActionConfig, FloatingBarDeleteConfig, FloatingBarSize, FloatingBarPosition, FloatingBarTheme, } from "./components/floating-bar/FloatingBar";
|
|
110
112
|
export { SearchBar } from "./components/forms/search-bar/SearchBar";
|