theme constants

This commit is contained in:
Alex Holliday committed 2026-02-28 16:16:14 +00:00
1 parent a719364e40
commit 4aabc16096
6 files changed
+35 -13

No files matched your search

+1
View File
@@ -7,3 +7,4 @@ node_modules/
docs/architecture docs/architecture
docs/reviews docs/reviews
docs/todo docs/todo
docs/frontend
@@ -2,6 +2,7 @@ import { BaseBox } from ".";
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { LAYOUT } from "@/Utils/Theme/constants";
import type { ResponsiveStyleValue } from "@mui/system"; import type { ResponsiveStyleValue } from "@mui/system";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
@@ -26,7 +27,7 @@ export const BaseChart = ({
return ( return (
<BaseBox <BaseBox
sx={{ sx={{
padding: padding ?? theme.spacing(8), padding: padding ?? theme.spacing(LAYOUT.MD),
display: "flex", display: "flex",
flex: 1, flex: 1,
width: width, width: width,
@@ -34,13 +35,13 @@ export const BaseChart = ({
}} }}
> >
<Stack <Stack
gap={theme.spacing(8)} gap={theme.spacing(LAYOUT.MD)}
flex={1} flex={1}
> >
<Stack <Stack
direction="row" direction="row"
alignItems={"center"} alignItems={"center"}
gap={theme.spacing(4)} gap={theme.spacing(LAYOUT.XS)}
> >
{icon && ( {icon && (
<BaseBox <BaseBox
@@ -3,6 +3,7 @@ import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Alert from "@mui/material/Alert"; import Alert from "@mui/material/Alert";
import Link from "@mui/material/Link"; import Link from "@mui/material/Link";
import { LAYOUT, SPACING } from "@/Utils/Theme/constants";
import { import {
ErrorFallback, ErrorFallback,
EmptyFallback, EmptyFallback,
@@ -91,7 +92,7 @@ export const BasePage = ({
return ( return (
<Stack <Stack
spacing={theme.spacing(10)} spacing={theme.spacing(LAYOUT.LG)}
{...props} {...props}
> >
<Breadcrumb breadcrumbOverride={breadcrumbOverride} /> <Breadcrumb breadcrumbOverride={breadcrumbOverride} />
@@ -220,7 +221,7 @@ export const BaseAuthPage = ({
return ( return (
<BasePage <BasePage
breadcrumbOverride={[]} breadcrumbOverride={[]}
gap={theme.spacing(8)} gap={theme.spacing(LAYOUT.MD)}
alignItems={"center"} alignItems={"center"}
justifyContent={"center"} justifyContent={"center"}
minHeight="100vh" minHeight="100vh"
@@ -229,7 +230,7 @@ export const BaseAuthPage = ({
> >
<HeaderAuthControls <HeaderAuthControls
hideLogo hideLogo
py={theme.spacing(4)} py={theme.spacing(LAYOUT.XS)}
position={"absolute"} position={"absolute"}
top={0} top={0}
left={0} left={0}
@@ -243,14 +244,14 @@ export const BaseAuthPage = ({
<Stack alignItems={"center"}> <Stack alignItems={"center"}>
<Typography <Typography
variant="h1" variant="h1"
mb={theme.spacing(2)} mb={theme.spacing(SPACING.LG)}
> >
{title} {title}
</Typography> </Typography>
<Typography variant="h2">{subtitle}</Typography> <Typography variant="h2">{subtitle}</Typography>
</Stack> </Stack>
<Stack <Stack
gap={theme.spacing(8)} gap={theme.spacing(LAYOUT.MD)}
width={{ width={{
xs: "80%", xs: "80%",
md: "25%", md: "25%",
@@ -2,6 +2,7 @@ import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { Check } from "lucide-react"; import { Check } from "lucide-react";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import { LAYOUT } from "@/Utils/Theme/constants";
export const BulletPointCheck = ({ export const BulletPointCheck = ({
text, text,
@@ -21,7 +22,7 @@ export const BulletPointCheck = ({
return ( return (
<Stack <Stack
direction="row" direction="row"
gap={theme.spacing(6)} gap={theme.spacing(LAYOUT.SM)}
alignItems="center" alignItems="center"
> >
<Check <Check
@@ -3,6 +3,7 @@ import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery"; import useMediaQuery from "@mui/material/useMediaQuery";
import { LAYOUT } from "@/Utils/Theme/constants";
export const SplitBox = ({ export const SplitBox = ({
left, left,
right, right,
@@ -18,10 +19,10 @@ export const SplitBox = ({
bgcolor={theme.palette.background.paper} bgcolor={theme.palette.background.paper}
border={1} border={1}
borderColor={theme.palette.divider} borderColor={theme.palette.divider}
borderRadius={theme.spacing(2)} borderRadius={theme.shape.borderRadius}
> >
<Box <Box
padding={theme.spacing(15)} padding={theme.spacing(LAYOUT.XXL)}
borderRight={isSmall ? 0 : 1} borderRight={isSmall ? 0 : 1}
borderBottom={isSmall ? 1 : 0} borderBottom={isSmall ? 1 : 0}
borderColor={theme.palette.divider} borderColor={theme.palette.divider}
@@ -37,7 +38,7 @@ export const SplitBox = ({
</Box> </Box>
<Box <Box
flex={1} flex={1}
padding={theme.spacing(15)} padding={theme.spacing(LAYOUT.XXL)}
> >
{right} {right}
</Box> </Box>
@@ -60,7 +61,7 @@ export const ConfigBox = ({
return ( return (
<SplitBox <SplitBox
left={ left={
<Stack spacing={theme.spacing(4)}> <Stack spacing={theme.spacing(LAYOUT.XS)}>
<Typography <Typography
textTransform={"capitalize"} textTransform={"capitalize"}
component="h2" component="h2"
+17
View File
@@ -0,0 +1,17 @@
export const SPACING = {
XS: 0.5,
SM: 1,
MD: 1.5,
LG: 2,
XL: 2.5,
XXL: 3,
} as const;
export const LAYOUT = {
XS: 4,
SM: 6,
MD: 8,
LG: 10,
XL: 12,
XXL: 16,
} as const;