diff --git a/client/src/components/common/HeaderCreate.tsx b/client/src/components/common/HeaderCreate.tsx index 8beeca2d8..40f6f7182 100644 --- a/client/src/components/common/HeaderCreate.tsx +++ b/client/src/components/common/HeaderCreate.tsx @@ -52,7 +52,7 @@ export const HeaderCreate = ({ - diff --git a/client/src/pages/diagnostic/DiagnosticsLogTab.tsx b/client/src/pages/diagnostic/DiagnosticsLogTab.tsx index 9412c5c32..0122b8128 100644 --- a/client/src/pages/diagnostic/DiagnosticsLogTab.tsx +++ b/client/src/pages/diagnostic/DiagnosticsLogTab.tsx @@ -27,7 +27,7 @@ export const DiagnosticsLogTab = () => { info: theme.palette.success.main, warn: theme.palette.warning.main, error: theme.palette.error.main, - debug: theme.palette.accent.main, + debug: theme.palette.primary.main, }; const headers: Header[] = [ diff --git a/client/src/pages/errors/NoTeam.tsx b/client/src/pages/errors/NoTeam.tsx index 7613661cd..03f550d44 100644 --- a/client/src/pages/errors/NoTeam.tsx +++ b/client/src/pages/errors/NoTeam.tsx @@ -42,7 +42,7 @@ const NoTeam = () => { diff --git a/client/src/pages/infrastructure/InfraDetailsGraphs.tsx b/client/src/pages/infrastructure/InfraDetailsGraphs.tsx index 1380fb6e3..2a5590402 100644 --- a/client/src/pages/infrastructure/InfraDetailsGraphs.tsx +++ b/client/src/pages/infrastructure/InfraDetailsGraphs.tsx @@ -11,8 +11,8 @@ const getChartConfigs = (theme: any, checks: IInfraCheck[]) => { { type: "memory", dataKeys: ["memory.usage_percent"], - strokeColor: theme.palette.accent.main, - gradientStartColor: theme.palette.accent.main, + strokeColor: theme.palette.primary.main, + gradientStartColor: theme.palette.primary.main, yDomain: [0, 1], idx: null, }, diff --git a/client/src/pages/infrastructure/InfraDetailsNetGraphs.tsx b/client/src/pages/infrastructure/InfraDetailsNetGraphs.tsx index 6fb325180..cf52d0a32 100644 --- a/client/src/pages/infrastructure/InfraDetailsNetGraphs.tsx +++ b/client/src/pages/infrastructure/InfraDetailsNetGraphs.tsx @@ -20,8 +20,8 @@ const getChartConfigs = ( { type: "Bytes received", dataKeys: [`net[${idx}].bytes_recv`], - strokeColor: theme.palette.accent.main, - gradientStartColor: theme.palette.accent.main, + strokeColor: theme.palette.primary.main, + gradientStartColor: theme.palette.primary.main, yDomain: [0, 1], idx: null, }, diff --git a/client/src/pages/infrastructure/InfraForm.tsx b/client/src/pages/infrastructure/InfraForm.tsx index 3216460b4..9e970edb5 100644 --- a/client/src/pages/infrastructure/InfraForm.tsx +++ b/client/src/pages/infrastructure/InfraForm.tsx @@ -349,7 +349,7 @@ export const InfraForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/pages/maintenance/MaintenanceForm.tsx b/client/src/pages/maintenance/MaintenanceForm.tsx index 14bf60338..1df419e16 100644 --- a/client/src/pages/maintenance/MaintenanceForm.tsx +++ b/client/src/pages/maintenance/MaintenanceForm.tsx @@ -217,7 +217,7 @@ export const MaintenanceForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/pages/notification-channels/NotificationChannelsForm.tsx b/client/src/pages/notification-channels/NotificationChannelsForm.tsx index 6d1020d45..50473bc83 100644 --- a/client/src/pages/notification-channels/NotificationChannelsForm.tsx +++ b/client/src/pages/notification-channels/NotificationChannelsForm.tsx @@ -213,7 +213,7 @@ export const NotificationChannelsForm = ({ > diff --git a/client/src/pages/pagespeed/PageSpeedForm.tsx b/client/src/pages/pagespeed/PageSpeedForm.tsx index 1b7b768aa..16ae0d31e 100644 --- a/client/src/pages/pagespeed/PageSpeedForm.tsx +++ b/client/src/pages/pagespeed/PageSpeedForm.tsx @@ -269,7 +269,7 @@ export const PageSpeedForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/pages/profile/ProfileForm.tsx b/client/src/pages/profile/ProfileForm.tsx index c52a84843..d5ed20081 100644 --- a/client/src/pages/profile/ProfileForm.tsx +++ b/client/src/pages/profile/ProfileForm.tsx @@ -140,7 +140,7 @@ export const ProfileForm = ({ @@ -364,7 +364,7 @@ export const SettingsForm = ({ > diff --git a/client/src/pages/teams/TeamMemberForm.tsx b/client/src/pages/teams/TeamMemberForm.tsx index b498d8b0b..6119c1a47 100644 --- a/client/src/pages/teams/TeamMemberForm.tsx +++ b/client/src/pages/teams/TeamMemberForm.tsx @@ -137,7 +137,7 @@ export const TeamMemberForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/pages/teams/TeamsForm.tsx b/client/src/pages/teams/TeamsForm.tsx index 09c70b7e0..bfa6fecfb 100644 --- a/client/src/pages/teams/TeamsForm.tsx +++ b/client/src/pages/teams/TeamsForm.tsx @@ -144,7 +144,7 @@ export const TeamsForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/pages/uptime/UptimeForm.tsx b/client/src/pages/uptime/UptimeForm.tsx index 08d2d433b..e3a82d97a 100644 --- a/client/src/pages/uptime/UptimeForm.tsx +++ b/client/src/pages/uptime/UptimeForm.tsx @@ -338,7 +338,7 @@ export const UptimeForm = ({ loading={loading} type="submit" variant="contained" - color="accent" + color="primary" > {t("settingsSave")} diff --git a/client/src/theme/new_palette.ts b/client/src/theme/new_palette.ts deleted file mode 100644 index c28f4d25d..000000000 --- a/client/src/theme/new_palette.ts +++ /dev/null @@ -1,21 +0,0 @@ -const typographyBase = 13; - -export const typographyLevels = { - base: typographyBase, - xs: `${(typographyBase - 4) / 16}rem`, - s: `${(typographyBase - 2) / 16}rem`, - m: `${typographyBase / 16}rem`, - l: `${(typographyBase + 2) / 16}rem`, - xl: `${(typographyBase + 10) / 16}rem`, -}; - -export const lightPalette = { - primary: { - main: "#1570ef", - }, -}; -export const darkPalette = { - primary: { - main: "#1570ef", - }, -}; diff --git a/client/src/theme/palette.ts b/client/src/theme/palette.ts index 9bb62e4af..ef312b29b 100644 --- a/client/src/theme/palette.ts +++ b/client/src/theme/palette.ts @@ -47,85 +47,65 @@ export const colors = { }; export const lightPalette = { - accent: { - main: colors.blueBlueWave, - light: lighten(colors.blueBlueWave, 0.2), - dark: darken(colors.blueBlueWave, 0.2), - contrastText: colors.offWhite, - }, primary: { - main: colors.offWhite, - contrastText: colors.blueGray800, - contrastTextSecondary: colors.blueGray600, - contrastTextTertiary: colors.blueGray500, - lowContrast: colors.gray250, - veryLowContrast: lighten(colors.gray250, 0.5), + main: colors.blueBlueWave, + light: lighten(colors.blueBlueWave, 0.4), + dark: darken(colors.blueBlueWave, 0.2), }, secondary: { main: colors.gray200, light: colors.lightBlueWave, dark: lighten(colors.gray200, 0.1), - contrastText: colors.blueGray600, - }, - tertiary: { - main: colors.gray100, - contrastText: colors.blueGray800, }, + // Tertiary is a custom helper palette success: { main: colors.green700, contrastText: colors.offWhite, - lowContrast: colors.green400, + light: lighten(colors.green700, 0.35), + dark: darken(colors.green700, 0.2), }, warning: { main: colors.orange700, contrastText: colors.offWhite, - lowContrast: colors.orange100, + light: lighten(colors.orange700, 0.4), + dark: darken(colors.orange700, 0.2), }, error: { main: colors.red700, contrastText: colors.offWhite, - lowContrast: colors.red400, + light: lighten(colors.red700, 0.35), + dark: darken(colors.red700, 0.2), }, }; export const darkPalette = { - accent: { - main: colors.blueBlueWave, - light: lighten(colors.blueBlueWave, 0.2), - dark: darken(colors.blueBlueWave, 0.2), - contrastText: colors.offWhite, - }, primary: { - main: colors.offBlack, - contrastText: colors.blueGray50, - contrastTextSecondary: colors.gray200, - contrastTextTertiary: colors.gray500, - lowContrast: colors.blueGray600, - veryLowContrast: darken(colors.blueGray600, 0.5), + main: colors.blueBlueWave, + light: lighten(colors.blueBlueWave, 0.4), + dark: darken(colors.blueBlueWave, 0.2), }, secondary: { main: colors.gray700, light: colors.lightBlueWave, dark: lighten(colors.gray700, 0.1), - contrastText: colors.gray200, - }, - tertiary: { - main: colors.blueGray800, - contrastText: colors.gray100, }, + // Tertiary is a custom helper palette success: { main: colors.green100, contrastText: colors.offBlack, - lowContrast: colors.green200, + light: lighten(colors.green100, 0.25), + dark: darken(colors.green100, 0.15), }, warning: { main: colors.orange200, contrastText: colors.offBlack, - lowContrast: colors.orange600, + light: lighten(colors.orange200, 0.25), + dark: darken(colors.orange200, 0.15), }, error: { main: colors.red100, contrastText: colors.offBlack, - lowContrast: colors.red600, + light: lighten(colors.red100, 0.25), + dark: darken(colors.red100, 0.15), }, }; diff --git a/client/src/theme/theme.ts b/client/src/theme/theme.ts index 3b081a048..b6a57067c 100644 --- a/client/src/theme/theme.ts +++ b/client/src/theme/theme.ts @@ -1,6 +1,5 @@ import { createTheme } from "@mui/material"; -// import { lightPalette, darkPalette, typographyLevels } from "./palette"; -import { lightPalette, darkPalette, typographyLevels } from "./new_palette"; +import { lightPalette, darkPalette, typographyLevels } from "./palette"; import type { Theme } from "@mui/material/styles"; @@ -35,23 +34,18 @@ export const theme = (mode: string, palette: any) => fontSize: typographyLevels.base, h1: { fontSize: typographyLevels.xl, - color: palette.primary.contrastText, fontWeight: 500, }, h2: { fontSize: typographyLevels.l, - color: palette.primary.contrastTextSecondary, fontWeight: 400, }, - body1: { fontSize: typographyLevels.m, - color: palette.primary.contrastTextTertiary, fontWeight: 400, }, body2: { fontSize: typographyLevels.s, - color: palette.primary.contrastTextTertiary, fontWeight: 400, }, }, @@ -87,7 +81,7 @@ export const theme = (mode: string, palette: any) => styleOverrides: { root: { "&.Mui-focused .MuiOutlinedInput-notchedOutline": { - borderColor: palette.accent.main, + borderColor: palette.primary.main, }, }, }, @@ -101,10 +95,10 @@ export const theme = (mode: string, palette: any) => padding: 0, border: 1, borderStyle: "solid", - borderColor: theme.palette.primary.lowContrast, + borderColor: theme.palette.divider, borderRadius: 4, boxShadow: shadow, - backgroundColor: theme.palette.primary.main, + backgroundColor: theme.palette.background.paper, backgroundImage: "none", }; }, diff --git a/client/src/types/mui.d.ts b/client/src/types/mui.d.ts index 9f6f9fb65..6bcdfdbc8 100644 --- a/client/src/types/mui.d.ts +++ b/client/src/types/mui.d.ts @@ -1,31 +1,11 @@ import "@mui/material/Button"; -declare module "@mui/material/styles" { - interface Palette { - accent: Palette["primary"]; - tertiary: Palette["primary"]; - } - interface PaletteOptions { - accent?: PaletteOptions["primary"]; - tertiary?: PaletteOptions["primary"]; - } - - interface PaletteColor { - contrastTextSecondary?: string; - contrastTextTertiary?: string; - lowContrast?: string; - veryLowContrast?: string; - } -} +declare module "@mui/material/styles" {} declare module "@mui/material/Button" { - interface ButtonPropsColorOverrides { - accent: true; - } + interface ButtonPropsColorOverrides {} } declare module "@mui/material/CircularProgress" { - interface CircularProgressPropsColorOverrides { - accent: true; - } + interface CircularProgressPropsColorOverrides {} } diff --git a/client/src/utils/DataUtils.ts b/client/src/utils/DataUtils.ts index ebea3d506..96c4d5bb1 100644 --- a/client/src/utils/DataUtils.ts +++ b/client/src/utils/DataUtils.ts @@ -41,7 +41,7 @@ export const normalizeResponseTimes = < }; // Interpolate color between three theme colors over 0-100 range. -// 0-50 => start (success.lowContrast), 50-75 => mid (warning.lowContrast), 75-100 => end (error.lowContrast) +// 0-50 => start (success.light), 50-75 => mid (warning.light), 75-100 => end (error.light) export const getResponseColor = ( ms: number, colors: { diff --git a/client/src/utils/MonitorUtils.ts b/client/src/utils/MonitorUtils.ts index 46468e7a9..de31b8b41 100644 --- a/client/src/utils/MonitorUtils.ts +++ b/client/src/utils/MonitorUtils.ts @@ -36,10 +36,10 @@ export const getValuePalette = (value: ValueType): PaletteKey => { export const getStatusColor = (status: MonitorStatus, theme: any): string => { const statusColors: Record = { - up: theme.palette.success.lowContrast, - down: theme.palette.error.lowContrast, - paused: theme.palette.warning.lowContrast, - initializing: theme.palette.warning.lowContrast, + up: theme.palette.success.light, + down: theme.palette.error.light, + paused: theme.palette.warning.light, + initializing: theme.palette.warning.light, }; return statusColors[status]; }; @@ -58,9 +58,9 @@ export const getInfraGaugeColor = (val: number, theme: any) => { if (val < 50) { return theme.palette.success.main; } else if (val < 80) { - return theme.palette.warning.lowContrast; + return theme.palette.warning.light; } else { - return theme.palette.error.lowContrast; + return theme.palette.error.light; } };