formik-form-components 0.2.26 → 0.2.27

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
@@ -23,7 +23,7 @@ interface AppSelectOptions$4 {
23
23
  label: string;
24
24
  value: string | number;
25
25
  }
26
- interface Props$7 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
26
+ interface Props$8 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
27
27
  name: string;
28
28
  label?: string;
29
29
  placeholder?: string;
@@ -35,7 +35,7 @@ interface Props$7 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChan
35
35
  listboxSx?: SxProps<Theme>;
36
36
  errorSx?: SxProps<Theme>;
37
37
  }
38
- declare function AppAutoCompleter({ placeholder, name, label, options, disabled, sx, formControlSx, textFieldSx, listboxSx, errorSx }: Props$7): React.JSX.Element;
38
+ declare function AppAutoCompleter({ placeholder, name, label, options, disabled, sx, formControlSx, textFieldSx, listboxSx, errorSx }: Props$8): React.JSX.Element;
39
39
 
40
40
  interface AppDateAndTimePickerProps {
41
41
  /** Field name for formik */
@@ -83,14 +83,14 @@ interface AppDateAndTimePickerProps {
83
83
  }
84
84
  declare const AppDateAndTimePicker: React__default.ForwardRefExoticComponent<Omit<AppDateAndTimePickerProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
85
85
 
86
- interface Props$6 {
86
+ interface Props$7 {
87
87
  name: string;
88
88
  alwaysShow?: boolean;
89
89
  sx?: SxProps<Theme>;
90
90
  containerSx?: SxProps<Theme>;
91
91
  textSx?: SxProps<Theme>;
92
92
  }
93
- declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx }: Props$6): React.JSX.Element | null;
93
+ declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx }: Props$7): React.JSX.Element | null;
94
94
 
95
95
  interface AppTextAreaProps {
96
96
  /** Field name for formik */
@@ -136,7 +136,7 @@ interface AppTextAreaProps {
136
136
  }
137
137
  declare const AppTextArea: React$1.ForwardRefExoticComponent<Omit<AppTextAreaProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
138
138
 
139
- interface Props$5 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
139
+ interface Props$6 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
140
140
  name: string;
141
141
  freeSolo?: boolean;
142
142
  multiple?: boolean;
@@ -153,7 +153,7 @@ interface Props$5 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChan
153
153
  chipContainerSx?: SxProps<Theme>;
154
154
  inputSx?: SxProps<Theme>;
155
155
  }
156
- declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, sx, formControlSx, textFieldSx, chipSx, listboxSx, errorSx, chipContainerSx, inputSx, }: Props$5): React.JSX.Element;
156
+ declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, sx, formControlSx, textFieldSx, chipSx, listboxSx, errorSx, chipContainerSx, inputSx, }: Props$6): React.JSX.Element;
157
157
 
158
158
  interface AppSwitchInputProps {
159
159
  name: string;
@@ -164,7 +164,7 @@ interface AppSwitchInputProps {
164
164
  switchSx?: SxProps<Theme>;
165
165
  labelSx?: SxProps<Theme>;
166
166
  errorSx?: SxProps<Theme>;
167
- labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
167
+ labelPlacement?: "start" | "end" | "top" | "bottom";
168
168
  disabled?: boolean;
169
169
  [key: string]: unknown;
170
170
  }
@@ -178,7 +178,7 @@ interface AppSwitchProps {
178
178
  switchSx?: SxProps<Theme>;
179
179
  labelSx?: SxProps<Theme>;
180
180
  errorSx?: SxProps<Theme>;
181
- labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
181
+ labelPlacement?: "start" | "end" | "top" | "bottom";
182
182
  disabled?: boolean;
183
183
  }
184
184
  declare function AppSwitch({ name, label, sx, containerSx, switchSx, labelSx, errorSx, labelPlacement, disabled, ...otherProps }: AppSwitchProps): React.JSX.Element;
@@ -189,7 +189,7 @@ interface FormProps<T> extends FormikConfig<T> {
189
189
  }
190
190
  declare const Form: <T extends FormikValues>({ children, className, ...props }: FormProps<T>) => ReactElement;
191
191
 
192
- interface Props$4 extends Omit<AutocompleteProps<string, true, boolean, false, 'div'>, 'renderInput' | 'onChange' | 'value' | 'multiple' | 'freeSolo'> {
192
+ interface Props$5 extends Omit<AutocompleteProps<string, true, boolean, false, 'div'>, 'renderInput' | 'onChange' | 'value' | 'multiple' | 'freeSolo'> {
193
193
  name: string;
194
194
  freeSolo?: boolean;
195
195
  label?: string;
@@ -205,7 +205,7 @@ interface Props$4 extends Omit<AutocompleteProps<string, true, boolean, false, '
205
205
  chipSx?: SxProps<Theme$1>;
206
206
  errorSx?: SxProps<Theme$1>;
207
207
  }
208
- declare function AppAutoComplete({ placeholder, name, variant, label, options, value: propValue, onChange: propOnChange, sx, formControlSx, textFieldSx, chipSx, errorSx, }: Props$4): React.JSX.Element;
208
+ declare function AppAutoComplete({ placeholder, name, variant, label, options, value: propValue, onChange: propOnChange, sx, formControlSx, textFieldSx, chipSx, errorSx, }: Props$5): React.JSX.Element;
209
209
 
210
210
  interface CheckboxOption {
211
211
  label: string;
@@ -213,7 +213,7 @@ interface CheckboxOption {
213
213
  value: string | boolean | number;
214
214
  disabled?: boolean;
215
215
  }
216
- interface Props$3 {
216
+ interface Props$4 {
217
217
  /** Array of checkbox options with label and value */
218
218
  option: CheckboxOption[];
219
219
  /** Field name for formik */
@@ -241,9 +241,9 @@ interface Props$3 {
241
241
  /** Custom styles for the checked state */
242
242
  checkedSx?: SxProps<Theme>;
243
243
  }
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;
244
+ declare const AppCheckBox: ({ name, option, label, required, disabled, row, sx, checkboxSx, labelSx, errorSx, containerSx, iconSx, checkedSx, ...rest }: Props$4) => react_jsx_runtime.JSX.Element;
245
245
 
246
- interface Props$2 extends Omit<TextFieldProps, 'variant'> {
246
+ interface Props$3 extends Omit<TextFieldProps, 'variant'> {
247
247
  name: string;
248
248
  label: ReactNode;
249
249
  tagUser?: string;
@@ -251,7 +251,7 @@ interface Props$2 extends Omit<TextFieldProps, 'variant'> {
251
251
  required?: boolean;
252
252
  variant?: 'outlined' | 'filled' | 'standard';
253
253
  }
254
- declare function AppInputField({ name, label, type, InputProps, required, variant, ...otherProps }: Props$2): React__default.JSX.Element;
254
+ declare function AppInputField({ name, label, type, InputProps, required, variant, ...otherProps }: Props$3): React__default.JSX.Element;
255
255
 
256
256
  interface AppSelectOptions$3 {
257
257
  /** The label to display for this option */
@@ -459,7 +459,7 @@ interface AppRatingProps {
459
459
  }
460
460
  declare const AppRating: React$1.ForwardRefExoticComponent<AppRatingProps & React$1.RefAttributes<HTMLDivElement>>;
461
461
 
462
- interface Props$1 {
462
+ interface Props$2 {
463
463
  name: string;
464
464
  label?: string;
465
465
  placeholder?: string;
@@ -476,7 +476,7 @@ interface Props$1 {
476
476
  activeButtonSx?: SxProps<Theme>;
477
477
  dialogSx?: SxProps<Theme>;
478
478
  }
479
- 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;
479
+ 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;
480
480
 
481
481
  interface AppSelectOptions$2 {
482
482
  /** Display text for the option */
@@ -502,8 +502,8 @@ interface AppSelectOptions$2 {
502
502
  /** Custom props for the option component */
503
503
  componentProps?: Record<string, any>;
504
504
  }
505
- type CustomAutocompleteProps$1 = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
506
- interface AppSearchableMultiSelectorProps$1 extends CustomAutocompleteProps$1 {
505
+ type CustomAutocompleteProps = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
506
+ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
507
507
  /** Field name for formik */
508
508
  name: string;
509
509
  /** Label for the input */
@@ -512,8 +512,8 @@ interface AppSearchableMultiSelectorProps$1 extends CustomAutocompleteProps$1 {
512
512
  multiple?: boolean;
513
513
  /** Available options */
514
514
  options: AppSelectOptions$2[];
515
- /** Callback when search query changes - useful for remote searching */
516
- setSearchQuery?: React__default.Dispatch<SetStateAction<string>>;
515
+ /** Callback when search query changes */
516
+ setSearchQuery: React__default.Dispatch<SetStateAction<string>>;
517
517
  /** Whether the field is required */
518
518
  required?: boolean;
519
519
  /** Whether the field is disabled */
@@ -633,135 +633,111 @@ interface AppSearchableMultiSelectorProps$1 extends CustomAutocompleteProps$1 {
633
633
  /** Callback when a selection is added */
634
634
  onAdd?: (value: AppSelectOptions$2) => void;
635
635
  }
636
- declare const AppSearchableMultiSelector$1: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps$1, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
636
+ declare const AppSearchableMultiSelector: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
637
637
 
638
638
  interface AppSelectOptions$1 {
639
639
  label: string;
640
- value: number | string;
640
+ value: string | number;
641
641
  searchAbleValue1?: string;
642
642
  searchAbleValue2?: string;
643
643
  searchAbleValue3?: string;
644
- disabled?: boolean;
645
- sx?: SxProps<Theme>;
646
- textSx?: SxProps<Theme>;
647
- icon?: ReactNode;
648
- component?: ElementType;
649
- componentProps?: Record<string, any>;
650
644
  }
651
- type CustomAutocompleteProps = Omit<AutocompleteProps<AppSelectOptions$1, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
652
- interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
645
+ interface Props$1 extends Omit<AutocompleteProps<AppSelectOptions$1, false, false, false>, "options" | "renderInput" | "value" | "onChange"> {
653
646
  name: string;
654
- label?: string;
655
- multiple?: boolean;
647
+ label: string;
656
648
  options: AppSelectOptions$1[];
657
- setSearchQuery?: React__default.Dispatch<SetStateAction<string>>;
649
+ setSearchQuery?: React__default.Dispatch<SetStateAction<string>> | undefined;
658
650
  required?: boolean;
659
- disabled?: boolean;
660
- readOnly?: boolean;
661
- showHelperText?: boolean;
662
- helperText?: string;
663
- maxSelections?: number;
664
- showSelectedCount?: boolean;
651
+ placeholder?: string;
652
+ isResetRequired?: boolean;
665
653
  variant?: "outlined" | "filled" | "standard";
666
- sx?: SxProps<Theme>;
667
- formControlSx?: SxProps<Theme>;
668
- labelSx?: SxProps<Theme>;
669
- inputSx?: SxProps<Theme>;
670
- textFieldSx?: SxProps<Theme>;
671
- autocompleteSx?: SxProps<Theme>;
672
- listboxSx?: SxProps<Theme>;
673
- optionSx?: SxProps<Theme>;
674
- chipSx?: SxProps<Theme>;
675
- errorSx?: SxProps<Theme>;
676
- helperTextSx?: SxProps<Theme>;
677
- selectedCountSx?: SxProps<Theme>;
678
- renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
679
- renderOption?: (props: React__default.HTMLAttributes<HTMLLIElement>, option: AppSelectOptions$1, state: AutocompleteRenderOptionState, ownerState: any) => ReactNode;
680
- renderTags?: (value: AppSelectOptions$1[], getTagProps: (params: {
681
- index: number;
682
- }) => {
683
- key: number | string;
684
- }, ownerState: any) => ReactNode;
685
- renderGroup?: (params: AutocompleteRenderGroupParams) => ReactNode;
686
- labelComponent?: ElementType;
687
- inputComponent?: ElementType;
688
- errorComponent?: ElementType;
689
- helperTextComponent?: ElementType;
690
- labelProps?: Record<string, any>;
691
- inputProps?: Record<string, any>;
692
- textFieldProps?: Record<string, any>;
693
- autocompleteProps?: Record<string, any>;
694
- checkboxProps?: CheckboxProps;
695
- chipProps?: ChipProps;
696
- errorProps?: Record<string, any>;
697
- helperTextProps?: Record<string, any>;
698
- className?: string;
699
- formControlClassName?: string;
700
- labelClassName?: string;
701
- inputClassName?: string;
702
- textFieldClassName?: string;
703
- autocompleteClassName?: string;
704
- listboxClassName?: string;
705
- optionClassName?: string;
706
- chipClassName?: string;
707
- errorClassName?: string;
708
- helperTextClassName?: string;
709
- onChange?: (event: React__default.SyntheticEvent, value: AppSelectOptions$1[], reason: string) => void;
710
- onInputChange?: (event: React__default.SyntheticEvent, value: string, reason: string) => void;
711
- onOpen?: (event: React__default.SyntheticEvent) => void;
712
- onClose?: (event: React__default.SyntheticEvent, reason: string) => void;
713
- onBlur?: (event: React__default.FocusEvent) => void;
714
- onFocus?: (event: React__default.FocusEvent) => void;
715
- onClear?: () => void;
716
- onMaxSelectionsReached?: (maxSelections: number) => void;
717
- onRemove?: (value: AppSelectOptions$1) => void;
718
- onAdd?: (value: AppSelectOptions$1) => void;
719
654
  }
720
- declare const AppSearchableMultiSelector: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
655
+ declare function AppSearchableSelectInput({ name, label, options, required, variant, placeholder, setSearchQuery, isResetRequired, ...otherProps }: Props$1): React__default.JSX.Element;
721
656
 
722
657
  interface AppSelectOptions {
658
+ /** The label to display for this option */
723
659
  label: string;
660
+ /** The value to be used when this option is selected */
724
661
  value: string | number;
662
+ /** Whether this option is disabled */
725
663
  disabled?: boolean;
664
+ /** Custom styles for this specific menu item */
726
665
  sx?: SxProps<Theme>;
666
+ /** Custom styles for this specific menu item text */
727
667
  textSx?: SxProps<Theme>;
668
+ /** Custom icon for the option */
728
669
  icon?: ReactNode;
670
+ /** Custom component to render the option */
729
671
  component?: ElementType;
672
+ /** Custom props for the option component */
730
673
  componentProps?: Record<string, any>;
731
674
  }
732
675
  interface AppSelectInputProps extends Omit<SelectProps, "name" | "label" | "value" | "onChange" | "sx"> {
676
+ /** Field name for formik */
733
677
  name: string;
678
+ /** Label for the select */
734
679
  label?: string;
680
+ /** Array of select options */
735
681
  options: AppSelectOptions[];
682
+ /** Whether the field is required */
736
683
  required?: boolean;
684
+ /** Whether the field is disabled */
737
685
  disabled?: boolean;
686
+ /** Whether the field is read-only */
738
687
  readOnly?: boolean;
688
+ /** Variant of the select input */
739
689
  variant?: "outlined" | "filled" | "standard";
690
+ /** Whether to show a 'None' option */
740
691
  showNoneOption?: boolean;
692
+ /** Text to display for the 'None' option */
741
693
  noneOptionText?: string;
694
+ /** Whether to show the helper text when no error */
742
695
  showHelperText?: boolean;
696
+ /** Custom helper text to display */
743
697
  helperText?: string;
698
+ /** Custom styles for the root container */
744
699
  sx?: SxProps<Theme>;
700
+ /** Custom styles for the form control */
745
701
  formControlSx?: SxProps<Theme>;
702
+ /** Custom styles for the select component */
746
703
  selectSx?: SxProps<Theme>;
704
+ /** Custom styles for the input */
747
705
  inputSx?: SxProps<Theme>;
706
+ /** Custom styles for the label */
748
707
  labelSx?: SxProps<Theme>;
708
+ /** Custom styles for the menu paper */
749
709
  menuPaperSx?: SxProps<Theme>;
710
+ /** Custom styles for all menu items */
750
711
  menuItemSx?: SxProps<Theme>;
712
+ /** Custom styles for the selected menu item */
751
713
  selectedMenuItemSx?: SxProps<Theme>;
714
+ /** Custom styles for the error message */
752
715
  errorSx?: SxProps<Theme>;
716
+ /** Custom styles for the helper text */
753
717
  helperTextSx?: SxProps<Theme>;
718
+ /** Custom styles for the select icon */
754
719
  iconSx?: SxProps<Theme>;
720
+ /** Custom component for the label */
755
721
  labelComponent?: ElementType;
722
+ /** Custom component for the error message */
756
723
  errorComponent?: ElementType;
724
+ /** Custom component for the helper text */
757
725
  helperTextComponent?: ElementType;
726
+ /** Callback when the value changes */
758
727
  onChange?: (event: SelectChangeEvent$1<unknown>, child: ReactNode) => void;
728
+ /** Callback when the menu opens */
759
729
  onOpen?: (event: React.SyntheticEvent) => void;
730
+ /** Callback when the menu closes */
760
731
  onClose?: (event: React.SyntheticEvent) => void;
732
+ /** Callback when the field is blurred */
761
733
  onBlur?: (event: React.FocusEvent) => void;
734
+ /** Custom render function for the selected value */
762
735
  renderValue?: (value: unknown) => ReactNode;
736
+ /** Custom render function for menu items */
763
737
  renderMenuItem?: (option: AppSelectOptions, index: number) => ReactNode;
738
+ /** Custom props for the MenuProps */
764
739
  MenuProps?: any;
740
+ /** Custom props for the input component */
765
741
  inputProps?: any;
766
742
  }
767
743
  declare const AppSelectInput: React$1.ForwardRefExoticComponent<Omit<AppSelectInputProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -850,4 +826,4 @@ interface Props extends BoxProps {
850
826
  }
851
827
  declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
852
828
 
853
- export { AppAutoComplete, AppAutoCompleter, AppCheckBox, AppDateAndTimePicker, AppDatePicker, AppFormErrorMessage, AppInputField, AppMultiSelector, AppPhoneNoInput, AppRadioGroup, AppRating, AppRichTextEditor, AppSearchableMultiSelector$1 as AppSearchableMultiSelector, AppSearchableMultiSelector as AppSearchableSelectInput, AppSelectInput, AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea, AppUploadFile, Form, Iconify, IconifyProps, SubmitButton, UploadProps };
829
+ 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 };