1.0.4 • Published 1 year ago

@devtostes/design-system-test v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

React Design System

A modern React component library built with Vite, TypeScript, Tailwind CSS, and shadcn/ui. This project implements Atomic Design principles and includes comprehensive testing and documentation.

šŸš€ Technologies

  • Vite: Lightning fast build tool and dev server
  • React 18: Modern UI development
  • TypeScript: Type safety and better developer experience
  • Tailwind CSS: Utility-first CSS framework
  • shadcn/ui: Beautifully designed components
  • Storybook: Component documentation and testing
  • Vitest: Unit testing with coverage reports
  • Testing Library: React component testing

šŸ“ Project Structure

src/
ā”œā”€ā”€ components/
│ ā”œā”€ā”€ atoms/ # Basic building blocks (buttons, inputs)
│ ā”œā”€ā”€ molecules/ # Simple combinations of atoms
│ ā”œā”€ā”€ organisms/ # Complex combinations of molecules
│ ā”œā”€ā”€ templates/ # Page layouts
│ └── ui/ # shadcn/ui components
ā”œā”€ā”€ lib/ # Utilities and helpers
ā”œā”€ā”€ pages/ # Application pages
ā”œā”€ā”€ styles/ # Global styles
└── test/ # Test setup and utilities

šŸ› ļø Scripts

"scripts": {
"dev": "Start development server",
"build": "Build for production",
"test": "Run tests with coverage",
"storybook": "Start Storybook development server",
"build-storybook": "Build Storybook for deployment",
"prepare": "Build types and bundle",
"release": "Build and publish to npm"
}

šŸŽØ Atomic Design

This project follows Atomic Design methodology:

  1. Atoms: Basic UI components like buttons and inputs
  2. Molecules: Simple component combinations (e.g., search bar)
  3. Organisms: Complex UI sections (e.g., header)
  4. Templates: Page layouts and structure
  5. Pages: Complete page implementations

šŸ“š Component Documentation

Components are documented using Storybook. Each component includes:

  • Interactive examples
  • Props documentation
  • Different variants/states
  • Responsive design previews

To view the documentation:

npm run storybook

āœ… Testing

The project uses Vitest and Testing Library for comprehensive testing:

  • Unit tests for components
  • Integration tests for pages
  • 80% minimum coverage requirement
  • Snapshot testing

Run tests with:

npm test

šŸŽÆ Code Coverage

Current test coverage:

  • Statements: 100%
  • Branches: 100%
  • Functions: 100%
  • Lines: 100%

šŸ”§ Configuration

Vite

typescript:vite.config.ts

Tailwind

json:tsconfig.app.json

TypeScript

json:tsconfig.app.json

šŸ“¦ Installation

Install dependencies

npm install

Start development server

npm run dev

Build for production

npm run build

šŸ¤ Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

šŸ“„ License

MIT License - see the LICENSE file for details.