Update memory files for Card atom

- Component registry: Card → review with full details
- Session log: Add session 2026-03-25f entry
- Token registry: Add card component tokens

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 15:32:02 +11:00
parent 7169a6559b
commit 3be3afd80c
3 changed files with 53 additions and 3 deletions

View File

@@ -285,6 +285,42 @@ Each entry follows this structure:
- Should we add a character count feature? (Useful for textarea fields like special instructions)
**Next steps:**
- User to review Input in Storybook
- Build next atom (Card, Badge, or Chip recommended)
- ~~User to review Input in Storybook~~ ✓
- ~~Build next atom (Card, Badge, or Chip recommended)~~ ✓ Card done
- Consider whether FormField molecule is still needed given Input's built-in label/helperText
### Session 2026-03-25f — Card atom
**Agent(s):** Claude Opus (via conversation)
**Work completed:**
- Created card component tokens (`tokens/component/card.json`): borderRadius, padding (default 24px / compact 16px), shadow (default md / hover lg), border, background — 7 tokens total
- Rebuilt token pipeline — 7 new card tokens generated across CSS/JS/JSON outputs
- Updated MUI theme (`src/theme/index.ts`) with MuiCard overrides:
- Root: card token border radius, background, resting shadow (shadow.md), smooth transition
- Outlined variant: no shadow, card border colour
- Created Card component (`src/components/atoms/Card/Card.tsx`):
- Two visual variants: elevated (shadow, default) and outlined (border)
- `interactive` prop: hover shadow lift (shadow.lg), pointer cursor, focus-visible outline
- `padding` prop: "default" (24px), "compact" (16px), "none" (raw children for full-bleed)
- Uses CardContent internally for padded variants; raw children when none
- Thin wrapper pattern consistent with Button and Typography
- Created barrel export (`src/components/atoms/Card/index.ts`)
- Created 8 Storybook stories: Default, Variants, Interactive, PaddingPresets, PriceCardPreview, ServiceOptionPreview, WithImage, RichContent
- Preflight passed all 5 checks
- Committed and pushed to Gitea
**Decisions made:**
- Card uses MUI spacing units (p: 4/6) for padding presets rather than CSS variables — consistent with MUI-first approach
- Elevation set to 0 on MuiCard; box-shadow applied directly from card tokens for precise control
- Interactive hover uses CSS variable (`var(--fa-card-shadow-hover)`) for shadow.lg
- No new design decisions needed — Card follows existing token/design conventions from design-system.md
**Open questions:**
- Should interactive cards have a subtle border-colour change on hover in addition to shadow lift?
- Should we add a "selected" state for ServiceOption-style cards (e.g., brand border + brand.50 background)?
**Next steps:**
- User to review Card in Storybook
- Build Badge or Chip atom next
- Begin PriceCard or ServiceOption molecule once Card is approved