@ory/elements-react 1.0.0-next.17 → 1.0.0-next.18

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 (61) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/elements-react-client.api.json +144 -16
  3. package/api-report/elements-react-client.api.md +19 -8
  4. package/api-report/elements-react-theme.api.json +47 -0
  5. package/api-report/elements-react-theme.api.md +5 -2
  6. package/api-report/elements-react.api.json +7 -3
  7. package/api-report/elements-react.api.md +4 -2
  8. package/api-report/temp/elements-react-client.api.md +19 -8
  9. package/api-report/temp/elements-react-theme.api.md +5 -2
  10. package/api-report/temp/elements-react.api.md +4 -2
  11. package/dist/client/config.d.mts +21 -0
  12. package/dist/client/config.d.ts +21 -0
  13. package/dist/client/config.js +77 -0
  14. package/dist/client/config.js.map +1 -0
  15. package/dist/client/config.mjs +51 -0
  16. package/dist/client/config.mjs.map +1 -0
  17. package/dist/client/frontendClient.d.mts +3 -1
  18. package/dist/client/frontendClient.d.ts +3 -1
  19. package/dist/client/frontendClient.js +14 -2
  20. package/dist/client/frontendClient.js.map +1 -1
  21. package/dist/client/frontendClient.mjs +14 -2
  22. package/dist/client/frontendClient.mjs.map +1 -1
  23. package/dist/client/index.d.mts +3 -1
  24. package/dist/client/index.d.ts +3 -1
  25. package/dist/client/index.js +4 -0
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/index.mjs +5 -0
  28. package/dist/client/index.mjs.map +1 -1
  29. package/dist/client/session-provider.d.mts +62 -0
  30. package/dist/client/session-provider.d.ts +62 -0
  31. package/dist/client/session-provider.js +96 -0
  32. package/dist/client/session-provider.js.map +1 -0
  33. package/dist/client/session-provider.mjs +71 -0
  34. package/dist/client/session-provider.mjs.map +1 -0
  35. package/dist/client/useSession.d.mts +22 -31
  36. package/dist/client/useSession.d.ts +22 -31
  37. package/dist/client/useSession.js +7 -49
  38. package/dist/client/useSession.js.map +1 -1
  39. package/dist/client/useSession.mjs +8 -49
  40. package/dist/client/useSession.mjs.map +1 -1
  41. package/dist/index.d.mts +5 -4
  42. package/dist/index.d.ts +5 -4
  43. package/dist/index.js +46 -24
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +49 -27
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/theme/default/index.css +358 -251
  48. package/dist/theme/default/index.css.map +1 -1
  49. package/dist/theme/default/index.d.mts +4 -2
  50. package/dist/theme/default/index.d.ts +4 -2
  51. package/dist/theme/default/index.js +605 -531
  52. package/dist/theme/default/index.js.map +1 -1
  53. package/dist/theme/default/index.mjs +536 -463
  54. package/dist/theme/default/index.mjs.map +1 -1
  55. package/jest.config.ts +1 -1
  56. package/package.json +2 -1
  57. package/postcss.config.ts +1 -0
  58. package/tailwind.config.ts +14 -13
  59. package/tsconfig.json +4 -3
  60. package/variables-processed.json +385 -187
  61. package/.eslintrc.js +0 -63
@@ -19,61 +19,19 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var useSession_exports = {};
21
21
  __export(useSession_exports, {
22
- sessionStore: () => sessionStore,
23
22
  useSession: () => useSession
24
23
  });
25
24
  module.exports = __toCommonJS(useSession_exports);
26
25
  var import_react = require("react");
