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

@kurot/ui-runtime

v0.4.0

Published

Runtime materialization layer for validated Kurot UI documents

Readme

@kurot/ui-runtime

Runtime materialization layer for validated Kurot UI documents. It converts canonical kui.* nodes into real @kurot/ui components without moving document semantics into the component library.

import { createKurotUI } from '@kurot/ui-runtime';

const result = createKurotUI(document, { assets });
stage.addChild(result.root);

The runtime supports kui.Group, kui.Label, kui.EditableText, kui.Image, kui.Rect, kui.Button, kui.ToggleButton, kui.ProgressBar, and kui.TextInput, including their audited inherited properties, children, layout descriptors, and nine-slice rectangles. ProgressBar appearances bind live thumb and label parts. TextInput appearances bind a real EditableText textDisplay and Label promptDisplay, preserving native focus, text entry, restrictions, and prompt states. Reusable component assets are expanded with parameter bindings, variants, part overrides, and projected Slot content. Appearance assets become native Kurot skins and states, including the selected appearance variant.

Version 0.4 completes the first bounded visual-semantics slice with component capability validation and transactional data updates. Contract data fields drive declared one-way property bindings, semantic actions expose declared tap and change events, and numeric appearance overrides may use bounded transitions. The package still performs full-tree creation; incremental preview reconciliation belongs to the next phase.

The result also provides a stable node lookup for editor selection and event wiring:

const startButton = result.instances.get('startButton');
const internalLabel = result.instances.get('startButton/label');

const state = result.stateControllers.get('startButton');
state?.setState('disabled');
state?.clearState();

result.data.setValue('balanceText', '$1,250.00');
result.dispose();

Required data fields must receive an initial value or declare a Schema default. A later setValue() commits only after every binding target succeeds; failure restores earlier targets and leaves the controller value unchanged. Built-in and ordinary reflective properties are restored automatically. A custom adapter that stores bound state outside its runtime object must provide the paired captureProperty and restoreProperty hooks.

Reusable-component state controllers apply Contract state overrides at runtime and restore the exact pre-state values when cleared. Controllers are isolated per component instance; an unknown state throws KurotUIRuntimeError.

Design tokens resolve from the supplied UIAssetRegistry. Resource references use their registered key by default. Applications may replace the adapter for each semantic category without adding resource-system behavior to the document model:

const result = createKurotUI(document, {
	assets,
	resourceAdapters: {
		image: reference => resource.getRes(reference.key),
		font: reference => fontFamilies[reference.key],
		spine: reference => spineAssets[reference.key],
		animation: reference => animations[reference.key],
	},
	onAction: action => controller.handle(action.action),
});

Image and sprite-frame references can feed built-in Image properties. Spine and animation remain project component boundaries: their category adapters resolve the registered resource, while a project component adapter owns the corresponding runtime object.

Project component types are added by extending a foundation UIComponentRegistry and supplying a matching runtime adapter. Invalid documents, unsupported values, and missing adapters throw KurotUIRuntimeError with a stable code and exact document path.

Boundary

  • @kurot/ui-document describes and validates UI.
  • @kurot/ui-runtime creates and connects runtime objects.
  • @kurot/ui implements component behavior and layout.
  • @kurot/core renders the resulting display tree.

This package does not own Canvas or Stage lifecycle and does not define a second document model.

Development

pnpm install
pnpm build
pnpm test
pnpm preview

The preview is available at http://localhost:5173/preview/ by default.