Skip to content

Feat/914 add storybook for component documentation#1138

Merged
jeromehardaway merged 18 commits into
masterfrom
feat/914-add-storybook-for-component-documentation
Jun 9, 2026
Merged

Feat/914 add storybook for component documentation#1138
jeromehardaway merged 18 commits into
masterfrom
feat/914-add-storybook-for-component-documentation

Conversation

@jinu2ID

@jinu2ID jinu2ID commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Set up Storybook v10 with Next.js Webpack preset for isolated component development and documentation
  • Configured global styles (Tailwind CSS + custom fonts) in Storybook preview
  • Added stories for UI components organized into sidebar groups: Button, Form, Cards, Modals, Navigation, Feedback
  • Added interaction testing for Input, Checkbox, and Modal components

What's done

  • Install Storybook with Next.js Webpack preset
  • Configure preview with global styles and Tailwind CSS
  • Disable telemetry
  • Button stories (7 variants: primary, outlined, light, small, disabled, full width, as-link)
  • Form component stories (Input, Textarea, Checkbox with validation states)
  • Card component stories (VWCGridCard, ProgramCard)
  • Modal stories (generic Modal, EngagementModal, VideoModal)
  • Navigation stories (MainMenu, Breadcrumb)
  • Loading state stories (Spinner)
  • Error/feedback state stories (Feedback component with error, warning, success states)
  • Organize sidebar into groups (Cards, Modals, Navigation, Form, Feedback)
  • Remove example stories (src/stories/)
  • Add interaction testing (Input type/verify, Checkbox toggle, Modal open)
  • Add accessibility addon

Not applicable

  • Empty states — No standalone empty state components exist in the codebase. Empty states are handled inline within individual pages/containers rather than as reusable components.
  • Error states — No standalone error state components beyond the form Feedback component (covered above). The 404 page exists but is a full page, not a reusable component.
  • Deploy Storybook — Marked optional in the issue. Can be set up with Chromatic in a follow-up.

How to test

npm install
npm run storybook

Then browse components at http://localhost:6006

Notes

  • Added @emotion/is-prop-valid as a dependency (required by Framer Motion in Storybook's Webpack build)
  • Added @storybook/test and @storybook/addon-interactions for interaction testing
  • VS Code shows type errors on @storybook/react imports due to moduleResolution: "node" in tsconfig — this is cosmetic only, Storybook compiles and runs correctly
  • The issue references @storybook/addon-essentials and @storybook/addon-links — these are outdated for Storybook v10, which replaced addon-essentials with individual addons (addon-docs, addon-a11y, etc.). addon-links (for linking between stories) was not added as it's not needed for any current stories.

Closes #914

@jinu2ID jinu2ID linked an issue Jun 2, 2026 that may be closed by this pull request
10 tasks
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment Jun 9, 2026 2:42am

Request Review

@jinu2ID jinu2ID marked this pull request as ready for review June 3, 2026 03:21
@jinu2ID jinu2ID requested a review from jeromehardaway June 3, 2026 03:21
next build type-checks every file matched by the tsconfig include glob
(src/**/*.tsx), which swept in the new .stories.tsx files. They import
@storybook/react, whose types are only reachable via its package.json exports
map, unresolvable under the repo's moduleResolution: node. The build failed on
the first such file.

Exclude src/**/*.stories.* so the production build only type-checks shipped
code. Story type-safety will be restored separately via a dedicated
.storybook/tsconfig.json.

Refs: #914

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Storybook-based component documentation/testing to the Next.js app, enabling isolated UI development and interactive “play” tests for selected components.

Changes:

  • Introduces Storybook configuration (.storybook/main.ts, .storybook/preview.ts) with global CSS/Tailwind and selected addons.
  • Adds Storybook stories for multiple UI components (buttons, form elements, cards, modals, navigation, feedback).
  • Updates project config/scripts to support Storybook and (optionally) reduce TS friction around stories.

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package.json Adds Storybook scripts and dependencies/addons needed for Storybook + interaction testing.
tsconfig.json Excludes Storybook story files from TypeScript project typechecking.
.storybook/main.ts Storybook config (stories glob, addons, Next.js framework, static dirs, telemetry off).
.storybook/preview.ts Loads global CSS/Tailwind into Storybook preview.
.gitignore Ignores Storybook build output and logs.
src/components/ui/button/button.stories.tsx Button variants stories.
src/components/ui/form-elements/input.stories.tsx Input stories + interaction test.
src/components/ui/form-elements/textarea.stories.tsx Textarea state/variant stories.
src/components/ui/form-elements/checkbox.stories.tsx Checkbox stories + interaction test.
src/components/ui/form-elements/feedback.stories.tsx Feedback state stories.
src/components/vwc-card/vwc-card.stories.tsx VWCGridCard stories.
src/components/program-card/program-card.stories.tsx ProgramCard stories.
src/components/ui/modal/modal.stories.tsx Modal stories + open/assert interaction test.
src/components/ui/engagement-modal/engagement-modal.stories.tsx EngagementModal story.
src/components/ui/video-modal/video-modal.stories.tsx VideoModal story with local state.
src/components/ui/spinner/spinner.stories.tsx Spinner story.
src/components/menu/main-menu/main-menu.stories.tsx MainMenu stories (variants + decorator).
src/components/breadcrumb/breadcrumb.stories.tsx Breadcrumb stories (title/no-title/deep nesting).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread .storybook/preview.ts
Comment thread src/components/ui/form-elements/checkbox.stories.tsx Outdated
Comment thread src/components/ui/form-elements/input.stories.tsx
Comment thread src/components/ui/form-elements/input.stories.tsx
@storybook/test (8.6.15) and @storybook/addon-interactions (8.6.14) were
pinned to v8 while the rest of the Storybook stack is on 10.3.6. Mixing
majors risks resolution and type incompatibilities.

In Storybook 10 the test utilities ship from the core storybook/test
entrypoint and interaction instrumentation is built into core, so both
v8 packages are redundant.

Migrate expect/userEvent/within imports from @storybook/test to
storybook/test (input, checkbox, modal stories), drop the
@storybook/addon-interactions addon from .storybook/main.ts, and remove
both v8 packages. build-storybook and play functions verified passing.

Addresses a Copilot review comment on PR #1138.
The two // @ts-ignore comments on the CSS side-effect imports in
.storybook/preview.ts suppressed nothing useful: the *.css module is
already declared in src/@types/assets/index.d.ts. The real unresolved
import was @storybook/nextjs, failing only because .storybook/ sat
outside any tsconfig and fell back to node module resolution.

Add .storybook/tsconfig.json (extends root, moduleResolution: bundler,
with the ambient declarations in scope) so every .storybook/ import
resolves, and remove both @ts-ignore lines. tsc on the new config and
build-storybook both pass.

Addresses a Copilot review comment on PR #1138.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jeromehardaway jeromehardaway merged commit 6afa18d into master Jun 9, 2026
6 checks passed
@jeromehardaway jeromehardaway deleted the feat/914-add-storybook-for-component-documentation branch June 9, 2026 16:13
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.

Add Storybook for component documentation

3 participants