2024-11-12 19:10:48 -05:00
|
|
|
import { typographyLevels } from "./constants";
|
2024-11-08 18:36:43 -05:00
|
|
|
|
|
|
|
|
const fontFamilyPrimary = '"Inter" , sans-serif';
|
|
|
|
|
// const fontFamilySecondary = '"Avenir", sans-serif';
|
|
|
|
|
|
2024-11-12 17:24:21 -05:00
|
|
|
/* TODO take the color out from here */
|
2024-11-09 08:01:14 -05:00
|
|
|
const shadow =
|
|
|
|
|
"0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)";
|
|
|
|
|
|
2024-11-12 19:10:48 -05:00
|
|
|
const baseTheme = (palette) => ({
|
2024-11-08 18:36:43 -05:00
|
|
|
typography: {
|
|
|
|
|
fontFamily: fontFamilyPrimary,
|
2024-11-09 08:01:14 -05:00
|
|
|
fontSize: 14,
|
2024-11-08 18:36:43 -05:00
|
|
|
h1: {
|
|
|
|
|
fontSize: typographyLevels.xl,
|
2024-11-12 19:10:48 -05:00
|
|
|
color: palette.text.primary,
|
2024-11-08 18:36:43 -05:00
|
|
|
fontWeight: 500,
|
|
|
|
|
},
|
|
|
|
|
h2: {
|
|
|
|
|
fontSize: typographyLevels.l,
|
2024-11-12 19:10:48 -05:00
|
|
|
color: palette.text.secondary,
|
2024-11-08 18:36:43 -05:00
|
|
|
fontWeight: 400,
|
|
|
|
|
},
|
|
|
|
|
body1: {
|
|
|
|
|
fontSize: typographyLevels.m,
|
2024-11-12 19:10:48 -05:00
|
|
|
color: palette.text.tertiary,
|
2024-11-08 18:36:43 -05:00
|
|
|
fontWeight: 400,
|
|
|
|
|
},
|
|
|
|
|
body2: {
|
|
|
|
|
fontSize: typographyLevels.s,
|
2024-11-12 19:10:48 -05:00
|
|
|
color: palette.text.tertiary,
|
2024-11-08 18:36:43 -05:00
|
|
|
fontWeight: 400,
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-09 08:01:14 -05:00
|
|
|
/* TODO take chart from here, it should live inside of the gauge, and get info from the theme */
|
|
|
|
|
chart: {
|
|
|
|
|
header: {
|
|
|
|
|
fontWeight: 400,
|
2024-11-12 19:10:48 -05:00
|
|
|
fill: palette.text.tertiary,
|
2024-11-09 08:01:14 -05:00
|
|
|
fontSize: typographyLevels.m,
|
|
|
|
|
},
|
|
|
|
|
subheader: {
|
|
|
|
|
fontWeight: 400,
|
2024-11-12 19:10:48 -05:00
|
|
|
fill: palette.text.tertiary,
|
2024-11-09 08:01:14 -05:00
|
|
|
fontSize: typographyLevels.xs,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
spacing: 2,
|
2024-11-12 19:10:48 -05:00
|
|
|
/* TODO All these should live inside of a component*/
|
2024-11-09 08:01:14 -05:00
|
|
|
components: {
|
|
|
|
|
MuiButton: {
|
|
|
|
|
defaultProps: {
|
|
|
|
|
disableRipple: true,
|
|
|
|
|
},
|
|
|
|
|
styleOverrides: {
|
|
|
|
|
root: ({ theme }) => ({
|
|
|
|
|
variants: [
|
|
|
|
|
{
|
|
|
|
|
props: (props) => props.variant === "group",
|
|
|
|
|
style: {
|
|
|
|
|
color: theme.palette.secondary.contrastText,
|
|
|
|
|
backgroundColor: theme.palette.background.main,
|
|
|
|
|
border: 1,
|
|
|
|
|
borderStyle: "solid",
|
|
|
|
|
borderColor: theme.palette.border.light,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
props: (props) => props.variant === "group" && props.filled === "true",
|
|
|
|
|
style: {
|
|
|
|
|
backgroundColor: theme.palette.secondary.main,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
props: (props) =>
|
|
|
|
|
props.variant === "contained" && props.color === "secondary",
|
|
|
|
|
style: {
|
|
|
|
|
border: 1,
|
|
|
|
|
borderStyle: "solid",
|
|
|
|
|
borderColor: theme.palette.border.light,
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-12 19:10:48 -05:00
|
|
|
{
|
|
|
|
|
props: (props) => props.variant === "contained" && props.disabled,
|
|
|
|
|
style: {
|
|
|
|
|
backgroundColor: `${theme.palette.secondary.main} !important`,
|
|
|
|
|
color: `${theme.palette.secondary.contrastText} !important`,
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-09 08:01:14 -05:00
|
|
|
],
|
|
|
|
|
fontWeight: 400,
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
boxShadow: "none",
|
|
|
|
|
textTransform: "none",
|
|
|
|
|
"&:focus": {
|
|
|
|
|
outline: "none",
|
|
|
|
|
},
|
|
|
|
|
"&:hover": {
|
|
|
|
|
boxShadow: "none",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiIconButton: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
2024-11-09 08:01:14 -05:00
|
|
|
padding: 4,
|
|
|
|
|
transition: "none",
|
|
|
|
|
"&:hover": {
|
2024-11-12 17:24:21 -05:00
|
|
|
backgroundColor: theme.palette.background.fill,
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
2024-11-12 17:24:21 -05:00
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiPaper: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => {
|
|
|
|
|
return {
|
|
|
|
|
marginTop: 4,
|
|
|
|
|
padding: 0,
|
|
|
|
|
border: 1,
|
|
|
|
|
borderStyle: "solid",
|
|
|
|
|
borderColor: theme.palette.border.light,
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
boxShadow: shadow,
|
|
|
|
|
backgroundColor: theme.palette.background.main,
|
|
|
|
|
backgroundImage: "none",
|
|
|
|
|
};
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiList: {
|
|
|
|
|
styleOverrides: {
|
|
|
|
|
root: {
|
|
|
|
|
padding: 0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiListItemButton: {
|
|
|
|
|
styleOverrides: {
|
|
|
|
|
root: {
|
|
|
|
|
transition: "none",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiMenuItem: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
2024-11-09 08:01:14 -05:00
|
|
|
borderRadius: 4,
|
|
|
|
|
backgroundColor: "inherit",
|
|
|
|
|
padding: "4px 6px",
|
2024-11-12 17:24:21 -05:00
|
|
|
color: theme.palette.text.secondary,
|
2024-11-09 08:01:14 -05:00
|
|
|
fontSize: 13,
|
|
|
|
|
margin: 2,
|
|
|
|
|
minWidth: 100,
|
|
|
|
|
"&:hover, &.Mui-selected, &.Mui-selected:hover, &.Mui-selected.Mui-focusVisible":
|
|
|
|
|
{
|
2024-11-12 17:24:21 -05:00
|
|
|
backgroundColor: theme.palette.background.fill,
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
2024-11-12 17:24:21 -05:00
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiTableCell: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
|
|
|
|
borderBottomColor: theme.palette.border.light,
|
|
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiTableHead: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
|
|
|
|
backgroundColor: theme.palette.background.accent,
|
|
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiPagination: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
|
|
|
|
backgroundColor: theme.palette.background.main,
|
2024-11-09 08:01:14 -05:00
|
|
|
border: 1,
|
|
|
|
|
borderStyle: "solid",
|
2024-11-12 17:24:21 -05:00
|
|
|
borderColor: theme.palette.border.light,
|
2024-11-09 08:01:14 -05:00
|
|
|
"& button": {
|
2024-11-12 17:24:21 -05:00
|
|
|
color: theme.palette.text.tertiary,
|
2024-11-09 08:01:14 -05:00
|
|
|
borderRadius: 4,
|
|
|
|
|
},
|
|
|
|
|
"& li:first-of-type button, & li:last-of-type button": {
|
|
|
|
|
border: 1,
|
|
|
|
|
borderStyle: "solid",
|
2024-11-12 17:24:21 -05:00
|
|
|
borderColor: theme.palette.border.light,
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
2024-11-12 17:24:21 -05:00
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiPaginationItem: {
|
|
|
|
|
styleOverrides: {
|
2024-11-12 17:24:21 -05:00
|
|
|
root: ({ theme }) => ({
|
2024-11-09 08:01:14 -05:00
|
|
|
"&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": {
|
2024-11-12 17:24:21 -05:00
|
|
|
backgroundColor: theme.palette.background.fill,
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
2024-11-12 17:24:21 -05:00
|
|
|
}),
|
2024-11-09 08:01:14 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
MuiSkeleton: {
|
|
|
|
|
styleOverrides: {
|
|
|
|
|
root: ({ theme }) => ({
|
|
|
|
|
backgroundColor: theme.palette.unresolved.bg,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
shape: {
|
|
|
|
|
borderRadius: 2,
|
|
|
|
|
borderThick: 2,
|
|
|
|
|
boxShadow: shadow,
|
|
|
|
|
},
|
2024-11-12 19:10:48 -05:00
|
|
|
});
|
2024-11-08 18:36:43 -05:00
|
|
|
|
|
|
|
|
export { baseTheme };
|