Skip to content

Automate browser based workflows with AI

feat: DS primitives — Skeleton/Typography/Card-tone/CSS-vars/Table-Line (SKY-9271) (#5827)

Aaron Perez982b87ec9122
diff --git a/skyvern-frontend/src/components/ui/card-variants.test.ts b/skyvern-frontend/src/components/ui/card-variants.test.ts
new file mode 100644
index 000000000..8ca542180
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/card-variants.test.ts
@@ -0,0 +1,52 @@
+import { describe, expect, it } from "vitest";
+import { cardVariants } from "./card-variants";
+
+describe("cardVariants", () => {
+ // Pre-cva Card class string was:
+ // "rounded-xl border bg-card text-card-foreground shadow"
+ // Default tone MUST emit those same classes (order-insensitive — twMerge
+ // resolves ordering when cn() composes them with caller className).
+ it("returns the legacy class set for tone=default (existing-caller preservation)", () => {
+ const result = cardVariants({ tone: "default" });
+ expect(result).toContain("rounded-xl");
+ expect(result).toContain("border");
+ expect(result).toContain("bg-card");
+ expect(result).toContain("text-card-foreground");
+ expect(result).toContain("shadow");
+ });
+
+ it("defaults to tone=default when no tone is passed", () => {
+ expect(cardVariants({})).toBe(cardVariants({ tone: "default" }));
+ });
+
+ it("emits a success-tinted border for tone=success", () => {
+ const result = cardVariants({ tone: "success" });
+ expect(result).toMatch(/border-success/);
+ });
+
+ it("emits a warning-tinted border for tone=warning", () => {
+ const result = cardVariants({ tone: "warning" });
+ expect(result).toMatch(/border-warning/);
+ });
+
+ it("emits a destructive-tinted border for tone=destructive", () => {
+ const result = cardVariants({ tone: "destructive" });
+ expect(result).toMatch(/border-destructive/);
+ });
+
+ it("keeps the rounded-xl + shadow + bg-card base across all tones (border-tint only)", () => {
+ // Tones are border-tints only — full background washes were out-of-scope
+ // per mandate. A destructive Card still reads as a Card, not a Banner.
+ for (const tone of [
+ "default",
+ "success",
+ "warning",
+ "destructive",
+ ] as const) {
+ const result = cardVariants({ tone });
+ expect(result).toContain("rounded-xl");
+ expect(result).toContain("shadow");
+ expect(result).toContain("bg-card");
+ }
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/card-variants.ts b/skyvern-frontend/src/components/ui/card-variants.ts
new file mode 100644
index 000000000..4bdf8404e
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/card-variants.ts
@@ -0,0 +1,21 @@
+import { cva } from "class-variance-authority";
+
+/** Default tone preserves pre-cva Card output. Non-default tones swap only the border color (border-tint, no background wash). */
+const cardVariants = cva(
+ "rounded-xl border bg-card text-card-foreground shadow",
+ {
+ variants: {
+ tone: {
+ default: "",
+ success: "border-success/40",
+ warning: "border-warning/40",
+ destructive: "border-destructive/40",
+ },
+ },
+ defaultVariants: {
+ tone: "default",
+ },
+ },
+);
+
+export { cardVariants };
diff --git a/skyvern-frontend/src/components/ui/card.tsx b/skyvern-frontend/src/components/ui/card.tsx
index fe1bcf366..945088ef9 100644
--- a/skyvern-frontend/src/components/ui/card.tsx
+++ b/skyvern-frontend/src/components/ui/card.tsx
@@ -1,20 +1,21 @@
import * as React from "react";
+import type { VariantProps } from "class-variance-authority";
import { cn } from "@/util/utils";
+import { cardVariants } from "./card-variants";
-const Card = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => (
- <div
- ref={ref}
- className={cn(
- "rounded-xl border bg-card text-card-foreground shadow",
- className,
- )}
- {...props}
- />
-));
+type CardProps = React.HTMLAttributes<HTMLDivElement> &
+ VariantProps<typeof cardVariants>;
+
+const Card = React.forwardRef<HTMLDivElement, CardProps>(
+ ({ className, tone, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(cardVariants({ tone }), className)}
+ {...props}
+ />
+ ),
+);
Card.displayName = "Card";
const CardHeader = React.forwardRef<
diff --git a/skyvern-frontend/src/components/ui/css-vars.test.ts b/skyvern-frontend/src/components/ui/css-vars.test.ts
new file mode 100644
index 000000000..29bea2f85
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/css-vars.test.ts
@@ -0,0 +1,127 @@
+import { describe, expect, it } from "vitest";
+import { existsSync, readFileSync } from "node:fs";
+import { dirname, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+
+// Lock the --input / --ring CSS-var contract that the Input component, the
+// shadcn dialog/popover/select primitives, and any future ring-using
+// surface depend on. Without these vars, focus rings and input borders
+// fall back to browser defaults and the dashboard looks unstyled.
+//
+// The 3 index.css files (cloud / eval / src) are separate entrypoints —
+// each app loads exactly one. Asserting all three define the vars in both
+// :root and .dark prevents a regression where one entrypoint silently
+// drops a token that another entrypoint still ships.
+
+const HERE = dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = resolve(HERE, "../../../..");
+// Multi-entrypoint layout (cloud / eval / src) exists in the cloud monorepo;
+// the OSS repo syncs only src/. Filter to whatever exists so the contract
+// holds in both contexts without per-repo divergence.
+const ALL_CSS_FILES = [
+ "skyvern-frontend/src/index.css",
+ "skyvern-frontend/cloud/index.css",
+ "skyvern-frontend/eval/index.css",
+];
+const CSS_FILES = ALL_CSS_FILES.filter((f) =>
+ existsSync(resolve(REPO_ROOT, f)),
+);
+
+function load(file: string): string {
+ return readFileSync(resolve(REPO_ROOT, file), "utf-8");
+}
+
+function blockBetween(css: string, openSelector: string): string {
+ // Naive but sufficient: find the selector, then capture from there to the
+ // matching closing brace of its top-level block. The :root and .dark blocks
+ // in our index.css files are flat (no nested rules), so this is safe.
+ const idx = css.indexOf(openSelector);
+ if (idx === -1) {
+ return "";
+ }
+ const open = css.indexOf("{", idx);
+ if (open === -1) {
+ return "";
+ }
+ let depth = 1;
+ for (let i = open + 1; i < css.length; i++) {
+ if (css[i] === "{") depth++;
+ else if (css[i] === "}") {
+ depth--;
+ if (depth === 0) return css.slice(open + 1, i);
+ }
+ }
+ return "";
+}
+
+describe.each(CSS_FILES)("%s defines DS token vars", (file) => {
+ const css = load(file);
+ const root = blockBetween(css, ":root");
+ const dark = blockBetween(css, ".dark");
+
+ it("defines --input under :root", () => {
+ expect(root).toMatch(/--input:\s*[^;]+;/);
+ });
+
+ it("defines --ring under :root", () => {
+ expect(root).toMatch(/--ring:\s*[^;]+;/);
+ });
+
+ it("defines --input under .dark", () => {
+ expect(dark).toMatch(/--input:\s*[^;]+;/);
+ });
+
+ it("defines --ring under .dark", () => {
+ expect(dark).toMatch(/--ring:\s*[^;]+;/);
+ });
+
+ // Status tokens — consumed by Card tone variants and any future
+ // status-tinted surface. Required in BOTH :root and .dark of all 3
+ // entrypoints so border-success/border-warning render the same color
+ // regardless of which app loads.
+ it("defines --success under :root", () => {
+ expect(root).toMatch(/--success:\s*[^;]+;/);
+ });
+
+ it("defines --success-foreground under :root", () => {
+ expect(root).toMatch(/--success-foreground:\s*[^;]+;/);
+ });
+
+ it("defines --warning under :root", () => {
+ expect(root).toMatch(/--warning:\s*[^;]+;/);
+ });
+
+ it("defines --warning-foreground under :root", () => {
+ expect(root).toMatch(/--warning-foreground:\s*[^;]+;/);
+ });
+
+ it("defines --success under .dark", () => {
+ expect(dark).toMatch(/--success:\s*[^;]+;/);
+ });
+
+ it("defines --warning under .dark", () => {
+ expect(dark).toMatch(/--warning:\s*[^;]+;/);
+ });
+});
+
+describe("--ring is consistent across cloud/eval/src", () => {
+ // Sub-pixel drift (4.9% vs 5%) shipped a long time ago and is the kind
+ // of polish gap a leadership walkthrough would notice. Lock the
+ // harmonization in test so a future copy-paste into one entrypoint
+ // can't silently re-introduce the drift.
+ function ringValue(css: string, selector: string): string {
+ const block = blockBetween(css, selector);
+ const m = block.match(/--ring:\s*([^;]+);/);
+ return (m?.[1] ?? "").trim();
+ }
+
+ it("light-mode --ring is the same value in all 3 entrypoints", () => {
+ const values = CSS_FILES.map((f) => ringValue(load(f), ":root"));
+ expect(new Set(values).size).toBe(1);
+ });
+
+ it("dark-mode --ring is the same value in all 3 entrypoints", () => {
+ const values = CSS_FILES.map((f) => ringValue(load(f), ".dark"));
+ expect(new Set(values).size).toBe(1);
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/input.test.tsx b/skyvern-frontend/src/components/ui/input.test.tsx
new file mode 100644
index 000000000..5938b3dc4
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/input.test.tsx
@@ -0,0 +1,25 @@
+import { describe, expect, it } from "vitest";
+import { renderToStaticMarkup } from "react-dom/server";
+import { Input } from "./input";
+
+// Contract: <Input> must render with the design-system tokens that the cloud
+// app (and OSS app) configure via CSS vars. Locking the className contract
+// here so a future shadcn-style refactor can't silently drop the token wiring.
+describe("Input — DS token contract", () => {
+ it("renders with border-input so the --input CSS var drives the border color", () => {
+ const html = renderToStaticMarkup(<Input />);
+ expect(html).toContain("border-input");
+ });
+
+ it("wires the focus ring to --ring via focus-visible:ring-ring", () => {
+ const html = renderToStaticMarkup(<Input />);
+ expect(html).toContain("focus-visible:ring-ring");
+ });
+
+ it("renders a single <input> element so existing form-libraries keep working", () => {
+ const html = renderToStaticMarkup(<Input placeholder="Search" />);
+ // Single input, no extra wrapping div / span.
+ expect(html.match(/<input\b/g)?.length ?? 0).toBe(1);
+ expect(html).toContain('placeholder="Search"');
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/skeleton-variants.test.ts b/skyvern-frontend/src/components/ui/skeleton-variants.test.ts
new file mode 100644
index 000000000..942be411b
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/skeleton-variants.test.ts
@@ -0,0 +1,29 @@
+import { describe, expect, it } from "vitest";
+import { skeletonVariants } from "./skeleton-variants";
+
+describe("skeletonVariants", () => {
+ it("returns the legacy class string for variant=rect", () => {
+ // The pre-cva Skeleton was a single div with these classes. The rect
+ // variant must emit them so existing callers see no visual change.
+ const result = skeletonVariants({ variant: "rect" });
+ expect(result).toContain("animate-pulse");
+ expect(result).toContain("rounded-md");
+ expect(result).toContain("bg-primary/10");
+ });
+
+ it("defaults to rect when no variant is passed (existing-caller preservation)", () => {
+ expect(skeletonVariants({})).toBe(skeletonVariants({ variant: "rect" }));
+ });
+
+ it("emits rounded-full for circle so twMerge collapses rounded-md", () => {
+ // Both classes end up in the final string; tailwind-merge collapses to
+ // rounded-full at render time. Asserting rounded-full presence is enough
+ // — no need to assert rounded-md absence.
+ expect(skeletonVariants({ variant: "circle" })).toContain("rounded-full");
+ });
+
+ it("emits a flex-col container for the text variant so stacked lines align", () => {
+ expect(skeletonVariants({ variant: "text" })).toContain("flex");
+ expect(skeletonVariants({ variant: "text" })).toContain("flex-col");
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/skeleton-variants.ts b/skyvern-frontend/src/components/ui/skeleton-variants.ts
new file mode 100644
index 000000000..2fd839ec5
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/skeleton-variants.ts
@@ -0,0 +1,19 @@
+import { cva } from "class-variance-authority";
+
+/** Default `rect` variant renders byte-identical to the pre-cva Skeleton. */
+const skeletonVariants = cva("animate-pulse rounded-md bg-primary/10", {
+ variants: {
+ variant: {
+ rect: "",
+ // tailwind-merge collapses rounded-md (base) → rounded-full (variant).
+ circle: "rounded-full",
+ // Container only — line bars are rendered as children by the component.
+ text: "flex flex-col gap-2 bg-transparent rounded-none animate-none",
+ },
+ },
+ defaultVariants: {
+ variant: "rect",
+ },
+});
+
+export { skeletonVariants };
diff --git a/skyvern-frontend/src/components/ui/skeleton.test.tsx b/skyvern-frontend/src/components/ui/skeleton.test.tsx
new file mode 100644
index 000000000..79f3a0f61
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/skeleton.test.tsx
@@ -0,0 +1,56 @@
+import { describe, expect, it } from "vitest";
+import { renderToStaticMarkup } from "react-dom/server";
+import { Skeleton } from "./skeleton";
+
+// Existing-caller preservation gate: the 3 specialized callsites
+// (TaskListSkeletonRows, RunningTaskSkeleton, WorkflowRunOverviewSkeleton)
+// pass `<Skeleton className="..." />` with no variant prop. The rendered
+// HTML must keep the legacy single-<div> shape and the legacy core classes.
+describe("Skeleton — existing-caller preservation", () => {
+ it("renders a single div carrying the className passthrough", () => {
+ const html = renderToStaticMarkup(<Skeleton className="h-4 w-full" />);
+ expect(html).toMatch(/^<div\b/);
+ expect(html).toContain("h-4");
+ expect(html).toContain("w-full");
+ // Legacy core classes — the rect default must keep emitting these.
+ expect(html).toContain("animate-pulse");
+ expect(html).toContain("rounded-md");
+ });
+
+ // PRESERVATION HARD GATE — no-prop default must render byte-identical HTML
+ // to the pre-cva Skeleton. Cascade rebase relies on this; if this test
+ // breaks, downstream PRs that style around <Skeleton> may surface visual
+ // regressions. Don't relax this assertion without sc-67 sign-off.
+ it('matches `<Skeleton variant="rect" />` exactly when no variant prop is passed', () => {
+ const noProp = renderToStaticMarkup(<Skeleton className="h-4 w-full" />);
+ const explicit = renderToStaticMarkup(
+ <Skeleton variant="rect" className="h-4 w-full" />,
+ );
+ expect(noProp).toBe(explicit);
+ });
+});
+
+describe("Skeleton — variant=circle", () => {
+ it("renders a round shape sized via inline style", () => {
+ const html = renderToStaticMarkup(<Skeleton variant="circle" size={32} />);
+ expect(html).toContain("rounded-full");
+ // Inline width/height in pixels so callers can size without className.
+ expect(html).toContain("width:32px");
+ expect(html).toContain("height:32px");
+ });
+});
+
+describe("Skeleton — variant=text", () => {
+ it("renders N stacked line divs (lines prop)", () => {
+ const html = renderToStaticMarkup(<Skeleton variant="text" lines={3} />);
+ // Three internal line bars; outer container counts as the wrapper.
+ const lineMatches = html.match(/<div[^>]*data-skeleton-line/g) ?? [];
+ expect(lineMatches.length).toBe(3);
+ });
+
+ it("defaults to a single line when lines is omitted", () => {
+ const html = renderToStaticMarkup(<Skeleton variant="text" />);
+ const lineMatches = html.match(/<div[^>]*data-skeleton-line/g) ?? [];
+ expect(lineMatches.length).toBe(1);
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/skeleton.tsx b/skyvern-frontend/src/components/ui/skeleton.tsx
index f1af09dc4..bb421d2c4 100644
--- a/skyvern-frontend/src/components/ui/skeleton.tsx
+++ b/skyvern-frontend/src/components/ui/skeleton.tsx
@@ -1,15 +1,71 @@
+import * as React from "react";
+import type { VariantProps } from "class-variance-authority";
+
import { cn } from "@/util/utils";
+import { skeletonVariants } from "./skeleton-variants";
+
+type SkeletonBaseProps = React.HTMLAttributes<HTMLDivElement> &
+ VariantProps<typeof skeletonVariants>;
+
+interface SkeletonProps extends SkeletonBaseProps {
+ // circle: render a round placeholder sized to `size` (px). Defaults to 24.
+ size?: number;
+ // text: number of stacked line bars to render. Defaults to 1.
+ lines?: number;
+}
function Skeleton({
className,
+ variant,
+ size,
+ lines,
+ style,
...props
-}: React.HTMLAttributes<HTMLDivElement>) {
+}: SkeletonProps) {
+ if (variant === "circle") {
+ const dimension = size ?? 24;
+ return (
+ <div
+ className={cn(skeletonVariants({ variant }), className)}
+ style={{ width: dimension, height: dimension, ...style }}
+ {...props}
+ />
+ );
+ }
+
+ if (variant === "text") {
+ const lineCount = Math.max(1, lines ?? 1);
+ return (
+ <div
+ className={cn(skeletonVariants({ variant }), className)}
+ style={style}
+ {...props}
+ >
+ {Array.from({ length: lineCount }).map((_, i) => (
+ <div
+ key={i}
+ data-skeleton-line=""
+ // Last line is shorter so the stack reads as text rather than a
+ // uniform block; matches common skeleton conventions.
+ className={cn(
+ "h-4 animate-pulse rounded-md bg-primary/10",
+ i === lineCount - 1 && lineCount > 1 ? "w-2/3" : "w-full",
+ )}
+ />
+ ))}
+ </div>
+ );
+ }
+
+ // variant === "rect" or undefined (default).
return (
<div
- className={cn("animate-pulse rounded-md bg-primary/10", className)}
+ className={cn(skeletonVariants({ variant }), className)}
+ style={style}
{...props}
/>
);
}
export { Skeleton };
+export type { SkeletonProps };
diff --git a/skyvern-frontend/src/components/ui/table-variants.test.ts b/skyvern-frontend/src/components/ui/table-variants.test.ts
new file mode 100644
index 000000000..17276bd9a
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/table-variants.test.ts
@@ -0,0 +1,58 @@
+import { describe, expect, it } from "vitest";
+import { tableVariants } from "./table-variants";
+
+describe("tableVariants", () => {
+ // Pre-cva Table class string was:
+ // "w-full caption-bottom text-sm"
+ // The default variant must emit those classes so existing Table callers
+ // (many — Table is a workhorse) render byte-identical output.
+ it("returns the legacy class set for variant=default (existing-caller preservation)", () => {
+ const result = tableVariants({ variant: "default" });
+ expect(result).toContain("w-full");
+ expect(result).toContain("caption-bottom");
+ expect(result).toContain("text-sm");
+ });
+
+ it("defaults to variant=default when no variant is passed", () => {
+ expect(tableVariants({})).toBe(tableVariants({ variant: "default" }));
+ });
+
+ it("does not inject column-width selectors on the default variant", () => {
+ // The line-5col selectors must NOT bleed into the default variant —
+ // existing callers don't expect their TableCell to be auto-aligned.
+ const result = tableVariants({ variant: "default" });
+ expect(result).not.toMatch(/nth-child/);
+ expect(result).not.toMatch(/tabular-nums/);
+ });
+
+ describe("variant=line-5col schema", () => {
+ const result = tableVariants({ variant: "line-5col" });
+
+ it("preserves the legacy base classes", () => {
+ expect(result).toContain("w-full");
+ expect(result).toContain("caption-bottom");
+ expect(result).toContain("text-sm");
+ });
+
+ it("right-aligns numeric columns 2-5 in headers and cells", () => {
+ expect(result).toMatch(/\[&_th:nth-child\(n\+2\)\]:text-right/);
+ expect(result).toMatch(/\[&_td:nth-child\(n\+2\)\]:text-right/);
+ });
+
+ it("applies tabular-nums to the numeric cells (cols 2-5)", () => {
+ expect(result).toMatch(/\[&_td:nth-child\(n\+2\)\]:tabular-nums/);
+ });
+
+ it("sets fixed widths on cols 2-5 so col 1 (workflow) takes the remaining space", () => {
+ // Runs col is narrower (80px / w-20) than the cost cols (w-24).
+ expect(result).toMatch(/\[&_th:nth-child\(2\)\]:w-20/);
+ expect(result).toMatch(/\[&_th:nth-child\(3\)\]:w-24/);
+ expect(result).toMatch(/\[&_th:nth-child\(4\)\]:w-24/);
+ expect(result).toMatch(/\[&_th:nth-child\(5\)\]:w-24/);
+ });
+
+ it("bolds the Total Cost cell (col 5) so it reads as the bottom-line number", () => {
+ expect(result).toMatch(/\[&_td:nth-child\(5\)\]:font-semibold/);
+ });
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/table-variants.ts b/skyvern-frontend/src/components/ui/table-variants.ts
new file mode 100644
index 000000000..6921684b7
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/table-variants.ts
@@ -0,0 +1,33 @@
+import { cva } from "class-variance-authority";
+
+/** Default variant preserves pre-cva Table output. `line-5col` is the dashboard breakdown schema: Workflow / Runs / Success% / Avg Cost / Total Cost. */
+const tableVariants = cva("w-full caption-bottom text-sm", {
+ variants: {
+ variant: {
+ default: "",
+ "line-5col": [
+ // Right-align cols 2-5 (Runs, Success%, Avg Cost, Total Cost).
+ // Col 1 (Workflow) keeps the default left alignment.
+ "[&_th:nth-child(n+2)]:text-right",
+ "[&_td:nth-child(n+2)]:text-right",
+ // Tabular-nums on numeric cells so 1,234 lines up under 12,345.
+ "[&_td:nth-child(n+2)]:tabular-nums",
+ // Fixed widths: Runs is narrower (80px) than the cost cols (96px).
+ // Workflow col (1) absorbs the remaining width via the default
+ // `w-auto` behavior of <th>.
+ "[&_th:nth-child(2)]:w-20",
+ "[&_th:nth-child(3)]:w-24",
+ "[&_th:nth-child(4)]:w-24",
+ "[&_th:nth-child(5)]:w-24",
+ // Total Cost is the bottom-line number — bold so the eye lands
+ // there first when scanning the breakdown.
+ "[&_td:nth-child(5)]:font-semibold",
+ ].join(" "),
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+});
+
+export { tableVariants };
diff --git a/skyvern-frontend/src/components/ui/table.tsx b/skyvern-frontend/src/components/ui/table.tsx
index cdb42a7fd..cfa69ebb1 100644
--- a/skyvern-frontend/src/components/ui/table.tsx
+++ b/skyvern-frontend/src/components/ui/table.tsx
@@ -1,19 +1,23 @@
import * as React from "react";
+import type { VariantProps } from "class-variance-authority";
import { cn } from "@/util/utils";
+import { tableVariants } from "./table-variants";
-const Table = React.forwardRef<
- HTMLTableElement,
- React.HTMLAttributes<HTMLTableElement>
->(({ className, ...props }, ref) => (
- <div className="relative w-full overflow-auto">
- <table
- ref={ref}
- className={cn("w-full caption-bottom text-sm", className)}
- {...props}
- />
- </div>
-));
+type TableProps = React.HTMLAttributes<HTMLTableElement> &
+ VariantProps<typeof tableVariants>;
+
+const Table = React.forwardRef<HTMLTableElement, TableProps>(
+ ({ className, variant, ...props }, ref) => (
+ <div className="relative w-full overflow-auto">
+ <table
+ ref={ref}
+ className={cn(tableVariants({ variant }), className)}
+ {...props}
+ />
+ </div>
+ ),
+);
Table.displayName = "Table";
const TableHeader = React.forwardRef<
diff --git a/skyvern-frontend/src/components/ui/typography.test.tsx b/skyvern-frontend/src/components/ui/typography.test.tsx
new file mode 100644
index 000000000..fd9c74860
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/typography.test.tsx
@@ -0,0 +1,60 @@
+import { describe, expect, it } from "vitest";
+import { renderToStaticMarkup } from "react-dom/server";
+import { TitleDescription } from "./typography";
+
+describe("TitleDescription", () => {
+ it("renders the title text inside a heading element", () => {
+ const html = renderToStaticMarkup(
+ <TitleDescription title="Usage & Operations" />,
+ );
+ expect(html).toContain("Usage &amp; Operations");
+ // Default heading level is h2 — recognized by both screen readers and
+ // the DS visual scale. Override via `as` if the page already has an h1.
+ expect(html).toMatch(/<h2\b/);
+ });
+
+ it("renders the description text inside a <p> when provided", () => {
+ const html = renderToStaticMarkup(
+ <TitleDescription
+ title="Usage & Operations"
+ description="Aggregate metrics for the period"
+ />,
+ );
+ expect(html).toContain("Aggregate metrics for the period");
+ expect(html).toMatch(/<p\b/);
+ });
+
+ it("omits the description <p> entirely when description is undefined", () => {
+ // No empty paragraph — the screen reader / visual rhythm should not
+ // pick up a phantom slot.
+ const html = renderToStaticMarkup(
+ <TitleDescription title="Just a title" />,
+ );
+ expect(html).not.toMatch(/<p\b/);
+ });
+
+ it("omits the description <p> when description is an empty string", () => {
+ const html = renderToStaticMarkup(
+ <TitleDescription title="Just a title" description="" />,
+ );
+ expect(html).not.toMatch(/<p\b/);
+ });
+
+ it("respects the `as` prop to override the default heading level", () => {
+ // Page-level header consumers (e.g. /analytics page) already have an
+ // <h1> from the route layout; they want this primitive to render <h2>
+ // by default but be able to drop to <h3> for sub-section headers.
+ const html = renderToStaticMarkup(
+ <TitleDescription as="h3" title="Sub-section" />,
+ );
+ expect(html).toMatch(/<h3\b/);
+ expect(html).not.toMatch(/<h2\b/);
+ });
+
+ it("forwards a className to the container so callers can space the block", () => {
+ const html = renderToStaticMarkup(
+ <TitleDescription title="Block" className="mb-6" />,
+ );
+ expect(html).toContain("mb-6");
+ });
+});
diff --git a/skyvern-frontend/src/components/ui/typography.tsx b/skyvern-frontend/src/components/ui/typography.tsx
new file mode 100644
index 000000000..06d17fdc7
--- /dev/null
+++ b/skyvern-frontend/src/components/ui/typography.tsx
@@ -0,0 +1,37 @@
+import * as React from "react";
+
+import { cn } from "@/util/utils";
+
+type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
+
+interface TitleDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
+ title: string;
+ // Empty string or undefined suppresses the `<p>` so screen readers don't see a phantom paragraph.
+ description?: string;
+ // Defaults to `h2`; use `h3` for nested sections.
+ as?: HeadingLevel;
+}
+
+/** Two-slot title + description compound for section headers. */
+function TitleDescription({
+ title,
+ description,
+ as: Heading = "h2",
+ className,
+ ...props
+}: TitleDescriptionProps) {
+ const showDescription = description !== undefined && description !== "";
+ return (
+ <div className={cn("flex flex-col gap-1", className)} {...props}>
+ <Heading className="font-semibold tracking-tight text-foreground">
+ {title}
+ </Heading>
+ {showDescription ? (
+ <p className="text-sm text-muted-foreground">{description}</p>
+ ) : null}
+ </div>
+ );
+}
+
+export { TitleDescription };
+export type { TitleDescriptionProps };
diff --git a/skyvern-frontend/src/index.css b/skyvern-frontend/src/index.css
index 5d04f88aa..f66ae18f5 100644
--- a/skyvern-frontend/src/index.css
+++ b/skyvern-frontend/src/index.css
@@ -35,9 +35,12 @@
--warning: 32.1 94.6% 43.7%; /* amber-600 */
--warning-foreground: 36 100% 97.1%; /* amber-50 */
+ --success: 142.1 76.2% 36.3%; /* green-600 */
+ --success-foreground: 138.5 76.5% 96.7%; /* green-50 */
+
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
- --ring: 222.2 84% 4.9%;
+ --ring: 222.2 84% 5%;
--radius: 0.5rem;
}