All files / src/theme/components textField.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159        484x                     23970x                                                                                                                                                                                                                                                                                              
import { Components } from "@mui/material";
import { palette } from "@palette";
import { isSecondVersion } from "@theme/v2/utils";
 
export const textField: Components["MuiTextField"] = {
  defaultProps: {
    InputLabelProps: {
      variant: "filled",
    },
    version: "one",
  },
  styleOverrides: {
    root: {
      variants: [
        {
          props: (props: any) => !isSecondVersion(props.version),
          style: {
            "& .MuiInputBase-root": {
              borderRadius: "8px",
              padding: "7.5px 12px",
              fontSize: "14px",
              boxShadow: "none",
              backgroundColor: palette.neutral.white,
              border: `2px solid ${palette.liftedWhite[200]}`,
 
              "& .MuiInputAdornment-root.MuiInputAdornment-positionStart": {
                marginRight: "4px",
              },
 
              "& .MuiInputAdornment-root.MuiInputAdornment-positionEnd": {
                display: "flex",
                gap: "4px",
                flexDirection: "row",
                alignItems: "center",
              },
 
              "& fieldset": {
                border: "none",
                borderRadius: 0,
              },
 
              "& input": {
                padding: 0,
                fontFamily: "Give Whyte",
                fontStyle: "normal",
                fontWeight: 400,
                fontSize: "14px",
                lineHeight: "17px",
                color: palette.black[100],
                marginTop: "15px",
 
                "&::-ms-reveal": {
                  display: "none",
                },
                "&::-ms-clear": {
                  display: "none",
                },
 
                "&::placeholder": {
                  fontFamily: "Give Whyte",
                  fontStyle: "normal",
                  fontWeight: 400,
                  fontSize: "14px",
                  lineHeight: "17px",
                  color: palette.gray[300],
                },
 
                ":-webkit-autofill, :-webkit-autofill:focus": {
                  transition: "background-color 600000s 0s",
                  backgroundColor: palette.neutral.white,
                  animationName: "onAutoFillStart",
                },
                ":not(:-webkit-autofill)": {
                  animationName: "onAutoFillCancel",
                },
                "@keyframes onAutoFillStart": {},
                "@keyframes onAutoFillCancel": {},
              },
 
              "& textarea": {
                borderRadius: 0,
                fontFamily: "Give Whyte",
                fontStyle: "normal",
                fontWeight: 400,
                fontSize: "14px",
                lineHeight: "17px",
                color: palette.black[100],
                marginTop: "18px",
              },
 
              "&:hover": {
                borderColor: palette.gray.main,
              },
            },
 
            "& .MuiInputBase-root.Mui-focused": {
              backgroundColor: palette.neutral.white,
              borderColor: palette.gray[300],
 
              "& .MuiInputBase-currencyIcon": {
                color: palette.black[200],
              },
            },
            "& .MuiInputBase-root.Mui-error": {
              backgroundColor: palette.neutral.white,
              borderColor: "#D80D0D",
            },
            "& .MuiInputBase-root.Mui-disabled": {
              backgroundColor: palette.liftedWhite[200],
              boxShadow: "none",
              border: "none",
 
              "& input": {
                marginTop: "18px",
              },
            },
 
            "& .MuiInputLabel-root": {
              color: palette.gray.main,
              fontSize: "18px",
              letterSpacing: "-0.01em",
              lineHeight: "22px",
              left: "1px",
            },
            "& .MuiInputLabel-root.Mui-error": {
              color: palette.gray.main,
            },
            "& .MuiInputLabel-root.MuiInputLabel-shrink": {
              color: palette.gray[300],
              letterSpacing: "0px",
              scale: 0.78,
            },
            "& .MuiInputLabel-root.Mui-focused, .MuiInputLabel-root.Mui-disabled":
              {
                color: palette.gray[300],
              },
 
            "& .MuiFormHelperText-root": {
              margin: 0,
              textTransform: "none",
              paddingInline: "12px",
              fontSize: "12px",
              marginTop: "4px",
              color: palette.gray[300],
              lineHeight: "14px",
              fontFamily: "Give Whyte",
              fontWeight: 400,
              fontStyle: "normal",
            },
            "& .MuiFormHelperText-root.Mui-error": {
              color: palette.gray[300],
            },
          },
        },
      ],
    },
  },
};