formik-form-components 0.2.25 → 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.mjs CHANGED
@@ -64,14 +64,16 @@ var AppDatePicker = forwardRef(
64
64
  onChange: handleChange,
65
65
  format,
66
66
  disabled,
67
+ slots: {
68
+ openPickerIcon: CalendarMonthIcon
69
+ },
67
70
  slotProps: {
68
71
  textField: {
69
72
  variant: "outlined",
70
73
  fullWidth: true,
71
74
  error: isTouched && Boolean(fieldError),
72
75
  helperText: isTouched && fieldError ? fieldError : void 0,
73
- sx: textFieldSx,
74
- openPickerIcon: CalendarMonthIcon
76
+ sx: textFieldSx
75
77
  }
76
78
  },
77
79
  ...otherProps
@@ -649,25 +651,30 @@ function AppSwitchInput({
649
651
  Box,
650
652
  {
651
653
  className,
652
- sx: [{
653
- display: "flex",
654
- flexDirection: labelPlacement === "start" || labelPlacement === "end" ? "row" : "column",
655
- alignItems: labelPlacement === "start" || labelPlacement === "end" ? "center" : "flex-start",
656
- justifyContent: labelPlacement === "start" || labelPlacement === "end" ? "space-between" : "center",
657
- gap: 1,
658
- my: 1,
659
- ...containerSx
660
- }, sx],
654
+ sx: [
655
+ {
656
+ display: "flex",
657
+ flexDirection: labelPlacement === "start" || labelPlacement === "end" ? "row" : "column",
658
+ alignItems: labelPlacement === "start" || labelPlacement === "end" ? "center" : "flex-start",
659
+ justifyContent: labelPlacement === "start" || labelPlacement === "end" ? "space-between" : "center",
660
+ gap: 1,
661
+ my: 1,
662
+ ...containerSx
663
+ },
664
+ sx
665
+ ],
661
666
  children: [
662
667
  label && /* @__PURE__ */ jsx(
663
668
  Typography,
664
669
  {
665
670
  variant: "body2",
666
- sx: [{
667
- color: "text.primary",
668
- order: labelPlacement === "start" ? 0 : 1,
669
- ...labelSx
670
- }],
671
+ sx: [
672
+ {
673
+ color: "text.primary",
674
+ order: labelPlacement === "start" ? 0 : 1,
675
+ ...labelSx
676
+ }
677
+ ],
671
678
  children: label
672
679
  }
673
680
  ),
@@ -680,25 +687,27 @@ function AppSwitchInput({
680
687
  onChange: () => {
681
688
  setFieldValue(name, !values[name], true);
682
689
  },
683
- sx: [{
684
- "& .MuiSwitch-switchBase": {
685
- color: "text.secondary",
686
- "&.Mui-checked": {
687
- color: "primary.main",
688
- "& + .MuiSwitch-track": {
689
- backgroundColor: "primary.main",
690
- opacity: 0.5
690
+ sx: [
691
+ {
692
+ "& .MuiSwitch-switchBase": {
693
+ color: "text.secondary",
694
+ "&.Mui-checked": {
695
+ color: "primary.main",
696
+ "& + .MuiSwitch-track": {
697
+ backgroundColor: "primary.main",
698
+ opacity: 0.5
699
+ }
700
+ },
701
+ "&.Mui-disabled": {
702
+ color: "action.disabled",
703
+ "& + .MuiSwitch-track": {
704
+ backgroundColor: "action.disabledBackground"
705
+ }
691
706
  }
692
707
  },
693
- "&.Mui-disabled": {
694
- color: "action.disabled",
695
- "& + .MuiSwitch-track": {
696
- backgroundColor: "action.disabledBackground"
697
- }
698
- }
699
- },
700
- ...switchSx
701
- }],
708
+ ...switchSx
709
+ }
710
+ ],
702
711
  ...otherProps
703
712
  }
704
713
  ),
@@ -706,12 +715,14 @@ function AppSwitchInput({
706
715
  Typography,
707
716
  {
708
717
  variant: "caption",
709
- sx: [{
710
- color: "error.main",
711
- display: "block",
712
- mt: 0.5,
713
- ...errorSx
714
- }],
718
+ sx: [
719
+ {
720
+ color: "error.main",
721
+ display: "block",
722
+ mt: 0.5,
723
+ ...errorSx
724
+ }
725
+ ],
715
726
  gutterBottom: true,
716
727
  children: fieldError
717
728
  }
@@ -743,21 +754,26 @@ function AppSwitch({
743
754
  alignItems: labelPlacement === "start" || labelPlacement === "end" ? "center" : "flex-start",
744
755
  justifyContent: labelPlacement === "start" || labelPlacement === "end" ? "space-between" : "center",
745
756
  spacing: 1,
746
- sx: [{
747
- width: "100%",
748
- ...labelPlacement === "top" || labelPlacement === "bottom" ? { alignItems: "flex-start" } : {},
749
- ...containerSx
750
- }, sx],
757
+ sx: [
758
+ {
759
+ width: "100%",
760
+ ...labelPlacement === "top" || labelPlacement === "bottom" ? { alignItems: "flex-start" } : {},
761
+ ...containerSx
762
+ },
763
+ sx
764
+ ],
751
765
  children: [
752
766
  /* @__PURE__ */ jsx(
753
767
  Typography,
754
768
  {
755
769
  variant: "body2",
756
- sx: [{
757
- color: "text.primary",
758
- order: labelPlacement === "start" ? 0 : 1,
759
- ...labelSx
760
- }],
770
+ sx: [
771
+ {
772
+ color: "text.primary",
773
+ order: labelPlacement === "start" ? 0 : 1,
774
+ ...labelSx
775
+ }
776
+ ],
761
777
  children: label
762
778
  }
763
779
  ),
@@ -769,25 +785,27 @@ function AppSwitch({
769
785
  onChange: () => {
770
786
  setFieldValue(name, !fieldValue, true);
771
787
  },
772
- sx: [{
773
- "& .MuiSwitch-switchBase": {
774
- color: "text.secondary",
775
- "&.Mui-checked": {
776
- color: "primary.main",
777
- "& + .MuiSwitch-track": {
778
- backgroundColor: "primary.main",
779
- opacity: 0.5
788
+ sx: [
789
+ {
790
+ "& .MuiSwitch-switchBase": {
791
+ color: "text.secondary",
792
+ "&.Mui-checked": {
793
+ color: "primary.main",
794
+ "& + .MuiSwitch-track": {
795
+ backgroundColor: "primary.main",
796
+ opacity: 0.5
797
+ }
798
+ },
799
+ "&.Mui-disabled": {
800
+ color: "action.disabled",
801
+ "& + .MuiSwitch-track": {
802
+ backgroundColor: "action.disabledBackground"
803
+ }
780
804
  }
781
805
  },
782
- "&.Mui-disabled": {
783
- color: "action.disabled",
784
- "& + .MuiSwitch-track": {
785
- backgroundColor: "action.disabledBackground"
786
- }
787
- }
788
- },
789
- ...switchSx
790
- }],
806
+ ...switchSx
807
+ }
808
+ ],
791
809
  ...otherProps
792
810
  }
793
811
  ),
@@ -795,12 +813,14 @@ function AppSwitch({
795
813
  Typography,
796
814
  {
797
815
  variant: "caption",
798
- sx: [{
799
- color: "error.main",
800
- display: "block",
801
- mt: 0.5,
802
- ...errorSx
803
- }],
816
+ sx: [
817
+ {
818
+ color: "error.main",
819
+ display: "block",
820
+ mt: 0.5,
821
+ ...errorSx
822
+ }
823
+ ],
804
824
  gutterBottom: true,
805
825
  children: fieldError
806
826
  }