@ory/elements-react 0.0.0-pr.e3d2b7e1 → 0.0.0-pr.f3c2f07

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 (183) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/DEVELOPMENT.md +19 -4
  3. package/babel.config.js +10 -0
  4. package/dist/client/frontendClient.d.mts +5 -2
  5. package/dist/client/frontendClient.d.ts +5 -2
  6. package/dist/client/frontendClient.js +25 -2
  7. package/dist/client/frontendClient.js.map +1 -1
  8. package/dist/client/frontendClient.mjs +25 -2
  9. package/dist/client/frontendClient.mjs.map +1 -1
  10. package/dist/index.d.mts +46 -5
  11. package/dist/index.d.ts +46 -5
  12. package/dist/index.js +540 -115
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +540 -116
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/theme/default/index.css +171 -118
  17. package/dist/theme/default/index.css.map +1 -1
  18. package/dist/theme/default/index.d.mts +30 -4
  19. package/dist/theme/default/index.d.ts +30 -4
  20. package/dist/theme/default/index.js +3842 -567
  21. package/dist/theme/default/index.js.map +1 -1
  22. package/dist/theme/default/index.mjs +3862 -521
  23. package/dist/theme/default/index.mjs.map +1 -1
  24. package/package.json +9 -3
  25. package/tsconfig.json +1 -1
  26. package/.storybook/global.css +0 -7
  27. package/.storybook/main.ts +0 -50
  28. package/.storybook/preview-head.html +0 -15
  29. package/.storybook/preview.tsx +0 -68
  30. package/.storybook/public/InterVariable.woff2 +0 -0
  31. package/.storybook/public/inter.css +0 -8
  32. package/.stub-responses/login/1fa/all-methods/initial-form.json +0 -245
  33. package/.stub-responses/login/1fa/all-methods/missing-email.json +0 -263
  34. package/.stub-responses/login/1fa/all-methods/wrong-credentials.json +0 -252
  35. package/.stub-responses/login/1fa/code/code-input.json +0 -135
  36. package/.stub-responses/login/1fa/code/initial-form.json +0 -173
  37. package/.stub-responses/login/1fa/code/invalid-account.json +0 -182
  38. package/.stub-responses/login/1fa/code/missing-email.json +0 -182
  39. package/.stub-responses/login/1fa/code/wrong-credentials.json +0 -124
  40. package/.stub-responses/login/1fa/none/initial-form.json +0 -33
  41. package/.stub-responses/login/1fa/oidc/credential-select-password.json +0 -120
  42. package/.stub-responses/login/1fa/oidc/credential-select.json +0 -81
  43. package/.stub-responses/login/1fa/oidc/initial-form.json +0 -279
  44. package/.stub-responses/login/1fa/passkey/initial-form.json +0 -122
  45. package/.stub-responses/login/1fa/password/initial-form.json +0 -154
  46. package/.stub-responses/login/1fa/password/missing-email.json +0 -172
  47. package/.stub-responses/login/1fa/password/wrong-credentials.json +0 -163
  48. package/.stub-responses/login/1fa/webauthn/initial-form.json +0 -76
  49. package/.stub-responses/login/1fa/webauthn/invalid-account.json +0 -83
  50. package/.stub-responses/login/1fa/webauthn/show-trigger.json +0 -105
  51. package/.stub-responses/recovery/disabled/initial-form.json +0 -9
  52. package/.stub-responses/recovery/none/initial-form.json +0 -9
  53. package/.stub-responses/registration/one-step/all-methods/initial-form.json +0 -334
  54. package/.stub-responses/registration/one-step/all-methods/missing-fields.json +0 -343
  55. package/.stub-responses/registration/one-step/disabled/initial-form.json +0 -10
  56. package/.stub-responses/registration/one-step/none/initial-form.json +0 -14
  57. package/.stub-responses/registration/one-step/oidc/initial-form.json +0 -338
  58. package/.stub-responses/registration/one-step/passkey/initial-form.json +0 -177
  59. package/.stub-responses/registration/one-step/password/initial-form.json +0 -154
  60. package/.stub-responses/registration/one-step/password/missing-fields.json +0 -172
  61. package/.stub-responses/registration/one-step/password/second-step.json +0 -164
  62. package/.stub-responses/registration/one-step/webauthn/initial-form.json +0 -185
  63. package/.stub-responses/registration/two-step/all-methods/enter-password.json +0 -242
  64. package/.stub-responses/registration/two-step/all-methods/initial-form.json +0 -180
  65. package/.stub-responses/registration/two-step/all-methods/missing-fields.json +0 -189
  66. package/.stub-responses/registration/two-step/all-methods/password-validation-error.json +0 -244
  67. package/.stub-responses/registration/two-step/password/enter-password.json +0 -108
  68. package/.stub-responses/registration/two-step/password/initial-form.json +0 -134
  69. package/.stub-responses/registration/two-step/password/missing-fields.json +0 -143
  70. package/.stub-responses/registration/two-step/password/password-validation-error.json +0 -110
  71. package/.stub-responses/settings/all-methods/change-password.json +0 -381
  72. package/.stub-responses/settings/all-methods/change-trait.json +0 -377
  73. package/.stub-responses/settings/all-methods/initial-form.json +0 -368
  74. package/.stub-responses/settings/oidc/with-provider.json +0 -229
  75. package/.stub-responses/settings/passkey/initial-form.json +0 -256
  76. package/.stub-responses/settings/webauthn/initial-form.json +0 -263
  77. package/.stub-responses/verification/disabled/initial-form.json +0 -9
  78. package/.stub-responses/verification/none/initial-form.json +0 -9
  79. package/dist/theme/default/tailwind/defaults.d.mts +0 -737
  80. package/dist/theme/default/tailwind/defaults.d.ts +0 -737
  81. package/stories/components/login/1fa/all.stories.ts +0 -46
  82. package/stories/components/login/1fa/code.stories.ts +0 -64
  83. package/stories/components/login/1fa/custom.stories.tsx +0 -74
  84. package/stories/components/login/1fa/none.stories.tsx +0 -28
  85. package/stories/components/login/1fa/oidc.stories.tsx +0 -140
  86. package/stories/components/login/1fa/passkey.stories.ts +0 -28
  87. package/stories/components/login/1fa/password.stories.ts +0 -46
  88. package/stories/components/login/1fa/webauthn.stories.ts +0 -46
  89. package/stories/components/registration/one-step/all-methods.stories.ts +0 -37
  90. package/stories/components/registration/one-step/password.stories.ts +0 -37
  91. package/stories/components/registration/one-step/webauthn.stories.ts +0 -28
  92. package/stories/components/registration/two-step/all-methods.stories.ts +0 -55
  93. package/stories/components/registration/two-step/password.stories.ts +0 -55
  94. package/stories/components/settings/all.stories.ts +0 -46
  95. package/stories/components/settings/oidc.stories.ts +0 -28
  96. package/stories/components/settings/passkey.stories.ts +0 -28
  97. package/stories/components/settings/webauthn.stories.ts +0 -28
  98. package/stories/pages/error.tsx +0 -29
  99. package/stories/utils.ts +0 -20
  100. package/storybook-static/InterVariable.woff2 +0 -0
  101. package/storybook-static/assets/Color-ERTF36HU-BdkKyVuV.js +0 -1
  102. package/storybook-static/assets/DocsRenderer-CFRXHY34-YqKt61zP.js +0 -595
  103. package/storybook-static/assets/all-methods.stories-B-rqPBX2.js +0 -11
  104. package/storybook-static/assets/all-methods.stories-CmMlhzsx.js +0 -21
  105. package/storybook-static/assets/all.stories-CtQ0yCQi.js +0 -16
  106. package/storybook-static/assets/all.stories-DgIVCzcZ.js +0 -16
  107. package/storybook-static/assets/chunk-H6MOWX77-DTQOW814.js +0 -1
  108. package/storybook-static/assets/code.stories-BbEryDcA.js +0 -26
  109. package/storybook-static/assets/custom.stories-DH2zHar9.js +0 -6
  110. package/storybook-static/assets/entry-preview-CcFGVifh.js +0 -10
  111. package/storybook-static/assets/entry-preview-docs-CyY-8bLe.js +0 -54
  112. package/storybook-static/assets/iframe-C5GAfuxh.js +0 -2
  113. package/storybook-static/assets/index-BVoBHvaS.js +0 -8
  114. package/storybook-static/assets/index-CfOt2XX2.js +0 -24
  115. package/storybook-static/assets/index-DPRSEdy-.js +0 -1
  116. package/storybook-static/assets/index-DrFu-skq.js +0 -6
  117. package/storybook-static/assets/index-FeUjBnvO.js +0 -1
  118. package/storybook-static/assets/index-uubelm5h.js +0 -9
  119. package/storybook-static/assets/initial-form-DWp_1F-f.js +0 -1
  120. package/storybook-static/assets/jsx-runtime-QvZ8i92b.js +0 -9
  121. package/storybook-static/assets/none.stories-TAeRhzd5.js +0 -6
  122. package/storybook-static/assets/oidc.stories-CniWBy7t.js +0 -58
  123. package/storybook-static/assets/oidc.stories-jhWzAyoQ.js +0 -6
  124. package/storybook-static/assets/passkey.stories-CBtjoVSN.js +0 -6
  125. package/storybook-static/assets/passkey.stories-CQU2Xw_t.js +0 -6
  126. package/storybook-static/assets/password.stories-0s6cDl0o.js +0 -11
  127. package/storybook-static/assets/password.stories-B2Wtckz_.js +0 -16
  128. package/storybook-static/assets/password.stories-DX0gkWjH.js +0 -21
  129. package/storybook-static/assets/preview-BBWR9nbA.js +0 -1
  130. package/storybook-static/assets/preview-BPAmP-pY.js +0 -2
  131. package/storybook-static/assets/preview-BWzBA1C2.js +0 -396
  132. package/storybook-static/assets/preview-BXtF2ySE.js +0 -234
  133. package/storybook-static/assets/preview-Cur_8nCX.css +0 -1
  134. package/storybook-static/assets/preview-D77C14du.js +0 -34
  135. package/storybook-static/assets/preview-DCjDUH0w.js +0 -27
  136. package/storybook-static/assets/preview-DFmD0pui.js +0 -1
  137. package/storybook-static/assets/preview-DGUiP6tS.js +0 -7
  138. package/storybook-static/assets/preview-aVwhiz9X.js +0 -1
  139. package/storybook-static/assets/react-18-CtsMCmcS.js +0 -1
  140. package/storybook-static/assets/settings-BqEFC2-V.css +0 -1
  141. package/storybook-static/assets/settings-Bx4osEmB.js +0 -2304
  142. package/storybook-static/assets/webauthn.stories-BzodmV0c.js +0 -6
  143. package/storybook-static/assets/webauthn.stories-DglGm7Ys.js +0 -6
  144. package/storybook-static/assets/webauthn.stories-G9E76Wjj.js +0 -16
  145. package/storybook-static/favicon.svg +0 -1
  146. package/storybook-static/iframe.html +0 -654
  147. package/storybook-static/index.html +0 -173
  148. package/storybook-static/index.json +0 -1
  149. package/storybook-static/inter.css +0 -8
  150. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  151. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  152. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  153. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  154. package/storybook-static/preview-stats.json +0 -2344
  155. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
  156. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
  157. package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
  158. package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
  159. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +0 -394
  160. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
  161. package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
  162. package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
  163. package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
  164. package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
  165. package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
  166. package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
  167. package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
  168. package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
  169. package/storybook-static/sb-addons/interactions-8/manager-bundle.js +0 -211
  170. package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
  171. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
  172. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  173. package/storybook-static/sb-common-assets/favicon.svg +0 -1
  174. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  175. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  176. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  177. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  178. package/storybook-static/sb-manager/globals-module-info.js +0 -1006
  179. package/storybook-static/sb-manager/globals-runtime.js +0 -54400
  180. package/storybook-static/sb-manager/globals.js +0 -48
  181. package/storybook-static/sb-manager/runtime.js +0 -12089
  182. package/storybook-static/sb-preview/globals.js +0 -33
  183. package/storybook-static/sb-preview/runtime.js +0 -9498
