@zitadel/sdk-solid 1.0.0-alpha.24 → 1.0.0-alpha.28

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
@@ -2,9 +2,17 @@
2
2
 
3
3
  Solid components for the Zitadel auth UI, for client-side SPAs (Vite, etc.).
4
4
 
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @zitadel/sdk-solid@alpha
9
+ ```
10
+
5
11
  ## Requirements
6
12
 
7
- TypeScript ≥ 5.0 — the published type definitions re-export with `export type *`, which TypeScript introduced in 5.0.
13
+ Peer dependencies: `solid-js >=1.6`.
14
+
15
+ TypeScript ≥ 5.0, the floor shared by every SDK; see the [compatibility notes](https://github.com/zitadel/nextgen/blob/main/packages/AGENTS.md).
8
16
 
9
17
  ## Usage
10
18
 
@@ -23,10 +31,60 @@ export default function LoginPage() {
23
31
 
24
32
  `<ZitadelLogout project={project} postSignOutUrl="/login" />` works the same way.
25
33
 
34
+ `ZitadelLogin` also takes `resumeFlowId`, an existing flow to resume instead of starting a new one; unset, `null` or `""` falls back to the `flow` query parameter.
35
+
26
36
  The signed-in session card is `<ZitadelSession project={project} />` (exported as `ZitadelSession`).
27
37
 
28
- The widget's flow events are also surfaced as optional callbacks:
29
- `onFlowStep`, `onFlowInput`, `onFlowComplete`, and `onFlowError`.
38
+ ## Widget props and events
39
+
40
+ `ZitadelLogin`, `ZitadelLogout` and `ZitadelSession` take the props below, spelled the same in every SPA SDK. An unset prop keeps the widget's own default.
41
+
42
+ | Prop | Type | Default | Widgets | Description |
43
+ | --- | --- | --- | --- | --- |
44
+ | `project` | `ZitadelProject` | unset | Login, Logout, Session | The handle from `configureZitadel(...)`. Wins over `projectId` and `proxyPath`. |
45
+ | `projectId` | `string` | unset | Login, Logout, Session | Project id, read when no `project` handle is passed. |
46
+ | `proxyPath` | `string` | `"/__nextgen"` | Login, Logout, Session | Same-origin path the widget calls. |
47
+ | `purpose` | `CreateFlowBodyPurpose` | `"login"` | Login | Flow purpose. |
48
+ | `flowName` | `string` | unset | Login | Runs the flow definition with this `name`; unset runs the project's default flow for the purpose. |
49
+ | `postSignInUrl` | `string` | unset | Login | Where to navigate after a completed sign-in. When the page's `next` query parameter names a path on the same origin, as the server SDKs' middleware sets it for a signed-out visit to a protected route, the widget returns there instead. |
50
+ | `forcePostSignInUrl` | `boolean` | `false` | Login | Navigates to `postSignInUrl` even when the page's `next` query parameter names a path, for a page that uses `next` for something of its own. |
51
+ | `postSignOutUrl` | `string` | unset | Logout, Session | Where to navigate after sign-out. |
52
+ | `resumeFlowId` | `string` or `null` | unset | Login | An existing flow's id to resume instead of starting a new flow; unset, `null` or `""` falls back to the `flow` query parameter, and an id that no longer resolves starts a new flow. |
53
+ | `variant` | `"widget"` or `"page"` | `"widget"` | Login, Session | `widget` is content-sized and paints no page chrome; `page` claims the viewport, paints the surface background and loads the brand font, and on Login focuses the first field. |
54
+ | `theme` | `"light"`, `"dark"` or `"auto"` | unset | Login, Logout, Session | Colour mode. Unset follows the tenant's branding theme on Login, then the variant default (`dark` for `page`, `auto` for `widget`); Logout defaults to `auto`. `auto` follows `prefers-color-scheme`. |
55
+ | `suppressHeader` | `boolean` | `false` | Login, Session | Visually hides the widget's own heading block while keeping it in the accessibility tree, for pages that already carry the heading. |
56
+ | `suppressPasswordToggle` | `boolean` | `false` | Login | Hides the show/hide button on password fields. |
57
+ | `heading` | `string` | `"Signed in as"` | Session | Heading text override. |
58
+ | `logoutLabel` | `string` | `"Sign out"` | Session | Logout action label override. |
59
+ | `locales` | `Record<string, Partial<Record<string, string>>>` | unset | Login | Copy overrides merged over the builtin dictionaries, keyed by primary language subtag, for example `{ en: { "identifier.title": "Welcome back" } }`. |
60
+ | `lang` | `string` | browser language | Login | BCP-47 language override. |
61
+
62
+ Each widget event reaches the callback in the last column, which receives the event's `detail` payload.
63
+
64
+ | Widget event | Fires when | Detail | Widgets | Callback |
65
+ | --- | --- | --- | --- | --- |
66
+ | `zitadel-flow-step` | Login shows a step, the first one included. | `{ step }` | Login | `onFlowStep` |
67
+ | `zitadel-flow-input` | The visitor edits a field. | `{ name, value }` | Login | `onFlowInput` |
68
+ | `zitadel-flow-complete` | The flow reaches a terminal step. | `{ behavior, redirect_uri?, handoff_token?, handoff_token_expires_at? }` | Login | `onFlowComplete` |
69
+ | `zitadel-flow-redirect` | The widget hands the browser to an identity provider; nobody is signed in yet. | `{ redirect_url, step }` | Login | `onFlowRedirect` |
70
+ | `zitadel-flow-error` | The flow reports an error. | `{ message }` | Login | `onFlowError` |
71
+ | `zitadel-signout` | The user signs out. | `{ display, identifier }` | Logout, Session | `onSignout` |
72
+
73
+ ```tsx
74
+ <ZitadelLogin project={project} theme="light" onFlowComplete={(detail) => track(detail)} />
75
+ ```
76
+
77
+ ## Standard HTML attributes
78
+
79
+ `ZitadelLogin`, `ZitadelLogout` and `ZitadelSession` also take the standard HTML attributes (`class`, `style`, `id`, `title`, `slot`, `hidden`, `role`, `tabindex`, `data-*` and `aria-*`) and pass them to the widget element, so you can position, style and label the widget without an extra wrapper element. Nothing else reaches the element: any other prop is ignored.
80
+
81
+ ```tsx
82
+ <ZitadelLogin project={project} class="login" data-testid="login" aria-label="Sign in" />
83
+ ```
84
+
85
+ ## Server rendering
86
+
87
+ If your app renders on the server, mount the widget on the client only, after hydration, or pass `projectId` and `proxyPath` to the `ZitadelLogin` wrapper as strings (it writes them as the `project-id` and `proxy-path` attributes; use those hyphenated names only on a raw `<zitadel-login>` element), because a widget that starts before its configuration arrives shows an error instead of the flow.
30
88
 
31
89
  ## Proxying to the backend (deployment)
32
90
 
package/dist/index.d.ts CHANGED
@@ -1,42 +1,49 @@
1
1
  import { ZitadelLogin as ZitadelLoginElement, ZitadelLogout as ZitadelLogoutElement, ZitadelSession as ZitadelSessionElement } from '@zitadel/components';
2
2
  import { JSX } from 'solid-js';
3
+ import { widgetTags } from '@zitadel/sdk-core/types';
3
4
  import { configureZitadel, getApi, getZitadelConfig, ZitadelConfig, ZitadelProject } from '@zitadel/api/config';
4
- import { ZitadelFlowCompleteDetail, ZitadelFlowErrorDetail, ZitadelFlowInputDetail, ZitadelFlowStepDetail, ZitadelLoginProps, ZitadelLogoutProps, ZitadelSessionProps, ZitadelSignoutDetail } from './types';
5
+ import { ZitadelFlowCompleteDetail, ZitadelFlowRedirectDetail, ZitadelFlowErrorDetail, ZitadelFlowInputDetail, ZitadelFlowStepDetail, ZitadelLoginProps, ZitadelLogoutProps, ZitadelSessionProps, ZitadelSignoutDetail, ZitadelWidgetAttributes } from './types';
5
6
  declare module "solid-js" {
6
7
  namespace JSX {
7
8
  interface IntrinsicElements {
8
- "zitadel-login": Omit<HTMLAttributes<HTMLElement>, "ref"> & {
9
+ [widgetTags.login]: Omit<HTMLAttributes<HTMLElement>, "ref"> & {
9
10
  ref?: ZitadelLoginElement | ((el: ZitadelLoginElement) => void);
10
11
  "prop:project"?: ZitadelProject;
11
12
  "prop:locales"?: Record<string, Partial<Record<string, string>>>;
12
13
  "prop:lang"?: string;
13
14
  "project-id"?: string;
14
15
  "proxy-path"?: string;
16
+ url?: string;
15
17
  purpose?: string;
16
18
  "flow-name"?: string;
17
19
  "post-sign-in-url"?: string;
20
+ "prop:forcePostSignInUrl"?: boolean;
18
21
  variant?: "widget" | "page";
19
22
  theme?: "light" | "dark" | "auto";
20
23
  "prop:suppressHeader"?: boolean;
24
+ "prop:suppressPasswordToggle"?: boolean;
21
25
  "on:zitadel-flow-step"?: (event: CustomEvent<ZitadelFlowStepDetail>) => void;
22
26
  "on:zitadel-flow-input"?: (event: CustomEvent<ZitadelFlowInputDetail>) => void;
23
27
  "on:zitadel-flow-complete"?: (event: CustomEvent<ZitadelFlowCompleteDetail>) => void;
28
+ "on:zitadel-flow-redirect"?: (event: CustomEvent<ZitadelFlowRedirectDetail>) => void;
24
29
  "on:zitadel-flow-error"?: (event: CustomEvent<ZitadelFlowErrorDetail>) => void;
25
30
  };
26
- "zitadel-logout": Omit<HTMLAttributes<HTMLElement>, "ref"> & {
31
+ [widgetTags.logout]: Omit<HTMLAttributes<HTMLElement>, "ref"> & {
27
32
  ref?: ZitadelLogoutElement | ((el: ZitadelLogoutElement) => void);
28
33
  "prop:project"?: ZitadelProject;
29
34
  "project-id"?: string;
30
35
  "proxy-path"?: string;
36
+ url?: string;
31
37
  "post-sign-out-url"?: string;
32
38
  theme?: "light" | "dark" | "auto";
33
39
  "on:zitadel-signout"?: (event: CustomEvent<ZitadelSignoutDetail>) => void;
34
40
  };
35
- "zitadel-session": Omit<HTMLAttributes<HTMLElement>, "ref"> & {
41
+ [widgetTags.session]: Omit<HTMLAttributes<HTMLElement>, "ref"> & {
36
42
  ref?: ZitadelSessionElement | ((el: ZitadelSessionElement) => void);
37
43
  "prop:project"?: ZitadelProject;
38
44
  "project-id"?: string;
39
45
  "proxy-path"?: string;
46
+ url?: string;
40
47
  "post-sign-out-url"?: string;
41
48
  heading?: string;
42
49
  "logout-label"?: string;
@@ -48,6 +55,18 @@ declare module "solid-js" {
48
55
  }
49
56
  }
50
57
  }
58
+ /** Props of `ZitadelLogin`: the widget's own plus the standard HTML attributes. */
59
+ export type ZitadelLoginSolidProps = ZitadelLoginProps & ZitadelWidgetAttributes & {
60
+ ref?: ZitadelLoginElement | ((el: ZitadelLoginElement) => void);
61
+ };
62
+ /** Props of `ZitadelLogout`: the widget's own plus the standard HTML attributes. */
63
+ export type ZitadelLogoutSolidProps = ZitadelLogoutProps & ZitadelWidgetAttributes & {
64
+ ref?: ZitadelLogoutElement | ((el: ZitadelLogoutElement) => void);
65
+ };
66
+ /** Props of `ZitadelSession`: the widget's own plus the standard HTML attributes. */
67
+ export type ZitadelSessionSolidProps = ZitadelSessionProps & ZitadelWidgetAttributes & {
68
+ ref?: ZitadelSessionElement | ((el: ZitadelSessionElement) => void);
69
+ };
51
70
  export { configureZitadel, getApi, getZitadelConfig };
52
71
  export type { ZitadelConfig, ZitadelProject };
53
72
  export * from './types';
@@ -61,9 +80,7 @@ export { businessLocales } from '@zitadel/components';
61
80
  * A forwarded `ref` resolves to the underlying `<zitadel-login>` DOM element,
62
81
  * so consumers can imperatively access the upgraded web component.
63
82
  */
64
- export declare function ZitadelLogin(props: ZitadelLoginProps & {
65
- ref?: ZitadelLoginElement | ((el: ZitadelLoginElement) => void);
66
- }): JSX.Element;
83
+ export declare function ZitadelLogin(props: ZitadelLoginSolidProps): JSX.Element;
67
84
  /**
68
85
  * Solid component wrapping the `<zitadel-logout>` web component. Binds the
69
86
  * {@link ZitadelProject} handle as a DOM property (or the discrete project id /
@@ -73,9 +90,7 @@ export declare function ZitadelLogin(props: ZitadelLoginProps & {
73
90
  * A forwarded `ref` resolves to the underlying `<zitadel-logout>` DOM element,
74
91
  * so consumers can imperatively access the upgraded web component.
75
92
  */
76
- export declare function ZitadelLogout(props: ZitadelLogoutProps & {
77
- ref?: ZitadelLogoutElement | ((el: ZitadelLogoutElement) => void);
78
- }): JSX.Element;
93
+ export declare function ZitadelLogout(props: ZitadelLogoutSolidProps): JSX.Element;
79
94
  /**
80
95
  * Solid component wrapping the `<zitadel-session>` web component — the
81
96
  * post-sign-in "signed in as" card. Binds the {@link ZitadelProject} handle as
@@ -84,7 +99,5 @@ export declare function ZitadelLogout(props: ZitadelLogoutProps & {
84
99
  *
85
100
  * A forwarded `ref` resolves to the underlying `<zitadel-session>` DOM element.
86
101
  */
87
- export declare function ZitadelSession(props: ZitadelSessionProps & {
88
- ref?: ZitadelSessionElement | ((el: ZitadelSessionElement) => void);
89
- }): JSX.Element;
102
+ export declare function ZitadelSession(props: ZitadelSessionSolidProps): JSX.Element;
90
103
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,mBAAmB,EACnC,aAAa,IAAI,oBAAoB,EACrC,cAAc,IAAI,qBAAqB,EACxC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,qBAAq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D,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAC9C,cAAc,SAAS,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA6BvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAgBzE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAoB3E"}
package/dist/index.js CHANGED
@@ -1,74 +1,121 @@
1
- import { addEventListener as d, use as h, getOwner as m, effect as s, template as w } from "solid-js/web";
2
- import { businessLocales as F } from "@zitadel/components";
3
- import { configureZitadel as b, getApi as C, getZitadelConfig as E } from "@zitadel/api/config";
4
- var x = /* @__PURE__ */ w("<zitadel-login>", !0, !1, !1), y = /* @__PURE__ */ w("<zitadel-logout>", !0, !1, !1), z = /* @__PURE__ */ w("<zitadel-session>", !0, !1, !1);
5
- function L(i) {
6
- return (() => {
7
- var t = x();
8
- d(t, "zitadel-flow-error", (e) => i.onFlowError?.(e.detail)), d(t, "zitadel-flow-complete", (e) => i.onFlowComplete?.(e.detail)), d(t, "zitadel-flow-input", (e) => i.onFlowInput?.(e.detail)), d(t, "zitadel-flow-step", (e) => i.onFlowStep?.(e.detail));
9
- var o = i.ref;
10
- return typeof o == "function" ? h(o, t) : i.ref = t, t._$owner = m(), s((e) => {
11
- var a = i.project, n = i.locales, r = i.lang, l = i.projectId, v = i.proxyPath, u = i.purpose ?? "login", f = i.flowName, g = i.postSignInUrl, c = i.variant, j = i.theme, S = i.suppressHeader;
12
- return a !== e.e && (t.project = e.e = a), n !== e.t && (t.locales = e.t = n), r !== e.a && (t.lang = e.a = r), l !== e.o && (t.projectId = e.o = l), v !== e.i && (t.proxyPath = e.i = v), u !== e.n && (t.purpose = e.n = u), f !== e.s && (t.flowName = e.s = f), g !== e.h && (t.postSignInUrl = e.h = g), c !== e.r && (t.variant = e.r = c), j !== e.d && (t.theme = e.d = j), S !== e.l && (t.suppressHeader = e.l = S), e;
13
- }, {
14
- e: void 0,
15
- t: void 0,
16
- a: void 0,
17
- o: void 0,
18
- i: void 0,
19
- n: void 0,
20
- s: void 0,
21
- h: void 0,
22
- r: void 0,
23
- d: void 0,
24
- l: void 0
25
- }), t;
26
- })();
1
+ import { Dynamic as e, createComponent as t, mergeProps as n } from "solid-js/web";
2
+ import { businessLocales as r } from "@zitadel/components";
3
+ import { standardAttributes as i, widgetTags as a } from "@zitadel/sdk-core/types";
4
+ import { configureZitadel as o, getApi as s, getZitadelConfig as c } from "@zitadel/api/config";
5
+ //#region src/index.tsx
6
+ function l(e) {
7
+ let t = e.project?.proxyPath ?? e.proxyPath;
8
+ return {
9
+ "project-id": e.project?.projectId ?? e.projectId,
10
+ "proxy-path": t === "" ? "/" : t,
11
+ url: e.project?.url
12
+ };
27
13
  }
28
- function P(i) {
29
- return (() => {
30
- var t = y();
31
- d(t, "zitadel-signout", (e) => i.onSignout?.(e.detail));
32
- var o = i.ref;
33
- return typeof o == "function" ? h(o, t) : i.ref = t, t._$owner = m(), s((e) => {
34
- var a = i.project, n = i.projectId, r = i.proxyPath, l = i.postSignOutUrl, v = i.theme;
35
- return a !== e.e && (t.project = e.e = a), n !== e.t && (t.projectId = e.t = n), r !== e.a && (t.proxyPath = e.a = r), l !== e.o && (t.postSignOutUrl = e.o = l), v !== e.i && (t.theme = e.i = v), e;
36
- }, {
37
- e: void 0,
38
- t: void 0,
39
- a: void 0,
40
- o: void 0,
41
- i: void 0
42
- }), t;
43
- })();
14
+ function u(r) {
15
+ return t(e, n({ get component() {
16
+ return a.login;
17
+ } }, () => i(r, "attr:"), {
18
+ ref(e) {
19
+ var t = r.ref;
20
+ typeof t == "function" ? t(e) : r.ref = e;
21
+ },
22
+ get "prop:project"() {
23
+ return r.project;
24
+ },
25
+ get "prop:locales"() {
26
+ return r.locales;
27
+ },
28
+ get "prop:lang"() {
29
+ return r.lang;
30
+ }
31
+ }, () => l(r), {
32
+ get purpose() {
33
+ return r.purpose ?? "login";
34
+ },
35
+ get "flow-name"() {
36
+ return r.flowName;
37
+ },
38
+ get "post-sign-in-url"() {
39
+ return r.postSignInUrl;
40
+ },
41
+ get "prop:forcePostSignInUrl"() {
42
+ return r.forcePostSignInUrl;
43
+ },
44
+ get "resume-flow-id"() {
45
+ return r.resumeFlowId;
46
+ },
47
+ get variant() {
48
+ return r.variant;
49
+ },
50
+ get theme() {
51
+ return r.theme;
52
+ },
53
+ get "prop:suppressHeader"() {
54
+ return r.suppressHeader;
55
+ },
56
+ get "prop:suppressPasswordToggle"() {
57
+ return r.suppressPasswordToggle;
58
+ },
59
+ "on:zitadel-flow-step": (e) => r.onFlowStep?.(e.detail),
60
+ "on:zitadel-flow-input": (e) => r.onFlowInput?.(e.detail),
61
+ "on:zitadel-flow-complete": (e) => r.onFlowComplete?.(e.detail),
62
+ "on:zitadel-flow-redirect": (e) => r.onFlowRedirect?.(e.detail),
63
+ "on:zitadel-flow-error": (e) => r.onFlowError?.(e.detail)
64
+ }));
44
65
  }
45
- function U(i) {
46
- return (() => {
47
- var t = z();
48
- d(t, "zitadel-signout", (e) => i.onSignout?.(e.detail));
49
- var o = i.ref;
50
- return typeof o == "function" ? h(o, t) : i.ref = t, t._$owner = m(), s((e) => {
51
- var a = i.project, n = i.projectId, r = i.proxyPath, l = i.postSignOutUrl, v = i.heading, u = i.logoutLabel, f = i.variant, g = i.theme, c = i.suppressHeader;
52
- return a !== e.e && (t.project = e.e = a), n !== e.t && (t.projectId = e.t = n), r !== e.a && (t.proxyPath = e.a = r), l !== e.o && (t.postSignOutUrl = e.o = l), v !== e.i && (t.heading = e.i = v), u !== e.n && (t.logoutLabel = e.n = u), f !== e.s && (t.variant = e.s = f), g !== e.h && (t.theme = e.h = g), c !== e.r && (t.suppressHeader = e.r = c), e;
53
- }, {
54
- e: void 0,
55
- t: void 0,
56
- a: void 0,
57
- o: void 0,
58
- i: void 0,
59
- n: void 0,
60
- s: void 0,
61
- h: void 0,
62
- r: void 0
63
- }), t;
64
- })();
66
+ function d(r) {
67
+ return t(e, n({ get component() {
68
+ return a.logout;
69
+ } }, () => i(r, "attr:"), {
70
+ ref(e) {
71
+ var t = r.ref;
72
+ typeof t == "function" ? t(e) : r.ref = e;
73
+ },
74
+ get "prop:project"() {
75
+ return r.project;
76
+ }
77
+ }, () => l(r), {
78
+ get "post-sign-out-url"() {
79
+ return r.postSignOutUrl;
80
+ },
81
+ get theme() {
82
+ return r.theme;
83
+ },
84
+ "on:zitadel-signout": (e) => r.onSignout?.(e.detail)
85
+ }));
65
86
  }
66
- export {
67
- L as ZitadelLogin,
68
- P as ZitadelLogout,
69
- U as ZitadelSession,
70
- F as businessLocales,
71
- b as configureZitadel,
72
- C as getApi,
73
- E as getZitadelConfig
74
- };
87
+ function f(r) {
88
+ return t(e, n({ get component() {
89
+ return a.session;
90
+ } }, () => i(r, "attr:"), {
91
+ ref(e) {
92
+ var t = r.ref;
93
+ typeof t == "function" ? t(e) : r.ref = e;
94
+ },
95
+ get "prop:project"() {
96
+ return r.project;
97
+ }
98
+ }, () => l(r), {
99
+ get "post-sign-out-url"() {
100
+ return r.postSignOutUrl;
101
+ },
102
+ get heading() {
103
+ return r.heading;
104
+ },
105
+ get "logout-label"() {
106
+ return r.logoutLabel;
107
+ },
108
+ get variant() {
109
+ return r.variant;
110
+ },
111
+ get theme() {
112
+ return r.theme;
113
+ },
114
+ get "prop:suppressHeader"() {
115
+ return r.suppressHeader;
116
+ },
117
+ "on:zitadel-signout": (e) => r.onSignout?.(e.detail)
118
+ }));
119
+ }
120
+ //#endregion
121
+ export { u as ZitadelLogin, d as ZitadelLogout, f as ZitadelSession, r as businessLocales, o as configureZitadel, s as getApi, c as getZitadelConfig };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { StandardAttributeProps } from '@zitadel/sdk-core/types';
2
+ import { JSX } from 'solid-js';
1
3
  /**
2
4
  * Re-exports the shared SPA widget types from `@zitadel/sdk-core`.
3
5
  *
@@ -7,4 +9,10 @@
7
9
  * of the browser SDK surface.
8
10
  */
9
11
  export type * from '@zitadel/sdk-core/types';
12
+ /**
13
+ * The standard HTML attributes a widget wrapper accepts besides its own props,
14
+ * and nothing else, so no prop the type accepts is dropped. They are passed to
15
+ * the widget element.
16
+ */
17
+ export type ZitadelWidgetAttributes = StandardAttributeProps<JSX.HTMLAttributes<HTMLElement>>;
10
18
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mBAAmB,yBAAyB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;;;GAOG;AACH,mBAAmB,yBAAyB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zitadel/sdk-solid",
3
- "version": "1.0.0-alpha.24",
3
+ "version": "1.0.0-alpha.28",
4
4
  "description": "Solid components for the Zitadel auth UI (client-side SPA).",
5
5
  "homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-solid#readme",
6
6
  "bugs": {
@@ -26,42 +26,35 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@zitadel/api": "1.0.0-alpha.24",
30
- "@zitadel/components": "1.0.0-alpha.24",
31
- "@zitadel/sdk-core": "1.0.0-alpha.24"
29
+ "@zitadel/api": "1.0.0-alpha.28",
30
+ "@zitadel/components": "1.0.0-alpha.28",
31
+ "@zitadel/sdk-core": "1.0.0-alpha.28"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "solid-js": ">=1.6"
35
35
  },
36
36
  "devDependencies": {
37
- "@eslint/js": "^9.0.0",
38
- "@eslint/json": "^0.11.0",
39
- "@eslint/markdown": "^6.0.0",
37
+ "@edge-runtime/vm": "^5.0.0",
40
38
  "@solidjs/testing-library": "^0.8.10",
41
39
  "@testing-library/jest-dom": "^6.0.0",
42
- "@vitest/coverage-v8": "^3.2.7",
43
- "eslint": "^9.0.0",
44
- "eslint-config-prettier": "^10.0.0",
45
- "eslint-import-resolver-typescript": "^3.7.0",
46
- "eslint-plugin-import": "^2.31.0",
47
- "eslint-plugin-perfectionist": "^4.0.0",
48
- "eslint-plugin-prettier": "^5.0.0",
49
- "eslint-plugin-solid": "^0.14.5",
40
+ "@types/node": "^24.19.1",
41
+ "@vitest/coverage-v8": "^4.1.11",
42
+ "@zitadel/api-mock": "0.0.0",
50
43
  "jsdom": "^29.0.2",
51
- "prettier": "^3.0.0",
52
- "solid-js": "^1.9.12",
44
+ "msw": "^2.14.6",
45
+ "solid-js": "^1.9.16",
53
46
  "typescript": "^6.0.3",
54
- "typescript-eslint": "^8.0.0",
55
- "vite": "^7.3.5",
56
- "vite-plugin-dts": "^4.5.0",
47
+ "vite": "^8.3.1",
48
+ "vite-plugin-dts": "^5.1.2",
57
49
  "vite-plugin-solid": "^2.11.0",
58
- "vitest": "^3.2.7"
50
+ "vitest": "^4.1.11"
59
51
  },
60
52
  "scripts": {
61
53
  "build": "vite build",
62
- "typecheck": "tsc --noEmit -p tsconfig.json",
54
+ "typecheck": "tsc --noEmit -p tsconfig.lib.json && tsc --noEmit -p tsconfig.spec.json",
63
55
  "test": "vitest run",
64
56
  "test:all": "pnpm run test",
65
- "lint": "eslint ."
57
+ "lint": "biome check .",
58
+ "build-release": "node ../../scripts/release-clean.mjs local-dist && pnpm run build"
66
59
  }
67
60
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=test-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}