refactor(status-page): convert bold, modern and editorial themes to MUI sx

Finishes the migration started for refined. Each theme now consumes the same pattern:

- A typed *Styles interface that names every entry the page consumes (no `as Function` casts at the call site)
- A *Styles factory that takes (tokens, isDark) and returns sx recipes derived from existing tokens.ts plus the shared toneColor/toneSoft helpers in shared/overallStatus
- A useMemo around the factory call so MUI's sx processor sees referential equality across renders that don't change tokens
- modern.css's keyframes (pulse + staggered fade-in + reduced-motion guard) ported via @mui/system keyframes inside the modern styles factory
- bold.css's hero glow + conic logo + pseudo-elements ported as inline sx via "&::before" / "& > *" selectors
- editorial.css's serif typography + hairline dividers + flat rectangular badges ported as plain sx with the serif/sans family stacks named at module scope

Drop the four .css files (~1789 lines) along with the className= attributes and the import "./*.css" lines in each StatusPage component.

The shared themed components (ThemedHeatmap, ThemedHistogram, ThemedInfrastructure) lose their legacy classPrefix branch entirely now that no theme uses it. The dual-API gate is gone; there is one path.

Verified: tsc --noEmit clean, prettier clean.

Note: theme-overrides.css remains for the legacy non-themed status page components (StatusBar, MonitorsList, HeaderStatusPageControls). That's separate scope from the four-theme work the reviewer flagged; can be migrated in a follow-up.
This commit is contained in:
gorkem-bwl committed 2026-04-27 18:39:42 -04:00
1 parent b95d8886b9
commit c6c50063d8
12 files changed
+1442 -1616

No files matched your search

