@react-solutions/inputs 0.3.0 → 1.0.1

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.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { SliderProps, FormControlProps, FormLabelProps, SwitchProps, FormControlLabelProps, RadioGroupProps, RadioProps, FormControl, CheckboxProps, Box, Stack, ButtonProps, TextFieldProps, AutocompleteProps, AutocompleteChangeReason, AutocompleteInputChangeReason, AutocompleteCloseReason, SelectProps, MenuItemProps, InputLabel, SelectChangeEvent, IconButtonProps, TextFieldPropsSizeOverrides, SxProps, Theme } from '@mui/material';
1
+ import { SliderProps, FormControlProps, FormLabelProps, SwitchProps, FormControlLabelProps, RadioGroupProps, RadioProps, SxProps, Theme, FormControl, CheckboxProps, Box, Stack, ButtonProps, TextFieldProps, AutocompleteProps, AutocompleteChangeReason, AutocompleteInputChangeReason, AutocompleteCloseReason, SelectProps, MenuItemProps, InputLabel, SelectChangeEvent, IconButtonProps, TextFieldPropsSizeOverrides } from '@mui/material';
2
2
  import * as React from 'react';
3
3
  import React__default, { SyntheticEvent, FocusEvent, ChangeEvent } from 'react';
4
4
  import { DateCalendarProps, TimeClockProps, TimeView, TimePickerProps, DatePickerProps } from '@mui/x-date-pickers';
@@ -223,6 +223,8 @@ interface IRadioButtonGroupFieldProps extends Omit<RadioGroupProps, "value" | "o
223
223
  formLabelProps?: Omit<FormLabelProps, "children">;
224
224
  /** FormControlLabel props */
225
225
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label" | "value">;
226
+ /** Custom styles for RadioGroup */
227
+ sxProps?: SxProps<Theme>;
226
228
  }
227
229
  declare const RadioButtonFieldGroup: React__default.ForwardRefExoticComponent<Omit<IRadioButtonGroupFieldProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
228
230
 
@@ -365,6 +367,8 @@ interface ICheckboxFieldGroupProps extends Omit<FormControlProps, "error" | "dis
365
367
  formLabelProps?: Omit<FormLabelProps, "children">;
366
368
  /** FormControlLabel props */
367
369
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label" | "value">;
370
+ /** xsProps */
371
+ sxProps?: SxProps<Theme>;
368
372
  }
369
373
  declare const CheckboxFieldGroup: React__default.ForwardRefExoticComponent<Omit<ICheckboxFieldGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
370
374
 
