@zitadel/components 0.1.0-alpha.5 → 0.1.0-alpha.8

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.
Files changed (111) hide show
  1. package/README.md +29 -19
  2. package/dist/atoms/index.d.mts +1 -1
  3. package/dist/atoms/index.mjs +1 -1
  4. package/dist/{atoms-Dh5J7QwT.mjs → atoms-B25wiDqb.mjs} +2 -2
  5. package/dist/atoms-B25wiDqb.mjs.map +1 -0
  6. package/dist/default-Cpl78hQN.mjs +6 -0
  7. package/dist/default-Cpl78hQN.mjs.map +1 -0
  8. package/dist/{index-B1nizGvK.d.mts → index-DVDCrfkv.d.mts} +321 -328
  9. package/dist/index-DVDCrfkv.d.mts.map +1 -0
  10. package/dist/{index-AOp9ms-2.d.mts → index-DZ82Y3_z.d.mts} +6 -6
  11. package/dist/{index-AOp9ms-2.d.mts.map → index-DZ82Y3_z.d.mts.map} +1 -1
  12. package/dist/index.d.mts +3 -3
  13. package/dist/index.mjs +4 -4
  14. package/dist/manifests.mjs +1 -1
  15. package/dist/orchestrator/index.d.mts +2 -2
  16. package/dist/orchestrator/index.mjs +2 -2
  17. package/dist/{orchestrator-e33w1C7V.mjs → orchestrator-CW9zixuw.mjs} +18 -19
  18. package/dist/orchestrator-CW9zixuw.mjs.map +1 -0
  19. package/dist/standalone.mjs +16 -17
  20. package/dist/tokens/index.mjs +1 -1
  21. package/dist/{tokens-TXmurodq.mjs → tokens-BQ_augxi.mjs} +2 -2
  22. package/dist/{tokens-TXmurodq.mjs.map → tokens-BQ_augxi.mjs.map} +1 -1
  23. package/package.json +2 -16
  24. package/dist/atoms/index.d.ts +0 -9
  25. package/dist/atoms/index.d.ts.map +0 -1
  26. package/dist/atoms/zl-alert.d.ts +0 -56
  27. package/dist/atoms/zl-alert.d.ts.map +0 -1
  28. package/dist/atoms/zl-button.d.ts +0 -99
  29. package/dist/atoms/zl-button.d.ts.map +0 -1
  30. package/dist/atoms/zl-card.d.ts +0 -53
  31. package/dist/atoms/zl-card.d.ts.map +0 -1
  32. package/dist/atoms/zl-field.d.ts +0 -90
  33. package/dist/atoms/zl-field.d.ts.map +0 -1
  34. package/dist/atoms/zl-icon.d.ts +0 -48
  35. package/dist/atoms/zl-icon.d.ts.map +0 -1
  36. package/dist/atoms/zl-page-shell.d.ts +0 -48
  37. package/dist/atoms/zl-page-shell.d.ts.map +0 -1
  38. package/dist/atoms/zl-passkey.d.ts +0 -123
  39. package/dist/atoms/zl-passkey.d.ts.map +0 -1
  40. package/dist/atoms/zl-pill.d.ts +0 -54
  41. package/dist/atoms/zl-pill.d.ts.map +0 -1
  42. package/dist/atoms-Dh5J7QwT.mjs.map +0 -1
  43. package/dist/default-DD6GYdEe.mjs +0 -6
  44. package/dist/default-DD6GYdEe.mjs.map +0 -1
  45. package/dist/index-B1nizGvK.d.mts.map +0 -1
  46. package/dist/index.d.ts +0 -16
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/internal/base64url.d.ts +0 -18
  49. package/dist/internal/base64url.d.ts.map +0 -1
  50. package/dist/internal/emit.d.ts +0 -12
  51. package/dist/internal/emit.d.ts.map +0 -1
  52. package/dist/internal/escape-html.d.ts +0 -10
  53. package/dist/internal/escape-html.d.ts.map +0 -1
  54. package/dist/internal/unique-id.d.ts +0 -2
  55. package/dist/internal/unique-id.d.ts.map +0 -1
  56. package/dist/manifest.d.ts +0 -36
  57. package/dist/manifest.d.ts.map +0 -1
  58. package/dist/manifests.d.ts +0 -6
  59. package/dist/manifests.d.ts.map +0 -1
  60. package/dist/orchestrator/api-client.d.ts +0 -33
  61. package/dist/orchestrator/api-client.d.ts.map +0 -1
  62. package/dist/orchestrator/branding-to-tokens.d.ts +0 -28
  63. package/dist/orchestrator/branding-to-tokens.d.ts.map +0 -1
  64. package/dist/orchestrator/branding-validator.d.ts +0 -7
  65. package/dist/orchestrator/branding-validator.d.ts.map +0 -1
  66. package/dist/orchestrator/branding.d.ts +0 -76
  67. package/dist/orchestrator/branding.d.ts.map +0 -1
  68. package/dist/orchestrator/font-loader.d.ts +0 -2
  69. package/dist/orchestrator/font-loader.d.ts.map +0 -1
  70. package/dist/orchestrator/index.d.ts +0 -23
  71. package/dist/orchestrator/index.d.ts.map +0 -1
  72. package/dist/orchestrator/liquid.d.ts +0 -31
  73. package/dist/orchestrator/liquid.d.ts.map +0 -1
  74. package/dist/orchestrator/locales/de.d.ts +0 -16
  75. package/dist/orchestrator/locales/de.d.ts.map +0 -1
  76. package/dist/orchestrator/locales/en.d.ts +0 -19
  77. package/dist/orchestrator/locales/en.d.ts.map +0 -1
  78. package/dist/orchestrator/locales/index.d.ts +0 -13
  79. package/dist/orchestrator/locales/index.d.ts.map +0 -1
  80. package/dist/orchestrator/locales/it.d.ts +0 -14
  81. package/dist/orchestrator/locales/it.d.ts.map +0 -1
  82. package/dist/orchestrator/mandatory-gates.d.ts +0 -26
  83. package/dist/orchestrator/mandatory-gates.d.ts.map +0 -1
  84. package/dist/orchestrator/resolve-api.d.ts +0 -37
  85. package/dist/orchestrator/resolve-api.d.ts.map +0 -1
  86. package/dist/orchestrator/sanitiser.d.ts +0 -6
  87. package/dist/orchestrator/sanitiser.d.ts.map +0 -1
  88. package/dist/orchestrator/template-context.d.ts +0 -55
  89. package/dist/orchestrator/template-context.d.ts.map +0 -1
  90. package/dist/orchestrator/template-names.d.ts +0 -16
  91. package/dist/orchestrator/template-names.d.ts.map +0 -1
  92. package/dist/orchestrator/theme-controller.d.ts +0 -30
  93. package/dist/orchestrator/theme-controller.d.ts.map +0 -1
  94. package/dist/orchestrator/zitadel-login.d.ts +0 -213
  95. package/dist/orchestrator/zitadel-login.d.ts.map +0 -1
  96. package/dist/orchestrator/zitadel-logout.d.ts +0 -114
  97. package/dist/orchestrator/zitadel-logout.d.ts.map +0 -1
  98. package/dist/orchestrator-e33w1C7V.mjs.map +0 -1
  99. package/dist/styles/base.d.ts +0 -7
  100. package/dist/styles/base.d.ts.map +0 -1
  101. package/dist/styles/focus-ring.d.ts +0 -7
  102. package/dist/styles/focus-ring.d.ts.map +0 -1
  103. package/dist/styles/index.d.ts +0 -5
  104. package/dist/styles/index.d.ts.map +0 -1
  105. package/dist/styles/surface.d.ts +0 -8
  106. package/dist/styles/surface.d.ts.map +0 -1
  107. package/dist/styles/tokens.d.ts +0 -11
  108. package/dist/styles/tokens.d.ts.map +0 -1
  109. package/dist/tokens/index.d.ts +0 -9
  110. package/dist/tokens/index.d.ts.map +0 -1
  111. package/dist/tsconfig.lib.tsbuildinfo +0 -1
@@ -1,13 +0,0 @@
1
- /**
2
- * Built-in locale registry.
3
- *
4
- * Re-exports the individual dictionaries and provides a `builtinLocales`
5
- * map so the orchestrator can resolve a BCP 47 language tag to the
6
- * matching dictionary at runtime.
7
- */
8
- export { en, type Locale } from "./en.js";
9
- export { de } from "./de.js";
10
- export { it } from "./it.js";
11
- import { type Locale } from "./en.js";
12
- export declare const builtinLocales: Readonly<Record<string, Locale>>;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/locales/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAkB,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Italian locale dictionary.
3
- *
4
- * Structure mirrors {@link en} — same keys, translated values.
5
- *
6
- * Text keys are auto-generated by the server from the flow definition:
7
- * - Step titles: `<step>.title`
8
- * - Step descriptions: `<step>.description`
9
- * - Field labels: `<step>.field.<field>`
10
- * - Action labels: `<step>.action.<action>`
11
- */
12
- import type { Locale } from "./en.js";
13
- export declare const it: Locale;
14
- //# sourceMappingURL=it.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/locales/it.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,EAAE,EAAE,MAgKhB,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * `{% mandatory_gates %}` runtime patcher.
3
- *
4
- * Per `docs/design/branding/validator.md` §Runtime safety net:
5
- *
6
- * "After the template finishes rendering, the tag inspects the produced DOM
7
- * and appends:
8
- * - Any required `fields[*]` without a matching `<zl-field>`.
9
- * - Any required `gates[*]` without a matching consumer.
10
- * - A primary `<zl-button type="submit">` if none was reached."
11
- *
12
- * Implementation: the LiquidJS `{% mandatory_gates %}` tag emits a unique
13
- * marker comment. After Liquid renders, this patcher parses the produced
14
- * HTML into a `<template>`, builds any missing atoms as real DOM elements,
15
- * replaces the marker with them, and serialises back to a string.
16
- *
17
- * Building elements via the DOM (`document.createElement` + `setAttribute`)
18
- * delegates HTML attribute escaping to the browser's serialiser — no manual
19
- * string-escaping in this module.
20
- */
21
- import type { CreateFlow201Step } from "@zitadel/api/generated/model";
22
- import type { Locale } from "./locales/en.js";
23
- export declare const MANDATORY_GATES_MARKER = "ZL_MANDATORY_GATES";
24
- export declare const mandatoryGatesMarkerComment = "<!--ZL_MANDATORY_GATES-->";
25
- export declare function patchMandatoryGates(html: string, step: CreateFlow201Step, locale: Locale): string;
26
- //# sourceMappingURL=mandatory-gates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mandatory-gates.d.ts","sourceRoot":"","sources":["../../src/orchestrator/mandatory-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,eAAO,MAAM,2BAA2B,8BAAqC,CAAC;AAE9E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAoBR"}
@@ -1,37 +0,0 @@
1
- import { type ZitadelApi, type ZitadelProject } from "@zitadel/api/config";
2
- /**
3
- * Declarative configuration read from an element's HTML attributes
4
- * (`project-id` / `proxy-path` / `url`). Empty strings mean "unset".
5
- */
6
- export interface ProjectAttrs {
7
- readonly projectId: string;
8
- readonly proxyPath: string;
9
- readonly url: string;
10
- }
11
- /**
12
- * Resolves the effective SDK project handle and its typed API client for an
13
- * orchestrator element. Precedence, highest first:
14
- *
15
- * 1. the element's `project` property (an SDK handle set from JS / a framework),
16
- * 2. the global handle from `configureZitadel()`,
17
- * 3. the `project-id` / `proxy-path` / `url` attributes set declaratively in HTML.
18
- *
19
- * Both JS paths (property and global) win over the declarative attributes, so a
20
- * deliberate `configureZitadel()` is never silently overridden by fallback or
21
- * stale HTML attributes; the attributes are the no-JS fallback.
22
- *
23
- * Both `<zitadel-login>` and `<zitadel-logout>` need the same resolution and
24
- * the same "no config" failure, so it lives here rather than being copied
25
- * into each element. Callers run this inside their try/catch so a missing
26
- * configuration surfaces through the element's normal error path rather than
27
- * as an unhandled rejection.
28
- *
29
- * @param project Optional per-element override handle.
30
- * @param attrs Declarative config read from the element's attributes.
31
- * @param element Tag name used in the thrown error (e.g. `<zitadel-login>`).
32
- */
33
- export declare function resolveApi(project: ZitadelProject | undefined, attrs: ProjectAttrs, element: string): {
34
- project: ZitadelProject;
35
- api: ZitadelApi;
36
- };
37
- //# sourceMappingURL=resolve-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-api.d.ts","sourceRoot":"","sources":["../../src/orchestrator/resolve-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAK7B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAuCD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAS9C"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Returns a sanitiser bound to the current manifest registry. Callers should
3
- * cache the result; rebuilding is cheap but allocates a fresh DOMPurify config.
4
- */
5
- export declare function createSanitiser(): (html: string) => string;
6
- //# sourceMappingURL=sanitiser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitiser.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sanitiser.ts"],"names":[],"mappings":"AA0GA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAsB1D"}
@@ -1,55 +0,0 @@
1
- /**
2
- * Liquid template context contract.
3
- *
4
- * The orchestrator feeds tenant Liquid templates a stable, renderer-friendly
5
- * projection of the wire `CreateFlow201` shape. Capability dictionaries
6
- * (`fields`, `actions`, `gates`, `sso_providers`) are typed straight from
7
- * the orval-generated wire so templates iterate over the same schema the
8
- * server promises.
9
- *
10
- * The orchestrator owns three projections that don't exist on the wire:
11
- *
12
- * 1. `errors` — lifted from `step.error: string | null` so templates iterate
13
- * uniformly even though the wire only carries one error string.
14
- * 2. `messages` — populated by orchestrator decoration hooks (info banners,
15
- * sticky notices); not on the wire.
16
- * 3. `identity` — resolved client-side for greet-by-name; not on the wire.
17
- */
18
- import type { CreateFlow201Step, CreateFlow201StepActions, CreateFlow201StepChallenge, CreateFlow201StepFields, CreateFlow201StepGates, CreateFlow201StepSsoProvidersItem } from "@zitadel/api/generated/model";
19
- import type { Branding } from "./branding.js";
20
- export type FlowMessage = {
21
- level: "info" | "warning";
22
- text_key: string;
23
- };
24
- export type FlowError = {
25
- code?: string;
26
- text_key?: string;
27
- message?: string;
28
- };
29
- export type FlowIdentity = {
30
- display_name?: string;
31
- email_address?: string;
32
- avatar_url?: string;
33
- };
34
- /**
35
- * Liquid render context. The orchestrator builds this from the wire
36
- * `CreateFlow201` payload before invoking the engine.
37
- *
38
- * Capability dictionaries point at the orval wire shapes directly. The only
39
- * client-only pieces are `messages`, `identity`, `errors`, the resolved
40
- * `branding` (v2 superset), and `loading`.
41
- */
42
- export type LiquidContext = {
43
- step: Pick<CreateFlow201Step, "name" | "complete" | "texts">;
44
- fields: CreateFlow201StepFields;
45
- actions: CreateFlow201StepActions;
46
- gates: CreateFlow201StepGates;
47
- sso_providers: readonly CreateFlow201StepSsoProvidersItem[];
48
- challenge: CreateFlow201StepChallenge | null;
49
- messages: readonly FlowMessage[];
50
- identity: FlowIdentity | null;
51
- errors: readonly FlowError[];
52
- branding: Branding | Record<string, never>;
53
- loading: boolean;
54
- };
55
- //# sourceMappingURL=template-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-context.d.ts","sourceRoot":"","sources":["../../src/orchestrator/template-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,iCAAiC,EAClC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;IAC7D,MAAM,EAAE,uBAAuB,CAAC;IAChC,OAAO,EAAE,wBAAwB,CAAC;IAClC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,aAAa,EAAE,SAAS,iCAAiC,EAAE,CAAC;IAC5D,SAAS,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC7C,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IACjC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Names of the bundled Liquid templates the `<zitadel-login>` orchestrator
3
- * registers.
4
- *
5
- * This lives in its own module — separate from `liquid.ts` — so the public
6
- * barrel can re-export `TEMPLATE_NAMES` without dragging LiquidJS' `Liquid`
7
- * type (and its Node ambient-type requirements) into the published
8
- * declaration surface. See `liquid.ts` / the orchestrator barrel.
9
- */
10
- export declare const TEMPLATE_NAMES: {
11
- readonly default: "default";
12
- readonly authForm: "auth-form";
13
- readonly passkeyUpsell: "passkey-upsell";
14
- readonly signedIn: "signed-in";
15
- };
16
- //# sourceMappingURL=template-names.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-names.d.ts","sourceRoot":"","sources":["../../src/orchestrator/template-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;aACzB,OAAO,EAAE,SAAS;aAClB,QAAQ,EAAE,WAAW;aACrB,aAAa,EAAE,gBAAgB;aAC/B,QAAQ,EAAE,WAAW;CACb,CAAC"}
@@ -1,30 +0,0 @@
1
- /**
2
- * `ThemeController` — Lit ReactiveController that resolves the active
3
- * `light | dark` theme from the current `Branding` payload and keeps it in
4
- * sync with the OS-level `prefers-color-scheme` when the tenant opts into
5
- * `theme.mode = "auto"`.
6
- *
7
- * Per `docs/design/branding/tokens.md` the orchestrator owns theming entirely.
8
- * Subscribing here is what makes "auto" actually reactive instead of a
9
- * one-shot read at first paint.
10
- */
11
- import type { ReactiveController, ReactiveControllerHost } from "lit";
12
- import type { Branding } from "./branding.js";
13
- export type ResolvedTheme = "light" | "dark";
14
- export declare class ThemeController implements ReactiveController {
15
- private readonly host;
16
- private branding;
17
- private mediaQuery;
18
- private _theme;
19
- constructor(host: ReactiveControllerHost);
20
- get theme(): ResolvedTheme;
21
- setBranding(branding: Branding | undefined): void;
22
- hostConnected(): void;
23
- hostDisconnected(): void;
24
- private refresh;
25
- private attach;
26
- private detach;
27
- private onMediaChange;
28
- private update;
29
- }
30
- //# sourceMappingURL=theme-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-controller.d.ts","sourceRoot":"","sources":["../../src/orchestrator/theme-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAI7C,qBAAa,eAAgB,YAAW,kBAAkB;IACxD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;IAE9C,OAAO,CAAC,QAAQ,CAAuB;IAEvC,OAAO,CAAC,UAAU,CAA+B;IAKjD,OAAO,CAAC,MAAM,CAAyB;IAEvC,YAAY,IAAI,EAAE,sBAAsB,EAGvC;IAED,IAAI,KAAK,IAAI,aAAa,CAEzB;IAED,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAGhD;IAED,aAAa,IAAI,IAAI,CAEpB;IAED,gBAAgB,IAAI,IAAI,CAEvB;IAED,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,MAAM;CAKf"}
@@ -1,213 +0,0 @@
1
- import { type ZitadelProject } from "@zitadel/api/config";
2
- import type { CreateFlowBodyPurpose } from "@zitadel/api/generated/model";
3
- import { LitElement, type PropertyValues } from "lit";
4
- import "../atoms/index.js";
5
- import { type Locale } from "./locales/index.js";
6
- /**
7
- * `<zitadel-login>` — the auth-UI orchestrator.
8
- *
9
- * Drives the typed `@zitadel/api` Flow API directly: `POST /flow`
10
- * starts a flow, `POST /flow/{id}/submit` advances it. Renders each step
11
- * through LiquidJS, sanitises the output via DOMPurify, and mounts the
12
- * result inside a real `<form>` element in its Shadow DOM via Lit's
13
- * `unsafeHTML` directive. Atom CustomEvents (`zl-input` / `zl-submit`)
14
- * and the form's native `submit` event feed back into the
15
- * submit cycle.
16
- *
17
- * Form participation: the orchestrator owns the `<form>` so Enter submits,
18
- * browsers offer "save password" prompts, and password managers / autofill
19
- * see a real form. Each `<zl-field>` is form-associated (see
20
- * `docs/design/branding/form-participation.md`) so its value participates in
21
- * the form even though it lives inside its own shadow root. The shadow root
22
- * also delegates focus, and after each step swap focus moves to the first
23
- * field so screen-reader and keyboard users land in a sensible spot.
24
- *
25
- * Session/state: the server is stateless between requests — a `_zflow`
26
- * HttpOnly cookie carries orchestration state. We always run with
27
- * `credentials: "include"` (set in `api-client.ts`). The flow handle (`id`)
28
- * may rotate on pivots/pops; we re-read it from every response.
29
- *
30
- * Spec sources:
31
- * - `docs/design/flowengine/flow-engine-guide.md`
32
- * - `docs/design/branding/templates.md`
33
- * - `docs/design/branding/tokens.md`
34
- * - `docs/design/branding/schema.md`
35
- * - `docs/design/branding/form-participation.md`
36
- * - `docs/design/flowengine/template-security.md`
37
- */
38
- export declare class ZitadelLogin extends LitElement {
39
- static shadowRootOptions: ShadowRootInit;
40
- static styles: import("lit").CSSResult;
41
- accessor purpose: CreateFlowBodyPurpose;
42
- /**
43
- * SDK project handle returned by `configureZitadel()`. Set from JS (or a
44
- * framework binding). When set, takes precedence over both the
45
- * `project-id`/`proxy-path`/`url` attributes and the global singleton from
46
- * `getZitadelConfig()`.
47
- */
48
- accessor project: ZitadelProject | undefined;
49
- /**
50
- * Project ID, set declaratively in HTML. Lets the component be configured on
51
- * a plain page without JS or `configureZitadel()`. Ignored when the `project`
52
- * property or a `configureZitadel()` global is set. See {@link projectAttrs}.
53
- */
54
- accessor projectId: string;
55
- /**
56
- * Proxy path for API requests (e.g. `/__nextgen`), set declaratively in HTML.
57
- * Defaults to `/__nextgen` when omitted, matching `configureZitadel()`.
58
- */
59
- accessor proxyPath: string;
60
- /**
61
- * Full URL of the Zitadel auth backend, set declaratively in HTML. Optional —
62
- * not needed in client-only setups.
63
- */
64
- accessor url: string;
65
- /**
66
- * URL to navigate to after a successful embedded sign-in. When set, the
67
- * orchestrator exchanges the terminal `handoff_token` via the generated
68
- * API client (setting the session cookie) and then performs a full
69
- * navigation to this URL so host middleware can observe the cookie.
70
- * For `complete: "redirect"` the orchestrator follows `redirect_uri`
71
- * instead and does not run the exchange.
72
- */
73
- accessor postSignInUrl: string;
74
- /**
75
- * Existing flow handle to resume rather than start a new flow. When set,
76
- * the orchestrator hits `GET /flow/{id}` instead of `POST /flow` on
77
- * mount, so a page reload after a network blip can re-render the same
78
- * step without losing collected state.
79
- */
80
- accessor resumeFlowId: string;
81
- /**
82
- * BCP 47 language tag (e.g. `"de"`, `"en-US"`). The widget resolves this
83
- * to a built-in locale dictionary. Falls back to auto-detection from
84
- * `document.documentElement.lang` or `navigator.language` when empty.
85
- */
86
- accessor lang: string;
87
- /**
88
- * Custom locale dictionaries keyed by language code. When set, these take
89
- * precedence over the built-in dictionaries for matching language codes.
90
- *
91
- * ```ts
92
- * import { en } from "@zitadel/components";
93
- * const locales = {
94
- * en: { ...en, "identifier.title": "Welcome" },
95
- * de: myGermanDict,
96
- * };
97
- * ```
98
- */
99
- accessor locales: Record<string, Locale> | undefined;
100
- private accessor response;
101
- private accessor branding;
102
- private accessor loading;
103
- private accessor startupError;
104
- private accessor formValues;
105
- private readonly themeController;
106
- private engine;
107
- private readonly sanitise;
108
- /**
109
- * Cached compiled tenant template, keyed by source string. Re-rendering on
110
- * every `formValues` change otherwise re-parses the same template.
111
- */
112
- private tenantTemplateCache;
113
- createRenderRoot(): HTMLElement | DocumentFragment;
114
- /**
115
- * Start the flow after the first render rather than in `connectedCallback`.
116
- * Frameworks that wrap web components (e.g. `@lit/react` in the console)
117
- * attach the element first and then assign object properties (`branding`,
118
- * `locale`) via setters. `connectedCallback` runs synchronously on attach
119
- * — before any setters from a wrapper's effects/refs — so reading those
120
- * properties there sees stale defaults. `firstUpdated` runs after Lit's
121
- * first render, by which time setters from the wrapping framework have
122
- * fired.
123
- */
124
- protected firstUpdated(): void;
125
- /**
126
- * Resolves the effective locale dictionary. The built-in dictionary for the
127
- * resolved language is used as the base; entries from the `locales` map (if
128
- * set) are spread on top so partial overrides work without importing and
129
- * spreading the full base dictionary.
130
- *
131
- * Priority: explicit `lang` attr → `navigator.language` (user preference)
132
- * → `document.documentElement.lang` (page default) → English fallback.
133
- */
134
- private resolveLocale;
135
- willUpdate(changed: PropertyValues<this>): void;
136
- updated(changed: PropertyValues<this>): void;
137
- private hydrateStepAfterRender;
138
- render(): import("lit").TemplateResult<1>;
139
- /**
140
- * Inject the attribution badge into the rendered template's
141
- * `<zl-page-shell>` footer slot. The attribution must live INSIDE the
142
- * page-shell so it sits within the 100vh viewport rhythm (matching the
143
- * Figma sign-in frame where the pill sits 24px below the card, both
144
- * centred on the page). It can't be a sibling of the page-shell because
145
- * the page-shell already occupies the full viewport height.
146
- *
147
- * This markup is appended AFTER `renderStep` has sanitised the Liquid
148
- * output, so it is not run through DOMPurify. It is orchestrator-owned and
149
- * any tenant-supplied values (`custom_link`) are escaped via `escapeHtml`.
150
- */
151
- private injectAttribution;
152
- /**
153
- * "Secured with Zitadel" attribution chrome injected into every
154
- * template's page-shell footer slot. Controlled by
155
- * `branding.attribution.show_zitadel` — defaults to `true` for
156
- * community / OSS deployments. Licensed tenants can suppress the badge
157
- * entirely or swap it for a `custom_link` value.
158
- */
159
- private renderAttributionHtml;
160
- /** Declarative config read from this element's attributes. */
161
- private get projectAttrs();
162
- private startFlow;
163
- private applyResponse;
164
- private maybeCompleteFlow;
165
- private renderStep;
166
- /**
167
- * Build a `FlowIdentity` from the orchestrator's captured form values so
168
- * the signed-in template can greet the user by email without the API
169
- * having to round-trip identity claims. Email comes from the
170
- * identifier step; display name composes from `given_name` /
171
- * `family_name` when the register step ran.
172
- */
173
- private deriveIdentity;
174
- private applyValuesToFields;
175
- private captureValuesFromFields;
176
- private currentFieldValue;
177
- private handleAtomInput;
178
- private syncFieldElementValue;
179
- private handleAtomSubmit;
180
- /** Secondary navigation rows (`data-action` on `.zl-card-nav__link`). */
181
- private handleDelegatedAction;
182
- private handleFormSubmit;
183
- /**
184
- * Handle a successful WebAuthn ceremony. Auto-submit with the proof
185
- * as `challenge_response` so the flow advances without extra user
186
- * interaction — the ceremony IS the factor verification (ADR 013).
187
- */
188
- private handlePasskeyResult;
189
- /**
190
- * Handle a WebAuthn ceremony error. Re-render the current step with
191
- * an error message so the user sees feedback and can retry or skip.
192
- *
193
- * Guard: if the step already carries the same error key, skip the update.
194
- * Mutating `this.response` triggers `unsafeHTML` to replace the DOM tree,
195
- * which reconnects a fresh `<zl-passkey>` that immediately re-starts the
196
- * ceremony — creating an infinite loop. The guard breaks the cycle.
197
- *
198
- * We also strip the `challenge` from the step so the template does not
199
- * render a new `<zl-passkey>` on re-render. Without this, the first
200
- * cancel would trigger a second ceremony (the guard prevents a third).
201
- */
202
- private handlePasskeyError;
203
- private findPrimaryAction;
204
- private moveFocusToFirstField;
205
- private submit;
206
- private handleTransportError;
207
- }
208
- declare global {
209
- interface HTMLElementTagNameMap {
210
- "zitadel-login": ZitadelLogin;
211
- }
212
- }
213
- //# sourceMappingURL=zitadel-login.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zitadel-login.d.ts","sourceRoot":"","sources":["../../src/orchestrator/zitadel-login.ts"],"names":[],"mappings":"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"}
@@ -1,114 +0,0 @@
1
- import { LitElement, nothing } from "lit";
2
- import { type ZitadelProject } from "@zitadel/api/config";
3
- /**
4
- * `<zitadel-logout>` — orchestrator-tier element that lets the signed-in user
5
- * sign out without touching the flow API.
6
- *
7
- * Reads the user's display name + email from the `__nextgen_display` cookie
8
- * (set by the auth backend on sign-in), renders an avatar trigger with a
9
- * dropdown that exposes a "Sign out" action, and calls the typed
10
- * `revokeMySession` operation in `@zitadel/api`
11
- * (`DELETE /sessions/me`). The server clears the session cookie via
12
- * `Set-Cookie: Max-Age=0`; on success the element fires `zitadel-signout`
13
- * and optionally navigates to `post-sign-out-url`. (`getEndSessionUrl()`
14
- * additionally exposes the OIDC end-session URL for consumers that prefer a
15
- * user-agent-driven redirect.)
16
- *
17
- * ## Template-slot mode
18
- *
19
- * When the consumer projects a `<template>` child the element renders the
20
- * template's clone into its light DOM with `{{name}}`, `{{email}}`, and
21
- * `{{initial}}` substituted. Any element with `data-action="logout"` inside
22
- * the cloned template triggers the sign-out flow. This mirrors the
23
- * placeholder `<nextgen-logout>`'s contract so existing markup keeps working.
24
- *
25
- * Default styles consume the `--zl-*` design tokens so tenant branding
26
- * applies automatically — there is no hardcoded brand colour, radius, or
27
- * shadow.
28
- */
29
- export declare class ZitadelLogout extends LitElement {
30
- static styles: import("lit").CSSResult[];
31
- /**
32
- * SDK project handle returned by `configureZitadel()`. Set from JS (or a
33
- * framework binding). When set, takes precedence over both the
34
- * `project-id`/`proxy-path`/`url` attributes and the global singleton from
35
- * `getZitadelConfig()`.
36
- */
37
- accessor project: ZitadelProject | undefined;
38
- /**
39
- * Project ID, set declaratively in HTML. Lets the component be configured on
40
- * a plain page without JS or `configureZitadel()`. Ignored when the `project`
41
- * property or a `configureZitadel()` global is set.
42
- */
43
- accessor projectId: string;
44
- /**
45
- * Proxy path for API requests (e.g. `/__nextgen`), set declaratively in HTML.
46
- * Defaults to `/__nextgen` when omitted, matching `configureZitadel()`.
47
- */
48
- accessor proxyPath: string;
49
- /**
50
- * Full URL of the Zitadel auth backend, set declaratively in HTML. Optional —
51
- * not needed in client-only setups.
52
- */
53
- accessor url: string;
54
- /** URL to navigate to after a successful sign-out. */
55
- accessor postSignOutUrl: string;
56
- /**
57
- * OIDC `client_id` to forward as a query parameter on the end-session
58
- * request, mirroring the standard end-session contract. Optional —
59
- * leaving this empty is fine when the backend can resolve the client
60
- * from the session cookie alone.
61
- */
62
- accessor clientId: string;
63
- private accessor displayName;
64
- private accessor displayEmail;
65
- private accessor open;
66
- private accessor loading;
67
- private accessor errorMessage;
68
- private templateMode;
69
- connectedCallback(): void;
70
- disconnectedCallback(): void;
71
- updated(): void;
72
- /**
73
- * Decodes the `__nextgen_display` cookie (base64-encoded JSON, set by the
74
- * auth backend on sign-in) and populates `displayName` / `displayEmail`.
75
- * A missing or malformed cookie is intentionally non-fatal — the dropdown
76
- * still renders, just with empty values.
77
- */
78
- private readDisplayCookie;
79
- private get initial();
80
- /**
81
- * Clones a consumer-supplied `<template>` into the light DOM, fills the
82
- * `{{name}}`, `{{email}}`, and `{{initial}}` tokens via a TreeWalker, and
83
- * wires every element with `data-action="logout"` to trigger sign-out.
84
- * Light-DOM mounting is deliberate so the consumer's existing CSS applies.
85
- */
86
- private renderTemplate;
87
- private readonly handleDocumentClick;
88
- private readonly handleDocumentKeydown;
89
- private toggleOpen;
90
- /**
91
- * Calls `DELETE /sessions/me` (`revokeMySession`) with `credentials: "include"`.
92
- * The server validates the `__nextgen_session` cookie, deletes the session, and
93
- * clears the cookie via `Set-Cookie: Max-Age=0`. On success this element fires
94
- * `zitadel-signout` and optionally navigates to `postSignOutUrl`.
95
- */
96
- /** Declarative config read from this element's attributes. */
97
- private get projectAttrs();
98
- private doLogout;
99
- /**
100
- * Returns the absolute URL the end-session request will hit. Useful for
101
- * test assertions and for consumers that prefer to navigate the browser
102
- * directly (instead of fetching) so the OIDC session-end redirect is
103
- * driven by the user agent.
104
- */
105
- getEndSessionUrl(): string;
106
- private handleSignOutClick;
107
- render(): typeof nothing | import("lit").TemplateResult<1>;
108
- }
109
- declare global {
110
- interface HTMLElementTagNameMap {
111
- "zitadel-logout": ZitadelLogout;
112
- }
113
- }
114
- //# sourceMappingURL=zitadel-logout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zitadel-logout.d.ts","sourceRoot":"","sources":["../../src/orchestrator/zitadel-logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAoB1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,OAAgB,MAAM,4BA2IpB;IAEF;;;;;OAKG;IAC6B,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAC;IAE7E;;;;OAIG;IACkD,QAAQ,CAAC,SAAS,SAAM;IAE7E;;;OAGG;IACkD,QAAQ,CAAC,SAAS,SAAM;IAE7E;;;OAGG;IACyB,QAAQ,CAAC,GAAG,SAAM;IAE9C,sDAAsD;IACM,QAAQ,CAAC,cAAc,SAAM;IAEzF;;;;;OAKG;IACiD,QAAQ,CAAC,QAAQ,SAAM;IAElE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAM;IAElC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAM;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAM;IAK5C,OAAO,CAAC,YAAY,CAAS;IAEpB,iBAAiB,IAAI,IAAI,CAajC;IAEQ,oBAAoB,IAAI,IAAI,CAIpC;IAEQ,OAAO,IAAI,IAAI,CAKvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAazB,OAAO,KAAK,OAAO,GAGlB;IAED;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAEF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAKpC;IAEF,OAAO,CAAC,UAAU;IAKlB;;;;;OAKG;IACH,8DAA8D;IAC9D,OAAO,KAAK,YAAY,GAEvB;YAEa,QAAQ;IAwBtB;;;;;OAKG;IACH,gBAAgB,IAAI,MAAM,CAOzB;IAED,OAAO,CAAC,kBAAkB;IAKjB,MAAM,qDAsEd;CACF;AA0BD,OAAO,CAAC,MAAM,CAAC,CAAC;IACd,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}