formik-form-components 0.2.24 → 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 */
@@ -323,7 +323,7 @@ declare const AppMultiSelector: React$1.ForwardRefExoticComponent<Omit<AppMultiS
323
323
 
324
324
  interface AppPhoneNoInputProps {
325
325
  name: string;
326
- label?: string;
326
+ label: string;
327
327
  required?: boolean;
328
328
  defaultCountry?: string;
329
329
  placeholder?: string;
@@ -332,6 +332,8 @@ interface AppPhoneNoInputProps {
332
332
  labelSx?: SxProps<Theme>;
333
333
  inputSx?: React__default.CSSProperties;
334
334
  errorSx?: SxProps<Theme>;
335
+ international?: boolean;
336
+ withCountryCallingCode?: boolean;
335
337
  }
336
338
  declare const AppPhoneNoInput: React__default.FC<AppPhoneNoInputProps>;
337
339
 
@@ -457,7 +459,7 @@ interface AppRatingProps {
457
459
  }
458
460
  declare const AppRating: React$1.ForwardRefExoticComponent<AppRatingProps & React$1.RefAttributes<HTMLDivElement>>;
459
461
 
460
- interface Props$2 {
462
+ interface Props$1 {
461
463
  name: string;
462
464
  label?: string;
463
465
  placeholder?: string;
@@ -474,7 +476,7 @@ interface Props$2 {
474
476
  activeButtonSx?: SxProps<Theme>;
475
477
  dialogSx?: SxProps<Theme>;
476
478
  }
477
- 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;
478
480
 
479
481
  interface AppSelectOptions$2 {
480
482
  /** Display text for the option */
@@ -500,8 +502,8 @@ interface AppSelectOptions$2 {
500
502
  /** Custom props for the option component */
501
503
  componentProps?: Record<string, any>;
502
504
  }
503
- type CustomAutocompleteProps = Omit<AutocompleteProps<AppSelectOptions$2, boolean, boolean, boolean>, "renderInput" | "options" | "renderTags" | "onChange" | "value" | "multiple">;
504
- 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 {
505
507
  /** Field name for formik */
506
508
  name: string;
507
509
  /** Label for the input */
@@ -510,8 +512,8 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
510
512
  multiple?: boolean;
511
513
  /** Available options */
512
514
  options: AppSelectOptions$2[];
513
- /** Callback when search query changes */
514
- setSearchQuery: React__default.Dispatch<SetStateAction<string>>;
515
+ /** Callback when search query changes - useful for remote searching */
516
+ setSearchQuery?: React__default.Dispatch<SetStateAction<string>>;
515
517
  /** Whether the field is required */
516
518
  required?: boolean;
517
519
  /** Whether the field is disabled */
@@ -527,7 +529,7 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
527
529
  /** Whether to show the selected count */
528
530
  showSelectedCount?: boolean;
529
531
  /** Variant of the input field */
530
- variant?: 'outlined' | 'filled' | 'standard';
532
+ variant?: "outlined" | "filled" | "standard";
531
533
  /** Custom styles for the root container */
532
534
  sx?: SxProps<Theme>;
533
535
  /** Custom styles for the form control */
@@ -631,111 +633,135 @@ interface AppSearchableMultiSelectorProps extends CustomAutocompleteProps {
631
633
  /** Callback when a selection is added */
632
634
  onAdd?: (value: AppSelectOptions$2) => void;
633
635
  }
634
- 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>>;
635
637
 
636
638
  interface AppSelectOptions$1 {
637
639
  label: string;
638
- value: string | number;
640
+ value: number | string;
639
641
  searchAbleValue1?: string;
640
642
  searchAbleValue2?: string;
641
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>;
642
650
  }
643
- 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 {
644
653
  name: string;
645
- label: string;
654
+ label?: string;
655
+ multiple?: boolean;
646
656
  options: AppSelectOptions$1[];
647
- setSearchQuery?: React__default.Dispatch<SetStateAction<string>> | undefined;
657
+ setSearchQuery?: React__default.Dispatch<SetStateAction<string>>;
648
658
  required?: boolean;
649
- placeholder?: string;
650
- isResetRequired?: boolean;
651
- 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;
652
719
  }
653
- 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>>;
654
721
 
655
722
  interface AppSelectOptions {
656
- /** The label to display for this option */
657
723
  label: string;
658
- /** The value to be used when this option is selected */
659
724
  value: string | number;
660
- /** Whether this option is disabled */
661
725
  disabled?: boolean;
662
- /** Custom styles for this specific menu item */
663
726
  sx?: SxProps<Theme>;
664
- /** Custom styles for this specific menu item text */
665
727
  textSx?: SxProps<Theme>;
666
- /** Custom icon for the option */
667
728
  icon?: ReactNode;
668
- /** Custom component to render the option */
669
729
  component?: ElementType;
670
- /** Custom props for the option component */
671
730
  componentProps?: Record<string, any>;
672
731
  }
673
732
  interface AppSelectInputProps extends Omit<SelectProps, "name" | "label" | "value" | "onChange" | "sx"> {
674
- /** Field name for formik */
675
733
  name: string;
676
- /** Label for the select */
677
734
  label?: string;
678
- /** Array of select options */
679
735
  options: AppSelectOptions[];
680
- /** Whether the field is required */
681
736
  required?: boolean;
682
- /** Whether the field is disabled */
683
737
  disabled?: boolean;
684
- /** Whether the field is read-only */
685
738
  readOnly?: boolean;
686
- /** Variant of the select input */
687
- variant?: 'outlined' | 'filled' | 'standard';
688
- /** Whether to show a 'None' option */
739
+ variant?: "outlined" | "filled" | "standard";
689
740
  showNoneOption?: boolean;
690
- /** Text to display for the 'None' option */
691
741
  noneOptionText?: string;
692
- /** Whether to show the helper text when no error */
693
742
  showHelperText?: boolean;
694
- /** Custom helper text to display */
695
743
  helperText?: string;
696
- /** Custom styles for the root container */
697
744
  sx?: SxProps<Theme>;
698
- /** Custom styles for the form control */
699
745
  formControlSx?: SxProps<Theme>;
700
- /** Custom styles for the select component */
701
746
  selectSx?: SxProps<Theme>;
702
- /** Custom styles for the input */
703
747
  inputSx?: SxProps<Theme>;
704
- /** Custom styles for the label */
705
748
  labelSx?: SxProps<Theme>;
706
- /** Custom styles for the menu paper */
707
749
  menuPaperSx?: SxProps<Theme>;
708
- /** Custom styles for all menu items */
709
750
  menuItemSx?: SxProps<Theme>;
710
- /** Custom styles for the selected menu item */
711
751
  selectedMenuItemSx?: SxProps<Theme>;
712
- /** Custom styles for the error message */
713
752
  errorSx?: SxProps<Theme>;
714
- /** Custom styles for the helper text */
715
753
  helperTextSx?: SxProps<Theme>;
716
- /** Custom styles for the select icon */
717
754
  iconSx?: SxProps<Theme>;
718
- /** Custom component for the label */
719
755
  labelComponent?: ElementType;
720
- /** Custom component for the error message */
721
756
  errorComponent?: ElementType;
722
- /** Custom component for the helper text */
723
757
  helperTextComponent?: ElementType;
724
- /** Callback when the value changes */
725
758
  onChange?: (event: SelectChangeEvent$1<unknown>, child: ReactNode) => void;
726
- /** Callback when the menu opens */
727
759
  onOpen?: (event: React.SyntheticEvent) => void;
728
- /** Callback when the menu closes */
729
760
  onClose?: (event: React.SyntheticEvent) => void;
730
- /** Callback when the field is blurred */
731
761
  onBlur?: (event: React.FocusEvent) => void;
732
- /** Custom render function for the selected value */
733
762
  renderValue?: (value: unknown) => ReactNode;
734
- /** Custom render function for menu items */
735
763
  renderMenuItem?: (option: AppSelectOptions, index: number) => ReactNode;
736
- /** Custom props for the MenuProps */
737
764
  MenuProps?: any;
738
- /** Custom props for the input component */
739
765
  inputProps?: any;
740
766
  }
741
767
  declare const AppSelectInput: React$1.ForwardRefExoticComponent<Omit<AppSelectInputProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -824,4 +850,4 @@ interface Props extends BoxProps {
824
850
  }
825
851
  declare const Iconify: React$1.ForwardRefExoticComponent<Omit<Props, "ref"> & React$1.RefAttributes<SVGElement>>;
826
852
 
827
- 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 };