Files
cv/docs/design/specs/ui/spec-ui-components.md
dong.nguyen 5b4b301ef1 docs(specs): record the timeline pass, variant model and resume undefined fix
- AGENTS.md: data layer now names ExperienceEntry.variant ('current' | 'gap'); Card dropped
  from the ui/ component list (deleted in d172843)
- spec-ui-components.md: Card section replaced with a removal note (component + .card* rules
  deleted; remaining cards are section-specific classes)
- spec-ui-experience.md: structure tree used the dropped `current: true` flag -> composed class
- spec-v3-typography.md: achievement rules marked deleted, dead-CSS list extended, Experience
  TSX row marked superseded, new 4.4 covering the timeline pass and the resume generator fix
- spec-v3-resume-improvements.md: Bugs Fixed row 2 for
  "${exp.achievements?.map(...).join('')}" printing the literal "undefined"; malformed table
  separator repaired
- spec-v2-resume-playwright.md: acceptance row 4 notes the achievements branch is now a
  guarded no-op
- spec-v3-i18n.md: experience.ts data row and the Experience strings rows updated
  (achievements dropped, relax-gap added, experience.tldr / tldrText recorded)
- spec-v3-theme-palette-gasatrya.md: lint baseline annotated 15/9 -> 11/9
2026-10-16 23:22:20 +07:00

261 lines
4.1 KiB
Markdown

# UI Spec — Reusable Components
## Overview
Common UI components used across the portfolio.
---
## Button
### Structure
```
Button
├── Icon (optional)
├── Text
└── Loading spinner (optional)
```
### Variants
| Variant | Background | Text | Border | Use case |
|---|---|---|---|---|
| Primary | Accent | White | None | CTA |
| Secondary | Transparent | Accent | 1px accent | Secondary action |
| Ghost | Transparent | Muted | None | Tertiary action |
| Icon | Transparent | None | None | Icon-only button |
### Sizes
| Size | Padding | Font size |
|---|---|---|
| Small | 8px 12px | 12px |
| Medium | 12px 24px | 16px |
| Large | 16px 32px | 18px |
### States
| State | Style |
|---|---|
| Default | Variant style |
| Hover | Lighter/darker shade |
| Active | Darker shade |
| Disabled | Muted bg/text, no pointer, opacity 0.5 |
| Focus | Visible outline (2px accent) |
| Loading | Spinner, disabled text |
---
## Badge
### Structure
```
Badge
└── Text
```
### Variants
| Variant | Background | Text | Border |
|---|---|---|---|
| Default | Accent | White | None |
| Outline | Transparent | Accent | 1px accent |
| Muted | Muted bg | Muted text | None |
### Sizes
| Size | Padding | Font size |
|---|---|---|
| Small | 4px 8px | 11px |
| Medium | 6px 12px | 12px |
### Use cases
- Category tags
- Status indicators
- Project categories
---
## Card
**Removed 2026-10-16.** `src/components/ui/Card.tsx`, its barrel export and the `.card`, `.card:hover`, `.card-elevated`, `.card-featured` rules were deleted — no component rendered them. The cards that remain in the UI are section-specific classes styled directly in `src/App.css`: `.project-section`, `.project-card`, `.expertise-card`, `.philosophy-card`. See `spec-v3-typography.md` §4.2.
---
## Tag
### Structure
```
Tag
└── Text
```
### Variants
| Variant | Background | Text |
|---|---|---|
| Default | Muted bg | Muted text |
| Accent | Accent bg | White |
### Use cases
- Technology labels
- Skill tags
- Filter pills
- Category labels
---
## SectionHeading
### Structure
```
SectionHeading
├── Number (optional, "01", "02")
├── Title (H2 or H3)
└── Subtitle (optional)
```
### Variants
| Variant | Size |
|---|---|
| Large | 40px desktop / 32px mobile |
| Medium | 24px |
| Small | 20px |
---
## CodeBlock
### Structure
```
CodeBlock
├── Header (optional)
│ ├── Language label
│ └── Copy button
├── Code (pre > code)
│ ├── Line numbers (optional)
│ └── Syntax highlighted content
└── Footer (optional)
```
### Styles
| Property | Value |
|---|---|
| Background | Dark bg (#1a1a1a) |
| Font | Monospace, 14px |
| Padding | 16px |
| Border-radius | 6px |
| Border | 1px border |
| Overflow | Auto (scroll) |
### Features
- Syntax highlighting (shiki)
- Copy to clipboard button
- Line numbers (optional)
- Language label in header
---
## ImageGallery
### Structure
```
ImageGallery
├── Main image
├── Thumbnails (optional)
└── Navigation arrows (optional)
```
### Variants
| Variant | Description |
|---|---|
| Single | Single image, lazy loaded |
| Grid | Multiple images in grid |
| Carousel | Slidable with arrows |
### States
| State | Style |
|---|---|
| Loading | Skeleton placeholder |
| Error | Fallback icon + alt text |
| Hover | Zoom (subtle) |
---
## Tooltip
### Structure
```
Tooltip
└── Text
```
### Variants
| Variant | Position |
|---|---|
| Default | Above element |
| Below | Below element |
| Left | Left of element |
| Right | Right of element |
### Behavior
- Appears on hover
- Appears on focus
- Disappears on hover out / blur
- Max-width: 250px
- Word wrap
---
## Container
### Structure
```
Container
└── Children
```
### Variants
| Variant | Max-width | Padding |
|---|---|---|
| Wide | 1200px | 0 24px |
| Content | 800px | 0 24px |
| Full | None | 0 24px |
---
## TimelineMarker
### Structure
```
TimelineMarker
└── Dot
```
### Variants
| Variant | Style |
|---|---|
| Default | Circle, accent outline, 12px |
| Active | Circle, accent fill, 14px |
| Completed | Circle, muted outline, 12px |