@@ -1,4 +1,4 @@
import { useState } from "react";
import { useMemo, useState } from "react";
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import { useTranslation } from "react-i18next";
@@ -14,7 +14,8 @@ import {
resolveOverallStatus,
statusBadgeKey,
} from "../shared/overallStatus";
import "./bold.css";
import { useStatusPageTheme } from "../StatusPageThemeProvider";
import { boldStyles } from "./styles";
type StatusPageMonitor = Monitor & { checks?: Monitor["recentChecks"] };
@@ -23,85 +24,99 @@ interface Props {
monitors: StatusPageMonitor[];
}
const PREFIX = "bo";
export const BoldStatusPage = ({ statusPage, monitors }: Props) => {
const { t } = useTranslation();
const { tokens, mode } = useStatusPageTheme();
const styles = useMemo(() => boldStyles(tokens, mode === "dark"), [tokens, mode]);
const [chartMode, setChartMode] = useState<"heatmap" | "histogram">("heatmap");
// Bold uses a dedicated check-disc treatment next to the title; its
// icon is scaled differently but the semantic resolution is shared.
const overall = resolveOverallStatus(monitors, t, { iconSize: 18 });
const logoSrc = statusPage.logo?.data
? `data:${statusPage.logo.contentType};base64,${statusPage.logo.data}`
: null;
return (
<Box className={`${PREFIX}-page`}>
<Box sx={styles.page}>
<Box
component="header"
className={`${PREFIX}-top`}
sx={styles.top}
>
<Box className={`${PREFIX}-brand`}>
<Box sx={styles.brand}>
{logoSrc ? (
<Box
component="img"
src={logoSrc}
alt={statusPage.companyName}
className={`${PREFIX}-logo-img`}
sx={styles.logoImg}
/>
) : (
<Box className={`${PREFIX}-logo-conic`}>
{monoFirstChar(statusPage.companyName)}
</Box>
<Box sx={styles.logoConic}>{monoFirstChar(statusPage.companyName)}</Box>
)}
<span className={`${PREFIX}-company`}>{statusPage.companyName}</span>
<Box
component="span"
sx={styles.company}
>
{statusPage.companyName}
</Box>
</Box>
</Box>
<Box className={`${PREFIX}-hero ${PREFIX}-tone-${overall.tone}`}>
<h1 className={`${PREFIX}-hero-title`}>
<span className={`${PREFIX}-hero-check`}>{overall.icon}</span>
<Box sx={styles.hero}>
<Box
component="h1"
sx={styles.heroTitle}
>
<Box
component="span"
sx={styles.heroCheck(overall.tone)}
>
{overall.icon}
</Box>
{overall.message}
</h1>
<p className={`${PREFIX}-hero-sub`}>
</Box>
<Box
component="p"
sx={styles.heroSub}
>
{t("pages.statusPages.statusBar.monitoringSummary", {
count: monitors.length,
})}
</p>
</Box>
</Box>
{statusPage.showCharts && (
<Box className={`${PREFIX}-chart-switch-wrap`}>
<Box sx={styles.chartSwitchWrap}>
<Box
className={`${PREFIX}-chart-switch`}
sx={styles.chartSwitch}
role="radiogroup"
>
<button
<Box
component="button"
type="button"
role="radio"
aria-checked={chartMode === "heatmap"}
className={chartMode === "heatmap" ? `${PREFIX}-active` : ""}
onClick={() => setChartMode("heatmap")}
sx={styles.chartSwitchButton(chartMode === "heatmap")}
>
{t("pages.statusPages.monitorsList.chartTypeHeatmap")}
</button>
<button
</Box>
<Box
component="button"
type="button"
role="radio"
aria-checked={chartMode === "histogram"}
className={chartMode === "histogram" ? `${PREFIX}-active` : ""}
onClick={() => setChartMode("histogram")}
sx={styles.chartSwitchButton(chartMode === "histogram")}
>
{t("pages.statusPages.monitorsList.chartTypeHistogram")}
</button>
</Box>
</Box>
</Box>
)}
<Stack
component="ul"
className={`${PREFIX}-monitor-list`}
sx={styles.monitorList}
>
{monitors.map((monitor) => {
const isHardware = monitor.type === "hardware";
@@ -113,48 +128,65 @@ export const BoldStatusPage = ({ statusPage, monitors }: Props) => {
<Box
component="li"
key={monitor.id}
className={`${PREFIX}-card ${PREFIX}-card-${monitor.status}`}
sx={styles.card}
>
<Box className={`${PREFIX}-card-row`}>
<Box className={`${PREFIX}-card-left`}>
<Box className={`${PREFIX}-monitor-name`}>{monitor.name}</Box>
<Box className={`${PREFIX}-monitor-meta`}>
<span
className={`${PREFIX}-pill ${PREFIX}-pill-${isHardware ? "hardware" : "default"}`}
<Box sx={styles.cardRow}>
<Box sx={styles.cardLeft}>
<Box sx={styles.monitorName}>{monitor.name}</Box>
<Box sx={styles.monitorMeta}>
<Box
component="span"
sx={isHardware ? styles.pillHardware : styles.pill}
>
{getMonitorTypeLabel(monitor.type, t)}
</span>
</Box>
{monitor.url && (
<span
className={`${PREFIX}-monitor-url`}
<Box
component="span"
sx={styles.monitorUrl}
title={monitor.url}
>
{monitor.url}
</span>
</Box>
)}
</Box>
</Box>
<span className={`${PREFIX}-badge ${PREFIX}-badge-${badgeTone}`}>
<Box
component="span"
sx={styles.badge(badgeTone)}
>
{t(statusBadgeKey[monitor.status])}
</span>
</Box>
</Box>
{showInfra && (
<ThemedInfrastructure
monitor={monitor}
classPrefix={PREFIX}
sxApi={{
containerSx: styles.infra,
emptySx: styles.infraEmpty,
gaugeSx: styles.gauge,
gaugeLabelSx: styles.gaugeLabel,
gaugeValueSx: styles.gaugeValue,
gaugeBarSx: styles.gaugeBar,
gaugeFillSx: styles.gaugeFill,
gaugeSubSx: styles.gaugeSub,
}}
/>
)}
{showChart &&
(chartMode === "heatmap" ? (
<ThemedHeatmap
checks={monitor.recentChecks ?? []}
classPrefix={PREFIX}
containerSx={styles.heatmap}
cellSx={styles.heatmapCell}
/>
) : (
<ThemedHistogram
checks={monitor.recentChecks ?? []}
classPrefix={PREFIX}
containerSx={styles.histogram}
barSx={styles.bar}
statsSx={styles.chartStats}
/>
))}
</Box>
@@ -164,7 +196,7 @@ export const BoldStatusPage = ({ statusPage, monitors }: Props) => {
<Box
component="footer"
className={`${PREFIX}-footer`}
sx={styles.footer}
>
{t("pages.statusPages.footer.poweredBy")}{" "}
<a
@@ -1,497 +0,0 @@
/*
* Bold theme — scoped to [data-status-theme="bold"].
* Port of /Users/gorkemcetin/Desktop/checkmate-status-mockups/03-bold-dark.html.
* Signature traits: conic-gradient logo, dual-radial-glow body, large
* 34px hero title with a check-disc inline, glowing chart cells/bars,
* 18px-radius cards with staggered fade-in and accent-green hover.
*/
[data-status-theme="bold"]:not([data-status-transparent]) {
display: flex;
flex-direction: column;
min-height: 100vh;
background:
radial-gradient(
900px 500px at 15% -10%,
color-mix(in srgb, var(--sp-up) 4%, transparent),
transparent 60%
),
radial-gradient(
900px 500px at 95% 10%,
color-mix(in srgb, var(--sp-up-strong) 3%, transparent),
transparent 60%
),
var(--sp-bg);
}
[data-status-theme="bold"][data-status-mode="dark"]:not([data-status-transparent]) {
background:
radial-gradient(
900px 500px at 15% -10%,
color-mix(in srgb, var(--sp-up) 8%, transparent),
transparent 60%
),
radial-gradient(
900px 500px at 95% 10%,
color-mix(in srgb, var(--sp-up-strong) 9%, transparent),
transparent 60%
),
var(--sp-bg);
}
[data-status-theme="bold"] .bo-page {
flex: 1 0 auto;
max-width: 1040px;
width: 100%;
margin: 0 auto;
padding: 56px 24px 96px;
font:
14px/1.55 ui-sans-serif,
-apple-system,
BlinkMacSystemFont,
"Inter",
"Segoe UI",
Roboto,
sans-serif;
color: var(--sp-text);
-webkit-font-smoothing: antialiased;
}
/* --- header / conic logo --- */
[data-status-theme="bold"] .bo-top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 36px;
}
[data-status-theme="bold"] .bo-brand {
display: flex;
align-items: center;
gap: 14px;
font-weight: 700;
font-size: 16px;
letter-spacing: -0.01em;
color: var(--sp-text);
}
[data-status-theme="bold"] .bo-logo-conic {
width: 36px;
height: 36px;
border-radius: 12px;
background: conic-gradient(
from 140deg,
var(--sp-up),
var(--sp-up-strong),
#0f766e,
var(--sp-up)
);
display: grid;
place-items: center;
color: #05070a;
font-weight: 900;
font-size: 14px;
box-shadow:
0 8px 24px color-mix(in srgb, var(--sp-up) 30%, transparent),
inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
[data-status-theme="bold"] .bo-logo-img {
max-height: 36px;
max-width: 140px;
object-fit: contain;
}
/* --- hero: gradient overlay + dual radial glow + big title with check disc --- */
[data-status-theme="bold"] .bo-hero {
position: relative;
border-radius: 22px;
padding: 36px 36px 32px;
margin-bottom: 28px;
background:
linear-gradient(
135deg,
color-mix(in srgb, var(--sp-up) 8%, transparent),
transparent 60%
),
var(--sp-surface);
border: 1px solid var(--sp-border);
overflow: hidden;
}
[data-status-theme="bold"][data-status-mode="dark"] .bo-hero {
background:
linear-gradient(
135deg,
color-mix(in srgb, var(--sp-up) 16%, transparent),
transparent 60%
),
var(--sp-surface);
}
[data-status-theme="bold"] .bo-hero::before {
content: "";
position: absolute;
inset: 0;
background:
radial-gradient(
400px 200px at 20% 30%,
color-mix(in srgb, var(--sp-up) 14%, transparent),
transparent 60%
),
radial-gradient(
300px 200px at 90% 80%,
color-mix(in srgb, var(--sp-up-strong) 10%, transparent),
transparent 60%
);
pointer-events: none;
opacity: 0.8;
z-index: 0;
}
[data-status-theme="bold"][data-status-mode="dark"] .bo-hero::before {
background:
radial-gradient(
400px 200px at 20% 30%,
color-mix(in srgb, var(--sp-up) 32%, transparent),
transparent 60%
),
radial-gradient(
300px 200px at 90% 80%,
color-mix(in srgb, var(--sp-up-strong) 22%, transparent),
transparent 60%
);
mix-blend-mode: screen;
opacity: 0.8;
}
[data-status-theme="bold"] .bo-hero > * {
position: relative;
z-index: 1;
}
[data-status-theme="bold"] .bo-hero-title {
margin: 0;
font-size: 34px;
font-weight: 800;
letter-spacing: -0.02em;
line-height: 1.1;
color: var(--sp-text);
display: flex;
align-items: center;
gap: 10px;
}
[data-status-theme="bold"] .bo-hero-check {
display: inline-grid;
place-items: center;
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--sp-up);
color: #05070a;
flex-shrink: 0;
box-shadow: 0 0 0 6px var(--sp-up-soft);
}
[data-status-theme="bold"] .bo-hero.bo-tone-warn .bo-hero-check {
background: var(--sp-warn);
box-shadow: 0 0 0 6px var(--sp-warn-soft);
}
[data-status-theme="bold"] .bo-hero.bo-tone-down .bo-hero-check {
background: var(--sp-down);
color: #fff;
box-shadow: 0 0 0 6px var(--sp-down-soft);
}
[data-status-theme="bold"] .bo-hero-sub {
margin: 10px 0 0;
color: var(--sp-text-muted);
font-size: 14px;
}
/* --- chart toggle --- */
[data-status-theme="bold"] .bo-chart-switch-wrap {
display: flex;
justify-content: flex-end;
margin-bottom: 16px;
}
[data-status-theme="bold"] .bo-chart-switch {
display: inline-flex;
border: 1px solid var(--sp-border);
border-radius: 999px;
background: var(--sp-surface);
padding: 3px;
gap: 2px;
}
[data-status-theme="bold"] .bo-chart-switch > button {
border: 0;
background: transparent;
font: inherit;
font-size: 11px;
padding: 8px 18px;
cursor: pointer;
color: var(--sp-text-muted);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.12em;
transition:
background 0.2s,
color 0.2s;
border-radius: 999px;
}
[data-status-theme="bold"] .bo-chart-switch > button:hover {
color: var(--sp-text);
}
[data-status-theme="bold"] .bo-chart-switch > button.bo-active {
color: var(--sp-up);
background: var(--sp-up-soft);
}
/* --- cards: 18px radius, staggered fade-in, accent-green border on hover --- */
[data-status-theme="bold"] .bo-monitor-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 14px;
}
[data-status-theme="bold"] .bo-card {
background: var(--sp-surface);
border: 1px solid var(--sp-border);
border-radius: 18px;
overflow: hidden;
transition:
transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
border-color 0.2s;
}
[data-status-theme="bold"] .bo-card:hover {
transform: translateY(-3px);
border-color: color-mix(in srgb, var(--sp-up) 40%, var(--sp-border));
}
[data-status-theme="bold"] .bo-card-row {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
gap: 24px;
padding: 22px 28px;
}
[data-status-theme="bold"] .bo-card-left {
min-width: 0;
}
[data-status-theme="bold"] .bo-monitor-name {
font-weight: 700;
font-size: 17px;
letter-spacing: -0.01em;
color: var(--sp-text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-status-theme="bold"] .bo-monitor-meta {
display: flex;
gap: 10px;
align-items: center;
margin-top: 6px;
flex-wrap: wrap;
}
[data-status-theme="bold"] .bo-pill {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--sp-text-muted);
background: color-mix(in srgb, var(--sp-surface) 80%, var(--sp-bg));
border: 1px solid var(--sp-border);
padding: 3px 10px;
border-radius: 999px;
font-weight: 700;
}
[data-status-theme="bold"] .bo-pill-hardware {
color: var(--sp-up);
border-color: color-mix(in srgb, var(--sp-up) 40%, transparent);
background: var(--sp-up-soft);
}
[data-status-theme="bold"] .bo-monitor-url {
font-size: 12px;
color: var(--sp-text-muted);
font-family: ui-monospace, Menlo, monospace;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 300px;
}
/* --- badge: glowing dot --- */
[data-status-theme="bold"] .bo-badge {
font-size: 11px;
font-weight: 800;
padding: 6px 14px;
border-radius: 999px;
display: inline-flex;
align-items: center;
gap: 7px;
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: nowrap;
}
[data-status-theme="bold"] .bo-badge::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
box-shadow: 0 0 8px currentColor;
}
[data-status-theme="bold"] .bo-badge-up {
background: var(--sp-up-soft);
color: var(--sp-up);
}
[data-status-theme="bold"] .bo-badge-warn {
background: var(--sp-warn-soft);
color: var(--sp-warn);
}
[data-status-theme="bold"] .bo-badge-down {
background: var(--sp-down-soft);
color: var(--sp-down);
}
/* --- heatmap: glowing cells --- */
[data-status-theme="bold"] .bo-heatmap {
padding: 0 28px 22px;
display: grid;
grid-template-columns: repeat(25, 1fr);
gap: 3px;
height: 48px;
}
[data-status-theme="bold"] .bo-heatmap-cell {
border-radius: 3px;
background: var(--sp-up);
transition: transform 0.15s;
box-shadow: 0 0 6px color-mix(in srgb, var(--sp-up) 18%, transparent);
}
[data-status-theme="bold"] .bo-heatmap-cell:hover {
transform: scaleY(1.2);
}
[data-status-theme="bold"] .bo-heatmap-cell.bo-fast {
background: var(--sp-up);
}
[data-status-theme="bold"] .bo-heatmap-cell.bo-med {
background: color-mix(in srgb, var(--sp-up) 70%, #ffffff 30%);
}
[data-status-theme="bold"] .bo-heatmap-cell.bo-slow {
background: var(--sp-warn);
box-shadow: 0 0 6px color-mix(in srgb, var(--sp-warn) 20%, transparent);
}
[data-status-theme="bold"] .bo-heatmap-cell.bo-down {
background: var(--sp-down);
box-shadow: 0 0 6px color-mix(in srgb, var(--sp-down) 20%, transparent);
}
[data-status-theme="bold"] .bo-heatmap-cell.bo-empty {
background: var(--sp-border);
box-shadow: none;
opacity: 0.4;
}
/* --- histogram: glowing gradient bars --- */
[data-status-theme="bold"] .bo-histogram {
padding: 0 28px;
display: grid;
grid-template-columns: repeat(25, 1fr);
gap: 3px;
align-items: flex-end;
height: 48px;
}
[data-status-theme="bold"] .bo-bar {
background: var(--sp-up);
border-radius: 3px;
min-height: 4px;
}
[data-status-theme="bold"] .bo-bar.bo-down {
background: var(--sp-down);
}
[data-status-theme="bold"] .bo-bar.bo-empty {
background: var(--sp-border);
box-shadow: none;
opacity: 0.4;
}
[data-status-theme="bold"] .bo-chart-stats {
padding: 0 28px 22px;
font-size: 11px;
color: var(--sp-text-muted);
font-variant-numeric: tabular-nums;
font-weight: 700;
letter-spacing: 0.05em;
}
/* --- gauges: larger, bolder, 16px radius --- */
[data-status-theme="bold"] .bo-infra {
padding: 18px 28px 26px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 16px;
}
@media (max-width: 720px) {
[data-status-theme="bold"] .bo-infra {
grid-template-columns: 1fr;
}
}
[data-status-theme="bold"] .bo-infra-empty {
padding: 18px 28px 26px;
color: var(--sp-text-muted);
font-size: 13px;
}
[data-status-theme="bold"] .bo-gauge {
border: 1px solid var(--sp-border);
border-radius: 16px;
padding: 16px 18px;
background: color-mix(in srgb, var(--sp-surface) 80%, var(--sp-bg));
}
[data-status-theme="bold"] .bo-gauge-label {
font-size: 10px;
color: var(--sp-text-muted);
text-transform: uppercase;
letter-spacing: 0.12em;
font-weight: 700;
}
[data-status-theme="bold"] .bo-gauge-value {
font-size: 30px;
font-weight: 800;
letter-spacing: -0.02em;
margin-top: 6px;
font-variant-numeric: tabular-nums;
color: var(--sp-text);
}
[data-status-theme="bold"] .bo-gauge-bar {
height: 6px;
background: var(--sp-border);
border-radius: 3px;
overflow: hidden;
margin-top: 12px;
}
[data-status-theme="bold"] .bo-gauge-fill {
display: block;
height: 100%;
background: linear-gradient(
90deg,
var(--sp-up),
color-mix(in srgb, var(--sp-up) 70%, #ffffff 30%)
);
border-radius: 3px;
transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-status-theme="bold"] .bo-gauge-fill.bo-warm {
background: linear-gradient(90deg, var(--sp-warn), #fbbf24);
}
[data-status-theme="bold"] .bo-gauge-fill.bo-hot {
background: linear-gradient(90deg, var(--sp-down), #fb7185);
}
[data-status-theme="bold"] .bo-gauge-sub {
font-size: 11px;
color: var(--sp-text-muted);
margin-top: 10px;
font-variant-numeric: tabular-nums;
}
/* --- footer --- */
[data-status-theme="bold"] .bo-footer {
text-align: center;
color: var(--sp-text-muted);
font-size: 12px;
margin-top: 52px;
}
[data-status-theme="bold"] .bo-footer a {
color: var(--sp-up);
text-decoration: underline;
text-underline-offset: 3px;
font-weight: 800;
}
@@ -0,0 +1,408 @@
import type { SxProps, Theme } from "@mui/material/styles";
import type { StatusPageThemeTokens } from "../tokens";
import { type OverallTone, toneColor, toneSoft } from "../shared/overallStatus";
export type BoldHeatCell = "fast" | "med" | "slow" | "down" | "empty";
export type BoldBarKind = "up" | "down" | "empty";
export type BoldGaugeFill = "ok" | "warm" | "hot";
export interface BoldStyles {
page: SxProps<Theme>;
top: SxProps<Theme>;
brand: SxProps<Theme>;
logoConic: SxProps<Theme>;
logoImg: SxProps<Theme>;
company: SxProps<Theme>;
hero: SxProps<Theme>;
heroTitle: SxProps<Theme>;
heroCheck: (tone: OverallTone) => SxProps<Theme>;
heroSub: SxProps<Theme>;
chartSwitchWrap: SxProps<Theme>;
chartSwitch: SxProps<Theme>;
chartSwitchButton: (active: boolean) => SxProps<Theme>;
monitorList: SxProps<Theme>;
card: SxProps<Theme>;
cardRow: SxProps<Theme>;
cardLeft: SxProps<Theme>;
monitorName: SxProps<Theme>;
monitorMeta: SxProps<Theme>;
pill: SxProps<Theme>;
pillHardware: SxProps<Theme>;
monitorUrl: SxProps<Theme>;
badge: (tone: OverallTone) => SxProps<Theme>;
heatmap: SxProps<Theme>;
heatmapCell: (kind: BoldHeatCell) => SxProps<Theme>;
histogram: SxProps<Theme>;
bar: (kind: BoldBarKind, heightPct: number) => SxProps<Theme>;
chartStats: SxProps<Theme>;
infra: SxProps<Theme>;
infraEmpty: SxProps<Theme>;
gauge: SxProps<Theme>;
gaugeLabel: SxProps<Theme>;
gaugeValue: SxProps<Theme>;
gaugeBar: SxProps<Theme>;
gaugeFill: (level: BoldGaugeFill, widthPct: number) => SxProps<Theme>;
gaugeSub: SxProps<Theme>;
footer: SxProps<Theme>;
}
const sansFontStack =
'ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif';
export const boldStyles = (
tokens: StatusPageThemeTokens,
isDark: boolean
): BoldStyles => {
const heatCellBg: Record<BoldHeatCell, string> = {
fast: tokens.up,
med: `color-mix(in srgb, ${tokens.up} 70%, #ffffff 30%)`,
slow: tokens.warn,
down: tokens.down,
empty: tokens.border,
};
const heatCellShadow: Record<BoldHeatCell, string> = {
fast: `0 0 6px color-mix(in srgb, ${tokens.up} 18%, transparent)`,
med: `0 0 6px color-mix(in srgb, ${tokens.up} 18%, transparent)`,
slow: `0 0 6px color-mix(in srgb, ${tokens.warn} 20%, transparent)`,
down: `0 0 6px color-mix(in srgb, ${tokens.down} 20%, transparent)`,
empty: "none",
};
const barBg: Record<BoldBarKind, string> = {
up: tokens.up,
down: tokens.down,
empty: tokens.border,
};
const gaugeFillBg: Record<BoldGaugeFill, string> = {
ok: `linear-gradient(90deg, ${tokens.up}, color-mix(in srgb, ${tokens.up} 70%, #ffffff 30%))`,
warm: `linear-gradient(90deg, ${tokens.warn}, #fbbf24)`,
hot: `linear-gradient(90deg, ${tokens.down}, #fb7185)`,
};
const heroBgLight = `linear-gradient(135deg, color-mix(in srgb, ${tokens.up} 8%, transparent), transparent 60%), ${tokens.surface}`;
const heroBgDark = `linear-gradient(135deg, color-mix(in srgb, ${tokens.up} 16%, transparent), transparent 60%), ${tokens.surface}`;
const heroGlowLight = `radial-gradient(400px 200px at 20% 30%, color-mix(in srgb, ${tokens.up} 14%, transparent), transparent 60%), radial-gradient(300px 200px at 90% 80%, color-mix(in srgb, ${tokens.upStrong} 10%, transparent), transparent 60%)`;
const heroGlowDark = `radial-gradient(400px 200px at 20% 30%, color-mix(in srgb, ${tokens.up} 32%, transparent), transparent 60%), radial-gradient(300px 200px at 90% 80%, color-mix(in srgb, ${tokens.upStrong} 22%, transparent), transparent 60%)`;
return {
page: {
flex: "1 0 auto",
maxWidth: 1040,
width: "100%",
mx: "auto",
p: "56px 24px 96px",
fontFamily: sansFontStack,
fontSize: 14,
lineHeight: 1.55,
color: tokens.text,
WebkitFontSmoothing: "antialiased",
},
top: {
display: "flex",
alignItems: "center",
justifyContent: "space-between",
mb: "36px",
},
brand: {
display: "flex",
alignItems: "center",
gap: "14px",
fontWeight: 700,
fontSize: 16,
letterSpacing: "-0.01em",
color: tokens.text,
},
logoConic: {
width: 36,
height: 36,
borderRadius: "12px",
background: `conic-gradient(from 140deg, ${tokens.up}, ${tokens.upStrong}, #0f766e, ${tokens.up})`,
display: "grid",
placeItems: "center",
color: "#05070a",
fontWeight: 900,
fontSize: 14,
boxShadow: `0 8px 24px color-mix(in srgb, ${tokens.up} 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.2)`,
},
logoImg: { maxHeight: 36, maxWidth: 140, objectFit: "contain" },
company: {},
hero: {
position: "relative",
borderRadius: "22px",
padding: "36px 36px 32px",
mb: "28px",
background: isDark ? heroBgDark : heroBgLight,
border: `1px solid ${tokens.border}`,
overflow: "hidden",
"&::before": {
content: '""',
position: "absolute",
inset: 0,
background: isDark ? heroGlowDark : heroGlowLight,
pointerEvents: "none",
opacity: 0.8,
zIndex: 0,
...(isDark ? { mixBlendMode: "screen" } : {}),
},
"& > *": { position: "relative", zIndex: 1 },
},
heroTitle: {
m: 0,
fontSize: 34,
fontWeight: 800,
letterSpacing: "-0.02em",
lineHeight: 1.1,
color: tokens.text,
display: "flex",
alignItems: "center",
gap: "10px",
},
heroCheck: (tone) => ({
display: "inline-grid",
placeItems: "center",
width: 32,
height: 32,
borderRadius: "50%",
background: toneColor(tone, tokens),
color: tone === "down" ? "#fff" : "#05070a",
flexShrink: 0,
boxShadow: `0 0 0 6px ${toneSoft(tone, tokens)}`,
}),
heroSub: { mt: "10px", mb: 0, color: tokens.textMuted, fontSize: 14 },
chartSwitchWrap: { display: "flex", justifyContent: "flex-end", mb: "16px" },
chartSwitch: {
display: "inline-flex",
border: `1px solid ${tokens.border}`,
borderRadius: "999px",
background: tokens.surface,
p: "3px",
gap: "2px",
},
chartSwitchButton: (active) => ({
border: 0,
background: active ? tokens.upSoft : "transparent",
fontFamily: "inherit",
fontSize: 11,
padding: "8px 18px",
cursor: "pointer",
color: active ? tokens.up : tokens.textMuted,
fontWeight: 700,
textTransform: "uppercase",
letterSpacing: "0.12em",
transition: "background 0.2s, color 0.2s",
borderRadius: "999px",
"&:hover": { color: active ? tokens.up : tokens.text },
}),
monitorList: {
listStyle: "none",
m: 0,
p: 0,
display: "flex",
flexDirection: "column",
gap: "14px",
},
card: {
background: tokens.surface,
border: `1px solid ${tokens.border}`,
borderRadius: "18px",
overflow: "hidden",
transition: "transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s",
"&:hover": {
transform: "translateY(-3px)",
borderColor: `color-mix(in srgb, ${tokens.up} 40%, ${tokens.border})`,
},
},
cardRow: {
display: "grid",
gridTemplateColumns: "1fr auto",
alignItems: "center",
gap: "24px",
p: "22px 28px",
},
cardLeft: { minWidth: 0 },
monitorName: {
fontWeight: 700,
fontSize: 17,
letterSpacing: "-0.01em",
color: tokens.text,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
},
monitorMeta: {
display: "flex",
gap: "10px",
alignItems: "center",
mt: "6px",
flexWrap: "wrap",
},
pill: {
fontSize: 10,
textTransform: "uppercase",
letterSpacing: "0.1em",
color: tokens.textMuted,
background: `color-mix(in srgb, ${tokens.surface} 80%, ${tokens.bg})`,
border: `1px solid ${tokens.border}`,
padding: "3px 10px",
borderRadius: "999px",
fontWeight: 700,
},
pillHardware: {
fontSize: 10,
textTransform: "uppercase",
letterSpacing: "0.1em",
padding: "3px 10px",
borderRadius: "999px",
fontWeight: 700,
color: tokens.up,
borderColor: `color-mix(in srgb, ${tokens.up} 40%, transparent)`,
border: `1px solid color-mix(in srgb, ${tokens.up} 40%, transparent)`,
background: tokens.upSoft,
},
monitorUrl: {
fontSize: 12,
color: tokens.textMuted,
fontFamily: "ui-monospace, Menlo, monospace",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: 300,
},
badge: (tone) => ({
fontSize: 11,
fontWeight: 800,
padding: "6px 14px",
borderRadius: "999px",
display: "inline-flex",
alignItems: "center",
gap: "7px",
textTransform: "uppercase",
letterSpacing: "0.08em",
whiteSpace: "nowrap",
background: toneSoft(tone, tokens),
color: toneColor(tone, tokens),
"&::before": {
content: '""',
width: 6,
height: 6,
borderRadius: "50%",
background: "currentColor",
boxShadow: "0 0 8px currentColor",
},
}),
heatmap: {
padding: "0 28px 22px",
display: "grid",
gridTemplateColumns: "repeat(25, 1fr)",
gap: "3px",
height: 48,
},
heatmapCell: (kind) => ({
borderRadius: "3px",
background: heatCellBg[kind],
boxShadow: heatCellShadow[kind],
opacity: kind === "empty" ? 0.4 : 1,
transition: "transform 0.15s",
"&:hover": { transform: "scaleY(1.2)" },
}),
histogram: {
padding: "0 28px",
display: "grid",
gridTemplateColumns: "repeat(25, 1fr)",
gap: "3px",
alignItems: "flex-end",
height: 48,
},
bar: (kind, heightPct) => ({
background: barBg[kind],
borderRadius: "3px",
minHeight: 4,
opacity: kind === "empty" ? 0.4 : 1,
height: `${heightPct}%`,
}),
chartStats: {
padding: "0 28px 22px",
fontSize: 11,
color: tokens.textMuted,
fontVariantNumeric: "tabular-nums",
fontWeight: 700,
letterSpacing: "0.05em",
},
infra: {
padding: "18px 28px 26px",
display: "grid",
gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" },
gap: "16px",
},
infraEmpty: {
padding: "18px 28px 26px",
color: tokens.textMuted,
fontSize: 13,
},
gauge: {
border: `1px solid ${tokens.border}`,
borderRadius: "16px",
p: "16px 18px",
background: `color-mix(in srgb, ${tokens.surface} 80%, ${tokens.bg})`,
},
gaugeLabel: {
fontSize: 10,
color: tokens.textMuted,
textTransform: "uppercase",
letterSpacing: "0.12em",
fontWeight: 700,
},
gaugeValue: {
fontSize: 30,
fontWeight: 800,
letterSpacing: "-0.02em",
mt: "6px",
fontVariantNumeric: "tabular-nums",
color: tokens.text,
},
gaugeBar: {
height: 6,
background: tokens.border,
borderRadius: "3px",
overflow: "hidden",
mt: "12px",
},
gaugeFill: (level, widthPct) => ({
display: "block",
height: "100%",
background: gaugeFillBg[level],
borderRadius: "3px",
transition: "width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1)",
width: `${Math.max(0, Math.min(100, widthPct))}%`,
}),
gaugeSub: {
fontSize: 11,
color: tokens.textMuted,
mt: "10px",
fontVariantNumeric: "tabular-nums",
},
footer: {
textAlign: "center",
color: tokens.textMuted,
fontSize: 12,
mt: "52px",
"& a": {
color: tokens.up,
textDecoration: "underline",
textUnderlineOffset: "3px",
fontWeight: 800,
},
},
};
};