27
- var import_zustand = require("zustand");
28
- var import_middleware = require("zustand/middleware");
29
- var import_frontendClient = require("./frontendClient");
30
- const sessionStore = (0, import_zustand.create)()(
31
- (0, import_middleware.subscribeWithSelector)((set) => ({
32
- isLoading: false,
33
- setIsLoading: (isLoading) => set({ isLoading }),
34
- session: void 0,
35
- setSession: (session) => set({ session }),
36
- error: void 0,
37
- setError: (error) => set({ error })
38
- }))
39
- );
40
- const useSession = (config) => {
41
- const store = (0, import_zustand.useStore)(sessionStore);
42
- const fetchSession = (0, import_react.useCallback)(async () => {
43
- var _a;
44
- const { session, isLoading, setSession, setIsLoading, setError } = sessionStore.getState();
45
- if (!!session || isLoading) {
46
- return;
47
- }
48
- setIsLoading(true);
49
- try {
50
- const sessionData = await (0, import_frontendClient.frontendClient)(
51
- (_a = config == null ? void 0 : config.sdk.url) != null ? _a : window.location.protocol + "//" + window.location.host
52
- ).toSession();
53
- setSession(sessionData);
54
- } catch (e) {
55
- setError(e instanceof Error ? e.message : "Unknown error occurred");
56
- if (!(config == null ? void 0 : config.sdk.url)) {
57
- console.error(
58
- "Could not fetch session. Make sure you have set the SDK URL in the config."
59
- );
60
- }
61
- } finally {
62
- setIsLoading(false);
63
- }
64
- }, [config == null ? void 0 : config.sdk.url]);
65
- (0, import_react.useEffect)(() => {
66
- void fetchSession();
67
- }, [fetchSession]);
68
- return {
69
- session: store.session,
70
- error: store.error,
71
- isLoading: store.isLoading
72
- };
73
- };
26
+ var import_session_provider = require("./session-provider");
27
+ function useSession() {
28
+ if (!import_session_provider.SessionContext) {
29
+ throw new Error("[Ory/Elements] useSession must be used on the client");
30
+ }
31
+ return (0, import_react.useContext)(import_session_provider.SessionContext);
32
+ }
74
33
  // Annotate the CommonJS export names for ESM import in node:
75
34
  0 && (module.exports = {
76
- sessionStore,
77
35
  useSession
78
36
  });
79
37
  //# sourceMappingURL=useSession.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/useSession.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\n\nimport { Session } from \"@ory/client-fetch\"\nimport { useCallback, useEffect } from \"react\"\nimport { create, useStore } from \"zustand\"\nimport { subscribeWithSelector } from \"zustand/middleware\"\nimport { frontendClient } from \"./frontendClient\"\n\ntype SessionStore = {\n setIsLoading: (loading: boolean) => void\n setSession: (session: Session) => void\n isLoading: boolean\n session: Session | undefined\n error: string | undefined\n setError: (error: string | undefined) => void\n}\n\nexport const sessionStore = create<SessionStore>()(\n subscribeWithSelector((set) => ({\n isLoading: false,\n setIsLoading: (isLoading: boolean) => set({ isLoading }),\n session: undefined,\n setSession: (session: Session) => set({ session }),\n error: undefined,\n setError: (error: string | undefined) => set({ error }),\n })),\n)\n\n/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const { session, error, isLoading } = useSession()\n * ```\n *\n * @returns The current session, error and loading state.\n */\nexport const useSession = (config?: { sdk: { url: string } }) => {\n const store = useStore(sessionStore)\n\n const fetchSession = useCallback(async () => {\n const { session, isLoading, setSession, setIsLoading, setError } =\n sessionStore.getState()\n\n if (!!session || isLoading) {\n return\n }\n\n setIsLoading(true)\n\n try {\n const sessionData = await frontendClient(\n config?.sdk.url ??\n window.location.protocol + \"//\" + window.location.host,\n ).toSession()\n setSession(sessionData)\n } catch (e) {\n setError(e instanceof Error ? e.message : \"Unknown error occurred\")\n if (!config?.sdk.url) {\n console.error(\n \"Could not fetch session. Make sure you have set the SDK URL in the config.\",\n )\n }\n } finally {\n setIsLoading(false)\n }\n }, [config?.sdk.url])\n\n useEffect(() => {\n void fetchSession()\n }, [fetchSession])\n\n return {\n session: store.session,\n error: store.error,\n isLoading: store.isLoading,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAAuC;AACvC,qBAAiC;AACjC,wBAAsC;AACtC,4BAA+B;AAWxB,MAAM,mBAAe,uBAAqB;AAAA,MAC/C,yCAAsB,CAAC,SAAS;AAAA,IAC9B,WAAW;AAAA,IACX,cAAc,CAAC,cAAuB,IAAI,EAAE,UAAU,CAAC;AAAA,IACvD,SAAS;AAAA,IACT,YAAY,CAAC,YAAqB,IAAI,EAAE,QAAQ,CAAC;AAAA,IACjD,OAAO;AAAA,IACP,UAAU,CAAC,UAA8B,IAAI,EAAE,MAAM,CAAC;AAAA,EACxD,EAAE;AACJ;AAYO,MAAM,aAAa,CAAC,WAAsC;AAC/D,QAAM,YAAQ,yBAAS,YAAY;AAEnC,QAAM,mBAAe,0BAAY,YAAY;AA3C/C;AA4CI,UAAM,EAAE,SAAS,WAAW,YAAY,cAAc,SAAS,IAC7D,aAAa,SAAS;AAExB,QAAI,CAAC,CAAC,WAAW,WAAW;AAC1B;AAAA,IACF;AAEA,iBAAa,IAAI;AAEjB,QAAI;AACF,YAAM,cAAc,UAAM;AAAA,SACxB,sCAAQ,IAAI,QAAZ,YACE,OAAO,SAAS,WAAW,OAAO,OAAO,SAAS;AAAA,MACtD,EAAE,UAAU;AACZ,iBAAW,WAAW;AAAA,IACxB,SAAS,GAAG;AACV,eAAS,aAAa,QAAQ,EAAE,UAAU,wBAAwB;AAClE,UAAI,EAAC,iCAAQ,IAAI,MAAK;AACpB,gBAAQ;AAAA,UACN;AAAA,QACF;AAAA,MACF;AAAA,IACF,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,iCAAQ,IAAI,GAAG,CAAC;AAEpB,8BAAU,MAAM;AACd,SAAK,aAAa;AAAA,EACpB,GAAG,CAAC,YAAY,CAAC;AAEjB,SAAO;AAAA,IACL,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,IACb,WAAW,MAAM;AAAA,EACnB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/client/useSession.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\n\nimport { useContext } from \"react\"\nimport { SessionContext } from \"./session-provider\"\n\n/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const session = useSession()\n *\n * if (session.state == \"loading\") {\n * return <div>Loading...</div>\n * }\n *\n * if (session.state == \"authenticated\") {\n * return <div>Session: {session.session.id}</div>\n * }\n * ```\n *\n * :::note\n * This is a client-side hook and must be used within a React component.\n * On the server, you can use the getServerSession function from `@ory/nextjs`\n * and hydrate SessionProvider with the session.\n * :::\n *\n * @returns The current session, and error or loading state.\n */\n\nexport function useSession() {\n if (!SessionContext) {\n throw new Error(\"[Ory/Elements] useSession must be used on the client\")\n }\n return useContext(SessionContext)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAA2B;AAC3B,8BAA+B;AA2BxB,SAAS,aAAa;AAC3B,MAAI,CAAC,wCAAgB;AACnB,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AACA,aAAO,yBAAW,sCAAc;AAClC;","names":[]}
