formik-form-components 0.2.10 → 0.2.12

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/index.d.ts CHANGED
@@ -1,59 +1,172 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ReactElement, ReactNode, SetStateAction } from 'react';
2
+ import React__default, { ReactElement, ReactNode, ElementType, SetStateAction } from 'react';
3
3
  import { FormikValues, FormikConfig, FormikProps } from 'formik';
4
- import { SelectProps } from '@mui/material/Select';
5
- import { Dayjs } from 'dayjs';
6
- import { StandardTextFieldProps, RadioGroupProps, AutocompleteProps, SxProps, BoxProps } from '@mui/material';
4
+ import { SxProps, Theme, SelectProps as SelectProps$1, StandardTextFieldProps, SelectChangeEvent, RadioGroupProps, AutocompleteRenderInputParams, AutocompleteRenderOptionState, AutocompleteRenderGroupParams, CheckboxProps, ChipProps, AutocompleteProps, BoxProps } from '@mui/material';
5
+ import { Theme as Theme$1 } from '@mui/material/styles';
6
+ import { SelectProps, SelectChangeEvent as SelectChangeEvent$1 } from '@mui/material/Select';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
- import { Theme } from '@mui/material/styles';
8
+ import { Dayjs } from 'dayjs';
9
+ import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
9
10
  import { DropzoneOptions } from 'react-dropzone';
10
11
  import { IconifyIcon } from '@iconify/react';
11
12
 
12
- interface Props$e {
13
+ type PickerChangeHandlerContext = {
14
+ validationError: string | null;
15
+ };
16
+
17
+ declare const AppDatePicker: React__default.ForwardRefExoticComponent<Omit<DatePickerProps<boolean, Dayjs, Dayjs>, "value" | "onChange" | "renderInput" | "slotProps"> & {
18
+ /** Variant of the input field */
19
+ variant?: "outlined" | "filled" | "standard";
20
+ /** Field name for formik */
13
21
  name: string;
14
- label: string;
22
+ /** Label for the date picker */
23
+ label?: string;
24
+ /** Whether the field is required */
15
25
  required?: boolean;
16
- minDate?: Dayjs;
17
- disablePast?: boolean;
18
- [key: string]: unknown;
19
- }
20
- declare const AppDatePicker: ({ name, label, required, disablePast, ...otherProps }: Props$e) => React__default.JSX.Element;
26
+ /** Whether the field is disabled */
27
+ disabled?: boolean;
28
+ /** Whether to show the calendar icon */
29
+ showIcon?: boolean;
30
+ /** Format for the displayed date */
31
+ format?: string;
32
+ /** Custom styles for the root container */
33
+ sx?: SxProps<Theme>;
34
+ /** Custom styles for the form control */
35
+ formControlSx?: SxProps<Theme>;
36
+ /** Custom styles for the text field */
37
+ textFieldSx?: SxProps<Theme>;
38
+ /** Custom styles for the label */
39
+ labelSx?: SxProps<Theme>;
40
+ /** Custom styles for the input */
41
+ inputSx?: SxProps<Theme>;
42
+ /** Custom styles for the error message */
43
+ errorSx?: SxProps<Theme>;
44
+ /** Custom styles for the calendar icon */
45
+ iconSx?: SxProps<Theme>;
46
+ /** Callback when the value changes */
47
+ onChange?: (value: Dayjs | null, context: PickerChangeHandlerContext) => void;
48
+ /** Callback when the field is blurred */
49
+ onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
50
+ } & React__default.RefAttributes<HTMLDivElement>>;
21
51
 
22
52
  interface AppSelectOptions$4 {
23
53
  label: string;
24
54
  value: string | number;
25
55
  }
26
- interface Props$d extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
56
+ interface Props$8 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
27
57
  name: string;
28
58
  label?: string;
29
59
  placeholder?: string;
30
60
  options: AppSelectOptions$4[];
31
61
  disabled?: boolean;
62
+ sx?: SxProps<Theme>;
63
+ formControlSx?: SxProps<Theme>;
64
+ textFieldSx?: SxProps<Theme>;
65
+ listboxSx?: SxProps<Theme>;
66
+ errorSx?: SxProps<Theme>;
32
67
  }
33
- declare function AppAutoCompleter({ placeholder, name, label, options, disabled }: Props$d): React.JSX.Element;
68
+ declare function AppAutoCompleter({ placeholder, name, label, options, disabled, sx, formControlSx, textFieldSx, listboxSx, errorSx }: Props$8): React.JSX.Element;
34
69
 
35
- interface Props$c {
70
+ interface AppDateAndTimePickerProps {
71
+ /** Field name for formik */
36
72
  name: string;
73
+ /** Label for the date and time picker */
37
74
  label?: string;
75
+ /** Variant of the input field */
76
+ variant?: 'outlined' | 'filled' | 'standard';
77
+ /** Placeholder text */
38
78
  placeholder?: string;
79
+ /** Whether the field is required */
39
80
  required?: boolean;
40
- [key: string]: unknown;
81
+ /** Whether the field is disabled */
82
+ disabled?: boolean;
83
+ /** Minimum selectable date */
84
+ minDate?: Date | Dayjs | null;
85
+ /** Maximum selectable date */
86
+ maxDate?: Date | Dayjs | null;
87
+ /** Format string for the displayed date and time */
88
+ format?: string;
89
+ /** Custom styles for the root container */
90
+ sx?: SxProps<Theme>;
91
+ /** Custom styles for the form control */
92
+ formControlSx?: SxProps<Theme>;
93
+ /** Custom styles for the text field */
94
+ textFieldSx?: SxProps<Theme>;
95
+ /** Custom styles for the label */
96
+ labelSx?: SxProps<Theme>;
97
+ /** Custom styles for the input */
98
+ inputSx?: SxProps<Theme>;
99
+ /** Custom styles for the error message */
100
+ errorSx?: SxProps<Theme>;
101
+ /** Custom styles for the helper text */
102
+ helperTextSx?: SxProps<Theme>;
103
+ /** Whether to show the helper text when no error */
104
+ showHelperText?: boolean;
105
+ /** Custom helper text to display */
106
+ helperText?: string;
107
+ /** Callback when the value changes */
108
+ onChange?: (value: Dayjs | null) => void;
109
+ /** Callback when the field is blurred */
110
+ onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
111
+ /** Additional props to pass to the DateTimePicker */
112
+ [key: string]: any;
41
113
  }
42
- declare const AppDateAndTimePicker: ({ name, label, required, ...otherProps }: Props$c) => React__default.JSX.Element;
114
+ declare const AppDateAndTimePicker: React__default.ForwardRefExoticComponent<Omit<AppDateAndTimePickerProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
43
115
 
44
- interface Props$b {
116
+ interface Props$7 {
45
117
  name: string;
46
118
  alwaysShow?: boolean;
119
+ sx?: SxProps<Theme>;
120
+ containerSx?: SxProps<Theme>;
121
+ textSx?: SxProps<Theme>;
47
122
  }
48
- declare function AppFormErrorMessage({ name, alwaysShow }: Props$b): React.JSX.Element | null;
123
+ declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx }: Props$7): React.JSX.Element | null;
49
124
 
50
125
  interface AppTextAreaProps {
126
+ /** Field name for formik */
51
127
  name: string;
52
- label: string;
128
+ /** Label for the textarea */
129
+ label?: string;
130
+ /** Variant of the input field */
131
+ variant?: 'outlined' | 'filled' | 'standard';
132
+ /** Placeholder text */
133
+ placeholder?: string;
134
+ /** Number of visible text lines */
135
+ rows?: number;
136
+ /** Maximum number of characters */
137
+ maxLength?: number;
138
+ /** Whether the field is required */
139
+ required?: boolean;
140
+ /** Whether the field is disabled */
141
+ disabled?: boolean;
142
+ /** Whether the field is read-only */
143
+ readOnly?: boolean;
144
+ /** Whether to show character counter */
145
+ showCount?: boolean;
146
+ /** Custom styles for the root container */
147
+ sx?: SxProps<Theme>;
148
+ /** Custom styles for the TextField component */
149
+ textFieldSx?: SxProps<Theme>;
150
+ /** Custom styles for the label */
151
+ labelSx?: SxProps<Theme>;
152
+ /** Custom styles for the input */
153
+ inputSx?: SxProps<Theme>;
154
+ /** Custom styles for the error message */
155
+ errorSx?: SxProps<Theme>;
156
+ /** Custom styles for the character counter */
157
+ counterSx?: SxProps<Theme>;
158
+ /** Callback when the value changes */
159
+ onChange?: (value: string) => void;
160
+ /** Callback when the field is focused */
161
+ onFocus?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
162
+ /** Callback when the field is blurred */
163
+ onBlur?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
164
+ /** Additional props for the TextField component */
165
+ [key: string]: any;
53
166
  }
54
- declare function AppTextArea({ name, label }: AppTextAreaProps): React.JSX.Element;
167
+ declare const AppTextArea: React$1.ForwardRefExoticComponent<Omit<AppTextAreaProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
55
168
 
56
- interface Props$a extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
169
+ interface Props$6 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
57
170
  name: string;
58
171
  freeSolo?: boolean;
59
172
  multiple?: boolean;
@@ -61,24 +174,44 @@ interface Props$a extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChan
61
174
  placeholder?: string;
62
175
  options: string[];
63
176
  disabled?: boolean;
177
+ sx?: SxProps<Theme>;
178
+ formControlSx?: SxProps<Theme>;
179
+ textFieldSx?: SxProps<Theme>;
180
+ chipSx?: SxProps<Theme>;
181
+ listboxSx?: SxProps<Theme>;
182
+ errorSx?: SxProps<Theme>;
183
+ chipContainerSx?: SxProps<Theme>;
184
+ inputSx?: SxProps<Theme>;
64
185
  }
65
- declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, }: Props$a): React.JSX.Element;
186
+ declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, sx, formControlSx, textFieldSx, chipSx, listboxSx, errorSx, chipContainerSx, inputSx, }: Props$6): React.JSX.Element;
66
187
 
67
188
  interface AppSwitchInputProps {
68
189
  name: string;
69
190
  label?: string;
70
191
  className?: string;
71
- style?: React__default.CSSProperties;
72
- inputStyle?: React__default.CSSProperties;
192
+ sx?: SxProps<Theme>;
193
+ containerSx?: SxProps<Theme>;
194
+ switchSx?: SxProps<Theme>;
195
+ labelSx?: SxProps<Theme>;
196
+ errorSx?: SxProps<Theme>;
197
+ labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
198
+ disabled?: boolean;
73
199
  [key: string]: unknown;
74
200
  }
75
- declare function AppSwitchInput({ name, label, className, style, inputStyle, ...otherProps }: AppSwitchInputProps): React__default.JSX.Element;
201
+ declare function AppSwitchInput({ name, label, className, sx, containerSx, switchSx, labelSx, errorSx, labelPlacement, disabled, ...otherProps }: AppSwitchInputProps): React__default.JSX.Element;
76
202
 
