Task: ListCard Component
Type: Component
Milestone: M0.5 — Shared Component Library
Estimate: S
Component Type
Props Interface
interface ListCardProps {
children: ReactNode; // expanded body content
header: ReactNode; // always visible — title, badges, meta
footer?: ReactNode; // action buttons — only shown when expanded
isClickable?: boolean;
isExpanded?: boolean;
onToggle?: () => void;
className?: string;
testId?: string;
}
Variants / States
| State |
Description |
| Collapsed |
Only header slot renders. Body and footer hidden. |
| Expanded |
Header + body (children) + footer all render. Border upgrades to --border-primary + --shadow-md. |
| Clickable hover |
--border-secondary on hover, pointer cursor — only when isClickable is true |
| With footer |
Footer slot rendered below a top divider, flex row, wraps on overflow |
| Without footer |
No divider, no empty space at bottom |
Acceptance Criteria
Notes
ReportCard and UserCard (M2) both compose this — validate slot API against ReportCard's needs before signing off
stopPropagation on footer click must be handled here, not in every consumer — clicking "Ban author" must not toggle the card closed
Task: ListCard Component
Type: Component
Milestone: M0.5 — Shared Component Library
Estimate: S
Component Type
Props Interface
Variants / States
headerslot renders. Body and footer hidden.children) + footer all render. Border upgrades to--border-primary+--shadow-md.--border-secondaryon hover, pointer cursor — only whenisClickableis trueAcceptance Criteria
header— no empty body div left in DOMfooterslot only renders when both provided ANDisExpandedis trueonTogglefires on click of the card root — not on clicks inside footer buttons (stopPropagation handled internally)isExpandedis trueisClickableis trueCardbase — does not duplicate any styling from itNotes
ReportCardandUserCard(M2) both compose this — validate slot API againstReportCard's needs before signing offstopPropagationon footer click must be handled here, not in every consumer — clicking "Ban author" must not toggle the card closed