feat(card): Card primitive (shadcn v4) + gallery showcase#48
Merged
Conversation
TDD, subagent-driven plan for the Card primitive (shadcn v4) + gallery integration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ctive Card + CardHeader/Title/Description/Action/Content/Footer; Material-free, styled through flutterwindcss semantic tokens (card/cardForeground/border/mutedForeground). Composed subcomponents; CardHeader uses explicit title/description/action slots (Flutter has no has-[sibling] selector); CardFooter is full-width so Spacer/end-alignment work like shadcn. 11 behavior tests: token reskin, mutedForeground override, action layout, divider presence+absence, RTL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oritative Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…no-drift) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card — the second flutterbits primitive (shadcn v4 parity)
Ships
Cardand its compound subcomponents as Material-free, themeable, copy-paste source inapps/gallery, and establishes the canonical template for compound / non-interactive components (complementingbutton.dart, the interactive template).What's included
Card+CardHeader/CardTitle/CardDescription/CardAction/CardContent/CardFooter— one cohesive file (apps/gallery/lib/components/ui/card.dart), mirroring shadcn's singlecard.tsx.flutterwindcsssemantic tokens (card,cardForeground,border,mutedForeground) + theme-resolvedroundedXl/shadowSm, so any pasted theme reskins it.Faithful shadcn v4 mapping
Cardflex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-smCardHeaderitems-start gap-2 px-6· two-col when an action is present ·[.border-b]:pb-6CardTitleleading-none font-semiboldCardDescriptiontext-sm text-muted-foregroundCardContentpx-6CardFooterflex items-center px-6 [.border-t]:pt-6Design decisions (rationale in the plan + doc-comments)
Card(children: [...])with subcomponent widgets, mirroring shadcn's compound-component DX.CardHeaderuses explicittitle/description/actionslots instead of generic children, because shadcn'shas-data-[slot=card-action]:grid-cols-[1fr_auto](sibling-presence detection) has no Flutter analog. With anaction, the title/description column isExpandedbeside the top-end action; without one, they stack. A faithful-result / idiomatic-means substitution that preserves the capability bar — not a scope cut.crossAxisAlignment: stretch) — fills (and requires) a bounded-width parent, like a<div>; documented. Horizontal padding lives on the sections (px-6), the card carries onlypy-6+gap-6, so full-bleed dividers/images work.CardFooteris full-width soSpacer/Expanded/MainAxisAlignmentwork (the canonical "Cancel … Save" footer), matching shadcn's block-level footer.Tests
cardpresent + light absent), themutedForegroundoverride vscardForegroundtitle (resolved viaRichText), action two-column layout, bordered-divider presence and absence (BorderDirectionaldistinguishes the divider from the card's uniform border), RTL composition with no overflow.gallery-golden-failuresrecipe) in a follow-up commit on this branch.flutter analyze --fatal-infos --fatal-warningsclean;dart formatclean.No-drift
AGENTS.md§6/§12 — canonical templates are nowbutton.dart(interactive) +card.dart(compound/non-interactive); corrected the staleregistry/button.dartreference (components live inapps/galleryuntil the registry/CLI promotion).Review
Built via subagent-driven development: fresh implementer per unit + spec-compliance and code-quality reviews between units, plus a final whole-slice Opus review (which caught the footer
MainAxisSizeissue, now fixed).🤖 Generated with Claude Code