@zitadel/components 0.1.0-alpha.11 → 0.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -115,38 +115,29 @@ fixtures:
115
115
  - **Tests (`msw/node`)** — pass `setupMockHandlers()` from
116
116
  `@zitadel/api-mock` into `setupServer(...)`.
117
117
  `getCapturedRequests()` exposes captured request bodies for assertions.
118
- - **Dev playgrounds / browser (`msw/browser`)** — `setupMock(worker)`; see
119
- [`dev/main.ts`](dev/main.ts) for a working setup. `applyBranding(...)`
120
- injects a tenant branding overlay merged into every response (presets
121
- include `font_url` for Inter).
118
+ - **Browser (`msw/browser`)** — `setupMock(worker)` wires the handlers into a
119
+ `msw/browser` worker. The Storybook orchestrator stories take the equivalent
120
+ path through `msw-storybook-addon` (see
121
+ [`apps/storybook/src/orchestrator.stories.ts`](../../apps/storybook/src/orchestrator.stories.ts)).
122
+ `applyBranding(...)` injects a tenant branding overlay merged into every
123
+ response (presets include `font_url` for Inter).
122
124
  - **Framework demos (TCP server)** — `moon run api-mock:start`
123
125
  serves the same handlers on port 4000 with `defaultDevBranding` (Arimo
124
126
  `font_url`) applied at boot. See [`apps/demo-next`](../../apps/demo-next/README.md)
125
127
  and [`apps/demo-nuxt`](../../apps/demo-nuxt/README.md).
126
128
 
127
- ### Two preview surfaces
129
+ ### Preview surfaces
128
130
 
