Your pattern library has been fully modernized from Gulp/Nunjucks to React/TypeScript/Storybook!
-
New Technology Stack:
- ✅ React 18 with TypeScript
- ✅ Vite for blazing-fast builds
- ✅ Storybook 8 for component development
- ✅ SCSS Modules for scoped styling
-
Converted Components:
- ✅ Banner - Full-width image banner with text overlay
- ✅ Hero - Responsive hero with picture element
- ✅ Tile - Square tiles with image/text content
- ✅ NavBar - Responsive navigation bar
-
Configuration Files:
- ✅
package.json- Updated with modern dependencies - ✅
tsconfig.json- TypeScript configuration - ✅
vite.config.ts- Build configuration - ✅
.storybook/- Storybook 8 configuration - ✅
eslint.config.js- Modern ESLint setup
- ✅
-
Documentation:
- ✅
README.md- Complete usage guide - ✅
MIGRATION.md- Migration guide from old structure
- ✅
npm installThis will install all the modern dependencies including React, TypeScript, Vite, and Storybook.
npm run devThis will start Storybook on http://localhost:6006 where you can:
- View all your components
- Test different props and states
- See component documentation
- Interact with live examples
npm run buildThis creates a production build in the dist/ folder that can be:
- Published to npm
- Imported into other projects
- Deployed to a CDN
npm run build-storybookThis creates a static Storybook site in storybook-static/ that you can deploy to:
- GitHub Pages
- Netlify
- Vercel
- Any static hosting service
pattern-library/
├── .storybook/ # Storybook configuration
│ ├── main.ts
│ └── preview.ts
├── src/
│ ├── components/ # React components
│ │ ├── Banner/
│ │ │ ├── Banner.tsx
│ │ │ ├── Banner.types.ts
│ │ │ ├── Banner.module.scss
│ │ │ ├── Banner.stories.tsx
│ │ │ └── index.ts
│ │ ├── Hero/
│ │ ├── Tile/
│ │ └── NavBar/
│ ├── styles/ # Global styles
│ │ ├── global.scss
│ │ └── _variables.scss
│ └── index.ts # Main library export
├── package.json
├── tsconfig.json
├── vite.config.ts
├── README.md
└── MIGRATION.md
import { Banner, Hero, Tile, NavBar } from '@j-cam/pattern-library';
import '@j-cam/pattern-library/styles';
function App() {
return (
<>
<NavBar
logoAlt="My Company"
links={[
{ label: 'Home', href: '/' },
{ label: 'About', href: '/about' }
]}
/>
<Hero
imageSrc="hero.jpg"
heading="Welcome"
/>
<Banner
imageSrc="banner.jpg"
heading="Featured Content"
/>
</>
);
}- Make Changes: Edit components in
src/components/ - See Live Updates: Storybook hot-reloads automatically
- Test: Use Storybook's interaction testing
- Build: Run
npm run buildto create distribution files - Publish: Publish to npm or use locally
- Storybook Docs: https://storybook.js.org/
- Vite Guide: https://vitejs.dev/guide/
- React Docs: https://react.dev/
- TypeScript Handbook: https://www.typescriptlang.org/docs/
- Viewing Stories: Each component has multiple stories showing different use cases
- Props Table: Storybook auto-generates prop documentation from TypeScript types
- Responsive Testing: Use Storybook's viewport addon to test mobile/tablet/desktop
- Accessibility: Check the A11y addon in Storybook for accessibility issues
- Open Storybook and browse the Banner component stories
- Try changing props using the Controls panel
- Check the Docs tab for component documentation
- Use the viewport toolbar to test responsiveness
- Review the code in the "Show code" panel
npm run dev # Start Storybook
npm run build # Build library for production
npm run build-storybook # Build Storybook static site
npm run lint # Run ESLint
npm run type-check # Check TypeScript typesCongratulations! Your pattern library is now modernized and ready for React development! 🎉