-
-
Notifications
You must be signed in to change notification settings - Fork 78
Feat/914 add storybook for component documentation #1138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jeromehardaway
merged 18 commits into
master
from
feat/914-add-storybook-for-component-documentation
Jun 9, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c087969
chore: Add Storybook with Next.js Webpack preset (#914)
jinu2ID 8f02921
chore: Configure Storybook preview with global styles (#914)
jinu2ID 1d31e63
feat: Add Button component stories for Storybook (#914)
jinu2ID c14cbd4
feat: Add form component stories and Tailwind CSS import (#914)
jinu2ID 7f28581
feat: Add card component stories and emotion dep (#914)
jinu2ID 611955d
feat: Add modal component stories (#914)
jinu2ID 55b8dac
feat: Add navigation stories and organize sidebar (#914)
jinu2ID e5725b5
fix: Update story titles for sidebar grouping (#914)
jinu2ID 5913c01
feat: Add Spinner loading state story (#914)
jinu2ID 4929a71
feat: Add Feedback component story for error states (#914)
jinu2ID 5a5f357
chore: Remove example Storybook stories (#914)
jinu2ID 17c4074
feat: Add interaction testing for Input, Checkbox, and Modal (#914)
jinu2ID 5ef5238
Merge remote-tracking branch 'origin/master' into feat/914-add-storyb…
jinu2ID 3d52c0c
chore: Add comment for Storybook gitignore entries
jinu2ID 7aeb21d
fix: Exclude Storybook story files from production type-check
jinu2ID 794a5ee
fix: Align Storybook test packages to v10
jinu2ID c53378e
fix: Add Storybook tsconfig and drop preview @ts-ignore
jinu2ID 34526ef
Apply suggestions from Copilot code review
jinu2ID File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
|
||
| const config: StorybookConfig = { | ||
| "stories": [ | ||
| "../src/**/*.mdx", | ||
| "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)" | ||
| ], | ||
| "addons": [ | ||
| "@storybook/addon-a11y", | ||
| "@storybook/addon-docs", | ||
| "@storybook/addon-onboarding" | ||
| ], | ||
| "framework": "@storybook/nextjs", | ||
| "staticDirs": [ | ||
| "../public" | ||
| ], | ||
| core: { | ||
| disableTelemetry: true, | ||
| }, | ||
| }; | ||
| export default config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import type { Preview } from "@storybook/nextjs"; | ||
| import "../src/assets/css/globals.css"; | ||
| import "../src/assets/css/tailwind.css"; | ||
|
|
||
| const preview: Preview = { | ||
| parameters: { | ||
| controls: { | ||
| matchers: { | ||
| color: /(background|color)$/i, | ||
| date: /Date$/i, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default preview; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "extends": "../tsconfig.json", | ||
| "compilerOptions": { | ||
| "moduleResolution": "bundler" | ||
| }, | ||
| "include": ["../src/@types/**/*", "**/*.ts"] | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import Breadcrumb from './index'; | ||
|
|
||
| const meta: Meta<typeof Breadcrumb> = { | ||
| title: 'UI/Navigation/Breadcrumb', | ||
| component: Breadcrumb, | ||
| tags: ['autodocs'], | ||
| argTypes: { | ||
| showTitle: { | ||
| control: 'boolean', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof Breadcrumb>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| pages: [ | ||
| { path: '/', label: 'Home' }, | ||
| { path: '/programs', label: 'Programs' }, | ||
| ], | ||
| currentPage: 'Web Development', | ||
| showTitle: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const WithoutTitle: Story = { | ||
| args: { | ||
| pages: [ | ||
| { path: '/', label: 'Home' }, | ||
| { path: '/programs', label: 'Programs' }, | ||
| ], | ||
| currentPage: 'Web Development', | ||
| showTitle: false, | ||
| }, | ||
| }; | ||
|
|
||
| export const DeepNesting: Story = { | ||
| args: { | ||
| pages: [ | ||
| { path: '/', label: 'Home' }, | ||
| { path: '/programs', label: 'Programs' }, | ||
| { path: '/programs/web-development', label: 'Web Development' }, | ||
| ], | ||
| currentPage: 'Module 1', | ||
| showTitle: true, | ||
| title: 'JavaScript Fundamentals', | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import MainMenu from './index'; | ||
|
|
||
| const sampleMenu = [ | ||
| { id: 1, label: 'Home', path: '/' }, | ||
| { id: 2, label: 'About', path: '/about' }, | ||
| { id: 3, label: 'Programs', path: '/programs', submenu: [ | ||
| { id: 31, label: 'Web Development', path: '/programs/web-development' }, | ||
| { id: 32, label: 'Cybersecurity', path: '/programs/cybersecurity' }, | ||
| ]}, | ||
| { id: 4, label: 'Projects', path: '/projects' }, | ||
| { id: 5, label: 'Contact', path: '/contact' }, | ||
| ]; | ||
|
|
||
| const meta: Meta<typeof MainMenu> = { | ||
| title: 'UI/Navigation/MainMenu', | ||
| component: MainMenu, | ||
| tags: ['autodocs'], | ||
| argTypes: { | ||
| hoverStyle: { | ||
| control: 'select', | ||
| options: ['A', 'B'], | ||
| }, | ||
| color: { | ||
| control: 'select', | ||
| options: ['light', 'dark'], | ||
| }, | ||
| align: { | ||
| control: 'select', | ||
| options: ['left', 'right', 'center'], | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof MainMenu>; | ||
|
|
||
| export const Dark: Story = { | ||
| args: { | ||
| menu: sampleMenu, | ||
| color: 'dark', | ||
| hoverStyle: 'A', | ||
| align: 'left', | ||
| }, | ||
| }; | ||
|
|
||
| export const Light: Story = { | ||
| args: { | ||
| menu: sampleMenu, | ||
| color: 'light', | ||
| hoverStyle: 'A', | ||
| align: 'left', | ||
| }, | ||
| parameters: { | ||
| backgrounds: { default: 'dark' }, | ||
| }, | ||
| decorators: [ | ||
| (Story) => ( | ||
| <div style={{ backgroundColor: '#1a1a2e', padding: '1rem' }}> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| ], | ||
| }; | ||
|
|
||
| export const WithHoverStyleB: Story = { | ||
| args: { | ||
| menu: sampleMenu, | ||
| color: 'dark', | ||
| hoverStyle: 'B', | ||
| align: 'center', | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import ProgramCard from './index'; | ||
|
|
||
| const meta: Meta<typeof ProgramCard> = { | ||
| title: 'UI/Cards/ProgramCard', | ||
| component: ProgramCard, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof ProgramCard>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| program: { | ||
| slug: 'web-development', | ||
| title: 'Web Development', | ||
| description: 'Learn full-stack web development with modern tools and frameworks.', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export const LongDescription: Story = { | ||
| args: { | ||
| program: { | ||
| slug: 'cybersecurity', | ||
| title: 'Cybersecurity Operations', | ||
| description: 'Master the fundamentals of cybersecurity including network defense, threat analysis, incident response, and security operations for enterprise environments.', | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import Button from './index'; | ||
|
|
||
| const meta: Meta<typeof Button> = { | ||
| title: 'UI/Button', | ||
| component: Button, | ||
| tags: ['autodocs'], | ||
| argTypes: { | ||
| variant: { | ||
| control: 'select', | ||
| options: ['contained', 'outlined', 'texted'], | ||
| }, | ||
| color: { | ||
| control: 'select', | ||
| options: ['primary', 'light'], | ||
| }, | ||
| size: { | ||
| control: 'select', | ||
| options: ['xs', 'sm', 'md', 'lg'], | ||
| }, | ||
| fullwidth: { | ||
| control: 'boolean', | ||
| }, | ||
| disabled: { | ||
| control: 'boolean', | ||
| }, | ||
| active: { | ||
| control: 'boolean', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof Button>; | ||
|
|
||
| export const Primary: Story = { | ||
| args: { | ||
| children: 'Get Started', | ||
| variant: 'contained', | ||
| color: 'primary', | ||
| size: 'md', | ||
| }, | ||
| }; | ||
|
|
||
| export const Outlined: Story = { | ||
| args: { | ||
| children: 'Learn More', | ||
| variant: 'outlined', | ||
| color: 'primary', | ||
| size: 'md', | ||
| }, | ||
| }; | ||
|
|
||
| export const Light: Story = { | ||
| args: { | ||
| children: 'Sign Up', | ||
| variant: 'contained', | ||
| color: 'light', | ||
| size: 'md', | ||
| }, | ||
| }; | ||
|
|
||
| export const Small: Story = { | ||
| args: { | ||
| children: 'Details', | ||
| variant: 'contained', | ||
| color: 'primary', | ||
| size: 'sm', | ||
| }, | ||
| }; | ||
|
|
||
| export const Disabled: Story = { | ||
| args: { | ||
| children: 'Unavailable', | ||
| variant: 'contained', | ||
| color: 'primary', | ||
| size: 'md', | ||
| disabled: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const FullWidth: Story = { | ||
| args: { | ||
| children: 'Submit Application', | ||
| variant: 'contained', | ||
| color: 'primary', | ||
| size: 'md', | ||
| fullwidth: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const AsLink: Story = { | ||
| args: { | ||
| children: 'Visit Page', | ||
| variant: 'outlined', | ||
| color: 'primary', | ||
| size: 'md', | ||
| path: '/about', | ||
| }, | ||
| }; |
21 changes: 21 additions & 0 deletions
21
src/components/ui/engagement-modal/engagement-modal.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import { EngagementModal } from './EngagementModal'; | ||
|
|
||
| const meta: Meta<typeof EngagementModal> = { | ||
| title: 'UI/Modals/EngagementModal', | ||
| component: EngagementModal, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof EngagementModal>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| headline: 'Join the Mission', | ||
| body: 'We help veterans transition into tech careers through mentorship and hands-on training.', | ||
| cta1: { label: 'Donate', href: 'https://vetswhocode.io/donate' }, | ||
| cta2: { label: 'Apply Now', href: '#apply' }, | ||
| forceShow: true, | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.