@@ -1,54 +1,13 @@
1
1
  "use client";
2
- import { useCallback, useEffect } from "react";
3
- import { create, useStore } from "zustand";
4
- import { subscribeWithSelector } from "zustand/middleware";
5
- import { frontendClient } from "./frontendClient";
6
- const sessionStore = create()(
7
- subscribeWithSelector((set) => ({
8
- isLoading: false,
9
- setIsLoading: (isLoading) => set({ isLoading }),
10
- session: void 0,
11
- setSession: (session) => set({ session }),
12
- error: void 0,
13
- setError: (error) => set({ error })
14
- }))
15
- );
16
- const useSession = (config) => {
17
- const store = useStore(sessionStore);
18
- const fetchSession = useCallback(async () => {
19
- var _a;
20
- const { session, isLoading, setSession, setIsLoading, setError } = sessionStore.getState();
21
- if (!!session || isLoading) {
22
- return;
23
- }
24
- setIsLoading(true);
25
- try {
26
- const sessionData = await frontendClient(
27
- (_a = config == null ? void 0 : config.sdk.url) != null ? _a : window.location.protocol + "//" + window.location.host
28
- ).toSession();
29
- setSession(sessionData);
30
- } catch (e) {
31
- setError(e instanceof Error ? e.message : "Unknown error occurred");
32
- if (!(config == null ? void 0 : config.sdk.url)) {
33
- console.error(
34
- "Could not fetch session. Make sure you have set the SDK URL in the config."
35
- );
36
- }
37
- } finally {
38
- setIsLoading(false);
39
- }
40
- }, [config == null ? void 0 : config.sdk.url]);
41
- useEffect(() => {
42
- void fetchSession();
43
- }, [fetchSession]);
44
- return {
45
- session: store.session,
46
- error: store.error,
47
- isLoading: store.isLoading
48
- };
49
- };
2
+ import { useContext } from "react";
3
+ import { SessionContext } from "./session-provider";
4
+ function useSession() {
5
+ if (!SessionContext) {
6
+ throw new Error("[Ory/Elements] useSession must be used on the client");
7
+ }
8
+ return useContext(SessionContext);
9
+ }
50
10
  export {
51
- sessionStore,
52
11
  useSession
53
12
  };
