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

@petrarca/sonnet-ui

v0.4.2

Published

UI primitives, data components, and table schema system for the Petrarca Sonnet component library

Readme

@petrarca/sonnet-ui

UI primitives and data components for the Petrarca Sonnet component library.

What's included

UI primitives — Tailwind + Radix UI components: Button, Badge, Card, Dialog, Tabs, Input, Textarea, Checkbox, Label, Tooltip, Spinner, Avatar, Separator, Stepper, ResizeHandle (draggable divider for resizable panes), and more.

Data components — Higher-level data-driven UI:

  • EntityTable — Schema-driven table with pagination, row actions, custom cell renderers
  • EntitySelect — Async searchable select with typeahead, backed by a fetcher API
  • EntityTree — Hierarchical tree browser with search and edit support
  • TreeView — Generic accessible tree with keyboard navigation and row selection
  • SearchInput — Faceted search input with chip-based filters (simple, searchFields, faceted modes)
  • JsonEditor — CodeMirror JSON editor with validation (subpath: @petrarca/sonnet-ui/json-editor)

Design tokens — Shipped as styles.css and tailwind-preset.js.


Install

pnpm add @petrarca/sonnet-ui @petrarca/sonnet-core

Peer dependencies: react >=19, react-dom >=19, tailwindcss >=3, tailwindcss-animate, @tailwindcss/typography.


Setup

CSS

Import styles.css in your app's global CSS. It provides design tokens (light + dark), base resets, heading utilities, and typography classes.

/* index.css */
@import "@petrarca/sonnet-ui/styles.css";

/* Shell layout — add below the import (app-level, not provided by the library) */
html, body, #root { height: 100%; }
#root { display: flex; flex-direction: column; overflow: hidden; }
body { min-height: 100vh; overflow: hidden; }

Override any token after the import for white-labeling:

@import "@petrarca/sonnet-ui/styles.css";

:root {
  --primary: 210 80% 40%;  /* custom brand color */
}

Tailwind

Use the preset in tailwind.config.js. It maps all design tokens to Tailwind utility classes (bg-primary, text-muted-foreground, border-border, etc.):

module.exports = {
  presets: [require("@petrarca/sonnet-ui/tailwind-preset")],
  content: [
    "./src/**/*.{ts,tsx}",
    "./node_modules/@petrarca/sonnet-*/dist/**/*.js",
  ],
  plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],
};

Design tokens

All tokens are CSS custom properties (HSL triplets). Key semantic tokens:

| Token | Role | |---|---| | --background / --foreground | Page surface / primary text | | --card / --card-foreground | Card surface / text | | --primary / --primary-foreground | Brand action color | | --destructive | Error / danger | | --muted / --muted-foreground | Quiet surface / secondary text | | --tertiary-foreground | Tertiary text (timestamps, helpers) | | --faint-foreground | Ghost text (annotations, disabled) | | --border / --border-subtle / --border-strong | 3-tier border system | | --state-hover / --state-selected | Interaction state backgrounds | | --ring | Focus ring | | --radius | Base border radius |

See DESIGN.md at the repo root for the full token reference.


License

See LICENSE.md.