forked from layer5io/sistent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request layer5io#470 from sudhanshutech/add/refactor/comp
refactor: Add and Refactor theme components
- Loading branch information
Showing
8 changed files
with
170 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
import { Components, Theme } from '@mui/material'; | ||
import { CARIBBEAN_GREEN, KEPPEL, WHITE, buttonDisabled } from '../colors'; | ||
import { CARIBBEAN_GREEN, WHITE, buttonDisabled } from '../colors'; | ||
|
||
export const MuiButton: Components<Theme>['MuiButton'] = { | ||
styleOverrides: { | ||
root: { | ||
borderRadius: '3px', | ||
textTransform: 'none', | ||
'&.Mui-disabled': { | ||
backgroundColor: buttonDisabled.main, | ||
color: WHITE | ||
} | ||
}, | ||
contained: { | ||
backgroundColor: KEPPEL, | ||
'&:hover': { | ||
backgroundColor: CARIBBEAN_GREEN, | ||
color: WHITE | ||
} | ||
}, | ||
outlined: { | ||
'&:hover': { | ||
backgroundColor: CARIBBEAN_GREEN, | ||
color: WHITE | ||
} | ||
root: ({ theme }) => { | ||
const { | ||
palette: { | ||
secondary: { main } | ||
} | ||
} = theme; | ||
return { | ||
'&.MuiButton-contained': { | ||
color: WHITE, | ||
backgroundColor: main, | ||
'&:hover': { | ||
backgroundColor: CARIBBEAN_GREEN | ||
} | ||
}, | ||
'&.MuiButton-outlined': { | ||
border: `1px solid ${main}`, | ||
'&:hover': { | ||
backgroundColor: CARIBBEAN_GREEN, | ||
color: WHITE | ||
} | ||
}, | ||
'&.MuiButton-contained.Mui-disabled': { | ||
color: buttonDisabled.main, | ||
backgroundColor: buttonDisabled.main | ||
} | ||
}; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}` | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Components, ListItemProps, Theme } from '@mui/material'; | ||
import { DARK_SLATE_GRAY, PATTERNS_BLUE } from '../colors'; | ||
|
||
export const MuiListItem: Components<Theme>['MuiListItem'] = { | ||
variants: [ | ||
{ | ||
props: { variant: 'menu' } as ListItemProps, | ||
style: { | ||
textTransform: 'none', | ||
margin: '.5rem 0rem .5rem .5rem', | ||
padding: '0rem', | ||
color: DARK_SLATE_GRAY, | ||
fontSize: '.9rem', | ||
fill: DARK_SLATE_GRAY, | ||
'&.Mui-selected': { | ||
fontWeight: 'bold', | ||
color: DARK_SLATE_GRAY, | ||
fill: DARK_SLATE_GRAY, | ||
'&:hover': { | ||
color: DARK_SLATE_GRAY, | ||
'& svg': { | ||
fill: DARK_SLATE_GRAY | ||
} | ||
} | ||
}, | ||
'&:li:has(> .MuiMenuItem)': { | ||
backgroundColor: 'green' | ||
}, | ||
'& svg': { | ||
marginRight: '.75rem', | ||
paddingLeft: '0rem', | ||
marginLeft: '0rem' | ||
} | ||
} | ||
}, | ||
{ | ||
props: { variant: 'submenu' } as ListItemProps, | ||
style: { | ||
textTransform: 'none', | ||
margin: '.0rem 0rem 0rem .5rem', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
color: DARK_SLATE_GRAY, | ||
fontSize: '.9rem', | ||
fill: DARK_SLATE_GRAY, | ||
'&.Mui-selected': { | ||
fontWeight: 'bold', | ||
backgroundColor: PATTERNS_BLUE, | ||
color: DARK_SLATE_GRAY, | ||
fill: DARK_SLATE_GRAY, | ||
'&:hover': { | ||
color: DARK_SLATE_GRAY, | ||
'& svg': { | ||
fill: DARK_SLATE_GRAY | ||
} | ||
} | ||
}, | ||
'& svg': { | ||
marginRight: '.5rem' | ||
} | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Components, Theme } from '@mui/material'; | ||
import { CARIBBEAN_GREEN, CHARCOAL } from '../colors'; | ||
|
||
export const MuiSwitch: Components<Theme>['MuiSwitch'] = { | ||
styleOverrides: { | ||
root: { | ||
'& .MuiSwitch-switchBase': { | ||
color: CHARCOAL, | ||
'&:hover': { | ||
backgroundColor: 'rgba(60, 73, 79, 0.06)' | ||
} | ||
}, | ||
'& .MuiSwitch-switchBase.Mui-checked': { | ||
color: CARIBBEAN_GREEN, | ||
'&:hover': { | ||
backgroundColor: 'rgba(0, 211, 169, 0.06)' | ||
} | ||
}, | ||
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': { | ||
backgroundColor: CARIBBEAN_GREEN | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)' | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters