normalize NoticeBanner
This commit is contained in:
1 parent
fef3f2c294
commit
5792ca624e
5 files changed
+25
-24
No files matched your search
@@ -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>
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in new issue
Block a user