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

@symbo.ls/windows

v3.14.709

Published

Unified modal / dialog system. One `ModalRoot` at the app shell hosts a stack of layers; each layer is a separate visible window so a modal can open another modal. Replaces:

Readme

@symbo.ls/windows

Unified modal / dialog system. One ModalRoot at the app shell hosts a stack of layers; each layer is a separate visible window so a modal can open another modal. Replaces:

  • per-component Modal definitions that each declared their own stateKey on root state
  • native window.alert / window.confirm / window.prompt (which block the JS event loop and ship the host OS's chrome instead of the app's design system)

Wiring

Once per shell — at the app's entry point alongside the SDK + router plugins:

import { windowsComponents } from '@symbo.ls/windows/components'
import { windowsFunctions } from '@symbo.ls/windows/functions'

// 1. Register the plugin's components + functions into context
Object.assign(context.components, windowsComponents)
Object.assign(context.functions, windowsFunctions)

// 2. Add ModalRoot once at the root of your shell tree
const shell = {
  Header: {},
  Main: {},
  Footer: {},
  ModalRoot: {}, // ← this line, that's the whole wiring
}

Reuses the existing ModalWindow, ModalHeader, ModalFooter, Button, Input, Hgroup, Icon components from the design system — no new chrome added.

Calling

From any element handler:

el.call('confirmDialog', {
  title: 'Delete event?',
  message: 'This permanently removes "Standup" from everyone’s calendar.',
  confirmText: 'Delete',
  confirmTheme: 'red',
  icon: 'trash',
  onConfirm: () => el.call('deleteEvent', id),
  onCancel: () => {}, // optional
})

el.call('alertDialog', {
  title: 'Saved',
  message: 'Your changes are live.',
  onOk: () => {}, // optional
})

el.call('promptDialog', {
  title: 'Rename page',
  message: 'New name:',
  defaultValue: oldName,
  placeholder: 'Untitled',
  onConfirm: (value) => el.call('renamePage', value),
  onCancel: () => {}, // optional
})

// Custom content — caller provides a DOMQL fragment
const layerId = el.call('openModal', {
  template: 'custom',
  content: {
    H2: { text: 'Custom modal' },
    P: { text: 'Anything DOMQL goes here.' },
    Button: { text: 'Done', onClick: (e, btn) => btn.call('closeModal', layerId) },
  },
})

Stacking

Up to 5 layers (ModalLayer_0 through ModalLayer_4). Layer N z-indexes at 2000 + N*10, so layer 1 always renders above layer 0. ESC closes the topmost layer. Backdrop clicks dismiss unless dismissOnBackdrop: false was passed to openModal.

Rules followed

  • FA101 / FA102 — flat el.X props + onClick/onInit/onDestroy (no el.props.X, no on.click).
  • FA201 — mutable state lives in state.stack on ModalRoot, never on globalScope.
  • FA204 — Prompt's input draft uses scope: { value: '' }.
  • FA207 — top-level const _layerText = (el, field, fallback) => ... helpers, no nested function declarations inside handlers.
  • FA514 — ESC listener attached via onInit/onDestroy lifecycle, not at module load. The previous window.__modalEscBound pattern in workspace/packages/shared/components/Modal.js is the exact anti-pattern this plugin retires.
  • REUSE rule — Window chrome extends the shared ModalWindow; buttons extend Button; inputs extend Input; icons extend Icon. No re-definition of built-ins.