Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
chore: improve web lighthouse accessibility (#1858)
Maximilian Kaske5e17cfb5c814
diff --git a/apps/web/src/content/copy-button.tsx b/apps/web/src/content/copy-button.tsxindex 7ea6e66ff..29d5889fd 100644--- a/apps/web/src/content/copy-button.tsx+++ b/apps/web/src/content/copy-button.tsx@@ -86,7 +86,11 @@ export function CopyDropdownButton({</Button><DropdownMenu><DropdownMenuTrigger asChild>- <Button variant="ghost" className="group rounded-none">+ <Button+ variant="ghost"+ className="group rounded-none"+ aria-label="Copy dropdown"+ ><spanclassName="relative top-[1px] shrink-0 origin-center text-[10px] text-muted-foreground transition duration-300 group-hover:text-foreground group-data-[state=open]:rotate-180 group-data-[state=open]:text-foreground"aria-hidden="true"diff --git a/apps/web/src/content/footer-status.tsx b/apps/web/src/content/footer-status.tsxindex 3f6473acc..c6893dc98 100644--- a/apps/web/src/content/footer-status.tsx+++ b/apps/web/src/content/footer-status.tsx@@ -35,14 +35,29 @@ export function FooterStatus() {}const STATUS = {- operational: { color: "text-success", label: "Operational" },+ operational: {+ color: "text-green-700 dark:text-green-400",+ label: "Operational",+ },degraded_performance: {- color: "text-warning",+ color: "text-yellow-700 dark:text-yellow-400",label: "Degraded Performance",},- partial_outage: { color: "text-warning", label: "Partial Outage" },- major_outage: { color: "text-error", label: "Major Outage" },- under_maintenance: { color: "text-info", label: "Under Maintenance" },- unknown: { color: "text-gray-500", label: "Unknown" },- incident: { color: "text-warning", label: "Incident" },+ partial_outage: {+ color: "text-yellow-700 dark:text-yellow-400",+ label: "Partial Outage",+ },+ major_outage: {+ color: "text-red-700 dark:text-red-400",+ label: "Major Outage",+ },+ under_maintenance: {+ color: "text-blue-700 dark:text-blue-400",+ label: "Under Maintenance",+ },+ unknown: { color: "text-gray-700 dark:text-gray-400", label: "Unknown" },+ incident: {+ color: "text-yellow-700 dark:text-yellow-400",+ label: "Incident",+ },} satisfies Record<StatusResponse["status"], { color: string; label: string }>;diff --git a/apps/web/src/content/header.tsx b/apps/web/src/content/header.tsxindex 59d83cdb9..ec764954c 100644--- a/apps/web/src/content/header.tsx+++ b/apps/web/src/content/header.tsx@@ -48,7 +48,7 @@ export function Header() {<CmdK /><Linkhref="https://app.openstatus.dev/login"- className="truncate text-info"+ className="truncate text-blue-700 dark:text-blue-400">Dashboard</Link>diff --git a/apps/web/src/content/image-zoom.tsx b/apps/web/src/content/image-zoom.tsxindex f971f554a..eb504d781 100644--- a/apps/web/src/content/image-zoom.tsx+++ b/apps/web/src/content/image-zoom.tsx@@ -1,6 +1,10 @@"use client";import { cn } from "@/lib/utils";+import { useTheme } from "next-themes";+import Image from "next/image";+import type { ImageProps } from "next/image";+import { useEffect, useState } from "react";import Zoom, {type ControlledProps,type UncontrolledProps,@@ -11,14 +15,20 @@ export type ImageZoomProps = UncontrolledProps & {onZoomChange?: ControlledProps["onZoomChange"];className?: string;backdropClassName?: string;+ "aria-hidden"?: boolean;+ inert?: true;};export const ImageZoom = ({className,backdropClassName,+ "aria-hidden": ariaHidden,+ inert,...props}: ImageZoomProps) => (<div+ aria-hidden={ariaHidden}+ inert={inert}className={cn("relative","[&_[data-rmiz-ghost]]:pointer-events-none [&_[data-rmiz-ghost]]:absolute",@@ -50,3 +60,73 @@ export const ImageZoom = ({/></div>);++interface ZoomableImageProps extends ImageProps {+ darkSrc?: string;+ imageWidth: number;+ imageHeight: number;+}++export function ZoomableImage({+ src,+ alt,+ className,+ darkSrc,+ imageWidth,+ imageHeight,+ ...rest+}: ZoomableImageProps) {+ const { resolvedTheme } = useTheme();+ const [mounted, setMounted] = useState(false);+ const isDark = resolvedTheme === "dark";++ useEffect(() => {+ setMounted(true);+ }, []);++ return (+ <figure>+ <ImageZoom+ backdropClassName={cn(+ '[&_[data-rmiz-modal-overlay="visible"]]:bg-black/80',+ )}+ zoomMargin={16}+ aria-hidden={mounted ? isDark : undefined}+ inert={mounted && isDark ? true : undefined}+ className="block dark:hidden"+ >+ <Image+ {...rest}+ src={src}+ alt={alt ?? ""}+ width={imageWidth}+ height={imageHeight}+ sizes="100vw"+ style={{ width: "100%", height: "auto" }}+ className={className}+ />+ </ImageZoom>+ <ImageZoom+ backdropClassName={cn(+ '[&_[data-rmiz-modal-overlay="visible"]]:bg-black/80',+ )}+ zoomMargin={16}+ aria-hidden={mounted ? !isDark : undefined}+ inert={mounted && !isDark ? true : undefined}+ className="hidden dark:block"+ >+ <Image+ {...rest}+ src={darkSrc ?? src}+ alt={alt ?? ""}+ width={imageWidth}+ height={imageHeight}+ sizes="100vw"+ style={{ width: "100%", height: "auto" }}+ className={className}+ />+ </ImageZoom>+ {alt && <figcaption>{alt}</figcaption>}+ </figure>+ );+}diff --git a/apps/web/src/content/mdx.tsx b/apps/web/src/content/mdx.tsxindex 3b7452989..8b1157aed 100644--- a/apps/web/src/content/mdx.tsx+++ b/apps/web/src/content/mdx.tsx@@ -13,7 +13,7 @@ import { highlight } from "sugar-high";import { ComponentHighlighter } from "./component-highlighter";import { CopyButton } from "./copy-button";import { HighlightText } from "./highlight-text";-import { ImageZoom } from "./image-zoom";+import { ImageZoom, ZoomableImage } from "./image-zoom";import { LatencyChartTable } from "./latency-chart-table";import { StatusPageExample } from "./shadcn-registry-example";@@ -281,43 +281,15 @@ function CustomImage({const useDarkImage = checkDarkImageExists(darkSrc);return (- <figure>- <ImageZoom- backdropClassName={cn(- '[&_[data-rmiz-modal-overlay="visible"]]:bg-black/80',- )}- zoomMargin={16}- >- <Image- {...rest}- src={src}- alt={alt ?? ""}- width={imageWidth}- height={imageHeight}- sizes="100vw"- style={{ width: "100%", height: "auto" }}- className={cn("block dark:hidden", className)}- />- </ImageZoom>- <ImageZoom- backdropClassName={cn(- '[&_[data-rmiz-modal-overlay="visible"]]:bg-black/80',- )}- zoomMargin={16}- >- <Image- {...rest}- src={useDarkImage ? darkSrc : src}- alt={alt ?? ""}- width={imageWidth}- height={imageHeight}- sizes="100vw"- style={{ width: "100%", height: "auto" }}- className={cn("hidden dark:block", className)}- />- </ImageZoom>- {alt && <figcaption>{alt}</figcaption>}- </figure>+ <ZoomableImage+ {...rest}+ src={src}+ alt={alt}+ className={className}+ darkSrc={useDarkImage ? darkSrc : undefined}+ imageWidth={imageWidth as number}+ imageHeight={imageHeight as number}+ />);}