feat: simplify and adjust status label

This commit is contained in:
Caio Cabral committed 2025-01-12 09:39:31 -05:00
1 parent 5eca39cd04
commit 61aaa8489a
58 files changed
+266 -202

No files matched your search

+3 -3
View File
@@ -251,7 +251,7 @@ const BasicTable = ({ data, paginated, reversed, table, emptyMessage = "No data"
px={theme.spacing(4)} px={theme.spacing(4)}
sx={{ sx={{
"& p": { "& p": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -305,9 +305,9 @@ const BasicTable = ({ data, paginated, reversed, table, emptyMessage = "No data"
}} }}
sx={{ sx={{
mt: theme.spacing(6), mt: theme.spacing(6),
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.3, strokeWidth: 1.3,
}, },
"& .MuiSelect-select": { "& .MuiSelect-select": {
@@ -68,8 +68,8 @@ const BarChart = ({ checks = [] }) => {
height={theme.spacing(4)} height={theme.spacing(4)}
backgroundColor={ backgroundColor={
check.status check.status
? theme.palette.success.accent ? theme.palette.success.lowContrast
: theme.palette.error.accent : theme.palette.error.lowContrast
} }
sx={{ borderRadius: "50%" }} sx={{ borderRadius: "50%" }}
/> />
@@ -159,7 +159,9 @@ const BarChart = ({ checks = [] }) => {
width="100%" width="100%"
height={`${animate ? check.responseTime : 0}%`} height={`${animate ? check.responseTime : 0}%`}
backgroundColor={ backgroundColor={
check.status ? theme.palette.success.accent : theme.palette.error.accent check.status
? theme.palette.success.lowContrast
: theme.palette.error.lowContrast
} }
sx={{ sx={{
borderRadius: theme.spacing(1.5), borderRadius: theme.spacing(1.5),
@@ -36,7 +36,7 @@ const CustomToolTip = ({ active, payload, label }) => {
> >
<Typography <Typography
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
}} }}
@@ -58,7 +58,7 @@ const CustomToolTip = ({ active, payload, label }) => {
ml={theme.spacing(3)} ml={theme.spacing(3)}
sx={{ sx={{
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 11, fontSize: 11,
fontWeight: 500, fontWeight: 500,
}, },
@@ -114,7 +114,7 @@ const CustomTick = ({ x, y, payload, index }) => {
x={x} x={x}
y={y + 10} y={y + 10}
textAnchor="middle" textAnchor="middle"
fill={theme.palette.primary.contrastText.tertiary} fill={theme.palette.primary.contrastTextTertiary}
fontSize={11} fontSize={11}
fontWeight={400} fontWeight={400}
> >
@@ -23,7 +23,7 @@ export const TzTick = ({ x, y, payload, index }) => {
x={x} x={x}
y={y + 10} y={y + 10}
textAnchor="middle" textAnchor="middle"
fill={theme.palette.primary.contrastText.tertiary} fill={theme.palette.primary.contrastTextTertiary}
fontSize={11} fontSize={11}
fontWeight={400} fontWeight={400}
> >
@@ -57,7 +57,7 @@ export const PercentTick = ({ x, y, payload, index }) => {
x={x - 20} x={x - 20}
y={y} y={y}
textAnchor="middle" textAnchor="middle"
fill={theme.palette.primary.contrastText.tertiary} fill={theme.palette.primary.contrastTextTertiary}
fontSize={11} fontSize={11}
fontWeight={400} fontWeight={400}
> >
@@ -128,7 +128,7 @@ export const InfrastructureTooltip = ({
> >
<Typography <Typography
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
}} }}
@@ -150,7 +150,7 @@ export const InfrastructureTooltip = ({
ml={theme.spacing(3)} ml={theme.spacing(3)}
sx={{ sx={{
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 11, fontSize: 11,
fontWeight: 500, fontWeight: 500,
}, },
@@ -208,7 +208,7 @@ export const TemperatureTooltip = ({ active, payload, label, keys, dotColor }) =
> >
<Typography <Typography
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
}} }}
@@ -227,7 +227,7 @@ export const TemperatureTooltip = ({ active, payload, label, keys, dotColor }) =
ml={theme.spacing(3)} ml={theme.spacing(3)}
sx={{ sx={{
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 11, fontSize: 11,
fontWeight: 500, fontWeight: 500,
}, },
+1 -1
View File
@@ -51,7 +51,7 @@ const Check = ({ text, noHighlightText, variant = "info", outlined = false }) =>
sx={{ sx={{
color: color:
variant === "info" variant === "info"
? theme.palette.primary.contrastText.tertiary ? theme.palette.primary.contrastTextTertiary
: colors[variant], : colors[variant],
opacity: 0.8, opacity: 0.8,
}} }}
+2 -2
View File
@@ -28,10 +28,10 @@ const ConfigBox = styled(Stack)(({ theme }) => ({
paddingLeft: theme.spacing(18), paddingLeft: theme.spacing(18),
}, },
"& h1, & h2": { "& h1, & h2": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
}, },
"& p": { "& p": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
})); }));
@@ -37,7 +37,7 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
id={titleId} id={titleId}
component="h2" component="h2"
fontSize={16} fontSize={16}
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
fontWeight={600} fontWeight={600}
> >
{title} {title}
@@ -45,7 +45,7 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
{description && ( {description && (
<Typography <Typography
id={descriptionId} id={descriptionId}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{description} {description}
</Typography> </Typography>
+1 -1
View File
@@ -54,7 +54,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
<Typography <Typography
component="h1" component="h1"
marginY={theme.spacing(4)} marginY={theme.spacing(4)}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{vowelStart ? "An" : "A"} {title} is used to: {vowelStart ? "An" : "A"} {title} is used to:
</Typography> </Typography>
+1 -1
View File
@@ -59,7 +59,7 @@ const IconBox = styled(Box)(
width: svgWidth, width: svgWidth,
height: svgHeight, height: svgHeight,
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}, },
}) })
@@ -94,10 +94,10 @@ const Checkbox = ({
}, },
"& span.MuiTypography-root": { "& span.MuiTypography-root": {
fontSize: 13, fontSize: 13,
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
".MuiFormControlLabel-label.Mui-disabled": { ".MuiFormControlLabel-label.Mui-disabled": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
opacity: 0.25, opacity: 0.25,
}, },
}} }}
+3 -3
View File
@@ -94,7 +94,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
</IconButton> </IconButton>
<Typography <Typography
component="h2" component="h2"
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
<Typography <Typography
component="span" component="span"
@@ -108,7 +108,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
</Typography> </Typography>
<Typography <Typography
component="p" component="p"
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
sx={{ opacity: 0.6 }} sx={{ opacity: 0.6 }}
> >
(maximum size: 3MB) (maximum size: 3MB)
@@ -117,7 +117,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
</Box> </Box>
<Typography <Typography
component="p" component="p"
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
sx={{ opacity: 0.6 }} sx={{ opacity: 0.6 }}
> >
Supported formats: JPG, PNG Supported formats: JPG, PNG
+2 -2
View File
@@ -43,7 +43,7 @@ const Radio = (props) => {
height: 16, height: 16,
boxShadow: `inset 0 0 0 1px ${theme.palette.secondary.main}`, boxShadow: `inset 0 0 0 1px ${theme.palette.secondary.main}`,
"&:not(.Mui-checked)": { "&:not(.Mui-checked)": {
boxShadow: `inset 0 0 0 1px ${theme.palette.primary.contrastText.main}70`, // Use theme text color for the outline boxShadow: `inset 0 0 0 1px ${theme.palette.primary.contrastText}70`, // Use theme text color for the outline
}, },
mt: theme.spacing(0.5), mt: theme.spacing(0.5),
}} }}
@@ -56,7 +56,7 @@ const Radio = (props) => {
<Typography <Typography
component="h6" component="h6"
mt={theme.spacing(1)} mt={theme.spacing(1)}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
{props.desc} {props.desc}
</Typography> </Typography>
@@ -27,7 +27,7 @@ const SearchAdornment = () => {
width: 16, width: 16,
height: 16, height: 16,
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.2, strokeWidth: 1.2,
}, },
}, },
@@ -80,7 +80,7 @@ const Search = ({
<Typography <Typography
component="h3" component="h3"
fontSize={"var(--env-var-font-size-medium)"} fontSize={"var(--env-var-font-size-medium)"}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
fontWeight={500} fontWeight={500}
> >
{label} {label}
@@ -157,7 +157,7 @@ const Search = ({
sx: { sx: {
"& ul": { p: 2, backgroundColor: theme.palette.primary.main }, "& ul": { p: 2, backgroundColor: theme.palette.primary.main },
"& li.MuiAutocomplete-option": { "& li.MuiAutocomplete-option": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
px: 4, px: 4,
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
}, },
@@ -168,7 +168,7 @@ const Search = ({
}, },
"& li.MuiAutocomplete-option:hover:not([aria-selected='true'])": { "& li.MuiAutocomplete-option:hover:not([aria-selected='true'])": {
color: theme.palette.primary.main, color: theme.palette.primary.main,
backgroundColor: theme.palette.primary.contrastText.secondary, backgroundColor: theme.palette.primary.contrastTextSecondary,
}, },
"& .MuiAutocomplete-noOptions": { "& .MuiAutocomplete-noOptions": {
px: theme.spacing(6), px: theme.spacing(6),
@@ -54,7 +54,7 @@ const Select = ({
const theme = useTheme(); const theme = useTheme();
const itemStyles = { const itemStyles = {
fontSize: "var(--env-var-font-size-medium)", fontSize: "var(--env-var-font-size-medium)",
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
margin: theme.spacing(2), margin: theme.spacing(2),
}; };
@@ -67,7 +67,7 @@ const Select = ({
{label && ( {label && (
<Typography <Typography
component="h3" component="h3"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
fontWeight={500} fontWeight={500}
fontSize={13} fontSize={13}
> >
@@ -95,7 +95,7 @@ const Select = ({
borderColor: theme.palette.primary.lowContrast, borderColor: theme.palette.primary.lowContrast,
}, },
"& svg path": { "& svg path": {
fill: theme.palette.primary.contrastText.tertiary, fill: theme.palette.primary.contrastTextTertiary,
}, },
...sx, ...sx,
}} }}
@@ -20,7 +20,7 @@ export const HttpAdornment = ({ https }) => {
<Typography <Typography
component="h5" component="h5"
paddingRight={"var(--env-var-spacing-1-minus)"} paddingRight={"var(--env-var-spacing-1-minus)"}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
sx={{ lineHeight: 1, opacity: 0.8 }} sx={{ lineHeight: 1, opacity: 0.8 }}
> >
{https ? "https" : "http"}:// {https ? "https" : "http"}://
@@ -101,7 +101,7 @@ const TextInput = forwardRef(
<Typography <Typography
component="h3" component="h3"
fontSize={"var(--env-var-font-size-medium)"} fontSize={"var(--env-var-font-size-medium)"}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
fontWeight={500} fontWeight={500}
> >
{label} {label}
+21 -18
View File
@@ -31,8 +31,8 @@ const BaseLabel = ({ label, styles, children }) => {
className="label" className="label"
sx={{ sx={{
borderRadius: borderRadius, borderRadius: borderRadius,
border: `1px solid ${theme.palette.primary.contrastText.tertiary}`, border: `1px solid ${theme.palette.primary.contrastTextTertiary}`,
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
padding: padding, padding: padding,
...styles, ...styles,
}} }}
@@ -122,55 +122,58 @@ ColoredLabel.propTypes = {
* <StatusLabel status="up" text="Active" /> * <StatusLabel status="up" text="Active" />
*/ */
/* TODO check design aspect with Gorkem */ const statusToTheme = {
up: "success",
down: "error",
paused: "warning",
pending: "secondary",
"cannot resolve": "tertiary",
};
const StatusLabel = ({ status, text, customStyles }) => { const StatusLabel = ({ status, text, customStyles }) => {
const theme = useTheme(); const theme = useTheme();
const colors = { /* const colors = {
up: { up: {
dotColor: theme.palette.success.main, dotColor: theme.palette.success.main,
/* bgColor: theme.palette.success.contrastText */ /* dark */ borderColor: theme.palette.success.main ,
borderColor: theme.palette.success.main /* light */,
}, },
down: { down: {
dotColor: theme.palette.error.main, dotColor: theme.palette.error.main,
/* TODO Look for dark and light, they still work */
/* bgColor: theme.palette.primary.lowContrast, */
borderColor: theme.palette.error.light, borderColor: theme.palette.error.light,
}, },
paused: { paused: {
dotColor: theme.palette.warning.main, dotColor: theme.palette.warning.main,
/* bgColor: theme.palette.warning.dark, */
borderColor: theme.palette.warning.light, borderColor: theme.palette.warning.light,
}, },
pending: { pending: {
dotColor: theme.palette.primary.contrastText.secondary, dotColor: theme.palette.primary.contrastTextSecondary,
bgColor: theme.palette.primary.main,
borderColor: theme.palette.primary.lowContrast, borderColor: theme.palette.primary.lowContrast,
}, },
"cannot resolve": { "cannot resolve": {
dotColor: theme.palette.unresolved.main, dotColor: theme.palette.unresolved.main,
bgColor: theme.palette.primary.lowContrast,
borderColor: theme.palette.unresolved.light, borderColor: theme.palette.unresolved.light,
}, },
}; }; */
const themeColor = statusToTheme[status];
// Look up the color for the status // Look up the color for the status
const { borderColor, bgColor, dotColor } = colors[status]; /* const { borderColor, bgColor, dotColor } = colors[status]; */
return ( return (
<BaseLabel <BaseLabel
label={text} label={text}
styles={{ styles={{
color: dotColor, color: theme.palette[themeColor].main /* dotColor */,
backgroundColor: bgColor, /*backgroundColor: bgColor, */
borderColor: borderColor, borderColor: theme.palette[themeColor].lowContrast /* borderColor */,
...customStyles, ...customStyles,
}} }}
> >
<Box <Box
width={7} width={7}
height={7} height={7}
bgcolor={dotColor} bgcolor={theme.palette[themeColor].lowContrast /* dotColor */}
borderRadius="50%" borderRadius="50%"
marginRight="5px" marginRight="5px"
/> />
+4 -4
View File
@@ -16,22 +16,22 @@ const Link = ({ level, label, url }) => {
const levelConfig = { const levelConfig = {
primary: {}, primary: {},
secondary: { secondary: {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
sx: { sx: {
":hover": { ":hover": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
}, },
}, },
}, },
tertiary: { tertiary: {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
sx: { sx: {
textDecoration: "underline", textDecoration: "underline",
textDecorationStyle: "dashed", textDecorationStyle: "dashed",
textDecorationColor: theme.palette.primary.main, textDecorationColor: theme.palette.primary.main,
textUnderlineOffset: "1px", textUnderlineOffset: "1px",
":hover": { ":hover": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
textDecorationColor: theme.palette.primary.main, textDecorationColor: theme.palette.primary.main,
backgroundColor: theme.palette.primary.lowContrast, backgroundColor: theme.palette.primary.lowContrast,
}, },
+2 -2
View File
@@ -71,7 +71,7 @@ const ProgressUpload = ({ icon, label, size, progress = 0, onClick, error }) =>
width: 23, width: 23,
height: 23, height: 23,
"& path": { "& path": {
fill: theme.palette.primary.contrastText.tertiary, fill: theme.palette.primary.contrastTextTertiary,
}, },
}, },
}} }}
@@ -90,7 +90,7 @@ const ProgressUpload = ({ icon, label, size, progress = 0, onClick, error }) =>
{error} {error}
</Typography> </Typography>
) : ( ) : (
<Box color={theme.palette.primary.contrastText.tertiary}> <Box color={theme.palette.primary.contrastTextTertiary}>
<Typography <Typography
component="h2" component="h2"
mb={theme.spacing(1.5)} mb={theme.spacing(1.5)}
+5 -5
View File
@@ -156,7 +156,7 @@ function Sidebar() {
} }
}, [location]); }, [location]);
const iconColor = theme.palette.primary.contrastText.tertiary; const iconColor = theme.palette.primary.contrastTextTertiary;
/* TODO refactor this, there are a some ternaries and comments in the return */ /* TODO refactor this, there are a some ternaries and comments in the return */
return ( return (
@@ -178,7 +178,7 @@ function Sidebar() {
Text color for unselected menu items and menu headings Text color for unselected menu items and menu headings
Secondary contrast text against main background Secondary contrast text against main background
*/ */
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
}, },
"& .MuiList-root svg path": { "& .MuiList-root svg path": {
/* Menu Icons */ /* Menu Icons */
@@ -228,7 +228,7 @@ function Sidebar() {
height: theme.spacing(8), height: theme.spacing(8),
"& path": { "& path": {
/* TODO this should be set at the top level if possible */ /* TODO this should be set at the top level if possible */
stroke: theme.palette.primary.contrastText.secondary, stroke: theme.palette.primary.contrastTextSecondary,
}, },
}, },
"&:focus": { outline: "none" }, "&:focus": { outline: "none" },
@@ -443,7 +443,7 @@ function Sidebar() {
/* TODO this has no effect? */ /* TODO this has no effect? */
"& svg": { "& svg": {
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.1, strokeWidth: 1.1,
}, },
}, },
@@ -536,7 +536,7 @@ function Sidebar() {
}, },
"&.selected-path::after": { "&.selected-path::after": {
/* TODO what is this selector doing? */ /* TODO what is this selector doing? */
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastTextTertiary,
transform: "scale(1.2)", transform: "scale(1.2)",
}, },
}} }}
+3 -3
View File
@@ -44,15 +44,15 @@ const StatBox = ({ heading, subHeading, sx }) => {
"& h2": { "& h2": {
fontSize: 13, fontSize: 13,
fontWeight: 500, fontWeight: 500,
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
textTransform: "uppercase", textTransform: "uppercase",
}, },
"& p": { "& p": {
fontSize: 18, fontSize: 18,
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
marginTop: theme.spacing(2), marginTop: theme.spacing(2),
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
marginLeft: theme.spacing(2), marginLeft: theme.spacing(2),
fontSize: 15, fontSize: 15,
}, },
@@ -115,7 +115,7 @@ const PasswordPanel = () => {
value="password" value="password"
sx={{ sx={{
"& h1, & input": { "& h1, & input": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -216,7 +216,7 @@ const ProfilePanel = () => {
value="profile" value="profile"
sx={{ sx={{
"& h1, & p, & input": { "& h1, & p, & input": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -91,7 +91,7 @@ const TeamPanel = () => {
id: idx, id: idx,
data: ( data: (
<Stack> <Stack>
<Typography color={theme.palette.primary.contrastText.secondary}> <Typography color={theme.palette.primary.contrastTextSecondary}>
{member.firstName + " " + member.lastName} {member.firstName + " " + member.lastName}
</Typography> </Typography>
<Typography> <Typography>
@@ -190,7 +190,7 @@ const TeamPanel = () => {
value="team" value="team"
sx={{ sx={{
"& h1": { "& h1": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
"& .MuiTable-root .MuiTableBody-root .MuiTableCell-root, & .MuiTable-root p + p": "& .MuiTable-root .MuiTableBody-root .MuiTableCell-root, & .MuiTable-root p + p":
{ {
@@ -35,12 +35,12 @@ const SunAndMoonIcon = () => {
cx="12" cx="12"
cy="12" cy="12"
r="6" r="6"
fill={theme.palette.primary.contrastText.secondary} fill={theme.palette.primary.contrastTextSecondary}
mask="url(#moon-mask)" mask="url(#moon-mask)"
/> />
<g <g
className="sun-beams" className="sun-beams"
stroke={theme.palette.primary.contrastText.secondary} stroke={theme.palette.primary.contrastTextSecondary}
> >
<line <line
x1="12" x1="12"
+1 -1
View File
@@ -84,7 +84,7 @@ const Account = ({ open = "profile" }) => {
tabIndex={index} tabIndex={index}
sx={{ sx={{
fontSize: 13, fontSize: 13,
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
textTransform: "none", textTransform: "none",
minWidth: "fit-content", minWidth: "fit-content",
minHeight: 0, minHeight: 0,
+3 -3
View File
@@ -50,7 +50,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
"& svg": { "& svg": {
mr: theme.spacing(4), mr: theme.spacing(4),
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}, },
"&:focus-visible": { "&:focus-visible": {
@@ -77,7 +77,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
}} }}
sx={{ sx={{
"&:hover": { "&:hover": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -95,7 +95,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => {
}} }}
sx={{ sx={{
"&:hover": { "&:hover": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -16,7 +16,7 @@ const Empty = ({ styles, mode }) => {
</Box> </Box>
<Typography <Typography
textAlign="center" textAlign="center"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
No incidents recorded yet. No incidents recorded yet.
</Typography> </Typography>
@@ -159,7 +159,7 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
</Box> </Box>
<Typography <Typography
textAlign="center" textAlign="center"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
The monitor you have selected has no recorded incidents yet. The monitor you have selected has no recorded incidents yet.
</Typography> </Typography>
+1 -1
View File
@@ -84,7 +84,7 @@ const Incidents = () => {
<Typography <Typography
display="inline-block" display="inline-block"
component="h1" component="h1"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
Incidents for Incidents for
</Typography> </Typography>
@@ -19,7 +19,7 @@ const Empty = ({ styles }) => {
<Typography variant="h2">Your infrastructure dashboard will show here</Typography> <Typography variant="h2">Your infrastructure dashboard will show here</Typography>
<Typography <Typography
textAlign="center" textAlign="center"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
Hang tight! Data is loading Hang tight! Data is loading
</Typography> </Typography>
@@ -83,7 +83,7 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => {
outline: "none", outline: "none",
}, },
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
ref={anchor} ref={anchor}
@@ -98,9 +98,9 @@ function Pagination({
}, },
}} }}
sx={{ sx={{
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.3, strokeWidth: 1.3,
}, },
"& .MuiSelect-select": { "& .MuiSelect-select": {
+3 -3
View File
@@ -156,7 +156,7 @@ function Infrastructure() {
? theme.palette.percentage.uptimeFair ? theme.palette.percentage.uptimeFair
: monitor.uptimePercentage < 0.75 : monitor.uptimePercentage < 0.75
? theme.palette.percentage.uptimeGood ? theme.palette.percentage.uptimeGood
: theme.palette.success.accent; : theme.palette.success.lowContrast;
return { return {
id: monitor._id, id: monitor._id,
name: monitor.name, name: monitor.name,
@@ -229,7 +229,7 @@ function Infrastructure() {
<Box <Box
component="span" component="span"
className="current-monitors-counter" className="current-monitors-counter"
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
border={1} border={1}
borderColor={theme.palette.primary.lowContrast} borderColor={theme.palette.primary.lowContrast}
backgroundColor={theme.palette.tertiary.main} backgroundColor={theme.palette.tertiary.main}
@@ -313,7 +313,7 @@ function Infrastructure() {
<IconButton <IconButton
sx={{ sx={{
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
+1 -1
View File
@@ -126,7 +126,7 @@ const Integrations = () => {
gap={theme.spacing(2)} gap={theme.spacing(2)}
sx={{ sx={{
"& h1, & p": { "& h1, & p": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
}, },
}} }}
> >
@@ -394,7 +394,7 @@ const CreateMaintenance = () => {
py: 0, py: 0,
mr: 0, mr: 0,
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.1, strokeWidth: 1.1,
}, },
"&:hover": { backgroundColor: "transparent" }, "&:hover": { backgroundColor: "transparent" },
@@ -95,7 +95,7 @@ const ActionsMenu = ({ /* isAdmin, */ maintenanceWindow, updateCallback }) => {
outline: "none", outline: "none",
}, },
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -329,9 +329,9 @@ const MaintenanceTable = ({
}} }}
sx={{ sx={{
mt: theme.spacing(6), mt: theme.spacing(6),
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.3, strokeWidth: 1.3,
}, },
"& .MuiSelect-select": { "& .MuiSelect-select": {
@@ -249,7 +249,7 @@ const PageSpeedConfigure = () => {
width: 4, width: 4,
height: 4, height: 4,
borderRadius: "50%", borderRadius: "50%",
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastTextTertiary,
opacity: 0.8, opacity: 0.8,
left: -10, left: -10,
top: "50%", top: "50%",
@@ -276,7 +276,7 @@ const PageSpeedConfigure = () => {
"& svg": { "& svg": {
mr: theme.spacing(2), mr: theme.spacing(2),
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 0.1, strokeWidth: 0.1,
}, },
}, },
@@ -179,7 +179,7 @@ const CreatePageSpeed = () => {
className="create-monitor" className="create-monitor"
sx={{ sx={{
"& h1": { "& h1": {
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
}, },
}} }}
> >
@@ -207,7 +207,7 @@ const CreatePageSpeed = () => {
component="span" component="span"
fontSize="inherit" fontSize="inherit"
fontWeight="inherit" fontWeight="inherit"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
PageSpeed monitor PageSpeed monitor
</Typography> </Typography>
@@ -64,7 +64,7 @@ const CustomToolTip = ({ active, payload, label, config }) => {
> >
<Typography <Typography
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
}} }}
@@ -86,7 +86,7 @@ const CustomToolTip = ({ active, payload, label, config }) => {
mt={theme.spacing(1)} mt={theme.spacing(1)}
sx={{ sx={{
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 11, fontSize: 11,
fontWeight: 500, fontWeight: 500,
}, },
@@ -186,7 +186,7 @@ const CustomTick = ({ x, y, payload, index }) => {
x={x} x={x}
y={y + 8} y={y + 8}
textAnchor="middle" textAnchor="middle"
fill={theme.palette.primary.contrastText.tertiary} fill={theme.palette.primary.contrastTextTertiary}
fontSize={11} fontSize={11}
fontWeight={400} fontWeight={400}
> >
+3 -3
View File
@@ -151,7 +151,7 @@ const PageSpeedDetails = () => {
width: 4, width: 4,
height: 4, height: 4,
borderRadius: "50%", borderRadius: "50%",
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastTextTertiary,
opacity: 0.8, opacity: 0.8,
left: -9, left: -9,
top: "50%", top: "50%",
@@ -175,7 +175,7 @@ const PageSpeedDetails = () => {
"& svg": { "& svg": {
mr: theme.spacing(3), mr: theme.spacing(3),
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}, },
}} }}
@@ -410,7 +410,7 @@ const PageSpeedDetails = () => {
component="span" component="span"
fontSize={14} fontSize={14}
fontWeight={500} fontWeight={500}
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
> >
{value} {value}
<Typography <Typography
@@ -12,11 +12,11 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
borderBottomRightRadius: 16, borderBottomRightRadius: 16,
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
"& h2": { "& h2": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
fontSize: 15, fontSize: 15,
fontWeight: 500, fontWeight: 500,
}, },
"& p": { color: theme.palette.primary.contrastText.tertiary }, "& p": { color: theme.palette.primary.contrastTextTertiary },
"& > :nth-of-type(1)": { "& > :nth-of-type(1)": {
gridColumn: 1, gridColumn: 1,
gridRow: 1, gridRow: 1,
+3 -3
View File
@@ -33,7 +33,7 @@ const CustomToolTip = ({ payload }) => {
> >
<Typography <Typography
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 12, fontSize: 12,
fontWeight: 500, fontWeight: 500,
}} }}
@@ -52,7 +52,7 @@ const CustomToolTip = ({ payload }) => {
mt={theme.spacing(1)} mt={theme.spacing(1)}
sx={{ sx={{
"& span": { "& span": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 11, fontSize: 11,
fontWeight: 500, fontWeight: 500,
}, },
@@ -299,7 +299,7 @@ const Card = ({ monitor }) => {
<Typography <Typography
component="span" component="span"
fontSize={12} fontSize={12}
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
> >
{time}{" "} {time}{" "}
</Typography> </Typography>
+1 -1
View File
@@ -113,7 +113,7 @@ const PageSpeed = () => {
<Box <Box
component="span" component="span"
className="current-monitors-counter" className="current-monitors-counter"
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
border={1} border={1}
borderColor={theme.palette.primary.lowContrast} borderColor={theme.palette.primary.lowContrast}
backgroundColor={theme.palette.tertiary.main} backgroundColor={theme.palette.tertiary.main}
+2 -2
View File
@@ -276,7 +276,7 @@ const Configure = () => {
width: 4, width: 4,
height: 4, height: 4,
borderRadius: "50%", borderRadius: "50%",
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastTextTertiary,
opacity: 0.8, opacity: 0.8,
left: -10, left: -10,
top: "50%", top: "50%",
@@ -307,7 +307,7 @@ const Configure = () => {
width: 22, width: 22,
height: 22, height: 22,
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
strokeWidth: 1.7, strokeWidth: 1.7,
}, },
}, },
+5 -5
View File
@@ -190,7 +190,7 @@ const DetailsPage = () => {
width: 4, width: 4,
height: 4, height: 4,
borderRadius: "50%", borderRadius: "50%",
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastTextTertiary,
opacity: 0.8, opacity: 0.8,
left: -9, left: -9,
top: "50%", top: "50%",
@@ -259,7 +259,7 @@ const DetailsPage = () => {
<Typography <Typography
component="span" component="span"
fontSize={13} fontSize={13}
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
> >
{certificateExpiry} {certificateExpiry}
</Typography> </Typography>
@@ -333,7 +333,7 @@ const DetailsPage = () => {
position="absolute" position="absolute"
top="100%" top="100%"
fontSize={11} fontSize={11}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{formatDateWithTz( {formatDateWithTz(
hoveredUptimeData._id, hoveredUptimeData._id,
@@ -390,7 +390,7 @@ const DetailsPage = () => {
position="absolute" position="absolute"
top="100%" top="100%"
fontSize={11} fontSize={11}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{formatDateWithTz( {formatDateWithTz(
hoveredIncidentsData._id, hoveredIncidentsData._id,
@@ -443,7 +443,7 @@ const DetailsPage = () => {
</IconBox> </IconBox>
<Typography <Typography
component="h2" component="h2"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
History History
</Typography> </Typography>
+4 -4
View File
@@ -12,16 +12,16 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
borderRadius: 4, borderRadius: 4,
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
"& h2": { "& h2": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
fontSize: 15, fontSize: 15,
fontWeight: 500, fontWeight: 500,
}, },
"& .MuiBox-root:not(.area-tooltip) p": { "& .MuiBox-root:not(.area-tooltip) p": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
fontSize: 13, fontSize: 13,
}, },
"& .MuiBox-root > span": { "& .MuiBox-root > span": {
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
fontSize: 20, fontSize: 20,
"& span": { "& span": {
opacity: 0.8, opacity: 0.8,
@@ -37,7 +37,7 @@ export const ChartBox = styled(Stack)(({ theme }) => ({
alignItems: "center", alignItems: "center",
}, },
"& tspan, & text": { "& tspan, & text": {
fill: theme.palette.primary.contrastText.tertiary, fill: theme.palette.primary.contrastTextTertiary,
}, },
"& path": { "& path": {
transition: "fill 300ms ease, stroke-width 400ms ease", transition: "fill 300ms ease, stroke-width 400ms ease",
@@ -30,7 +30,7 @@ const CurrentMonitoring = ({ totalMonitors, monitors, isAdmin, handlePause }) =>
<Box <Box
className="current-monitors-counter" className="current-monitors-counter"
color={theme.palette.primary.contrastText.main} color={theme.palette.primary.contrastText}
border={1} border={1}
borderColor={theme.palette.primary.lowContrast} borderColor={theme.palette.primary.lowContrast}
backgroundColor={theme.palette.tertiary.main} backgroundColor={theme.palette.tertiary.main}
+7 -7
View File
@@ -12,27 +12,27 @@ const StatusBox = ({ title, value }) => {
position: "absolute", position: "absolute",
right: 8, right: 8,
opacity: 0.5, opacity: 0.5,
"& svg path": { stroke: theme.palette.primary.contrastText.tertiary }, "& svg path": { stroke: theme.palette.primary.contrastTextTertiary },
}; };
let color; let color;
let icon; let icon;
if (title === "up") { if (title === "up") {
color = theme.palette.success.accent; color = theme.palette.success.lowContrast;
icon = ( icon = (
<Box sx={{ ...sharedStyles, top: 8 }}> <Box sx={{ ...sharedStyles, top: 8 }}>
<Arrow /> <Arrow />
</Box> </Box>
); );
} else if (title === "down") { } else if (title === "down") {
color = theme.palette.error.accent; color = theme.palette.error.lowContrast;
icon = ( icon = (
<Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}> <Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}>
<Arrow /> <Arrow />
</Box> </Box>
); );
} else if (title === "paused") { } else if (title === "paused") {
color = theme.palette.warning.accent; color = theme.palette.warning.lowContrast;
icon = ( icon = (
<Box sx={{ ...sharedStyles, top: 12, right: 12 }}> <Box sx={{ ...sharedStyles, top: 12, right: 12 }}>
<ClockSnooze /> <ClockSnooze />
@@ -58,7 +58,7 @@ const StatusBox = ({ title, value }) => {
left: "5%", left: "5%",
pointerEvents: "none", pointerEvents: "none",
"& svg g g:last-of-type path": { "& svg g g:last-of-type path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -68,7 +68,7 @@ const StatusBox = ({ title, value }) => {
textTransform="uppercase" textTransform="uppercase"
fontSize={15} fontSize={15}
letterSpacing={0.5} letterSpacing={0.5}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
mb={theme.spacing(8)} mb={theme.spacing(8)}
> >
{title} {title}
@@ -88,7 +88,7 @@ const StatusBox = ({ title, value }) => {
component="span" component="span"
fontSize={20} fontSize={20}
fontWeight={300} fontWeight={300}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
sx={{ opacity: 0.3 }} sx={{ opacity: 0.3 }}
> >
# #
@@ -171,7 +171,7 @@ const MonitorTable = ({ isAdmin, filter, setIsSearching, isSearching, handlePaus
> >
<CircularProgress <CircularProgress
sx={{ sx={{
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
}} }}
/> />
</Box> </Box>
@@ -182,7 +182,7 @@ const MonitorTable = ({ isAdmin, filter, setIsSearching, isSearching, handlePaus
sx={{ sx={{
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
"& :is(th, td)": { "& :is(th, td)": {
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
}, },
}} }}
> >
@@ -238,7 +238,7 @@ const MonitorTable = ({ isAdmin, filter, setIsSearching, isSearching, handlePaus
{monitors.length > 0 ? ( {monitors.length > 0 ? (
monitors.map((monitor) => { monitors.map((monitor) => {
let uptimePercentage = ""; let uptimePercentage = "";
let percentageColor = theme.palette.success.accent; let percentageColor = theme.palette.success.lowContrast;
// Determine uptime percentage and color based on the monitor's uptimePercentage value // Determine uptime percentage and color based on the monitor's uptimePercentage value
if (monitor.uptimePercentage !== undefined) { if (monitor.uptimePercentage !== undefined) {
+2 -2
View File
@@ -90,7 +90,7 @@ const ActionsMenu = ({ monitor, isAdmin, updateRowCallback, pauseCallback }) =>
outline: "none", outline: "none",
}, },
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastTextTertiary,
}, },
}} }}
> >
@@ -110,7 +110,7 @@ const ActionsMenu = ({ monitor, isAdmin, updateRowCallback, pauseCallback }) =>
p: theme.spacing(2.5), p: theme.spacing(2.5),
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
}, },
"& li": { m: 0, color: theme.palette.primary.contrastText.secondary }, "& li": { m: 0, color: theme.palette.primary.contrastTextSecondary },
/* /*
This should not be set automatically on the last of type This should not be set automatically on the last of type
"& li:last-of-type": { "& li:last-of-type": {
+1 -1
View File
@@ -21,7 +21,7 @@ const Fallback = ({ isAdmin }) => {
border={1} border={1}
borderRadius={theme.shape.borderRadius} borderRadius={theme.shape.borderRadius}
borderColor={theme.palette.primary.lowContrast} borderColor={theme.palette.primary.lowContrast}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
<Box pb={theme.spacing(20)}> <Box pb={theme.spacing(20)}>
{mode === "light" ? <PlaceholderLight /> : <PlaceholderDark />} {mode === "light" ? <PlaceholderLight /> : <PlaceholderDark />}
+39
View File
@@ -72,6 +72,45 @@ const UptimeMonitors = () => {
> >
Create new Create new
</Button> </Button>
<Button
variant="contained"
color="success"
onClick={() => {
navigate("/uptime/create");
}}
sx={{
fontWeight: 500,
whiteSpace: "nowrap",
}}
>
Create new
</Button>
<Button
variant="contained"
color="warning"
onClick={() => {
navigate("/uptime/create");
}}
sx={{
fontWeight: 500,
whiteSpace: "nowrap",
}}
>
Create new
</Button>
<Button
variant="contained"
color="error"
onClick={() => {
navigate("/uptime/create");
}}
sx={{
fontWeight: 500,
whiteSpace: "nowrap",
}}
>
Create new
</Button>
</> </>
)} )}
</Stack> </Stack>
+19 -12
View File
@@ -11,10 +11,10 @@ const useUtils = () => {
const theme = useTheme(); const theme = useTheme();
const statusColor = { const statusColor = {
up: theme.palette.success.accent, up: theme.palette.success.lowContrast,
down: theme.palette.error.accent, down: theme.palette.error.lowContrast,
paused: theme.palette.warning.accent, paused: theme.palette.warning.lowContrast,
pending: theme.palette.warning.accent, pending: theme.palette.warning.lowContrast,
}; };
const statusMsg = { const statusMsg = {
@@ -31,32 +31,39 @@ const useUtils = () => {
/* This is used on /* This is used on
1) Details > Gradient card */ 1) Details > Gradient card */
/* These are rediections. We should do something that maps up to success, down to error, and get the theme by that
*/
const statusStyles = { const statusStyles = {
up: { up: {
backgroundColor: theme.palette.success.accent, backgroundColor: theme.palette.success.lowContrast,
background: `linear-gradient(340deg, ${theme.palette.success.accent} -60%, ${theme.palette.success.contrastText} 35%)`, background: `linear-gradient(340deg, ${theme.palette.success.lowContrast} -60%, ${theme.palette.success.contrastText} 35%)`,
borderColor: theme.palette.success.contrastText, borderColor: theme.palette.success.contrastText,
"& h2": { color: theme.palette.success.main }, "& h2": { color: theme.palette.success.main },
}, },
down: { down: {
backgroundColor: theme.palette.error.accent /* dark */, backgroundColor: theme.palette.error.lowContrast,
background: `linear-gradient(340deg, ${theme.palette.error.accent} -60%, ${theme.palette.error.contrastText} 35%)`, background: `linear-gradient(340deg, ${theme.palette.error.lowContrast} -60%, ${theme.palette.error.contrastText} 35%)`,
borderColor: theme.palette.error.contrastText, borderColor: theme.palette.error.contrastText,
"& h2": { color: theme.palette.error.main }, "& h2": { color: theme.palette.error.main },
}, },
paused: { paused: {
backgroundColor: theme.palette.warning.accent /* dark */, backgroundColor: theme.palette.warning.lowContrast,
background: `linear-gradient(340deg, ${theme.palette.warning.accent} -60%, ${theme.palette.warning.contrastText} 35%)`, background: `linear-gradient(340deg, ${theme.palette.warning.lowContrast} -60%, ${theme.palette.warning.contrastText} 35%)`,
borderColor: theme.palette.warning.contrastText, borderColor: theme.palette.warning.contrastText,
"& h2": { color: theme.palette.warning.main }, "& h2": { color: theme.palette.warning.main },
}, },
pending: { pending: {
backgroundColor: theme.palette.warning.accent /* dark */, backgroundColor: theme.palette.warning.lowContrast,
background: `linear-gradient(340deg, ${theme.palette.warning.accent} -60%, ${theme.palette.warning.contrastText} 35%)`, background: `linear-gradient(340deg, ${theme.palette.warning.lowContrast} -60%, ${theme.palette.warning.contrastText} 35%)`,
borderColor: theme.palette.warning.contrastText, borderColor: theme.palette.warning.contrastText,
"& h2": { color: theme.palette.warning.main }, "& h2": { color: theme.palette.warning.main },
}, },
}; };
/* These are rediections. We should do something that maps up to success, down to error, and get the theme by that
*/
const pagespeedStyles = { const pagespeedStyles = {
up: { up: {
bg: theme.palette.success.dark, bg: theme.palette.success.dark,
+59 -46
View File
@@ -97,22 +97,36 @@ const newColors = {
green200: "#4B9B77", green200: "#4B9B77",
green400: "#079455", green400: "#079455",
green700: "#026513", green700: "#026513",
orange100: "#FFE5CC", orange100: "#CCB368",
orange400: "#FD8F22", orange400: "#FD8F22",
orange600: "#9B734B", orange600: "#9B734B",
orange700: "#694016", orange700: "#884605" /* "#6F5404" */,
red100: "#F9C2C2", /* warning: {
main: {
light: newColors.orange700,
dark: newColors.orange100,
},
contrastText: {
light: newColors.offWhite,
dark: newColors.offBlack,
},
lowContrast: {
light: newColors.orange400,
dark: newColors.orange600,
},
}, */
red100: "#F27C7C",
red400: "#D92020", red400: "#D92020",
red600: "#9B4B4B", red600: "#9B4B4B",
red700: "#791515", red700: "#980303",
}; };
/* Structure: /* Structure:
Key: Key:
main: background color main: background color
contrastText: color for main contrast text contrastText: color for main contrast text
light and dark: should be transparent (since we don't want MUI to make the light dark automatic calculations for us) contrastTextSecondary: if needed
lowerContrastText: if there are any, use nested keys secondary and tertiary contrastTextTertiary: if needed
lowContrast: if we need some low contrast for that color (for borders, and decorative elements). This should never be usend in text lowContrast: if we need some low contrast for that color (for borders, and decorative elements). This should never be usend in text
*/ */
@@ -133,18 +147,16 @@ const newSemanticColors = {
dark: newColors.offBlack, dark: newColors.offBlack,
}, },
contrastText: { contrastText: {
main: { light: newColors.blueGray800,
light: newColors.blueGray800, dark: newColors.blueGray50,
dark: newColors.blueGray50, },
}, contrastTextSecondary: {
secondary: { light: newColors.blueGray600,
light: newColors.blueGray600, dark: newColors.gray200,
dark: newColors.gray200, },
}, contrastTextTertiary: {
tertiary: { light: newColors.blueGray500,
light: newColors.blueGray500, dark: newColors.gray500,
dark: newColors.gray500,
},
}, },
lowContrast: { lowContrast: {
light: newColors.gray200, light: newColors.gray200,
@@ -171,49 +183,48 @@ const newSemanticColors = {
dark: newColors.gray100, dark: newColors.gray100,
}, },
}, },
/* For success, warning and error, contrastText works wll with main, and with the theme primary main color. Accent is to be used in graphs */
success: { success: {
main: { main: {
light: newColors.green700, light: newColors.green700,
dark: newColors.green100, dark: newColors.green100,
}, },
contrastText: { contrastText: {
light: newColors.green100, light: newColors.offWhite,
dark: newColors.green700, dark: newColors.offBlack,
}, },
accent: { lowContrast: {
light: newColors.green400, light: newColors.green400,
dark: newColors.green200, dark: newColors.green200,
}, },
}, },
error: {
main: {
light: newColors.red700,
dark: newColors.red100,
},
contrastText: {
light: newColors.red100,
dark: newColors.red700,
},
accent: {
light: newColors.red400,
dark: newColors.red600,
},
},
warning: { warning: {
main: { main: {
light: newColors.orange700, light: newColors.orange700,
dark: newColors.orange100, dark: newColors.orange100,
}, },
contrastText: { contrastText: {
light: newColors.orange100, light: newColors.offWhite,
dark: newColors.orange700, dark: newColors.offBlack,
}, },
accent: { lowContrast: {
light: newColors.orange400, light: newColors.orange400,
dark: newColors.orange600, dark: newColors.orange600,
}, },
}, },
error: {
main: {
light: newColors.red700,
dark: newColors.red100,
},
contrastText: {
light: newColors.offWhite,
dark: newColors.offBlack,
},
lowContrast: {
light: newColors.red400,
dark: newColors.red600,
},
},
/* These are temporary, just for everything not to break */ /* These are temporary, just for everything not to break */
gradient: { gradient: {
color1: { color1: {
@@ -237,12 +248,6 @@ const newSemanticColors = {
dark: paletteColors.gray850, dark: paletteColors.gray850,
}, },
}, },
other: {
grid: {
light: paletteColors.gray300,
dark: paletteColors.gray600,
},
},
unresolved: { unresolved: {
main: { main: {
light: paletteColors.blue700, light: paletteColors.blue700,
@@ -255,7 +260,15 @@ export { typographyLevels, semanticColors as colors, newSemanticColors };
/* TODO /* TODO
Look up for Look up for
success.contrastText
warning.contrastText
error.contrastText
"red" "red"
"white" "white"
{ text, bg, border } { text, bg, border }
@@ -263,5 +276,5 @@ Look up for
.dark .dark
theme.palette.unresolved theme.palette.unresolved (will become tertiary)
*/ */
+5 -5
View File
@@ -58,7 +58,7 @@ const baseTheme = (palette) => ({
props: (props) => props.variant === "group", props: (props) => props.variant === "group",
style: { style: {
/* color: theme.palette.secondary.contrastText, */ /* color: theme.palette.secondary.contrastText, */
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
border: 1, border: 1,
borderStyle: "solid", borderStyle: "solid",
@@ -114,7 +114,7 @@ const baseTheme = (palette) => ({
"&.MuiLoadingButton-root": { "&.MuiLoadingButton-root": {
"&:disabled": { "&:disabled": {
backgroundColor: theme.palette.secondary.main, backgroundColor: theme.palette.secondary.main,
color: theme.palette.primary.contrastText.main, color: theme.palette.primary.contrastText,
}, },
}, },
"&.MuiLoadingButton-loading": { "&.MuiLoadingButton-loading": {
@@ -177,7 +177,7 @@ const baseTheme = (palette) => ({
borderRadius: 4, borderRadius: 4,
backgroundColor: "inherit", backgroundColor: "inherit",
padding: "4px 6px", padding: "4px 6px",
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastTextSecondary,
fontSize: 13, fontSize: 13,
margin: 2, margin: 2,
minWidth: 100, minWidth: 100,
@@ -210,7 +210,7 @@ const baseTheme = (palette) => ({
borderStyle: "solid", borderStyle: "solid",
borderColor: theme.palette.primary.lowContrast, borderColor: theme.palette.primary.lowContrast,
"& button": { "& button": {
color: theme.palette.primary.contrastText.tertiary, color: theme.palette.primary.contrastTextTertiary,
borderRadius: 4, borderRadius: 4,
}, },
"& li:first-of-type button, & li:last-of-type button": { "& li:first-of-type button, & li:last-of-type button": {
@@ -258,7 +258,7 @@ const baseTheme = (palette) => ({
"& .MuiInputBase-input:-webkit-autofill": { "& .MuiInputBase-input:-webkit-autofill": {
transition: "background-color 5000s ease-in-out 0s", transition: "background-color 5000s ease-in-out 0s",
WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.primary.main} inset`, WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.primary.main} inset`,
WebkitTextFillColor: theme.palette.primary.contrastText.main, WebkitTextFillColor: theme.palette.primary.contrastText,
}, },
"& .MuiInputBase-input.MuiOutlinedInput-input": { "& .MuiInputBase-input.MuiOutlinedInput-input": {
padding: "0 var(--env-var-spacing-1-minus) !important", padding: "0 var(--env-var-spacing-1-minus) !important",
+3 -3
View File
@@ -163,7 +163,7 @@ const Greeting = ({ type = "" }) => {
<Typography <Typography
component="span" component="span"
fontSize="inherit" fontSize="inherit"
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{prepend},{" "} {prepend},{" "}
</Typography> </Typography>
@@ -171,7 +171,7 @@ const Greeting = ({ type = "" }) => {
component="span" component="span"
fontSize="inherit" fontSize="inherit"
fontWeight="inherit" fontWeight="inherit"
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastTextSecondary}
> >
{firstName} {emoji} {firstName} {emoji}
</Typography> </Typography>
@@ -179,7 +179,7 @@ const Greeting = ({ type = "" }) => {
<Typography <Typography
variant="h2" variant="h2"
lineHeight={1} lineHeight={1}
color={theme.palette.primary.contrastText.tertiary} color={theme.palette.primary.contrastTextTertiary}
> >
{append} — Here’s an overview of your {type} monitors. {append} — Here’s an overview of your {type} monitors.
</Typography> </Typography>