Skip to content

feat(storybook): add display primitive stories#18124

Merged
pettinarip merged 11 commits into
devfrom
feat/storybook-display-primitives
May 18, 2026
Merged

feat(storybook): add display primitive stories#18124
pettinarip merged 11 commits into
devfrom
feat/storybook-display-primitives

Conversation

@myelinated-wackerow
Copy link
Copy Markdown
Collaborator

@myelinated-wackerow myelinated-wackerow commented May 5, 2026

Summary

Adds Storybook stories for the display primitives in src/components/ui/. This is PR 3 of 5 for #18121, scoped to display components. One commit per checkbox in the issue.

  • Tabs — Default, WithDisabledTab, ManyPanels (overflow scroll). Title UI / Primitives / Tabs.
  • Skeleton — Default block, Lines, CardContent, Card, CardGrid sub-components. Title UI / Skeleton.
  • Spinner — Default, Sizes (em-scaled), WithLabel, InsideButton. Title UI / Spinner.
  • Progress — Default, Colors (disabled|primary), Values (0/25/50/75/100), WithLabel. Title UI / Primitives / Progress.
  • Breadcrumb — TwoLevel, ThreeLevel, WithCurrentPage, WithEllipsis. Title UI / Primitives / Breadcrumb.
  • ScrollArea — VerticalScroll, HorizontalScroll (explicit ScrollBar orientation), ShortContent. Title UI / Primitives / ScrollArea.
  • List — Unordered, Ordered, Nested (mixed), PlainList. Title UI / List.
  • Collapsible — Closed, Open (defaultOpen), WithCustomTrigger (data-state icon swap), ListOfDetails. Title UI / Primitives / Collapsible.
  • TruncatedText — Default, OneLine, ThreeLines, FourLines, LineCounts (all 4 side-by-side), ShortText edge case. Title UI / TruncatedText.
  • Chart — BarUsage, LineUsage, AreaUsage (stacked), PieUsage, TooltipIndicators (dot|line|dashed), HiddenLabel. Title UI / Chart.

Title hierarchy follows the convention established in #18122 / #18123: UI / Primitives / [Name] for shadcn-regenerable primitives, UI / [Name] for app-canonical components with custom shapes.

Notes for review

  • Spinner has no built-in size prop; sizing is driven by font-size. Stories demonstrate scaling via Tailwind text-* utilities.
  • TruncatedText uses client-side useTranslation for the Show more / Show less label; Storybook's preview wires next-intl so the toggle works without per-story setup.
  • Collapsible WithCustomTrigger shows the canonical pattern for swapping chevrons via group-data-[state=open].
  • ScrollArea horizontal scrolling requires an explicit ScrollBar orientation='horizontal'; the default ScrollBar is vertical-only.
  • Breadcrumb uses the project's i18n-aware Link; the storybook preview wires next-intl so links render without errors.
  • Chart stories reference colors via var(--color-<key>) CSS variables generated from the config map — designers can recolor a chart by editing the config without touching the Recharts JSX.

Test plan

  • Eyeball each new story in Storybook (light + dark, locale toggle)
  • a11y addon passes for each story
  • Confirm TruncatedText toggle works with both Show more and Show less labels rendering

Refs: #18121

myelinated-wackerow and others added 9 commits May 4, 2026 20:18
Cover Default (3 tabs), WithDisabledTab, and ManyPanels (overflow scroll). Title hierarchy `UI / Primitives / Tabs` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Default block usage, SkeletonLines, SkeletonCardContent, SkeletonCard, and SkeletonCardGrid sub-components. Title hierarchy `UI / Skeleton` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Default, Sizes (em-scaled via text-* utilities), WithLabel, and InsideButton compositions. Title hierarchy `UI / Spinner` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Default, Colors (`disabled|primary`), Values (0/25/50/75/100), and WithLabel composition. Title hierarchy `UI / Primitives / Progress` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover TwoLevel, ThreeLevel, WithCurrentPage (BreadcrumbPage), and WithEllipsis (collapsed deep hierarchy). Title hierarchy `UI / Primitives / Breadcrumb` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover VerticalScroll, HorizontalScroll (explicit `ScrollBar orientation`), and ShortContent (no scrollbar). Title hierarchy `UI / Primitives / ScrollArea` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Unordered, Ordered, Nested (mixed ordered/unordered), and PlainList (no markers). Title hierarchy `UI / List` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Closed, Open (`defaultOpen`), WithCustomTrigger (asChild + data-state icon swap), and ListOfDetails composition. Title hierarchy `UI / Primitives / Collapsible` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Cover Default (2-line clamp), OneLine, ThreeLines, FourLines, LineCounts (all four side-by-side), and ShortText edge case. Title hierarchy `UI / TruncatedText` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit d797132
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a047093258c830008c54790
😎 Deploy Preview https://deploy-preview-18124.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 64 (🔴 down 1 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

myelinated-wackerow and others added 2 commits May 5, 2026 15:28
Cover BarUsage, LineUsage, AreaUsage (stacked), PieUsage, TooltipIndicators (`dot|line|dashed`), and HiddenLabel. Each story uses `ChartContainer` with a `config` map and references colors via the generated `--color-<key>` CSS variables. Title hierarchy `UI / Chart` per #18121.

Refs: #18121

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Per team decision to keep the Chromatic snapshot budget controlled
while these primitives get visual reference in Storybook. Snapshots
can be re-enabled per-story once we assess which views need
regression coverage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Copy link
Copy Markdown
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pettinarip pettinarip merged commit ac06dc8 into dev May 18, 2026
14 checks passed
@pettinarip pettinarip deleted the feat/storybook-display-primitives branch May 18, 2026 13:36
@claude claude Bot mentioned this pull request May 22, 2026
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.

2 participants