All files / src/theme/v2/customStyles customBaseInputStyle.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    548x       2905x                                                                                    
import { getJsonValue } from "../utils";
 
export const getCustomBaseInputStyle = (
  mode: "light" | "dark",
  basePallete: any,
  palette: any,
) => ({
  styleOverrides: {
    root: {
      backgroundColor: getJsonValue(`tokens.${mode}.colour.surface.primary`),
      padding: "10px",
      borderRadius: "8px",
      border:
        "1px solid " + getJsonValue(`tokens.${mode}.primitive.neutral.20`),
      "&:before": {
        borderBottom: "none",
      },
      "&:after": {
        borderBottom: "none",
      },
      "&:hover:not(.Mui-disabled, .Mui-error, .Mui-focused)": {
        border:
          "1px solid " + getJsonValue(`tokens.${mode}.primitive.neutral.90`),
      },
      "&.Mui-focused:not(.Mui-disabled, .Mui-error)": {
        background: basePallete.gradient["ocean-blue"].border,
        border: "1.5px solid transparent",
      },
      "&:hover:not(.Mui-disabled, .Mui-error)&:before": {
        borderBottom: "none",
      },
      "&.Mui-disabled:before": {
        borderBottomStyle: "none",
      },
      "&.Mui-error": {
        border:
          "1px solid " +
          getJsonValue(`tokens.${mode}.primitive.citrus-peel.100`),
      },
      "&.Mui-focused": {
        border: "solid 1.5px transparent",
        backgroundImage: `linear-gradient(${palette.surface.primary}, ${palette.surface.primary}), ${basePallete.gradient["aqua-horizon"].border}`,
        backgroundOrigin: "border-box",
        backgroundClip: "padding-box, border-box",
      },
    },
  },
});