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

@sema-lang/ui

v0.1.3

Published

Web Components for the Sema design system. Lit-based, framework-agnostic, consumes DESIGN.md tokens via CSS custom properties.

Downloads

451

Readme

@sema-lang/ui

Lit-based Web Components for the Sema design system. Framework-agnostic, consumes DESIGN.md tokens via CSS custom properties.

Quick Start

Standalone (notebook, playground, any HTML page)

<link rel="stylesheet" href="tokens.css">
<script type="module" src="sema-ui.js"></script>

<sema-button variant="primary">Get Started</sema-button>

dist/sema-ui.js is a self-contained ES module — Lit is bundled inline, zero runtime dependencies. Drop it into any page alongside tokens.css.

npm consumer (VitePress, Vite, any bundler)

import '@sema-lang/ui/tokens.css'
import '@sema-lang/ui'

When imported this way, lit stays external — your bundler deduplicates it.

Commands

npm run dev           # Vite dev server with component showcase
npm run build         # Build standalone library (Vite → Rolldown)
npm run preview       # Preview built output
npm test              # Run tests and quit (Vitest + Playwright, headless)
npm run test:watch    # Run tests in watch mode (re-run on changes)
npm run test:ui       # Run tests with Vitest UI
npm run lint          # ESLint across all source files

Components

| Component | Tag | Variants | Notes | |-----------|-----|----------|-------| | Button | <sema-button> | primary, secondary, ghost, icon, pill, run, debug, action | +danger modifier, +shortcut badge, +disabled | | Tooltip | <sema-tooltip> | placement: top/bottom/left/right | CSS Anchor Positioning with fallback, Escape to dismiss | | Toggle | <sema-toggle> | — | Used inside ToggleGroup, aria-checked synced | | Toggle Group | <sema-toggle-group> | — | Arrow key navigation, sema-change event | | Splitter | <sema-splitter> | direction: horizontal/vertical | Mouse + touch drag, keyboard arrows, sema-resize delta events, configurable step/shiftStep | | Dialog | <sema-dialog> | — | Modal with focus trap, backdrop click, Escape close, scroll lock, header/body/footer slots | | Tree | <sema-tree> / <sema-tree-item> | — | Nested items, keyboard arrows, expand/collapse chevron, auto depth calculation, sema-tree-select event |

Architecture

  • Lit 3 — reactive Web Components with decorators
  • CSS custom properties — all styling from docs/design/DESIGN.md tokens, zero hardcoded hex
  • CSS Anchor Positioning — tooltip popups with @supports fallback (zero JS positioning)
  • Vite 6 — Rolldown-powered build, TypeScript compilation, declaration: true
  • Vitest 4 — Playwright browser mode, 49 tests, real Chromium rendering
  • ESLinteslint-plugin-lit + eslint-plugin-lit-a11y + eslint-plugin-wc
  • 54.8 KB unminified, 13.4 KB gzipped (Lit + 8 components bundled inline)

Integration

Standalone (notebook, playground, any HTML page)

Copy dist/sema-ui.js + src/styles/tokens.css into your project, add <link> + <script type="module">. All 8 custom elements auto-register.

Notebook (Rust binary)

Copy both files into crates/sema-notebook/src/ui/, register in ui.rs via include_str!, add to index.html before notebook.js.

Playground (esbuild)

Copy both files to playground/, add <link> + <script type="module"> to index.html. Components register globally before dist/app.js runs.

Website (VitePress)

import '@sema-lang/ui/tokens.css'
import '@sema-lang/ui'

Vite deduplicates lit automatically.

Publishing (npm)

{
  "main": "src/index.ts",
  "module": "src/index.ts",
  "types": "src/index.ts",
  "exports": {
    ".": { "import": "./src/index.ts", "types": "./src/index.ts" },
    "./standalone": { "import": "./dist/sema-ui.js" },
    "./tokens.css": "./src/styles/tokens.css"
  }
}

All best practices from Lit's publishing guide:

  • ES2021 target, ESM modules, .js extensions on imports
  • HTMLElementTagNameMap entries on every component
  • Self-defining elements, exported classes
  • TypeScript declarations generated (declaration: true)
  • No bundled lit for npm consumers (use ./standalone for bundled)

Links

License

MIT © Helge Sverre