54
13
  //# sourceMappingURL=useSession.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/useSession.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\n\nimport { Session } from \"@ory/client-fetch\"\nimport { useCallback, useEffect } from \"react\"\nimport { create, useStore } from \"zustand\"\nimport { subscribeWithSelector } from \"zustand/middleware\"\nimport { frontendClient } from \"./frontendClient\"\n\ntype SessionStore = {\n setIsLoading: (loading: boolean) => void\n setSession: (session: Session) => void\n isLoading: boolean\n session: Session | undefined\n error: string | undefined\n setError: (error: string | undefined) => void\n}\n\nexport const sessionStore = create<SessionStore>()(\n subscribeWithSelector((set) => ({\n isLoading: false,\n setIsLoading: (isLoading: boolean) => set({ isLoading }),\n session: undefined,\n setSession: (session: Session) => set({ session }),\n error: undefined,\n setError: (error: string | undefined) => set({ error }),\n })),\n)\n\n/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const { session, error, isLoading } = useSession()\n * ```\n *\n * @returns The current session, error and loading state.\n */\nexport const useSession = (config?: { sdk: { url: string } }) => {\n const store = useStore(sessionStore)\n\n const fetchSession = useCallback(async () => {\n const { session, isLoading, setSession, setIsLoading, setError } =\n sessionStore.getState()\n\n if (!!session || isLoading) {\n return\n }\n\n setIsLoading(true)\n\n try {\n const sessionData = await frontendClient(\n config?.sdk.url ??\n window.location.protocol + \"//\" + window.location.host,\n ).toSession()\n setSession(sessionData)\n } catch (e) {\n setError(e instanceof Error ? e.message : \"Unknown error occurred\")\n if (!config?.sdk.url) {\n console.error(\n \"Could not fetch session. Make sure you have set the SDK URL in the config.\",\n )\n }\n } finally {\n setIsLoading(false)\n }\n }, [config?.sdk.url])\n\n useEffect(() => {\n void fetchSession()\n }, [fetchSession])\n\n return {\n session: store.session,\n error: store.error,\n isLoading: store.isLoading,\n }\n}\n"],"mappings":";AAKA,SAAS,aAAa,iBAAiB;AACvC,SAAS,QAAQ,gBAAgB;AACjC,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAWxB,MAAM,eAAe,OAAqB;AAAA,EAC/C,sBAAsB,CAAC,SAAS;AAAA,IAC9B,WAAW;AAAA,IACX,cAAc,CAAC,cAAuB,IAAI,EAAE,UAAU,CAAC;AAAA,IACvD,SAAS;AAAA,IACT,YAAY,CAAC,YAAqB,IAAI,EAAE,QAAQ,CAAC;AAAA,IACjD,OAAO;AAAA,IACP,UAAU,CAAC,UAA8B,IAAI,EAAE,MAAM,CAAC;AAAA,EACxD,EAAE;AACJ;AAYO,MAAM,aAAa,CAAC,WAAsC;AAC/D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,eAAe,YAAY,YAAY;AA3C/C;AA4CI,UAAM,EAAE,SAAS,WAAW,YAAY,cAAc,SAAS,IAC7D,aAAa,SAAS;AAExB,QAAI,CAAC,CAAC,WAAW,WAAW;AAC1B;AAAA,IACF;AAEA,iBAAa,IAAI;AAEjB,QAAI;AACF,YAAM,cAAc,MAAM;AAAA,SACxB,sCAAQ,IAAI,QAAZ,YACE,OAAO,SAAS,WAAW,OAAO,OAAO,SAAS;AAAA,MACtD,EAAE,UAAU;AACZ,iBAAW,WAAW;AAAA,IACxB,SAAS,GAAG;AACV,eAAS,aAAa,QAAQ,EAAE,UAAU,wBAAwB;AAClE,UAAI,EAAC,iCAAQ,IAAI,MAAK;AACpB,gBAAQ;AAAA,UACN;AAAA,QACF;AAAA,MACF;AAAA,IACF,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,iCAAQ,IAAI,GAAG,CAAC;AAEpB,YAAU,MAAM;AACd,SAAK,aAAa;AAAA,EACpB,GAAG,CAAC,YAAY,CAAC;AAEjB,SAAO;AAAA,IACL,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,IACb,WAAW,MAAM;AAAA,EACnB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/client/useSession.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\n\nimport { useContext } from \"react\"\nimport { SessionContext } from \"./session-provider\"\n\n/**\n * A hook to get the current session from the Ory Network.\n *\n * Usage:\n * ```ts\n * const session = useSession()\n *\n * if (session.state == \"loading\") {\n * return <div>Loading...</div>\n * }\n *\n * if (session.state == \"authenticated\") {\n * return <div>Session: {session.session.id}</div>\n * }\n * ```\n *\n * :::note\n * This is a client-side hook and must be used within a React component.\n * On the server, you can use the getServerSession function from `@ory/nextjs`\n * and hydrate SessionProvider with the session.\n * :::\n *\n * @returns The current session, and error or loading state.\n */\n\nexport function useSession() {\n if (!SessionContext) {\n throw new Error(\"[Ory/Elements] useSession must be used on the client\")\n }\n return useContext(SessionContext)\n}\n"],"mappings":";AAIA,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AA2BxB,SAAS,aAAa;AAC3B,MAAI,CAAC,gBAAgB;AACnB,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AACA,SAAO,WAAW,cAAc;AAClC;","names":[]}
