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

@chavesnamao2022/design-system

v0.2.1

Published

CNM Design System - React component library for Chaves na Mão

Downloads

66

Readme

CNM Design System

O CNM Design System é a biblioteca de componentes e documentação de estilos visuais do Chaves na Mão.

Este projeto fornece um conjunto de componentes reutilizáveis, tokens de estilização e diretrizes para garantir a consistência da marca e acelerar o desenvolvimento em todas as aplicações do Chaves na Mão.

Funcionalidades

  • React & TypeScript: Componentes modernos e com tipagem segura, construídos com React 18+.
  • Desenvolvido com Vite: Desenvolvimento rápido e builds otimizados.
  • SCSS & Variáveis CSS: Design tokens expostos como CSS Custom Properties.
  • Tree-shakeable: Importe apenas os componentes que você precisa.
  • Documentação com Storybook: Documentação interativa em dev.chavesnamao.com.br/ds.

Instalação

# npm
npm install @chavesnamao2022/design-system

# yarn
yarn add @chavesnamao2022/design-system

# pnpm
pnpm add @chavesnamao2022/design-system

Como Usar

1. Importe os Estilos

No ponto de entrada da sua aplicação (ex: layout.tsx, _app.tsx, main.tsx):

// CSS Global (reset + tokens)
import "@chavesnamao2022/design-system/style.css";

2. Use os Componentes

import {
  // Typography
  H1, H2, H3, H4, Body1, Body2, P, Label, Typography,
  
  // Atoms
  Button, Input, Select, Icon, Avatar, Link, LogoCNM, Skeleton,
  
  // Molecules
  Accordion, Breadcrumb, Pagination, Tabs, Toast, Tooltips,
} from '@chavesnamao2022/design-system';

function MeuComponente() {
  return (
    <div>
      <H1>Título Principal</H1>
      <P>Parágrafo de texto usando Body1.</P>
      
      <H2 variant="text-body-lg-bold">Subtítulo com variant customizado</H2>
      <Body2>Texto secundário menor.</Body2>
      
      <Button onClick={() => alert('Clicou!')}>
        Clique aqui
      </Button>
      
      <Input placeholder="Digite algo..." />
    </div>
  );
}
  return (
    <div>
      <Typography variant="text-title-lg">
        Bem-vindo ao Design System
      </Typography>
      <Icon name="meu-icone" />
    </div>
  );
}

3. Typography com Variants

O sistema de tipografia suporta variants para customização:

import { H1, H2, Typography } from '@chavesnamao2022/design-system';

// Uso básico (variants padrão por tag)
<H1>Título</H1>                      // text-display
<H2>Subtítulo</H2>                   // text-title-lg

// Com variant customizado
<H2 variant="text-body-lg-bold">Subtítulo menor</H2>

// Usando Typography diretamente
<Typography as="span" variant="text-caption-semibold">
  Legenda
</Typography>

Variants disponíveis:

  • text-display - Títulos principais
  • text-title-lg, text-title-md, text-title-sm - Subtítulos
  • text-body-lg-*, text-body-md-*, text-body-sm-* - Corpo (medium, semibold, bold)
  • text-caption-* - Legendas (medium, semibold, bold)
  • text-numeric-* - Números (xl, lg, md, sm)

4. Usando Tokens CSS

.meu-componente {
  color: var(--color-txt-primary);
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius-9);
  padding: var(--spacing-4);
  font-size: var(--font-size-md);
}

Componentes Disponíveis

Atoms

| Componente | Descrição | |------------|-----------| | Typography, H1-H4, Body1, Body2, P, Label | Sistema de tipografia | | Button | Botão com loading state | | Input | Campo de entrada com máscara | | Select | Dropdown com seleção única/múltipla | | Icon | Ícones do sistema | | Avatar | Avatar de usuário | | Link | Link estilizado | | LogoCNM | Logo Chaves na Mão | | Skeleton | Placeholder de carregamento |

Molecules

| Componente | Descrição | |------------|-----------| | Accordion | Seção expansível | | Breadcrumb | Navegação em migalhas | | Pagination | Paginação | | Tabs | Abas de navegação | | Toast | Notificações | | Tooltips | Dicas de interface |


Desenvolvimento Local

# Clone o repositório
git clone <url-do-repositorio>

# Instale as dependências
yarn install

# Execute o Storybook
yarn storybook

# Build da biblioteca
yarn build

Scripts

  • yarn storybook - Inicia o Storybook em dev
  • yarn build - Compila o pacote para produção
  • yarn build-storybook - Build do Storybook estático
  • yarn publish - Build e publica no NPM