@lax-wp/design-system 0.2.0 → 0.2.1
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 +79 -0
- package/dist/components/data-display/badge/Badge.d.ts +44 -0
- package/dist/components/data-display/banner/Banner.d.ts +41 -0
- package/dist/components/data-display/code-editor/CodeEditor.d.ts +4 -0
- package/dist/components/data-display/code-editor/JsonGrid.d.ts +14 -0
- package/dist/components/data-display/code-editor/Tabs.d.ts +12 -0
- package/dist/components/data-display/diff-viewer/DiffViewer.d.ts +64 -0
- package/dist/components/data-display/label-value/LabelValue.d.ts +121 -0
- package/dist/components/data-display/modal/Modal.d.ts +77 -0
- package/dist/components/data-display/pdf-viewer/PdfViewer.d.ts +45 -0
- package/dist/components/data-display/popper/Popper.d.ts +57 -0
- package/dist/components/data-display/resizable-sidebar/ResizableSidebar.d.ts +54 -0
- package/dist/components/data-display/status-color-mapping/StatusColorMapping.d.ts +29 -0
- package/dist/components/data-display/tag/Tag.d.ts +53 -0
- package/dist/components/data-display/typography/Typography.d.ts +15 -0
- package/dist/components/feedback/toast/Toast.d.ts +29 -0
- package/dist/components/floating-bar/FloatingBar.d.ts +147 -0
- package/dist/components/forms/checkbox/Checkbox.d.ts +55 -0
- package/dist/components/forms/color-picker/ColorPicker.d.ts +60 -0
- package/dist/components/forms/creatable-select/CreatableSelect.d.ts +92 -0
- package/dist/components/forms/currency-input/CurrencyInputField.d.ts +73 -0
- package/dist/components/forms/currency-input/currency.constant.d.ts +12 -0
- package/dist/components/forms/date-range/DateRange.d.ts +72 -0
- package/dist/components/forms/debounce-input/DebounceInputField.d.ts +76 -0
- package/dist/components/forms/file-upload/FileUpload.d.ts +81 -0
- package/dist/components/forms/input-field/InputField.d.ts +62 -0
- package/dist/components/forms/multi-file-upload/MultiFileUpload.d.ts +78 -0
- package/dist/components/forms/percentage-input/PercentageInputField.d.ts +75 -0
- package/dist/components/forms/text-field/TextField.d.ts +48 -0
- package/dist/components/forms/toggle/Toggle.d.ts +71 -0
- package/dist/components/icons/CloseIcon.d.ts +16 -0
- package/dist/components/icons/HelpIcon.d.ts +6 -0
- package/dist/components/icons/SearchIcon.d.ts +6 -0
- package/dist/components/tooltip/Tooltip.d.ts +8 -0
- package/dist/constants/colors.d.ts +263 -0
- package/dist/hooks/useOutsideClick.d.ts +28 -0
- package/dist/hooks/usePythonSyntax.d.ts +28 -0
- package/dist/hooks/useTheme.d.ts +6 -0
- package/dist/index.d.ts +67 -0
- package/dist/services/monacoManager.d.ts +28 -0
- package/dist/types/index.d.ts +66 -0
- package/dist/utils/formatters.d.ts +24 -0
- package/dist/utils/messageConstants.d.ts +16 -0
- package/dist/utils/tagUtils.d.ts +12 -0
- package/dist/utils/utilities.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the DebounceInputField component
|
|
3
|
+
*/
|
|
4
|
+
export interface DebounceInputFieldProps {
|
|
5
|
+
/** Unique identifier for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text to display above the input */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Current value of the input */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Default value for the input */
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/** Callback function called when value changes (debounced) */
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
/** Callback function called on every keystroke (immediate) */
|
|
16
|
+
onImmediateChange?: (value: string) => void;
|
|
17
|
+
/** Whether the input is disabled */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Whether the field is required */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Placeholder text for the input */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Message to display below the input */
|
|
24
|
+
message?: string;
|
|
25
|
+
/** Type of message to display */
|
|
26
|
+
messageType?: "success" | "error" | "info" | "default";
|
|
27
|
+
/** Additional CSS classes for the wrapper container */
|
|
28
|
+
wrapperClassName?: string;
|
|
29
|
+
/** Additional CSS classes for the input */
|
|
30
|
+
inputClassName?: string;
|
|
31
|
+
/** Additional CSS classes for the label */
|
|
32
|
+
labelClassName?: string;
|
|
33
|
+
/** Help text to display below the label */
|
|
34
|
+
helpText?: string;
|
|
35
|
+
/** Size variant for the input */
|
|
36
|
+
size?: "small" | "medium" | "large";
|
|
37
|
+
/** Input type */
|
|
38
|
+
type?: "text" | "email" | "url" | "search" | "tel" | "password";
|
|
39
|
+
/** Debounce timeout in milliseconds */
|
|
40
|
+
debounceTimeout?: number;
|
|
41
|
+
/** Minimum value for number inputs */
|
|
42
|
+
min?: number;
|
|
43
|
+
/** Maximum value for number inputs */
|
|
44
|
+
max?: number;
|
|
45
|
+
/** Maximum length for text inputs */
|
|
46
|
+
maxLength?: number;
|
|
47
|
+
/** Pattern for input validation */
|
|
48
|
+
pattern?: string;
|
|
49
|
+
/** Additional props to pass to the input element */
|
|
50
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
51
|
+
/** Inline styles for the input element */
|
|
52
|
+
inputStyle?: React.CSSProperties;
|
|
53
|
+
/** Callback for key down events */
|
|
54
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
55
|
+
/** Callback for focus events */
|
|
56
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
57
|
+
/** Callback for blur events */
|
|
58
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A highly customizable debounced input component with label, validation, and styling support.
|
|
62
|
+
* Features configurable debounce timing, immediate change callbacks, and comprehensive prop support.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <DebounceInputField
|
|
67
|
+
* id="search"
|
|
68
|
+
* label="Search"
|
|
69
|
+
* value={searchTerm}
|
|
70
|
+
* onChange={(value) => setSearchTerm(value)}
|
|
71
|
+
* debounceTimeout={300}
|
|
72
|
+
* placeholder="Type to search..."
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare const DebounceInputField: import("react").ForwardRefExoticComponent<DebounceInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* File upload size options
|
|
4
|
+
*/
|
|
5
|
+
export type FileUploadSize = "small" | "medium" | "large";
|
|
6
|
+
/**
|
|
7
|
+
* File upload variant options
|
|
8
|
+
*/
|
|
9
|
+
export type FileUploadVariant = "primary" | "secondary";
|
|
10
|
+
/**
|
|
11
|
+
* Props for the FileUpload component
|
|
12
|
+
*/
|
|
13
|
+
export interface FileUploadProps {
|
|
14
|
+
/** Unique identifier for the file upload */
|
|
15
|
+
id?: string;
|
|
16
|
+
/** Callback function called when file is selected */
|
|
17
|
+
onFileSelect: (file: File | File[] | null, fileName?: string) => void;
|
|
18
|
+
/** Custom upload handler function */
|
|
19
|
+
onUpload?: (file: File | File[]) => Promise<void>;
|
|
20
|
+
/** Description text to display */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Error message to display */
|
|
23
|
+
errorMessage?: string;
|
|
24
|
+
/** Whether the upload is disabled */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Default file to display */
|
|
27
|
+
defaultFile?: File | null;
|
|
28
|
+
/** Accepted file types (e.g., ".pdf,.doc,.docx") */
|
|
29
|
+
acceptedFiles?: string;
|
|
30
|
+
/** Whether the upload is in loading state */
|
|
31
|
+
isLoading?: boolean;
|
|
32
|
+
/** Whether to convert file to base64 */
|
|
33
|
+
asBase64?: boolean;
|
|
34
|
+
/** Whether to allow multiple file selection */
|
|
35
|
+
multiple?: boolean;
|
|
36
|
+
/** Whether to hide the selected file display */
|
|
37
|
+
hideSelectedFile?: boolean;
|
|
38
|
+
/** Callback when file is deleted */
|
|
39
|
+
onDelete?: () => void;
|
|
40
|
+
/** Maximum file size in bytes (default: 200MB) */
|
|
41
|
+
maxSize?: number;
|
|
42
|
+
/** Additional CSS classes for the wrapper container */
|
|
43
|
+
wrapperClassName?: string;
|
|
44
|
+
/** Additional CSS classes for the upload area */
|
|
45
|
+
uploadClassName?: string;
|
|
46
|
+
/** Size variant for the upload area */
|
|
47
|
+
size?: FileUploadSize;
|
|
48
|
+
/** Visual variant for the upload area */
|
|
49
|
+
variant?: FileUploadVariant;
|
|
50
|
+
/** Custom upload icon */
|
|
51
|
+
uploadIcon?: ReactNode;
|
|
52
|
+
/** Custom delete icon */
|
|
53
|
+
deleteIcon?: ReactNode;
|
|
54
|
+
/** Custom file type icons */
|
|
55
|
+
fileTypeIcons?: {
|
|
56
|
+
pdf?: ReactNode;
|
|
57
|
+
default?: ReactNode;
|
|
58
|
+
};
|
|
59
|
+
/** Whether to show file size */
|
|
60
|
+
showFileSize?: boolean;
|
|
61
|
+
/** Whether to show upload progress */
|
|
62
|
+
showProgress?: boolean;
|
|
63
|
+
/** Upload progress percentage */
|
|
64
|
+
progress?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A highly customizable file upload component with drag-and-drop support.
|
|
68
|
+
* Features multiple sizes, variants, file type detection, and comprehensive styling options.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <FileUpload
|
|
73
|
+
* id="document-upload"
|
|
74
|
+
* onFileSelect={(file) => console.log('File selected:', file)}
|
|
75
|
+
* description="Upload your document here"
|
|
76
|
+
* acceptedFiles=".pdf,.doc,.docx"
|
|
77
|
+
* maxSize={10 * 1024 * 1024} // 10MB
|
|
78
|
+
* />
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare const FileUpload: import("react").ForwardRefExoticComponent<FileUploadProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the InputField component
|
|
4
|
+
*/
|
|
5
|
+
export interface InputFieldProps {
|
|
6
|
+
/** Unique identifier for the input field */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The current value of the input field */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** Callback function called when the input value changes */
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
/** Callback function called on key down events */
|
|
13
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** Error message to display below the input */
|
|
15
|
+
message?: string;
|
|
16
|
+
/** Success message to display below the input */
|
|
17
|
+
messageType?: "success" | "error" | "info" | "default";
|
|
18
|
+
/** Default value for the input field */
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
/** Whether the input field is disabled */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Maximum value for number inputs */
|
|
23
|
+
max?: number;
|
|
24
|
+
/** Minimum value for number inputs */
|
|
25
|
+
min?: number;
|
|
26
|
+
/** Whether the field is required */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Label text for the input field */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Input type (text, email, password, number, etc.) */
|
|
31
|
+
type?: string;
|
|
32
|
+
/** Placeholder text for the input */
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
/** Icon or element to display at the end of the input */
|
|
35
|
+
fieldSuffix?: React.ReactNode;
|
|
36
|
+
/** Additional CSS classes for the wrapper container */
|
|
37
|
+
wrapperClassNames?: string;
|
|
38
|
+
/** Additional CSS classes for the input element */
|
|
39
|
+
inputClassNames?: string;
|
|
40
|
+
/** Inline styles for the input element */
|
|
41
|
+
inputStyle?: React.CSSProperties;
|
|
42
|
+
/** Additional props to pass to the input element */
|
|
43
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A highly customizable input field component with label, validation, and styling support.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <InputField
|
|
51
|
+
* id="email"
|
|
52
|
+
* label="Email Address"
|
|
53
|
+
* type="email"
|
|
54
|
+
* value={email}
|
|
55
|
+
* onChange={setEmail}
|
|
56
|
+
* placeholder="Enter your email"
|
|
57
|
+
* required
|
|
58
|
+
* errorMessage={emailError}
|
|
59
|
+
* />
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare const InputField: React.ForwardRefExoticComponent<InputFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File upload result interface
|
|
3
|
+
*/
|
|
4
|
+
export interface FileUploadResult {
|
|
5
|
+
filename: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
fileUrl?: string;
|
|
8
|
+
fileName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Union type for file change callback parameter
|
|
12
|
+
*/
|
|
13
|
+
export type FileChangeValue = File | File[] | FileUploadResult | FileUploadResult[] | string | string[] | null;
|
|
14
|
+
/**
|
|
15
|
+
* Props for the MultiFileUpload component
|
|
16
|
+
*/
|
|
17
|
+
export interface MultiFileUploadProps {
|
|
18
|
+
/** Unique identifier for the upload component */
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Callback function called when files are selected/uploaded */
|
|
21
|
+
onFileChange: (files: FileChangeValue, fileName?: string) => void;
|
|
22
|
+
/** Description text to display in the upload area */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** Error message to display */
|
|
25
|
+
errorMessage?: string;
|
|
26
|
+
/** Whether the upload is disabled */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Default file to display */
|
|
29
|
+
defaultFile?: File | null;
|
|
30
|
+
/** Accepted file types (e.g., ".pdf,.doc,.docx") */
|
|
31
|
+
acceptedFiles?: string;
|
|
32
|
+
/** Whether the component is in loading state */
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
/** Whether to convert files to base64 */
|
|
35
|
+
asBase64?: boolean;
|
|
36
|
+
/** Whether to upload files to server */
|
|
37
|
+
toFileServer?: boolean;
|
|
38
|
+
/** Whether files are currently uploading */
|
|
39
|
+
fileUploading?: boolean;
|
|
40
|
+
/** Callback to set file uploading state */
|
|
41
|
+
setFileUploading?: (fileUploading: boolean | string | null) => void;
|
|
42
|
+
/** Whether to upload to document server */
|
|
43
|
+
uploadToDocServer?: boolean;
|
|
44
|
+
/** Whether to allow multiple file selection */
|
|
45
|
+
multiple?: boolean;
|
|
46
|
+
/** Whether to get real file name */
|
|
47
|
+
getRealFileName?: boolean;
|
|
48
|
+
/** Maximum file size in bytes (default: 50MB) */
|
|
49
|
+
maxSize?: number;
|
|
50
|
+
/** Custom upload handler function */
|
|
51
|
+
onUpload?: (files: File[]) => Promise<FileUploadResult[]>;
|
|
52
|
+
/** Custom delete handler function */
|
|
53
|
+
onDelete?: (fileData?: FileUploadResult) => Promise<void>;
|
|
54
|
+
/** Additional CSS classes for the wrapper */
|
|
55
|
+
wrapperClassName?: string;
|
|
56
|
+
/** Additional CSS classes for the upload area */
|
|
57
|
+
uploadClassName?: string;
|
|
58
|
+
/** Whether to show file size */
|
|
59
|
+
showFileSize?: boolean;
|
|
60
|
+
/** Custom file size formatter */
|
|
61
|
+
formatFileSize?: (size: number) => string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A highly customizable multi-file upload component with drag-and-drop support.
|
|
65
|
+
* Features file validation, base64 conversion, server upload, and comprehensive styling options.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <MultiFileUpload
|
|
70
|
+
* id="file-upload"
|
|
71
|
+
* description="Upload your documents"
|
|
72
|
+
* onFileChange={(files) => console.log(files)}
|
|
73
|
+
* multiple
|
|
74
|
+
* maxSize={10 * 1024 * 1024} // 10MB
|
|
75
|
+
* />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const MultiFileUpload: import("react").ForwardRefExoticComponent<MultiFileUploadProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the PercentageInputField component
|
|
3
|
+
*/
|
|
4
|
+
export interface PercentageInputFieldProps {
|
|
5
|
+
/** Unique identifier for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text to display above the input */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Current value of the input (number) */
|
|
10
|
+
value?: number | null;
|
|
11
|
+
/** Default value for the input */
|
|
12
|
+
defaultValue?: number | null;
|
|
13
|
+
/** Callback function called when value changes */
|
|
14
|
+
onChange: (value: number | null) => void;
|
|
15
|
+
/** Whether the input is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Whether the field is required */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Placeholder text for the input */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/** Message to display below the input */
|
|
22
|
+
message?: string;
|
|
23
|
+
/** Type of message to display */
|
|
24
|
+
messageType?: "success" | "error" | "info" | "default";
|
|
25
|
+
/** Additional CSS classes for the wrapper container */
|
|
26
|
+
wrapperClassName?: string;
|
|
27
|
+
/** Additional CSS classes for the input */
|
|
28
|
+
inputClassName?: string;
|
|
29
|
+
/** Additional CSS classes for the label */
|
|
30
|
+
labelClassName?: string;
|
|
31
|
+
/** Help text to display below the label */
|
|
32
|
+
helpText?: string;
|
|
33
|
+
/** Size variant for the input */
|
|
34
|
+
size?: "small" | "medium" | "large";
|
|
35
|
+
/** Minimum value allowed */
|
|
36
|
+
min?: number;
|
|
37
|
+
/** Maximum value allowed */
|
|
38
|
+
max?: number;
|
|
39
|
+
/** Step value for incrementing */
|
|
40
|
+
step?: number;
|
|
41
|
+
/** Number of decimal places */
|
|
42
|
+
decimalPlaces?: number;
|
|
43
|
+
/** Whether to show percentage symbol */
|
|
44
|
+
showSymbol?: boolean;
|
|
45
|
+
/** Whether to allow negative values */
|
|
46
|
+
allowNegative?: boolean;
|
|
47
|
+
/** Additional props to pass to the input element */
|
|
48
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
49
|
+
/** Inline styles for the input element */
|
|
50
|
+
inputStyle?: React.CSSProperties;
|
|
51
|
+
/** Callback for key down events */
|
|
52
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
53
|
+
/** Callback for focus events */
|
|
54
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
55
|
+
/** Callback for blur events */
|
|
56
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A highly customizable percentage input component with label, validation, and styling support.
|
|
60
|
+
* Features percentage symbol, decimal control, and comprehensive validation.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <PercentageInputField
|
|
65
|
+
* id="discount"
|
|
66
|
+
* label="Discount Percentage"
|
|
67
|
+
* value={discount}
|
|
68
|
+
* onChange={(value) => setDiscount(value)}
|
|
69
|
+
* min={0}
|
|
70
|
+
* max={100}
|
|
71
|
+
* required
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare const PercentageInputField: import("react").ForwardRefExoticComponent<PercentageInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the TextAreaField component
|
|
4
|
+
*/
|
|
5
|
+
export interface TextFieldProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> {
|
|
6
|
+
/** The label text to display above the textarea */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Placeholder text for the textarea */
|
|
9
|
+
placeholder: string;
|
|
10
|
+
/** Current value of the textarea */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** Callback function called when the textarea value changes */
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
/** Number of visible text lines for the textarea */
|
|
15
|
+
rows?: number;
|
|
16
|
+
/** Message to display below the textarea */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Type of message to display */
|
|
19
|
+
messageType?: "success" | "error" | "info" | "default";
|
|
20
|
+
/** Default value for the textarea */
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
/** Whether the field is required */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** Whether the textarea is disabled */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Additional CSS classes for the wrapper container */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Ref object for the textarea element */
|
|
29
|
+
inputRef?: RefObject<HTMLTextAreaElement>;
|
|
30
|
+
/** Maximum character length allowed */
|
|
31
|
+
maxLength?: number;
|
|
32
|
+
/** Whether to preserve original case in the label */
|
|
33
|
+
originalCase?: boolean;
|
|
34
|
+
/** Whether to remove border styling */
|
|
35
|
+
noBorder?: boolean;
|
|
36
|
+
/** Unique identifier for the textarea */
|
|
37
|
+
id?: string;
|
|
38
|
+
/** Custom inline styles for the textarea */
|
|
39
|
+
inputStyle?: React.CSSProperties;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A customizable textarea field component with label, validation, and styling support.
|
|
43
|
+
* Features dark mode support, accessibility enhancements, and character count display.
|
|
44
|
+
*
|
|
45
|
+
* @param props - The props for the TextAreaField component
|
|
46
|
+
* @returns The rendered TextAreaField component
|
|
47
|
+
*/
|
|
48
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Toggle label direction options
|
|
4
|
+
*/
|
|
5
|
+
export type ToggleDirection = "top" | "left" | "right";
|
|
6
|
+
/**
|
|
7
|
+
* Props for the Toggle component
|
|
8
|
+
*/
|
|
9
|
+
export interface ToggleProps {
|
|
10
|
+
/** Unique identifier for the toggle */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Whether the toggle is checked */
|
|
13
|
+
checked: boolean;
|
|
14
|
+
/** Callback function called when toggle state changes */
|
|
15
|
+
onChange: (checked: boolean) => void;
|
|
16
|
+
/** Label text or element to display */
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
/** Whether the field is required */
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Whether the toggle is disabled */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Message to display below the toggle */
|
|
23
|
+
message?: string;
|
|
24
|
+
/** Type of message to display */
|
|
25
|
+
messageType?: "success" | "error" | "info" | "default";
|
|
26
|
+
/** Additional CSS classes for the wrapper container */
|
|
27
|
+
wrapperClassName?: string;
|
|
28
|
+
/** Additional CSS classes for the toggle */
|
|
29
|
+
toggleClassName?: string;
|
|
30
|
+
/** Additional CSS classes for the label */
|
|
31
|
+
labelClassName?: string;
|
|
32
|
+
/** Help text to display below the label */
|
|
33
|
+
helpText?: string;
|
|
34
|
+
/** Size variant for the toggle */
|
|
35
|
+
size?: "small" | "medium" | "large";
|
|
36
|
+
/** Label direction relative to toggle */
|
|
37
|
+
labelDirection?: ToggleDirection;
|
|
38
|
+
/** Whether to hide the status text (Yes/No) */
|
|
39
|
+
hideStatus?: boolean;
|
|
40
|
+
/** Custom status text instead of Yes/No */
|
|
41
|
+
statusText?: string;
|
|
42
|
+
/** Whether to show icons in the toggle */
|
|
43
|
+
withIcon?: boolean;
|
|
44
|
+
/** Custom icons for checked/unchecked states */
|
|
45
|
+
icon?: {
|
|
46
|
+
checkedIcon: ReactNode;
|
|
47
|
+
uncheckedIcon: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
/** Visual variant for the toggle */
|
|
50
|
+
variant?: "primary" | "secondary";
|
|
51
|
+
/** Whether to preserve original case in the label */
|
|
52
|
+
originalCase?: boolean;
|
|
53
|
+
/** Whether to stop click propagation */
|
|
54
|
+
stopClickPropagation?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A highly customizable toggle component with label, validation, and styling support.
|
|
58
|
+
* Features multiple sizes, variants, icon support, and comprehensive prop support.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <Toggle
|
|
63
|
+
* id="notifications"
|
|
64
|
+
* label="Enable Notifications"
|
|
65
|
+
* checked={notificationsEnabled}
|
|
66
|
+
* onChange={(checked) => setNotificationsEnabled(checked)}
|
|
67
|
+
* required
|
|
68
|
+
* />
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SVGAttributes } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Close icon component
|
|
4
|
+
*/
|
|
5
|
+
export interface CloseIconProps extends SVGAttributes<SVGElement> {
|
|
6
|
+
/** Size of the icon */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** Fill color of the icon */
|
|
9
|
+
fill?: string;
|
|
10
|
+
/** Additional CSS classes */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Close icon component
|
|
15
|
+
*/
|
|
16
|
+
export declare const CloseIcon: import("react").ForwardRefExoticComponent<CloseIconProps & import("react").RefAttributes<SVGSVGElement>>;
|