{"_id":"@anzaui/anza","name":"@anzaui/anza","dist-tags":{"latest":"0.5.0"},"versions":{"0.5.0":{"name":"@anzaui/anza","version":"0.5.0","description":"Anza web platform library — reactive state, networking, offline, animations, custom elements. Instant build step. Pure browser ESM.","author":{"name":"fescii"},"license":"MIT","type":"module","types":"./types/index.d.ts","homepage":"https://github.com/anzaui/anza#readme","repository":{"type":"git","url":"git+https://github.com/anzaui/anza.git"},"publishConfig":{"access":"public"},"keywords":["anza","esm","web-components","reactive","offline","animations","no-build","shadow-dom"],"bin":{"anza":"bin/anza/index.js","anza-create":"bin/create/index.js"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./schemas/anza.schema.json":"./schemas/anza.schema.json","./schemas/vscode-json-schemas.json":"./schemas/vscode-json-schemas.json","./schemas/anza.code-snippets":"./schemas/anza.code-snippets","./api":{"types":"./types/core/api/index.d.ts","default":"./src/core/api/index.js"},"./state":{"types":"./types/core/state/index.d.ts","default":"./src/core/state/index.js"},"./events":{"types":"./types/core/events/index.d.ts","default":"./src/core/events/index.js"},"./router":{"types":"./types/core/router/index.d.ts","default":"./src/core/router/index.js"},"./storage":{"types":"./types/core/storage/index.d.ts","default":"./src/core/storage/index.js"},"./offline":{"types":"./types/core/offline/index.d.ts","default":"./src/core/offline/index.js"},"./animations":{"types":"./types/core/animations/index.d.ts","default":"./src/core/animations/index.js"},"./workers":{"types":"./types/core/workers/index.d.ts","default":"./src/core/workers/index.js"},"./security":{"types":"./types/core/security/index.d.ts","default":"./src/core/security/index.js"},"./platform":{"types":"./types/core/platform/index.d.ts","default":"./src/core/platform/index.js"},"./ui":{"types":"./types/core/ui/index.d.ts","default":"./src/core/ui/index.js"},"./defs":{"default":"./src/core/ui/defs/index.js"},"./elements":{"types":"./types/elements/index.d.ts","default":"./src/elements/index.js"},"./elements/button":"./src/elements/primitives/button/index.js","./elements/icon":"./src/elements/primitives/icon/index.js","./elements/badge":"./src/elements/primitives/badge/index.js","./elements/avatar":"./src/elements/primitives/avatar/index.js","./elements/divider":"./src/elements/primitives/divider/index.js","./elements/text":"./src/elements/primitives/text/index.js","./elements/link":"./src/elements/primitives/link/index.js","./elements/spinner":"./src/elements/primitives/spinner/index.js","./elements/input":"./src/elements/forms/input/index.js","./elements/textarea":"./src/elements/forms/textarea/index.js","./elements/select":"./src/elements/forms/select/index.js","./elements/checkbox":"./src/elements/forms/checkbox/index.js","./elements/radio":"./src/elements/forms/radio/index.js","./elements/toggle":"./src/elements/forms/toggle/index.js","./elements/field":"./src/elements/forms/field/index.js","./elements/upload":"./src/elements/forms/upload/index.js","./elements/form":"./src/elements/forms/form/index.js","./elements/dialog":"./src/elements/overlay/dialog/index.js","./elements/popover":"./src/elements/overlay/popover/index.js","./elements/tooltip":"./src/elements/overlay/tooltip/index.js","./elements/menu":"./src/elements/overlay/menu/index.js","./elements/drawer":"./src/elements/overlay/drawer/index.js","./elements/sheet":"./src/elements/overlay/sheet/index.js","./elements/alert":"./src/elements/feedback/alert/index.js","./elements/toast":"./src/elements/feedback/toast/index.js","./elements/progress":"./src/elements/feedback/progress/index.js","./elements/skeleton":"./src/elements/feedback/skeleton/index.js","./elements/empty":"./src/elements/feedback/empty/index.js","./elements/table":"./src/elements/data/table/index.js","./elements/list":"./src/elements/data/list/index.js","./elements/card":"./src/elements/data/card/index.js","./elements/chart":"./src/elements/data/chart/index.js","./elements/stat":"./src/elements/data/stat/index.js","./elements/nav":"./src/elements/navigation/nav/index.js","./elements/tabs":"./src/elements/navigation/tabs/index.js","./elements/breadcrumb":"./src/elements/navigation/breadcrumb/index.js","./elements/pagination":"./src/elements/navigation/pagination/index.js","./elements/steps":"./src/elements/navigation/steps/index.js","./elements/app":"./src/elements/layout/app/index.js","./elements/header":"./src/elements/layout/header/index.js","./elements/sidebar":"./src/elements/layout/sidebar/index.js","./elements/stack":"./src/elements/layout/stack/index.js","./elements/grid":"./src/elements/layout/grid/index.js","./elements/split":"./src/elements/layout/split/index.js","./elements/scroll":"./src/elements/layout/scroll/index.js","./elements/surface":"./src/elements/layout/surface/index.js","./styles/*":"./src/styles/*","./tokens/*":"./src/tokens/*","./sw":{"default":"./src/sw/index.js"},"./theme":{"types":"./types/core/theme/index.d.ts","default":"./src/core/theme/index.js"},"./bin/create":{"default":"./bin/create/index.js"},"./package.json":"./package.json"},"scripts":{"test":"npx @web/test-runner","serve":"npx @web/dev-server --port 8080 --node-resolve false","check":"tsc --noEmit -p tsconfig.json"},"_id":"@anzaui/anza@0.5.0","gitHead":"a831988e49c3f7d5301ff43803d10bc14d9e2540","bugs":{"url":"https://github.com/anzaui/anza/issues"},"_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-hAao7R99mc/JqpHSzFnJfN5SyQr3QRhkXaJ+CeuxVR9iXQ+0D+ktXGSdKSvJYjiFUAT0/IwVyXZFXUAJj6PC3A==","shasum":"45345bfaf8d68b6f43178acbdde627a4190e69fc","tarball":"https://registry.npmjs.org/@anzaui/anza/-/anza-0.5.0.tgz","fileCount":363,"unpackedSize":927898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA4s9j/REKykh6quNlbimK0eB3UdIKz/lQk4Ga27/Wh/AiEA4Rq3y5B3Y92YPbcj9Mo9w6GtSNibjpk4E3go4CCmnYs="}]},"_npmUser":{"name":"fescii","email":"adukiorg@gmail.com"},"directories":{},"maintainers":[{"name":"fescii","email":"adukiorg@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/anza_0.5.0_1787864509265_0.31547704163444656"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T21:01:48.919Z","0.5.0":"2026-08-27T21:01:49.430Z","modified":"2026-08-27T21:01:49.711Z"},"maintainers":[{"name":"fescii","email":"adukiorg@gmail.com"}],"description":"Anza web platform library — reactive state, networking, offline, animations, custom elements. Instant build step. Pure browser ESM.","homepage":"https://github.com/anzaui/anza#readme","keywords":["anza","esm","web-components","reactive","offline","animations","no-build","shadow-dom"],"repository":{"type":"git","url":"git+https://github.com/anzaui/anza.git"},"author":{"name":"fescii"},"bugs":{"url":"https://github.com/anzaui/anza/issues"},"license":"MIT","readme":"# @anzaui/anza\n\n> The browser already knows how to render, route, cache, and animate. We just stopped getting in its way.\n\n[![npm](https://img.shields.io/npm/v/@anzaui/anza)](https://www.npmjs.com/package/@anzaui/anza)\n[![license](https://img.shields.io/npm/l/@anzaui/anza)](./LICENSE)\n[![tests](https://img.shields.io/badge/tests-237%20passing-brightgreen)](#testing)\n\n---\n\n## What This Is (and What It Is Not)\n\n**This is** a web platform library that treats the browser as the runtime. It gives you reactive state, client-side routing, custom elements, offline sync, and animations — all as plain ES modules the browser resolves directly. No bundler. No virtual DOM. No framework lock-in.\n\n**This is NOT** another React competitor. React is excellent for complex applications with rich ecosystems. Anza is for projects that prefer browser-native APIs and minimal tooling. We're not trying to replace React — we're offering a different approach.\n\n**This is NOT** Angular. Angular provides a comprehensive framework with powerful tooling. Anza focuses on simplicity: `element('my-button', { template: '<button>Click me</button>' })`. That's the whole API.\n\n**This is NOT** Vue. Vue's template compiler and virtual DOM enable great developer experiences. Anza uses native HTML parsing — the browser handles the DOM directly, which works well for many use cases.\n\n---\n\n## The Pitch\n\nAnza is built on browser-native APIs. Every module wraps something the browser already ships:\n\n| Module | What it wraps | What we did to it |\n| --- | --- | --- |\n| `/api` | `fetch`, Streams API, `scheduler.postTask` | Added retries, caching, and a pipeline. The browser did the hard part. |\n| `/state` | ES Proxy, `queueMicrotask`, `BroadcastChannel` | Reactive stores with batched updates. No getters/setters boilerplate. |\n| `/events` | `CustomEvent`, `AbortSignal` | Pub/sub with cleanup that actually works. |\n| `/router` | Navigation API, History API, `URLPattern` | Routes that match URLs and render views. Shocking, we know. |\n| `/storage` | IndexedDB, Cache API, OPFS | Tiered persistence: memory → IDB → disk. You pick the tier. |\n| `/offline` | `navigator.onLine`, IndexedDB | Queue failed requests, replay them later. Like a polite retry system. |\n| `/animations` | WAAPI (`element.animate`) | Stagger groups and scroll-driven animations. The GPU does the work. |\n| `/workers` | Web Locks API, Web Workers | A worker pool with concurrency limits. Because tabs deserve boundaries. |\n| `/security` | Web Crypto API, `DOMParser` | Encrypt, hash, sanitize. The browser has a crypto lab. We use it. |\n| `/platform` | 30+ browser APIs | Feature detection so you know what you are working with. |\n| `/ui` | Custom Elements, Shadow DOM, CSS Layers | Declarative components with reactive props and lifecycle hooks. No classes. |\n| `/sw` | Service Worker, Cache API, Background Sync | Caching strategies, route interception, and push notifications. |\n| `/theme` | `data-theme`, `localStorage`, `matchMedia` | Auto theme switching with persistence. Light, dark, or high-contrast. |\n\nThe Rust CLI (`anza`) resolves your ESM import graph and copies only the modules you actually use into `dist/`. It generates type declarations, serves with HMR, and gets out of your way.\n\n---\n\n## Quick Start\n\n```bash\nnpm create @anzaui/anza myapp\ncd myapp\nnpm install\nnpm run dev\n```\n\nThat is it. Your browser loads `dist/app.js` natively. No webpack. No vite. No `npm run build` that takes forty seconds — our Rust CLI compiles your app in milliseconds.\n\n---\n\n## What You Actually Write\n\n### A Component\n\n```javascript\nimport { view } from '@anzaui/anza/defs';\n\nview('user-card', {\n  props: {\n    name: { type: String, default: 'Guest' },\n    active: { type: Boolean }\n  },\n  template: `\n    <div class=\"card\">\n      <h2 ref=\"title\">{{ name }}</h2>\n      <span class=\"badge\" hidden=\"\">{{ active }}</span>\n    </div>\n  `,\n  on: {\n    connect({ refs }) {\n      refs.title.textContent = this.name;\n    },\n    change({ name, val, refs }) {\n      if (name === 'name') refs.title.textContent = val;\n    }\n  }\n});\n```\n\nUse it:\n\n```html\n<user-card name=\"Alice\" active></user-card>\n```\n\nNo complex build pipeline. No JSX transform. No virtual DOM reconciliation. The browser parses the template, creates the DOM, and updates it when props change. Because that is literally what browsers are for.\n\n### A Route\n\n```javascript\nimport { page, dock } from '@anzaui/anza/defs';\n\ndock('main');\n\npage('/', {\n  tag: 'page-home',\n  via: ['main'],\n  template: { html: './home.html', css: './home.css' }\n}, import.meta.url);\n```\n\nClick `<a href=\"/about\">`. The router intercepts it. The view transitions. No full page reload. The Navigation API has been in Chrome since 2022. We use it.\n\n### Reactive State\n\n```javascript\nimport { state } from '@anzaui/anza/state';\n\nconst store = state.create({ count: 0 });\n\nstore.subscribe('count', () => {\n  console.log('count changed to', store.get('count'));\n});\n\nstore.set('count', 1);\n```\n\nProxy-based reactivity. Batched updates. Cross-tab sync via `BroadcastChannel`. No reducers. No actions. No sagas. Just a store that notifies subscribers when data changes.\n\n### Theme Switching (Automatic)\n\n```javascript\nimport { theme } from '@anzaui/anza/theme';\n\ntheme.toggle();              // light ↔ dark\ntheme.set('high-contrast');  // high-contrast mode\ntheme.resolved();            // effective theme (resolves auto)\n```\n\nNo init call needed. It auto-restores from `localStorage` (`anza-theme`) on import, migrating a legacy `theme` key once when present. Sets `data-theme` on `<html>`. Respects `prefers-color-scheme` if no saved preference exists. Attaches to `window.theme` for devtools access.\n\n---\n\n## The Token System\n\nAnza ships with a complete design token layer:\n\n- **Primitives** — OKLCH color scales, spacing, motion, radius, shadow, z-index\n- **Semantic** — light, dark, high-contrast themes with GPU-accelerated token morphing\n- **Components** — form controls, feedback, overlays, layout tokens\n- **Transitions** — View Transition timing and backdrop tokens\n\nYou own `src/tokens/` after scaffolding. Change a primitive, every component updates. Change a semantic mapping, the whole theme shifts. Override anything in `@layer overrides`. The cascade handles the rest.\n\n---\n\n## Philosophy\n\n**Native first.** If the browser has an API for it, we use it. If it doesn't, we build the smallest possible wrapper. We do not reimplement the browser inside JavaScript.\n\n**Instant builds.** The browser resolves ESM imports natively. Our Rust CLI copies the files you use into `dist/` in milliseconds. That is the whole build step. No bundling. No tree-shaking algorithms. The browser is single-threaded anyway.\n\n**You own your code.** Scaffolding copies starter files into `src/`. The library never touches them again. No hidden configs. No magic globals. No runtime injection of framework internals.\n\n---\n\n## Testing\n\nTests run in **real Chromium** via `@web/test-runner` — no jsdom, no node mocks, no pretend browser.\n\n```bash\nnpm test\n```\n\nIf it passes in Chromium, it passes in Chrome. If it passes in Chrome, it probably works everywhere else. (We said probably. Safari is Safari.)\n\n---\n\n## License\n\n[MIT](./LICENSE) © 2026 Aduki\n","readmeFilename":"README.md","_rev":"1-6f049f71d4e6e1f43581a53debad4cf6"}