77
203
  interface AppSwitchProps {
78
204
  name: string;
79
205
  label: string;
206
+ sx?: SxProps<Theme>;
207
+ containerSx?: SxProps<Theme>;
208
+ switchSx?: SxProps<Theme>;
209
+ labelSx?: SxProps<Theme>;
210
+ errorSx?: SxProps<Theme>;
211
+ labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
212
+ disabled?: boolean;
80
213
  }
81
- declare function AppSwitch({ name, label }: AppSwitchProps): React.JSX.Element;
214
+ declare function AppSwitch({ name, label, sx, containerSx, switchSx, labelSx, errorSx, labelPlacement, disabled, ...otherProps }: AppSwitchProps): React.JSX.Element;
82
215
 
83
216
  interface FormProps<T> extends FormikConfig<T> {
84
217
  children?: ((props: FormikProps<T>) => ReactNode) | ReactNode;
@@ -86,93 +219,445 @@ interface FormProps<T> extends FormikConfig<T> {
86
219
  }
87
220
  declare const Form: <T extends FormikValues>({ children, className, ...props }: FormProps<T>) => ReactElement;
88
221
 
89
- interface Props$9 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
222
+ interface Props$5 extends Omit<SelectProps$1, 'name' | 'label' | 'value' | 'onChange' | 'variant'> {
90
223
  name: string;
91
224
  freeSolo?: boolean;
92
225
  label?: string;
93
226
  placeholder?: string;
94
227
  options: string[];
228
+ /** Variant of the input field */
229
+ variant?: 'outlined' | 'filled' | 'standard';
230
+ sx?: SxProps<Theme$1>;
231
+ formControlSx?: SxProps<Theme$1>;
232
+ textFieldSx?: SxProps<Theme$1>;
233
+ chipSx?: SxProps<Theme$1>;
234
+ errorSx?: SxProps<Theme$1>;
95
235
  }
96
- declare function AppAutoComplete({ placeholder, name, label, options }: Props$9): React.JSX.Element;
236
+ declare function AppAutoComplete({ placeholder, name, variant, label, options, sx, formControlSx, textFieldSx, chipSx, errorSx }: Props$5): React.JSX.Element;
97
237
 
98
- interface Props$8 {
99
- option: {
100
- label: string;
101
- name: string;
102
- }[];
238
+ interface CheckboxOption {
239
+ label: string;
103
240
  name: string;
241
+ disabled?: boolean;
104
242
  }
105
- declare const CheckboxField: React__default.FC<Props$8>;
243
+ interface Props$4 {
244
+ /** Array of checkbox options with label and value */
245
+ option: CheckboxOption[];
246
+ /** Field name for formik */
247
+ name: string;
248
+ /** Label for the checkbox group */
249
+ label?: string;
250
+ /** Whether the field is required */
251
+ required?: boolean;
252
+ /** Whether the checkbox group is disabled */
253
+ disabled?: boolean;
254
+ /** Whether the checkbox group is in a row */
255
+ row?: boolean;
256
+ /** Custom styles for the root container */
257
+ sx?: SxProps<Theme>;
258
+ /** Custom styles for the checkbox component */
259
+ checkboxSx?: SxProps<Theme>;
260
+ /** Custom styles for the label */
261
+ labelSx?: SxProps<Theme>;
262
+ /** Custom styles for the error message */
263
+ errorSx?: SxProps<Theme>;
264
+ /** Custom styles for the checkbox container */
265
+ containerSx?: SxProps<Theme>;
266
+ /** Custom styles for the checkbox icon */
267
+ iconSx?: SxProps<Theme>;
268
+ /** Custom styles for the checked state */
269
+ checkedSx?: SxProps<Theme>;
270
+ }
271
+ declare const AppCheckBox: ({ name, option, label, required, disabled, row, sx, checkboxSx, labelSx, errorSx, containerSx, iconSx, checkedSx, ...rest }: Props$4) => react_jsx_runtime.JSX.Element;
106
272
 
107
- interface Props$7 extends StandardTextFieldProps {
273
+ interface Props$3 extends Omit<StandardTextFieldProps, 'variant'> {
108
274
  name: string;
109
275
  label: ReactNode;
110
276
  tagUser?: string;
111
277
  hasReply?: boolean;
112
278
  required?: boolean;
279
+ variant?: 'outlined' | 'filled' | 'standard';
113
280
  }
114
- declare function AppInputField({ name, label, type, InputProps, required, ...otherProps }: Props$7): React__default.JSX.Element;
281
+ declare function AppInputField({ name, label, type, InputProps, required, variant, ...otherProps }: Props$3): React__default.JSX.Element;
115
282
 
116
283
  interface AppSelectOptions$3 {
284
+ /** The label to display for this option */
117
285
  label: string;
286
+ /** The value to be used when this option is selected */
118
287
  value: string | number;
288
+ /** Whether this option is disabled */
289
+ disabled?: boolean;
290
+ /** Custom styles for this specific menu item */
291
+ sx?: SxProps<Theme>;
292
+ /** Custom styles for this specific menu item text */
293
+ textSx?: SxProps<Theme>;
119
294
  }
120
- interface Props$6 extends Omit<SelectProps<(string | number)[]>, 'name' | 'label' | 'value' | 'onChange'> {
295
+ interface AppMultiSelectorProps extends Omit<SelectProps<(string | number)[]>, "name" | "label" | "value" | "onChange"> {
296
+ /** Field name for formik */
121
297
  name: string;
122
- label: string;
298
+ /** Label for the multi-selector */
299
+ label?: string;
300
+ /** Whether multiple selection is allowed */
123
301
  multiple?: boolean;
302
+ /** Array of select options */
124
303
  options: AppSelectOptions$3[];
304
+ /** Whether the field is required */
125
305
  required?: boolean;
306
+ /** Whether the field is disabled */
307
+ disabled?: boolean;
308
+ /** Maximum number of items that can be selected */
309
+ maxSelections?: number;
310
+ /** Whether to show the selected count in the label */
311
+ showSelectedCount?: boolean;
312
+ /** Whether to show the helper text when no error */
313
+ showHelperText?: boolean;
314
+ /** Variant of the input field */
315
+ variant?: 'outlined' | 'filled' | 'standard';
316
+ /** Custom helper text to display */
317
+ helperText?: string;
318
+ /** Custom styles for the root container */
319
+ sx?: SxProps<Theme>;
320
+ /** Custom styles for the form control */
321
+ formControlSx?: SxProps<Theme>;
322
+ /** Custom styles for the select component */
323
+ selectSx?: SxProps<Theme>;
324
+ /** Custom styles for the label */
325
+ labelSx?: SxProps<Theme>;
326
+ /** Custom styles for the chip components */
327
+ chipSx?: SxProps<Theme>;
328
+ /** Custom styles for the checkbox components */
329
+ checkboxSx?: SxProps<Theme>;
330
+ /** Custom styles for the menu items */
331
+ menuItemSx?: SxProps<Theme>;
332
+ /** Custom styles for the error message */
333
+ errorSx?: SxProps<Theme>;
334
+ /** Custom styles for the helper text */
335
+ helperTextSx?: SxProps<Theme>;
336
+ /** Custom styles for the select icon */
337
+ iconSx?: SxProps<Theme>;
338
+ /** Callback when the value changes */
339
+ onChange?: (event: SelectChangeEvent<(string | number)[]>, child: ReactNode) => void;
340
+ /** Callback when the menu opens */
341
+ onOpen?: (event: React.SyntheticEvent) => void;
342
+ /** Callback when the menu closes */
343
+ onClose?: (event: React.SyntheticEvent) => void;
344
+ /** Custom render function for the selected value */
345
+ renderValue?: (selected: Array<string | number>) => ReactNode;
346
+ /** Custom render function for menu items */
347
+ renderMenuItem?: (option: AppSelectOptions$3, isSelected: boolean) => ReactNode;
126
348
  }
127
- declare function AppMultiSelector({ multiple, name, label, options, required, ...otherProps }: Props$6): React.JSX.Element;
349
+ declare const AppMultiSelector: React$1.ForwardRefExoticComponent<Omit<AppMultiSelectorProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
128
350
 
129
351
  interface AppPhoneNoInputProps {
130
352
  name: string;
131
353
  label?: string;
132
354
  required?: boolean;
355
+ sx?: SxProps<Theme>;
356
+ containerSx?: SxProps<Theme>;
357
+ labelSx?: SxProps<Theme>;
358
+ inputSx?: React__default.CSSProperties;
359
+ errorSx?: SxProps<Theme>;
133
360
  [key: string]: unknown;
134
361
  }
135
362
  declare const AppPhoneNoInput: React__default.FC<AppPhoneNoInputProps>;
136
363
 
137
- type Props$5 = RadioGroupProps & {
364
+ interface RadioOption {
365
+ /** The label to be shown next to the radio button */
366
+ label: string;
367
+ /** The value to be used when this option is selected */
368
+ value: string | number;
369
+ /** Whether this option is disabled */
370
+ disabled?: boolean;
371
+ /** Custom styles for this specific radio option */
372
+ sx?: SxProps<Theme>;
373
+ /** Custom styles for this specific radio button */
374
+ radioSx?: SxProps<Theme>;
375
+ /** Custom styles for this specific label */
376
+ labelSx?: SxProps<Theme>;
377
+ }
378
+ interface AppRadioGroupProps extends Omit<RadioGroupProps, 'onChange' | 'onBlur' | 'value'> {
379
+ /** Field name for formik */
138
380
  name: string;
139
- options: {
140
- label: string;
141
- value: string | number;
142
- }[];
143
- };
144
- declare function AppRadioGroup({ name, options, ...rest }: Props$5): React.JSX.Element;
381
+ /** Array of radio options */
382
+ options: RadioOption[];
383
+ /** Label for the radio group */
384
+ label?: string;
385
+ /** Whether the field is required */
386
+ required?: boolean;
387
+ /** Whether the radio group is disabled */
388
+ disabled?: boolean;
389
+ /** Whether to show the radio group in a row */
390
+ row?: boolean;
391
+ /** Custom styles for the root container */
392
+ sx?: SxProps<Theme>;
393
+ /** Custom styles for the form control */
394
+ formControlSx?: SxProps<Theme>;
395
+ /** Custom styles for the radio group */
396
+ radioGroupSx?: SxProps<Theme>;
397
+ /** Custom styles for the form label */
398
+ formLabelSx?: SxProps<Theme>;
399
+ /** Custom styles for the radio buttons */
400
+ radioSx?: SxProps<Theme>;
401
+ /** Custom styles for the radio labels */
402
+ labelSx?: SxProps<Theme>;
403
+ /** Custom styles for the error message */
404
+ errorSx?: SxProps<Theme>;
405
+ /** Callback when the value changes */
406
+ onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, value: string) => void;
407
+ /** Callback when the field is blurred */
408
+ onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
409
+ }
410
+ declare const AppRadioGroup: React__default.ForwardRefExoticComponent<Omit<AppRadioGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
145
411
 
146
412
  interface AppRatingProps {
413
+ /** Field name for formik */
147
414
  name: string;
148
- label: string;
415
+ /** Label for the rating */
416
+ label?: string;
417
+ /** Whether the rating is required */
418
+ required?: boolean;
419
+ /** Whether the rating is read-only */
420
+ readOnly?: boolean;
421
+ /** Whether the rating is disabled */
422
+ disabled?: boolean;
423
+ /** Maximum rating value */
424
+ max?: number;
425
+ /** Precision of the rating */
426
+ precision?: number;
427
+ /** Size of the rating icons */
428
+ size?: 'small' | 'medium' | 'large' | number;
429
+ /** Custom icon for empty rating */
430
+ emptyIcon?: ReactNode;
431
+ /** Custom icon for filled rating */
432
+ icon?: ReactNode;
433
+ /** Custom icon component */
434
+ IconContainerComponent?: ElementType<{
435
+ value: number;
436
+ }>;
437
+ /** Custom label for the rating value */
438
+ getLabelText?: (value: number) => string;
439
+ /** Callback when the rating changes */
440
+ onChange?: (event: React.SyntheticEvent, value: number | null) => void;
441
+ /** Callback when the rating is hovered */
442
+ onChangeActive?: (event: React.SyntheticEvent, value: number) => void;
443
+ /** Custom styles for the root container */
444
+ sx?: SxProps<Theme>;
445
+ /** Custom styles for the label */
446
+ labelSx?: SxProps<Theme>;
447
+ /** Custom styles for the rating component */
448
+ ratingSx?: SxProps<Theme>;
449
+ /** Custom styles for the error message */
450
+ errorSx?: SxProps<Theme>;
451
+ /** Custom styles for the helper text */
452
+ helperTextSx?: SxProps<Theme>;
453
+ /** Whether to show the helper text when no error */
454
+ showHelperText?: boolean;
455
+ /** Custom helper text to display */
456
+ helperText?: string;
457
+ /** Custom component for the label */
458
+ labelComponent?: ElementType;
459
+ /** Custom component for the rating */
460
+ ratingComponent?: ElementType;
461
+ /** Custom component for the error */
462
+ errorComponent?: ElementType;
463
+ /** Custom component for the helper text */
464
+ helperTextComponent?: ElementType;
465
+ /** Custom props for the label component */
466
+ labelProps?: Record<string, any>;
467
+ /** Custom props for the rating component */
468
+ ratingProps?: Record<string, any>;
469
+ /** Custom props for the error component */
470
+ errorProps?: Record<string, any>;
471
+ /** Custom props for the helper text component */
472
+ helperTextProps?: Record<string, any>;
473
+ /** Custom class name for the root container */
474
+ className?: string;
475
+ /** Custom class name for the label */
476
+ labelClassName?: string;
477
+ /** Custom class name for the rating */
478
+ ratingClassName?: string;
479
+ /** Custom class name for the error */
480
+ errorClassName?: string;
481
+ /** Custom class name for the helper text */
482
+ helperTextClassName?: string;
149
483
  }
150
- declare function AppRating({ name, label }: AppRatingProps): React.JSX.Element;
484
+ declare const AppRating: React$1.ForwardRefExoticComponent<AppRatingProps & React$1.RefAttributes<HTMLDivElement>>;
151
485
 
152
- interface Props$4 {
486
+ interface Props$2 {
153
487
  name: string;
154
488
  label?: string;
155
489
  placeholder?: string;
156
490
  required?: boolean;
491
+ /** Variant of the input field */
492
+ variant?: 'outlined' | 'filled' | 'standard';
493
+ sx?: SxProps<Theme>;
494
+ editorSx?: SxProps<Theme>;
495
+ toolbarSx?: SxProps<Theme>;
496
+ contentSx?: SxProps<Theme>;
497
+ errorSx?: SxProps<Theme>;
498
+ labelSx?: SxProps<Theme>;
499
+ buttonSx?: SxProps<Theme>;
500
+ activeButtonSx?: SxProps<Theme>;
501
+ dialogSx?: SxProps<Theme>;
157
502
  }
158
- declare const AppRichTextEditor: ({ name, label, required, placeholder }: Props$4) => react_jsx_runtime.JSX.Element | null;
503
+ declare const AppRichTextEditor: ({ name, label, required, variant, placeholder, sx, editorSx, toolbarSx, contentSx, errorSx, labelSx, buttonSx, activeButtonSx, dialogSx, }: Props$2) => react_jsx_runtime.JSX.Element | null;
159
504
 
160
505
  interface AppSelectOptions$2 {
506
+ /** Display text for the option */
161
507
  label: string;
162
- value: number;
508
+ /** Unique value for the option */
509
+ value: number | string;
510
+ /** Additional searchable text */
163
511
  searchAbleValue1?: string;
512
+ /** Additional searchable text */
164
513
  searchAbleValue2?: string;
514
+ /** Additional searchable text */
165
515
  searchAbleValue3?: string;
516
+ /** Whether the option is disabled */
517
+ disabled?: boolean;
518
+ /** Custom styles for the option */
519
+ sx?: SxProps<Theme>;
520
+ /** Custom styles for the option text */
521
+ textSx?: SxProps<Theme>;
522
+ /** Custom icon for the option */
523
+ icon?: ReactNode;
524
+ /** Custom component to render the option */
525
+ component?: ElementType;
526
+ /** Custom props for the option component */
527
+ componentProps?: Record<string, any>;
166
528
  }
167
- interface Props$3 {
529
+ type CustomAutocompleteProps = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
530
+ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
531
+ /** Field name for formik */
168
532
  name: string;
169
- label: string;
533
+ /** Label for the input */
534
+ label?: string;
535
+ /** Whether multiple selections are allowed */
170
536
  multiple?: boolean;
537
+ /** Available options */
171
538
  options: AppSelectOptions$2[];
539
+ /** Callback when search query changes */
172
540
  setSearchQuery: React__default.Dispatch<SetStateAction<string>>;
541
+ /** Whether the field is required */
173
542
  required?: boolean;
543
+ /** Whether the field is disabled */
544
+ disabled?: boolean;
545
+ /** Whether the field is read-only */
546
+ readOnly?: boolean;
547
+ /** Whether to show the helper text when no error */
548
+ showHelperText?: boolean;
549
+ /** Custom helper text */
550
+ helperText?: string;
551
+ /** Maximum number of selectable items */
552
+ maxSelections?: number;
553
+ /** Whether to show the selected count */
554
+ showSelectedCount?: boolean;
555
+ /** Variant of the input field */
556
+ variant?: 'outlined' | 'filled' | 'standard';
557
+ /** Custom styles for the root container */
558
+ sx?: SxProps<Theme>;
559
+ /** Custom styles for the form control */
560
+ formControlSx?: SxProps<Theme>;
561
+ /** Custom styles for the label */
562
+ labelSx?: SxProps<Theme>;
563
+ /** Custom styles for the input */
564
+ inputSx?: SxProps<Theme>;
565
+ /** Custom styles for the text field */
566
+ textFieldSx?: SxProps<Theme>;
567
+ /** Custom styles for the autocomplete */
568
+ autocompleteSx?: SxProps<Theme>;
569
+ /** Custom styles for the listbox */
570
+ listboxSx?: SxProps<Theme>;
571
+ /** Custom styles for the option */
572
+ optionSx?: SxProps<Theme>;
573
+ /** Custom styles for the chip */
574
+ chipSx?: SxProps<Theme>;
575
+ /** Custom styles for the error message */
576
+ errorSx?: SxProps<Theme>;
577
+ /** Custom styles for the helper text */
578
+ helperTextSx?: SxProps<Theme>;
579
+ /** Custom styles for the selected count */
580
+ selectedCountSx?: SxProps<Theme>;
581
+ /** Custom render function for the input */
582
+ renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
583
+ /** Custom render function for the option */
584
+ renderOption?: (props: React__default.HTMLAttributes<HTMLLIElement>, option: AppSelectOptions$2, state: AutocompleteRenderOptionState, ownerState: any) => ReactNode;
585
+ /** Custom render function for the selected value */
586
+ renderTags?: (value: AppSelectOptions$2[], getTagProps: (params: {
587
+ index: number;
588
+ }) => {
589
+ key: number | string;
590
+ }, ownerState: any) => ReactNode;
591
+ /** Custom render function for the group */
592
+ renderGroup?: (params: AutocompleteRenderGroupParams) => ReactNode;
593
+ /** Custom component for the label */
594
+ labelComponent?: ElementType;
595
+ /** Custom component for the input */
596
+ inputComponent?: ElementType;
597
+ /** Custom component for the error */
598
+ errorComponent?: ElementType;
599
+ /** Custom component for the helper text */
600
+ helperTextComponent?: ElementType;
601
+ /** Custom props for the label component */
602
+ labelProps?: Record<string, any>;
603
+ /** Custom props for the input component */
604
+ inputProps?: Record<string, any>;
605
+ /** Custom props for the text field component */
606
+ textFieldProps?: Record<string, any>;
607
+ /** Custom props for the autocomplete component */
608
+ autocompleteProps?: Record<string, any>;
609
+ /** Custom props for the checkbox component */
610
+ checkboxProps?: CheckboxProps;
611
+ /** Custom props for the chip component */
612
+ chipProps?: ChipProps;
613
+ /** Custom props for the error component */
614
+ errorProps?: Record<string, any>;
615
+ /** Custom props for the helper text component */
616
+ helperTextProps?: Record<string, any>;
617
+ /** Custom class name for the root container */
618
+ className?: string;
619
+ /** Custom class name for the form control */
620
+ formControlClassName?: string;
621
+ /** Custom class name for the label */
622
+ labelClassName?: string;
623
+ /** Custom class name for the input */
624
+ inputClassName?: string;
625
+ /** Custom class name for the text field */
626
+ textFieldClassName?: string;
627
+ /** Custom class name for the autocomplete */
628
+ autocompleteClassName?: string;
629
+ /** Custom class name for the listbox */
630
+ listboxClassName?: string;
631
+ /** Custom class name for the option */
632
+ optionClassName?: string;
633
+ /** Custom class name for the chip */
634
+ chipClassName?: string;
635
+ /** Custom class name for the error */
636
+ errorClassName?: string;
637
+ /** Custom class name for the helper text */
638
+ helperTextClassName?: string;
639
+ /** Callback when the selection changes */
640
+ onChange?: (event: React__default.SyntheticEvent, value: AppSelectOptions$2[], reason: string) => void;
641
+ /** Callback when the input value changes */
642
+ onInputChange?: (event: React__default.SyntheticEvent, value: string, reason: string) => void;
643
+ /** Callback when the dropdown is opened */
644
+ onOpen?: (event: React__default.SyntheticEvent) => void;
645
+ /** Callback when the dropdown is closed */
646
+ onClose?: (event: React__default.SyntheticEvent, reason: string) => void;
647
+ /** Callback when the blur event occurs */
648
+ onBlur?: (event: React__default.FocusEvent) => void;
649
+ /** Callback when the focus event occurs */
650
+ onFocus?: (event: React__default.FocusEvent) => void;
651
+ /** Callback when the clear button is clicked */
652
+ onClear?: () => void;
653
+ /** Callback when the maximum number of selections is reached */
654
+ onMaxSelectionsReached?: (maxSelections: number) => void;
655
+ /** Callback when a selection is removed */
656
+ onRemove?: (value: AppSelectOptions$2) => void;
657
+ /** Callback when a selection is added */
658
+ onAdd?: (value: AppSelectOptions$2) => void;
174
659
  }
175
- declare function AppSearchableMultiSelector({ multiple, name, label, options, required, setSearchQuery, }: Props$3): React__default.JSX.Element;
660
+ declare const AppSearchableMultiSelector: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
176
661
 
177
662
  interface AppSelectOptions$1 {
178
663
  label: string;
@@ -181,7 +666,7 @@ interface AppSelectOptions$1 {
181
666
  searchAbleValue2?: string;
182
667
  searchAbleValue3?: string;
183
668
  }
184
- interface Props$2 extends Omit<AutocompleteProps<AppSelectOptions$1, false, false, false>, 'options' | 'renderInput' | 'value' | 'onChange'> {
669
+ interface Props$1 extends Omit<AutocompleteProps<AppSelectOptions$1, false, false, false>, 'options' | 'renderInput' | 'value' | 'onChange'> {
185
670
  name: string;
186
671
  label: string;
187
672
  options: AppSelectOptions$1[];
@@ -189,28 +674,115 @@ interface Props$2 extends Omit<AutocompleteProps<AppSelectOptions$1, false, fals
189
674
  required?: boolean;
190
675
  placeholder?: string;
191
676
  isResetRequired?: boolean;
677
+ variant?: 'outlined' | 'filled' | 'standard';
192
678
  }
193
- declare function AppSearchableSelectInput({ name, label, required, options, placeholder, setSearchQuery, isResetRequired, ...otherProps }: Props$2): React__default.JSX.Element;
679
+ declare function AppSearchableSelectInput({ name, label, options, required, variant, placeholder, setSearchQuery, isResetRequired, ...otherProps }: Props$1): React__default.JSX.Element;
194
680
 
195
681
  interface AppSelectOptions {
682
+ /** The label to display for this option */
196
683
  label: string;
684
+ /** The value to be used when this option is selected */
197
685
  value: string | number;
686
+ /** Whether this option is disabled */
687
+ disabled?: boolean;
688
+ /** Custom styles for this specific menu item */
689
+ sx?: SxProps<Theme>;
690
+ /** Custom styles for this specific menu item text */
691
+ textSx?: SxProps<Theme>;
692
+ /** Custom icon for the option */
693
+ icon?: ReactNode;
694
+ /** Custom component to render the option */
695
+ component?: ElementType;
696
+ /** Custom props for the option component */
697
+ componentProps?: Record<string, any>;
198
698
  }
199
- interface Props$1 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
699
+ interface AppSelectInputProps extends Omit<SelectProps, "name" | "label" | "value" | "onChange" | "sx"> {
700
+ /** Field name for formik */
200
701
  name: string;
201
- label: string;
702
+ /** Label for the select */
703
+ label?: string;
704
+ /** Array of select options */
202
705
  options: AppSelectOptions[];
706
+ /** Whether the field is required */
203
707
  required?: boolean;
204
- fullWidth?: boolean;
708
+ /** Whether the field is disabled */
709
+ disabled?: boolean;
710
+ /** Whether the field is read-only */
711
+ readOnly?: boolean;
712
+ /** Variant of the select input */
713
+ variant?: 'outlined' | 'filled' | 'standard';
714
+ /** Whether to show a 'None' option */
715
+ showNoneOption?: boolean;
716
+ /** Text to display for the 'None' option */
717
+ noneOptionText?: string;
718
+ /** Whether to show the helper text when no error */
719
+ showHelperText?: boolean;
720
+ /** Custom helper text to display */
721
+ helperText?: string;
722
+ /** Custom styles for the root container */
723
+ sx?: SxProps<Theme>;
724
+ /** Custom styles for the form control */
725
+ formControlSx?: SxProps<Theme>;
726
+ /** Custom styles for the select component */
727
+ selectSx?: SxProps<Theme>;
728
+ /** Custom styles for the input */
729
+ inputSx?: SxProps<Theme>;
730
+ /** Custom styles for the label */
731
+ labelSx?: SxProps<Theme>;
732
+ /** Custom styles for the menu paper */
733
+ menuPaperSx?: SxProps<Theme>;
734
+ /** Custom styles for all menu items */
735
+ menuItemSx?: SxProps<Theme>;
736
+ /** Custom styles for the selected menu item */
737
+ selectedMenuItemSx?: SxProps<Theme>;
738
+ /** Custom styles for the error message */
739
+ errorSx?: SxProps<Theme>;
740
+ /** Custom styles for the helper text */
741
+ helperTextSx?: SxProps<Theme>;
742
+ /** Custom styles for the select icon */
743
+ iconSx?: SxProps<Theme>;
744
+ /** Custom component for the label */
745
+ labelComponent?: ElementType;
746
+ /** Custom component for the error message */
747
+ errorComponent?: ElementType;
748
+ /** Custom component for the helper text */
749
+ helperTextComponent?: ElementType;
750
+ /** Callback when the value changes */
751
+ onChange?: (event: SelectChangeEvent$1<unknown>, child: ReactNode) => void;
752
+ /** Callback when the menu opens */
753
+ onOpen?: (event: React.SyntheticEvent) => void;
754
+ /** Callback when the menu closes */
755
+ onClose?: (event: React.SyntheticEvent) => void;
756
+ /** Callback when the field is blurred */
757
+ onBlur?: (event: React.FocusEvent) => void;
758
+ /** Custom render function for the selected value */
759
+ renderValue?: (value: unknown) => ReactNode;
760
+ /** Custom render function for menu items */
761
+ renderMenuItem?: (option: AppSelectOptions, index: number) => ReactNode;
762
+ /** Custom props for the MenuProps */
763
+ MenuProps?: any;
764
+ /** Custom props for the input component */
765
+ inputProps?: any;
205
766
  }
206
- declare function AppSelectInput({ name, label, fullWidth, required, options, ...otherProps }: Props$1): React.JSX.Element;
767
+ declare const AppSelectInput: React$1.ForwardRefExoticComponent<Omit<AppSelectInputProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
207
768
 
208
- interface AppSimpleUploadFilePropTypes {
769
+ interface AppSimpleUploadFileProps {
209
770
  name: string;
210
771
  label?: string;
772
+ accept?: string;
211
773
  multiple?: boolean;
774
+ disabled?: boolean;
775
+ required?: boolean;
776
+ maxFiles?: number;
777
+ maxSizeInBytes?: number;
778
+ sx?: SxProps<Theme>;
779
+ buttonSx?: SxProps<Theme>;
780
+ errorSx?: SxProps<Theme>;
781
+ onAdd?: (file: File) => void;
782
+ onRemove?: (file: File) => void;
783
+ onError?: (error: string) => void;
212
784
  }
213
- declare const AppSimpleUploadFile: ({ name, multiple }: AppSimpleUploadFilePropTypes) => React.JSX.Element;
785
+ declare const AppSimpleUploadFile: React__default.FC<AppSimpleUploadFileProps>;
214
786
 
215
787
  interface FileItem extends File {
216
788
  id?: number | string;
@@ -227,7 +799,7 @@ interface CustomFile extends File {
227
799
  }
228
800
  interface UploadProps extends DropzoneOptions {
229
801
  error?: boolean;
230
- sx?: SxProps<Theme>;
802
+ sx?: SxProps<Theme$1>;
231
803
  thumbnail?: boolean;
232
804
  isClickable?: boolean;
233
805
  placeholder?: React.ReactNode;
@@ -250,15 +822,32 @@ interface UploadProps extends DropzoneOptions {
250
822
  interface AppUploadFilePropTypes extends UploadProps {
251
823
  name: string;
252
824
  label?: string;
825
+ sx?: SxProps<Theme>;
826
+ uploadSx?: SxProps<Theme>;
827
+ errorSx?: SxProps<Theme>;
828
+ helperTextSx?: SxProps<Theme>;
829
+ previewSx?: SxProps<Theme>;
830
+ dropZoneSx?: SxProps<Theme>;
253
831
  }
254
- declare const AppUploadFile: ({ name, ...rest }: AppUploadFilePropTypes) => react_jsx_runtime.JSX.Element;
832
+ declare const AppUploadFile: ({ name, sx, uploadSx, errorSx, helperTextSx, previewSx, dropZoneSx, ...rest }: AppUploadFilePropTypes) => react_jsx_runtime.JSX.Element;
255
833
 
256
834
  interface SubmitButtonProps {
257
835
  children: React__default.ReactNode;
258
836
  loading?: boolean;
837
+ disabled?: boolean;
838
+ fullWidth?: boolean;
839
+ variant?: 'text' | 'outlined' | 'contained';
840
+ color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
841
+ size?: 'small' | 'medium' | 'large';
842
+ startIcon?: React__default.ReactNode;
843
+ endIcon?: React__default.ReactNode;
844
+ sx?: SxProps<Theme>;
845
+ buttonSx?: SxProps<Theme>;
846
+ loadingSx?: SxProps<Theme>;
847
+ disabledSx?: SxProps<Theme>;
259
848
  [key: string]: any;
260
849
  }
261
- declare const SubmitButton: ({ children, loading, disabled, ...rest }: SubmitButtonProps) => React__default.JSX.Element;
850
+ declare const SubmitButton: ({ children, loading, disabled, fullWidth, variant, color, size, startIcon, endIcon, sx, buttonSx, loadingSx, disabledSx, ...rest }: SubmitButtonProps) => React__default.JSX.Element;
262
851
 
263
852
  type IconifyProps = IconifyIcon | string;
264
853
 
@@ -267,4 +856,4 @@ interface Props extends BoxProps {
267
856
  }
268
857
  declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
269
858
 
270
- export { AppAutoComplete, AppAutoCompleter, CheckboxField as AppCheckBox, AppDateAndTimePicker, AppDatePicker, AppFormErrorMessage, AppInputField, AppMultiSelector, AppPhoneNoInput, AppRadioGroup, AppRating, AppRichTextEditor, AppSearchableMultiSelector, AppSearchableSelectInput, AppSelectInput, AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea, AppUploadFile, Form, Iconify, IconifyProps, SubmitButton, UploadProps };
859
+ export { AppAutoComplete, AppAutoCompleter, AppCheckBox, AppDateAndTimePicker, AppDatePicker, AppFormErrorMessage, AppInputField, AppMultiSelector, AppPhoneNoInput, AppRadioGroup, AppRating, AppRichTextEditor, AppSearchableMultiSelector, AppSearchableSelectInput, AppSelectInput, AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea, AppUploadFile, Form, Iconify, IconifyProps, SubmitButton, UploadProps };