Skip to content

feat(registry): add diff-viewer and kbd components + docs polish#16

Merged
jal-co merged 8 commits intomainfrom
feat/diff-viewer
Mar 25, 2026
Merged

feat(registry): add diff-viewer and kbd components + docs polish#16
jal-co merged 8 commits intomainfrom
feat/diff-viewer

Conversation

@jal-co
Copy link
Copy Markdown
Owner

@jal-co jal-co commented Mar 25, 2026

New Components: diff-viewer and kbd + Docs Polish

What changed

This PR adds two new registry components and a comprehensive docs-site polish pass.

New: Diff Viewer

Code diff viewer with line numbers and add/remove coloring. Supports unified (single column) and split (side-by-side) layouts. Accepts oldCode/newCode strings or a pre-computed patch string. Depends on diff (jsdiff, zero deps).

New: Kbd

Keyboard shortcut keys rendered as styled keycaps. Three visual profiles — flat, raised, sculpted — inspired by real keycap shapes. 12 built-in color schemes inspired by popular keycap sets (dolch, olivia, botanical, laser, mizu, dracula, etc.) plus custom { bg, text, border } support. Includes KbdCombo helper and an interactive playground.

Registry: CodeBlock compact prop

New compact prop on both the registry and docs CodeBlock — hides the header bar, floats the copy button inside the code area.

Docs polish (10 items)

  • Consolidated ChangelogImage + ComponentCardPreviewImage → shared ThemeImage
  • Fixed CLS on card preview placeholder (h-[140px]aspect-[2/1])
  • Added focus-visible:ring-2 ring-ring/50 to all interactive docs elements
  • Added global prefers-reduced-motion reset + useReducedMotion for sidebar
  • Replaced animate-bounce with motion-safe:animate-pulse
  • Replaced hardcoded #ff4f00 badge color with ring token
  • Normalized shadow-xsshadow-sm, container border-radius to rounded-xl
  • Added hover:border-foreground/20 to prev/next nav + hover:bg-muted to theme toggle
  • Set --ring to orange, reduced --radius from 0.625rem to 0.375rem
  • Tightened section gap-8gap-4 across all 17 component pages
  • Removed grid background and red border from requirements card

Docs: Installation page rewrite

  • Uses Stepper component (dogfooding)
  • Added registry add step with components.json snippet
  • Added manual setup, without-shadcn, and MCP integration sections
  • Product Hunt token setup converted to Stepper

Checklist

Diff Viewer

  • Component source in registry/diff-viewer/
  • registry.json entry
  • Sidebar nav entry with badge
  • Docs page with preview, usage, variant grid (unified/split), examples, API ref, notes
  • Card preview file
  • pnpm registry:build and pnpm build pass

Kbd

  • Component source in registry/kbd/
  • registry.json entry
  • Sidebar nav entry with badge
  • Docs page with playground, variants, sizes, color schemes grid, examples, API ref
  • Card preview showing color schemes
  • pnpm registry:build and pnpm build pass

Screenshots

Component Dark Light
Diff Viewer diff-viewer-dark diff-viewer-light
Kbd kbd-dark kbd-light

Notes

  • Diff Viewer language prop is accepted in the type but syntax highlighting is not yet implemented — planned as a follow-up.
  • Kbd color schemes use generic names that reference popular keycap colorways. The color values are original — no assets or code from third parties.
  • The polish changes touch 17 component pages (gap tightening) but each change is a single gap-8gap-4 substitution.

jal-co added 8 commits March 24, 2026 21:16
Top-level /changelog route showing all components in reverse-chronological
order, derived from docsNav dateAdded fields and registry descriptions.

- Timeline layout with date headers and component cards
- Theme-aware screenshots (switches dark/light with site theme)
- Grouped by date, links to each component's docs page
- Category badges per entry
- Backfilled dateAdded on all existing nav items
- Zero maintenance — updates automatically when new components are added
- Move changelog to /docs/changelog (inside docs layout)
- Blog-style layout with date headers, descriptions, screenshots
- Auto-derives entries from docsNav dateAdded + registry descriptions
- Theme-aware images (dark/light based on site theme)
- Add Changelog to sidebar and header nav
- Fix CopyPromptButton height to match AiCopyButton
- Remove ProductHunt button from navbar
… token cleanup

- Consolidate ChangelogImage + ComponentCardPreviewImage into shared ThemeImage
- Fix CLS on card preview placeholder (h-[140px] → aspect-[2/1])
- Add focus-visible:ring-2 ring-ring/50 to all interactive elements
- Add global prefers-reduced-motion reset + useReducedMotion for sidebar
- Replace animate-bounce with motion-safe:animate-pulse on scroll indicator
- Replace hardcoded #ff4f00 badge color with ring token
- Normalize shadow-xs → shadow-sm on variant grid cells
- Normalize container border-radius to rounded-xl
- Add hover:border-foreground/20 to prev/next nav cards
- Add hover:bg-muted to theme toggle button
- Set --ring to orange (oklch 0.67 0.22 37.41) in light/dark themes
- Reduce --radius from 0.625rem to 0.375rem
- Tighten radius scale steps (2px increments)
- Remove grid background and red border from requirements card
…s, registry add step

- Rewrite installation page using Stepper component (dogfooding)
- Add registry add step with components.json snippet
- Add manual setup, without-shadcn, and MCP integration sections
- Add compact prop to docs CodeBlock (hides header, floating copy button)
- Convert Product Hunt token setup to use Stepper
Hides the header bar and floats the copy button inside the code area.
Code diff viewer with line numbers and add/remove coloring.
Supports unified and split layouts via layout prop.
Accepts oldCode/newCode strings or a pre-computed patch.

Dependencies: diff (jsdiff)
Keyboard shortcut keys rendered as styled keycaps.
Three visual profiles: flat, raised, sculpted.
12 built-in color schemes inspired by popular keycap sets
(dolch, olivia, botanical, laser, mizu, dracula, etc.).
Custom { bg, text, border } color prop for full control.
Includes KbdCombo helper for multi-key shortcuts.
Interactive playground on docs page.
@jal-co jal-co force-pushed the feat/diff-viewer branch from dbef6da to 1f28ed3 Compare March 25, 2026 04:16
@jal-co jal-co merged commit 017ed2c into main Mar 25, 2026
2 checks passed
@jal-co jal-co deleted the feat/diff-viewer branch March 25, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant