formik-form-components 0.2.29 → 0.2.30

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,43 +1,27 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactElement, ReactNode, SyntheticEvent, ElementType } from 'react';
3
3
  import { FormikValues, FormikConfig, FormikProps } from 'formik';
4
- import { SxProps, Theme, AutocompleteProps, AutocompleteChangeReason, AutocompleteChangeDetails, TextFieldProps, RadioGroupProps, BoxProps } from '@mui/material';
4
+ import { SxProps, Theme, SwitchProps, AutocompleteProps, AutocompleteChangeReason, AutocompleteChangeDetails, Checkbox, TextFieldProps, RadioGroupProps, BoxProps } from '@mui/material';
5
5
  import { Theme as Theme$1 } from '@mui/material/styles';
6
- import { SelectProps } from '@mui/material/Select';
7
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import { DateTimePickerProps } from '@mui/x-date-pickers/DateTimePicker';
8
8
  import { Dayjs } from 'dayjs';
9
+ import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
10
+ import { SelectProps } from '@mui/material/Select';
9
11
  import { DropzoneOptions } from 'react-dropzone';
10
12
  import { IconifyIcon } from '@iconify/react';
11
13
 
12
- type AppDatePickerProps = {
14
+ declare const AppDatePicker: React__default.ForwardRefExoticComponent<{
13
15
  name: string;
14
16
  label?: string;
15
17
  disabled?: boolean;
18
+ disablePast?: boolean;
16
19
  format?: string;
17
20
  sx?: SxProps<Theme>;
18
21
  textFieldSx?: SxProps<Theme>;
19
- };
20
- declare const AppDatePicker: React__default.ForwardRefExoticComponent<AppDatePickerProps & React__default.RefAttributes<HTMLDivElement>>;
22
+ } & Omit<DatePickerProps<true, Dayjs, Dayjs>, "value" | "onChange" | "renderInput"> & React__default.RefAttributes<HTMLDivElement>>;
21
23
 
22
- interface AppSelectOptions {
23
- label: string;
24
- value: string | number;
25
- }
26
- interface Props$7 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
27
- name: string;
28
- label?: string;
29
- placeholder?: string;
30
- options: AppSelectOptions[];
31
- disabled?: boolean;
32
- sx?: SxProps<Theme>;
33
- formControlSx?: SxProps<Theme>;
34
- textFieldSx?: SxProps<Theme>;
35
- listboxSx?: SxProps<Theme>;
36
- errorSx?: SxProps<Theme>;
37
- }
38
- declare function AppAutoCompleter({ placeholder, name, label, options, disabled, sx, formControlSx, textFieldSx, listboxSx, errorSx }: Props$7): React.JSX.Element;
39
-
40
- interface AppDateAndTimePickerProps {
24
+ type AppDateAndTimePickerProps = {
41
25
  /** Field name for formik */
42
26
  name: string;
43
27
  /** Label for the date and time picker */
@@ -80,7 +64,7 @@ interface AppDateAndTimePickerProps {
80
64
  onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
81
65
  /** Additional props to pass to the DateTimePicker */
82
66
  [key: string]: any;
83
- }
67
+ } & Omit<DateTimePickerProps<true, Dayjs, Dayjs>, "value" | "onChange" | "renderInput">;
84
68
  declare const AppDateAndTimePicker: React__default.ForwardRefExoticComponent<Omit<AppDateAndTimePickerProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
85
69
 
86
70
  interface Props$6 {
@@ -90,7 +74,7 @@ interface Props$6 {
90
74
  containerSx?: SxProps<Theme>;
91
75
  textSx?: SxProps<Theme>;
92
76
  }
93
- declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx }: Props$6): React.JSX.Element | null;
77
+ declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx, }: Props$6): React.JSX.Element | null;
94
78
 
95
79
  interface AppTextAreaProps {
96
80
  /** Field name for formik */
@@ -155,7 +139,7 @@ interface Props$5 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChan
155
139
  }
156
140
  declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, sx, formControlSx, textFieldSx, chipSx, listboxSx, errorSx, chipContainerSx, inputSx, }: Props$5): React.JSX.Element;
157
141
 
158
- interface AppSwitchInputProps {
142
+ interface AppSwitchInputProps extends Omit<SwitchProps, "name" | "checked" | "onChange"> {
159
143
  name: string;
160
144
  label?: string;
161
145
  className?: string;
@@ -170,7 +154,7 @@ interface AppSwitchInputProps {
170
154
  }
171
155
  declare function AppSwitchInput({ name, label, className, sx, containerSx, switchSx, labelSx, errorSx, labelPlacement, disabled, ...otherProps }: AppSwitchInputProps): React__default.JSX.Element;
172
156
 
173
- interface AppSwitchProps {
157
+ interface AppSwitchProps extends Omit<SwitchProps, "name" | "checked" | "onChange"> {
174
158
  name: string;
175
159
  label: string;
176
160
  sx?: SxProps<Theme>;
@@ -189,7 +173,7 @@ interface FormProps<T> extends FormikConfig<T> {
189
173
  }
190
174
  declare const Form: <T extends FormikValues>({ children, className, ...props }: FormProps<T>) => ReactElement;
191
175
 
192
- interface Props$4 extends Omit<AutocompleteProps<string, true, boolean, false, 'div'>, 'renderInput' | 'onChange' | 'value' | 'multiple' | 'freeSolo'> {
176
+ interface Props$4 extends Omit<AutocompleteProps<string, true, boolean, false, "div">, "renderInput" | "onChange" | "value" | "multiple" | "freeSolo"> {
193
177
  name: string;
194
178
  freeSolo?: boolean;
195
179
  label?: string;
@@ -207,51 +191,61 @@ interface Props$4 extends Omit<AutocompleteProps<string, true, boolean, false, '
207
191
  }
208
192
  declare function AppAutoComplete({ placeholder, name, variant, label, options, value: propValue, onChange: propOnChange, sx, formControlSx, textFieldSx, chipSx, errorSx, }: Props$4): React.JSX.Element;
209
193
 
194
+ interface SelectOption {
195
+ label: string;
196
+ value: string | number;
197
+ }
198
+ type OptionType = string | SelectOption;
199
+ interface Props$3 extends Omit<AutocompleteProps<OptionType, boolean, boolean, boolean>, "renderInput" | "options" | "value" | "onChange"> {
200
+ name: string;
201
+ label?: string;
202
+ placeholder?: string;
203
+ options: OptionType[];
204
+ multiple?: boolean;
205
+ freeSolo?: boolean;
206
+ sx?: SxProps<Theme>;
207
+ formControlSx?: SxProps<Theme>;
208
+ textFieldSx?: SxProps<Theme>;
209
+ chipSx?: SxProps<Theme>;
210
+ errorSx?: SxProps<Theme>;
211
+ }
212
+ declare function AppAutoCompleter({ name, label, placeholder, options, multiple, freeSolo, sx, formControlSx, textFieldSx, chipSx, errorSx, ...rest }: Props$3): React__default.JSX.Element;
213
+
210
214
  interface CheckboxOption {
211
215
  label: string;
212
216
  name: string;
213
- value: string | boolean | number;
217
+ value: string | number | boolean;
214
218
  disabled?: boolean;
215
219
  }
216
- interface Props$3 {
217
- /** Array of checkbox options with label and value */
218
- option: CheckboxOption[];
219
- /** Field name for formik */
220
+ interface Props$2 {
220
221
  name: string;
221
- /** Label for the checkbox group */
222
+ option: CheckboxOption[];
222
223
  label?: string;
223
- /** Whether the field is required */
224
224
  required?: boolean;
225
- /** Whether the checkbox group is disabled */
226
225
  disabled?: boolean;
227
- /** Whether the checkbox group is in a row */
228
226
  row?: boolean;
229
- /** Custom styles for the root container */
230
227
  sx?: SxProps<Theme>;
231
- /** Custom styles for the checkbox component */
232
228
  checkboxSx?: SxProps<Theme>;
233
- /** Custom styles for the label */
234
229
  labelSx?: SxProps<Theme>;
235
- /** Custom styles for the error message */
236
230
  errorSx?: SxProps<Theme>;
237
- /** Custom styles for the checkbox container */
238
231
  containerSx?: SxProps<Theme>;
239
- /** Custom styles for the checkbox icon */
240
232
  iconSx?: SxProps<Theme>;
241
- /** Custom styles for the checked state */
242
233
  checkedSx?: SxProps<Theme>;
234
+ checkboxProps?: React__default.ComponentProps<typeof Checkbox>;
243
235
  }
244
- declare const AppCheckBox: ({ name, option, label, required, disabled, row, sx, checkboxSx, labelSx, errorSx, containerSx, iconSx, checkedSx, ...rest }: Props$3) => react_jsx_runtime.JSX.Element;
236
+ declare const AppCheckBox: ({ name, option, label, required, disabled, row, sx, checkboxSx, labelSx, errorSx, containerSx, iconSx, checkedSx, checkboxProps, }: Props$2) => react_jsx_runtime.JSX.Element;
245
237
 
246
- interface Props$2 extends Omit<TextFieldProps, 'variant'> {
238
+ interface CustomInputProps {
247
239
  name: string;
248
- label: ReactNode;
240
+ label?: ReactNode;
241
+ required?: boolean;
249
242
  tagUser?: string;
250
243
  hasReply?: boolean;
251
- required?: boolean;
252
- variant?: 'outlined' | 'filled' | 'standard';
253
244
  }
254
- declare function AppInputField({ name, label, type, InputProps, required, variant, ...otherProps }: Props$2): React__default.JSX.Element;
245
+ type AppInputFieldProps = CustomInputProps & Omit<TextFieldProps, "name" | "label" | "variant"> & {
246
+ variant?: "outlined" | "filled" | "standard";
247
+ };
248
+ declare function AppInputField({ name, label, type, required, variant, InputProps, ...otherProps }: AppInputFieldProps): React__default.JSX.Element;
255
249
 
256
250
  interface AppSelectOption$1 {
257
251
  label: string;
@@ -312,49 +306,28 @@ interface AppPhoneNoInputProps {
312
306
  declare const AppPhoneNoInput: React__default.FC<AppPhoneNoInputProps>;
313
307
 
314
308
  interface RadioOption {
315
- /** The label to be shown next to the radio button */
316
309
  label: string;
317
- /** The value to be used when this option is selected */
318
310
  value: string | number;
319
- /** Whether this option is disabled */
320
311
  disabled?: boolean;
321
- /** Custom styles for this specific radio option */
322
312
  sx?: SxProps<Theme>;
323
- /** Custom styles for this specific radio button */
324
313
  radioSx?: SxProps<Theme>;
325
- /** Custom styles for this specific label */
326
314
  labelSx?: SxProps<Theme>;
327
315
  }
328
- interface AppRadioGroupProps extends Omit<RadioGroupProps, 'onChange' | 'onBlur' | 'value'> {
329
- /** Field name for formik */
316
+ interface AppRadioGroupProps extends Omit<RadioGroupProps, "onChange" | "onBlur" | "value"> {
330
317
  name: string;
331
- /** Array of radio options */
332
318
  options: RadioOption[];
333
- /** Label for the radio group */
334
319
  label?: string;
335
- /** Whether the field is required */
336
320
  required?: boolean;
337
- /** Whether the radio group is disabled */
338
321
  disabled?: boolean;
339
- /** Whether to show the radio group in a row */
340
322
  row?: boolean;
341
- /** Custom styles for the root container */
342
323
  sx?: SxProps<Theme>;
343
- /** Custom styles for the form control */
344
324
  formControlSx?: SxProps<Theme>;
345
- /** Custom styles for the radio group */
346
325
  radioGroupSx?: SxProps<Theme>;
347
- /** Custom styles for the form label */
348
326
  formLabelSx?: SxProps<Theme>;
349
- /** Custom styles for the radio buttons */
350
327
  radioSx?: SxProps<Theme>;
351
- /** Custom styles for the radio labels */
352
328
  labelSx?: SxProps<Theme>;
353
- /** Custom styles for the error message */
354
329
  errorSx?: SxProps<Theme>;
355
- /** Callback when the value changes */
356
330
  onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, value: string) => void;
357
- /** Callback when the field is blurred */
358
331
  onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
359
332
  }
360
333
  declare const AppRadioGroup: React__default.ForwardRefExoticComponent<Omit<AppRadioGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
@@ -433,12 +406,12 @@ interface AppRatingProps {
433
406
  }
434
407
  declare const AppRating: React$1.ForwardRefExoticComponent<AppRatingProps & React$1.RefAttributes<HTMLDivElement>>;
435
408
 
409
+ type EditorButton = "bold" | "italic" | "underline" | "strike" | "bulletList" | "orderedList" | "alignLeft" | "alignCenter" | "alignRight" | "heading1" | "heading2" | "undo" | "redo" | "link";
436
410
  interface Props$1 {
437
411
  name: string;
438
412
  label?: string;
439
413
  placeholder?: string;
440
414
  required?: boolean;
441
- /** Variant of the input field */
442
415
  variant?: "outlined" | "filled" | "standard";
443
416
  sx?: SxProps<Theme>;
444
417
  editorSx?: SxProps<Theme>;
@@ -449,8 +422,9 @@ interface Props$1 {
449
422
  buttonSx?: SxProps<Theme>;
450
423
  activeButtonSx?: SxProps<Theme>;
451
424
  dialogSx?: SxProps<Theme>;
425
+ showButtons?: EditorButton[];
452
426
  }
453
- declare const AppRichTextEditor: ({ name, label, required, variant, placeholder, sx, editorSx, toolbarSx, contentSx, errorSx, labelSx, buttonSx, activeButtonSx, dialogSx, }: Props$1) => react_jsx_runtime.JSX.Element | null;
427
+ declare const AppRichTextEditor: React__default.FC<Props$1>;
454
428
 
455
429
  interface AppSelectOption {
456
430
  label: string;