Merge branch 'develop' into feat/incidents-page-polish

This commit is contained in:
Alex Holliday committed 2026-04-29 09:51:06 -07:00
commit 29bb1615f5
12 files changed
+103 -63

No files matched your search

@@ -38,9 +38,9 @@ export const PageSpeedKeyPriorityFallback = () => {
<Link <Link
component={RouterLink} component={RouterLink}
to="/settings" to="/settings"
color={theme.palette.primary.main}
fontWeight={600}
sx={{ sx={{
color: theme.palette.primary.main,
fontWeight: 600,
textDecoration: "underline", textDecoration: "underline",
}} }}
/> />
@@ -17,7 +17,7 @@ export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => {
return ( return (
<Stack> <Stack>
<Typography <Typography
fontSize={typographyLevels.xl} fontSize={typographyLevels.xxl}
fontWeight={500} fontWeight={500}
overflow={"hidden"} overflow={"hidden"}
textOverflow={"ellipsis"} textOverflow={"ellipsis"}
@@ -3,8 +3,10 @@ import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { useTheme, alpha } from "@mui/material/styles"; import { useTheme, alpha } from "@mui/material/styles";
import { LAYOUT } from "@/Utils/Theme/constants"; import { LAYOUT } from "@/Utils/Theme/constants";
import { typographyLevels } from "@/Utils/Theme/Palette";
type Severity = "info" | "warning" | "error"; export const Severities = ["info", "warning", "error"] as const;
export type Severity = (typeof Severities)[number];
const SEVERITY_GLYPH: Record<Severity, string> = { const SEVERITY_GLYPH: Record<Severity, string> = {
info: "ⓘ", info: "ⓘ",
@@ -25,29 +27,26 @@ export const NoticeBanner = ({ severity = "info", children }: NoticeBannerProps)
direction="row" direction="row"
alignItems="flex-start" alignItems="flex-start"
gap={theme.spacing(LAYOUT.SM)} gap={theme.spacing(LAYOUT.SM)}
sx={{ width={"100%"}
width: "100%", p={theme.spacing(LAYOUT.MD)}
p: theme.spacing(LAYOUT.MD), borderRadius={theme.shape.borderRadius}
borderRadius: 1, border={`1px solid ${alpha(tone, 0.45)}`}
border: `1px solid ${alpha(tone, 0.45)}`, bgcolor={alpha(tone, 0.08)}
backgroundColor: alpha(tone, 0.08), textAlign={"left"}
textAlign: "left",
}}
> >
<Box <Box
component="span" component="span"
sx={{ color={tone}
color: tone, fontSize={typographyLevels.xl}
fontSize: 18, lineHeight={1}
lineHeight: 1, mt={LAYOUT.XXS}
mt: "2px",
}}
aria-hidden aria-hidden
> >
{SEVERITY_GLYPH[severity]} {SEVERITY_GLYPH[severity]}
</Box> </Box>
<Typography <Typography
sx={{ color: theme.palette.text.primary, lineHeight: 1.55, fontSize: 13 }} color={theme.palette.text.primary}
lineHeight={1.55}
> >
{children} {children}
</Typography> </Typography>
+31 -9
View File
@@ -1,19 +1,43 @@
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import type { ButtonProps } from "@mui/material/Button"; import type { ButtonProps } from "@mui/material/Button";
import { useTheme } from "@mui/material/styles"; import { useTheme, darken } from "@mui/material/styles";
import { HOVER } from "@/Utils/Theme/constants";
const PALETTE_COLORS = [
"primary",
"secondary",
"error",
"warning",
"info",
"success",
] as const;
type PaletteColor = (typeof PALETTE_COLORS)[number];
export const ButtonInput = ({ sx, ...props }: ButtonProps) => { export const ButtonInput = ({ sx, ...props }: ButtonProps) => {
const theme = useTheme(); const theme = useTheme();
const outlinedSx =
const hoverOverrides: Record<string, unknown> = { boxShadow: "none" };
if (props.variant === "outlined") {
hoverOverrides.borderColor = theme.palette.text.secondary;
}
if (props.variant === "contained") {
const colorKey = (props.color ?? "primary") as PaletteColor;
const palette = theme.palette[colorKey];
if (palette && typeof palette === "object" && "main" in palette) {
hoverOverrides.backgroundColor = darken(palette.main, HOVER.DARKEN);
}
}
const variantSx =
props.variant === "outlined" props.variant === "outlined"
? { ? {
color: theme.palette.text.primary, color: theme.palette.text.primary,
borderColor: theme.palette.divider, borderColor: theme.palette.divider,
"&:hover": {
borderColor: theme.palette.text.secondary,
},
} }
: {}; : {};
return ( return (
<Button <Button
{...props} {...props}
@@ -26,10 +50,8 @@ export const ButtonInput = ({ sx, ...props }: ButtonProps) => {
textOverflow: "ellipsis", textOverflow: "ellipsis",
overflow: "hidden", overflow: "hidden",
boxShadow: "none", boxShadow: "none",
"&:hover": { "&:hover": hoverOverrides,
boxShadow: "none", ...variantSx,
},
...outlinedSx,
...sx, ...sx,
}} }}
/> />
+9 -9
View File
@@ -53,24 +53,24 @@ export const DialogInput = ({
> >
{title && ( {title && (
<DialogTitle <DialogTitle
sx={{ pb={theme.spacing(LAYOUT.XS)}
pb: theme.spacing(LAYOUT.XS), bgcolor={theme.palette.action.hover}
backgroundColor: theme.palette.action.hover, borderBottom={`1px solid ${theme.palette.divider}`}
borderBottom: `1px solid ${theme.palette.divider}`,
}}
> >
<Typography <Typography
component="span" component="span"
variant="h2" variant="h2"
sx={{ fontWeight: 600, display: "block" }} fontWeight={600}
display={"block"}
> >
{title} {title}
</Typography> </Typography>
{content && ( {content && (
<Typography <Typography
variant="body1" variant="body1"
color="text.secondary" color={theme.palette.text.secondary}
sx={{ mt: theme.spacing(LAYOUT.XS), display: "block" }} mt={theme.spacing(LAYOUT.XS)}
display={"block"}
> >
{content} {content}
</Typography> </Typography>
@@ -79,7 +79,7 @@ export const DialogInput = ({
)} )}
{children && ( {children && (
<DialogContent sx={{ pt: theme.spacing(LAYOUT.MD) }}> <DialogContent sx={{ pt: theme.spacing(LAYOUT.MD) }}>
<Box sx={{ pt: theme.spacing(LAYOUT.XS) }}>{children}</Box> <Box pt={theme.spacing(LAYOUT.XS)}>{children}</Box>
</DialogContent> </DialogContent>
)} )}
<DialogActions <DialogActions
+1 -1
View File
@@ -15,9 +15,9 @@ export const FieldLabel = ({ children, required = false, htmlFor }: FieldLabelPr
return ( return (
<Typography <Typography
component="label" component="label"
variant="body1"
htmlFor={htmlFor} htmlFor={htmlFor}
sx={{ sx={{
fontSize: "14px",
fontWeight: 500, fontWeight: 500,
color: theme.palette.text.secondary, color: theme.palette.text.secondary,
marginBottom: theme.spacing(2), marginBottom: theme.spacing(2),
+15 -8
View File
@@ -5,6 +5,7 @@ import { typographyLevels } from "@/Utils/Theme/Palette";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import { FieldLabel } from "./FieldLabel"; import { FieldLabel } from "./FieldLabel";
import { LAYOUT } from "@/Utils/Theme/constants";
interface TextInputProps extends Omit<TextFieldProps, "label"> { interface TextInputProps extends Omit<TextFieldProps, "label"> {
fieldLabel?: string; fieldLabel?: string;
@@ -12,16 +13,13 @@ interface TextInputProps extends Omit<TextFieldProps, "label"> {
} }
export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function TextInput( export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function TextInput(
{ fieldLabel, required, ...props }, { fieldLabel, required, sx, ...props },
ref ref
) { ) {
const theme = useTheme(); const theme = useTheme();
const input = ( const innerSx = {
<TextField width: "100%",
{...props}
inputRef={ref}
sx={{
"& .MuiOutlinedInput-root": { "& .MuiOutlinedInput-root": {
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
height: 34, height: 34,
@@ -46,13 +44,22 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(function T
caretColor: theme.palette.text.primary, caretColor: theme.palette.text.primary,
transition: "background-color 5000s ease-in-out 0s", transition: "background-color 5000s ease-in-out 0s",
}, },
}} };
const input = (
<TextField
{...props}
inputRef={ref}
sx={fieldLabel ? innerSx : { ...innerSx, ...sx }}
/> />
); );
if (fieldLabel) { if (fieldLabel) {
return ( return (
<Stack spacing={theme.spacing(2)}> <Stack
spacing={theme.spacing(LAYOUT.XXS)}
sx={sx}
>
<FieldLabel required={required}>{fieldLabel}</FieldLabel> <FieldLabel required={required}>{fieldLabel}</FieldLabel>
{input} {input}
</Stack> </Stack>
@@ -9,6 +9,7 @@ import { useAddTeamMemberForm } from "@/Hooks/useAddTeamMemberForm";
import type { AddTeamMemberFormData } from "@/Validation/addTeamMember"; import type { AddTeamMemberFormData } from "@/Validation/addTeamMember";
import type { UserRole, User } from "@/Types/User"; import type { UserRole, User } from "@/Types/User";
import { usePost } from "@/Hooks/UseApi"; import { usePost } from "@/Hooks/UseApi";
import { LAYOUT } from "@/Utils/Theme/constants";
interface AddTeamMemberDialogProps { interface AddTeamMemberDialogProps {
open: boolean; open: boolean;
@@ -82,9 +83,10 @@ export const AddTeamMemberDialog = ({
maxWidth="sm" maxWidth="sm"
fullWidth fullWidth
> >
<Stack gap={theme.spacing(LAYOUT.XS)}>
<Stack <Stack
gap={theme.spacing(4)} direction="row"
mt={theme.spacing(4)} gap={theme.spacing(LAYOUT.XS)}
> >
<Controller <Controller
name="firstName" name="firstName"
@@ -96,7 +98,7 @@ export const AddTeamMemberDialog = ({
placeholder={t("common.form.name.option.firstName.placeholder")} placeholder={t("common.form.name.option.firstName.placeholder")}
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={fieldState.error?.message ?? ""}
fullWidth sx={{ flex: 1 }}
/> />
)} )}
/> />
@@ -110,10 +112,11 @@ export const AddTeamMemberDialog = ({
placeholder={t("common.form.name.option.lastName.placeholder")} placeholder={t("common.form.name.option.lastName.placeholder")}
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={fieldState.error?.message ?? ""}
fullWidth sx={{ flex: 1 }}
/> />
)} )}
/> />
</Stack>
<Controller <Controller
name="email" name="email"
control={control} control={control}
@@ -151,6 +154,10 @@ export const AddTeamMemberDialog = ({
</Select> </Select>
)} )}
/> />
<Stack
direction="row"
gap={theme.spacing(LAYOUT.XS)}
>
<Controller <Controller
name="password" name="password"
control={control} control={control}
@@ -162,7 +169,7 @@ export const AddTeamMemberDialog = ({
type="password" type="password"
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={fieldState.error?.message ?? ""}
fullWidth sx={{ flex: 1 }}
/> />
)} )}
/> />
@@ -177,11 +184,12 @@ export const AddTeamMemberDialog = ({
type="password" type="password"
error={!!fieldState.error} error={!!fieldState.error}
helperText={fieldState.error?.message ?? ""} helperText={fieldState.error?.message ?? ""}
fullWidth sx={{ flex: 1 }}
/> />
)} )}
/> />
</Stack> </Stack>
</Stack>
</Dialog> </Dialog>
); );
}; };
@@ -9,6 +9,7 @@ import type { UserRole } from "@/Types/User";
import { useInviteForm } from "@/Hooks/useInviteForm"; import { useInviteForm } from "@/Hooks/useInviteForm";
import type { InviteFormData } from "@/Validation/invite"; import type { InviteFormData } from "@/Validation/invite";
import { usePost } from "@/Hooks/UseApi"; import { usePost } from "@/Hooks/UseApi";
import { LAYOUT } from "@/Utils/Theme/constants";
const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST; const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST;
@@ -95,10 +96,7 @@ export const InviteTeamMemberDialog = ({
</Button> </Button>
} }
> >
<Stack <Stack gap={theme.spacing(LAYOUT.XS)}>
gap={theme.spacing(4)}
mt={theme.spacing(4)}
>
<Controller <Controller
name="email" name="email"
control={control} control={control}
+7 -6
View File
@@ -1,12 +1,13 @@
const typographyBase = 13; const typographyBase = 13;
export const typographyLevels = { export const typographyLevels = {
base: typographyBase, base: typographyBase, // 13px
xs: `${(typographyBase - 4) / 16}rem`, xs: `${(typographyBase - 4) / 16}rem`, // 9px
s: `${(typographyBase - 2) / 16}rem`, s: `${(typographyBase - 2) / 16}rem`, // 11px
m: `${typographyBase / 16}rem`, m: `${typographyBase / 16}rem`, // 13px
l: `${(typographyBase + 2) / 16}rem`, l: `${(typographyBase + 2) / 16}rem`, // 15px
xl: `${(typographyBase + 10) / 16}rem`, xl: `${(typographyBase + 5) / 16}rem`, // 18px
xxl: `${(typographyBase + 10) / 16}rem`, // 23px
}; };
export const colors = { export const colors = {
+1 -1
View File
@@ -58,7 +58,7 @@ export const theme = (mode: string, palette: any) =>
fontFamilyMonospace, fontFamilyMonospace,
fontSize: typographyLevels.base, fontSize: typographyLevels.base,
h1: { h1: {
fontSize: typographyLevels.xl, fontSize: typographyLevels.xxl,
fontWeight: 500, fontWeight: 500,
}, },
h2: { h2: {
+5
View File
@@ -8,6 +8,7 @@ export const SPACING = {
} as const; } as const;
export const LAYOUT = { export const LAYOUT = {
XXS: 2,
XS: 4, XS: 4,
SM: 6, SM: 6,
MD: 8, MD: 8,
@@ -15,3 +16,7 @@ export const LAYOUT = {
XL: 12, XL: 12,
XXL: 16, XXL: 16,
} as const; } as const;
export const HOVER = {
DARKEN: 0.06, // This is a coefficient for darkening function
} as const;