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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tcce-design-system

v0.3.33

Published

This package provides reusable UI components to ensure consistency across all CRM frontend applications

Readme

TCCE Design System

A React component library for the TCCE CRM applications. Provides reusable, consistent UI components built with React, TypeScript, Tailwind CSS, and styled-components.

Overview

This is a component library designed to ensure visual and functional consistency across all TCCE CRM frontend applications. It includes:

  • 50+ reusable components (Button, Card, Dialog, Table, Forms, etc.)
  • Design tokens (colors, typography, spacing, shadows)
  • Storybook documentation for all components
  • TypeScript support with full type definitions

Table of Contents


Prerequisites

| Tool | Version | Notes | |------|---------|-------| | Node.js | v18+ | LTS recommended | | pnpm | v8+ | Package manager | | Docker | v20+ | Required for containerized development | | Git | Any | Version control |

Docker Network Prerequisite

If using Docker Compose, you must create the tcce-network network before starting the containers:

docker network create tcce-network

Important: Always use docker-compose.dev.yml when running with Docker Compose.

Installing pnpm

npm install -g pnpm

Quick Start

Local Development

# Clone the repository
git clone <repository-url>
cd tcce-design-system

# Install dependencies
pnpm install

# Start Storybook (recommended for development)
pnpm storybook

# OR start Vite dev server
pnpm dev

Access:

  • Storybook: http://localhost:6006
  • Vite Dev: http://localhost:5173

Using Docker (Recommended for Teams)

docker compose -f docker-compose.dev.yml up

Project Structure

tcce-design-system/
├── src/
│   ├── components/           # All UI components
│   │   ├── Badge/
│   │   ├── Button/
│   │   ├── Can/             # Authorization component
│   │   ├── Card/
│   │   ├── Divider/
│   │   ├── Icon/
│   │   ├── InfoLabel/
│   │   ├── Spinner/
│   │   ├── Stepper/
│   │   ├── Typography/
│   │   ├── Token/           # Design tokens showcase
│   │   ├── forms/           # Form components
│   │   │   ├── Checkbox/
│   │   │   ├── FormField/
│   │   │   ├── PinInput/
│   │   │   ├── RadioInput/
│   │   │   └── inputs/      # Input components
│   │   ├── layout/          # Layout components
│   │   ├── navigations/     # Navigation components
│   │   ├── notifications/    # Toast & notifications
│   │   ├── overlays/        # Dialog, Tooltip, etc.
│   │   └── Table/           # Data tables
│   ├── shared/
│   │   ├── hooks/           # Shared React hooks
│   │   ├── types/           # Global TypeScript types
│   │   └── utils/           # Utility functions
│   ├── globals.css          # Global styles
│   ├── tokens.css           # Design tokens CSS
│   └── main.ts              # Library entry point
├── .storybook/              # Storybook configuration
├── public/                  # Static assets (fonts, images)
├── dist/                    # Build output (generated)
├── package.json
├── vite.config.ts
├── tsconfig.json
└── eslint.config.js

Component Structure

Each component follows this pattern:

ComponentName/
├── ComponentName.tsx        # Main component
├── ComponentName.types.ts  # TypeScript interfaces
├── ComponentName.styles.ts # Styled-components styles
├── ComponentName.stories.tsx # Storybook stories
├── index.ts                # Barrel export
└── components/             # Sub-components (if needed)

Development

Available Scripts

| Command | Description | |---------|-------------| | pnpm dev | Start Vite development server | | pnpm storybook | Start Storybook (recommended) | | pnpm build | Build library for production | | pnpm build-storybook | Build static Storybook | | pnpm preview | Preview production build | | pnpm lint | Run ESLint | | pnpm lint:fix | Fix ESLint issues | | pnpm format | Format with Prettier |

Environment Variables

Create a .env file if needed (check .env.example):

# Not required for local development

Building Components

Creating a New Component

  1. Create the component folder:
src/components/controls/MyComponent/
  1. Create files following the pattern:
// MyComponent.types.ts
export interface MyComponentProps {
  variant?: 'primary' | 'secondary';
  // ... other props
}
// MyComponent.tsx
import type { MyComponentProps } from './MyComponent.types';
import { StyledMyComponent } from './MyComponent.styles';

export const MyComponent = ({ variant = 'primary', ...props }: MyComponentProps) => {
  return <StyledMyComponent $variant={variant} {...props} />;
};
// MyComponent.styles.ts
import styled from 'styled-components';

