@lax-wp/design-system 0.3.36 → 0.3.37

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,4 +1,6 @@
1
1
  import { type FC } from 'react';
2
2
  import { type CodeEditorProps } from '../../../types';
3
- export type TTabKey = 'JSON' | 'Grid';
3
+ declare const TABS: ('JSON' | 'Grid')[];
4
+ export type TTabKey = (typeof TABS)[number];
4
5
  export declare const CodeEditor: FC<CodeEditorProps>;
6
+ export {};
@@ -0,0 +1,122 @@
1
+ import type { RefObject } 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 TextAreaField component
23
+ */
24
+ export interface TextAreaFieldProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "maxLength"> {
25
+ /** The label text to display above the textarea */
26
+ label?: string;
27
+ /** Placeholder text for the textarea */
28
+ placeholder: string;
29
+ /** Current value of the textarea */
30
+ value?: string | any;
31
+ /** Callback function called when the textarea value changes */
32
+ onChange: (value: string) => void;
33
+ /** Number of visible text lines for the textarea (alias for rows) */
34
+ row?: number;
35
+ /** Error message to display below the textarea */
36
+ errorMessage?: string;
37
+ /** Default value for the textarea */
38
+ defaultValue?: string;
39
+ /** Whether the field is required */
40
+ required?: boolean;
41
+ /** Whether the required indicator shows as conditional (yellow instead of red) */
42
+ isRequiredConditional?: boolean;
43
+ /** Tags/labels to display next to the label */
44
+ tags?: (string | LabelType)[];
45
+ /** Whether the textarea is disabled */
46
+ disabled?: boolean;
47
+ /** Additional CSS classes for the textarea element */
48
+ className?: string;
49
+ /** Ref object for the textarea element */
50
+ inputRef?: RefObject<HTMLTextAreaElement>;
51
+ /** Maximum character length allowed */
52
+ maxLength?: number | null;
53
+ /** Tooltip text to display */
54
+ tooltip?: string;
55
+ /** Whether to preserve original case in the label */
56
+ originalCase?: boolean;
57
+ /** Whether the value was AI extracted */
58
+ isAiExtracted?: boolean;
59
+ /** Whether this is a GTN (Global Term Name) field */
60
+ isGTN?: boolean;
61
+ /** GTN field name for document integration */
62
+ gtnName?: any;
63
+ /** Whether to remove border styling */
64
+ noBorder?: boolean;
65
+ /** Unique identifier for the textarea */
66
+ id?: string;
67
+ /** Custom inline styles for the textarea */
68
+ inputStyle?: React.CSSProperties;
69
+ /** Additional CSS classes for the label */
70
+ labelClassName?: string;
71
+ /** Whether this is a live field */
72
+ isLiveField?: boolean;
73
+ /** Callback function called when the textarea loses focus */
74
+ onBlur?: () => void;
75
+ /** Risk details data */
76
+ riskDetails?: RiskDetails;
77
+ /** Whether risk analysis is open */
78
+ isRiskAnalysisOpen?: boolean;
79
+ /** Custom risk details card component */
80
+ RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps>;
81
+ /** AI extracted indicator component */
82
+ AIExtractedIndicator?: React.ComponentType;
83
+ /** Required indicator component */
84
+ RequiredIndicator?: React.ComponentType<{
85
+ isConditional?: boolean;
86
+ }>;
87
+ /** Handler for adding GTN to document */
88
+ onAddGTNToDocument?: (keyValuePair: {
89
+ key: string;
90
+ value: string;
91
+ }) => void;
92
+ /** Translation function */
93
+ t?: (key: string) => string;
94
+ }
95
+ /**
96
+ * A customizable textarea field component with label, validation, GTN integration,
97
+ * risk analysis support, and styling support. Features dark mode support,
98
+ * accessibility enhancements, and character count display.
99
+ *
100
+ * @example
101
+ * ```tsx
102
+ * <TextAreaField
103
+ * label="Description"
104
+ * placeholder="Enter a description..."
105
+ * value={description}
106
+ * onChange={(value) => setDescription(value)}
107
+ * required
108
+ * />
109
+ *
110
+ * <TextAreaField
111
+ * label="Comments"
112
+ * placeholder="Enter comments..."
113
+ * value={comments}
114
+ * onChange={(value) => setComments(value)}
115
+ * maxLength={500}
116
+ * isGTN
117
+ * gtnName="comments_field"
118
+ * onAddGTNToDocument={(kv) => handleAddToDocument(kv)}
119
+ * />
120
+ * ```
121
+ */
122
+ export declare const TextAreaField: import("react").ForwardRefExoticComponent<TextAreaFieldProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -87,6 +87,15 @@ export interface ToggleProps {
87
87
  key: string;
88
88
  value: string;
89
89
  }) => void;
90
+ /** Add to document icon component */
91
+ AddToDocumentIcon?: React.ComponentType<{
92
+ fontSize?: number;
93
+ color?: string;
94
+ }>;
95
+ /** Primary color shades for styling */
96
+ primaryColorShades?: Record<number, string>;
97
+ /** Translation function */
98
+ t?: (key: string) => string;
90
99
  }
91
100
  /**
92
101
  * A highly customizable toggle component with label, validation, and styling support.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export type { InputFieldProps } from "./components/forms/input-field/InputField"
3
3
  export * from "./components/data-display/typography/Typography";
4
4
  export { TextField } from "./components/forms/text-field/TextField";
5
5
  export type { TextFieldProps } from "./components/forms/text-field/TextField";
6
+ export { TextAreaField } from "./components/forms/text-area-field/TextAreaField";
7
+ export type { TextAreaFieldProps, RiskDetails as TextAreaFieldRiskDetails, RiskDetailsCardProps as TextAreaFieldRiskDetailsCardProps, } from "./components/forms/text-area-field/TextAreaField";
6
8
  export { SelectField } from "./components/forms/select-field/SelectField";
7
9
  export type { SelectFieldProps, SelectOption as SelectFieldOption, TLabelValue, } from "./components/forms/select-field/SelectField";
8
10
  export { Checkbox } from "./components/forms/checkbox/Checkbox";