ofd-shared-ui
v1.1.0
Published
A service like Uber Eats with restaurant listings, menus, order tracking, and delivery logistics. # π§± Atomic UI Library
Readme
ofd-shared-ui
A service like Uber Eats with restaurant listings, menus, order tracking, and delivery logistics.
π§± Atomic UI Library
A scalable, atomic design-based component library built with React, Material UI, and custom design tokens.
β¨ Features
- βοΈ Atomic Design (Atoms, Molecules, Organisms)
- π¨ MUI + Custom Design Tokens (Color, Typography, Spacing)
- π Storybook integration for UI preview & documentation
- π§ͺ Unit Testing with Jest & React Testing Library
- βοΈ Custom Vite/Webpack Config
- π¦ Build-ready for npm publish or internal usage
π Folder Structure
src/ βββ components/ # Atomic components (Button, Input, etc.) β βββ Button/ β βββ Button.tsx β βββ Button.test.tsx β βββ Button.stories.tsx β βββ index.ts βββ tokens/ # Design tokens (color, spacing, etc.) β βββ colors.ts βββ theme/ # MUI Theme creation from tokens β βββ index.ts βββ index.ts # Barrel export for all components
π Getting Started
1. Install Dependencies
pnpm install
# or
npm install
# or
yarn install
2. Run Storybook
pnpm storybook
3. Run Dev Server (for testing isolated components)
pnpm dev
4. Run Tests
pnpm test
π§ͺ Testing
Unit tests powered by Jest and React Testing Library
All components must include basic test coverage
Use jest --coverage to view test coverage
π§© Storybook
Storybook is used to document and test components in isolation.
pnpm storybook
Features:
Theme integration with MUI
Live interactive props
Custom color tokens visualized
π¨ Theming
Design tokens are defined in src/tokens/ and consumed via MUIβs createTheme.
// Example: tokens/colors.ts
export const colors = {
primary: { main: '#1976d2', contrastText: '#fff' },
secondary: { main: '#dc004e' },
};
π§± Creating Components
Use atomic structure:
src/components/AtomName/
βββ AtomName.tsx
βββ AtomName.stories.tsx
βββ AtomName.test.tsx
βββ index.ts
Each component should:
Use MUI as a base
Support theming (no inline styles unless necessary)
Be unit tested
Have a Storybook story
π¦ Build for Distribution
pnpm build
Bundle output is generated using vite build and configured for reuse.
π§Ύ License
MIT
π€ Contributing
Contributions, issues and feature requests are welcome!
Please create an issue or pull request.
π Tech Stack
React
Material UI
Storybook
Jest
Vite
---
Would you like:
- A **CLI script to scaffold new atomic components**?
- A **GitHub Actions CI/CD pipeline** for lint + test + publish?
Let me know and Iβll add them too.
