{"_id":"@aihu/ui","_rev":"4-aaf28abf8984fd8fe42cae40d5c106b8","name":"@aihu/ui","dist-tags":{"canary":"0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113","latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aihu/ui","version":"0.1.0","license":"MIT","_id":"@aihu/ui@0.1.0","maintainers":[{"name":"srmcguirt","email":"srmcguirt@gmail.com"}],"homepage":"https://github.com/fellwork/aihu/tree/main/packages/ui#readme","bugs":{"url":"https://github.com/fellwork/aihu/issues"},"dist":{"shasum":"2ab8a863714ac795c75a74465863a0ba9f6c7774","tarball":"https://registry.npmjs.org/@aihu/ui/-/ui-0.1.0.tgz","fileCount":34,"integrity":"sha512-jpLkw0wT3Lf2Ysf20D3wT8cNHMprJdLpcFQBeF8d8pBI33TyHPp7/gvbddQs5AupIH7LceFO/2tqj4u0ATaTHQ==","signatures":[{"sig":"MEYCIQCyvViyXQM29IgcWHpooBMpKUcTF9Af83KEJySfFrK0KwIhAJA6vqlcpMQDwUvCPXVmFOdDX/C0slqGP1Ly1Y7Wk8mq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aihu%2fui@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":47248},"type":"module","_from":"file:/tmp/tmp.aR9rblx5yY/aihu-ui-0.1.0.tgz","exports":{"./schema":{"types":"./src/schema.ts"},"./registry.json":"./registry.json"},"scripts":{"test":"vitest run","typecheck":"tsc --noEmit","gen:registry":"bun scripts/gen-registry.ts","prepublishOnly":"bun run gen:registry"},"_npmUser":{"name":"srmcguirt","email":"srmcguirt@gmail.com"},"_resolved":"/tmp/tmp.aR9rblx5yY/aihu-ui-0.1.0.tgz","_integrity":"sha512-jpLkw0wT3Lf2Ysf20D3wT8cNHMprJdLpcFQBeF8d8pBI33TyHPp7/gvbddQs5AupIH7LceFO/2tqj4u0ATaTHQ==","repository":{"url":"git+https://github.com/fellwork/aihu.git","type":"git","directory":"packages/ui"},"_npmVersion":"10.8.2","description":"aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"storybook":"^10.4.3","@aihu/css-engine":"0.4.3","@aihu/primitives":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/ui_0.1.0_1781148472673_0.9025959628494129","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113":{"name":"@aihu/ui","version":"0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113","license":"MIT","_id":"@aihu/ui@0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113","maintainers":[{"name":"srmcguirt","email":"srmcguirt@gmail.com"}],"homepage":"https://github.com/fellwork/aihu/tree/main/packages/ui#readme","bugs":{"url":"https://github.com/fellwork/aihu/issues"},"dist":{"shasum":"5478a4be5c7ccfd719b764765dad1f8b1d9347cf","tarball":"https://registry.npmjs.org/@aihu/ui/-/ui-0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113.tgz","fileCount":34,"integrity":"sha512-dsQMmRovx52PrA3ld4gdkvIUnUAfwgzum7Emoku0RxYMBHUVrsmlhXcT8/dcA+xwv9ydTECfKkEYjoe4IMnAxw==","signatures":[{"sig":"MEYCIQCWr+Irl9RY32DTaAc3XL7V/HxjehVn+gfCiZdx0Tl/4AIhAIrxYkIlJSjgAcQG63iK1ZoammJmxwk0FDCDwNBSZe0U","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aihu%2fui@0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":47125},"type":"module","_from":"file:/tmp/tmp.cMkmyDoOIw/aihu-ui-0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113.tgz","exports":{"./schema":{"types":"./src/schema.ts"},"./registry.json":"./registry.json"},"scripts":{"test":"vitest run","typecheck":"tsc --noEmit","gen:registry":"bun scripts/gen-registry.ts","prepublishOnly":"bun run gen:registry"},"_npmUser":{"name":"srmcguirt","email":"srmcguirt@gmail.com"},"_resolved":"/tmp/tmp.cMkmyDoOIw/aihu-ui-0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113.tgz","_integrity":"sha512-dsQMmRovx52PrA3ld4gdkvIUnUAfwgzum7Emoku0RxYMBHUVrsmlhXcT8/dcA+xwv9ydTECfKkEYjoe4IMnAxw==","repository":{"url":"git+https://github.com/fellwork/aihu.git","type":"git","directory":"packages/ui"},"_npmVersion":"10.8.2","description":"aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"storybook":"^10.4.3","@aihu/css-engine":"0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113","@aihu/primitives":"0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113"},"_npmOperationalInternal":{"tmp":"tmp/ui_0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113_1784720441160_0.5108985334170801","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aihu/ui","version":"0.1.1","license":"MIT","_id":"@aihu/ui@0.1.1","maintainers":[{"name":"srmcguirt","email":"srmcguirt@gmail.com"}],"homepage":"https://github.com/fellwork/aihu/tree/main/packages/ui#readme","bugs":{"url":"https://github.com/fellwork/aihu/issues"},"dist":{"shasum":"a8b9e55de7be54903a92c21bdb890535a0e4293c","tarball":"https://registry.npmjs.org/@aihu/ui/-/ui-0.1.1.tgz","fileCount":100,"integrity":"sha512-2kal0DPv12sJ9QbAUCw4mzA12fvVW4DXUNuPwoBNsQcgxku5oIegF8w25bB+9E+++cHoWH0vpMZgCdXNA7A1bA==","signatures":[{"sig":"MEQCIBWALcQZJ2n6pUevvr6PPKdA7Lzl4zF3QrLaeis3kYuOAiB0xmhUEEnQ5mGDw17blR6uqNv0L58m8ygALU/+9JEYbA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aihu%2fui@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":224728},"type":"module","_from":"file:/tmp/tmp.GmmwZ9sr3R/aihu-ui-0.1.1.tgz","exports":{"./schema":{"types":"./src/schema.ts"},"./registry.json":"./registry.json"},"scripts":{"test":"vitest run","typecheck":"tsc --noEmit","gen:registry":"bun scripts/gen-registry.ts","prepublishOnly":"bun run gen:registry"},"_npmUser":{"name":"srmcguirt","email":"srmcguirt@gmail.com"},"_resolved":"/tmp/tmp.GmmwZ9sr3R/aihu-ui-0.1.1.tgz","_integrity":"sha512-2kal0DPv12sJ9QbAUCw4mzA12fvVW4DXUNuPwoBNsQcgxku5oIegF8w25bB+9E+++cHoWH0vpMZgCdXNA7A1bA==","repository":{"url":"git+https://github.com/fellwork/aihu.git","type":"git","directory":"packages/ui"},"_npmVersion":"10.8.2","description":"aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"storybook":"^10.4.3","@aihu/css-engine":"0.6.1","@aihu/primitives":"0.2.3"},"_npmOperationalInternal":{"tmp":"tmp/ui_0.1.1_1786247316831_0.9614024733688542","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aihu/ui","version":"0.1.2","license":"MIT","type":"module","exports":{"./registry.json":"./registry.json","./registry":{"types":"./src/registry.ts"},"./schema":{"types":"./src/schema.ts"}},"sideEffects":false,"devDependencies":{"@aihu/css-engine":"0.7.0","@aihu/primitives":"0.2.4","storybook":"^10.4.3"},"scripts":{"gen:registry":"bun scripts/gen-registry.ts","test":"vitest run","typecheck":"tsc --noEmit","prepublishOnly":"bun run gen:registry"},"description":"aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).","repository":{"type":"git","url":"git+https://github.com/aihu-project/aihu.git","directory":"packages/ui"},"homepage":"https://github.com/aihu-project/aihu/tree/main/packages/ui#readme","bugs":{"url":"https://github.com/aihu-project/aihu/issues"},"publishConfig":{"access":"public"},"_id":"@aihu/ui@0.1.2","_integrity":"sha512-XxiZR3eekPUVvLo0RuOI5LtuLF0BphwnbQrtAQuow2oYM65Hd9bclmHn6KRD/jMDmxnSJ4nDEoNO4BQowSKroQ==","_resolved":"/tmp/tmp.Qdbsqhv6BK/aihu-ui-0.1.2.tgz","_from":"file:/tmp/tmp.Qdbsqhv6BK/aihu-ui-0.1.2.tgz","_nodeVersion":"22.12.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-XxiZR3eekPUVvLo0RuOI5LtuLF0BphwnbQrtAQuow2oYM65Hd9bclmHn6KRD/jMDmxnSJ4nDEoNO4BQowSKroQ==","shasum":"9245a6c185648890f9a8285c3ad96665394cea00","tarball":"https://registry.npmjs.org/@aihu/ui/-/ui-0.1.2.tgz","fileCount":101,"unpackedSize":225414,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aihu%2fui@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBdbtQUgGa59LMAwNW2VmhtEUqVGpG3YeGDWeU1gHW6qAiEA+D7zlKo0OUV/V4BZiYQgbQQ7SX3S8AsiX6i/vnhUtEY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5d627a7e-ed67-44ef-96f9-1fa73178d100"}},"directories":{},"maintainers":[{"name":"srmcguirt","email":"srmcguirt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ui_0.1.2_1789233338257_0.9462020059283878"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-11T03:27:52.567Z","modified":"2026-09-12T17:15:38.703Z","0.1.0":"2026-06-11T03:27:52.806Z","0.0.0-canary-331b0151f7756608a00168b6de1d3b7bae639113":"2026-07-22T11:40:41.302Z","0.1.1":"2026-08-09T03:48:36.963Z","0.1.2":"2026-09-12T17:15:38.385Z"},"bugs":{"url":"https://github.com/aihu-project/aihu/issues"},"license":"MIT","homepage":"https://github.com/aihu-project/aihu/tree/main/packages/ui#readme","repository":{"type":"git","url":"git+https://github.com/aihu-project/aihu.git","directory":"packages/ui"},"description":"aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).","maintainers":[{"name":"srmcguirt","email":"srmcguirt@gmail.com"}],"readme":"# @aihu/ui\n\n> **Aihu** — agentic discovery and interaction, for human purpose.\n\naihu styled-recipe registry — copy-paste `.aihu` recipes distributed as source via `aihu add` (no runtime bundle).\n\n<!-- BEGIN_HANDWRITTEN: prose -->\nThe **styled-recipe layer** on top of the headless [`@aihu/primitives`](../primitives)\nand the [CSS engine](../css-engine). A recipe is an `.aihu` SFC with a `@meta`\nvariant declaration, a `@template` wiring `data-*` attributes, and a `@style`\nblock of `@apply` utilities resolved against the active style pack.\n\n**`@aihu/ui` is source-distributed.** Its payload is the `registry/**` `.aihu`\nrecipe sources plus a generated `registry.json` index — NOT a bundled runtime\ndependency. You install it as a devDependency and `aihu add <name>` copies the\nrecipe source into your project (you own the copy). Because nothing from this\npackage is bundled into your runtime *from the package*, it carries **no\n`.size-limit.json` row** — your own build measures the copied recipes. See\n[`.size-limit.README.md`](../../.size-limit.README.md).\n\nTooling that reads the catalog can import the stable TypeScript contract from\n`@aihu/ui/registry`. The `./schema` export remains available as a compatibility\nalias for existing in-repo consumers.\n\n### Phase 1 recipes\n\n| Recipe | Kind | Notes |\n|---|---|---|\n| `button` | styled | wraps a native `<button>`; variant + size matrix. No `$extends` — see below |\n| `card` | styled | presentational; slotted header/body/footer |\n| `badge` | styled | presentational; variant matrix |\n| `separator` | styled | presentational; `orientation` + `role=\"separator\"` |\n\n### CSS attachment (R2): the compiler owns it\n\nA recipe declares its appearance in `@style` and writes **no CSS-attachment\ncode at all**. The compiler emits, for every scoped component:\n\n```js\nconst __style__ = new CSSStyleSheet()      // MODULE scope — constructed once\n__style__.replaceSync(`…your @style block…`)\n\ndefineElement('aihu-card', defineComponent((ctx) => {\n  (ctx.host as ShadowRoot).adoptedStyleSheets = [__style__]   // per instance\n  …\n}))\n```\n\nThat already *is* the R2 contract — one shared, single-construction\nConstructable StyleSheet, adopted into every instance's shadow root, never a\nper-instance `<style>` element. Hand-rolling a second `static sheet =\nnew CSSStyleSheet()` inside `@state` adds nothing and cannot work: see\n\"Do NOT register the element yourself\" below.\n\n### Do NOT register the element yourself\n\nThe compiler registers the tag at **module scope**, before any instance\nexists. A `@state` block runs in the component's *setup* body, which the\nruntime only calls when an element **upgrades** — strictly after registration.\nSo this, which four recipes shipped with, is dead code in every browser:\n\n```js\n@state {\n  // ✗ NEVER runs: customElements.get('aihu-thing') is already truthy here,\n  //   because defineElement('aihu-thing', …) ran at module scope.\n  if (!customElements.get('aihu-thing')) customElements.define('aihu-thing', AihuThing)\n}\n```\n\nTo give the host extra behavior, supply a **base class** through the sanctioned\n`$extends:` macro — the compiler then emits `defineComponent({ base: … })` and\nthe runtime extends it, so the class you name really is in the element's\nprototype chain:\n\n```js\n@state {\n  import { AihuCheckboxRoot } from '@aihu/primitives/checkbox'\n\n  base: AihuCheckboxRoot\n}\n```\n\nChoose between the two shapes by asking **what carries the semantics**:\n\n- The **host** does (it *is* the checkbox / switch / dialog) → `$extends:` the\n  primitive. See `checkbox.aihu`, `switch.aihu`, `dialog-*.aihu`.\n- The **template** does (it renders a native `<button>`/`<input>`/`<label>`)\n  → no `$extends:`. Extending would fight the native element — you get a\n  focusable host wrapping a focusable control, two tab stops, and doubled\n  keyboard activation. See `button.aihu`, `input.aihu`, `textarea.aihu`.\n\n`tests/shadow-adoption.test.ts` pins both halves against the real compiler\noutput loaded in a DOM.\n\n### Authoring a recipe: `@state` runs on the SERVER too\n\nA `@state` block is emitted verbatim into the component's setup body, and under\n`output: 'ssr'` that body executes inside a Cloudflare Worker — where\n`HTMLElement`, `CSSStyleSheet`, `customElements` and `document` are all\n`undefined`. A bare DOM reference there is not a degraded render, it is a\n`ReferenceError`: as a child the element comes out empty, as a page the request\ngets no response at all.\n\nSo anything in `@state` that touches a DOM global directly must be guarded:\n\n```js\n@state {\n  // A media query read at setup time — genuinely DOM-only, genuinely needed.\n  const compact =\n    typeof matchMedia !== 'undefined' && matchMedia('(max-width: 40rem)').matches\n}\n```\n\nThe guard is a last resort, not the house style. Before reaching for one, check\nthat the DOM work belongs in `@state` at all — element registration and CSS\nattachment do not (see the two sections above), and anything that needs a live\nelement belongs in `onMount`.\n\nThree things do NOT need a guard, and should not get one:\n\n- `onMount` / event handlers / `@aihu/use` composables — never run during a\n  server render (the composables carry their own `isClient` no-op contract).\n- `@aihu/primitives`' `defineX()` entry points (`defineSlider()`,\n  `defineRadioGroup()`, …) — each is a documented no-op without a DOM.\n- The `@style` block — the compiler already elides its `new CSSStyleSheet()`\n  on the server target and ships the CSS as a string instead.\n\n`tests/ssr-recipe-safety.test.ts` enforces this by compiling every recipe to\nthe server target and running its renderer in a DOM-less realm.\n\n### Local development\n\n```bash\nbun run gen:registry   # scan registry/** → registry.json (index-only)\nbun run test           # vitest (recipe-compile + shadow-adoption + SSR safety)\nbun run typecheck      # tsc --noEmit (no dist; recipes are typechecked, not compiled)\n```\n\n### Ported catalogs — provenance\n\nSome recipes in this registry are ported from third-party open-source catalogs, per\n`docs/plans/2026-08-01-performative-ui-port.md`:\n\n- **[tailwind-animations](https://github.com/midudev/tailwind-animations)** (MIT, ©\n  Miguel Ángel Durán) — the ported `animate-*` utility classes are transcribed into\n  `@aihu/css-engine`'s utility engine; see `vendor/tailwind-animations-*/PROVENANCE.md`\n  and root [`NOTICES.md`](../../NOTICES.md).\n- **[performativeUI](https://github.com/vorpus/performativeUI)** (MIT) — components in\n  this registry inspired by performativeUI's design/behavior/style are reimplemented in\n  aihu-native code (no `pui-` prefixed class names or source text copied); each such\n  recipe's header comment carries a one-line attribution. See\n  `docs/plans/2026-08-01-performative-ui-port.md` for the transcription policy and\n  `scripts/check-no-vendored-pui.ts` for the CI guard enforcing it.\n<!-- END_HANDWRITTEN: prose -->\n\n## Install\n\n<!-- BEGIN_AUTOGEN: install -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\n```bash\nnpm install @aihu/ui\n# or\nbun add @aihu/ui\n```\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: install -->\n\n## Package facts\n\n<!-- BEGIN_AUTOGEN: stats -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\n| | |\n|---|---|\n| **Version** | `0.1.2` |\n| **Tier** | F — UI — styled-recipe registry distributed as source via `aihu add` |\n| **Published files** | 6 entries |\n| **License** | MIT |\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: stats -->\n\n## Exports\n\n<!-- BEGIN_AUTOGEN: exports -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\n| Subpath | ESM | CJS |\n|---|---|---|\n| `./registry.json` | `./registry.json` | — |\n| `./registry` | `—` | `—` |\n| `./schema` | `—` | `—` |\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: exports -->\n\n## Dependencies\n\n<!-- BEGIN_AUTOGEN: deps -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\n_Zero runtime dependencies_ (per the [dep-free thesis](../../README.md#project-posture))_._\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: deps -->\n\n## See also\n\n<!-- BEGIN_AUTOGEN: see-also -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\n- [@aihu/primitives](../primitives)\n- [@aihu/css-engine](../css-engine)\n- [Aihu framework root](../../README.md)\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: see-also -->\n\n## License\n\n<!-- BEGIN_AUTOGEN: license -->\n<!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->\n\nMIT — see [LICENSE](../../LICENSE).\n\n<sub><i>Auto-generated against `@aihu/ui@0.1.2`.</i></sub>\n\n<!-- END_AUTOGEN: license -->\n","readmeFilename":"README.md"}