aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/BugTitleForm/BugTitleInput.tsx
blob: 11cbbdb61b50041d25d183d5ea8336e7ba5c9fae (plain) (blame)
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
import { alpha, TextField } from '@mui/material';
import { Theme } from '@mui/material/styles';
import createStyles from '@mui/styles/createStyles';
import withStyles from '@mui/styles/withStyles';

const BugTitleInput = withStyles((theme: Theme) =>
  createStyles({
    root: {
      '& .MuiInputLabel-outlined': {
        color: theme.palette.text.primary,
      },
      '& input:valid + fieldset': {
        color: theme.palette.text.primary,
        borderColor: theme.palette.divider,
        borderWidth: 2,
      },
      '& input:valid:hover + fieldset': {
        color: theme.palette.text.primary,
        borderColor: alpha(theme.palette.divider, 0.3),
        borderWidth: 2,
      },
      '& input:valid:focus + fieldset': {
        color: theme.palette.text.primary,
        borderColor: theme.palette.divider,
      },
      '& input:invalid + fieldset': {
        borderColor: theme.palette.error.main,
        borderWidth: 2,
      },
      '& input:invalid:hover + fieldset': {
        borderColor: theme.palette.error.main,
        borderWidth: 2,
      },
      '& input:invalid:focus + fieldset': {
        borderColor: theme.palette.error.main,
        borderWidth: 2,
      },
    },
  })
)(TextField);

export default BugTitleInput;