export const StyledMyComponent = styled.div<{ $variant: string }>`
  /* Styles using Tailwind and styled-components */
`;
// MyComponent.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import { MyComponent } from './MyComponent';

const meta = {
  title: 'Controls/MyComponent',
  component: MyComponent,
  tags: ['autodocs'],
} satisfies Meta<typeof MyComponent>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  args: {
    variant: 'primary',
  },
};
// index.ts
export * from './MyComponent';
export * from './MyComponent.types';
  1. Export from main.ts:
// src/main.ts
export * from './components/controls/MyComponent';
  1. Run Storybook to test:
pnpm storybook

Component Patterns

  • Use styled-components for component-specific styles
  • Use Tailwind CSS via @apply in styles
  • Prefix styled-component props with $ (transient props)
  • Always create TypeScript types in .types.ts files
  • Create Storybook stories for documentation and testing

Code Quality

Linting & Formatting

This project uses:

  • ESLint - Code linting
  • Prettier - Code formatting
  • TypeScript - Type safety

Running Checks

# Lint
pnpm lint

# Fix lint issues
pnpm lint:fix

# Format code
pnpm format

# Type check
pnpm build  # (includes tsc)

Pre-commit Hooks

Ensure you run these before committing:

pnpm lint:fix && pnpm format

ESLint Rules

Key rules enforced:

  • React hooks dependencies must be correct
  • No unused variables
  • Prettier formatting required

Testing Components

Using Storybook

Storybook is the primary way to test components:

pnpm storybook
  • Browse components at http://localhost:6006
  • Use Controls panel to test props
  • Use Actions panel to see event handlers
  • Check Accessibility tab for a11y issues

Component Story Format

Write stories following CSF (Component Story Format):

// ComponentName.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import { ComponentName } from './ComponentName';

const meta = {
  title: 'Category/ComponentName',
  component: ComponentName,
  parameters: {
    layout: 'centered',
  },
  tags: ['autodocs'],
  argTypes: {
    variant: { control: 'select', options: ['primary', 'secondary'] },
  },
} satisfies Meta<typeof ComponentName>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  args: {
    variant: 'primary',
    label: 'Click me',
  },
};

export const Secondary: Story = {
  args: {
    variant: 'secondary',
    label: 'Cancel',
  },
};

Publishing

Building for npm

# Build the library
pnpm build

# Check dist folder
ls dist/

Publish to npm

# Login to npm
npm login

# Publish
npm publish

The build outputs:

  • dist/tcce-design-system-components.js (ESM)
  • dist/tcce-design-system-components.umd.cjs (UMD)
  • dist/tcce-design-system-components.css
  • Type definitions via vite-plugin-dts

Consuming in Other Projects

# Install from npm (when published)
pnpm add tcce-design-system

# Or from local path
pnpm add ../tcce-design-system
// Usage
import { Button, Card } from 'tcce-design-system';
import 'tcce-design-system/dist/tcce-design-system-components.css';

Contributing

Workflow

  1. Create a branch:

    git checkout -b feature/component-name
  2. Make changes:

    • Follow component patterns
    • Add Storybook stories
    • Update types
  3. Run quality checks:

    pnpm lint:fix
    pnpm format
    pnpm build
  4. Commit and push:

    git add .
    git commit -m "feat: add new component"
    git push origin feature/component-name
  5. Create Pull Request

Coding Standards

  • Use TypeScript for everything
  • Use styled-components for styling
  • Use Tailwind CSS utilities via @apply
  • Follow existing component patterns
  • Write stories for all components
  • Use transient props ($prop) in styled-components
  • No comments unless absolutely necessary

Versioning

This project uses Semantic Versioning:

  • MAJOR: Breaking changes
  • MINOR: New features (backward compatible)
  • PATCH: Bug fixes

Update version in package.json before publishing.


Troubleshooting

Common Issues

Port already in use:

# Find and kill process on port 6006
lsof -i :6006
kill -9 <PID>

Dependencies issues:

rm -rf node_modules
pnpm install

Docker build fails:

docker build --no-cache -t tcce-design-system .

TypeScript errors:

# Check for type errors
npx tsc --noEmit

Getting Help

  • Check Storybook docs: http://localhost:6006
  • Review existing component patterns
  • Contact: [email protected]

License

MIT License

Team