npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

swatisr-design-system

v1.0.8

Published

AI-driven design system with Figma tokens, shadcn components, and Cursor AI integration

Readme

@yourcompany/design-system

AI-driven design system with Figma design tokens, shadcn/ui components, and Cursor AI integration.

Build consistent, token-based UIs using AI prompting. Non-designers can generate beautiful interfaces that automatically follow your design system.


🚀 Quick Start

Installation

npm install @yourcompany/design-system

Setup (3 steps)

1. Import styles in your app layout

// app/layout.tsx (Next.js) or main entry file
import '@yourcompany/design-system/tokens';
import '@yourcompany/design-system/styles';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

2. Copy Cursor AI rules (optional but recommended)

cp node_modules/@yourcompany/design-system/.cursorrules .cursorrules

3. Start using components

import { Button, Card, Input } from '@yourcompany/design-system';

export default function MyPage() {
  return (
    <Card>
      <h1>Welcome!</h1>
      <Input placeholder="Enter your email" />
      <Button>Submit</Button>
    </Card>
  );
}

That's it! You're ready to go.


📦 What's Included

Components (shadcn/ui)

  • Button - Primary, secondary, outline, ghost, link variants
  • Card - Container with header, title, content sections
  • Input - Text input with design tokens
  • Badge - Status indicators and labels
  • Select - Dropdown select menus
  • Dialog - Modal dialogs
  • Tabs - Tabbed navigation
  • Table - Data tables with headers
  • Avatar - User avatars with fallbacks
  • Dropdown Menu - Context menus
  • Navigation Menu - Site navigation
  • Tooltip - Hover tooltips

Custom Components

  • StatsCard - Metric cards with change indicators
  • ThemeSwitcher - Light/dark mode toggle

Design Tokens

  • Colors: Accent, neutral, semantic (text, background, borders, status)
  • Spacing: Consistent scale (4px to 128px)
  • Typography: Font sizes, line heights, weights, Poppins font family
  • Radii: Border radius values (sm, md, lg, full)

See docs/TOKEN_MAPPING.md for complete token reference.


💡 Usage Examples

Basic Component Usage

import { Button, Card, CardHeader, CardTitle, CardContent } from '@yourcompany/design-system';

function Dashboard() {
  return (
    <div className="p-8">
      <Card>
        <CardHeader>
          <CardTitle>Dashboard</CardTitle>
        </CardHeader>
        <CardContent>
          <Button>Create New</Button>
        </CardContent>
      </Card>
    </div>
  );
}

Using Design Tokens

function CustomSection() {
  return (
    <div 
      style={{ 
        padding: 'var(--token-space-6)',
        backgroundColor: 'var(--token-bg-subtle)',
        borderRadius: 'var(--token-radius-md)'
      }}
    >
      <h2 style={{ color: 'var(--token-text-heading)' }}>
        Custom Section
      </h2>
      <p style={{ color: 'var(--token-text-body)' }}>
        Using design tokens for consistency
      </p>
    </div>
  );
}

With Tailwind (recommended)

The package includes a globals.css that maps tokens to Tailwind utilities:

function Hero() {
  return (
    <div className="p-8 bg-token-bg-default">
      <h1 className="text-3xl font-bold text-text-heading mb-4">
        Welcome
      </h1>
      <Button className="w-full">Get Started</Button>
    </div>
  );
}

🤖 Using with Cursor AI

This design system is optimized for AI prompting. The included .cursorrules file teaches Cursor AI to:

  • ✅ Use existing components instead of creating custom ones
  • ✅ Apply design tokens for all styling
  • ✅ Follow spacing and color conventions
  • ✅ Generate accessible, type-safe code
  • ❌ Prevent hardcoded colors or spacing
  • ❌ Block creation of components outside the design system

Example Prompts

✅ Good prompts:

"Create a user profile page with stats cards and edit button"
"Build a settings form with name, email inputs and save button"
"Generate a dashboard with 4 metric cards and a data table"

Cursor will automatically use components from this package and apply design tokens.

❌ Bad prompts:

"Create a blue button with 20px padding"  
→ Cursor will suggest using Button component instead

"Make a custom dropdown component"
→ Cursor will suggest using existing Select or Dropdown Menu

🎨 Design Token System

All design tokens are CSS variables with the --token- prefix:

Colors

--token-text-heading      /* Primary heading color */
--token-text-body         /* Body text color */
--token-text-body-muted   /* Muted text */
--token-bg-default        /* Page background */
--token-bg-subtle         /* Subtle background */
--token-bg-surface        /* Card/surface background */
--token-color-accent-500  /* Brand accent color */
--token-border-default    /* Default border color */
--token-status-success-bg /* Success state background */
--token-status-error-bg   /* Error state background */

Spacing

--token-space-1   /* 4px */
--token-space-2   /* 8px */
--token-space-3   /* 12px */
--token-space-4   /* 16px */
--token-space-6   /* 24px */
--token-space-8   /* 32px */
--token-space-12  /* 48px */
--token-space-16  /* 64px */

Typography

--token-font-12           /* 12px */
--token-font-14           /* 14px */
--token-font-16           /* 16px (body) */
--token-font-18           /* 18px */
--token-font-24           /* 24px */
--token-font-36           /* 36px (large heading) */
--token-font-family-sans  /* Poppins */
--token-line-1-5          /* Line height 1.5 */

See full token reference: docs/TOKEN_MAPPING.md


🔄 Updating the Design System

When the design system is updated:

npm update @yourcompany/design-system

This automatically:

  • ✅ Updates all components
  • ✅ Updates design tokens
  • ✅ Updates documentation
  • ✅ Your app reflects new styles without code changes

📚 Documentation


🛠️ Development

Regenerate Tokens

If you modify src/tokens/figma-tokens.json:

npm run tokens

This regenerates src/tokens/tokens.css from the JSON source.

TypeScript

The package includes TypeScript definitions for all components. Your IDE will provide full autocomplete and type checking.


🎯 For Non-Designers

This package is designed for engineers and PMs who need to build UIs without deep design knowledge.

What you CAN do:

  • ✅ Use all components
  • ✅ Compose components into pages
  • ✅ Use design tokens for custom styling
  • ✅ Let Cursor AI generate pages for you
  • ✅ Add business logic and interactions

What you CANNOT do:

  • ❌ Create new token values
  • ❌ Hardcode colors or spacing
  • ❌ Override component styles
  • ❌ Create components outside the design system

The .cursorrules file enforces these constraints automatically when using Cursor AI.


🏢 For Companies

Benefits

  1. Speed: Build UIs in minutes with AI prompting
  2. Consistency: All products use the same design system
  3. Scalability: Non-designers can build production UIs
  4. Maintainability: Update design system once, affects all projects
  5. Quality: AI + design system = fewer design bugs
  6. Onboarding: New team members productive on day 1

Workflow

Designer updates Figma
  ↓
Export tokens → Update package
  ↓
npm publish (v1.1.0)
  ↓
Teams run: npm update
  ↓
All apps updated automatically ✨

📄 License

MIT


🤝 Support


🎉 Get Started Now

npm install @yourcompany/design-system

Then import and start building! 🚀