Skip to content

Commit

Permalink
feat(components): added
Browse files Browse the repository at this point in the history
Signed-off-by: sudhanshu dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Feb 1, 2024
1 parent 15acdae commit aa7613d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
18 changes: 18 additions & 0 deletions src/theme/components/input.modifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Components, Theme } from '@mui/material/styles';
import { CARIBBEAN_GREEN } from '../colors';

export const MuiInput: Components<Theme>['MuiInput'] = {
styleOverrides: {
root: {
'&:before': {
borderBottom: '2px solid rgba(0, 0, 0, 0.5)'
},
'&.Mui-focused:after': {
borderBottom: ` 2px solid ${CARIBBEAN_GREEN}`
},
'&:hover:not(.Mui-disabled):before': {
borderBottom: `2px solid ${CARIBBEAN_GREEN}`
}
}
}
};
20 changes: 15 additions & 5 deletions src/theme/components/outlinedinput.modifier.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import { Components, Theme } from '@mui/material';
import { defaultPalette } from '../colors';
import { outlinedInputClasses } from '@mui/material/OutlinedInput';
import { CARIBBEAN_GREEN, KEPPEL } from '../colors';

export const MuiOutlinedInput: Components<Theme>['MuiOutlinedInput'] = {
styleOverrides: {
notchedOutline: {
borderColor: 'rgba(0, 0, 0, 0.5)'
},
root: {
'&:hover $notchedOutline': {
borderColor: defaultPalette.keppel[3]
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
borderColor: CARIBBEAN_GREEN
},
'&$focused $notchedOutline': {
borderColor: defaultPalette.keppel[3]
[`&.Mui-focused .${outlinedInputClasses.notchedOutline}`]: {
borderColor: CARIBBEAN_GREEN
},
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
borderColor: KEPPEL
},
'&:hover .MuiOutlinedInput-notchedOutline': {
borderColor: KEPPEL
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/theme/components/textfield.modifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Components, Theme } from '@mui/material';
import { CARIBBEAN_GREEN } from '../colors';

export const MuiTextField: Components<Theme>['MuiTextField'] = {
styleOverrides: {
root: {
'--TextField-brandBorderColor': 'rgba(0, 0, 0, 0.5)',
'--TextField-brandBorderHoverColor': CARIBBEAN_GREEN,
'--TextField-brandBorderFocusedColor': CARIBBEAN_GREEN,
'& label.Mui-focused': {
color: 'var(--TextField-brandBorderFocusedColor)'
}
}
}
};

0 comments on commit aa7613d

Please sign in to comment.