package/dist/index.d.mts CHANGED
@@ -7,8 +7,7 @@ import { IntlShape } from 'react-intl';
7
7
 
8
8
  declare const buttonStyles: (props?: ({
9
9
  intent?: "primary" | "secondary" | null | undefined;
10
- size?: "default" | "large" | null | undefined;
11
- defaultVariants?: "intent" | "size" | null | undefined;
10
+ defaultVariants?: "intent" | null | undefined;
12
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
12
  type ButtonVariants = VariantProps<typeof buttonStyles>;
14
13
 
@@ -57,7 +56,9 @@ type OryFormSectionContentProps = PropsWithChildren<{
57
56
  title?: string;
58
57
  description?: string;
59
58
  }>;
60
- type OryFormSectionFooterProps = PropsWithChildren;
59
+ type OryFormSectionFooterProps = PropsWithChildren<{
60
+ text?: string;
61
+ }>;
61
62
 
62
63
  type OryCardHeaderProps = Record<string, never>;
63
64
  declare function OryCardHeader(): react_jsx_runtime.JSX.Element;
@@ -266,7 +267,7 @@ type OryFlowComponents = {
266
267
  /**
267
268
  * The SettingsSectionFooter component is rendered around the footer of each section of the settings.
268
269
  */
269
- SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
270
+ SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
270
271
  };
271
272
  Form: {
272
273
  /**
package/dist/index.d.ts CHANGED
@@ -7,8 +7,7 @@ import { IntlShape } from 'react-intl';
7
7
 
8
8
  declare const buttonStyles: (props?: ({
9
9
  intent?: "primary" | "secondary" | null | undefined;
10
- size?: "default" | "large" | null | undefined;
11
- defaultVariants?: "intent" | "size" | null | undefined;
10
+ defaultVariants?: "intent" | null | undefined;
12
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
12
  type ButtonVariants = VariantProps<typeof buttonStyles>;
14
13
 
@@ -57,7 +56,9 @@ type OryFormSectionContentProps = PropsWithChildren<{
57
56
  title?: string;
58
57
  description?: string;
59
58
  }>;
60
- type OryFormSectionFooterProps = PropsWithChildren;
59
+ type OryFormSectionFooterProps = PropsWithChildren<{
60
+ text?: string;
61
+ }>;
61
62
 
62
63
  type OryCardHeaderProps = Record<string, never>;
63
64
  declare function OryCardHeader(): react_jsx_runtime.JSX.Element;
@@ -266,7 +267,7 @@ type OryFlowComponents = {
266
267
  /**
267
268
  * The SettingsSectionFooter component is rendered around the footer of each section of the settings.
268
269
  */
269
- SettingsSectionFooter: ComponentType<OryFormSectionContentProps>;
270
+ SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>;
270
271
  };
271
272
  Form: {
272
273
  /**
package/dist/index.js CHANGED
@@ -2259,7 +2259,8 @@ async function onSubmitLogin({ config, flow }, {
2259
2259
  updateLoginFlowBody: body
2260
2260
  }).then(() => {
2261
2261
  var _a2;
2262
- window.location.href = (_a2 = flow.return_to) != null ? _a2 : config.sdk.url + "/self-service/login/browser";
2262
+ window.location.href = // eslint-disable-next-line promise/always-return
2263
+ (_a2 = flow.return_to) != null ? _a2 : config.sdk.url + "/self-service/login/browser";
2263
2264
  }).catch(
2264
2265
  clientFetch.handleFlowError({
2265
2266
  onRestartFlow: () => {
@@ -2467,6 +2468,9 @@ function computeDefaultValues(nodes) {
2467
2468
  return nodes.reduce((acc, node) => {
2468
2469
  const attrs = node.attributes;
2469
2470
  if (clientFetch.isUiNodeInputAttributes(attrs)) {
2471
+ if (attrs.type === "checkbox" && typeof attrs.value === "undefined") {
2472
+ attrs.value = false;
2473
+ }
2470
2474
  if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
2471
2475
  return acc;
2472
2476
  }
@@ -2519,19 +2523,19 @@ function triggerToWindowCall(trigger) {
2519
2523
  }
2520
2524
  function triggerToFunction(trigger) {
2521
2525
  if (typeof window === "undefined") {
2522
- console.error(
2526
+ console.debug(
2523
2527
  "The Ory SDK is missing a required function: window is undefined."
2524
2528
  );
2525
2529
  return void 0;
2526
2530
  }
2527
2531
  const typedWindow = window;
2528
2532
  if (!(trigger in typedWindow) || !typedWindow[trigger]) {
2529
- console.error(`The Ory SDK is missing a required function: ${trigger}.`);
2533
+ console.debug(`The Ory SDK is missing a required function: ${trigger}.`);
2530
2534
  return void 0;
2531
2535
  }
2532
2536
  const triggerFn = typedWindow[trigger];
2533
2537
  if (typeof triggerFn !== "function") {
2534
- console.error(
2538
+ console.debug(
2535
2539
  `The Ory SDK is missing a required function: ${trigger}. It is not a function.`
2536
2540
  );
2537
2541
  return void 0;
@@ -3105,7 +3109,12 @@ function OrySettingsOidc({ nodes }) {
3105
3109
  )
3106
3110
  }
3107
3111
  ),
3108
- /* @__PURE__ */ jsxRuntime.jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: intl.formatMessage({ id: "settings.oidc.info" }) }) })
3112
+ /* @__PURE__ */ jsxRuntime.jsx(
3113
+ Card.SettingsSectionFooter,
3114
+ {
3115
+ text: intl.formatMessage({ id: "settings.oidc.info" })
3116
+ }
3117
+ )
3109
3118
  ] });
