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

barte-design-system

v0.1.14

Published

Barte Design System - React component library

Downloads

1,338

Readme

Design System

A modern React component library built with TypeScript, Vite, and Storybook.

Features

  • React 18+ - Built with the latest React features
  • TypeScript - Full type safety and IntelliSense support
  • CSS Modules - Scoped styling with design tokens integration
  • Components - Button, IconButton, Typography (Text)
  • Storybook 8 - Interactive component documentation with Welcome page
  • Design Tokens - Powered by barte-design-tokens
  • Icons - Pre-integrated with Phosphor Icons
  • Tree-shakeable - Optimized bundle size with ES modules
  • Developer Experience - ESLint, Prettier, and TypeScript configured

Installation

npm install barte-design-system

Usage

Importing Components

import { Button, IconButton, Text } from 'barte-design-system';
import { Plus } from '@phosphor-icons/react';
import 'barte-design-system/styles';

function App() {
  return (
    <div style={{ display: 'flex', gap: '1rem', padding: '2rem' }}>
      <Button type="primary">Click me</Button>
      
      <IconButton type="secondary" aria-label="Add item">
        <Plus />
      </IconButton>

      <Text variant="body-base">Hello World</Text>
    </div>
  );
}

CSS/Tokens

The design system uses barte-design-tokens for consistent styling. You must import the styles in your app entry point (e.g., main.tsx or App.tsx):

import 'barte-design-system/styles';

This will import all the necessary CSS including:

  • Design tokens (CSS variables)
  • Fonts (Inter)
  • Component styles

Semantic Tokens

Once the styles are imported, you can use the semantic tokens anywhere in your CSS or inline styles. These tokens ensure consistency across all applications.

Common tokens include:

  • Backgrounds: var(--bg-primary), var(--bg-secondary), var(--bg-tertiary)
  • Text: var(--text-primary), var(--text-secondary)
  • Borders: var(--border-default), var(--border-focus)

Example usage:

.my-card {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

Development

Prerequisites

  • Node.js 18+
  • npm 9+

Setup

# Install dependencies
npm install

# Start Storybook development server
npm run storybook

# Build the library
npm run build

# Run linting
npm run lint

# Format code
npm run format

Scripts

  • npm run dev - Start Vite development server
  • npm run build - Build library for production
  • npm run storybook - Start Storybook on port 6006
  • npm run build-storybook - Build static Storybook
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint errors
  • npm run format - Format code with Prettier
  • npm run format:check - Check code formatting
  • npm run type-check - Run TypeScript compiler checks

Project Structure

design-system/
├── src/
│   ├── components/        # React components
│   │   ├── Button/
│   │   ├── IconButton/
│   │   └── Typography/
│   ├── styles/
│   │   └── global.css    # Design tokens import
│   ├── types/
│   │   └── css-modules.d.ts  # CSS Modules types
│   ├── Welcome.mdx       # Storybook Welcome Page
│   └── index.ts          # Main export file
├── .storybook/           # Storybook configuration
├── dist/                 # Build output (generated)
├── package.json
├── tsconfig.json
├── vite.config.ts
└── README.md

Component Pattern

When creating components, follow this structure:

src/components/Button/
├── Button.tsx
├── Button.module.css
├── Button.stories.tsx
├── Button.types.ts
└── index.ts

Example component:

// Button.tsx
import styles from './Button.module.css';
import type { ButtonProps } from './Button.types';

export const Button = ({ children, ...props }: ButtonProps) => {
  return (
    <button className={styles.button} {...props}>
      {children}
    </button>
  );
};

// index.ts
export { Button } from './Button';
export type { ButtonProps } from './Button.types';

Build Output

The build generates:

  • dist/index.js - ES Module format
  • dist/index.cjs - CommonJS format
  • dist/index.d.ts - TypeScript definitions
  • dist/barte-design-system.css - Bundled styles (includes fonts, tokens, and component styles)
  • Source maps for all files

Dependencies

Peer Dependencies

  • react ^18.0.0
  • react-dom ^18.0.0

External Dependencies

  • barte-design-tokens - Design tokens package
  • @phosphor-icons/react - Icon library

License

Proprietary - Barte Internal Use Only