package/CHANGELOG.md CHANGED
@@ -1,3 +1,125 @@
1
+ ## 1.0.0-next.39 (2025-03-25)
2
+
3
+ ### 🚀 Features
4
+
5
+ - add SAML group handling ([#390](https://github.com/ory/elements/pull/390))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - hackerman @aeneasr
10
+
11
+ ## 1.0.0-next.38 (2025-03-24)
12
+
13
+ ### 🩹 Fixes
14
+
15
+ - hide registration link again ([#387](https://github.com/ory/elements/pull/387))
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - hackerman @aeneasr
20
+
21
+ ## 1.0.0-next.37 (2025-03-12)
22
+
23
+ ### 🩹 Fixes
24
+
25
+ - correctly render test id for error card ([#386](https://github.com/ory/elements/pull/386))
26
+
27
+ ### ❤️ Thank You
28
+
29
+ - Jonas Hungershausen
30
+
31
+ ## 1.0.0-next.36 (2025-03-12)
32
+
33
+ ### 🩹 Fixes
34
+
35
+ - handle error messages for selected methods ([#385](https://github.com/ory/elements/pull/385))
36
+
37
+ ### ❤️ Thank You
38
+
39
+ - Pierre Caillaud @pcaillaudm
40
+
41
+ ## 1.0.0-next.35 (2025-03-12)
42
+
43
+ ### 🚀 Features
44
+
45
+ - add more intelligent error screen ([#383](https://github.com/ory/elements/pull/383))
46
+
47
+ ### ❤️ Thank You
48
+
49
+ - Jonas Hungershausen
50
+
51
+ ## 1.0.0-next.34 (2025-03-12)
52
+
53
+ ### 🩹 Fixes
54
+
55
+ - use correct import paths ([#384](https://github.com/ory/elements/pull/384))
56
+
57
+ ### ❤️ Thank You
58
+
59
+ - hackerman @aeneasr
60
+
61
+ ## 1.0.0-next.33 (2025-03-07)
62
+
63
+ ### 🚀 Features
64
+
65
+ - add password toggle to input ([#378](https://github.com/ory/elements/pull/378))
66
+
67
+ ### 🩹 Fixes
68
+
69
+ - validation message regression ([#380](https://github.com/ory/elements/pull/380))
70
+
71
+ ### ❤️ Thank You
72
+
73
+ - Jonas Hungershausen
74
+ - Pierre Caillaud @pcaillaudm
75
+
76
+ ## 1.0.0-next.32 (2025-03-06)
77
+
78
+ ### 🚀 Features
79
+
80
+ - use method selector in 2fa login ([#377](https://github.com/ory/elements/pull/377))
81
+
82
+ ### ❤️ Thank You
83
+
84
+ - Pierre Caillaud @pcaillaudm
85
+
86
+ ## 1.0.0-next.31 (2025-03-06)
87
+
88
+ ### 🚀 Features
89
+
90
+ - support captchas natively in new and old elements ([#372](https://github.com/ory/elements/pull/372))
91
+
92
+ ### 🩹 Fixes
93
+
94
+ - center text on OIDC buttons and debounce state update ([#366](https://github.com/ory/elements/pull/366))
95
+
96
+ ### ❤️ Thank You
97
+
98
+ - hackerman @aeneasr
99
+ - Jonas Hungershausen
100
+
101
+ ## 1.0.0-next.30 (2025-03-05)
102
+
103
+ ### 🩹 Fixes
104
+
105
+ - show possible OIDC connections on login method selector ([#362](https://github.com/ory/elements/pull/362))
106
+ - add correct x/twitter OIDC logo ([#364](https://github.com/ory/elements/pull/364))
107
+
108
+ ### ❤️ Thank You
109
+
110
+ - Jonas Hungershausen
111
+
112
+ ## 1.0.0-next.29 (2025-02-27)
113
+
114
+ ### 🩹 Fixes
115
+
116
+ - remove untranslated aria label from auth list item ([#365](https://github.com/ory/elements/pull/365))
117
+ - spacing in auth method list ([#359](https://github.com/ory/elements/pull/359))
118
+
119
+ ### ❤️ Thank You
120
+
121
+ - Jonas Hungershausen
122
+
1
123
  ## 1.0.0-next.28 (2025-02-20)
2
124
 
3
125
  ### 🩹 Fixes
package/DEVELOPMENT.md CHANGED
@@ -51,13 +51,13 @@ Each flow has its own story in the `packages/elements-react-stories` package. To
51
51
  run the storybook development environment, execute:
52
52
 
53
53
  ```bash
54
- npx nx storybook elements-react-stories
54
+ npx nx storybook @ory/elements-react
55
55
  ```
56
56
 
57
57
  You can also build the Storybook using:
58
58
 
59
59
  ```bash
60
- npx nx build elements-react-stories
60
+ npx nx build @ory/elements-react
61
61
  ```
62
62
 
63
63
  The stories use stub responses
@@ -66,14 +66,29 @@ The stories use stub responses
66
66
 
67
67
  @ory/elements-react and @ory/nextjs is released using nx releases.
68
68
 
69
- There is a helper script located in "./scripts/release.sh".
69
+ There is a helper script located in `./scripts/release.sh`.
70
70
 
71
71
  Usage:
72
72
 
73
73
  ```bash
74
- ./scripts/release.sh @ory/elements-react # or @ory/nextjs
74
+ ./scripts/release.sh <project> <tag>
75
+
76
+ ./scripts/release.sh @ory/elements-react next
75
77
  ```
76
78
 
77
79
  The script asks the user before executing each steps. Please double check
78
80
  CHANGELOG.md and dry run outputs. nx also creates git tags and commits, that
79
81
  should be commited. The script will do that automatically.
82
+
83
+ ### Pre-releasing unmerged changes
84
+
85
+ You can release a PR's changes to npm to test them in a different repository,
86
+ etc. These versions are released on the `pr` npm tag, and will have the version
87
+ `0.0.0-pr.<git hash>`. These releases wont be pushed to master, but you might
88
+ have to revert the `package.json` and `package-lock.json` files.
89
+
90
+ Usage:
91
+
92
+ ```bash
93
+ ./scripts/release.sh @ory/elements-react pr
94
+ ```
@@ -0,0 +1,10 @@
1
+ // Copyright © 2025 Ory Corp
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ module.exports = {
5
+ presets: [
6
+ "@babel/preset-env",
7
+ "@babel/preset-react",
8
+ "@babel/preset-typescript",
9
+ ],
10
+ }
@@ -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":[]}
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';
@@ -28,6 +28,9 @@ type OryNodeTextProps = {
28
28
  node: UiNode;
29
29
  };
30
30
  type OryCardLogoProps = Record<string, never>;
31
+ type OryNodeCaptchaProps = {
32
+ node: UiNode;
33
+ };
31
34
  /**
32
35
  * Props for the AuthMethodListItem component. This component is used
33
36
  * to render a single auth method in the AuthMethodList component.
@@ -35,6 +38,10 @@ type OryCardLogoProps = Record<string, never>;
35
38
  type OryCardAuthMethodListItemProps = {
36
39
  onClick: () => void;
37
40
  group: string;
41
+ title?: {
42
+ id: string;
43
+ values?: Record<string, string>;
44
+ };
38
45
  };
39
46
  type OryNodeImageProps = {
40
47
  attributes: UiNodeImageAttributes;
@@ -52,6 +59,11 @@ type OryNodeInputProps = {
52
59
  node: UiNode;
53
60
  onClick?: MouseEventHandler;
54
61
  };
62
+ type OryNodeConsentScopeCheckboxProps = {
63
+ attributes: UiNodeInputAttributes;
64
+ node: UiNode;
65
+ onCheckedChange: (checked: boolean) => void;
66
+ };
55
67
  type OryFormSectionContentProps = PropsWithChildren<{
56
68
  title?: string;
57
69
  description?: string;
@@ -98,6 +110,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
98
110
 
99
111
  declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
100
112
 
113
+ declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
114
+
101
115
  /**
102
116
  * Props type for the Form Group Divider component.
103
117
  */
@@ -237,6 +251,14 @@ type OryFlowComponents = {
237
251
  * The Text component is rendered whenever a "text" node is encountered.
238
252
  */
239
253
  Text: ComponentType<OryNodeTextProps>;
254
+ /**
255
+ * The Captcha component is rendered whenever a "captcha" group is encountered.
256
+ */
257
+ Captcha: ComponentType<OryNodeCaptchaProps>;
258
+ /**
259
+ * Special version of the Input component for scopes in OAuth2 flows.
260
+ */
261
+ ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
240
262
  };
241
263
  Card: {
242
264
  /**
@@ -263,6 +285,12 @@ type OryFlowComponents = {
263
285
  * The HorizontalDivider component is rendered between groups.
264
286
  */
265
287
  Divider: ComponentType<OryCardDividerProps>;
288
+ /**
289
+ * The AuthMethodListContainer component is rendered around the "method" chooser step in the identifier_first login flow.
290
+ *
291
+ * This is only used, if login is configured to use identifier_first authentication.
292
+ */
293
+ AuthMethodListContainer: ComponentType<PropsWithChildren>;
266
294
  /**
267
295
  * The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow.
268
296
  *
@@ -347,7 +375,7 @@ type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
347
375
  type OryFormProps = PropsWithChildren<{
348
376
  onAfterSubmit?: (method: string | number | boolean | undefined) => void;
349
377
  }>;
350
- declare function OryForm({ children, onAfterSubmit }: OryFormProps): string | react_jsx_runtime.JSX.Element;
378
+ declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
351
379
 
352
380
  declare function useComponents(): OryFlowComponents;
353
381
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -387,6 +415,7 @@ type OryClientConfiguration = {
387
415
  registration_ui_url: string;
388
416
  verification_ui_url: string;
389
417
  login_ui_url: string;
418
+ default_redirect_url?: string;
390
419
  };
391
420
  intl?: IntlConfig;
392
421
  };
@@ -396,7 +425,7 @@ type OryClientConfiguration = {
396
425
  *
397
426
  * @see OryClientConfiguration
398
427
  */
399
- type OryFlow<TFlowType, TFlow> = {
428
+ type OryFlow<TFlowType extends FlowType, TFlow> = {
400
429
  flowType: TFlowType;
401
430
  flow: TFlow;
402
431
  config: OryClientConfiguration;
@@ -445,10 +474,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
445
474
  *
446
475
  */
447
476
  type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
477
+ type ConsentFlow = {
478
+ created_at: Date;
479
+ expires_at: Date;
480
+ id: string;
481
+ issued_at: Date;
482
+ state: "show_form" | "rejected" | "accepted";
483
+ active: string;
484
+ ui: UiContainer;
485
+ consent_request: OAuth2ConsentRequest;
486
+ session: Session;
487
+ };
488
+ type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
448
489
  /**
449
490
  * A union type of all flow containers
450
491
  */
451
- type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
492
+ type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
452
493
 
453
494
  /**
454
495
  * Converts a UiText to a FormattedMessage.
@@ -576,4 +617,4 @@ type OryProviderProps = {
576
617
  } & OryFlowContainer & PropsWithChildren;
577
618
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
578
619
 
579
- 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 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 };
620
+ 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';
@@ -28,6 +28,9 @@ type OryNodeTextProps = {
28
28
  node: UiNode;
29
29
  };
30
30
  type OryCardLogoProps = Record<string, never>;
31
+ type OryNodeCaptchaProps = {
32
+ node: UiNode;
33
+ };
31
34
  /**
32
35
  * Props for the AuthMethodListItem component. This component is used
33
36
  * to render a single auth method in the AuthMethodList component.
@@ -35,6 +38,10 @@ type OryCardLogoProps = Record<string, never>;
35
38
  type OryCardAuthMethodListItemProps = {
36
39
  onClick: () => void;
37
40
  group: string;
41
+ title?: {
42
+ id: string;
43
+ values?: Record<string, string>;
44
+ };
38
45
  };
39
46
  type OryNodeImageProps = {
40
47
  attributes: UiNodeImageAttributes;
@@ -52,6 +59,11 @@ type OryNodeInputProps = {
52
59
  node: UiNode;
53
60
  onClick?: MouseEventHandler;
54
61
  };
62
+ type OryNodeConsentScopeCheckboxProps = {
63
+ attributes: UiNodeInputAttributes;
64
+ node: UiNode;
65
+ onCheckedChange: (checked: boolean) => void;
66
+ };
55
67
  type OryFormSectionContentProps = PropsWithChildren<{
56
68
  title?: string;
57
69
  description?: string;
@@ -98,6 +110,8 @@ declare function OryCardContent({ children }: OryCardContentProps): react_jsx_ru
98
110
 
99
111
  declare function OryTwoStepCard(): react_jsx_runtime.JSX.Element;
100
112
 
113
+ declare function OryConsentCard(): react_jsx_runtime.JSX.Element;
114
+
101
115
  /**
102
116
  * Props type for the Form Group Divider component.
103
117
  */
@@ -237,6 +251,14 @@ type OryFlowComponents = {
237
251
  * The Text component is rendered whenever a "text" node is encountered.
238
252
  */
239
253
  Text: ComponentType<OryNodeTextProps>;
254
+ /**
255
+ * The Captcha component is rendered whenever a "captcha" group is encountered.
256
+ */
257
+ Captcha: ComponentType<OryNodeCaptchaProps>;
258
+ /**
259
+ * Special version of the Input component for scopes in OAuth2 flows.
260
+ */
261
+ ConsentScopeCheckbox: ComponentType<OryNodeConsentScopeCheckboxProps>;
240
262
  };
241
263
  Card: {
242
264
  /**
@@ -263,6 +285,12 @@ type OryFlowComponents = {
263
285
  * The HorizontalDivider component is rendered between groups.
264
286
  */
265
287
  Divider: ComponentType<OryCardDividerProps>;
288
+ /**
289
+ * The AuthMethodListContainer component is rendered around the "method" chooser step in the identifier_first login flow.
290
+ *
291
+ * This is only used, if login is configured to use identifier_first authentication.
292
+ */
293
+ AuthMethodListContainer: ComponentType<PropsWithChildren>;
266
294
  /**
267
295
  * The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow.
268
296
  *
@@ -347,7 +375,7 @@ type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>;
347
375
  type OryFormProps = PropsWithChildren<{
348
376
  onAfterSubmit?: (method: string | number | boolean | undefined) => void;
349
377
  }>;
350
- declare function OryForm({ children, onAfterSubmit }: OryFormProps): string | react_jsx_runtime.JSX.Element;
378
+ declare function OryForm({ children, onAfterSubmit }: OryFormProps): react_jsx_runtime.JSX.Element;
351
379
 
352
380
  declare function useComponents(): OryFlowComponents;
353
381
  declare function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
@@ -387,6 +415,7 @@ type OryClientConfiguration = {
387
415
  registration_ui_url: string;
388
416
  verification_ui_url: string;
389
417
  login_ui_url: string;
418
+ default_redirect_url?: string;
390
419
  };
391
420
  intl?: IntlConfig;
392
421
  };
@@ -396,7 +425,7 @@ type OryClientConfiguration = {
396
425
  *
397
426
  * @see OryClientConfiguration
398
427
  */
399
- type OryFlow<TFlowType, TFlow> = {
428
+ type OryFlow<TFlowType extends FlowType, TFlow> = {
400
429
  flowType: TFlowType;
401
430
  flow: TFlow;
402
431
  config: OryClientConfiguration;
@@ -445,10 +474,22 @@ type SettingsFlowContainer = OryFlow<FlowType.Settings, SettingsFlow>;
445
474
  *
446
475
  */
447
476
  type ErrorFlowContainer = OryFlow<FlowType.Error, FlowError>;
477
+ type ConsentFlow = {
478
+ created_at: Date;
479
+ expires_at: Date;
480
+ id: string;
481
+ issued_at: Date;
482
+ state: "show_form" | "rejected" | "accepted";
483
+ active: string;
484
+ ui: UiContainer;
485
+ consent_request: OAuth2ConsentRequest;
486
+ session: Session;
487
+ };
488
+ type ConsentFlowContainer = OryFlow<FlowType.OAuth2Consent, ConsentFlow>;
448
489
  /**
449
490
  * A union type of all flow containers
450
491
  */
451
- type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer;
492
+ type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer | ConsentFlowContainer;
452
493
 
453
494
  /**
454
495
  * Converts a UiText to a FormattedMessage.
@@ -576,4 +617,4 @@ type OryProviderProps = {
576
617
  } & OryFlowContainer & PropsWithChildren;
577
618
  declare function OryProvider({ children, components: Components, ...oryFlowProps }: OryProviderProps): react_jsx_runtime.JSX.Element;
578
619
 
579
- 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 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 };
620
+ 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 };