3110
3119
  }
3111
3120
  var getTriggerNode = (nodes) => nodes.find(
@@ -3162,7 +3171,12 @@ function OrySettingsPasskey({ nodes }) {
3162
3171
  ]
3163
3172
  }
3164
3173
  ),
3165
- /* @__PURE__ */ jsxRuntime.jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: intl.formatMessage({ id: "settings.passkey.info" }) }) })
3174
+ /* @__PURE__ */ jsxRuntime.jsx(
3175
+ Card.SettingsSectionFooter,
3176
+ {
3177
+ text: intl.formatMessage({ id: "settings.passkey.info" })
3178
+ }
3179
+ )
3166
3180
  ] });
3167
3181
  }
3168
3182
  var getRegenerateNode = (nodes) => nodes.find(
@@ -3247,16 +3261,19 @@ function OrySettingsTotp({ nodes }) {
3247
3261
  children: content
3248
3262
  }
3249
3263
  ),
3250
- /* @__PURE__ */ jsxRuntime.jsxs(Card.SettingsSectionFooter, { children: [
3251
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: totpUnlink ? intl.formatMessage({ id: "settings.totp.info.linked" }) : intl.formatMessage({ id: "settings.totp.info.not-linked" }) }),
3252
- totpLinkButton && /* @__PURE__ */ jsxRuntime.jsx(
3253
- Node2.Button,
3254
- {
3255
- node: totpLinkButton,
3256
- attributes: totpLinkButton.attributes
3257
- }
3258
- )
3259
- ] })
3264
+ /* @__PURE__ */ jsxRuntime.jsx(
3265
+ Card.SettingsSectionFooter,
3266
+ {
3267
+ text: totpUnlink ? intl.formatMessage({ id: "settings.totp.info.linked" }) : intl.formatMessage({ id: "settings.totp.info.not-linked" }),
3268
+ children: totpLinkButton && /* @__PURE__ */ jsxRuntime.jsx(
3269
+ Node2.Button,
3270
+ {
3271
+ node: totpLinkButton,
3272
+ attributes: totpLinkButton.attributes
3273
+ }
3274
+ )
3275
+ }
3276
+ )
3260
3277
  ] });