129
- Two places run the components against `@zitadel/api-mock`. They
130
- have different jobs keep both:
131
-
132
- | Surface | Moon command | URLs | What it gives you |
133
- | --- | --- | --- | --- |
134
- | **Lit playground** | `moon run components:dev` | [login](http://localhost:5173/?route=login) · [atoms](http://localhost:5173/?route=atoms) | Component author surface: branding presets, event log, source TS from `src/`. MSW runs in the browser — no TCP mock server. |
135
- | **React console playground** | `moon run console:dev` | [http://localhost:5174](http://localhost:5174) | `@zitadel/ui-react` atom matrices in the pre-release console shell. MSW in `import.meta.env.DEV`. Compare against Lit `:5173/?route=atoms` in a second tab. |
136
- | **demo-next** | `moon run api-mock:start` + `ZITADEL_URL=http://localhost:4000 moon run demo-next:dev` | [http://localhost:3002/login](http://localhost:3002/login) (mock on `:4000`) | Next.js SDK, middleware, cookies, built `dist/`. See [`apps/demo-next`](../../apps/demo-next/README.md). |
137
- | **demo-nuxt** | mock on `:4000`, then `ZITADEL_URL=http://localhost:4000 moon run demo-nuxt:dev` | [http://localhost:3001/login](http://localhost:3001/login) | Nuxt SDK, middleware, cookies, built `dist/`. See [`apps/demo-nuxt`](../../apps/demo-nuxt/README.md). |
138
-
139
- The Lit dev playground iterates on `<zl-*>` source; the React console
140
- playground exercises `@zitadel/ui-react` in the internal shell.
141
- When tweaking Lit visuals or shadow-DOM behaviour, use `:5173` first —
142
- it round-trips faster. For React pair tweaks, use `:5174`.
131
+ | Surface | Moon command | What it gives you |
132
+ | --- | --- | --- |
133
+ | **Storybook** | `moon run storybook:dev` ([:6006](http://localhost:6006)) | The workbench for both the Lit atoms and the paired React components, plus the `<zitadel-login>` orchestrator (MSW via `msw-storybook-addon`, flow/branding as controls). |
134
+ | **demo-next** | `moon run api-mock:start` + `ZITADEL_URL=http://localhost:4000 moon run demo-next:dev` | Next.js SDK, middleware, cookies, built `dist/` ([:3002/login](http://localhost:3002/login)). See [`apps/demo-next`](../../apps/demo-next/README.md). |
135
+ | **demo-nuxt** | mock on `:4000`, then `ZITADEL_URL=http://localhost:4000 moon run demo-nuxt:dev` | Nuxt SDK, middleware, cookies, built `dist/` ([:3001/login](http://localhost:3001/login)). See [`apps/demo-nuxt`](../../apps/demo-nuxt/README.md). |
143
136
 
144
- **Stale Lit styles on `:5173`?** Atom `.ts` changes use
145
- `vite-plugin-web-components-hmr` (Lit HMR). Edits to `shared-component-styles`
146
- CSS alone trigger a full reload. If it still looks old, run
147
- `corepack pnpm --filter @zitadel/components run dev:clean` and hard-refresh.
148
- Console (`:5174`) will not pick up Lit-only edits until you rebuild or
149
- change the paired React/CSS path.
137
+ Storybook consumes the built `@zitadel/components` / `@zitadel/ui-react`
138
+ artifacts, so rebuild after source changes (`moon run components:build`) or
139
+ keep the Storybook dev server running its tasks depend on the relevant
140
+ build tasks.
150
141
 
151
142
  ### Atoms-only (bypass the orchestrator)
152
143
 
@@ -280,11 +271,6 @@ See [`src/atoms/`](src/atoms) for full TypeScript types and JSDoc.
280
271
 
281
272
  ```
282
273
  packages/components/
283
- ├── dev/ Vite playground (atoms + login routes)
284
- │ ├── index.html
285
- │ ├── main.ts bootstraps @zitadel/api-mock + MSW worker
286
- │ ├── branding-presets.ts tenant-style branding payloads
287
- │ └── pages/ atom playground + <zitadel-login> demo
288
274
  ├── src/
289
275
  │ ├── atoms/ zl-field, zl-button, zl-alert, zl-icon, zl-pill,
290
276
  │ │ zl-card, zl-page-shell + tests
@@ -296,10 +282,12 @@ packages/components/
296
282
  │ ├── manifests.ts per-atom attribute / part / event manifests
297
283
  │ └── index.ts barrel
298
284
  ├── tsdown.config.ts library build (externalises lit/liquidjs/dompurify)
299
- ├── vite.config.mts dev server
300
285
  └── vitest.config.ts jsdom (unit) + chromium (browser) projects
301
286
  ```
302
287
 
288
+ The interactive workbench (atoms, paired React, and the `<zitadel-login>`
289
+ orchestrator) lives in [`apps/storybook`](../../apps/storybook/README.md).
290
+
303
291
  ## Develop
304
292
 
305
293
  Use **Moon** for tasks in this monorepo (`moon run <project>:<task>`).
@@ -311,16 +299,11 @@ documented path.
311
299
  # install once at the repo root
312
300
  corepack pnpm install
313
301
 
314
- # --- Playgrounds (two terminals) ---
315
-
316
- # Lit: atoms + login, in-browser MSW
317
- moon run components:dev
318
- # → http://localhost:5173/?route=login
319
- # → http://localhost:5173/?route=atoms
302
+ # --- Workbench ---
320
303
 
321
- # React console: ui-react atom playground (compare to Lit ?route=atoms in another tab)
322
- moon run console:dev
323
- # → http://localhost:5174
304
+ # Storybook: atoms, paired React, and the <zitadel-login> orchestrator
305
+ moon run storybook:dev
306
+ # → http://localhost:6006
324
307
 
325
308
  # Framework demos (TCP mock + SDK) — see apps/demo-*/README.md
326
309
  # moon run api-mock:start # → http://localhost:4000
@@ -335,8 +318,8 @@ moon run components:typecheck
335
318
  moon run components:build
336
319
  ```
337
320
 
338
- The components dev server imports source TS from `src/` and hot-reloads on edits.
339
- Run `build` when testing the published `dist/` shape (demos and npm consumers).
321
+ Storybook loads the built `dist/`, so run `moon run components:build` after
322
+ source changes (its Storybook tasks already depend on the build).
340
323
 
341
324
  **Framework demos** need the TCP mock plus a rebuild after orchestrator changes —
342
325
  see [`apps/demo-next/README.md`](../../apps/demo-next/README.md) and
@@ -1,2 +1,2 @@
1
- import { Gt as ZlAlert, Ht as zlCardManifest, Jt as ZlIcon, Kt as zlAlertManifest, Ut as ZlButton, Vt as ZlCard, Wt as zlButtonManifest, Yt as zlIconManifest, a as ZlPasskeyResultDetail, c as zlPageShellManifest, d as zlFieldManifest, i as ZlPasskeyErrorDetail, l as ZlField, n as zlPillManifest, o as zlPasskeyManifest, qt as IconName, r as ZlPasskey, s as ZlPageShell, t as ZlPill, u as ZlFieldType } from "../index-DVDCrfkv.mjs";
2
- export { IconName, ZlAlert, ZlButton, ZlCard, ZlField, ZlFieldType, ZlIcon, ZlPageShell, ZlPasskey, ZlPasskeyErrorDetail, ZlPasskeyResultDetail, ZlPill, zlAlertManifest, zlButtonManifest, zlCardManifest, zlFieldManifest, zlIconManifest, zlPageShellManifest, zlPasskeyManifest, zlPillManifest };
1
+ import { $t as zlButtonManifest, Jt as ZlCheckboxChangeDetail, Qt as ZlButton, Xt as ZlCard, Yt as zlCheckboxManifest, Zt as zlCardManifest, a as ZlPill, c as ZlPasskeyErrorDetail, d as ZlPageShell, en as ZlAlert, f as zlPageShellManifest, h as zlFieldManifest, i as zlSelectManifest, in as zlIconManifest, l as ZlPasskeyResultDetail, m as ZlFieldType, n as ZlSelectChangeDetail, nn as IconName, o as zlPillManifest, p as ZlField, qt as ZlCheckbox, r as ZlSelectOption, rn as ZlIcon, s as ZlPasskey, t as ZlSelect, tn as zlAlertManifest, u as zlPasskeyManifest } from "../index-1zs8u08H.mjs";
2
+ export { IconName, ZlAlert, ZlButton, ZlCard, ZlCheckbox, ZlCheckboxChangeDetail, ZlField, ZlFieldType, ZlIcon, ZlPageShell, ZlPasskey, ZlPasskeyErrorDetail, ZlPasskeyResultDetail, ZlPill, ZlSelect, ZlSelectChangeDetail, ZlSelectOption, zlAlertManifest, zlButtonManifest, zlCardManifest, zlCheckboxManifest, zlFieldManifest, zlIconManifest, zlPageShellManifest, zlPasskeyManifest, zlPillManifest, zlSelectManifest };
@@ -1,2 +1,2 @@
1
- import { a as ZlPageShell, c as zlFieldManifest, d as ZlButton, f as zlButtonManifest, g as zlIconManifest, h as ZlIcon, i as zlPasskeyManifest, l as ZlCard, m as zlAlertManifest, n as zlPillManifest, o as zlPageShellManifest, p as ZlAlert, r as ZlPasskey, s as ZlField, t as ZlPill, u as zlCardManifest } from "../atoms-BHSt5lSe.mjs";
2
- export { ZlAlert, ZlButton, ZlCard, ZlField, ZlIcon, ZlPageShell, ZlPasskey, ZlPill, zlAlertManifest, zlButtonManifest, zlCardManifest, zlFieldManifest, zlIconManifest, zlPageShellManifest, zlPasskeyManifest, zlPillManifest };
1
+ import { _ as ZlAlert, a as ZlPasskey, b as zlIconManifest, c as zlPageShellManifest, d as ZlCheckbox, f as zlCheckboxManifest, g as zlButtonManifest, h as ZlButton, i as zlPillManifest, l as ZlField, m as zlCardManifest, n as zlSelectManifest, o as zlPasskeyManifest, p as ZlCard, r as ZlPill, s as ZlPageShell, t as ZlSelect, u as zlFieldManifest, v as zlAlertManifest, y as ZlIcon } from "../atoms-BSwVl736.mjs";
2
+ export { ZlAlert, ZlButton, ZlCard, ZlCheckbox, ZlField, ZlIcon, ZlPageShell, ZlPasskey, ZlPill, ZlSelect, zlAlertManifest, zlButtonManifest, zlCardManifest, zlCheckboxManifest, zlFieldManifest, zlIconManifest, zlPageShellManifest, zlPasskeyManifest, zlPillManifest, zlSelectManifest };