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

@gridui/interaction

v1.3.1

Published

Cancelable interaction change details

Readme

Interaction

@gridui/interaction owns the React-free cancelable change notification shared by choice controls. It has no component, stylesheet, or theme dependency.

changeDetails(event) returns ChangeDetails: the original event, a live isCanceled flag, and an idempotent cancel() function. Each notification has independent cancellation state. The emitting control decides when to inspect that state and whether to commit its proposed change.

Release history

Package-owned records live in .changeset/history.

closesNavigation(event, target, download) identifies uncancelled primary activation in the same browsing context, preserving modifier keys and downloads. isSameDocumentAnchor(href, current) compares origin, pathname, search and a nonempty fragment so overlay compositions can preserve native anchor focus. Both helpers accept browser-independent values and own no routing policy.

getNavigationActivation(event) reads the current native anchor, including the document's base target and download attribute. It returns anchor, document, or null for an activation that should not dismiss navigation. Callers own navigation state and focus restoration. Sidebar and SiteNavigation share this DOM adapter as well as the pure link predicates.

isComposingKeyEvent(event) recognizes native keyboard events owned by an IME, including the processing-key fallback used by some input methods. Pass a React keyboard event's nativeEvent. Check it before treating Enter, Escape, or arrow keys as commands; keep any existing composition lifecycle tracking.

listenForDragCancellation(element, onCancel) observes Escape and window blur only for the lifetime of an active pointer drag. It listens to the element's owning window; Escape is claimed during window capture, before an enclosing Radix overlay's document-capture dismissal. IME processing and already handled Escape events are left alone. The returned cleanup function is idempotent.

Call cleanup when a drag completes, is canceled, or its owner unmounts. The callback owns rollback, pointer-capture release and any controlled-state notification; this helper owns no geometry, persistence, or React lifecycle.

Searchable lists

calculateSearchList(items, options) supplies shared result availability, active-item fallback and clamped next/previous/first/last navigation. Provide a stable string key, current highlighted key, optional preferred predicate and optional isNavigable predicate. Disabled commands can remain visible while being excluded from navigation; selection controls choose their own disabled-item policy. The input records and their order remain unchanged.

searchResultsAvailable({ loading, errorLabel }) rejects loading results and any defined error label, including an empty string. getSearchResultLabel(count, options) applies the same loading/error/empty/results status priority. Select and CommandPalette share these mechanisms while owning text matching, grouping, query lifecycle, ARIA identities, selection and popup focus themselves.