people-platform-design-system-test
v0.0.6
Published
A React + TypeScript + Vite-based design system using [shadcn/ui](https://ui.shadcn.com/), Tailwind CSS, Storybook, and Cypress for component development, documentation, and testing.
Readme
Northstar Design System
A React + TypeScript + Vite-based design system using shadcn/ui, Tailwind CSS, Storybook, and Cypress for component development, documentation, and testing.
Table of Contents
Getting Started
Install dependencies:
npm installStart the development server:
npm run dev
Code Generation
Component Codegen
To scaffold a new component (using shadcn/ui, wrapper, and Storybook story):
npm run component:codegen- You will be prompted to select a component (e.g.,
button,calendar, etc.). - This will:
- Run
npx shadcn@latest add <component>to add the base UI component. - Generate a wrapper component in
src/components/<Component>/<Component>.tsxand anindex.ts. - Generate a Storybook story in the same folder.
- Run
How it works:
See scripts/components-codegen/components-codegen.sh, scripts/components-codegen/components-codegen.ts, and scripts/storybook-codegen/storybook-codegen.ts.
Design Tokens Codegen
To update Tailwind config from design tokens (e.g., from Penpot):
npm run theme:codegen- This reads
scripts/penpot-codegen/design-tokens.jsonand generatestailwind.config.jswith the mapped tokens.
How it works:
See scripts/penpot-codegen/design-tokens-tailwind-codegen.ts.
Storybook Codegen
Storybook stories are auto-generated for each new component via the component codegen script.
You can also run the storybook codegen script directly:
node scripts/storybook-codegen/storybook-codegen.ts <ComponentPath>Storybook
To start Storybook for interactive component development and documentation:
npm run storybook- This will also start Tailwind in watch mode for live style updates.
To build static Storybook docs:
npm run build-storybookCypress
To run Cypress component tests:
npm run cypress:open- This opens the Cypress UI for running and debugging tests.
Build & Lint
- Build the library:
npm run build - Lint the codebase:
npm run lint
Project Structure
src/components— All components (UI, wrappers, and stories)src/lib— Utilities (e.g.,cnfunction)src/index.ts— Entry point for exportstailwind.config.js— Tailwind CSS config (auto-generated from design tokens)scripts— Codegen and automation scripts.storybook— Storybook configuration