@@ -592,7 +596,7 @@ type FieldError$b = {
592
596
  * Extended Time Picker Field Props
593
597
  * Extends MUI TimePickerProps with custom form field props
594
598
  */
595
- interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChange' | 'defaultValue' | 'slots' | 'slotProps' | 'renderInput' | 'onViewChange'> {
599
+ interface ITimePickerFieldProps extends Omit<TimePickerProps, "value" | "onChange" | "defaultValue" | "slots" | "slotProps" | "renderInput" | "onViewChange"> {
596
600
  /** Field name for form identification */
597
601
  name?: string;
598
602
  /** Label text for the time picker */
@@ -618,13 +622,13 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
618
622
  /** Maximum selectable time */
619
623
  maxTime?: Date;
620
624
  /** Function to disable specific times */
621
- shouldDisableTime?: (time: Date, view: 'hours' | 'minutes' | 'seconds') => boolean;
625
+ shouldDisableTime?: (time: Date, view: "hours" | "minutes" | "seconds") => boolean;
622
626
  /** TextField size */
623
- size?: TextFieldProps['size'];
627
+ size?: TextFieldProps["size"];
624
628
  /** TextField variant */
625
- variant?: TextFieldProps['variant'];
629
+ variant?: TextFieldProps["variant"];
626
630
  /** TextField color */
627
- color?: TextFieldProps['color'];
631
+ color?: TextFieldProps["color"];
628
632
  /** Placeholder text */
629
633
  placeholder?: string;
630
634
  /** Whether the field is read-only */
@@ -638,23 +642,23 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
638
642
  /** Whether to use 12-hour format */
639
643
  ampm?: boolean;
640
644
  /** Available views (hours, minutes, seconds) */
641
- views?: ('hours' | 'minutes' | 'seconds')[];
645
+ views?: ("hours" | "minutes" | "seconds")[];
642
646
  /** Controlled view state */
643
- view?: 'hours' | 'minutes' | 'seconds';
647
+ view?: "hours" | "minutes" | "seconds";
644
648
  /** Default view */
645
- openTo?: 'hours' | 'minutes' | 'seconds';
649
+ openTo?: "hours" | "minutes" | "seconds";
646
650
  /** Format for displaying the time */
647
651
  format?: string;
648
652
  /** Custom styles for the TimePicker */
649
- pickerStyles?: TimePickerProps['sx'];
653
+ pickerStyles?: TimePickerProps["sx"];
650
654
  /** Custom styles for FormControl */
651
- formControlStyles?: React__default.ComponentProps<typeof FormControl>['sx'];
655
+ formControlStyles?: React__default.ComponentProps<typeof FormControl>["sx"];
652
656
  /** Custom styles for FormLabel */
653
- formLabelStyles?: FormLabelProps['sx'];
657
+ formLabelStyles?: FormLabelProps["sx"];
654
658
  /** Custom styles for the container Box */
655
- containerStyles?: React__default.ComponentProps<typeof Box>['sx'];
659
+ containerStyles?: React__default.ComponentProps<typeof Box>["sx"];
656
660
  /** Custom styles for the TextField */
657
- textFieldStyles?: TextFieldProps['sx'];
661
+ textFieldStyles?: TextFieldProps["sx"];
658
662
  /** Callback fired when the time changes */
659
663
  onChange?: (value: Date | null) => void;
660
664
  /** Callback fired when the field receives focus */
@@ -662,15 +666,15 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
662
666
  /** Callback fired when the field loses focus */
663
667
  onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
664
668
  /** Callback fired when a view change is requested */
665
- onViewChange?: (view: 'hours' | 'minutes' | 'seconds' | 'meridiem') => void;
669
+ onViewChange?: (view: "hours" | "minutes" | "seconds" | "meridiem") => void;
666
670
  /** Callback fired when the picker opens */
667
671
  onOpen?: () => void;
668
672
  /** Callback fired when the picker closes */
669
673
  onClose?: () => void;
670
674
  /** Custom slot props for MUI v7 */
671
- slotProps?: TimePickerProps['slotProps'];
675
+ slotProps?: TimePickerProps["slotProps"];
672
676
  /** Custom slots for MUI v7 */
673
- slots?: TimePickerProps['slots'];
677
+ slots?: TimePickerProps["slots"];
674
678
  /** Date adapter to use (defaults to AdapterDateFns) */
675
679
  dateAdapter?: typeof AdapterDateFns;
676
680
  /** Auto focus the input */
@@ -791,7 +795,7 @@ type FieldError$9 = {
791
795
  * Extended File Upload Field Props
792
796
  * Extends MUI TextFieldProps with custom file upload props
793
797
  */
794
- interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange' | 'name' | 'type' | 'error' | 'onDrop'> {
798
+ interface IFileUploadFieldProps extends Omit<TextFieldProps, "value" | "onChange" | "name" | "type" | "error" | "onDrop"> {
795
799
  /** Field name for form identification */
796
800
  name?: string;
797
801
  /** Label text for the file upload field */
@@ -823,11 +827,11 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
823
827
  /** Placeholder text */
824
828
  placeholder?: string;
825
829
  /** TextField variant */
826
- variant?: TextFieldProps['variant'];
830
+ variant?: TextFieldProps["variant"];
827
831
  /** TextField size */
828
- size?: TextFieldProps['size'];
832
+ size?: TextFieldProps["size"];
829
833
  /** TextField color */
830
- color?: TextFieldProps['color'];
834
+ color?: TextFieldProps["color"];
831
835
  /** Full width of the field */
832
836
  fullWidth?: boolean;
833
837
  /** Required field indicator */
@@ -835,11 +839,11 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
835
839
  /** Upload button text */
836
840
  buttonText?: string;
837
841
  /** Upload button variant */
838
- buttonVariant?: ButtonProps['variant'];
842
+ buttonVariant?: ButtonProps["variant"];
839
843
  /** Upload button color */
840
- buttonColor?: ButtonProps['color'];
844
+ buttonColor?: ButtonProps["color"];
841
845
  /** Upload button size */
842
- buttonSize?: ButtonProps['size'];
846
+ buttonSize?: ButtonProps["size"];
843
847
  /** Custom upload icon */
844
848
  uploadIcon?: React__default.ReactNode;
845
849
  /** Callback fired when file(s) change */
@@ -853,17 +857,17 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
853
857
  /** Callback fired when file is dropped (drag and drop) */
854
858
  onDrop?: (files: FileList) => void;
855
859
  /** Custom styles for the TextField */
856
- inputStyles?: TextFieldProps['sx'];
860
+ inputStyles?: TextFieldProps["sx"];
857
861
  /** Custom styles for the Button */
858
- buttonStyles?: ButtonProps['sx'];
862
+ buttonStyles?: ButtonProps["sx"];
859
863
  /** Custom styles for FormControl */
860
- formControlStyles?: React__default.ComponentProps<typeof FormControl>['sx'];
864
+ formControlStyles?: React__default.ComponentProps<typeof FormControl>["sx"];
861
865
  /** Custom styles for the container */
862
866
  containerStyles?: React__default.CSSProperties;
863
867
  /** Custom slot props for MUI v7 */
864
- slotProps?: TextFieldProps['slotProps'];
868
+ slotProps?: TextFieldProps["slotProps"];
865
869
  /** Custom slots for MUI v7 */
866
- slots?: TextFieldProps['slots'];
870
+ slots?: TextFieldProps["slots"];
867
871
  }
868
872
  declare const FileUploadField: React__default.ForwardRefExoticComponent<Omit<IFileUploadFieldProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
869
873
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SliderProps, FormControlProps, FormLabelProps, SwitchProps, FormControlLabelProps, RadioGroupProps, RadioProps, FormControl, CheckboxProps, Box, Stack, ButtonProps, TextFieldProps, AutocompleteProps, AutocompleteChangeReason, AutocompleteInputChangeReason, AutocompleteCloseReason, SelectProps, MenuItemProps, InputLabel, SelectChangeEvent, IconButtonProps, TextFieldPropsSizeOverrides, SxProps, Theme } from '@mui/material';
1
+ import { SliderProps, FormControlProps, FormLabelProps, SwitchProps, FormControlLabelProps, RadioGroupProps, RadioProps, SxProps, Theme, FormControl, CheckboxProps, Box, Stack, ButtonProps, TextFieldProps, AutocompleteProps, AutocompleteChangeReason, AutocompleteInputChangeReason, AutocompleteCloseReason, SelectProps, MenuItemProps, InputLabel, SelectChangeEvent, IconButtonProps, TextFieldPropsSizeOverrides } from '@mui/material';
2
2
  import * as React from 'react';
3
3
  import React__default, { SyntheticEvent, FocusEvent, ChangeEvent } from 'react';
4
4
  import { DateCalendarProps, TimeClockProps, TimeView, TimePickerProps, DatePickerProps } from '@mui/x-date-pickers';
@@ -223,6 +223,8 @@ interface IRadioButtonGroupFieldProps extends Omit<RadioGroupProps, "value" | "o
223
223
  formLabelProps?: Omit<FormLabelProps, "children">;
224
224
  /** FormControlLabel props */
225
225
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label" | "value">;
226
+ /** Custom styles for RadioGroup */
227
+ sxProps?: SxProps<Theme>;
226
228
  }
227
229
  declare const RadioButtonFieldGroup: React__default.ForwardRefExoticComponent<Omit<IRadioButtonGroupFieldProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
228
230
 
@@ -365,6 +367,8 @@ interface ICheckboxFieldGroupProps extends Omit<FormControlProps, "error" | "dis
365
367
  formLabelProps?: Omit<FormLabelProps, "children">;
366
368
  /** FormControlLabel props */
367
369
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label" | "value">;
370
+ /** xsProps */
371
+ sxProps?: SxProps<Theme>;
368
372
  }
