Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor(onboarding): use design-system Card in the get-started hub (#1296)

Brad Barbinc238af5f5a00
diff --git a/.ai/lessons.md b/.ai/lessons.md
index ebefdd72ba..f1965f081e 100644
--- a/.ai/lessons.md
+++ b/.ai/lessons.md
@@ -567,3 +567,19 @@ Format: `Context → Problem → Rule → Applies to`
**Rule:** A `.refine` predicate must return a **boolean** (`false` = invalid). To attach a path/message, either pass the second `{ message, path }` argument to `.refine` and return `false` on failure, or use `.superRefine((data, ctx) => ctx.addIssue({ path, message }))` when you need per-field errors. Never return an object/array from a `.refine` callback expecting it to be an error map.
**Applies to:** all `apps/erp/app/modules/**/*.models.ts` (and `apps/mes/app/services/models.ts`) zod schemas using `.refine`.
+
+## The design-system `Card` is a gray tray + shadow edge — the white surface is `CardContent`, and a tint on the shell needs a `dark:` variant
+
+**Context:** Building card surfaces with `@carbon/react`'s `Card` family (`packages/react/src/Card.tsx`), e.g. the onboarding Implementation Hub (`packages/onboarding/src/ui/**`). Three separate traps hit in sequence while converting hand-rolled `rounded-lg border bg-card` blocks to the design system.
+
+**Problem:**
+1. `Card` is `bg-accent dark:bg-card` — a **muted gray tray** in light mode, not a white card. Putting content directly in `<Card>` reads gray. The white surface (`bg-card`) comes from `CardContent`; the canonical composition is `Card > CardHeader + CardContent` (see `MetricCard.tsx`, `ActionTaskList.tsx`).
+2. `Card`'s `shadow-button-base` already draws the crisp outer edge (a `0 0 0 1px` ring + inset highlights). A `CardContent` `border` sitting on top of that shadow ring reads as a **blurry double line**.
+3. Overriding the shell background with an **un-prefixed** color (`bg-emerald-500/5`) leaves `Card`'s base `dark:bg-card` in the class list; `.dark .dark:bg-card` out-specifies `.bg-emerald-500/5`, so the tint **silently disappears in dark mode** (border/icon still show, so it degrades quietly).
+
+**Rule:**
+- Single-surface white card: `Card > CardContent` (not content directly in `Card`).
+- Titled card: heading in `CardHeader` over `CardContent`; the shell shadow is the outer edge, so use `CardContent className="border-0"` and put the header/body divider on the `CardHeader` (`border-b border-border`) — never a full `CardContent` border on top of the shadow.
+- Colored callout on a `Card`: always pair the tint with its `dark:` variant (`bg-emerald-500/5 dark:bg-emerald-500/5`). `cn`/twMerge then drops the base `dark:bg-card`. Verify by checking the rendered class list no longer contains `dark:bg-card`.
+
+**Applies to:** any UI composing `@carbon/react` `Card`/`CardContent`/`CardHeader`; the `Section`/`Panel` primitives in `packages/onboarding/src/ui/primitives/Section.tsx` centralize this composition for the hub.
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 6fe6e945e0..b9e42c5872 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -69804,21 +69804,21 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["shipmentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["shipmentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -70365,14 +70365,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 6fe6e945e0..b9e42c5872 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -69804,21 +69804,21 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["shipmentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["shipmentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -70365,14 +70365,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/onboarding/AGENTS.md b/packages/onboarding/AGENTS.md
index fb01bfe54f..907048b20e 100644
--- a/packages/onboarding/AGENTS.md
+++ b/packages/onboarding/AGENTS.md
@@ -31,7 +31,7 @@ pnpm --filter @carbon/onboarding typecheck # tsgo --noEmit
- **Content-driven**: `src/content.ts` defines the template blueprint (steps, sections, exclusions)
- **Logic layer**: `src/logic/` — pure functions for visibility, timeline, board layout, guide flow
-- **UI primitives**: `src/ui/primitives/` — `PageHeader`, `Section`, `StatusToggle`, `EditableInput`, `DerivedStatus` (display-only ring for auto-derived items)
+- **UI primitives**: `src/ui/primitives/` — `PageHeader`, `Section`/`Panel` (design-system `Card`-composed surfaces: `Section` = `CardHeader` + divided-list `CardContent`, `Panel` = titled/prose `Card`), `StatusToggle`, `EditableInput`, `DerivedStatus` (display-only ring for auto-derived items)
- **Views**: `ScopeView`, `RolesView`, `DataMigrationView`, `TrainingView`, `GoLiveView`, etc.
## Cross-References
diff --git a/packages/onboarding/src/ui/GuidedUpsellCard.tsx b/packages/onboarding/src/ui/GuidedUpsellCard.tsx
index 438f3d94a9..8855ce9b55 100644
--- a/packages/onboarding/src/ui/GuidedUpsellCard.tsx
+++ b/packages/onboarding/src/ui/GuidedUpsellCard.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@carbon/react";
+import { Button, Card, CardContent } from "@carbon/react";
import { useLingui } from "@lingui/react/macro";
import { LuArrowRight, LuCheck, LuSparkles } from "react-icons/lu";
import { GUIDED_UPSELL } from "../content";
@@ -13,39 +13,41 @@ export function GuidedUpsellCard({
}) {
const { i18n } = useLingui();
return (
- <section className="rounded-lg border border-border bg-card p-6 flex items-start gap-4">
- <div className="shrink-0 size-11 rounded-lg bg-primary/15 flex items-center justify-center text-primary">
- <LuSparkles className="text-xl" />
- </div>
- <div className="flex-1 min-w-0">
- <div className="text-xxs uppercase text-muted-foreground tracking-wide font-medium">
- {i18n._(GUIDED_UPSELL.eyebrow)}
+ <Card>
+ <CardContent className="flex-row items-start gap-4 p-6 border-0">
+ <div className="shrink-0 size-11 rounded-lg bg-primary/15 flex items-center justify-center text-primary">
+ <LuSparkles className="text-xl" />
</div>
- <div className="text-base font-semibold tracking-tight mt-0.5 text-balance">
- {i18n._(GUIDED_UPSELL.heading)}
+ <div className="flex-1 min-w-0">
+ <div className="text-xxs uppercase text-muted-foreground tracking-wide font-medium">
+ {i18n._(GUIDED_UPSELL.eyebrow)}
+ </div>
+ <div className="text-base font-semibold tracking-tight mt-0.5 text-balance">
+ {i18n._(GUIDED_UPSELL.heading)}
+ </div>
+ <p className="text-sm text-muted-foreground mt-1 text-pretty">
+ {i18n._(GUIDED_UPSELL.body)}
+ </p>
+ <ul className="mt-3 flex flex-wrap gap-x-4 gap-y-1.5">
+ {GUIDED_UPSELL.points.map((point, index) => (
+ <li
+ key={index}
+ className="flex items-center gap-1.5 text-xs text-muted-foreground"
+ >
+ <LuCheck className="size-3.5 shrink-0 text-primary" />
+ {i18n._(point)}
+ </li>
+ ))}
+ </ul>
+ <Button
+ className="mt-4"
+ onClick={onContactExpert}
+ rightIcon={<LuArrowRight />}
+ >
+ {i18n._(GUIDED_UPSELL.cta)}
+ </Button>
</div>
- <p className="text-sm text-muted-foreground mt-1 text-pretty">
- {i18n._(GUIDED_UPSELL.body)}
- </p>
- <ul className="mt-3 flex flex-wrap gap-x-4 gap-y-1.5">
- {GUIDED_UPSELL.points.map((point, index) => (
- <li
- key={index}
- className="flex items-center gap-1.5 text-xs text-muted-foreground"
- >
- <LuCheck className="size-3.5 shrink-0 text-primary" />
- {i18n._(point)}
- </li>
- ))}
- </ul>
- <Button
- className="mt-4"
- onClick={onContactExpert}
- rightIcon={<LuArrowRight />}
- >
- {i18n._(GUIDED_UPSELL.cta)}
- </Button>
- </div>
- </section>
+ </CardContent>
+ </Card>
);
}
diff --git a/packages/onboarding/src/ui/HowWeWorkView.tsx b/packages/onboarding/src/ui/HowWeWorkView.tsx
index f251665667..12976ec82f 100644
--- a/packages/onboarding/src/ui/HowWeWorkView.tsx
+++ b/packages/onboarding/src/ui/HowWeWorkView.tsx
@@ -1,6 +1,7 @@
import { Trans, useLingui } from "@lingui/react/macro";
import { CADENCE, ESCALATION } from "../content/howwework";
import { EditableField } from "./EditableField";
+import { Panel, Section, SectionList } from "./primitives";
import { useFieldMap } from "./state";
export function HowWeWorkView() {
@@ -21,13 +22,8 @@ export function HowWeWorkView() {
</p>
</header>
- <section className="rounded-lg border bg-card shadow-button-base overflow-hidden">
- <div className="px-5 py-3 border-b">
- <span className="text-sm font-semibold">
- <Trans>Meeting cadence</Trans>
- </span>
- </div>
- <ul className="divide-y">
+ <Section title={<Trans>Meeting cadence</Trans>}>
+ <SectionList>
{CADENCE.map((c) => (
<li key={c.key} className="flex items-center gap-4 px-5 py-3">
<span className="text-sm font-medium w-28 shrink-0">
@@ -41,13 +37,10 @@ export function HowWeWorkView() {
/>
</li>
))}
- </ul>
- </section>
+ </SectionList>
+ </Section>
- <section className="rounded-lg border bg-card shadow-button-base p-5">
- <h2 className="text-sm font-semibold mb-4">
- <Trans>If something is off track</Trans>
- </h2>
+ <Panel title={<Trans>If something is off track</Trans>}>
<ol className="flex flex-col gap-4">
{ESCALATION.map((step) => (
<li key={step.n} className="flex items-start gap-3">
@@ -63,7 +56,7 @@ export function HowWeWorkView() {
</li>
))}
</ol>
- </section>
+ </Panel>
<div className="rounded-lg border-l-2 border-l-primary bg-muted/30 px-5 py-4">
<p className="text-sm text-muted-foreground">
diff --git a/packages/onboarding/src/ui/OnboardingHub.tsx b/packages/onboarding/src/ui/OnboardingHub.tsx
index 3827d5642b..28b0605cf9 100644
--- a/packages/onboarding/src/ui/OnboardingHub.tsx
+++ b/packages/onboarding/src/ui/OnboardingHub.tsx
@@ -1,4 +1,12 @@
-import { Badge, Button, cn } from "@carbon/react";
+import {
+ Badge,
+ Button,
+ Card,
+ CardContent,
+ CardHeader,
+ CardTitle,
+ cn
+} from "@carbon/react";
import { Plural, Trans, useLingui } from "@lingui/react/macro";
import { useEffect, useRef } from "react";
import {
@@ -131,7 +139,7 @@ export function OnboardingHub({
) : null}
{done === total ? (
- <div className="rounded-lg border border-emerald-500/30 bg-emerald-500/5 p-6 flex items-center gap-4 motion-safe:animate-in motion-safe:fade-in-50 motion-safe:zoom-in-95 motion-safe:duration-500">
+ <Card className="flex-row items-center gap-4 p-6 border border-emerald-500/30 bg-emerald-500/5 dark:bg-emerald-500/5 motion-safe:animate-in motion-safe:fade-in-50 motion-safe:zoom-in-95 motion-safe:duration-500">
<div className="shrink-0 size-12 rounded-lg bg-emerald-500/15 flex items-center justify-center">
<LuPartyPopper className="text-2xl text-emerald-600 dark:text-emerald-400" />
</div>
@@ -151,16 +159,16 @@ export function OnboardingHub({
<Trans>Finish onboarding</Trans>
</Button>
) : null}
- </div>
+ </Card>
) : null}
- <div className="rounded-lg border bg-card overflow-hidden">
- <div className="flex items-end justify-between gap-4 flex-wrap p-6 pb-4 border-b">
- <div className="text-base font-medium tracking-tight">
+ <Card className="overflow-hidden">
+ <CardHeader className="flex-row items-end justify-between gap-4 flex-wrap border-b border-border">
+ <CardTitle className="line-clamp-none">
<Trans>
{done} of {total} phases complete
</Trans>
- </div>
+ </CardTitle>
<span className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<span
className={cn(
@@ -170,50 +178,51 @@ export function OnboardingHub({
/>
{stateText}
</span>
- </div>
-
- <div className="flex gap-1.5 px-6 py-4">
- {spine.map((step) => {
- const st = effectiveGateStatus(
- step,
- map,
- signals,
- stepTaskProgress(tasks, step.key, map)
- );
- return (
- <div
- key={step.key}
- className={cn(
- "flex-1 h-2.5 rounded-full transition-colors",
- st === "done"
- ? "bg-emerald-500"
- : st === "prog"
- ? "bg-primary"
- : "bg-border"
- )}
- />
- );
- })}
- </div>
-
- <ul className="divide-y">
- {spine.map((step) => (
- <GateRow
- key={step.key}
- step={step}
- tier={tier}
- status={effectiveGateStatus(
+ </CardHeader>
+ <CardContent className="p-0 border-0">
+ <div className="flex gap-1.5 px-6 py-4">
+ {spine.map((step) => {
+ const st = effectiveGateStatus(
step,
map,
signals,
stepTaskProgress(tasks, step.key, map)
- )}
- progress={stepTaskProgress(tasks, step.key, map)}
- onOpenInPlan={onOpenInPlan}
- />
- ))}
- </ul>
- </div>
+ );
+ return (
+ <div
+ key={step.key}
+ className={cn(
+ "flex-1 h-2.5 rounded-full transition-colors",
+ st === "done"
+ ? "bg-emerald-500"
+ : st === "prog"
+ ? "bg-primary"
+ : "bg-border"
+ )}
+ />
+ );
+ })}
+ </div>
+
+ <ul className="divide-y">
+ {spine.map((step) => (
+ <GateRow
+ key={step.key}
+ step={step}
+ tier={tier}
+ status={effectiveGateStatus(
+ step,
+ map,
+ signals,
+ stepTaskProgress(tasks, step.key, map)
+ )}
+ progress={stepTaskProgress(tasks, step.key, map)}
+ onOpenInPlan={onOpenInPlan}
+ />
+ ))}
+ </ul>
+ </CardContent>
+ </Card>
{tier === "self_serve" && onContactExpert ? (
<GuidedUpsellCard onContactExpert={onContactExpert} />
@@ -244,63 +253,65 @@ function NextStepCard({
: undefined;
return (
- <div className="rounded-lg border border-border bg-card p-5 flex items-start gap-4 motion-safe:animate-in motion-safe:fade-in-50 motion-safe:slide-in-from-bottom-2 motion-safe:duration-300">
- <div className="shrink-0 size-9 rounded-xl bg-primary/15 flex items-center justify-center text-sm font-medium tabular-nums">
- {action.gateNumber}
- </div>
- <div className="flex-1 min-w-0">
- <div className="text-xxs uppercase text-muted-foreground tracking-wide font-medium">
- <Trans>Next step</Trans>
- </div>
- <div className="text-base font-medium tracking-tight mt-0.5">
- {i18n._(action.title)}
+ <Card className="motion-safe:animate-in motion-safe:fade-in-50 motion-safe:slide-in-from-bottom-2 motion-safe:duration-300">
+ <CardContent className="flex-row items-start gap-4 p-5 border-0">
+ <div className="shrink-0 size-9 rounded-xl bg-primary/15 flex items-center justify-center text-sm font-medium tabular-nums">
+ {action.gateNumber}
</div>
- {action.detail ? (
- <p className="text-sm text-muted-foreground mt-1">
- {i18n._(action.detail)}
- </p>
- ) : null}
- <div className="flex items-center gap-2 mt-3 flex-wrap">
- {product ? (
- <Button
- leftIcon={<LuArrowRight />}
- onClick={() => onOpenProduct(product.key)}
- >
- {product.cta ? i18n._(product.cta) : t`Open in Carbon`}
- </Button>
- ) : (
- <Button
- leftIcon={<LuArrowRight />}
- onClick={() => onOpenPage(action.refSlug)}
- >
- <Trans>Go to {i18n._(action.refTitle)}</Trans>
- </Button>
- )}
- {videoUrl ? (
- <Button
- variant="secondary"
- size="sm"
- leftIcon={<LuPlay />}
- onClick={() => window.open(videoUrl, "_blank", "noopener")}
- >
- <Trans>Watch</Trans>
- </Button>
- ) : null}
- {product?.docsUrl ? (
- <Button
- variant="secondary"
- size="sm"
- leftIcon={<LuArrowUpRight />}
- onClick={() =>
- window.open(product.docsUrl, "_blank", "noopener,noreferrer")
- }
- >
- <Trans>Docs</Trans>
- </Button>
+ <div className="flex-1 min-w-0">
+ <div className="text-xxs uppercase text-muted-foreground tracking-wide font-medium">
+ <Trans>Next step</Trans>
+ </div>
+ <div className="text-base font-medium tracking-tight mt-0.5">
+ {i18n._(action.title)}
+ </div>
+ {action.detail ? (
+ <p className="text-sm text-muted-foreground mt-1">
+ {i18n._(action.detail)}
+ </p>
) : null}
+ <div className="flex items-center gap-2 mt-3 flex-wrap">
+ {product ? (
+ <Button
+ leftIcon={<LuArrowRight />}
+ onClick={() => onOpenProduct(product.key)}
+ >
+ {product.cta ? i18n._(product.cta) : t`Open in Carbon`}
+ </Button>
+ ) : (
+ <Button
+ leftIcon={<LuArrowRight />}
+ onClick={() => onOpenPage(action.refSlug)}
+ >
+ <Trans>Go to {i18n._(action.refTitle)}</Trans>
+ </Button>
+ )}
+ {videoUrl ? (
+ <Button
+ variant="secondary"
+ size="sm"
+ leftIcon={<LuPlay />}
+ onClick={() => window.open(videoUrl, "_blank", "noopener")}
+ >
+ <Trans>Watch</Trans>
+ </Button>
+ ) : null}
+ {product?.docsUrl ? (
+ <Button
+ variant="secondary"
+ size="sm"
+ leftIcon={<LuArrowUpRight />}
+ onClick={() =>
+ window.open(product.docsUrl, "_blank", "noopener,noreferrer")
+ }
+ >
+ <Trans>Docs</Trans>
+ </Button>
+ ) : null}
+ </div>
</div>
- </div>
- </div>
+ </CardContent>
+ </Card>
);
}
diff --git a/packages/onboarding/src/ui/OnboardingHubSummary.tsx b/packages/onboarding/src/ui/OnboardingHubSummary.tsx
index 244ca885c7..daf01a9812 100644
--- a/packages/onboarding/src/ui/OnboardingHubSummary.tsx
+++ b/packages/onboarding/src/ui/OnboardingHubSummary.tsx
@@ -1,4 +1,4 @@
-import { cn, IconButton } from "@carbon/react";
+import { Card, cn, IconButton } from "@carbon/react";
import { Trans, useLingui } from "@lingui/react/macro";
import type { ReactNode } from "react";
import { LuX } from "react-icons/lu";
@@ -28,7 +28,7 @@ export function OnboardingHubSummary({
const { t } = useLingui();
const pct = total > 0 ? Math.round((done / total) * 100) : 0;
return (
- <div className="relative rounded-lg border bg-gradient-to-bl from-card from-50% to-background shadow-button-base p-6 pr-12 flex items-center gap-5 mb-6">
+ <Card className="relative flex-row items-center gap-5 p-6 pr-12 mb-6 bg-gradient-to-bl from-card from-50% to-background">
<div className="shrink-0 size-12 rounded-xl border flex items-center justify-center">
<img
src="/carbon-mark-light.svg"
@@ -75,6 +75,6 @@ export function OnboardingHubSummary({
className="absolute top-2 right-2 text-muted-foreground"
/>
) : null}
- </div>
+ </Card>
);
}
diff --git a/packages/onboarding/src/ui/PlanView.tsx b/packages/onboarding/src/ui/PlanView.tsx
index 9a7ce53d3d..dd9fdf25bd 100644
--- a/packages/onboarding/src/ui/PlanView.tsx
+++ b/packages/onboarding/src/ui/PlanView.tsx
@@ -4,6 +4,11 @@ import {
AlertTitle,
Badge,
Button,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
cn,
Modal,
ModalBody,
@@ -186,278 +191,274 @@ function PhaseCard({
}, [allDone, gateStatus, step.key, onToggleGate]);
return (
- <div
- id={planAnchorId(step.key)}
- className="rounded-lg border bg-card shadow-button-base overflow-hidden scroll-mt-6"
- >
- <div className="p-5 pb-4">
- <div className="flex items-start gap-4">
- <span
- className={cn(
- "shrink-0 size-9 rounded-lg border flex items-center justify-center text-sm font-semibold tabular-nums",
- gatePassed
- ? "bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400"
- : gateInProgress
- ? "bg-primary/10 border-primary/30 text-primary"
- : "bg-background"
- )}
- >
- {step.n}
- </span>
- <div className="flex-1 min-w-0">
- <div className="flex items-center gap-2 flex-wrap">
- <span className="text-base font-semibold tracking-tight">
- {i18n._(step.title)}
- </span>
- </div>
- <div className="text-xs text-muted-foreground mt-1">
- {i18n._(step.timing)}
- {tier !== "self_serve"
- ? ` · ${i18n._(ownerLeadLabel(ownerForStep(step, tier)))}`
- : null}
- </div>
- </div>
- {total > 0 ? (
- <Badge
- variant={allDone ? "green" : "outline"}
- className="shrink-0 tabular-nums"
- >
- {done} / {total} <Trans>done</Trans>
- </Badge>
- ) : null}
+ <Card id={planAnchorId(step.key)} className="overflow-hidden scroll-mt-6">
+ <CardHeader className="flex-row items-start gap-4 px-5 py-4 border-b border-border">
+ <span
+ className={cn(
+ "shrink-0 size-9 rounded-lg border flex items-center justify-center text-sm font-semibold tabular-nums",
+ gatePassed
+ ? "bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400"
+ : gateInProgress
+ ? "bg-primary/10 border-primary/30 text-primary"
+ : "bg-background"
+ )}
+ >
+ {step.n}
+ </span>
+ <div className="flex-1 min-w-0">
+ <CardTitle className="text-base font-semibold tracking-tight line-clamp-none">
+ {i18n._(step.title)}
+ </CardTitle>
+ <CardDescription className="mt-1">
+ {i18n._(step.timing)}
+ {tier !== "self_serve"
+ ? ` · ${i18n._(ownerLeadLabel(ownerForStep(step, tier)))}`
+ : null}
+ </CardDescription>
</div>
-
- {step.desc ? (
- <p className="text-sm text-muted-foreground mt-3">
- {i18n._(step.desc)}
- </p>
+ {total > 0 ? (
+ <Badge
+ variant={allDone ? "green" : "outline"}
+ className="shrink-0 tabular-nums"
+ >
+ {done} / {total} <Trans>done</Trans>
+ </Badge>
) : null}
+ </CardHeader>
+ <CardContent className="p-0 border-0">
+ <div className="px-5 py-4">
+ {step.desc ? (
+ <p className="text-sm text-muted-foreground">{i18n._(step.desc)}</p>
+ ) : null}
- {/* The separate "Learn" block would duplicate the per-task Docs/Video
+ {/* The separate "Learn" block would duplicate the per-task Docs/Video
badges when the phase's own tasks already carry links (Configure). */}
- {stepTasks.some((t) => t.docsUrl || t.academyUrl) ? null : (
- <PhaseResources step={step} />
- )}
+ {stepTasks.some((t) => t.docsUrl || t.academyUrl) ? null : (
+ <PhaseResources step={step} />
+ )}
- {stepTasks.length ? (
- <ul className="mt-4 flex flex-col gap-1">
- {stepTasks.map((task) => {
- const status = taskStatus(task, map);
- const isDone = status === "done";
- const isProg = status === "prog";
- // Setup-Map-derived tasks have no manual tick of their own — the
- // Setup Map is where the work actually happens.
- const fromSetupMap = !!task.setupKeys?.length;
- const checkbox = (
- <span
- className={cn(
- "shrink-0 mt-0.5 size-4 rounded border flex items-center justify-center transition-colors",
- isDone
- ? "bg-emerald-500 border-emerald-500 text-white"
- : isProg
- ? "bg-primary/15 border-primary"
- : "bg-card border-input"
- )}
- >
- {isDone ? <LuCheck className="size-3" /> : null}
- </span>
- );
- const label = (
- <span className="min-w-0 flex flex-col">
+ {stepTasks.length ? (
+ <ul className="mt-4 flex flex-col gap-1">
+ {stepTasks.map((task) => {
+ const status = taskStatus(task, map);
+ const isDone = status === "done";
+ const isProg = status === "prog";
+ // Setup-Map-derived tasks have no manual tick of their own — the
+ // Setup Map is where the work actually happens.
+ const fromSetupMap = !!task.setupKeys?.length;
+ const checkbox = (
<span
className={cn(
- "text-sm truncate",
- isDone && "line-through text-muted-foreground"
+ "shrink-0 mt-0.5 size-4 rounded border flex items-center justify-center transition-colors",
+ isDone
+ ? "bg-emerald-500 border-emerald-500 text-white"
+ : isProg
+ ? "bg-primary/15 border-primary"
+ : "bg-card border-input"
)}
>
- {i18n._(task.label)}
+ {isDone ? <LuCheck className="size-3" /> : null}
</span>
- {task.hint ? (
- <span className="text-xs text-muted-foreground truncate">
- {i18n._(task.hint)}
+ );
+ const label = (
+ <span className="min-w-0 flex flex-col">
+ <span
+ className={cn(
+ "text-sm truncate",
+ isDone && "line-through text-muted-foreground"
+ )}
+ >
+ {i18n._(task.label)}
</span>
- ) : null}
- </span>
- );
+ {task.hint ? (
+ <span className="text-xs text-muted-foreground truncate">
+ {i18n._(task.hint)}
+ </span>
+ ) : null}
+ </span>
+ );
+
+ // Setup rows aren't tickable here — they check themselves off as
+ // their Setup Map rows are configured, so they get the derived
+ // ring (never a checkbox) and the row opens the Setup Map, with
+ // the module's Docs/Video links inline. An <a> can't nest in a
+ // <button>, so these use a flex row of separate controls.
+ if (fromSetupMap) {
+ const setupProgress = taskSetupProgress(task, map);
+ const taskName = i18n._(task.label);
+ return (
+ <li
+ key={task.key}
+ className="group flex items-start gap-3 rounded-lg px-2 py-1.5 hover:bg-muted/50 transition-colors"
+ >
+ <DerivedStatus
+ status={isDone ? "done" : isProg ? "prog" : "todo"}
+ fraction={
+ setupProgress.total > 0
+ ? setupProgress.done / setupProgress.total
+ : undefined
+ }
+ tooltip={
+ isDone
+ ? t`"${taskName}" is done — all ${setupProgress.total} of its Setup Map items are configured.`
+ : t`"${taskName}" checks itself off once its ${setupProgress.total} Setup Map items are marked "Configured" — ${setupProgress.done} of ${setupProgress.total} so far.`
+ }
+ className="size-4 mt-0.5"
+ />
+ <button
+ type="button"
+ onClick={() =>
+ onOpenSetupMap?.(setupAnchorId(task.key))
+ }
+ title={t`Open the Setup Map`}
+ className="flex items-start gap-3 min-w-0 flex-1 text-left"
+ >
+ {label}
+ </button>
+ <div className="shrink-0 flex items-center gap-2 text-xs mt-0.5">
+ {task.docsUrl ? (
+ <LearnLink
+ href={task.docsUrl}
+ icon={<LuFileText className="size-3" />}
+ >
+ <Trans>Docs</Trans>
+ </LearnLink>
+ ) : null}
+ {task.academyUrl ? (
+ <LearnLink
+ href={task.academyUrl}
+ icon={<LuPlay className="size-3" />}
+ >
+ <Trans>Video</Trans>
+ </LearnLink>
+ ) : null}
+ </div>
+ </li>
+ );
+ }
- // Setup rows aren't tickable here — they check themselves off as
- // their Setup Map rows are configured, so they get the derived
- // ring (never a checkbox) and the row opens the Setup Map, with
- // the module's Docs/Video links inline. An <a> can't nest in a
- // <button>, so these use a flex row of separate controls.
- if (fromSetupMap) {
- const setupProgress = taskSetupProgress(task, map);
- const taskName = i18n._(task.label);
return (
- <li
- key={task.key}
- className="group flex items-start gap-3 rounded-lg px-2 py-1.5 hover:bg-muted/50 transition-colors"
- >
- <DerivedStatus
- status={isDone ? "done" : isProg ? "prog" : "todo"}
- fraction={
- setupProgress.total > 0
- ? setupProgress.done / setupProgress.total
- : undefined
- }
- tooltip={
- isDone
- ? t`"${taskName}" is done — all ${setupProgress.total} of its Setup Map items are configured.`
- : t`"${taskName}" checks itself off once its ${setupProgress.total} Setup Map items are marked "Configured" — ${setupProgress.done} of ${setupProgress.total} so far.`
- }
- className="size-4 mt-0.5"
- />
+ <li key={task.key}>
<button
type="button"
- onClick={() => onOpenSetupMap?.(setupAnchorId(task.key))}
- title={t`Open the Setup Map`}
- className="flex items-start gap-3 min-w-0 flex-1 text-left"
+ onClick={() =>
+ onToggleTask(
+ taskKey(task.key),
+ "task",
+ isDone ? "todo" : "done"
+ )
+ }
+ className="group w-full flex items-start gap-3 rounded-lg px-2 py-1.5 text-left hover:bg-muted/50 transition-colors"
>
+ {checkbox}
{label}
</button>
- <div className="shrink-0 flex items-center gap-2 text-xs mt-0.5">
- {task.docsUrl ? (
- <LearnLink
- href={task.docsUrl}
- icon={<LuFileText className="size-3" />}
- >
- <Trans>Docs</Trans>
- </LearnLink>
- ) : null}
- {task.academyUrl ? (
- <LearnLink
- href={task.academyUrl}
- icon={<LuPlay className="size-3" />}
- >
- <Trans>Video</Trans>
- </LearnLink>
- ) : null}
- </div>
</li>
);
- }
-
- return (
- <li key={task.key}>
- <button
- type="button"
- onClick={() =>
- onToggleTask(
- taskKey(task.key),
- "task",
- isDone ? "todo" : "done"
- )
- }
- className="group w-full flex items-start gap-3 rounded-lg px-2 py-1.5 text-left hover:bg-muted/50 transition-colors"
- >
- {checkbox}
- {label}
- </button>
- </li>
- );
- })}
- </ul>
- ) : null}
- </div>
-
- <div
- className={cn(
- "px-5 py-3 border-t text-xs flex items-center gap-3 transition-colors",
- gatePassed
- ? "bg-emerald-500/5"
- : gateInProgress
- ? "bg-primary/5"
- : "bg-card"
- )}
- >
- <div className="min-w-0 flex-1">
- <span className="text-muted-foreground">
- <Trans>Checkpoint ·</Trans>{" "}
- </span>
- <span className="font-medium">{i18n._(step.gate)}</span>
- {gateInProgress ? (
- // In-progress blue app-wide (BoP status language), not theme
- // primary — primary is near-black on neutral themes.
- <Badge variant="blue" className="ml-2">
- <Trans>In progress</Trans>
- </Badge>
+ })}
+ </ul>
) : null}
</div>
- <button
- type="button"
- onClick={() => {
- if (gatePassed) {
- onToggleGate(step.key, "todo");
- } else if (openTasks.length > 0) {
- setConfirmOpen(true);
- } else {
- onToggleGate(step.key, "done");
- }
- }}
+
+ <div
className={cn(
- "shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xxs font-medium transition-colors active:scale-[0.97]",
+ "px-5 py-3 border-t text-xs flex items-center gap-3 transition-colors",
gatePassed
- ? "border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/20"
- : "bg-card hover:border-primary hover:text-primary"
+ ? "bg-emerald-500/5"
+ : gateInProgress
+ ? "bg-primary/5"
+ : "bg-card"
)}
>
- {gatePassed ? (
- <>
- <LuCheck className="size-3" />
- <Trans>Passed</Trans>
- <span className="opacity-60">·</span>
- <LuRotateCcw className="size-3" />
- <Trans>Reopen</Trans>
- </>
- ) : (
- t`Mark checkpoint passed`
- )}
- </button>
- </div>
-
- <Modal open={confirmOpen} onOpenChange={setConfirmOpen}>
- <ModalContent>
- <ModalHeader>
- <ModalTitle>{t`Mark "${i18n._(step.gate)}" as passed?`}</ModalTitle>
- <ModalDescription>
- <Trans>
- Are you sure you want to pass this checkpoint? The{" "}
- {i18n._(step.title)} phase still has unfinished tasks.
- </Trans>
- </ModalDescription>
- </ModalHeader>
- <ModalBody>
- <Alert variant="destructive">
- <LuTriangleAlert className="h-4 w-4" />
- <AlertTitle>
- <Trans>Tasks still open</Trans>
- </AlertTitle>
- <AlertDescription>
- <Trans>The following tasks are not done yet:</Trans>
- <ul className="list-disc py-2 pl-4">
- {openTasks.map((task) => (
- <li key={task.key}>{i18n._(task.label)}</li>
- ))}
- </ul>
- </AlertDescription>
- </Alert>
- </ModalBody>
- <ModalFooter>
- <Button variant="secondary" onClick={() => setConfirmOpen(false)}>
- <Trans>Cancel</Trans>
- </Button>
- <Button
- onClick={() => {
- setConfirmOpen(false);
+ <div className="min-w-0 flex-1">
+ <span className="text-muted-foreground">
+ <Trans>Checkpoint ·</Trans>{" "}
+ </span>
+ <span className="font-medium">{i18n._(step.gate)}</span>
+ {gateInProgress ? (
+ // In-progress blue app-wide (BoP status language), not theme
+ // primary — primary is near-black on neutral themes.
+ <Badge variant="blue" className="ml-2">
+ <Trans>In progress</Trans>
+ </Badge>
+ ) : null}
+ </div>
+ <button
+ type="button"
+ onClick={() => {
+ if (gatePassed) {
+ onToggleGate(step.key, "todo");
+ } else if (openTasks.length > 0) {
+ setConfirmOpen(true);
+ } else {
onToggleGate(step.key, "done");
- }}
- >
- <Trans>Mark checkpoint passed</Trans>
- </Button>
- </ModalFooter>
- </ModalContent>
- </Modal>
- </div>
+ }
+ }}
+ className={cn(
+ "shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xxs font-medium transition-colors active:scale-[0.97]",
+ gatePassed
+ ? "border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/20"
+ : "bg-card hover:border-primary hover:text-primary"
+ )}
+ >
+ {gatePassed ? (
+ <>
+ <LuCheck className="size-3" />
+ <Trans>Passed</Trans>
+ <span className="opacity-60">·</span>
+ <LuRotateCcw className="size-3" />
+ <Trans>Reopen</Trans>
+ </>
+ ) : (
+ t`Mark checkpoint passed`
+ )}
+ </button>
+ </div>
+
+ <Modal open={confirmOpen} onOpenChange={setConfirmOpen}>
+ <ModalContent>
+ <ModalHeader>
+ <ModalTitle>{t`Mark "${i18n._(step.gate)}" as passed?`}</ModalTitle>
+ <ModalDescription>
+ <Trans>
+ Are you sure you want to pass this checkpoint? The{" "}
+ {i18n._(step.title)} phase still has unfinished tasks.
+ </Trans>
+ </ModalDescription>
+ </ModalHeader>
+ <ModalBody>
+ <Alert variant="destructive">
+ <LuTriangleAlert className="h-4 w-4" />
+ <AlertTitle>
+ <Trans>Tasks still open</Trans>
+ </AlertTitle>
+ <AlertDescription>
+ <Trans>The following tasks are not done yet:</Trans>
+ <ul className="list-disc py-2 pl-4">
+ {openTasks.map((task) => (
+ <li key={task.key}>{i18n._(task.label)}</li>
+ ))}
+ </ul>
+ </AlertDescription>
+ </Alert>
+ </ModalBody>
+ <ModalFooter>
+ <Button variant="secondary" onClick={() => setConfirmOpen(false)}>
+ <Trans>Cancel</Trans>
+ </Button>
+ <Button
+ onClick={() => {
+ setConfirmOpen(false);
+ onToggleGate(step.key, "done");
+ }}
+ >
+ <Trans>Mark checkpoint passed</Trans>
+ </Button>
+ </ModalFooter>
+ </ModalContent>
+ </Modal>
+ </CardContent>
+ </Card>
);
}
diff --git a/packages/onboarding/src/ui/RolesView.tsx b/packages/onboarding/src/ui/RolesView.tsx
index 3c6e81dfb6..fa3032938a 100644
--- a/packages/onboarding/src/ui/RolesView.tsx
+++ b/packages/onboarding/src/ui/RolesView.tsx
@@ -3,7 +3,7 @@ import { Trans, useLingui } from "@lingui/react/macro";
import { PAGE_COPY } from "../content";
import { ROLES } from "../content/roles";
import type { Owner } from "../types";
-import { OWNER_TOKENS } from "./primitives";
+import { OWNER_TOKENS, Section, SectionList } from "./primitives";
export function RolesView() {
const { i18n } = useLingui();
@@ -63,16 +63,8 @@ export function RolesView() {
<div className="flex flex-col gap-4">
{ROLES.map((step) => (
- <div
- key={step.stepKey}
- className="rounded-lg border bg-card shadow-button-base overflow-hidden"
- >
- <div className="px-5 py-3 border-b">
- <span className="text-sm font-semibold">
- {i18n._(step.title)}
- </span>
- </div>
- <ul className="divide-y">
+ <Section key={step.stepKey} title={i18n._(step.title)}>
+ <SectionList>
{step.lines.map((line, i) => (
<li key={i} className="flex items-center gap-3 px-5 py-3">
<span className="flex-1 text-sm">{i18n._(line.label)}</span>
@@ -92,8 +84,8 @@ export function RolesView() {
</span>
</li>
))}
- </ul>
- </div>
+ </SectionList>
+ </Section>
))}
</div>
</div>
diff --git a/packages/onboarding/src/ui/ScopeView.tsx b/packages/onboarding/src/ui/ScopeView.tsx
index e379a493e3..94987ed5c7 100644
--- a/packages/onboarding/src/ui/ScopeView.tsx
+++ b/packages/onboarding/src/ui/ScopeView.tsx
@@ -1,4 +1,4 @@
-import { Button, cn } from "@carbon/react";
+import { Button, Card, cn } from "@carbon/react";
import { Trans, useLingui } from "@lingui/react/macro";
import { LuCheck, LuX } from "react-icons/lu";
import { PAGE_COPY, UI_TEXT } from "../content";
@@ -113,12 +113,14 @@ export function ScopeView() {
</p>
</Panel>
- <section
+ <Card
className={cn(
- "rounded-lg border p-5 shadow-button-base",
+ "p-5 border",
+ // dark: variant is required — the Card shell's base `dark:bg-card`
+ // otherwise overrides an un-prefixed tint in dark mode.
agreed
- ? "border-emerald-500/30 bg-emerald-500/5"
- : "border-primary/30 bg-primary/5"
+ ? "border-emerald-500/30 bg-emerald-500/5 dark:bg-emerald-500/5"
+ : "border-primary/30 bg-primary/5 dark:bg-primary/5"
)}
>
{agreed ? (
@@ -160,7 +162,7 @@ export function ScopeView() {
</Button>
</div>
)}
- </section>
+ </Card>
</div>
);
}
diff --git a/packages/onboarding/src/ui/SetupControls.tsx b/packages/onboarding/src/ui/SetupControls.tsx
index afdcaeefb2..33859a9341 100644
--- a/packages/onboarding/src/ui/SetupControls.tsx
+++ b/packages/onboarding/src/ui/SetupControls.tsx
@@ -1,4 +1,12 @@
-import { Badge, Button, cn, DatePicker, Input } from "@carbon/react";
+import {
+ Badge,
+ Button,
+ CardContent,
+ cn,
+ DatePicker,
+ Input,
+ Card as UICard
+} from "@carbon/react";
import type { MessageDescriptor } from "@lingui/core";
import { msg } from "@lingui/core/macro";
import { Trans, useLingui } from "@lingui/react/macro";
@@ -250,17 +258,19 @@ function Card({
children: React.ReactNode;
}) {
return (
- <section className="rounded-lg border bg-card shadow-button-base p-5">
- <h2 className="text-sm font-semibold">{title}</h2>
- {subtitle ? (
- <p className="text-xs text-muted-foreground mt-1 mb-4 max-w-xl">
- {subtitle}
- </p>
- ) : (
- <div className="mb-4" />
- )}
- {children}
- </section>
+ <UICard>
+ <CardContent className="p-5 border-0">
+ <h2 className="text-sm font-semibold">{title}</h2>
+ {subtitle ? (
+ <p className="text-xs text-muted-foreground mt-1 mb-4 max-w-xl">
+ {subtitle}
+ </p>
+ ) : (
+ <div className="mb-4" />
+ )}
+ {children}
+ </CardContent>
+ </UICard>
);
}
diff --git a/packages/onboarding/src/ui/SetupMapView.tsx b/packages/onboarding/src/ui/SetupMapView.tsx
index ce8c2c4c6c..cf3333991d 100644
--- a/packages/onboarding/src/ui/SetupMapView.tsx
+++ b/packages/onboarding/src/ui/SetupMapView.tsx
@@ -70,9 +70,16 @@ export function SetupMapView() {
const { toggleFlag, toggleFlags } = useHubActions();
const resolveScreenUrl = useResolveScreenUrl();
- const visibleRows = SETUP_GROUPS.flatMap((g) =>
- filterByModule(g.rows, exclusions.modules)
- );
+ // Groups whose module is excluded drop out entirely (e.g. Accounting when the
+ // company has no accounting). The badge number is the group's position among
+ // the *visible* groups — deriving it here keeps the list reading 1, 2, 3… with
+ // no gaps. `group.n` stays the stable identity (anchor + board-task key), which
+ // must NOT be positional or excluding a module would reshuffle every key.
+ const visibleGroups = SETUP_GROUPS.map((group) => ({
+ group,
+ rows: filterByModule(group.rows, exclusions.modules)
+ })).filter(({ rows }) => rows.length > 0);
+ const visibleRows = visibleGroups.flatMap(({ rows }) => rows);
const configured = visibleRows.filter(
(r) => map.get(configuredKey(r.key)) === "1"
).length;
@@ -91,9 +98,7 @@ export function SetupMapView() {
}
/>
- {SETUP_GROUPS.map((group) => {
- const rows = filterByModule(group.rows, exclusions.modules);
- if (rows.length === 0) return null;
+ {visibleGroups.map(({ group, rows }, index) => {
const allConfigured = rows.every(
(r) => map.get(configuredKey(r.key)) === "1"
);
@@ -102,7 +107,7 @@ export function SetupMapView() {
key={group.n}
id={setupAnchorId(setupGroupKey(group.n))}
className="scroll-mt-6"
- number={group.n}
+ number={index + 1}
title={i18n._(group.title)}
subtitle={i18n._(group.desc)}
aside={
diff --git a/packages/onboarding/src/ui/TeamView.tsx b/packages/onboarding/src/ui/TeamView.tsx
index e8af3ef64b..3fd8b9250a 100644
--- a/packages/onboarding/src/ui/TeamView.tsx
+++ b/packages/onboarding/src/ui/TeamView.tsx
@@ -1,3 +1,4 @@
+import { Card, CardContent } from "@carbon/react";
import { Trans, useLingui } from "@lingui/react/macro";
import { LuUser } from "react-icons/lu";
import { PAGE_COPY } from "../content";
@@ -31,20 +32,21 @@ export function TeamView() {
<div className="flex flex-col gap-3">
{TEAM_ROLES.map((member, i) => (
- <div
- key={i}
- className="rounded-lg border bg-card shadow-button-base p-5 flex items-start gap-4"
- >
- <span className="shrink-0 size-10 rounded-full border bg-background flex items-center justify-center">
- <LuUser className="text-muted-foreground" />
- </span>
- <div>
- <div className="text-sm font-semibold">{i18n._(member.role)}</div>
- <div className="text-sm text-muted-foreground mt-0.5">
- <Trans>Owns: {i18n._(member.owns)}</Trans>
+ <Card key={i}>
+ <CardContent className="flex-row items-start gap-4 p-5 border-0">
+ <span className="shrink-0 size-10 rounded-full border bg-background flex items-center justify-center">
+ <LuUser className="text-muted-foreground" />
+ </span>
+ <div>
+ <div className="text-sm font-semibold">
+ {i18n._(member.role)}
+ </div>
+ <div className="text-sm text-muted-foreground mt-0.5">
+ <Trans>Owns: {i18n._(member.owns)}</Trans>
+ </div>
</div>
- </div>
- </div>
+ </CardContent>
+ </Card>
))}
</div>
</div>
diff --git a/packages/onboarding/src/ui/ValueView.tsx b/packages/onboarding/src/ui/ValueView.tsx
index 08999e5dc2..58778a7e0a 100644
--- a/packages/onboarding/src/ui/ValueView.tsx
+++ b/packages/onboarding/src/ui/ValueView.tsx
@@ -35,10 +35,7 @@ export function ValueView() {
<section className="grid grid-cols-1 sm:grid-cols-3 gap-4">
{VALUE_METRICS.map((metric) => (
- <div
- key={metric.key}
- className="rounded-lg border bg-card shadow-button-base p-5 flex flex-col gap-1"
- >
+ <Panel key={metric.key} className="gap-1">
<EditableField
fieldKey={`${metric.key}.value`}
value={fields.get(`${metric.key}.value`)}
@@ -53,7 +50,7 @@ export function ValueView() {
placeholder={t`Metric`}
className="text-xs text-muted-foreground"
/>
- </div>
+ </Panel>
))}
</section>
{canEdit ? (
diff --git a/packages/onboarding/src/ui/primitives/Section.tsx b/packages/onboarding/src/ui/primitives/Section.tsx
index e394e39979..aaa86e1023 100644
--- a/packages/onboarding/src/ui/primitives/Section.tsx
+++ b/packages/onboarding/src/ui/primitives/Section.tsx
@@ -1,8 +1,21 @@
// Card-shell + list primitives. The hub's surfaces are all "titled card wrapping
-// a divided list"; this replaces ~15 copy-pasted `rounded-lg border bg-card …`
-// blocks. Compose: <Section title aside><SectionList>{rows}</SectionList></Section>.
+// a divided list", composed the design-system way: a `CardHeader` (title bar,
+// sitting on the `Card` shell) over a `CardContent` (the white `bg-card` surface
+// holding the list — the `Card` shell itself is the muted `bg-accent` tray in
+// light mode, so the body must live in a `CardContent` or it reads gray).
+// `CardContent` is `border-0`: the `Card`'s `shadow-button-base` already draws
+// the crisp outer edge, so a `CardContent` border on top of it reads as a blurry
+// double line. The header/body divider is a `border-b` on the `CardHeader`.
+// Compose: <Section title aside><SectionList>{rows}</SectionList></Section>.
-import { cn } from "@carbon/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ cn
+} from "@carbon/react";
import type { ReactNode } from "react";
export function Section({
@@ -24,15 +37,9 @@ export function Section({
}) {
const hasHeader = title != null || aside != null;
return (
- <section
- id={id}
- className={cn(
- "rounded-lg border bg-card shadow-button-base overflow-hidden",
- className
- )}
- >
+ <Card id={id} className={cn("overflow-hidden", className)}>
{hasHeader ? (
- <div className="px-5 py-3 border-b flex items-start justify-between gap-3">
+ <CardHeader className="flex-row items-start justify-between gap-3 px-5 py-3 border-b border-border">
<div className="flex items-start gap-3 min-w-0">
{number != null ? (
<span className="shrink-0 size-6 rounded-lg border bg-background flex items-center justify-center text-xs font-semibold tabular-nums">
@@ -41,18 +48,18 @@ export function Section({
) : null}
<div className="min-w-0">
{title != null ? (
- <div className="text-sm font-semibold">{title}</div>
+ <CardTitle className="text-sm font-semibold">{title}</CardTitle>
) : null}
{subtitle != null ? (
- <div className="text-xs text-muted-foreground">{subtitle}</div>
+ <CardDescription>{subtitle}</CardDescription>
) : null}
</div>
</div>
{aside != null ? <div className="shrink-0">{aside}</div> : null}
- </div>
+ </CardHeader>
) : null}
- {children}
- </section>
+ <CardContent className="p-0 border-0">{children}</CardContent>
+ </Card>
);
}
@@ -66,8 +73,10 @@ export function SectionList({
return <ul className={cn("divide-y", className)}>{children}</ul>;
}
-// The other card idiom: a padded card with an inline heading (no header bar, no
-// divided list). Used for prose/summary blocks (Scope sections, support, etc.).
+// The other card idiom: a padded card for prose/summary blocks (Scope sections,
+// support, etc.). Same design-system composition as `Section` — a titled `Panel`
+// puts its heading in a `CardHeader` over the `CardContent` body; an untitled one
+// is just the `CardContent` surface.
export function Panel({
title,
aside,
@@ -79,22 +88,20 @@ export function Panel({
children: ReactNode;
className?: string;
}) {
+ const hasHeader = title != null || aside != null;
return (
- <section
- className={cn(
- "rounded-lg border bg-card shadow-button-base p-5",
- className
- )}
- >
- {title != null || aside != null ? (
- <div className="flex items-start justify-between gap-3 mb-3">
+ <Card className="overflow-hidden">
+ {hasHeader ? (
+ <CardHeader className="flex-row items-start justify-between gap-3 px-5 py-3 border-b border-border">
{title != null ? (
- <h2 className="text-sm font-semibold">{title}</h2>
+ <CardTitle className="text-sm font-semibold">{title}</CardTitle>
) : null}
{aside != null ? <div className="shrink-0">{aside}</div> : null}
- </div>
+ </CardHeader>
) : null}
- {children}
- </section>
+ <CardContent className={cn("p-5 border-0", className)}>
+ {children}
+ </CardContent>
+ </Card>
);
}