formik-form-components 0.2.11 → 0.2.13

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