@ory/elements-react 0.0.0-pr.3a98de9 → 0.0.0-pr.6b3fe62

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/CHANGELOG.md CHANGED
@@ -1,3 +1,101 @@
1
+ ## 1.0.0-next.43 (2025-04-10)
2
+
3
+ ### 🚀 Features
4
+
5
+ - add missing French translations ([#401](https://github.com/ory/elements/pull/401))
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - two-step registration back button ([#428](https://github.com/ory/elements/pull/428))
10
+ - resolve wcag2aa color contrast issues ([#367](https://github.com/ory/elements/pull/367))
11
+
12
+ ### ❤️ Thank You
13
+
14
+ - hackerman @aeneasr
15
+ - Jonas Hungershausen
16
+ - Jordan Labrosse
17
+
18
+ ## 1.0.0-next.41 (2025-04-07)
19
+
20
+ ### 🩹 Fixes
21
+
22
+ - resolve wcag2aa color contrast issues ([#367](https://github.com/ory/elements/pull/367))
23
+
24
+ ### ❤️ Thank You
25
+
26
+ - Jonas Hungershausen
27
+ - Jordan Labrosse
28
+
29
+ ## 1.0.0-next.40 (2025-04-02)
30
+
31
+ ### 🚀 Features
32
+
33
+ - support SAML-native ([#395](https://github.com/ory/elements/pull/395))
34
+
35
+ ### ❤️ Thank You
36
+
37
+ - hackerman @aeneasr
38
+
39
+ ## 1.0.0-next.39 (2025-03-25)
40
+
41
+ ### 🚀 Features
42
+
43
+ - add SAML group handling ([#390](https://github.com/ory/elements/pull/390))
44
+
45
+ ### ❤️ Thank You
46
+
47
+ - hackerman @aeneasr
48
+
49
+ ## 1.0.0-next.38 (2025-03-24)
50
+
51
+ ### 🩹 Fixes
52
+
53
+ - hide registration link again ([#387](https://github.com/ory/elements/pull/387))
54
+
55
+ ### ❤️ Thank You
56
+
57
+ - hackerman @aeneasr
58
+
59
+ ## 1.0.0-next.37 (2025-03-12)
60
+
61
+ ### 🩹 Fixes
62
+
63
+ - correctly render test id for error card ([#386](https://github.com/ory/elements/pull/386))
64
+
65
+ ### ❤️ Thank You
66
+
67
+ - Jonas Hungershausen
68
+
69
+ ## 1.0.0-next.36 (2025-03-12)
70
+
71
+ ### 🩹 Fixes
72
+
73
+ - handle error messages for selected methods ([#385](https://github.com/ory/elements/pull/385))
74
+
75
+ ### ❤️ Thank You
76
+
77
+ - Pierre Caillaud @pcaillaudm
78
+
79
+ ## 1.0.0-next.35 (2025-03-12)
80
+
81
+ ### 🚀 Features
82
+
83
+ - add more intelligent error screen ([#383](https://github.com/ory/elements/pull/383))
84
+
85
+ ### ❤️ Thank You
86
+
87
+ - Jonas Hungershausen
88
+
89
+ ## 1.0.0-next.34 (2025-03-12)
90
+
91
+ ### 🩹 Fixes
92
+
93
+ - use correct import paths ([#384](https://github.com/ory/elements/pull/384))
94
+
95
+ ### ❤️ Thank You
96
+
97
+ - hackerman @aeneasr
98
+
1
99
  ## 1.0.0-next.33 (2025-03-07)
2
100
 
3
101
  ### 🚀 Features
@@ -1,7 +1,10 @@
1
- import { ConfigurationParameters, FrontendApi } from '@ory/client-fetch';
1
+ import { ConfigurationParameters, FrontendApi, OAuth2Api } from '@ory/client-fetch';
2
2
 
3
3
  declare function frontendClient({ forceBaseUrl, ...opts }?: Partial<ConfigurationParameters & {
4
4
  forceBaseUrl?: string;
5
5
  }>): FrontendApi;
6
+ declare function oauth2Client({ forceBaseUrl, ...opts }?: Partial<ConfigurationParameters & {
7
+ forceBaseUrl?: string;
8
+ }>): OAuth2Api;
6
9
 
7
- export { frontendClient };
10
+ export { frontendClient, oauth2Client };
@@ -1,7 +1,10 @@
1
- import { ConfigurationParameters, FrontendApi } from '@ory/client-fetch';
1
+ import { ConfigurationParameters, FrontendApi, OAuth2Api } from '@ory/client-fetch';
2
2
 
3
3
  declare function frontendClient({ forceBaseUrl, ...opts }?: Partial<ConfigurationParameters & {
4
4
  forceBaseUrl?: string;
5
5
  }>): FrontendApi;
6
+ declare function oauth2Client({ forceBaseUrl, ...opts }?: Partial<ConfigurationParameters & {
7
+ forceBaseUrl?: string;
8
+ }>): OAuth2Api;
6
9
 
7
- export { frontendClient };
10
+ export { frontendClient, oauth2Client };
@@ -19,7 +19,8 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var frontendClient_exports = {};
21
21
  __export(frontendClient_exports, {
22
- frontendClient: () => frontendClient
22
+ frontendClient: () => frontendClient,
23
+ oauth2Client: () => oauth2Client
23
24
  });
24
25
  module.exports = __toCommonJS(frontendClient_exports);
25
26
  var import_client_fetch = require("@ory/client-fetch");
@@ -45,8 +46,30 @@ function frontendClient({
45
46
  });
46
47
  return new import_client_fetch.FrontendApi(config);
47
48
  }
49
+ function oauth2Client({
50
+ forceBaseUrl,
51
+ ...opts
52
+ } = {
53
+ credentials: "include"
54
+ }) {
55
+ var _a;
56
+ const basePath = forceBaseUrl != null ? forceBaseUrl : (0, import_config.guessPotentiallyProxiedOrySdkUrl)({
57
+ knownProxiedUrl: window.location.origin
58
+ });
59
+ const config = new import_client_fetch.Configuration({
60
+ ...opts,
61
+ basePath: basePath == null ? void 0 : basePath.replace(/\/$/, ""),
62
+ credentials: (_a = opts.credentials) != null ? _a : "include",
63
+ headers: {
64
+ Accept: "application/json",
65
+ ...opts.headers
66
+ }
67
+ });
68
+ return new import_client_fetch.OAuth2Api(config);
69
+ }
48
70
  // Annotate the CommonJS export names for ESM import in node:
49
71
  0 && (module.exports = {
50
- frontendClient
72
+ frontendClient,
73
+ oauth2Client
51
74
  });
52
75
  //# sourceMappingURL=frontendClient.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/frontendClient.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n} from \"@ory/client-fetch\"\nimport { guessPotentiallyProxiedOrySdkUrl } from \"./config\"\n\nexport function frontendClient(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAIO;AACP,oBAAiD;AAE1C,SAAS,eACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AAjBF;AAkBE,QAAM,WACJ,0CACA,gDAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,kCAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,gCAAY,MAAM;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/client/frontendClient.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n OAuth2Api,\n} from \"@ory/client-fetch\"\nimport { guessPotentiallyProxiedOrySdkUrl } from \"./config\"\n\nexport function frontendClient(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n\nexport function oauth2Client(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new OAuth2Api(config)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAKO;AACP,oBAAiD;AAE1C,SAAS,eACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AAlBF;AAmBE,QAAM,WACJ,0CACA,gDAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,kCAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,gCAAY,MAAM;AAC/B;AAEO,SAAS,aACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AA5CF;AA6CE,QAAM,WACJ,0CACA,gDAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,kCAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,8BAAU,MAAM;AAC7B;","names":[]}
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  Configuration,
4
- FrontendApi
4
+ FrontendApi,
5
+ OAuth2Api
5
6
  } from "@ory/client-fetch";
6
7
  import { guessPotentiallyProxiedOrySdkUrl } from "./config";
7
8
  function frontendClient({
@@ -25,7 +26,29 @@ function frontendClient({
25
26
  });
26
27
  return new FrontendApi(config);
27
28
  }
29
+ function oauth2Client({
30
+ forceBaseUrl,
31
+ ...opts
32
+ } = {
33
+ credentials: "include"
34
+ }) {
35
+ var _a;
36
+ const basePath = forceBaseUrl != null ? forceBaseUrl : guessPotentiallyProxiedOrySdkUrl({
37
+ knownProxiedUrl: window.location.origin
38
+ });
39
+ const config = new Configuration({
40
+ ...opts,
41
+ basePath: basePath == null ? void 0 : basePath.replace(/\/$/, ""),
42
+ credentials: (_a = opts.credentials) != null ? _a : "include",
43
+ headers: {
44
+ Accept: "application/json",
45
+ ...opts.headers
46
+ }
47
+ });
48
+ return new OAuth2Api(config);
49
+ }
28
50
  export {
29
- frontendClient
51
+ frontendClient,
52
+ oauth2Client
30
53
  };
31
54
  //# sourceMappingURL=frontendClient.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/frontendClient.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n} from \"@ory/client-fetch\"\nimport { guessPotentiallyProxiedOrySdkUrl } from \"./config\"\n\nexport function frontendClient(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,wCAAwC;AAE1C,SAAS,eACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AAjBF;AAkBE,QAAM,WACJ,sCACA,iCAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,cAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,YAAY,MAAM;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/client/frontendClient.ts"],"sourcesContent":["// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\"use client\"\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n OAuth2Api,\n} from \"@ory/client-fetch\"\nimport { guessPotentiallyProxiedOrySdkUrl } from \"./config\"\n\nexport function frontendClient(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n\nexport function oauth2Client(\n {\n forceBaseUrl,\n ...opts\n }: Partial<ConfigurationParameters & { forceBaseUrl?: string }> = {\n credentials: \"include\",\n },\n) {\n const basePath =\n forceBaseUrl ??\n guessPotentiallyProxiedOrySdkUrl({\n knownProxiedUrl: window.location.origin,\n })\n\n const config = new Configuration({\n ...opts,\n basePath: basePath?.replace(/\\/$/, \"\"),\n credentials: opts.credentials ?? \"include\",\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new OAuth2Api(config)\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wCAAwC;AAE1C,SAAS,eACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AAlBF;AAmBE,QAAM,WACJ,sCACA,iCAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,cAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,YAAY,MAAM;AAC/B;AAEO,SAAS,aACd;AAAA,EACE;AAAA,EACA,GAAG;AACL,IAAkE;AAAA,EAChE,aAAa;AACf,GACA;AA5CF;AA6CE,QAAM,WACJ,sCACA,iCAAiC;AAAA,IAC/B,iBAAiB,OAAO,SAAS;AAAA,EACnC,CAAC;AAEH,QAAM,SAAS,IAAI,cAAc;AAAA,IAC/B,GAAG;AAAA,IACH,UAAU,qCAAU,QAAQ,OAAO;AAAA,IACnC,cAAa,UAAK,gBAAL,YAAoB;AAAA,IACjC,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,IAAI,UAAU,MAAM;AAC7B;","names":[]}
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var client_exports = {};
21
- __export(client_exports, {
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
22
  SessionProvider: () => import_session_provider.SessionProvider,
23
23
  useSession: () => import_useSession.useSession
24
24
  });
25
- module.exports = __toCommonJS(client_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_session_provider = require("./session-provider");
27
27
  var import_useSession = require("./useSession");
28
28
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
1
+ import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
2
2
  import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
3
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
4
  import { VariantProps } from 'class-variance-authority';
@@ -53,12 +53,18 @@ type OryNodeImageProps = {
53
53
  type FormValues = Record<string, string | boolean | number | undefined>;
54
54
  type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
55
55
  onSubmit: FormEventHandler<HTMLFormElement>;
56
+ "data-testid"?: string;
56
57
  };
57
58
  type OryNodeInputProps = {
58
59
  attributes: UiNodeInputAttributes;
59
60
  node: UiNode;
60
61
  onClick?: MouseEventHandler;
61
62
  };
63
+ type OryNodeConsentScopeCheckboxProps = {
64
+ attributes: UiNodeInputAttributes;
65
+ node: UiNode;
66
+ onCheckedChange: (checked: boolean) => void;
67
+ };
62
68
  type OryFormSectionContentProps = PropsWithChildren<{
63
69
  title?: string;
64
70
  description?: string;
@@ -105,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
105
111
 
106
112
  declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
107
113
 
114
+ declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
115
+
108
116
  /**
109
117
  * Props type for the Form Group Divider component.
110
118
  */
@@ -248,6 +256,10 @@ type OryFlowComponents = {
248
256
  * The Captcha component is rendered whenever a "captcha" group is encountered.
249
257
  */
250
258
  Captcha: ComponentType<OryNodeCaptchaProps>;
259
+ /**
260
+ * Special version of the Input component for scopes in OAuth2 flows.
261
+ */
262
+ ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
251
263
  };
252
264
  Card: {
253
265
  /**
@@ -363,8 +375,9 @@ type DeepPartialTwoLevels<T> = {
363
375
  type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
364
376
  type OryFormProps = PropsWithChildren<{
365
377
  onAfterSubmit?: (method: string | number | boolean | undefined) => void;
378
+ "data-testid"?: string;
366
379
  }>;
367
- declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
380
+ declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
368
381
 
369
382
  declare function useComponents(): OryFlowComponents;
370
383
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -404,6 +417,7 @@ type OryClientConfiguration = {
404
417
  registration_ui_url: string;
405
418
  verification_ui_url: string;
406
419
  login_ui_url: string;
420
+ default_redirect_url?: string;
407
421
  };
408
422
  intl?: IntlConfig;
409
423
  };
@@ -413,7 +427,7 @@ type OryClientConfiguration = {
413
427
  *
414
428
  * @see OryClientConfiguration
415
429
  */
416
- type OryFlow<TFlowType, TFlow> = {
430
+ type OryFlow<TFlowType extends FlowType, TFlow> = {
417
431
  flowType: TFlowType;
418
432
  flow: TFlow;
419
433
  config: OryClientConfiguration;
@@ -462,10 +476,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
462
476
  *
463
477
  */
464
478
  type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
479
+ type ConsentFlow = {
480
+ created_at: Date;
481
+ expires_at: Date;
482
+ id: string;
483
+ issued_at: Date;
484
+ state: "show_form" | "rejected" | "accepted";
485
+ active: string;
486
+ ui: UiContainer;
487
+ consent_request: OAuth2ConsentRequest;
488
+ session: Session;
489
+ };
490
+ type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
465
491
  /**
466
492
  * A union type of all flow containers
467
493
  */
468
- type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
494
+ type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
469
495
 
470
496
  /**
471
497
  * Converts a UiText to a FormattedMessage.
@@ -593,4 +619,4 @@ type OryProviderProps = {
593
619
  } & OryFlowContainer & PropsWithChildren;
594
620
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
595
621
 
596
- export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
622
+ export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, OryConsentCard, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
1
+ import { UiNodeInputAttributes, UiNode, UiNodeAnchorAttributes, UiNodeTextAttributes, UiNodeImageAttributes, UiNodeGroupEnum, UiText, ConfigurationParameters, FlowType, LoginFlow, RegistrationFlow, RecoveryFlow, VerificationFlow, SettingsFlow, UiContainer, OAuth2ConsentRequest, Session, FlowError, UpdateLoginFlowBody, UpdateRegistrationFlowBody, UpdateVerificationFlowBody, UpdateRecoveryFlowBody, UpdateSettingsFlowBody, OnRedirectHandler } from '@ory/client-fetch';
2
2
  import { ComponentPropsWithoutRef, FormEventHandler, MouseEventHandler, PropsWithChildren, DetailedHTMLProps, HTMLAttributes, ComponentType, Dispatch } from 'react';
3
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
4
  import { VariantProps } from 'class-variance-authority';
@@ -53,12 +53,18 @@ type OryNodeImageProps = {
53
53
  type FormValues = Record<string, string | boolean | number | undefined>;
54
54
  type OryFormRootProps = ComponentPropsWithoutRef<"form"> & {
55
55
  onSubmit: FormEventHandler<HTMLFormElement>;
56
+ "data-testid"?: string;
56
57
  };
57
58
  type OryNodeInputProps = {
58
59
  attributes: UiNodeInputAttributes;
59
60
  node: UiNode;
60
61
  onClick?: MouseEventHandler;
61
62
  };
63
+ type OryNodeConsentScopeCheckboxProps = {
64
+ attributes: UiNodeInputAttributes;
65
+ node: UiNode;
66
+ onCheckedChange: (checked: boolean) => void;
67
+ };
62
68
  type OryFormSectionContentProps = PropsWithChildren<{
63
69
  title?: string;
64
70
  description?: string;
@@ -105,6 +111,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
105
111
 
106
112
  declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
107
113
 
114
+ declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
115
+
108
116
  /**
109
117
  * Props type for the Form Group Divider component.
110
118
  */
@@ -248,6 +256,10 @@ type OryFlowComponents = {
248
256
  * The Captcha component is rendered whenever a "captcha" group is encountered.
249
257
  */
250
258
  Captcha: ComponentType<OryNodeCaptchaProps>;
259
+ /**
260
+ * Special version of the Input component for scopes in OAuth2 flows.
261
+ */
262
+ ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
251
263
  };
252
264
  Card: {
253
265
  /**
@@ -363,8 +375,9 @@ type DeepPartialTwoLevels<T> = {
363
375
  type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
364
376
  type OryFormProps = PropsWithChildren<{
365
377
  onAfterSubmit?: (method: string | number | boolean | undefined) => void;
378
+ "data-testid"?: string;
366
379
  }>;
367
- declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
380
+ declare function OryForm({ children, onAfterSubmit, "data-testid": dataTestId, }: OryFormProps): react_jsx_runtime.JSX.Element;
368
381
 
369
382
  declare function useComponents(): OryFlowComponents;
370
383
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -404,6 +417,7 @@ type OryClientConfiguration = {
404
417
  registration_ui_url: string;
405
418
  verification_ui_url: string;
406
419
  login_ui_url: string;
420
+ default_redirect_url?: string;
407
421
  };
408
422
  intl?: IntlConfig;
409
423
  };
@@ -413,7 +427,7 @@ type OryClientConfiguration = {
413
427
  *
414
428
  * @see OryClientConfiguration
415
429
  */
416
- type OryFlow<TFlowType, TFlow> = {
430
+ type OryFlow<TFlowType extends FlowType, TFlow> = {
417
431
  flowType: TFlowType;
418
432
  flow: TFlow;
419
433
  config: OryClientConfiguration;
@@ -462,10 +476,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
462
476
  *
463
477
  */
464
478
  type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
479
+ type ConsentFlow = {
480
+ created_at: Date;
481
+ expires_at: Date;
482
+ id: string;
483
+ issued_at: Date;
484
+ state: "show_form" | "rejected" | "accepted";
485
+ active: string;
486
+ ui: UiContainer;
487
+ consent_request: OAuth2ConsentRequest;
488
+ session: Session;
489
+ };
490
+ type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
465
491
  /**
466
492
  * A union type of all flow containers
467
493
  */
468
- type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
494
+ type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
469
495
 
470
496
  /**
471
497
  * Converts a UiText to a FormattedMessage.
@@ -593,4 +619,4 @@ type OryProviderProps = {
593
619
  } & OryFlowContainer & PropsWithChildren;
594
620
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
595
621
 
596
- export { type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
622
+ export { type ConsentFlow, type ConsentFlowContainer, type ErrorFlowContainer, type FlowContainerSetter, type FlowContextValue, type FormState, type FormStateAction, type FormValues, HeadlessPageHeader, type IntlConfig, type LoginFlowContainer, type OnSubmitHandlerProps, OryCard, type OryCardAuthMethodListItemProps, OryCardContent, type OryCardContentProps, type OryCardDividerProps, OryCardFooter, type OryCardFooterProps, OryCardHeader, type OryCardHeaderProps, type OryCardLogoProps, type OryCardRootProps as OryCardProps, type OryCardSettingsSectionProps, OryCardValidationMessages, type OryClientConfiguration, OryConsentCard, type OryFlowComponentOverrides, type OryFlowComponents, type OryFlowContainer, OryForm, OryFormGroupDivider, type OryFormGroupProps, OryFormGroups, type OryFormGroupsProps, OryFormOidcButtons, type OryFormOidcRootProps, type OryFormProps, type OryFormRootProps, OryFormSection, type OryFormSectionContentProps, type OryFormSectionFooterProps, type OryFormSectionProps, OryFormSocialButtonsForm, OryLocales, type OryMessageContentProps, type OryMessageRootProps, type OryNodeAnchorProps, type OryNodeButtonProps, type OryNodeCaptchaProps, type OryNodeConsentScopeCheckboxProps, type OryNodeImageProps, type OryNodeInputProps, type OryNodeLabelProps, type OryNodeOidcButtonProps, type OryNodeTextProps, type OryPageHeaderProps, OryProvider, type OryProviderProps, OrySettingsCard, type OrySettingsOidcProps, type OrySettingsPasskeyProps, type OrySettingsRecoveryCodesProps, type OrySettingsTotpProps, type OrySettingsWebauthnProps, OryTwoStepCard, type RecoveryFlowContainer, type RegistrationFlowContainer, type SettingsFlowContainer, type VerificationFlowContainer, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };