formik-form-components 0.2.25 → 0.2.26

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$8 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
26
+ interface Props$7 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$8 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$8): React.JSX.Element;
38
+ declare function AppAutoCompleter({ placeholder, name, label, options, disabled, sx, formControlSx, textFieldSx, listboxSx, errorSx }: Props$7): 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$7 {
86
+ interface Props$6 {
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$7): React.JSX.Element | null;
93
+ declare function AppFormErrorMessage({ name, alwaysShow, sx, containerSx, textSx }: Props$6): 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$6 extends Omit<SelectProps, 'name' | 'label' | 'value' | 'onChange'> {
139
+ interface Props$5 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$6 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$6): React.JSX.Element;
156
+ declare function AppTagsCreator({ placeholder, name, multiple, label, options, disabled, sx, formControlSx, textFieldSx, chipSx, listboxSx, errorSx, chipContainerSx, inputSx, }: Props$5): React.JSX.Element;
157
157
 
158
158
  interface AppSwitchInputProps {
159
159
  name: string;
@@ -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$5 extends Omit<AutocompleteProps<string, true, boolean, false, 'div'>, 'renderInput' | 'onChange' | 'value' | 'multiple' | 'freeSolo'> {
192
+ interface Props$4 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$5 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$5): React.JSX.Element;
208
+ declare function AppAutoComplete({ placeholder, name, variant, label, options, value: propValue, onChange: propOnChange, sx, formControlSx, textFieldSx, chipSx, errorSx, }: Props$4): 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$4 {
216
+ interface Props$3 {
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$4 {
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$4) => react_jsx_runtime.JSX.Element;
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;
245
245
 
246
- interface Props$3 extends Omit<TextFieldProps, 'variant'> {
246
+ interface Props$2 extends Omit<TextFieldProps, 'variant'> {
247
247
  name: string;
248
248
  label: ReactNode;
249
249
  tagUser?: string;
@@ -251,7 +251,7 @@ interface Props$3 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$3): React__default.JSX.Element;
254
+ declare function AppInputField({ name, label, type, InputProps, required, variant, ...otherProps }: Props$2): 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$2 {
462
+ interface Props$1 {
463
463
  name: string;
464
464
  label?: string;
465
465
  placeholder?: string;
@@ -476,7 +476,7 @@ interface Props$2 {
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$2) => 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$1) => 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 = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
506
- interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
505
+ type CustomAutocompleteProps$1 = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
506
+ interface AppSearchableMultiSelectorProps$1 extends CustomAutocompleteProps$1 {
507
507
  /** Field name for formik */
508
508
  name: string;
509
509
  /** Label for the input */
@@ -512,8 +512,8 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
512
512
  multiple?: boolean;
513
513
  /** Available options */
514
514
  options: AppSelectOptions$2[];
515
- /** Callback when search query changes */
516
- setSearchQuery: React__default.Dispatch<SetStateAction<string>>;
515
+ /** Callback when search query changes - useful for remote searching */
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 */
@@ -529,7 +529,7 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
529
529
  /** Whether to show the selected count */
530
530
  showSelectedCount?: boolean;
531
531
  /** Variant of the input field */
532
- variant?: 'outlined' | 'filled' | 'standard';
532
+ variant?: "outlined" | "filled" | "standard";
533
533
  /** Custom styles for the root container */
534
534
  sx?: SxProps<Theme>;
535
535
  /** Custom styles for the form control */
@@ -633,111 +633,135 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
633
633
  /** Callback when a selection is added */
634
634
  onAdd?: (value: AppSelectOptions$2) => void;
635
635
  }
636
- declare const AppSearchableMultiSelector: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
636
+ declare const AppSearchableMultiSelector$1: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps$1, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
637
637
 
638
638
  interface AppSelectOptions$1 {
639
639
  label: string;
640
- value: string | number;
640
+ value: number | string;
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>;
644
650
  }
645
- interface Props$1 extends Omit<AutocompleteProps<AppSelectOptions$1, false, false, false>, 'options' | 'renderInput' | 'value' | 'onChange'> {
651
+ type CustomAutocompleteProps = Omit<AutocompleteProps<AppSelectOptions$1, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
652
+ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
646
653
  name: string;
647
- label: string;
654
+ label?: string;
655
+ multiple?: boolean;
648
656
  options: AppSelectOptions$1[];
649
- setSearchQuery?: React__default.Dispatch<SetStateAction<string>> | undefined;
657
+ setSearchQuery?: React__default.Dispatch<SetStateAction<string>>;
650
658
  required?: boolean;
651
- placeholder?: string;
652
- isResetRequired?: boolean;
653
- variant?: 'outlined' | 'filled' | 'standard';
659
+ disabled?: boolean;
660
+ readOnly?: boolean;
661
+ showHelperText?: boolean;
662
+ helperText?: string;
663
+ maxSelections?: number;
664
+ showSelectedCount?: boolean;
665
+ 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;
654
719
  }
655
- declare function AppSearchableSelectInput({ name, label, options, required, variant, placeholder, setSearchQuery, isResetRequired, ...otherProps }: Props$1): React__default.JSX.Element;
720
+ declare const AppSearchableMultiSelector: React__default.ForwardRefExoticComponent<Omit<AppSearchableMultiSelectorProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
656
721
 
657
722
  interface AppSelectOptions {
658
- /** The label to display for this option */
659
723
  label: string;
660
- /** The value to be used when this option is selected */
661
724
  value: string | number;
662
- /** Whether this option is disabled */
663
725
  disabled?: boolean;
664
- /** Custom styles for this specific menu item */
665
726
  sx?: SxProps<Theme>;
666
- /** Custom styles for this specific menu item text */
667
727
  textSx?: SxProps<Theme>;
668
- /** Custom icon for the option */
669
728
  icon?: ReactNode;
670
- /** Custom component to render the option */
671
729
  component?: ElementType;
672
- /** Custom props for the option component */
673
730
  componentProps?: Record<string, any>;
674
731
  }
675
732
  interface AppSelectInputProps extends Omit<SelectProps, "name" | "label" | "value" | "onChange" | "sx"> {
676
- /** Field name for formik */
677
733
  name: string;
678
- /** Label for the select */
679
734
  label?: string;
680
- /** Array of select options */
681
735
  options: AppSelectOptions[];
682
- /** Whether the field is required */
683
736
  required?: boolean;
684
- /** Whether the field is disabled */
685
737
  disabled?: boolean;
686
- /** Whether the field is read-only */
687
738
  readOnly?: boolean;
688
- /** Variant of the select input */
689
- variant?: 'outlined' | 'filled' | 'standard';
690
- /** Whether to show a 'None' option */
739
+ variant?: "outlined" | "filled" | "standard";
691
740
  showNoneOption?: boolean;
692
- /** Text to display for the 'None' option */
693
741
  noneOptionText?: string;
694
- /** Whether to show the helper text when no error */
695
742
  showHelperText?: boolean;
696
- /** Custom helper text to display */
697
743
  helperText?: string;
698
- /** Custom styles for the root container */
699
744
  sx?: SxProps<Theme>;
700
- /** Custom styles for the form control */
701
745
  formControlSx?: SxProps<Theme>;
702
- /** Custom styles for the select component */
703
746
  selectSx?: SxProps<Theme>;
704
- /** Custom styles for the input */
705
747
  inputSx?: SxProps<Theme>;
706
- /** Custom styles for the label */
707
748
  labelSx?: SxProps<Theme>;
708
- /** Custom styles for the menu paper */
709
749
  menuPaperSx?: SxProps<Theme>;
710
- /** Custom styles for all menu items */
711
750
  menuItemSx?: SxProps<Theme>;
712
- /** Custom styles for the selected menu item */
713
751
  selectedMenuItemSx?: SxProps<Theme>;
714
- /** Custom styles for the error message */
715
752
  errorSx?: SxProps<Theme>;
716
- /** Custom styles for the helper text */
717
753
  helperTextSx?: SxProps<Theme>;
718
- /** Custom styles for the select icon */
719
754
  iconSx?: SxProps<Theme>;
720
- /** Custom component for the label */
721
755
  labelComponent?: ElementType;
722
- /** Custom component for the error message */
723
756
  errorComponent?: ElementType;
724
- /** Custom component for the helper text */
725
757
  helperTextComponent?: ElementType;
726
- /** Callback when the value changes */
727
758
  onChange?: (event: SelectChangeEvent$1<unknown>, child: ReactNode) => void;
728
- /** Callback when the menu opens */
729
759
  onOpen?: (event: React.SyntheticEvent) => void;
730
- /** Callback when the menu closes */
731
760
  onClose?: (event: React.SyntheticEvent) => void;
732
- /** Callback when the field is blurred */
733
761
  onBlur?: (event: React.FocusEvent) => void;
734
- /** Custom render function for the selected value */
735
762
  renderValue?: (value: unknown) => ReactNode;
736
- /** Custom render function for menu items */
737
763
  renderMenuItem?: (option: AppSelectOptions, index: number) => ReactNode;
738
- /** Custom props for the MenuProps */
739
764
  MenuProps?: any;
740
- /** Custom props for the input component */
741
765
  inputProps?: any;
742
766
  }
743
767
  declare const AppSelectInput: React$1.ForwardRefExoticComponent<Omit<AppSelectInputProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -826,4 +850,4 @@ interface Props extends BoxProps {
826
850
  }
827
851
  declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
828
852
 
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 };
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 };