Skip to content

Commit 961082a

Browse files
authored
Merge pull request #464 from sudhanshutech/toggle/ui
Add Some theme components and add styles in existing ones
2 parents 63c9e69 + 0e164e2 commit 961082a

3 files changed

Lines changed: 49 additions & 2 deletions

File tree

packages/components/src/theme/components.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MuiOutlinedInput } from './components/outlinedinput.modifier';
1414
import { MuiPagination } from './components/pagination.modifier';
1515
import { MuiSvgIcon } from './components/svgicon.modifier';
1616
import { MuiTab } from './components/tab.modifier.ts';
17+
import { MuiToggleButton } from './components/toggle.modifier';
1718

1819
export const components: Components<Theme> = {
1920
MuiAppBar,
@@ -30,5 +31,6 @@ export const components: Components<Theme> = {
3031
MuiOutlinedInput,
3132
MuiPagination,
3233
MuiSvgIcon,
33-
MuiTab
34+
MuiTab,
35+
MuiToggleButton
3436
};
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
import { Components, Theme } from '@mui/material';
2+
import { CARIBBEAN_GREEN, KEPPEL, WHITE, buttonDisabled } from '../colors';
23

34
export const MuiButton: Components<Theme>['MuiButton'] = {
45
styleOverrides: {
5-
root: {}
6+
root: {
7+
borderRadius: '3px',
8+
textTransform: 'none',
9+
'&.Mui-disabled': {
10+
backgroundColor: buttonDisabled.main,
11+
color: WHITE
12+
}
13+
},
14+
contained: {
15+
backgroundColor: KEPPEL,
16+
'&:hover': {
17+
backgroundColor: CARIBBEAN_GREEN,
18+
color: WHITE
19+
}
20+
},
21+
outlined: {
22+
'&:hover': {
23+
backgroundColor: CARIBBEAN_GREEN,
24+
color: WHITE
25+
}
26+
}
627
}
728
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Components, Theme } from '@mui/material';
2+
import { CARIBBEAN_GREEN, CHARCOAL } from '../colors';
3+
4+
export const MuiToggleButton: Components<Theme>['MuiToggleButton'] = {
5+
styleOverrides: {
6+
root: {
7+
'& .MuiSwitch-switchBase': {
8+
color: CHARCOAL,
9+
'&:hover': {
10+
backgroundColor: 'rgba(60, 73, 79, 0.06)'
11+
}
12+
},
13+
'& .MuiSwitch-switchBase.Mui-checked': {
14+
color: CARIBBEAN_GREEN,
15+
'&:hover': {
16+
backgroundColor: 'rgba(0, 211, 169, 0.06)'
17+
}
18+
},
19+
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
20+
backgroundColor: CARIBBEAN_GREEN
21+
}
22+
}
23+
}
24+
};

0 commit comments

Comments
 (0)