}
+ className="taskito-carousel my-6 rounded-lg border border-fd-border bg-fd-card overflow-hidden focus:outline-none focus:ring-2 focus:ring-fd-primary/40"
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: container hosts arrow-key navigation per WAI-ARIA carousel pattern
+ tabIndex={0}
+ aria-roledescription="carousel"
+ aria-label={title ?? "Diagram carousel"}
+ >
+
+
+ {title && (
+
+ {title}
+
+ )}
+ {activeTitle && (
+
+ {title ? "·" : ""} {activeTitle}
+
+ )}
+
+
+
+ {index + 1} / {total}
+
+
+
+
+
+
+
+
+ {slides.map((slide, i) => (
+
+ {slide}
+
+ ))}
+
+
+ {slides.map((slide, i) => {
+ const slideTitle = slide.props.title;
+ return (
+
+
+ );
+}
diff --git a/docs/src/components/mdx.tsx b/docs/src/components/mdx.tsx
index 1e29908..00c1d1d 100644
--- a/docs/src/components/mdx.tsx
+++ b/docs/src/components/mdx.tsx
@@ -1,11 +1,14 @@
import defaultMdxComponents from "fumadocs-ui/mdx";
import type { MDXComponents } from "mdx/types";
+import { DiagramCarousel, DiagramSlide } from "./diagram-carousel";
import { Mermaid } from "./mermaid";
export function getMDXComponents(components?: MDXComponents) {
return {
...defaultMdxComponents,
Mermaid,
+ DiagramCarousel,
+ DiagramSlide,
...components,
} satisfies MDXComponents;
}
diff --git a/docs/src/components/mermaid.tsx b/docs/src/components/mermaid.tsx
index ecbcfa2..b4a78bd 100644
--- a/docs/src/components/mermaid.tsx
+++ b/docs/src/components/mermaid.tsx
@@ -3,6 +3,90 @@
import { useTheme } from "next-themes";
import { useEffect, useId, useRef, useState } from "react";
+const DARK_THEME_VARIABLES = {
+ background: "transparent",
+ primaryColor: "#1f2024",
+ primaryTextColor: "#f5f5f7",
+ primaryBorderColor: "#7a7d85",
+ lineColor: "#9b9ea6",
+ secondaryColor: "#2a2c31",
+ tertiaryColor: "#26282d",
+ mainBkg: "#1f2024",
+ nodeBkg: "#1f2024",
+ nodeBorder: "#7a7d85",
+ clusterBkg: "#1a1b1e",
+ clusterBorder: "#5a5d65",
+ edgeLabelBackground: "#2a2c31",
+ titleColor: "#f5f5f7",
+ labelTextColor: "#f5f5f7",
+ textColor: "#f5f5f7",
+ noteBkgColor: "#3a3c41",
+ noteTextColor: "#f5f5f7",
+ noteBorderColor: "#7a7d85",
+ errorBkgColor: "#4a1d1d",
+ errorTextColor: "#fca5a5",
+ // erDiagram-specific (entity attribute rows)
+ attributeBackgroundColorOdd: "#1f2024",
+ attributeBackgroundColorEven: "#272a30",
+ // stateDiagram-specific
+ altBackground: "#26282d",
+ // flowchart label colors
+ labelBackground: "#2a2c31",
+ // sequenceDiagram
+ actorBkg: "#1f2024",
+ actorBorder: "#7a7d85",
+ actorTextColor: "#f5f5f7",
+ actorLineColor: "#9b9ea6",
+ signalColor: "#f5f5f7",
+ signalTextColor: "#f5f5f7",
+ labelBoxBkgColor: "#2a2c31",
+ labelBoxBorderColor: "#7a7d85",
+ loopTextColor: "#f5f5f7",
+ activationBkgColor: "#3a3c41",
+ activationBorderColor: "#9b9ea6",
+} as const;
+
+const LIGHT_THEME_VARIABLES = {
+ background: "transparent",
+ primaryColor: "#ffffff",
+ primaryTextColor: "#1a1a1a",
+ primaryBorderColor: "#3a3a3a",
+ lineColor: "#4a4a4a",
+ secondaryColor: "#f4f4f5",
+ tertiaryColor: "#fafafa",
+ mainBkg: "#ffffff",
+ nodeBkg: "#ffffff",
+ nodeBorder: "#3a3a3a",
+ clusterBkg: "#f4f4f5",
+ clusterBorder: "#a1a1aa",
+ edgeLabelBackground: "#ffffff",
+ titleColor: "#1a1a1a",
+ labelTextColor: "#1a1a1a",
+ textColor: "#1a1a1a",
+ noteBkgColor: "#fef9c3",
+ noteTextColor: "#1a1a1a",
+ noteBorderColor: "#a1a1aa",
+ // erDiagram-specific (entity attribute rows)
+ attributeBackgroundColorOdd: "#ffffff",
+ attributeBackgroundColorEven: "#f4f4f5",
+ // stateDiagram-specific
+ altBackground: "#f4f4f5",
+ // flowchart label colors
+ labelBackground: "#ffffff",
+ // sequenceDiagram
+ actorBkg: "#ffffff",
+ actorBorder: "#3a3a3a",
+ actorTextColor: "#1a1a1a",
+ actorLineColor: "#4a4a4a",
+ signalColor: "#1a1a1a",
+ signalTextColor: "#1a1a1a",
+ labelBoxBkgColor: "#ffffff",
+ labelBoxBorderColor: "#3a3a3a",
+ loopTextColor: "#1a1a1a",
+ activationBkgColor: "#f4f4f5",
+ activationBorderColor: "#4a4a4a",
+} as const;
+
export function Mermaid({ chart }: { chart: string }) {
const id = useId();
const containerRef = useRef