3261
3278
  }
3262
3279
  var getInputNode = (nodes) => nodes.find(
@@ -3268,9 +3285,6 @@ var getTriggerNode2 = (nodes) => nodes.find(
3268
3285
  var getRemoveButtons = (nodes) => nodes.filter(
3269
3286
  (node) => "name" in node.attributes && node.attributes.name === "webauthn_remove"
3270
3287
  );
3271
- var getScriptNode = (nodes) => nodes.find(
3272
- (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
3273
- );
3274
3288
  var getRegisterNode = (nodes) => nodes.find(
3275
3289
  (node) => "name" in node.attributes && node.attributes.name === "webauthn_register"
3276
3290
  );
@@ -3283,7 +3297,6 @@ function OrySettingsWebauthn({ nodes }) {
3283
3297
  const triggerButton = getTriggerNode2(nodes);
3284
3298
  const inputNode = getInputNode(nodes);
3285
3299
  const removeButtons = getRemoveButtons(nodes);
3286
- const scriptNode = getScriptNode(nodes);
3287
3300
  const registerNode = getRegisterNode(nodes);
3288
3301
  if (!inputNode || !triggerButton) {
3289
3302
  return null;
@@ -3306,8 +3319,6 @@ function OrySettingsWebauthn({ nodes }) {
3306
3319
  }),
3307
3320
  children: [
3308
3321
  (_a = groups.default) == null ? void 0 : _a.map((node, i) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, `webauthn-default-${i}`)),
3309
- scriptNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: scriptNode }),
3310
- registerNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: registerNode }),
3311
3322
  /* @__PURE__ */ jsxRuntime.jsx(
3312
3323
  Form.WebauthnSettings,
3313
3324
  {
@@ -3319,11 +3330,17 @@ function OrySettingsWebauthn({ nodes }) {
3319
3330
  },
3320
3331
  removeButtons
3321
3332
  }
3322
- )
3333
+ ),
3334
+ registerNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: registerNode })
3323
3335
  ]
3324
3336
  }
3325
3337
  ),
3326
- /* @__PURE__ */ jsxRuntime.jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: intl.formatMessage({ id: "settings.webauthn.info" }) }) })
3338
+ /* @__PURE__ */ jsxRuntime.jsx(
3339
+ Card.SettingsSectionFooter,
3340
+ {
3341
+ text: intl.formatMessage({ id: "settings.webauthn.info" })
3342
+ }
3343
+ )
3327
3344
  ] });
3328
3345
  }
3329
3346
  function SettingsSectionContent({ group, nodes }) {
@@ -3375,11 +3392,16 @@ function SettingsSectionContent({ group, nodes }) {
3375
3392
  ).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)) })
3376
3393
  ] });
3377
3394
  }
3395
+ var getScriptNode = (nodes) => nodes.find(
3396
+ (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
3397
+ );
3378
3398
  function OrySettingsCard() {
3379
3399
  const { flow } = useOryFlow();
3380
3400
  const uniqueGroups = useNodesGroups(flow.ui.nodes);
3401
+ const scriptNode = getScriptNode(flow.ui.nodes);
3381
3402
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3382
3403
  /* @__PURE__ */ jsxRuntime.jsx(OryCardValidationMessages, {}),
3404
+ scriptNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: scriptNode }),
3383
3405
  uniqueGroups.entries.map(([group, nodes]) => {
3384
3406
  if (group === clientFetch.UiNodeGroupEnum.Default) {
3385
3407
  return null;