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

achs-web-kit

v0.0.2

Published

ACHS Design System - Web Kit con shadcn/ui y soporte multi-marca

Readme

ACHS Web Kit

Design system para ACHS compatible con Adonis + Inertia (Vite) y basado en shadcn/ui (Tailwind). Soporte multi-marca mediante data-brand.

Estructura

/achs-web-kit
├── apps/
│   ├── docs/              # Ladle - vitrina de componentes
│   └── demo-inertia/      # Demo Vite+React (validación de integración)
├── packages/
│   ├── tokens/            # CSS variables por marca (salud, seguro, servicios)
│   └── ui/                # Componentes shadcn + BrandProvider
└── pnpm-workspace.yaml

Comandos

pnpm install
pnpm docs      # Ladle en http://localhost:6006
pnpm demo      # Demo en http://localhost:5173

Instalación en tu proyecto

  1. Añadir dependencias:

    pnpm add @achsux/tokens @achsux/ui
  2. Importar tokens + estilos en el entry (ej. main.tsx o app.ts):

    import '@achsux/tokens'
    import '@achsux/ui/globals.css';
  3. Configurar Tailwind para incluir el paquete UI (build en dist/):

    // tailwind.config.js
    content: [
      './src/**/*.{ts,tsx,js,jsx}',
      './node_modules/@achsux/ui/dist/**/*.{js,jsx,ts,tsx}',
    ],
  4. Añadir data-brand en el HTML o usar BrandProvider:

    <html data-brand="salud">

Cómo usar los componentes

import { Button, Input, Card, BrandProvider, BrandSelector } from '@achsux/ui';

function App() {
  return (
    <BrandProvider>
      <BrandSelector />
      <Button>Primario</Button>
      <Input placeholder="Nombre" />
    </BrandProvider>
  );
}

Cómo cambiar de marca

Opción 1: BrandProvider + useBrand

import { BrandProvider, useBrand } from '@achsux/ui';

function MySelector() {
  const { brand, setBrand } = useBrand();
  return (
    <select value={brand} onChange={(e) => setBrand(e.target.value)}>
      <option value="salud">Salud</option>
      <option value="seguro">Seguro</option>
      <option value="servicios">Servicios</option>
    </select>
  );
}

Opción 2: Atributo directo

document.documentElement.dataset.brand = 'seguro';

Opción 3: HTML

<html data-brand="seguro">

El BrandSelector persiste la marca en localStorage automáticamente.

Marcas disponibles

| Valor | Descripción | |-------------|--------------| | salud | ACHS Salud | | seguro | ACHS Seguro | | servicios | ACHS Servicios |

Componentes incluidos

  • Button (default, secondary, outline, ghost, destructive, loading)
  • Input, Textarea
  • Select, Checkbox, Radio, Switch
  • Card
  • Tabs
  • Dialog
  • Toast (sonner)
  • Alert
  • Table
  • Skeleton

Cómo agregar nuevos componentes

  1. Crear el componente en packages/ui/src/components/ui/.
  2. Usar clases de Tailwind que referencien variables: bg-primary, text-foreground, border-border, ring-ring, etc.
  3. Evitar colores hardcodeados (#hex, rgb()).
  4. Exportar en packages/ui/src/index.ts.
  5. Añadir demo en apps/docs/src/*.stories.tsx.

Integración con Adonis + Inertia

  1. Crear la app: npm init adonisjs@latest mi-app -- -K=inertia --adapter=react
  2. Añadir dependencias: pnpm add @achsux/tokens @achsux/ui
  3. En el entry de Inertia (por ejemplo resources/js/app.tsx):
    import '@achsux/tokens';
    import '@achsux/ui/globals.css';
  4. En resources/views/inertia_layout.edge: <html data-brand="salud">
  5. En tailwind.config.js, añadir la librería al content:
    content: [
      './resources/**/*.{ts,tsx,js,jsx,edge}',
      './node_modules/@achsux/ui/dist/**/*.{js,jsx,ts,tsx}',
    ],
  6. Envolver la app con BrandProvider si usas useBrand o BrandSelector.

Accesibilidad y contraste

  • Los componentes usan focus-visible:ring-2 para foco keyboard.
  • Estados disabled usan opacity-50.
  • Los tokens de marca (--primary, --primary-foreground) deben cumplir WCAG AA (contraste 4.5:1 texto normal). Validar con herramientas como WebAIM Contrast Checker.