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

@puertochenta/blocks

v0.1.0

Published

Prebuilt, data-driven React blocks of the Puertochenta design system (app layouts, menus, user profile, pages), with adapters for Next.js, React Router and TanStack Router.

Readme

@puertochenta/blocks

Bloques prediseñados para construir aplicaciones con @puertochenta/ui pasando solo datos: layout de aplicación con barra lateral, menús, perfil de usuario, páginas y contenedores. Cada bloque se configura con arrays y objetos (NavItem, MenuAction, UserSummary…), y deja ReactNode o render props como escape cuando hace falta algo propio.

npm install @puertochenta/blocks @puertochenta/ui react react-dom
  • Los mismos componentes por dentro: accesibilidad (WAI-ARIA, teclado, axe), temas, densidades y textos en español sustituibles con LocaleProvider, igual que @puertochenta/ui.
  • Con tu router: adaptadores para Next.js (App Router), React Router y TanStack Router. Cualquier otro encaja con BlocksProvider.
  • Ligero: tree shaking por bloque; los routers son dependencias peer opcionales y cada adaptador vive en su propia subruta.

Estado: 0.x. 31 bloques en cuatro grupos. La API puede cambiar entre versiones menores hasta la 1.0.

Bloques

| Grupo | Bloques | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Navegación de la app | AppLayout, AppSidebar, AppHeader, UserMenu, AutoBreadcrumbs | | Menús | ActionMenu, ContextActionMenu, MegaMenu, WorkspaceSwitcher, CommandMenu, NotificationsMenu | | Cuenta de usuario | ProfileCard, ProfileHeader, ProfileSettingsForm, PasswordSettings, TwoFactorSettings, SessionsList, NotificationPreferences, DangerZone | | Páginas y contenedores | PageLayout, ListPage, DetailPage, SettingsLayout, DashboardPage, AuthLayout, LoginForm, SignUpForm, ForgotPasswordForm, ResetPasswordForm, ErrorPage, EmptyPage |

import { AppLayout } from '@puertochenta/blocks';
import type { NavSection } from '@puertochenta/blocks';
import { HomeIcon, PackageIcon } from '@puertochenta/icons';

const navigation: NavSection[] = [
  {
    items: [
      { label: 'Inicio', href: '/', icon: <HomeIcon /> },
      {
        label: 'Pedidos',
        href: '/pedidos',
        icon: <PackageIcon />,
        badge: 12,
        badgeLabel: 'pendientes',
      },
    ],
  },
];

export function Shell({ children }: { children: React.ReactNode }) {
  return (
    <AppLayout
      brand={{ name: 'Mi empresa', href: '/' }}
      navigation={navigation}
      user={{ name: 'Lucía Ortega', email: '[email protected]' }}
    >
      {children}
    </AppLayout>
  );
}

Estilos

Importa la hoja de los bloques una vez, después de la de @puertochenta/ui:

import '@puertochenta/ui/styles.css';
import '@puertochenta/blocks/styles.css';

Las reglas de los bloques van en la capa pc.blocks, que gana a los componentes base (pc.components). El CSS sin capa de tu aplicación gana a todo, sin !important. El recorte de @puertochenta/ui/prune-css también quita el CSS de los bloques que no uses.

Conectar el router

Los bloques pintan sus enlaces con el router de tu aplicación (navegación sin recargar la página), saben cuál es la página actual (aria-current="page") y navegan desde acciones de menú.

Next.js (App Router)

// app/layout.tsx (Server Component)
import { NextBlocksProvider } from '@puertochenta/blocks/next';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="es">
      <body>
        <NextBlocksProvider>{children}</NextBlocksProvider>
      </body>
    </html>
  );
}

React Router 7 u 8

import { ReactRouterBlocksProvider } from '@puertochenta/blocks/react-router';
import { Outlet } from 'react-router';

// Elemento de la ruta raíz, dentro del router.
export function RootLayout() {
  return (
    <ReactRouterBlocksProvider>
      <Outlet />
    </ReactRouterBlocksProvider>
  );
}

TanStack Router

import { TanStackRouterBlocksProvider } from '@puertochenta/blocks/tanstack-router';
import { createRootRoute, Outlet } from '@tanstack/react-router';

export const Route = createRootRoute({
  component: () => (
    <TanStackRouterBlocksProvider>
      <Outlet />
    </TanStackRouterBlocksProvider>
  ),
});

Otro router (o React Router 6)

import { BlocksProvider } from '@puertochenta/blocks';
import type { RouterLinkProps } from '@puertochenta/blocks';
import { Link, useLocation, useNavigate } from 'react-router-dom';

// Fuera de cualquier componente: un componente nuevo en cada render remontaría los enlaces.
function AppLink({ href, ...rest }: RouterLinkProps) {
  return <Link {...rest} to={href} />;
}

export function AppBlocks({ children }: { children: React.ReactNode }) {
  const { pathname } = useLocation();
  const navigate = useNavigate();
  return (
    <BlocksProvider link={AppLink} pathname={pathname} navigate={navigate}>
      {children}
    </BlocksProvider>
  );
}

Sin proveedor, los bloques usan enlaces <a> normales, la ruta de window.location y cargas de página completas: suficiente para un sitio de varias páginas.

Núcleo

  • BlockLink: el enlace de todos los bloques. Usa el router para las rutas de la aplicación, marca la página actual y abre los enlaces external en otra pestaña con aviso para lectores de pantalla. Sirve como as de los elementos de @puertochenta/ui: <SidebarItem as={BlockLink} href="/pedidos" icon={<BoxIcon />}>Pedidos</SidebarItem>.
  • useIsActive(href, { exact }) e isActivePath(pathname, href, exact): /pedidos está activo en /pedidos/42, nunca en /pedidos-archivados; se ignoran la consulta y el fragmento.
  • useBlocks(): el router actual (link, pathname, navigate) para tus propios componentes.
  • Tipos de datos: NavItem, NavSection, MenuAction, MenuActionGroup, MenuEntry y UserSummary.

Licencia

MIT