369
373
  declare const CheckboxFieldGroup: React__default.ForwardRefExoticComponent<Omit<ICheckboxFieldGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
370
374
 
@@ -592,7 +596,7 @@ type FieldError$b = {
592
596
  * Extended Time Picker Field Props
593
597
  * Extends MUI TimePickerProps with custom form field props
594
598
  */
595
- interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChange' | 'defaultValue' | 'slots' | 'slotProps' | 'renderInput' | 'onViewChange'> {
599
+ interface ITimePickerFieldProps extends Omit<TimePickerProps, "value" | "onChange" | "defaultValue" | "slots" | "slotProps" | "renderInput" | "onViewChange"> {
596
600
  /** Field name for form identification */
597
601
  name?: string;
598
602
  /** Label text for the time picker */
@@ -618,13 +622,13 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
618
622
  /** Maximum selectable time */
619
623
  maxTime?: Date;
620
624
  /** Function to disable specific times */
621
- shouldDisableTime?: (time: Date, view: 'hours' | 'minutes' | 'seconds') => boolean;
625
+ shouldDisableTime?: (time: Date, view: "hours" | "minutes" | "seconds") => boolean;
622
626
  /** TextField size */
623
- size?: TextFieldProps['size'];
627
+ size?: TextFieldProps["size"];
624
628
  /** TextField variant */
625
- variant?: TextFieldProps['variant'];
629
+ variant?: TextFieldProps["variant"];
626
630
  /** TextField color */
627
- color?: TextFieldProps['color'];
631
+ color?: TextFieldProps["color"];
628
632
  /** Placeholder text */
629
633
  placeholder?: string;
630
634
  /** Whether the field is read-only */
@@ -638,23 +642,23 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
638
642
  /** Whether to use 12-hour format */
639
643
  ampm?: boolean;
640
644
  /** Available views (hours, minutes, seconds) */
641
- views?: ('hours' | 'minutes' | 'seconds')[];
645
+ views?: ("hours" | "minutes" | "seconds")[];
642
646
  /** Controlled view state */
643
- view?: 'hours' | 'minutes' | 'seconds';
647
+ view?: "hours" | "minutes" | "seconds";
644
648
  /** Default view */
645
- openTo?: 'hours' | 'minutes' | 'seconds';
649
+ openTo?: "hours" | "minutes" | "seconds";
646
650
  /** Format for displaying the time */
647
651
  format?: string;
648
652
  /** Custom styles for the TimePicker */
649
- pickerStyles?: TimePickerProps['sx'];
653
+ pickerStyles?: TimePickerProps["sx"];
650
654
  /** Custom styles for FormControl */
651
- formControlStyles?: React__default.ComponentProps<typeof FormControl>['sx'];
655
+ formControlStyles?: React__default.ComponentProps<typeof FormControl>["sx"];
652
656
  /** Custom styles for FormLabel */
653
- formLabelStyles?: FormLabelProps['sx'];
657
+ formLabelStyles?: FormLabelProps["sx"];
654
658
  /** Custom styles for the container Box */
655
- containerStyles?: React__default.ComponentProps<typeof Box>['sx'];
659
+ containerStyles?: React__default.ComponentProps<typeof Box>["sx"];
656
660
  /** Custom styles for the TextField */
657
- textFieldStyles?: TextFieldProps['sx'];
661
+ textFieldStyles?: TextFieldProps["sx"];
658
662
  /** Callback fired when the time changes */
659
663
  onChange?: (value: Date | null) => void;
660
664
  /** Callback fired when the field receives focus */
@@ -662,15 +666,15 @@ interface ITimePickerFieldProps extends Omit<TimePickerProps, 'value' | 'onChang
662
666
  /** Callback fired when the field loses focus */
663
667
  onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
664
668
  /** Callback fired when a view change is requested */
665
- onViewChange?: (view: 'hours' | 'minutes' | 'seconds' | 'meridiem') => void;
669
+ onViewChange?: (view: "hours" | "minutes" | "seconds" | "meridiem") => void;
666
670
  /** Callback fired when the picker opens */
667
671
  onOpen?: () => void;
668
672
  /** Callback fired when the picker closes */
669
673
  onClose?: () => void;
670
674
  /** Custom slot props for MUI v7 */
671
- slotProps?: TimePickerProps['slotProps'];
675
+ slotProps?: TimePickerProps["slotProps"];
672
676
  /** Custom slots for MUI v7 */
673
- slots?: TimePickerProps['slots'];
677
+ slots?: TimePickerProps["slots"];
674
678
  /** Date adapter to use (defaults to AdapterDateFns) */
675
679
  dateAdapter?: typeof AdapterDateFns;
676
680
  /** Auto focus the input */
@@ -791,7 +795,7 @@ type FieldError$9 = {
791
795
  * Extended File Upload Field Props
792
796
  * Extends MUI TextFieldProps with custom file upload props
793
797
  */
794
- interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange' | 'name' | 'type' | 'error' | 'onDrop'> {
798
+ interface IFileUploadFieldProps extends Omit<TextFieldProps, "value" | "onChange" | "name" | "type" | "error" | "onDrop"> {
795
799
  /** Field name for form identification */
796
800
  name?: string;
797
801
  /** Label text for the file upload field */
@@ -823,11 +827,11 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
823
827
  /** Placeholder text */
824
828
  placeholder?: string;
825
829
  /** TextField variant */
826
- variant?: TextFieldProps['variant'];
830
+ variant?: TextFieldProps["variant"];
827
831
  /** TextField size */
828
- size?: TextFieldProps['size'];
832
+ size?: TextFieldProps["size"];
829
833
  /** TextField color */
830
- color?: TextFieldProps['color'];
834
+ color?: TextFieldProps["color"];
831
835
  /** Full width of the field */
832
836
  fullWidth?: boolean;
833
837
  /** Required field indicator */
@@ -835,11 +839,11 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
835
839
  /** Upload button text */
836
840
  buttonText?: string;
837
841
  /** Upload button variant */
838
- buttonVariant?: ButtonProps['variant'];
842
+ buttonVariant?: ButtonProps["variant"];
839
843
  /** Upload button color */
840
- buttonColor?: ButtonProps['color'];
844
+ buttonColor?: ButtonProps["color"];
841
845
  /** Upload button size */
842
- buttonSize?: ButtonProps['size'];
846
+ buttonSize?: ButtonProps["size"];
843
847
  /** Custom upload icon */
844
848
  uploadIcon?: React__default.ReactNode;
845
849
  /** Callback fired when file(s) change */
@@ -853,17 +857,17 @@ interface IFileUploadFieldProps extends Omit<TextFieldProps, 'value' | 'onChange
853
857
  /** Callback fired when file is dropped (drag and drop) */
854
858
  onDrop?: (files: FileList) => void;
855
859
  /** Custom styles for the TextField */
856
- inputStyles?: TextFieldProps['sx'];
860
+ inputStyles?: TextFieldProps["sx"];
857
861
  /** Custom styles for the Button */
858
- buttonStyles?: ButtonProps['sx'];
862
+ buttonStyles?: ButtonProps["sx"];
859
863
  /** Custom styles for FormControl */
860
- formControlStyles?: React__default.ComponentProps<typeof FormControl>['sx'];
864
+ formControlStyles?: React__default.ComponentProps<typeof FormControl>["sx"];
861
865
  /** Custom styles for the container */
862
866
  containerStyles?: React__default.CSSProperties;
863
867
  /** Custom slot props for MUI v7 */
864
- slotProps?: TextFieldProps['slotProps'];
868
+ slotProps?: TextFieldProps["slotProps"];
865
869
  /** Custom slots for MUI v7 */
866
- slots?: TextFieldProps['slots'];
870
+ slots?: TextFieldProps["slots"];
867
871
  }
868
872
  declare const FileUploadField: React__default.ForwardRefExoticComponent<Omit<IFileUploadFieldProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
869
873