Skip to content

Open-source status page, incident response and uptime monitoring

feat: nerd mode (#1379)

Maximilian Kaskef545d0615e1b
diff --git a/apps/dashboard/next-env.d.ts b/apps/dashboard/next-env.d.ts
index 1b3be0840..830fb594c 100644
--- a/apps/dashboard/next-env.d.ts
+++ b/apps/dashboard/next-env.d.ts
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
+/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/dashboard/src/components/forms/status-page/form-configuration.tsx b/apps/dashboard/src/components/forms/status-page/form-configuration.tsx
index 4dc8bfdb3..053590b82 100644
--- a/apps/dashboard/src/components/forms/status-page/form-configuration.tsx
+++ b/apps/dashboard/src/components/forms/status-page/form-configuration.tsx
@@ -329,7 +329,7 @@ export function FormConfiguration({
<FormCardFooterInfo>
Learn more about{" "}
<Link
- href="https://docs.openstatus.dev/"
+ href="https://docs.openstatus.dev/tutorial/how-to-configure-status-page"
rel="noreferrer"
target="_blank"
>
diff --git a/apps/dashboard/src/components/forms/status-page/update.tsx b/apps/dashboard/src/components/forms/status-page/update.tsx
index dcb59c283..0fcdbc053 100644
--- a/apps/dashboard/src/components/forms/status-page/update.tsx
+++ b/apps/dashboard/src/components/forms/status-page/update.tsx
@@ -140,7 +140,8 @@ export function FormStatusPageUpdate() {
}}
/>
{/* TODO: feature flagged - remove once we have the new version in production */}
- {process.env.NEXT_PUBLIC_STATUS_PAGE_V2 === "true" ? (
+ {process.env.NEXT_PUBLIC_STATUS_PAGE_V2 === "true" ||
+ process.env.NODE_ENV === "development" ? (
<FormConfiguration
defaultValues={{
new: !statusPage.legacyPage,
diff --git a/apps/status-page/next-env.d.ts b/apps/status-page/next-env.d.ts
index 1b3be0840..830fb594c 100644
--- a/apps/status-page/next-env.d.ts
+++ b/apps/status-page/next-env.d.ts
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
+/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/status-page/package.json b/apps/status-page/package.json
index 9245e12d3..379dbcec7 100644
--- a/apps/status-page/package.json
+++ b/apps/status-page/package.json
@@ -97,6 +97,7 @@
},
"devDependencies": {
"@tailwindcss/postcss": "4.1.11",
+ "@tailwindcss/typography": "0.5.10",
"@types/dom-speech-recognition": "0.0.6",
"@types/node": "24.0.8",
"@types/react": "19.1.13",
diff --git a/apps/status-page/public/fonts/CommitMono-400-Italic.otf b/apps/status-page/public/fonts/CommitMono-400-Italic.otf
new file mode 100644
index 000000000..616bb0797
Binary files /dev/null and b/apps/status-page/public/fonts/CommitMono-400-Italic.otf differ
diff --git a/apps/status-page/public/fonts/CommitMono-400-Regular.otf b/apps/status-page/public/fonts/CommitMono-400-Regular.otf
new file mode 100644
index 000000000..4c029ed36
Binary files /dev/null and b/apps/status-page/public/fonts/CommitMono-400-Regular.otf differ
diff --git a/apps/status-page/public/fonts/CommitMono-700-Italic.otf b/apps/status-page/public/fonts/CommitMono-700-Italic.otf
new file mode 100644
index 000000000..e948f7396
Binary files /dev/null and b/apps/status-page/public/fonts/CommitMono-700-Italic.otf differ
diff --git a/apps/status-page/public/fonts/CommitMono-700-Regular.otf b/apps/status-page/public/fonts/CommitMono-700-Regular.otf
new file mode 100644
index 000000000..da3e6243f
Binary files /dev/null and b/apps/status-page/public/fonts/CommitMono-700-Regular.otf differ
diff --git a/apps/status-page/src/app/(public)/layout.tsx b/apps/status-page/src/app/(public)/layout.tsx
index 52c9afe1c..c2dfa48bb 100644
--- a/apps/status-page/src/app/(public)/layout.tsx
+++ b/apps/status-page/src/app/(public)/layout.tsx
@@ -1,3 +1,4 @@
+import { Link } from "@/components/common/link";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner";
@@ -9,11 +10,16 @@ export default async function Layout({
return (
<ThemeProvider
attribute="class"
- defaultTheme="system"
+ defaultTheme="light"
enableSystem
disableTransitionOnChange
>
- {children}
+ <main>{children}</main>
+ <footer className="flex items-center justify-center gap-4 p-4 text-center font-mono text-muted-foreground text-sm">
+ <p>
+ powered by <Link href="https://openstatus.dev">openstatus</Link>
+ </p>
+ </footer>
<Toaster richColors expand />
</ThemeProvider>
);
diff --git a/apps/status-page/src/app/(public)/page.tsx b/apps/status-page/src/app/(public)/page.tsx
index 50a0740d9..df0c678bf 100644
--- a/apps/status-page/src/app/(public)/page.tsx
+++ b/apps/status-page/src/app/(public)/page.tsx
@@ -1,5 +1,6 @@
"use client";
+import { Link } from "@/components/common/link";
import {
Section,
SectionDescription,
@@ -7,8 +8,6 @@ import {
SectionHeader,
SectionTitle,
} from "@/components/content/section";
-import { THEMES } from "@/components/status-page/community-themes";
-import { COMMUNITY_THEME } from "@/components/status-page/floating-button";
import {
Status,
StatusContent,
@@ -18,7 +17,9 @@ import {
} from "@/components/status-page/status";
import { StatusBanner } from "@/components/status-page/status-banner";
import { StatusMonitor } from "@/components/status-page/status-monitor";
+import { Button } from "@/components/ui/button";
import { monitors } from "@/data/monitors";
+import { THEMES, THEME_KEYS } from "@/lib/community-themes";
import { useTRPC } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { useQuery } from "@tanstack/react-query";
@@ -30,36 +31,83 @@ export default function Page() {
<SectionHeader>
<SectionTitle>Status Page Themes</SectionTitle>
<SectionDescription>
- View all the current themes you can use. Or contribute your own one.
+ View all the current themes you can use.{" "}
+ <Link href="#contribute-theme">Contribute your own?</Link>
</SectionDescription>
</SectionHeader>
<div className="flex flex-col gap-4">
- {COMMUNITY_THEME.filter((theme) => theme !== "default").map(
- (theme) => {
- const t = THEMES[theme];
- return (
- <div key={theme} className="flex flex-col gap-2">
- <ThemeHeader>
- <ThemeTitle>{t.name}</ThemeTitle>
- <ThemeAuthor>
- by{" "}
- <a
- href={t.author.url}
- target="_blank"
- rel="noopener noreferrer"
- >
- {t.author.name}
- </a>
- </ThemeAuthor>
- </ThemeHeader>
- <ThemeGroup>
- <ThemeCard theme={theme} mode="light" />
- <ThemeCard theme={theme} mode="dark" />
- </ThemeGroup>
- </div>
- );
- },
- )}
+ {THEME_KEYS.map((theme) => {
+ const t = THEMES[theme];
+ return (
+ <div key={theme} className="flex flex-col gap-2">
+ <ThemeHeader>
+ <ThemeTitle>{t.name}</ThemeTitle>
+ <ThemeAuthor>
+ by{" "}
+ <a
+ href={t.author.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ {t.author.name}
+ </a>
+ </ThemeAuthor>
+ </ThemeHeader>
+ <ThemeGroup>
+ <ThemeCard theme={theme} mode="light" />
+ <ThemeCard theme={theme} mode="dark" />
+ </ThemeGroup>
+ </div>
+ );
+ })}
+ </div>
+ </Section>
+ <Section>
+ <SectionHeader id="contribute-theme">
+ <SectionTitle>Contribute Theme</SectionTitle>
+ <SectionDescription>
+ Contribute your own theme to the community.
+ </SectionDescription>
+ </SectionHeader>
+ <div className="prose dark:prose-invert prose-sm max-w-none">
+ <p>
+ You can contribute your own theme by creating a new file in the{" "}
+ <code>src/lib/community-themes</code> directory. You&apos;ll only
+ need to override css variables. Make sure your object is satisfiying
+ the <code>Theme</code> interface.
+ </p>
+ <p>
+ Go to the{" "}
+ <Link href="https://github.com/openstatus-dev/status-page/blob/main/src/lib/community-themes">
+ GitHub directory
+ </Link>{" "}
+ to see the existing themes and create a new one by forking and
+ creating a pull request.
+ </p>
+ <Button
+ onClick={() => {
+ // NOTE: we use it to display the 'floating-theme' component
+ sessionStorage.setItem("community-theme", "true");
+ window.location.href = "/status";
+ }}
+ >
+ Test it
+ </Button>
+ <hr />
+ <p>
+ Why don't we allow custom css styles to be overridden and only
+ support themes?
+ </p>
+ <ul>
+ <li>Keep it simple for the user</li>
+ <li>Don't end up with a xmas tree</li>
+ <li>Keep the theme consistent</li>
+ <li>Avoid conflicts with other styles</li>
+ <li>
+ Keep the theme maintainable (but this will also mean, a change
+ will affect all users)
+ </li>
+ </ul>
</div>
</Section>
</SectionGroup>
@@ -81,11 +129,14 @@ function ThemeCard({
trpc.statusPage.getNoopUptime.queryOptions(),
);
return (
- <div className="group/theme-card overflow-hidden rounded-lg border">
+ <div
+ className={cn(
+ "group/theme-card overflow-hidden rounded-lg border",
+ mode === "dark" ? "dark" : "",
+ )}
+ >
<div
- style={{
- ...t,
- }}
+ style={t as React.CSSProperties}
className="h-full w-full bg-background"
>
{/* NOTE: we use pointer-events-none to prevent the hover card or tooltip from being interactive - the Portal container is document body and we loose the styles */}
@@ -129,7 +180,9 @@ function ThemeHeader({ children, className }: React.ComponentProps<"div">) {
}
function ThemeTitle({ children, className }: React.ComponentProps<"div">) {
- return <div className={cn("font-bold text-base", className)}>{children}</div>;
+ return (
+ <div className={cn("font-semibold text-base", className)}>{children}</div>
+ );
}
function ThemeAuthor({ children, className }: React.ComponentProps<"div">) {
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
index 0d09eb5d1..e3b815756 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
@@ -1,5 +1,12 @@
"use client";
+import {
+ StatusBlankContainer,
+ StatusBlankContent,
+ StatusBlankDescription,
+ StatusBlankReport,
+ StatusBlankTitle,
+} from "@/components/status-page/status-blank";
import {
StatusEvent,
StatusEventAffected,
@@ -9,20 +16,14 @@ import {
StatusEventTimelineReport,
StatusEventTitle,
} from "@/components/status-page/status-events";
-import { useTRPC } from "@/lib/trpc/client";
-import { useQuery } from "@tanstack/react-query";
-import { useParams } from "next/navigation";
-
-import {
- StatusEmptyState,
- StatusEmptyStateDescription,
- StatusEmptyStateTitle,
-} from "@/components/status-page/status";
import { Badge } from "@/components/ui/badge";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { formatDate } from "@/lib/formatter";
-import { CircleCheck } from "lucide-react";
+import { useTRPC } from "@/lib/trpc/client";
+import { useQuery } from "@tanstack/react-query";
+import { Check } from "lucide-react";
import Link from "next/link";
+import { useParams } from "next/navigation";
// TODO: include ?filter=maintenance/reports
@@ -71,7 +72,11 @@ export default function Page() {
<StatusEventTitle className="inline-flex gap-1">
{report.title}
{isReportResolvedOnly ? (
- <CircleCheck className="size-4 text-success shrink-0 mt-1 ml-1.5" />
+ <div className="mt-1 ml-1.5">
+ <div className="rounded-full border border-success/20 bg-success/10 p-0.5 text-success">
+ <Check className="size-3 shrink-0" />
+ </div>
+ </div>
) : null}
</StatusEventTitle>
{report.monitorsToStatusReports.length > 0 ? (
@@ -96,12 +101,19 @@ export default function Page() {
);
})
) : (
- <StatusEmptyState>
- <StatusEmptyStateTitle>No reports found</StatusEmptyStateTitle>
- <StatusEmptyStateDescription>
- No reports found for this status page.
- </StatusEmptyStateDescription>
- </StatusEmptyState>
+ <StatusBlankContainer>
+ <div className="relative mt-8 flex w-full flex-col items-center justify-center">
+ <StatusBlankReport className="-top-16 absolute scale-60 opacity-50" />
+ <StatusBlankReport className="-top-8 absolute scale-80 opacity-80" />
+ <StatusBlankReport />
+ </div>
+ <StatusBlankContent>
+ <StatusBlankTitle>No reports found</StatusBlankTitle>
+ <StatusBlankDescription>
+ No reports found for this status page.
+ </StatusBlankDescription>
+ </StatusBlankContent>
+ </StatusBlankContainer>
)}
</TabsContent>
<TabsContent value="maintenances" className="flex flex-col gap-4">
@@ -144,12 +156,19 @@ export default function Page() {
);
})
) : (
- <StatusEmptyState>
- <StatusEmptyStateTitle>No maintenances found</StatusEmptyStateTitle>
- <StatusEmptyStateDescription>
- No maintenances found for this status page.
- </StatusEmptyStateDescription>
- </StatusEmptyState>
+ <StatusBlankContainer>
+ <div className="relative mt-8 flex w-full flex-col items-center justify-center">
+ <StatusBlankReport className="-top-16 absolute scale-60 opacity-50" />
+ <StatusBlankReport className="-top-8 absolute scale-80 opacity-80" />
+ <StatusBlankReport />
+ </div>
+ <StatusBlankContent>
+ <StatusBlankTitle>No maintenances found</StatusBlankTitle>
+ <StatusBlankDescription>
+ No maintenances found for this status page.
+ </StatusBlankDescription>
+ </StatusBlankContent>
+ </StatusBlankContainer>
)}
</TabsContent>
</Tabs>
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/monitors/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/(public)/monitors/page.tsx
index 0b392214e..b33a0bbde 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/monitors/page.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/monitors/page.tsx
@@ -8,12 +8,16 @@ import {
Status,
StatusContent,
StatusDescription,
- StatusEmptyState,
- StatusEmptyStateDescription,
- StatusEmptyStateTitle,
StatusHeader,
StatusTitle,
} from "@/components/status-page/status";
+import {
+ StatusBlankContainer,
+ StatusBlankContent,
+ StatusBlankDescription,
+ StatusBlankMonitor,
+ StatusBlankTitle,
+} from "@/components/status-page/status-blank";
import { StatusMonitorTitle } from "@/components/status-page/status-monitor";
import { StatusMonitorDescription } from "@/components/status-page/status-monitor";
import { useTRPC } from "@/lib/trpc/client";
@@ -69,7 +73,7 @@ export default function Page() {
className="rounded-lg"
>
<div className="group -mx-3 -my-2 flex flex-col gap-2 rounded-lg border border-transparent px-3 py-2 hover:border-border/50 hover:bg-muted/50">
- <div className="flex flex-row items-center gap-2">
+ <div className="flex flex-row items-center justify-start gap-2">
<StatusMonitorTitle>{monitor.name}</StatusMonitorTitle>
<StatusMonitorDescription>
{monitor.description}
@@ -90,12 +94,19 @@ export default function Page() {
);
})
) : (
- <StatusEmptyState>
- <StatusEmptyStateTitle>No public monitors</StatusEmptyStateTitle>
- <StatusEmptyStateDescription>
- No public monitors have been added to this page.
- </StatusEmptyStateDescription>
- </StatusEmptyState>
+ <StatusBlankContainer>
+ <div className="relative mt-8 flex w-full flex-col items-center justify-center">
+ <StatusBlankMonitor className="-top-16 absolute scale-60 opacity-50" />
+ <StatusBlankMonitor className="-top-8 absolute scale-80 opacity-80" />
+ <StatusBlankMonitor />
+ </div>
+ <StatusBlankContent>
+ <StatusBlankTitle>No public monitors</StatusBlankTitle>
+ <StatusBlankDescription>
+ No public monitors have been added to this page.
+ </StatusBlankDescription>
+ </StatusBlankContent>
+ </StatusBlankContainer>
)}
</StatusContent>
</Status>
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
index 63505cfa1..af9dc0b98 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
@@ -12,7 +12,10 @@ import {
StatusBanner,
StatusBannerContainer,
StatusBannerContent,
- StatusBannerTitle,
+ StatusBannerTabs,
+ StatusBannerTabsContent,
+ StatusBannerTabsList,
+ StatusBannerTabsTrigger,
} from "@/components/status-page/status-banner";
import {
StatusEventTimelineMaintenance,
@@ -22,8 +25,8 @@ import { StatusFeed } from "@/components/status-page/status-feed";
import { StatusMonitor } from "@/components/status-page/status-monitor";
import { Separator } from "@/components/ui/separator";
import { useTRPC } from "@/lib/trpc/client";
+import { cn } from "@/lib/utils";
import { useQuery } from "@tanstack/react-query";
-import Link from "next/link";
import { useParams } from "next/navigation";
export default function Page() {
@@ -55,61 +58,78 @@ export default function Page() {
</StatusHeader>
{page.openEvents.length > 0 ? (
<StatusContent>
- {page.openEvents.map((e) => {
- if (e.type === "maintenance") {
- const maintenance = page.maintenances.find(
- (maintenance) => maintenance.id === e.id,
- );
- if (!maintenance) return null;
- return (
- <Link
- href={`./events/maintenance/${e.id}`}
- key={e.id}
- className="rounded-lg"
- >
- <StatusBannerContainer status={e.status}>
- <StatusBannerTitle>{e.name}</StatusBannerTitle>
- <StatusBannerContent>
- <StatusEventTimelineMaintenance
- maintenance={maintenance}
- withDot={false}
- />
- </StatusBannerContent>
- </StatusBannerContainer>
- </Link>
- );
- }
- if (e.type === "report") {
- const report = page.statusReports.find(
- (report) => report.id === e.id,
- );
- if (!report) return null;
- return (
- <Link
- href={`./events/report/${e.id}`}
- key={e.id}
- className="rounded-lg"
- >
- <StatusBannerContainer status={e.status}>
- <StatusBannerTitle>{e.name}</StatusBannerTitle>
- <StatusBannerContent>
- <StatusEventTimelineReport
- updates={report.statusReportUpdates}
- withDot={false}
- />
- </StatusBannerContent>
- </StatusBannerContainer>
- </Link>
- );
- }
- return null;
- })}
+ <StatusBannerTabs
+ defaultValue={`${page.openEvents[0].type}-${page.openEvents[0].id}`}
+ >
+ <StatusBannerTabsList>
+ {page.openEvents.map((e, i) => {
+ return (
+ <StatusBannerTabsTrigger
+ value={`${e.type}-${e.id}`}
+ status={e.status}
+ key={e.id}
+ className={cn(
+ i === 0 && "rounded-tl-lg",
+ i === page.openEvents.length - 1 && "rounded-tr-lg",
+ )}
+ >
+ {e.name}
+ </StatusBannerTabsTrigger>
+ );
+ })}
+ </StatusBannerTabsList>
+ {page.openEvents.map((e) => {
+ if (e.type === "report") {
+ const report = page.statusReports.find(
+ (report) => report.id === e.id,
+ );
+ if (!report) return null;
+ return (
+ <StatusBannerTabsContent
+ value={`${e.type}-${e.id}`}
+ key={e.id}
+ >
+ <StatusBannerContainer status={e.status}>
+ <StatusBannerContent>
+ <StatusEventTimelineReport
+ updates={report.statusReportUpdates}
+ withDot={false}
+ />
+ </StatusBannerContent>
+ </StatusBannerContainer>
+ </StatusBannerTabsContent>
+ );
+ }
+ if (e.type === "maintenance") {
+ const maintenance = page.maintenances.find(
+ (maintenance) => maintenance.id === e.id,
+ );
+ if (!maintenance) return null;
+ return (
+ <StatusBannerTabsContent
+ value={`${e.type}-${e.id}`}
+ key={e.id}
+ >
+ <StatusBannerContainer status={e.status}>
+ <StatusBannerContent>
+ <StatusEventTimelineMaintenance
+ maintenance={maintenance}
+ withDot={false}
+ />
+ </StatusBannerContent>
+ </StatusBannerContainer>
+ </StatusBannerTabsContent>
+ );
+ }
+ return null;
+ })}
+ </StatusBannerTabs>
</StatusContent>
) : (
<StatusBanner status={page.status} />
)}
- {/* TODO: check how to display current events */}
- <StatusContent>
+ {/* NOTE: check what gap feels right */}
+ <StatusContent className="gap-5">
{page.monitors.map((monitor) => {
const { data, uptime } =
uptimeData?.find((m) => m.id === monitor.id) ?? {};
@@ -128,7 +148,6 @@ export default function Page() {
</StatusContent>
<Separator />
<StatusContent>
- <StatusTitle>Recent Events</StatusTitle>
<StatusFeed
statusReports={page.statusReports
.filter((report) =>
diff --git a/apps/status-page/src/app/(status-page)/[domain]/layout.tsx b/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
index 8415013aa..9343c549c 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
@@ -3,6 +3,7 @@ import {
FloatingButton,
StatusPageProvider,
} from "@/components/status-page/floating-button";
+import { FloatingTheme } from "@/components/status-page/floating-theme";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner";
import { HydrateClient, getQueryClient, trpc } from "@/lib/trpc/server";
@@ -17,10 +18,6 @@ export const schema = z.object({
theme: z.enum(["default"]).default("default"),
});
-const DISPLAY_FLOATING_BUTTON =
- process.env.NODE_ENV === "development" ||
- process.env.ENABLE_FLOATING_BUTTON === "true";
-
export default async function Layout({
children,
params,
@@ -51,8 +48,16 @@ export default async function Layout({
defaultCommunityTheme={validation.data?.theme}
>
{children}
- {DISPLAY_FLOATING_BUTTON ? <FloatingButton /> : null}
- <Toaster richColors expand />
+ <FloatingButton />
+ <FloatingTheme />
+ <Toaster
+ toastOptions={{
+ classNames: {},
+ style: { borderRadius: "var(--radius-lg)" },
+ }}
+ richColors
+ expand
+ />
</StatusPageProvider>
</ThemeProvider>
</HydrateClient>
diff --git a/apps/status-page/src/app/globals.css b/apps/status-page/src/app/globals.css
index 8711e0f91..4af968ad7 100644
--- a/apps/status-page/src/app/globals.css
+++ b/apps/status-page/src/app/globals.css
@@ -1,5 +1,6 @@
@import "tailwindcss";
@import "tw-animate-css";
+@plugin "@tailwindcss/typography";
/* safelist */
@source inline("has-data-[slot=slider-range]:bg-red-500");
@@ -14,7 +15,7 @@
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
- --font-mono: var(--font-geist-mono);
+ --font-mono: var(--font-commit-mono, var(--font-geist-mono));
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -44,6 +45,7 @@
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
+ --radius-xs: calc(var(--radius) - 8px);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
@@ -55,7 +57,8 @@
}
:root {
- --radius: 0.625rem;
+ /* --radius: 0.625rem; */
+ --radius: 0rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
@@ -175,3 +178,10 @@
@apply bg-background text-foreground;
}
}
+
+@layer utilities {
+ /* NOTE: allows us to --radius: 0px and avoid rounding issues - otherwise it is 'infinite * 1px' */
+ .rounded-full {
+ border-radius: calc(var(--radius) * 99999999);
+ }
+}
diff --git a/apps/status-page/src/app/layout.tsx b/apps/status-page/src/app/layout.tsx
index beb3bc68f..5eaad0aaf 100644
--- a/apps/status-page/src/app/layout.tsx
+++ b/apps/status-page/src/app/layout.tsx
@@ -24,6 +24,32 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});
+const commitMono = LocalFont({
+ src: [
+ {
+ path: "../../public/fonts/CommitMono-400-Regular.otf",
+ weight: "400",
+ style: "normal",
+ },
+ {
+ path: "../../public/fonts/CommitMono-400-Italic.otf",
+ weight: "400",
+ style: "italic",
+ },
+ {
+ path: "../../public/fonts/CommitMono-700-Regular.otf",
+ weight: "700",
+ style: "normal",
+ },
+ {
+ path: "../../public/fonts/CommitMono-700-Italic.otf",
+ weight: "700",
+ style: "italic",
+ },
+ ],
+ variable: "--font-commit-mono",
+});
+
export const metadata: Metadata = {
...defaultMetadata,
twitter: {
@@ -48,6 +74,7 @@ export default function RootLayout({
geistSans.variable,
geistMono.variable,
cal.variable,
+ commitMono.variable,
"antialiased",
)}
>
diff --git a/apps/status-page/src/components/chart/chart-legend-badge.tsx b/apps/status-page/src/components/chart/chart-legend-badge.tsx
index bdf05ca69..54e91a462 100644
--- a/apps/status-page/src/components/chart/chart-legend-badge.tsx
+++ b/apps/status-page/src/components/chart/chart-legend-badge.tsx
@@ -80,7 +80,7 @@ export function ChartLegendBadge({
<itemConfig.icon />
) : (
<div
- className="h-2 w-2 shrink-0 rounded-[2px]"
+ className="h-2 w-2 shrink-0 rounded-(--radius-xs)"
style={{
backgroundColor: item.color,
}}
diff --git a/apps/status-page/src/components/chart/chart-tooltip-number.tsx b/apps/status-page/src/components/chart/chart-tooltip-number.tsx
index f73a93bfb..9722ff1e4 100644
--- a/apps/status-page/src/components/chart/chart-tooltip-number.tsx
+++ b/apps/status-page/src/components/chart/chart-tooltip-number.tsx
@@ -20,7 +20,7 @@ export function ChartTooltipNumber({
return (
<>
<div
- className="h-2.5 w-2.5 shrink-0 rounded-[2px] bg-(--color-bg)"
+ className="h-2.5 w-2.5 shrink-0 rounded-(--radius-xs) bg-(--color-bg)"
style={
{
"--color-bg": `var(--color-${name})`,
diff --git a/apps/status-page/src/components/common/link.tsx b/apps/status-page/src/components/common/link.tsx
index 6749263d8..2a7dfa6cf 100644
--- a/apps/status-page/src/components/common/link.tsx
+++ b/apps/status-page/src/components/common/link.tsx
@@ -1,18 +1,31 @@
import { cn } from "@/lib/utils";
+import { type VariantProps, cva } from "class-variance-authority";
import NextLink from "next/link";
-// TODO: we could add cva variants for the link
+export const linkVariants = cva(
+ // NOTE: use same ring styles as the button
+ "outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm",
+ {
+ variants: {
+ variant: {
+ default: "text-foreground font-medium",
+ container: "focus-visible:border-ring",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ },
+);
export function Link({
children,
className,
+ variant,
...props
-}: React.ComponentProps<typeof NextLink>) {
+}: React.ComponentProps<typeof NextLink> & VariantProps<typeof linkVariants>) {
return (
- <NextLink
- className={cn("font-medium text-foreground", className)}
- {...props}
- >
+ <NextLink className={cn(linkVariants({ variant, className }))} {...props}>
{children}
</NextLink>
);
diff --git a/apps/status-page/src/components/content/process-message.tsx b/apps/status-page/src/components/content/process-message.tsx
index 791a1f8e9..61be0830d 100644
--- a/apps/status-page/src/components/content/process-message.tsx
+++ b/apps/status-page/src/components/content/process-message.tsx
@@ -1,4 +1,4 @@
-import type { AnchorHTMLAttributes } from "react";
+import type { AnchorHTMLAttributes, HTMLAttributes } from "react";
import { Fragment, createElement } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import rehypeReact from "rehype-react";
@@ -16,12 +16,25 @@ export function ProcessMessage({ value }: { value: string }) {
jsx,
jsxs,
components: {
+ ul: (props: HTMLAttributes<HTMLUListElement>) => {
+ return (
+ <ul
+ className="list-inside list-disc marker:text-muted-foreground/50"
+ {...props}
+ />
+ );
+ },
+ ol: (_props: HTMLAttributes<HTMLOListElement>) => {
+ return (
+ <ol className="list-inside list-decimal marker:text-muted-foreground/50" />
+ );
+ },
a: (props: AnchorHTMLAttributes<HTMLAnchorElement>) => {
return (
<a
target="_blank"
rel="noreferrer"
- className="underline"
+ className="rounded-sm underline outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
{...props}
/>
);
diff --git a/apps/status-page/src/components/nav/footer.tsx b/apps/status-page/src/components/nav/footer.tsx
index f0b04ea8d..31a8ab54b 100644
--- a/apps/status-page/src/components/nav/footer.tsx
+++ b/apps/status-page/src/components/nav/footer.tsx
@@ -20,9 +20,9 @@ export function Footer(props: React.ComponentProps<"footer">) {
return (
<footer {...props}>
<div className="mx-auto flex max-w-2xl items-center justify-between gap-4 px-3 py-2">
- <div className="leading-[0.9]">
- <p className="text-muted-foreground text-sm">
- Powered by <Link href="#">OpenStatus</Link>
+ <div>
+ <p className="font-mono text-muted-foreground text-sm leading-none">
+ powered by <Link href="#">openstatus</Link>
</p>
<TimestampHoverCard date={new Date(dataUpdatedAt)} side="top">
<span className="text-muted-foreground/70 text-xs">
diff --git a/apps/status-page/src/components/nav/header.tsx b/apps/status-page/src/components/nav/header.tsx
index edab17f41..a1cee6393 100644
--- a/apps/status-page/src/components/nav/header.tsx
+++ b/apps/status-page/src/components/nav/header.tsx
@@ -69,30 +69,30 @@ export function Header(props: React.ComponentProps<"header">) {
);
const types = (
- page?.workspacePlan === "free"
- ? ["rss", "atom", "ssh"]
- : ["email", "rss", "atom", "ssh"]
- ) satisfies ("email" | "rss" | "atom" | "ssh")[];
+ page?.workspacePlan === "free" ? ["rss", "ssh"] : ["email", "rss", "ssh"]
+ ) satisfies ("email" | "rss" | "ssh")[];
return (
<header {...props}>
<nav className="mx-auto flex max-w-2xl items-center justify-between gap-3 px-3 py-2">
{/* NOTE: same width as the `StatusUpdates` button */}
- <div className="w-[150px] shrink-0">
- <Link
- href={page?.homepageUrl || "/"}
- target={page?.homepageUrl ? "_blank" : undefined}
- rel={page?.homepageUrl ? "noreferrer" : undefined}
- className="rounded-full"
- >
- {page?.icon ? (
- <img
- src={page.icon}
- alt={`${page.title} status page`}
- className="size-8 rounded-full border"
- />
- ) : null}
- </Link>
+ <div className="flex w-[150px] shrink-0">
+ <div className="flex items-center justify-center">
+ <Link
+ href={page?.homepageUrl || "/"}
+ target={page?.homepageUrl ? "_blank" : undefined}
+ rel={page?.homepageUrl ? "noreferrer" : undefined}
+ className="rounded-full"
+ >
+ {page?.icon ? (
+ <img
+ src={page.icon}
+ alt={`${page.title} status page`}
+ className="size-8 rounded-full border"
+ />
+ ) : null}
+ </Link>
+ </div>
</div>
<NavDesktop className="hidden md:flex" />
<div className="flex min-w-[150px] items-center justify-end gap-2">
diff --git a/apps/status-page/src/components/status-page/community-themes.ts b/apps/status-page/src/components/status-page/community-themes.ts
deleted file mode 100644
index d4ac78676..000000000
--- a/apps/status-page/src/components/status-page/community-themes.ts
+++ /dev/null
@@ -1,117 +0,0 @@
-export const defaultTheme = {
- light: {} as React.CSSProperties,
- dark: {} as React.CSSProperties,
-} as const;
-
-export const supabaseTheme = {
- light: {
- "--background": "oklch(99.11% 0 0)",
- "--foreground": "oklch(20.46% 0 0)",
- "--border": "oklch(90.37% 0 0)",
- "--input": "oklch(90.37% 0 0)",
-
- "--primary": "oklch(76.26% 0.154 159.27)",
- "--primary-foreground": "oklch(20.46% 0 0)",
- "--muted": "oklch(97.61% 0 0)",
- "--muted-foreground": "oklch(54.52% 0 0)",
- "--secondary": "oklch(97.61% 0 0)",
- "--secondary-foreground": "oklch(20.46% 0 0)",
- "--accent": "oklch(97.61% 0 0)",
- "--accent-foreground": "oklch(20.46% 0 0)",
-
- "--success": "oklch(76.26% 0.154 159.27)",
- "--destructive": "oklch(62.71% 0.1936 33.34)",
- "--warning": "oklch(81.69% 0.1639 75.84)",
- "--info": "oklch(61.26% 0.218 283.85)",
- } as React.CSSProperties,
- dark: {
- "--background": "oklch(18.22% 0 0)",
- "--foreground": "oklch(98.51% 0 0)",
- "--border": "oklch(30.12% 0 0)",
- "--input": "oklch(30.12% 0 0)",
-
- "--primary": "oklch(68.56% 0.1558 158.13)",
- "--primary-foreground": "oklch(18.22% 0 0)",
- "--muted": "oklch(26.03% 0 0)",
- "--muted-foreground": "oklch(63.01% 0 0)",
- "--secondary": "oklch(26.03% 0 0)",
- "--secondary-foreground": "oklch(98.51% 0 0)",
- "--accent": "oklch(26.03% 0 0)",
- "--accent-foreground": "oklch(98.51% 0 0)",
-
- "--success": "oklch(68.56% 0.1558 158.13)",
- "--destructive": "oklch(62.71% 0.1936 33.34)",
- "--warning": "oklch(70.84% 0.1523 71.24)",
- "--info": "oklch(61.26% 0.218 283.85)",
- } as React.CSSProperties,
-};
-
-export const githubTheme = {
- light: {
- "--background": "oklch(100% 0 0)",
- "--foreground": "oklch(24.29% 0.0045 247.86)",
- "--border": "oklch(85.86% 0.0054 251.18)",
- "--input": "oklch(85.86% 0.0054 251.18)",
-
- "--primary": "oklch(60.81% 0.1567 142.5)",
- "--primary-foreground": "oklch(24.29% 0.0045 247.86)",
- "--muted": "oklch(97.86% 0.0019 247.86)",
- "--muted-foreground": "oklch(40.78% 0.0056 247.86)",
- "--secondary": "oklch(97.86% 0.0019 247.86)",
- "--secondary-foreground": "oklch(24.29% 0.0045 247.86)",
- "--accent": "oklch(97.86% 0.0019 247.86)",
- "--accent-foreground": "oklch(24.29% 0.0045 247.86)",
-
- "--success": "oklch(60.81% 0.1567 142.5)",
- "--destructive": "oklch(58.79% 0.1577 22.18)",
- "--warning": "oklch(81.84% 0.1328 85.87)",
- "--info": "oklch(45.2% 0.1445 252.03)",
- } as React.CSSProperties,
- dark: {
- "--background": "oklch(10.39% 0.0194 248.34)",
- "--foreground": "oklch(100% 0 0)",
- "--border": "oklch(58.41% 0.011 252.87)",
- "--input": "oklch(58.41% 0.011 252.87)",
-
- "--primary": "oklch(54.34% 0.1634 145.98)",
- "--primary-foreground": "oklch(100% 0 0)",
- "--muted": "oklch(33.39% 0.0223 256.4)",
- "--muted-foreground": "oklch(79.7% 0.0169 262.74)",
- "--secondary": "oklch(33.39% 0.0223 256.4)",
- "--secondary-foreground": "oklch(100% 0 0)",
- "--accent": "oklch(33.39% 0.0223 256.4)",
- "--accent-foreground": "oklch(100% 0 0)",
-
- "--success": "oklch(54.34% 0.1634 145.98)",
- "--destructive": "oklch(47.1% 0.1909 25.95)",
- "--warning": "oklch(81.84% 0.1328 85.87)",
- "--info": "oklch(46.96% 0.2957 264.51)",
- } as React.CSSProperties,
-};
-
-export const THEMES = {
- // supabase: supabaseTheme,
- default: {
- name: "Default",
- author: { name: "@openstatus", url: "https://openstatus.dev" },
- ...defaultTheme,
- },
- github: {
- name: "Github",
- author: { name: "@github", url: "https://github.com" },
- ...githubTheme,
- },
- supabase: {
- name: "Supabase",
- author: { name: "@supabase", url: "https://supabase.com" },
- ...supabaseTheme,
- },
-} as const satisfies Record<
- string,
- {
- name: string;
- author: { name: string; url: string };
- light: React.CSSProperties;
- dark: React.CSSProperties;
- }
->;
diff --git a/apps/status-page/src/components/status-page/floating-button.tsx b/apps/status-page/src/components/status-page/floating-button.tsx
index 80f5d17a0..74486e9ac 100644
--- a/apps/status-page/src/components/status-page/floating-button.tsx
+++ b/apps/status-page/src/components/status-page/floating-button.tsx
@@ -16,12 +16,12 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Separator } from "@/components/ui/separator";
+import { THEMES, THEME_KEYS } from "@/lib/community-themes";
import { cn } from "@/lib/utils";
import { Settings } from "lucide-react";
import { useTheme } from "next-themes";
import type React from "react";
import { createContext, useContext, useEffect, useState } from "react";
-import { THEMES } from "./community-themes";
export const VARIANT = ["success", "degraded", "error", "info"] as const;
export type VariantType = (typeof VARIANT)[number];
@@ -37,11 +37,12 @@ export type CardType = (typeof CARD_TYPE)[number];
export const BAR_TYPE = ["absolute", "dominant", "manual"] as const;
export type BarType = (typeof BAR_TYPE)[number];
-export const COMMUNITY_THEME = ["default", "github", "supabase"] as const;
+export const COMMUNITY_THEME = THEME_KEYS;
export type CommunityTheme = (typeof COMMUNITY_THEME)[number];
+
+export const RADIUS = ["square", "rounded"] as const;
+export type Radius = (typeof RADIUS)[number];
interface StatusPageContextType {
- variant: VariantType;
- setVariant: (variant: VariantType) => void;
cardType: CardType;
setCardType: (cardType: CardType) => void;
barType: BarType;
@@ -50,6 +51,8 @@ interface StatusPageContextType {
setShowUptime: (showUptime: boolean) => void;
communityTheme: CommunityTheme;
setCommunityTheme: (communityTheme: CommunityTheme) => void;
+ radius: Radius;
+ setRadius: (radius: Radius) => void;
}
const StatusPageContext = createContext<StatusPageContextType | null>(null);
@@ -64,23 +67,23 @@ export function useStatusPage() {
export function StatusPageProvider({
children,
- defaultVariant = "success",
defaultCardType = "duration",
defaultBarType = "absolute",
defaultShowUptime = true,
defaultCommunityTheme = "default",
+ defaultRadius = "square",
}: {
children: React.ReactNode;
- defaultVariant?: VariantType;
defaultCardType?: CardType;
defaultBarType?: BarType;
defaultShowUptime?: boolean;
defaultCommunityTheme?: CommunityTheme;
+ defaultRadius?: Radius;
}) {
- const [variant, setVariant] = useState<VariantType>(defaultVariant);
const [cardType, setCardType] = useState<CardType>(defaultCardType);
const [barType, setBarType] = useState<BarType>(defaultBarType);
const [showUptime, setShowUptime] = useState<boolean>(defaultShowUptime);
+ const [radius, setRadius] = useState<Radius>(defaultRadius);
const { resolvedTheme } = useTheme();
const [communityTheme, setCommunityTheme] = useState<CommunityTheme>(
defaultCommunityTheme,
@@ -105,11 +108,20 @@ export function StatusPageProvider({
}
}, [resolvedTheme, communityTheme]);
+ useEffect(() => {
+ const computedRadius = getComputedStyle(
+ document.documentElement,
+ ).getPropertyValue("--radius");
+ if (radius === "square" && computedRadius !== "0rem") {
+ document.documentElement.style.setProperty("--radius", "0rem");
+ } else if (radius === "rounded" && computedRadius !== "0.625rem") {
+ document.documentElement.style.setProperty("--radius", "0.625rem");
+ }
+ }, [radius]);
+
return (
<StatusPageContext.Provider
value={{
- variant,
- setVariant,
cardType,
setCardType,
barType,
@@ -118,12 +130,16 @@ export function StatusPageProvider({
setShowUptime,
communityTheme,
setCommunityTheme,
+ radius,
+ setRadius,
}}
>
<div
style={
communityTheme
- ? THEMES[communityTheme][resolvedTheme as "dark" | "light"]
+ ? (THEMES[communityTheme][
+ resolvedTheme as "dark" | "light"
+ ] as React.CSSProperties)
: undefined
}
>
@@ -133,10 +149,12 @@ export function StatusPageProvider({
);
}
+const DISPLAY_FLOATING_BUTTON =
+ process.env.NODE_ENV === "development" ||
+ process.env.NEXT_PUBLIC_ENABLE_FLOATING_BUTTON === "true";
+
export function FloatingButton({ className }: { className?: string }) {
const {
- variant,
- setVariant,
cardType,
setCardType,
barType,
@@ -145,8 +163,12 @@ export function FloatingButton({ className }: { className?: string }) {
setShowUptime,
communityTheme,
setCommunityTheme,
+ radius,
+ setRadius,
} = useStatusPage();
+ if (!DISPLAY_FLOATING_BUTTON) return null;
+
return (
<div className={cn("fixed right-4 bottom-4 z-50", className)}>
<Popover>
@@ -154,7 +176,7 @@ export function FloatingButton({ className }: { className?: string }) {
<Button
size="icon"
variant="outline"
- className="size-12 rounded-full"
+ className="size-12 rounded-full dark:bg-background"
>
<Settings className="size-5" />
<span className="sr-only">Open status page settings</span>
@@ -169,28 +191,6 @@ export function FloatingButton({ className }: { className?: string }) {
</p>
</div>
<div className="grid grid-cols-2 gap-4">
- <div className="space-y-2">
- <Label htmlFor="status-variant">Status Variant</Label>
- <Select
- value={variant}
- onValueChange={(v) => setVariant(v as VariantType)}
- >
- <SelectTrigger
- id="status-variant"
- className="w-full capitalize"
- disabled
- >
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {VARIANT.map((v) => (
- <SelectItem key={v} value={v} className="capitalize">
- {v}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
<div className="space-y-2">
<Label htmlFor="show-uptime">Show Uptime</Label>
<Select
@@ -283,6 +283,24 @@ export function FloatingButton({ className }: { className?: string }) {
</SelectContent>
</Select>
</div>
+ <div className="space-y-2">
+ <Label htmlFor="radius">Radius</Label>
+ <Select
+ value={radius}
+ onValueChange={(v) => setRadius(v as Radius)}
+ >
+ <SelectTrigger id="radius" className="w-full capitalize">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {RADIUS.map((v) => (
+ <SelectItem key={v} value={v} className="capitalize">
+ {v}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
</div>
</div>
<Separator />
diff --git a/apps/status-page/src/components/status-page/floating-theme.tsx b/apps/status-page/src/components/status-page/floating-theme.tsx
new file mode 100644
index 000000000..bd811f3cd
--- /dev/null
+++ b/apps/status-page/src/components/status-page/floating-theme.tsx
@@ -0,0 +1,102 @@
+"use client";
+
+import { ThemeToggle } from "@/components/theme-toggle";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/ui/popover";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { THEMES, THEME_KEYS } from "@/lib/community-themes";
+import { cn } from "@/lib/utils";
+import { Palette } from "lucide-react";
+import { useEffect } from "react";
+import { useState } from "react";
+import { useStatusPage } from "./floating-button";
+
+export const COMMUNITY_THEME = THEME_KEYS;
+export type CommunityTheme = (typeof COMMUNITY_THEME)[number];
+
+export function FloatingTheme({ className }: { className?: string }) {
+ const { communityTheme, setCommunityTheme } = useStatusPage();
+ const [display, setDisplay] = useState(false);
+
+ useEffect(() => {
+ const enabled = sessionStorage.getItem("community-theme") === "true";
+ const host = window.location.host;
+ if (
+ (host.includes("localhost") ||
+ host.includes("stpg.dev") ||
+ host.includes("vercel.app")) &&
+ enabled
+ ) {
+ setDisplay(true);
+ }
+ }, []);
+
+ if (!display) return null;
+
+ return (
+ <div className={cn("fixed right-4 bottom-4 z-50", className)}>
+ <Popover>
+ <PopoverTrigger asChild>
+ <Button
+ size="icon"
+ variant="outline"
+ className="size-12 rounded-full dark:bg-background"
+ >
+ <Palette className="size-5" />
+ <span className="sr-only">Open theme settings</span>
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-80 p-0" align="end">
+ <div className="space-y-4 p-4">
+ <div className="space-y-2">
+ <h4 className="font-medium leading-none">Theme Settings</h4>
+ <p className="text-muted-foreground text-sm">
+ Test the community themes on the status page.
+ </p>
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="theme">Theme</Label>
+ <ThemeToggle id="theme" className="w-full" />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="community-theme">Community Theme</Label>
+ <Select
+ value={communityTheme}
+ onValueChange={(v) => setCommunityTheme(v as CommunityTheme)}
+ >
+ <SelectTrigger
+ id="community-theme"
+ className="w-full capitalize"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {COMMUNITY_THEME.map((theme) => (
+ <SelectItem
+ key={theme}
+ value={theme}
+ className="capitalize"
+ >
+ {THEMES[theme].name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ </div>
+ </PopoverContent>
+ </Popover>
+ </div>
+ );
+}
diff --git a/apps/status-page/src/components/status-page/status-banner.tsx b/apps/status-page/src/components/status-page/status-banner.tsx
index a3c56be12..2d9772cfd 100644
--- a/apps/status-page/src/components/status-page/status-banner.tsx
+++ b/apps/status-page/src/components/status-page/status-banner.tsx
@@ -1,3 +1,4 @@
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { cn } from "@/lib/utils";
import {
AlertCircleIcon,
@@ -48,10 +49,10 @@ export function StatusBannerContainer({
data-status={status}
className={cn(
"group/status-banner overflow-hidden rounded-lg border",
- "data-[status=success]:border-success",
- "data-[status=degraded]:border-warning",
- "data-[status=error]:border-destructive",
- "data-[status=info]:border-info",
+ "data-[status=success]:border-success data-[status=success]:bg-success/5 dark:data-[status=success]:bg-success/10",
+ "data-[status=degraded]:border-warning data-[status=degraded]:bg-warning/5 dark:data-[status=degraded]:bg-warning/10",
+ "data-[status=error]:border-destructive data-[status=error]:bg-destructive/5 dark:data-[status=error]:bg-destructive/10",
+ "data-[status=info]:border-info data-[status=info]:bg-info/5 dark:data-[status=info]:bg-info/10",
className,
)}
>
@@ -90,7 +91,7 @@ export function StatusBannerTitle({
return (
<div
className={cn(
- "px-3 py-2 font-medium text-background sm:px-4 sm:py-3",
+ "px-3 py-2 font-medium text-background",
"group-data-[status=success]/status-banner:bg-success",
"group-data-[status=degraded]/status-banner:bg-warning",
"group-data-[status=error]/status-banner:bg-destructive",
@@ -139,3 +140,96 @@ export function StatusBannerIcon({
</div>
);
}
+
+// Tabs Components
+
+export function StatusBannerTabs({
+ className,
+ children,
+ status,
+ ...props
+}: React.ComponentProps<typeof Tabs> & {
+ status?: "success" | "degraded" | "error" | "info";
+}) {
+ return (
+ <Tabs
+ data-slot="status-banner-tabs"
+ data-status={status}
+ className={cn(
+ "gap-0",
+ "data-[status=success]:bg-success/20",
+ "data-[status=degraded]:bg-warning/20",
+ "data-[status=error]:bg-destructive/20",
+ "data-[status=info]:bg-info/20",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </Tabs>
+ );
+}
+
+export function StatusBannerTabsList({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof TabsList>) {
+ return (
+ <div className={cn("rounded-t-lg", "w-full overflow-x-auto")}>
+ <TabsList
+ className={cn(
+ "rounded-none rounded-t-lg p-0",
+ "border-none",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </TabsList>
+ </div>
+ );
+}
+
+export function StatusBannerTabsTrigger({
+ className,
+ children,
+ status,
+ ...props
+}: React.ComponentProps<typeof TabsTrigger> & {
+ status?: "success" | "degraded" | "error" | "info";
+}) {
+ return (
+ <TabsTrigger
+ data-slot="status-banner-tabs-trigger"
+ data-status={status}
+ className={cn(
+ "font-mono",
+ "rounded-none border-none focus-visible:ring-inset",
+ "h-full text-foreground data-[state=active]:text-background dark:text-foreground dark:data-[state=active]:text-background",
+ "data-[state=active]:data-[status=success]:bg-success data-[status=success]:bg-success/50 dark:data-[state=active]:data-[status=success]:bg-success dark:data-[status=success]:bg-success/50",
+ "data-[state=active]:data-[status=degraded]:bg-warning data-[status=degraded]:bg-warning/50 dark:data-[state=active]:data-[status=degraded]:bg-warning dark:data-[status=degraded]:bg-warning/50",
+ "data-[state=active]:data-[status=error]:bg-destructive data-[status=error]:bg-destructive/50 dark:data-[state=active]:data-[status=error]:bg-destructive dark:data-[status=error]:bg-destructive/50",
+ "data-[state=active]:data-[status=info]:bg-info data-[status=info]:bg-info/50 dark:data-[state=active]:data-[status=info]:bg-info dark:data-[status=info]:bg-info/50",
+ "data-[state=active]:shadow-none",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </TabsTrigger>
+ );
+}
+
+// NOTE: tabing into content is not being highlighted
+export function StatusBannerTabsContent({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof TabsContent>) {
+ return (
+ <TabsContent className={cn("-mx-3", className)} {...props}>
+ {children}
+ </TabsContent>
+ );
+}
diff --git a/apps/status-page/src/components/status-page/status-blank.tsx b/apps/status-page/src/components/status-page/status-blank.tsx
new file mode 100644
index 000000000..833d9a70e
--- /dev/null
+++ b/apps/status-page/src/components/status-page/status-blank.tsx
@@ -0,0 +1,194 @@
+import { cn } from "@/lib/utils";
+
+export function StatusBlankContainer({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn(
+ "flex flex-col items-center justify-center gap-2 rounded-lg border bg-muted/30 px-3 py-2 text-center sm:px-8 sm:py-6",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function StatusBlankTitle({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div className={cn("font-medium", className)} {...props}>
+ {children}
+ </div>
+ );
+}
+
+export function StatusBlankDescription({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn("font-mono text-muted-foreground text-sm", className)}
+ {...props}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function StatusBlankContent({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div className={cn("", className)} {...props}>
+ {children}
+ </div>
+ );
+}
+
+export function StatusBlankReport({ ...props }: React.ComponentProps<"div">) {
+ return (
+ <StatusBlankPage {...props}>
+ <StatusBlankPageHeader />
+ <div className="flex w-full flex-col">
+ <StatusBlankReportUpdate />
+ <StatusBlankReportUpdate />
+ </div>
+ <StatusBlankOverlay />
+ </StatusBlankPage>
+ );
+}
+
+export function StatusBlankMonitor({ ...props }: React.ComponentProps<"div">) {
+ return (
+ <StatusBlankPage {...props}>
+ <StatusBlankPageHeader />
+ <StatusBlankMonitorUptime />
+ <StatusBlankOverlay />
+ </StatusBlankPage>
+ );
+}
+
+export function StatusBlankPage({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn(
+ "relative flex w-full max-w-xs flex-1 flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border border-border/70 bg-background px-3 py-2 text-center",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function StatusBlankPageHeader({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn(
+ "flex w-full items-center justify-between gap-4",
+ className,
+ )}
+ {...props}
+ >
+ <div className="size-3 rounded-sm bg-accent/60" />
+ <div className="flex flex-row gap-1">
+ <div className="h-3 w-8 rounded-sm bg-accent/60" />
+ <div className="h-3 w-8 rounded-sm bg-accent/60" />
+ <div className="h-3 w-8 rounded-sm bg-accent/60" />
+ </div>
+ <div className="h-3 w-8 rounded-sm bg-accent/60" />
+ </div>
+ );
+}
+
+export function StatusBlankMonitorUptime({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn(
+ "flex w-full flex-col items-center justify-between gap-1",
+ className,
+ )}
+ {...props}
+ >
+ <div className="flex w-full flex-row gap-1">
+ <div className="h-3 w-8 rounded-sm bg-accent" />
+ <div className="h-3 w-12 rounded-sm bg-accent" />
+ <div className="h-3 w-10 rounded-sm bg-accent" />
+ </div>
+ <div className="flex w-full flex-row items-end gap-0.5">
+ {Array.from({ length: 30 }).map((_, index) => (
+ <div
+ key={index}
+ className={cn(
+ "h-12 flex-1 rounded-sm bg-accent",
+ [10, 20].includes(index) && "h-8",
+ [25].includes(index) && "h-10",
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ );
+}
+
+export function StatusBlankReportUpdate({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div className={cn("flex w-full items-start gap-2", className)} {...props}>
+ <div className="flex h-full flex-col items-center gap-0.5">
+ <div className="size-3 rounded-sm bg-accent" />
+ </div>
+ <div className="flex flex-1 flex-col gap-1 pb-2">
+ <div className="flex items-center gap-1">
+ <div className="h-3 w-12 rounded-sm bg-accent" />
+ <div className="h-3 w-16 rounded-sm bg-accent" />
+ </div>
+ <div className="h-3 w-full rounded-sm bg-accent" />
+ <div className="h-3 w-full rounded-sm bg-accent" />
+ </div>
+ </div>
+ );
+}
+
+export function StatusBlankOverlay({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ className={cn(
+ "absolute inset-0 flex flex-col items-center justify-center gap-2 bg-gradient-to-b from-40% from-transparent to-background p-2",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ );
+}
diff --git a/apps/status-page/src/components/status-page/status-events.tsx b/apps/status-page/src/components/status-page/status-events.tsx
index f574aa0e0..b10d2e790 100644
--- a/apps/status-page/src/components/status-page/status-events.tsx
+++ b/apps/status-page/src/components/status-page/status-events.tsx
@@ -124,6 +124,7 @@ export function StatusEventTimelineReport({
}
withSeparator={index !== updates.length - 1}
withDot={withDot}
+ isLast={index === updates.length - 1}
/>
))}
</div>
@@ -135,6 +136,7 @@ function StatusEventTimelineReportUpdate({
duration,
withSeparator = true,
withDot = true,
+ isLast = false,
}: {
report: {
date: Date;
@@ -144,6 +146,7 @@ function StatusEventTimelineReportUpdate({
withSeparator?: boolean;
duration?: string;
withDot?: boolean;
+ isLast?: boolean;
}) {
return (
<div data-variant={report.status} className="group">
@@ -157,7 +160,7 @@ function StatusEventTimelineReportUpdate({
{withSeparator ? <StatusEventTimelineSeparator /> : null}
</div>
) : null}
- <div className="mb-2">
+ <div className={cn(isLast ? "mb-0" : "mb-2")}>
<StatusEventTimelineTitle>
<span>{status[report.status]}</span>{" "}
{/* underline decoration-dashed underline-offset-2 decoration-muted-foreground/30 */}
@@ -209,7 +212,8 @@ export function StatusEventTimelineMaintenance({
</div>
</div>
) : null}
- <div className="mb-2">
+ {/* NOTE: is always last, no need for className="mb-2" */}
+ <div>
<StatusEventTimelineTitle>
<span>Maintenance</span>{" "}
<span className="font-mono text-muted-foreground/70 text-xs">
@@ -259,7 +263,10 @@ export function StatusEventTimelineMessage({
...props
}: React.ComponentProps<"div">) {
return (
- <div className={cn("text-muted-foreground text-sm", className)} {...props}>
+ <div
+ className={cn("font-mono text-muted-foreground text-sm", className)}
+ {...props}
+ >
{children}
</div>
);
diff --git a/apps/status-page/src/components/status-page/status-feed.tsx b/apps/status-page/src/components/status-page/status-feed.tsx
index 2eb3fe2d1..c59463c35 100644
--- a/apps/status-page/src/components/status-page/status-feed.tsx
+++ b/apps/status-page/src/components/status-page/status-feed.tsx
@@ -4,13 +4,14 @@ import { Badge } from "@/components/ui/badge";
import { usePathnamePrefix } from "@/hooks/use-pathname-prefix";
import { formatDate } from "@/lib/formatter";
import { cn } from "@/lib/utils";
-import { Newspaper } from "lucide-react";
import Link from "next/link";
import {
- StatusEmptyState,
- StatusEmptyStateDescription,
- StatusEmptyStateTitle,
-} from "./status";
+ StatusBlankContainer,
+ StatusBlankContent,
+ StatusBlankDescription,
+ StatusBlankReport,
+ StatusBlankTitle,
+} from "./status-blank";
import {
StatusEvent,
StatusEventAffected,
@@ -80,13 +81,19 @@ export function StatusFeed({
if (unifiedEvents.length === 0) {
return (
- <StatusEmptyState>
- <Newspaper className="size-4 text-muted-foreground" />
- <StatusEmptyStateTitle>No recent reports</StatusEmptyStateTitle>
- <StatusEmptyStateDescription>
- There have been no reports within the last 7 days.
- </StatusEmptyStateDescription>
- </StatusEmptyState>
+ <StatusBlankContainer>
+ <div className="relative mt-8 flex w-full flex-col items-center justify-center">
+ <StatusBlankReport className="-top-16 absolute scale-60 opacity-50" />
+ <StatusBlankReport className="-top-8 absolute scale-80 opacity-80" />
+ <StatusBlankReport />
+ </div>
+ <StatusBlankContent>
+ <StatusBlankTitle>No recent notifications</StatusBlankTitle>
+ <StatusBlankDescription>
+ There have been no reports within the last 7 days.
+ </StatusBlankDescription>
+ </StatusBlankContent>
+ </StatusBlankContainer>
);
}
diff --git a/apps/status-page/src/components/status-page/status-monitor.tsx b/apps/status-page/src/components/status-page/status-monitor.tsx
index 899a67d3f..0e47e4be4 100644
--- a/apps/status-page/src/components/status-page/status-monitor.tsx
+++ b/apps/status-page/src/components/status-page/status-monitor.tsx
@@ -56,7 +56,7 @@ export function StatusMonitor({
{...props}
>
<div className="flex flex-row items-center justify-between gap-4">
- <div className="flex flex-row items-center gap-2">
+ <div className="flex min-w-0 flex-row items-center gap-2">
<StatusMonitorTitle>{monitor.name}</StatusMonitorTitle>
<StatusMonitorDescription>
{monitor.description}
@@ -74,7 +74,7 @@ export function StatusMonitor({
<StatusMonitorIcon />
</>
) : (
- <StatusMonitorStatus className="text-sm" />
+ <StatusMonitorStatus />
)}
</div>
</div>
@@ -90,7 +90,13 @@ export function StatusMonitorTitle({
...props
}: React.ComponentProps<"div">) {
return (
- <div className={cn("font-medium", className)} {...props}>
+ <div
+ className={cn(
+ "truncate font-medium font-mono text-base text-foreground leading-5",
+ className,
+ )}
+ {...props}
+ >
{children}
</div>
);
@@ -134,7 +140,7 @@ export function StatusMonitorIcon({
return (
<div
className={cn(
- "flex size-4 items-center justify-center rounded-full bg-muted text-background [&>svg]:size-2.5",
+ "flex size-[12.5px] items-center justify-center rounded-full bg-muted text-background [&>svg]:size-[9px]",
"group-data-[variant=success]/monitor:bg-success",
"group-data-[variant=degraded]/monitor:bg-warning",
"group-data-[variant=error]/monitor:bg-destructive",
@@ -159,10 +165,10 @@ export function StatusMonitorFooter({
isLoading?: boolean;
}) {
return (
- <div className="flex flex-row items-center justify-between text-muted-foreground text-xs">
+ <div className="flex flex-row items-center justify-between font-mono text-muted-foreground text-xs leading-none">
<div>
{isLoading ? (
- <Skeleton className="h-4 w-18" />
+ <Skeleton className="h-3 w-18" />
) : data.length > 0 ? (
formatDistanceToNowStrict(new Date(data[0].day), {
unit: "day",
@@ -185,7 +191,10 @@ export function StatusMonitorUptime({
return (
<div
{...props}
- className={cn("font-mono text-muted-foreground text-sm", className)}
+ className={cn(
+ "font-mono text-foreground/80 text-sm leading-none",
+ className,
+ )}
>
{children}
</div>
@@ -206,6 +215,7 @@ export function StatusMonitorStatus({
return (
<div
className={cn(
+ "font-mono text-sm leading-none",
"group-data-[variant=success]/monitor:text-success",
"group-data-[variant=degraded]/monitor:text-warning",
"group-data-[variant=error]/monitor:text-destructive",
diff --git a/apps/status-page/src/components/status-page/status-tracker.tsx b/apps/status-page/src/components/status-page/status-tracker.tsx
index 8116d7457..7feb92f51 100644
--- a/apps/status-page/src/components/status-page/status-tracker.tsx
+++ b/apps/status-page/src/components/status-page/status-tracker.tsx
@@ -82,6 +82,15 @@ export function StatusTracker({ data }: { data: UptimeData }) {
setFocusedIndex(null);
setHoveredIndex(null);
+ if (focusedIndex !== null) {
+ const buttons =
+ containerRef.current?.querySelectorAll('[role="button"]');
+ const button = buttons?.[focusedIndex] as HTMLElement;
+ if (button) {
+ button.blur();
+ }
+ }
+
if (hoverTimeoutRef.current) {
clearTimeout(hoverTimeoutRef.current);
hoverTimeoutRef.current = null;
@@ -103,7 +112,40 @@ export function StatusTracker({ data }: { data: UptimeData }) {
prev !== null && prev < data.length - 1 ? prev + 1 : 0,
);
break;
+ case "ArrowUp":
+ e.preventDefault();
+ const prevMonitor = containerRef.current?.closest(
+ '[data-slot="status-monitor"]',
+ )?.previousElementSibling;
+ if (prevMonitor) {
+ const prevTracker = prevMonitor.querySelector('[role="toolbar"]');
+ if (prevTracker) {
+ const buttons = prevTracker.querySelectorAll('[role="button"]');
+ const button = buttons?.[focusedIndex] as HTMLElement;
+ if (button) {
+ button.focus();
+ }
+ }
+ }
+ break;
+ case "ArrowDown":
+ e.preventDefault();
+ const nextMonitor = containerRef.current?.closest(
+ '[data-slot="status-monitor"]',
+ )?.nextElementSibling;
+ if (nextMonitor) {
+ const nextTracker = nextMonitor.querySelector('[role="toolbar"]');
+ if (nextTracker) {
+ const buttons = nextTracker.querySelectorAll('[role="button"]');
+ const button = buttons?.[focusedIndex] as HTMLElement;
+ if (button) {
+ button.focus();
+ }
+ }
+ }
+ break;
case "Enter":
+ case "Escape":
case " ":
e.preventDefault();
handleBarClick(focusedIndex);
@@ -189,7 +231,7 @@ export function StatusTracker({ data }: { data: UptimeData }) {
<HoverCardTrigger asChild>
<div
className={cn(
- "group relative flex h-full w-full cursor-pointer flex-col px-px outline-none hover:opacity-80 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 data-[aria-pressed=true]:opacity-80",
+ "group relative mx-px flex h-full w-full cursor-pointer flex-col outline-none first:ml-0 last:mr-0 hover:opacity-80 focus-visible:opacity-80 focus-visible:ring-[2px] focus-visible:ring-ring/50 data-[aria-pressed=true]:opacity-80",
)}
onClick={() => handleBarClick(index)}
onFocus={() => handleBarFocus(index)}
@@ -197,7 +239,11 @@ export function StatusTracker({ data }: { data: UptimeData }) {
onMouseEnter={() => handleBarMouseEnter(index)}
onMouseLeave={handleBarMouseLeave}
tabIndex={
- index === 0 && focusedIndex === null ? 0 : isFocused ? 0 : -1
+ index === data.length - 1 && focusedIndex === null
+ ? 0
+ : isFocused
+ ? 0
+ : -1
}
role="button"
aria-label={`Day ${index + 1} status`}
diff --git a/apps/status-page/src/components/status-page/status-updates.tsx b/apps/status-page/src/components/status-page/status-updates.tsx
index 00f5436bf..70504a4c1 100644
--- a/apps/status-page/src/components/status-page/status-updates.tsx
+++ b/apps/status-page/src/components/status-page/status-updates.tsx
@@ -8,13 +8,16 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
+import { Separator } from "@/components/ui/separator";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard";
import { cn } from "@/lib/utils";
-import { Inbox } from "lucide-react";
+import { Check, Copy, Inbox } from "lucide-react";
import { useState } from "react";
-type StatusUpdateType = "email" | "rss" | "atom" | "ssh";
+type StatusUpdateType = "email" | "rss" | "ssh";
+
+// TODO: use domain instead of openstatus subdomain if available
interface StatusUpdatesProps extends React.ComponentProps<typeof Button> {
types?: StatusUpdateType[];
@@ -24,7 +27,7 @@ interface StatusUpdatesProps extends React.ComponentProps<typeof Button> {
export function StatusUpdates({
className,
- types = ["rss", "atom"],
+ types = ["rss", "ssh"],
slug,
onSubscribe,
...props
@@ -43,7 +46,7 @@ export function StatusUpdates({
Get updates
</Button>
</PopoverTrigger>
- <PopoverContent align="end" className="overflow-hidden p-0">
+ <PopoverContent align="end" className="w-80 overflow-hidden p-0">
<Tabs defaultValue="email">
<TabsList className="w-full rounded-none border-b">
{types.includes("email") ? (
@@ -52,9 +55,6 @@ export function StatusUpdates({
{types.includes("rss") ? (
<TabsTrigger value="rss">RSS</TabsTrigger>
) : null}
- {types.includes("atom") ? (
- <TabsTrigger value="atom">Atom</TabsTrigger>
- ) : null}
{types.includes("ssh") ? (
<TabsTrigger value="ssh">SSH</TabsTrigger>
) : null}
@@ -65,7 +65,7 @@ export function StatusUpdates({
) : (
<>
<div className="flex flex-col gap-2 border-b px-2 pb-2">
- <p className="text-foreground text-sm">
+ <p className="text-sm">
Get email notifications whenever a report has been created
or resolved
</p>
@@ -86,40 +86,30 @@ export function StatusUpdates({
)}
</TabsContent>
<TabsContent value="rss" className="flex flex-col gap-2">
- <div className="border-b px-2 pb-2">
- <Input
- placeholder={`https://${slug}.openstatus.dev/feed/rss`}
- readOnly
- />
- </div>
- <div className="px-2 pb-2">
- <CopyButton
+ <div className="flex flex-col gap-2 px-2">
+ <p className="text-sm">Get the RSS feed</p>
+ <CopyInputButton
className="w-full"
+ id="rss"
value={`https://${slug}.openstatus.dev/feed/rss`}
/>
</div>
- </TabsContent>
- <TabsContent value="atom" className="flex flex-col gap-2">
- <div className="border-b px-2 pb-2">
- <Input
- placeholder={`https://${slug}.openstatus.dev/feed/atom`}
- readOnly
- />
- </div>
- <div className="px-2 pb-2">
- <CopyButton
+ <Separator />
+ <div className="flex flex-col gap-2 px-2 pb-2">
+ <p className="text-sm">Get the Atom feed</p>
+ <CopyInputButton
className="w-full"
+ id="atom"
value={`https://${slug}.openstatus.dev/feed/atom`}
/>
</div>
</TabsContent>
<TabsContent value="ssh" className="flex flex-col gap-2">
- <div className="border-b px-2 pb-2">
- <Input placeholder={`ssh ${slug}@ssh.openstatus.dev`} readOnly />
- </div>
- <div className="px-2 pb-2">
- <CopyButton
+ <div className="flex flex-col gap-2 px-2 pb-2">
+ <p className="text-sm">Get status via SSH</p>
+ <CopyInputButton
className="w-full"
+ id="ssh"
value={`ssh ${slug}@ssh.openstatus.dev`}
/>
</div>
@@ -130,6 +120,44 @@ export function StatusUpdates({
);
}
+function CopyInputButton({
+ value,
+ onClick,
+ ...props
+}: React.ComponentProps<typeof Input> & {
+ value: string;
+}) {
+ const { copy, isCopied } = useCopyToClipboard();
+ return (
+ <div className="relative w-full">
+ <Input
+ placeholder={value}
+ readOnly
+ onClick={(e) => {
+ copy(value, {
+ successMessage: "Link copied to clipboard",
+ });
+ onClick?.(e);
+ }}
+ {...props}
+ />
+ <Button
+ variant="outline"
+ size="icon"
+ onClick={() =>
+ copy(value, {
+ successMessage: "Link copied to clipboard",
+ })
+ }
+ className="-translate-y-1/2 absolute top-1/2 right-2 size-6"
+ >
+ {isCopied ? <Check /> : <Copy />}
+ <span className="sr-only">Copy Link</span>
+ </Button>
+ </div>
+ );
+}
+
function CopyButton({
value,
onClick,
diff --git a/apps/status-page/src/components/status-page/status.tsx b/apps/status-page/src/components/status-page/status.tsx
index 524906920..eb0d85017 100644
--- a/apps/status-page/src/components/status-page/status.tsx
+++ b/apps/status-page/src/components/status-page/status.tsx
@@ -181,7 +181,10 @@ export function StatusEmptyStateDescription({
...props
}: React.ComponentProps<"div">) {
return (
- <div className={cn("text-muted-foreground text-sm", className)} {...props}>
+ <div
+ className={cn("font-mono text-muted-foreground text-sm", className)}
+ {...props}
+ >
{children}
</div>
);
diff --git a/apps/status-page/src/components/ui/chart.tsx b/apps/status-page/src/components/ui/chart.tsx
index 9acecd91e..cdfcb8e5f 100644
--- a/apps/status-page/src/components/ui/chart.tsx
+++ b/apps/status-page/src/components/ui/chart.tsx
@@ -205,7 +205,7 @@ function ChartTooltipContent({
!hideIndicator && (
<div
className={cn(
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
+ "shrink-0 rounded-(--radius-xs) border-(--color-border) bg-(--color-bg)",
{
"h-2.5 w-2.5": indicator === "dot",
"w-1": indicator === "line",
@@ -295,7 +295,7 @@ function ChartLegendContent({
<itemConfig.icon />
) : (
<div
- className="h-2 w-2 shrink-0 rounded-[2px]"
+ className="h-2 w-2 shrink-0 rounded-(--radius-xs)"
style={{
backgroundColor: item.color,
}}
diff --git a/apps/status-page/src/lib/community-themes/README.md b/apps/status-page/src/lib/community-themes/README.md
new file mode 100644
index 000000000..5d785248b
--- /dev/null
+++ b/apps/status-page/src/lib/community-themes/README.md
@@ -0,0 +1,98 @@
+# Community Themes
+
+This directory contains community-contributed themes for openstatus status pages. These themes allow users to customize the visual appearance of their status pages with different color schemes and design styles.
+
+## What are Community Themes?
+
+Community themes are predefined color schemes that users can apply to their status pages. Each theme includes:
+- **Light mode** colors for bright environments
+- **Dark mode** colors for low-light environments
+- **Consistent design** that works across all status page components
+- **Accessibility** considerations for better readability
+
+## Themes Examples
+
+- **Default** - The standard openstatus theme
+- **GitHub (High Contrast)** - High contrast theme inspired by GitHub's design
+- **Supabase** - Theme matching Supabase's brand colors
+
+## Creating a New Theme
+
+Want to contribute a theme? Follow these steps:
+
+### 1. Fork the Repository
+Start by forking the openstatus repository to your GitHub account.
+
+### 2. Create Your Theme File
+Create a new TypeScript file in this directory (e.g., `my-theme.ts`). You can copy an existing theme file as a starting template.
+
+### 3. Define Your Theme
+Your theme file should export a constant that matches the `Theme` interface:
+
+```typescript
+import type { Theme } from "./types";
+
+export const MY_THEME = {
+ id: "my-theme", // Unique identifier (kebab-case)
+ name: "My Awesome Theme", // Display name
+ author: {
+ name: "@yourusername",
+ url: "https://github.com/yourusername"
+ },
+ light: {
+ // CSS custom properties for light mode
+ "--background": "oklch(100% 0 0)",
+ "--foreground": "oklch(20% 0 0)",
+ // ... more variables
+ },
+ dark: {
+ // CSS custom properties for dark mode
+ "--background": "oklch(10% 0 0)",
+ "--foreground": "oklch(90% 0 0)",
+ // ... more variables
+ },
+} as const satisfies Theme;
+```
+
+### 4. Add to Theme Registry
+Update `index.ts` to include your theme in the `THEMES_LIST` array.
+
+### 5. Submit a Pull Request
+Create a pull request with your theme for review.
+
+## Design Guidelines
+
+### Color System
+- Use **OKLCH color space** for better perceptual uniformity
+- Ensure sufficient contrast ratios for accessibility
+- Test both light and dark modes thoroughly
+
+### Theme Requirements
+- ✅ **Consistent design** - All components should feel cohesive
+- ✅ **Both modes** - Must support light and dark variants
+- ✅ **Accessibility** - Meet WCAG contrast guidelines
+- ✅ **Unique ID** - Use descriptive, kebab-case identifiers
+- ❌ **No "Christmas tree"** - Avoid overly colorful or distracting designs
+
+### Available CSS Variables
+Themes can customize these CSS custom properties:
+- `--background`, `--foreground` - Base colors
+- `--primary`, `--secondary`, `--accent` - Brand colors
+- `--success`, `--warning`, `--destructive` - Status colors
+- `--border`, `--input`, `--ring` - Interactive elements
+- `--muted`, `--muted-foreground` - Subtle text and backgrounds
+- And many more... (see `types.ts` for the complete list)
+
+## Testing Your Theme
+
+Before submitting:
+1. Test your theme on a status page
+2. Verify both light and dark modes work correctly
+3. Check accessibility with browser dev tools
+4. Ensure all status indicators (operational, degraded, etc.) are clearly distinguishable
+
+To test a theme, you can use the `sessionStorage.setItem("community-theme", "true");` on your stpg.dev or vercel preview link. It will open a floating button on the right left corner where you can choose between the themes and dark/light mode.
+
+## Questions?
+
+Need help creating a theme? Open an issue or reach out to the openstatus community!
\ No newline at end of file
diff --git a/apps/status-page/src/lib/community-themes/github-contrast.ts b/apps/status-page/src/lib/community-themes/github-contrast.ts
new file mode 100644
index 000000000..b7c9ef361
--- /dev/null
+++ b/apps/status-page/src/lib/community-themes/github-contrast.ts
@@ -0,0 +1,47 @@
+import type { Theme } from "./types";
+
+export const GITHUB_CONTRAST = {
+ id: "github-contrast",
+ name: "Github (High Contrast)",
+ author: { name: "@openstatus", url: "https://openstatus.dev" },
+ light: {
+ "--background": "oklch(100% 0 0)",
+ "--foreground": "oklch(24.29% 0.0045 247.86)",
+ "--border": "oklch(85.86% 0.0054 251.18)",
+ "--input": "oklch(85.86% 0.0054 251.18)",
+
+ "--primary": "oklch(60.81% 0.1567 142.5)",
+ "--primary-foreground": "oklch(24.29% 0.0045 247.86)",
+ "--muted": "oklch(97.86% 0.0019 247.86)",
+ "--muted-foreground": "oklch(40.78% 0.0056 247.86)",
+ "--secondary": "oklch(97.86% 0.0019 247.86)",
+ "--secondary-foreground": "oklch(24.29% 0.0045 247.86)",
+ "--accent": "oklch(97.86% 0.0019 247.86)",
+ "--accent-foreground": "oklch(24.29% 0.0045 247.86)",
+
+ "--success": "oklch(60.81% 0.1567 142.5)",
+ "--destructive": "oklch(58.79% 0.1577 22.18)",
+ "--warning": "oklch(81.84% 0.1328 85.87)",
+ "--info": "oklch(45.2% 0.1445 252.03)",
+ },
+ dark: {
+ "--background": "oklch(10.39% 0.0194 248.34)",
+ "--foreground": "oklch(100% 0 0)",
+ "--border": "oklch(58.41% 0.011 252.87)",
+ "--input": "oklch(58.41% 0.011 252.87)",
+
+ "--primary": "oklch(54.34% 0.1634 145.98)",
+ "--primary-foreground": "oklch(100% 0 0)",
+ "--muted": "oklch(33.39% 0.0223 256.4)",
+ "--muted-foreground": "oklch(79.7% 0.0169 262.74)",
+ "--secondary": "oklch(33.39% 0.0223 256.4)",
+ "--secondary-foreground": "oklch(100% 0 0)",
+ "--accent": "oklch(33.39% 0.0223 256.4)",
+ "--accent-foreground": "oklch(100% 0 0)",
+
+ "--success": "oklch(54.34% 0.1634 145.98)",
+ "--destructive": "oklch(47.1% 0.1909 25.95)",
+ "--warning": "oklch(81.84% 0.1328 85.87)",
+ "--info": "oklch(46.96% 0.2957 264.51)",
+ },
+} as const satisfies Theme;
diff --git a/apps/status-page/src/lib/community-themes/index.ts b/apps/status-page/src/lib/community-themes/index.ts
new file mode 100644
index 000000000..dee095661
--- /dev/null
+++ b/apps/status-page/src/lib/community-themes/index.ts
@@ -0,0 +1,26 @@
+export * from "./types";
+import { GITHUB_CONTRAST } from "./github-contrast";
+import { SUPABASE } from "./supabase";
+import type { Theme, ThemeMap } from "./types";
+
+const DEFAULT_THEME = {
+ id: "default" as const,
+ name: "Default",
+ author: { name: "@openstatus", url: "https://openstatus.dev" },
+ light: {},
+ dark: {},
+} as const satisfies Theme;
+
+// TODO: Add validation to ensure that the theme IDs are unique
+const THEMES_LIST = [
+ DEFAULT_THEME,
+ GITHUB_CONTRAST,
+ SUPABASE,
+] satisfies Theme[];
+
+export const THEMES = THEMES_LIST.reduce<ThemeMap>((acc, theme) => {
+ acc[theme.id as keyof ThemeMap] = theme;
+ return acc;
+}, {} as ThemeMap);
+
+export const THEME_KEYS = THEMES_LIST.map((theme) => theme.id);
diff --git a/apps/status-page/src/lib/community-themes/supabase.ts b/apps/status-page/src/lib/community-themes/supabase.ts
new file mode 100644
index 000000000..e87867c76
--- /dev/null
+++ b/apps/status-page/src/lib/community-themes/supabase.ts
@@ -0,0 +1,47 @@
+import type { Theme } from "./types";
+
+export const SUPABASE = {
+ id: "supabase",
+ name: "Supabase",
+ author: { name: "@___", url: "#" },
+ light: {
+ "--background": "oklch(99.11% 0 0)",
+ "--foreground": "oklch(20.46% 0 0)",
+ "--border": "oklch(90.37% 0 0)",
+ "--input": "oklch(90.37% 0 0)",
+
+ "--primary": "oklch(76.26% 0.154 159.27)",
+ "--primary-foreground": "oklch(20.46% 0 0)",
+ "--muted": "oklch(97.61% 0 0)",
+ "--muted-foreground": "oklch(54.52% 0 0)",
+ "--secondary": "oklch(97.61% 0 0)",
+ "--secondary-foreground": "oklch(20.46% 0 0)",
+ "--accent": "oklch(97.61% 0 0)",
+ "--accent-foreground": "oklch(20.46% 0 0)",
+
+ "--success": "oklch(76.26% 0.154 159.27)",
+ "--destructive": "oklch(62.71% 0.1936 33.34)",
+ "--warning": "oklch(81.69% 0.1639 75.84)",
+ "--info": "oklch(61.26% 0.218 283.85)",
+ },
+ dark: {
+ "--background": "oklch(18.22% 0 0)",
+ "--foreground": "oklch(98.51% 0 0)",
+ "--border": "oklch(30.12% 0 0)",
+ "--input": "oklch(30.12% 0 0)",
+
+ "--primary": "oklch(68.56% 0.1558 158.13)",
+ "--primary-foreground": "oklch(18.22% 0 0)",
+ "--muted": "oklch(26.03% 0 0)",
+ "--muted-foreground": "oklch(63.01% 0 0)",
+ "--secondary": "oklch(26.03% 0 0)",
+ "--secondary-foreground": "oklch(98.51% 0 0)",
+ "--accent": "oklch(26.03% 0 0)",
+ "--accent-foreground": "oklch(98.51% 0 0)",
+
+ "--success": "oklch(68.56% 0.1558 158.13)",
+ "--destructive": "oklch(62.71% 0.1936 33.34)",
+ "--warning": "oklch(70.84% 0.1523 71.24)",
+ "--info": "oklch(61.26% 0.218 283.85)",
+ },
+} as const satisfies Theme;
diff --git a/apps/status-page/src/lib/community-themes/types.ts b/apps/status-page/src/lib/community-themes/types.ts
new file mode 100644
index 000000000..833692598
--- /dev/null
+++ b/apps/status-page/src/lib/community-themes/types.ts
@@ -0,0 +1,72 @@
+export const THEME_VAR_NAMES = [
+ "--radius",
+ "--background",
+ "--foreground",
+ "--card",
+ "--card-foreground",
+ "--popover",
+ "--popover-foreground",
+ "--primary",
+ "--primary-foreground",
+ "--secondary",
+ "--secondary-foreground",
+ "--muted",
+ "--muted-foreground",
+ "--accent",
+ "--accent-foreground",
+ "--destructive",
+ "--border",
+ "--input",
+ "--ring",
+ "--chart-1",
+ "--chart-2",
+ "--chart-3",
+ "--chart-4",
+ "--chart-5",
+ "--sidebar",
+ "--sidebar-foreground",
+ "--sidebar-primary",
+ "--sidebar-primary-foreground",
+ "--sidebar-accent",
+ "--sidebar-accent-foreground",
+ "--sidebar-border",
+ "--sidebar-ring",
+ "--success",
+ "--warning",
+ "--info",
+ "--rainbow-1",
+ "--rainbow-2",
+ "--rainbow-3",
+ "--rainbow-4",
+ "--rainbow-5",
+ "--rainbow-6",
+ "--rainbow-7",
+ "--rainbow-8",
+ "--rainbow-9",
+ "--rainbow-10",
+ "--rainbow-11",
+ "--rainbow-12",
+ "--rainbow-13",
+ "--rainbow-14",
+ "--rainbow-15",
+ "--rainbow-16",
+ "--rainbow-17",
+] as const;
+
+export type ThemeVarName = (typeof THEME_VAR_NAMES)[number];
+export type ThemeVars = Partial<Record<ThemeVarName, string>>;
+export type ThemeMode = "light" | "dark";
+
+export interface ThemeDefinition {
+ light: ThemeVars;
+ dark: ThemeVars;
+}
+
+export interface ThemeInfo {
+ id: string;
+ name: string;
+ author: { name: string; url: string };
+}
+
+export type Theme = ThemeInfo & ThemeDefinition;
+export type ThemeMap = Record<string, Theme>;
diff --git a/apps/status-page/src/middleware.ts b/apps/status-page/src/middleware.ts
index ec5d8ebd8..bf32d547d 100644
--- a/apps/status-page/src/middleware.ts
+++ b/apps/status-page/src/middleware.ts
@@ -44,10 +44,11 @@ export default async function middleware(req: NextRequest) {
const protectedCookie = cookies.get(createProtectedCookieKey(prefix));
const password = protectedCookie ? protectedCookie.value : undefined;
if (password !== _page.password && !url.pathname.endsWith("/protected")) {
+ const { pathname, origin } = req.nextUrl;
const url = new URL(
- `${req.nextUrl.origin}${
+ `${origin}${
type === "pathname" ? `/${prefix}` : ""
- }/protected?redirect=${encodeURIComponent(req.url)}`,
+ }/protected?redirect=${encodeURIComponent(pathname)}`,
);
return NextResponse.redirect(url);
}
diff --git a/packages/api/src/router/statusPage.ts b/packages/api/src/router/statusPage.ts
index 1db5a7470..934438ede 100644
--- a/packages/api/src/router/statusPage.ts
+++ b/packages/api/src/router/statusPage.ts
@@ -123,14 +123,13 @@ export const statusPageRouter = createTRPCRouter({
const threshold = new Date().getTime() - 7 * 24 * 60 * 60 * 1000;
const lastEvents = pageEvents
.filter((e) => {
- if (e.type !== "incident") return false;
- if (!e.to || e.to.getTime() >= threshold) return true;
+ if (e.type === "incident") return false;
+ if (!e.from || e.from.getTime() >= threshold) return true;
return false;
})
.sort((a, b) => a.from.getTime() - b.from.getTime());
const openEvents = pageEvents.filter((event) => {
- console.log(event.type, event.from, event.to);
if (event.type === "incident" || event.type === "report") {
if (!event.to) return true;
if (event.to < new Date()) return false;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 94702d05d..1709cc65a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -748,6 +748,9 @@ importers:
'@tailwindcss/postcss':
specifier: 4.1.11
version: 4.1.11
+ '@tailwindcss/typography':
+ specifier: 0.5.10
+ version: 0.5.10([email protected])
'@types/dom-speech-recognition':
specifier: 0.0.6
version: 0.0.6
@@ -2617,6 +2620,7 @@ packages:
'@ericcornelissen/[email protected]':
resolution: {integrity: sha512-4pIMTa1nEFfMXitv7oaNEWOdM+zpOZavesa5GaiWTgda6Zk32CFGxjUp/iIaN0PwgUW1yTq/fztSjbpE8SLGZQ==}
engines: {node: '>=4'}
+ deprecated: Support for this package will stop 2025-12-31
'@esbuild-kit/[email protected]':
resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==}
@@ -6497,6 +6501,7 @@ packages:
'@upstash/[email protected]':
resolution: {integrity: sha512-CIr657FZuK+IMuwcxkj3oCB6xKO+LMlHd4BL4J/Lwbpj6+5YHO+5ZcpdMIQhbcemthJcRtE0gDUfZEnrfb3Rjg==}
engines: {node: '>=10'}
+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
'@upstash/[email protected]':
resolution: {integrity: sha512-aB/1yqMJTRyOt7Go2Db1ZIVnmTPpsc2KGY5jpLVcegNtjksaPTJF6fmITxos5HVvsQhS8IB3gvF/+gQfRQlPLQ==}
@@ -17021,6 +17026,14 @@ snapshots:
postcss: 8.5.6
tailwindcss: 4.1.11
+ dependencies:
+ lodash.castarray: 4.4.0
+ lodash.isplainobject: 4.0.6
+ lodash.merge: 4.6.2
+ postcss-selector-parser: 6.0.10
+ tailwindcss: 4.1.11
+
dependencies:
lodash.castarray: 4.4.0