@thunderid/react 0.2.0 → 0.3.3

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 (475) hide show
  1. package/dist/ThunderIDReactClient.d.ts +4 -4
  2. package/dist/ThunderIDReactClient.d.ts.map +1 -1
  3. package/dist/ThunderIDReactClient.js +6 -6
  4. package/dist/ThunderIDReactClient.js.map +1 -1
  5. package/dist/cjs/ThunderIDReactClient.cjs +5 -5
  6. package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
  7. package/dist/cjs/components/actions/SignInButton/SignInButton.cjs.map +1 -1
  8. package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
  9. package/dist/cjs/components/adapters/ConsentCheckboxList.cjs +1 -1
  10. package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
  11. package/dist/cjs/components/auth/Callback/Callback.cjs +1 -1
  12. package/dist/cjs/components/auth/Callback/Callback.cjs.map +1 -1
  13. package/dist/cjs/components/auth/Callback/TokenCallback.cjs +3 -3
  14. package/dist/cjs/components/auth/Callback/TokenCallback.cjs.map +1 -1
  15. package/dist/cjs/components/factories/FieldFactory.cjs +2 -2
  16. package/dist/cjs/components/factories/FieldFactory.cjs.map +1 -1
  17. package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs +1 -1
  18. package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs +1 -1
  19. package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs +3 -3
  20. package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.cjs → AcceptInvite.cjs} +2 -2
  21. package/dist/cjs/components/presentation/auth/AcceptInvite/AcceptInvite.cjs.map +1 -0
  22. package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.cjs → BaseAcceptInvite.cjs} +47 -18
  23. package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs.map +1 -0
  24. package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.cjs → BaseAcceptInvite.styles.cjs} +2 -2
  25. package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs.map +1 -0
  26. package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +50 -32
  27. package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
  28. package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.cjs → BaseInviteUser.cjs} +44 -15
  29. package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs.map +1 -0
  30. package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.cjs → BaseInviteUser.styles.cjs} +2 -2
  31. package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs.map +1 -0
  32. package/dist/cjs/components/presentation/auth/InviteUser/{v2/InviteUser.cjs → InviteUser.cjs} +3 -3
  33. package/dist/cjs/components/presentation/auth/InviteUser/InviteUser.cjs.map +1 -0
  34. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.cjs → OrganizationUnitPicker.cjs} +3 -3
  35. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs.map +1 -0
  36. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.cjs → OrganizationUnitPicker.styles.cjs} +2 -2
  37. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs.map +1 -0
  38. package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs +389 -8
  39. package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs.map +1 -1
  40. package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs +51 -22
  41. package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs.map +1 -1
  42. package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs +346 -8
  43. package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs.map +1 -1
  44. package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs +547 -36
  45. package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs.map +1 -1
  46. package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs +691 -8
  47. package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs.map +1 -1
  48. package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs +66 -76
  49. package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs.map +1 -1
  50. package/dist/cjs/components/primitives/Alert/Alert.cjs +1 -1
  51. package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs +1 -1
  52. package/dist/cjs/components/primitives/FormControl/FormControl.cjs +1 -1
  53. package/dist/cjs/components/primitives/Toggle/Toggle.cjs +1 -1
  54. package/dist/cjs/contexts/ComponentRenderer/ComponentRendererContext.cjs.map +1 -1
  55. package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs +5 -7
  56. package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs.map +1 -1
  57. package/dist/cjs/contexts/Theme/ThemeProvider.cjs +76 -37
  58. package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
  59. package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +0 -1
  60. package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
  61. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +0 -3
  62. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
  63. package/dist/cjs/hooks/{v2/useOAuthCallback.cjs → useOAuthCallback.cjs} +2 -2
  64. package/dist/cjs/hooks/useOAuthCallback.cjs.map +1 -0
  65. package/dist/cjs/index.cjs +47 -50
  66. package/dist/cjs/utils/{v2/buildThemeConfigFromFlowMeta.cjs → buildThemeConfigFromFlowMeta.cjs} +1 -1
  67. package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs.map +1 -0
  68. package/dist/cjs/utils/{v2/flowTransformer.cjs → flowTransformer.cjs} +1 -1
  69. package/dist/cjs/utils/flowTransformer.cjs.map +1 -0
  70. package/dist/cjs/utils/{v2/getAuthComponentHeadings.cjs → getAuthComponentHeadings.cjs} +1 -1
  71. package/dist/cjs/utils/getAuthComponentHeadings.cjs.map +1 -0
  72. package/dist/cjs/utils/{v2/passkey.cjs → passkey.cjs} +2 -2
  73. package/dist/cjs/utils/passkey.cjs.map +1 -0
  74. package/dist/cjs/utils/{v2/resolveTranslationsInArray.cjs → resolveTranslationsInArray.cjs} +1 -1
  75. package/dist/cjs/utils/resolveTranslationsInArray.cjs.map +1 -0
  76. package/dist/cjs/utils/{v2/resolveTranslationsInObject.cjs → resolveTranslationsInObject.cjs} +2 -2
  77. package/dist/cjs/utils/resolveTranslationsInObject.cjs.map +1 -0
  78. package/dist/components/actions/SignInButton/SignInButton.d.ts.map +1 -1
  79. package/dist/components/actions/SignInButton/SignInButton.js.map +1 -1
  80. package/dist/components/adapters/Consent.d.ts +1 -1
  81. package/dist/components/adapters/Consent.d.ts.map +1 -1
  82. package/dist/components/adapters/Consent.js.map +1 -1
  83. package/dist/components/adapters/ConsentCheckboxList.d.ts +1 -1
  84. package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
  85. package/dist/components/adapters/ConsentCheckboxList.js +1 -1
  86. package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
  87. package/dist/components/auth/Callback/Callback.d.ts +1 -1
  88. package/dist/components/auth/Callback/Callback.js +1 -1
  89. package/dist/components/auth/Callback/Callback.js.map +1 -1
  90. package/dist/components/auth/Callback/TokenCallback.js +4 -4
  91. package/dist/components/auth/Callback/TokenCallback.js.map +1 -1
  92. package/dist/components/factories/FieldFactory.d.ts +2 -2
  93. package/dist/components/factories/FieldFactory.js +2 -2
  94. package/dist/components/factories/FieldFactory.js.map +1 -1
  95. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js +1 -1
  96. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js +1 -1
  97. package/dist/components/presentation/UserProfile/BaseUserProfile.js +3 -3
  98. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.d.ts.map +1 -0
  99. package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.js → AcceptInvite.js} +1 -1
  100. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.js.map +1 -0
  101. package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.d.ts → BaseAcceptInvite.d.ts} +3 -2
  102. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts.map +1 -0
  103. package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.js → BaseAcceptInvite.js} +45 -17
  104. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js.map +1 -0
  105. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts.map +1 -0
  106. package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.js → BaseAcceptInvite.styles.js} +1 -1
  107. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js.map +1 -0
  108. package/dist/components/presentation/auth/AcceptInvite/index.d.ts +4 -4
  109. package/dist/components/presentation/auth/AcceptInvite/index.d.ts.map +1 -1
  110. package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
  111. package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
  112. package/dist/components/presentation/auth/AuthOptionFactory.js +51 -33
  113. package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
  114. package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.d.ts → BaseInviteUser.d.ts} +3 -2
  115. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts.map +1 -0
  116. package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.js → BaseInviteUser.js} +44 -15
  117. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js.map +1 -0
  118. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts.map +1 -0
  119. package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.js → BaseInviteUser.styles.js} +1 -1
  120. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js.map +1 -0
  121. package/dist/components/presentation/auth/InviteUser/InviteUser.d.ts.map +1 -0
  122. package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.js → InviteUser.js} +2 -2
  123. package/dist/components/presentation/auth/InviteUser/InviteUser.js.map +1 -0
  124. package/dist/components/presentation/auth/InviteUser/index.d.ts +4 -4
  125. package/dist/components/presentation/auth/InviteUser/index.d.ts.map +1 -1
  126. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts.map +1 -0
  127. package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.js → OrganizationUnitPicker.js} +2 -2
  128. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js.map +1 -0
  129. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts.map +1 -0
  130. package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.js → OrganizationUnitPicker.styles.js} +1 -1
  131. package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js.map +1 -0
  132. package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +2 -2
  133. package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +1 -1
  134. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +63 -4
  135. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -1
  136. package/dist/components/presentation/auth/Recovery/BaseRecovery.js +389 -10
  137. package/dist/components/presentation/auth/Recovery/BaseRecovery.js.map +1 -1
  138. package/dist/components/presentation/auth/Recovery/Recovery.d.ts +21 -22
  139. package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -1
  140. package/dist/components/presentation/auth/Recovery/Recovery.js +51 -23
  141. package/dist/components/presentation/auth/Recovery/Recovery.js.map +1 -1
  142. package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts +213 -6
  143. package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -1
  144. package/dist/components/presentation/auth/SignIn/BaseSignIn.js +346 -10
  145. package/dist/components/presentation/auth/SignIn/BaseSignIn.js.map +1 -1
  146. package/dist/components/presentation/auth/SignIn/SignIn.d.ts +122 -13
  147. package/dist/components/presentation/auth/SignIn/SignIn.d.ts.map +1 -1
  148. package/dist/components/presentation/auth/SignIn/SignIn.js +548 -38
  149. package/dist/components/presentation/auth/SignIn/SignIn.js.map +1 -1
  150. package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts +164 -6
  151. package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -1
  152. package/dist/components/presentation/auth/SignUp/BaseSignUp.js +691 -10
  153. package/dist/components/presentation/auth/SignUp/BaseSignUp.js.map +1 -1
  154. package/dist/components/presentation/auth/SignUp/SignUp.d.ts +15 -74
  155. package/dist/components/presentation/auth/SignUp/SignUp.d.ts.map +1 -1
  156. package/dist/components/presentation/auth/SignUp/SignUp.js +67 -77
  157. package/dist/components/presentation/auth/SignUp/SignUp.js.map +1 -1
  158. package/dist/components/primitives/Alert/Alert.js +1 -1
  159. package/dist/components/primitives/Checkbox/Checkbox.js +1 -1
  160. package/dist/components/primitives/FormControl/FormControl.js +1 -1
  161. package/dist/components/primitives/Toggle/Toggle.js +1 -1
  162. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +1 -1
  163. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
  164. package/dist/contexts/ComponentRenderer/ComponentRendererContext.js.map +1 -1
  165. package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts.map +1 -1
  166. package/dist/contexts/FlowMeta/FlowMetaProvider.js +6 -8
  167. package/dist/contexts/FlowMeta/FlowMetaProvider.js.map +1 -1
  168. package/dist/contexts/Theme/ThemeProvider.d.ts +19 -39
  169. package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
  170. package/dist/contexts/Theme/ThemeProvider.js +76 -38
  171. package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
  172. package/dist/contexts/ThunderID/ThunderIDContext.d.ts +1 -2
  173. package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
  174. package/dist/contexts/ThunderID/ThunderIDContext.js +0 -1
  175. package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
  176. package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
  177. package/dist/contexts/ThunderID/ThunderIDProvider.js +1 -4
  178. package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
  179. package/dist/hooks/useOAuthCallback.d.ts.map +1 -0
  180. package/dist/hooks/{v2/useOAuthCallback.js → useOAuthCallback.js} +1 -1
  181. package/dist/hooks/useOAuthCallback.js.map +1 -0
  182. package/dist/index.d.ts +3 -9
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +28 -35
  185. package/dist/utils/buildThemeConfigFromFlowMeta.d.ts.map +1 -0
  186. package/dist/utils/{v2/buildThemeConfigFromFlowMeta.js → buildThemeConfigFromFlowMeta.js} +1 -1
  187. package/dist/utils/buildThemeConfigFromFlowMeta.js.map +1 -0
  188. package/dist/utils/{v2/flowTransformer.d.ts → flowTransformer.d.ts} +3 -3
  189. package/dist/utils/flowTransformer.d.ts.map +1 -0
  190. package/dist/utils/{v2/flowTransformer.js → flowTransformer.js} +1 -1
  191. package/dist/utils/flowTransformer.js.map +1 -0
  192. package/dist/utils/{v2/getAuthComponentHeadings.d.ts → getAuthComponentHeadings.d.ts} +1 -1
  193. package/dist/utils/getAuthComponentHeadings.d.ts.map +1 -0
  194. package/dist/utils/{v2/getAuthComponentHeadings.js → getAuthComponentHeadings.js} +1 -1
  195. package/dist/utils/getAuthComponentHeadings.js.map +1 -0
  196. package/dist/utils/passkey.d.ts.map +1 -0
  197. package/dist/utils/{v2/passkey.js → passkey.js} +1 -1
  198. package/dist/utils/passkey.js.map +1 -0
  199. package/dist/utils/{v2/resolveTranslationsInArray.d.ts → resolveTranslationsInArray.d.ts} +1 -1
  200. package/dist/utils/resolveTranslationsInArray.d.ts.map +1 -0
  201. package/dist/utils/{v2/resolveTranslationsInArray.js → resolveTranslationsInArray.js} +1 -1
  202. package/dist/utils/resolveTranslationsInArray.js.map +1 -0
  203. package/dist/utils/{v2/resolveTranslationsInObject.d.ts → resolveTranslationsInObject.d.ts} +1 -1
  204. package/dist/utils/resolveTranslationsInObject.d.ts.map +1 -0
  205. package/dist/utils/{v2/resolveTranslationsInObject.js → resolveTranslationsInObject.js} +1 -1
  206. package/dist/utils/resolveTranslationsInObject.js.map +1 -0
  207. package/package.json +10 -10
  208. package/dist/cjs/components/adapters/CheckboxInput.cjs +0 -30
  209. package/dist/cjs/components/adapters/CheckboxInput.cjs.map +0 -1
  210. package/dist/cjs/components/adapters/DateInput.cjs +0 -30
  211. package/dist/cjs/components/adapters/DateInput.cjs.map +0 -1
  212. package/dist/cjs/components/adapters/DividerComponent.cjs +0 -24
  213. package/dist/cjs/components/adapters/DividerComponent.cjs.map +0 -1
  214. package/dist/cjs/components/adapters/EmailInput.cjs +0 -30
  215. package/dist/cjs/components/adapters/EmailInput.cjs.map +0 -1
  216. package/dist/cjs/components/adapters/FormContainer.cjs +0 -36
  217. package/dist/cjs/components/adapters/FormContainer.cjs.map +0 -1
  218. package/dist/cjs/components/adapters/NumberInput.cjs +0 -30
  219. package/dist/cjs/components/adapters/NumberInput.cjs.map +0 -1
  220. package/dist/cjs/components/adapters/PasswordInput.cjs +0 -52
  221. package/dist/cjs/components/adapters/PasswordInput.cjs.map +0 -1
  222. package/dist/cjs/components/adapters/SelectInput.cjs +0 -36
  223. package/dist/cjs/components/adapters/SelectInput.cjs.map +0 -1
  224. package/dist/cjs/components/adapters/SubmitButton.cjs +0 -61
  225. package/dist/cjs/components/adapters/SubmitButton.cjs.map +0 -1
  226. package/dist/cjs/components/adapters/TelephoneInput.cjs +0 -32
  227. package/dist/cjs/components/adapters/TelephoneInput.cjs.map +0 -1
  228. package/dist/cjs/components/adapters/TextInput.cjs +0 -30
  229. package/dist/cjs/components/adapters/TextInput.cjs.map +0 -1
  230. package/dist/cjs/components/adapters/Typography.cjs +0 -60
  231. package/dist/cjs/components/adapters/Typography.cjs.map +0 -1
  232. package/dist/cjs/components/presentation/auth/AcceptInvite/v2/AcceptInvite.cjs.map +0 -1
  233. package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.cjs.map +0 -1
  234. package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.cjs.map +0 -1
  235. package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.cjs.map +0 -1
  236. package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.cjs.map +0 -1
  237. package/dist/cjs/components/presentation/auth/InviteUser/v2/InviteUser.cjs.map +0 -1
  238. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.cjs.map +0 -1
  239. package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.cjs.map +0 -1
  240. package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs +0 -293
  241. package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs.map +0 -1
  242. package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs +0 -43
  243. package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs.map +0 -1
  244. package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs +0 -163
  245. package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs.map +0 -1
  246. package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs +0 -378
  247. package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs.map +0 -1
  248. package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs +0 -78
  249. package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs.map +0 -1
  250. package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs +0 -734
  251. package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs.map +0 -1
  252. package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs +0 -68
  253. package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs.map +0 -1
  254. package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs +0 -59
  255. package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs.map +0 -1
  256. package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs +0 -139
  257. package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs.map +0 -1
  258. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs +0 -147
  259. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs.map +0 -1
  260. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs +0 -68
  261. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs.map +0 -1
  262. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs +0 -38
  263. package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs.map +0 -1
  264. package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs +0 -68
  265. package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs.map +0 -1
  266. package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs +0 -60
  267. package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs.map +0 -1
  268. package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs +0 -330
  269. package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs.map +0 -1
  270. package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs +0 -560
  271. package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs.map +0 -1
  272. package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs +0 -451
  273. package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs.map +0 -1
  274. package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs +0 -54
  275. package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs.map +0 -1
  276. package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs +0 -164
  277. package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs.map +0 -1
  278. package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs +0 -656
  279. package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs.map +0 -1
  280. package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs +0 -80
  281. package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs.map +0 -1
  282. package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs +0 -190
  283. package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs.map +0 -1
  284. package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs +0 -108
  285. package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs.map +0 -1
  286. package/dist/cjs/hooks/v2/useOAuthCallback.cjs.map +0 -1
  287. package/dist/cjs/utils/v2/buildThemeConfigFromFlowMeta.cjs.map +0 -1
  288. package/dist/cjs/utils/v2/flowTransformer.cjs.map +0 -1
  289. package/dist/cjs/utils/v2/getAuthComponentHeadings.cjs.map +0 -1
  290. package/dist/cjs/utils/v2/passkey.cjs.map +0 -1
  291. package/dist/cjs/utils/v2/resolveTranslationsInArray.cjs.map +0 -1
  292. package/dist/cjs/utils/v2/resolveTranslationsInObject.cjs.map +0 -1
  293. package/dist/components/adapters/CheckboxInput.d.ts +0 -25
  294. package/dist/components/adapters/CheckboxInput.d.ts.map +0 -1
  295. package/dist/components/adapters/CheckboxInput.js +0 -28
  296. package/dist/components/adapters/CheckboxInput.js.map +0 -1
  297. package/dist/components/adapters/DateInput.d.ts +0 -25
  298. package/dist/components/adapters/DateInput.d.ts.map +0 -1
  299. package/dist/components/adapters/DateInput.js +0 -28
  300. package/dist/components/adapters/DateInput.js.map +0 -1
  301. package/dist/components/adapters/DividerComponent.d.ts +0 -25
  302. package/dist/components/adapters/DividerComponent.d.ts.map +0 -1
  303. package/dist/components/adapters/DividerComponent.js +0 -22
  304. package/dist/components/adapters/DividerComponent.js.map +0 -1
  305. package/dist/components/adapters/EmailInput.d.ts +0 -25
  306. package/dist/components/adapters/EmailInput.d.ts.map +0 -1
  307. package/dist/components/adapters/EmailInput.js +0 -28
  308. package/dist/components/adapters/EmailInput.js.map +0 -1
  309. package/dist/components/adapters/FormContainer.d.ts +0 -25
  310. package/dist/components/adapters/FormContainer.d.ts.map +0 -1
  311. package/dist/components/adapters/FormContainer.js +0 -34
  312. package/dist/components/adapters/FormContainer.js.map +0 -1
  313. package/dist/components/adapters/NumberInput.d.ts +0 -25
  314. package/dist/components/adapters/NumberInput.d.ts.map +0 -1
  315. package/dist/components/adapters/NumberInput.js +0 -28
  316. package/dist/components/adapters/NumberInput.js.map +0 -1
  317. package/dist/components/adapters/PasswordInput.d.ts +0 -25
  318. package/dist/components/adapters/PasswordInput.d.ts.map +0 -1
  319. package/dist/components/adapters/PasswordInput.js +0 -50
  320. package/dist/components/adapters/PasswordInput.js.map +0 -1
  321. package/dist/components/adapters/SelectInput.d.ts +0 -25
  322. package/dist/components/adapters/SelectInput.d.ts.map +0 -1
  323. package/dist/components/adapters/SelectInput.js +0 -34
  324. package/dist/components/adapters/SelectInput.js.map +0 -1
  325. package/dist/components/adapters/SocialButton.d.ts +0 -25
  326. package/dist/components/adapters/SocialButton.d.ts.map +0 -1
  327. package/dist/components/adapters/SubmitButton.d.ts +0 -25
  328. package/dist/components/adapters/SubmitButton.d.ts.map +0 -1
  329. package/dist/components/adapters/SubmitButton.js +0 -59
  330. package/dist/components/adapters/SubmitButton.js.map +0 -1
  331. package/dist/components/adapters/TelephoneInput.d.ts +0 -25
  332. package/dist/components/adapters/TelephoneInput.d.ts.map +0 -1
  333. package/dist/components/adapters/TelephoneInput.js +0 -30
  334. package/dist/components/adapters/TelephoneInput.js.map +0 -1
  335. package/dist/components/adapters/TextInput.d.ts +0 -25
  336. package/dist/components/adapters/TextInput.d.ts.map +0 -1
  337. package/dist/components/adapters/TextInput.js +0 -28
  338. package/dist/components/adapters/TextInput.js.map +0 -1
  339. package/dist/components/adapters/Typography.d.ts +0 -25
  340. package/dist/components/adapters/Typography.d.ts.map +0 -1
  341. package/dist/components/adapters/Typography.js +0 -58
  342. package/dist/components/adapters/Typography.js.map +0 -1
  343. package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts.map +0 -1
  344. package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.js.map +0 -1
  345. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts.map +0 -1
  346. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.js.map +0 -1
  347. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts.map +0 -1
  348. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.js.map +0 -1
  349. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts.map +0 -1
  350. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.js.map +0 -1
  351. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts.map +0 -1
  352. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.js.map +0 -1
  353. package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts.map +0 -1
  354. package/dist/components/presentation/auth/InviteUser/v2/InviteUser.js.map +0 -1
  355. package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.d.ts.map +0 -1
  356. package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.js.map +0 -1
  357. package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.d.ts.map +0 -1
  358. package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.js.map +0 -1
  359. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +0 -74
  360. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +0 -1
  361. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js +0 -288
  362. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js.map +0 -1
  363. package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +0 -26
  364. package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +0 -1
  365. package/dist/components/presentation/auth/Recovery/v1/Recovery.js +0 -40
  366. package/dist/components/presentation/auth/Recovery/v1/Recovery.js.map +0 -1
  367. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +0 -46
  368. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +0 -1
  369. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js +0 -160
  370. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js.map +0 -1
  371. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +0 -83
  372. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +0 -1
  373. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js +0 -373
  374. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js.map +0 -1
  375. package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +0 -56
  376. package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +0 -1
  377. package/dist/components/presentation/auth/Recovery/v2/Recovery.js +0 -74
  378. package/dist/components/presentation/auth/Recovery/v2/Recovery.js.map +0 -1
  379. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +0 -131
  380. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts.map +0 -1
  381. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js +0 -729
  382. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js.map +0 -1
  383. package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts +0 -26
  384. package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts.map +0 -1
  385. package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js +0 -64
  386. package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js.map +0 -1
  387. package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts +0 -26
  388. package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts.map +0 -1
  389. package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js +0 -55
  390. package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js.map +0 -1
  391. package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts +0 -27
  392. package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts.map +0 -1
  393. package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js +0 -136
  394. package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js.map +0 -1
  395. package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +0 -77
  396. package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts.map +0 -1
  397. package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js +0 -143
  398. package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js.map +0 -1
  399. package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts +0 -26
  400. package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts.map +0 -1
  401. package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js +0 -64
  402. package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js.map +0 -1
  403. package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts +0 -26
  404. package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts.map +0 -1
  405. package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js +0 -36
  406. package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js.map +0 -1
  407. package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts +0 -26
  408. package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts.map +0 -1
  409. package/dist/components/presentation/auth/SignIn/v1/options/Totp.js +0 -64
  410. package/dist/components/presentation/auth/SignIn/v1/options/Totp.js.map +0 -1
  411. package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts +0 -26
  412. package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts.map +0 -1
  413. package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js +0 -56
  414. package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js.map +0 -1
  415. package/dist/components/presentation/auth/SignIn/v1/types.d.ts +0 -125
  416. package/dist/components/presentation/auth/SignIn/v1/types.d.ts.map +0 -1
  417. package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +0 -222
  418. package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts.map +0 -1
  419. package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js +0 -325
  420. package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js.map +0 -1
  421. package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +0 -165
  422. package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts.map +0 -1
  423. package/dist/components/presentation/auth/SignIn/v2/SignIn.js +0 -556
  424. package/dist/components/presentation/auth/SignIn/v2/SignIn.js.map +0 -1
  425. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +0 -174
  426. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts.map +0 -1
  427. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js +0 -446
  428. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js.map +0 -1
  429. package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts +0 -39
  430. package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts.map +0 -1
  431. package/dist/components/presentation/auth/SignUp/v1/SignUp.js +0 -51
  432. package/dist/components/presentation/auth/SignUp/v1/SignUp.js.map +0 -1
  433. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +0 -46
  434. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts.map +0 -1
  435. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js +0 -160
  436. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js.map +0 -1
  437. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +0 -186
  438. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts.map +0 -1
  439. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js +0 -651
  440. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js.map +0 -1
  441. package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts +0 -39
  442. package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts.map +0 -1
  443. package/dist/components/presentation/auth/SignUp/v2/SignUp.js +0 -77
  444. package/dist/components/presentation/auth/SignUp/v2/SignUp.js.map +0 -1
  445. package/dist/contexts/Theme/v1/ThemeProvider.d.ts +0 -89
  446. package/dist/contexts/Theme/v1/ThemeProvider.d.ts.map +0 -1
  447. package/dist/contexts/Theme/v1/ThemeProvider.js +0 -186
  448. package/dist/contexts/Theme/v1/ThemeProvider.js.map +0 -1
  449. package/dist/contexts/Theme/v2/ThemeProvider.d.ts +0 -58
  450. package/dist/contexts/Theme/v2/ThemeProvider.d.ts.map +0 -1
  451. package/dist/contexts/Theme/v2/ThemeProvider.js +0 -104
  452. package/dist/contexts/Theme/v2/ThemeProvider.js.map +0 -1
  453. package/dist/hooks/v2/useOAuthCallback.d.ts.map +0 -1
  454. package/dist/hooks/v2/useOAuthCallback.js.map +0 -1
  455. package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts.map +0 -1
  456. package/dist/utils/v2/buildThemeConfigFromFlowMeta.js.map +0 -1
  457. package/dist/utils/v2/flowTransformer.d.ts.map +0 -1
  458. package/dist/utils/v2/flowTransformer.js.map +0 -1
  459. package/dist/utils/v2/getAuthComponentHeadings.d.ts.map +0 -1
  460. package/dist/utils/v2/getAuthComponentHeadings.js.map +0 -1
  461. package/dist/utils/v2/passkey.d.ts.map +0 -1
  462. package/dist/utils/v2/passkey.js.map +0 -1
  463. package/dist/utils/v2/resolveTranslationsInArray.d.ts.map +0 -1
  464. package/dist/utils/v2/resolveTranslationsInArray.js.map +0 -1
  465. package/dist/utils/v2/resolveTranslationsInObject.d.ts.map +0 -1
  466. package/dist/utils/v2/resolveTranslationsInObject.js.map +0 -1
  467. /package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.d.ts → AcceptInvite.d.ts} +0 -0
  468. /package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.d.ts → BaseAcceptInvite.styles.d.ts} +0 -0
  469. /package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.d.ts → BaseInviteUser.styles.d.ts} +0 -0
  470. /package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.d.ts → InviteUser.d.ts} +0 -0
  471. /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.d.ts → OrganizationUnitPicker.d.ts} +0 -0
  472. /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.d.ts → OrganizationUnitPicker.styles.d.ts} +0 -0
  473. /package/dist/hooks/{v2/useOAuthCallback.d.ts → useOAuthCallback.d.ts} +0 -0
  474. /package/dist/utils/{v2/buildThemeConfigFromFlowMeta.d.ts → buildThemeConfigFromFlowMeta.d.ts} +0 -0
  475. /package/dist/utils/{v2/passkey.d.ts → passkey.d.ts} +0 -0
@@ -1,17 +1,396 @@
1
+ import ComponentRendererContext_default from "../../../../contexts/ComponentRenderer/ComponentRendererContext.js";
2
+ import FlowProvider_default from "../../../../contexts/Flow/FlowProvider.js";
1
3
  import useThunderID_default from "../../../../contexts/ThunderID/useThunderID.js";
2
- import BaseRecovery_default from "./v1/BaseRecovery.js";
3
- import BaseRecovery_default$1 from "./v2/BaseRecovery.js";
4
- import { Platform } from "@thunderid/browser";
5
- import { jsx } from "react/jsx-runtime";
4
+ import useFlow_default from "../../../../contexts/Flow/useFlow.js";
5
+ import useTheme_default from "../../../../contexts/Theme/useTheme.js";
6
+ import ComponentPreferencesContext_default from "../../../../contexts/I18n/ComponentPreferencesContext.js";
7
+ import useTranslation_default from "../../../../hooks/useTranslation.js";
8
+ import { useForm } from "../../../../hooks/useForm.js";
9
+ import Spinner_default from "../../../primitives/Spinner/Spinner.js";
10
+ import { extractErrorMessage, normalizeFlowResponse } from "../../../../utils/flowTransformer.js";
11
+ import Typography_default from "../../../primitives/Typography/Typography.js";
12
+ import Alert_default from "../../../primitives/Alert/Alert.js";
13
+ import Card_default from "../../../primitives/Card/Card.js";
14
+ import { renderRecoveryComponents } from "../AuthOptionFactory.js";
15
+ import BaseSignUp_styles_default from "../SignUp/BaseSignUp.styles.js";
16
+ import getAuthComponentHeadings_default from "../../../../utils/getAuthComponentHeadings.js";
17
+ import Logo_default from "../../../primitives/Logo/Logo.js";
18
+ import { EmbeddedFlowComponentType, EmbeddedRecoveryFlowStatus, buildValidatorFromRules, withVendorCSSClassPrefix } from "@thunderid/browser";
19
+ import { useCallback, useContext, useEffect, useRef, useState } from "react";
20
+ import { jsx, jsxs } from "react/jsx-runtime";
21
+ import { cx } from "@emotion/css";
6
22
 
7
23
  //#region src/components/presentation/auth/Recovery/BaseRecovery.tsx
8
- const BaseRecovery = (props) => {
9
- const { platform } = useThunderID_default();
10
- if (platform === Platform.ThunderID) return /* @__PURE__ */ jsx(BaseRecovery_default$1, { ...props });
11
- return /* @__PURE__ */ jsx(BaseRecovery_default, { ...props });
24
+ /**
25
+ * Internal component that renders the V2 recovery UI and manages flow state.
26
+ *
27
+ * @internal
28
+ */
29
+ const BaseRecoveryContent = ({ onInitialize, onSubmit, onError, onFlowChange, onComplete, error: externalError, className = "", inputClassName = "", buttonClassName = "", errorClassName = "", messageClassName = "", size = "medium", variant = "outlined", isInitialized, children, showTitle = true, showSubtitle = true }) => {
30
+ const { theme, colorScheme } = useTheme_default();
31
+ const customRenderers = useContext(ComponentRendererContext_default);
32
+ const { t } = useTranslation_default();
33
+ const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
34
+ const { meta } = useThunderID_default();
35
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
36
+ const [isLoading, setIsLoading] = useState(false);
37
+ const [isFlowInitialized, setIsFlowInitialized] = useState(false);
38
+ const [currentFlow, setCurrentFlow] = useState(null);
39
+ const [apiError, setApiError] = useState(null);
40
+ const initializationAttemptedRef = useRef(false);
41
+ const challengeTokenRef = useRef(null);
42
+ const handleError = useCallback((error) => {
43
+ const errorMessage = extractErrorMessage(error, t);
44
+ setApiError(error instanceof Error ? error : new Error(errorMessage));
45
+ clearMessages();
46
+ addMessage({
47
+ message: errorMessage,
48
+ type: "error"
49
+ });
50
+ }, [
51
+ t,
52
+ addMessage,
53
+ clearMessages
54
+ ]);
55
+ const normalizeFlowResponseLocal = useCallback((response) => {
56
+ if (response?.data?.components && Array.isArray(response.data.components)) return response;
57
+ if (response?.data) {
58
+ const { components } = normalizeFlowResponse(response, t, {
59
+ defaultErrorKey: "components.recovery.errors.generic",
60
+ resolveTranslations: false
61
+ }, meta);
62
+ return {
63
+ ...response,
64
+ data: {
65
+ ...response.data,
66
+ components
67
+ }
68
+ };
69
+ }
70
+ return response;
71
+ }, [t, meta]);
72
+ const extractFormFields = useCallback((components) => {
73
+ const fields = [];
74
+ const processComponents = (comps) => {
75
+ comps.forEach((component) => {
76
+ if (component.type === EmbeddedFlowComponentType.TextInput || component.type === EmbeddedFlowComponentType.PasswordInput || component.type === EmbeddedFlowComponentType.EmailInput || component.type === EmbeddedFlowComponentType.Select || component.type === EmbeddedFlowComponentType.DateInput) {
77
+ const fieldName = component.ref || component.id;
78
+ const ruleValidator = buildValidatorFromRules(component.validation);
79
+ fields.push({
80
+ initialValue: "",
81
+ name: fieldName,
82
+ required: component.required || false,
83
+ validator: (value) => {
84
+ if (component.required && (!value || value.trim() === "")) return t("validations.required.field.error");
85
+ if ((component.type === EmbeddedFlowComponentType.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) return t("field.email.invalid");
86
+ if (ruleValidator && value) {
87
+ const ruleMessage = ruleValidator(value);
88
+ if (ruleMessage) return t(ruleMessage);
89
+ }
90
+ return null;
91
+ }
92
+ });
93
+ }
94
+ if (component.components && Array.isArray(component.components)) processComponents(component.components);
95
+ });
96
+ };
97
+ processComponents(components);
98
+ return fields;
99
+ }, [t]);
100
+ const { values: formValues, touched: touchedFields, errors: formErrors, isValid: isFormValid, setValue: setFormValue, setTouched: setFormTouched, setErrors: setFormErrors, clearErrors: clearFormErrors, validateForm, touchAllFields, reset: resetForm } = useForm({
101
+ fields: currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [],
102
+ initialValues: {},
103
+ requiredMessage: t("validations.required.field.error"),
104
+ validateOnBlur: true,
105
+ validateOnChange: false
106
+ });
107
+ /**
108
+ * Project server-side validation errors from the most recent flow response into the
109
+ * form's `errors` state. See BaseSignIn for the same pattern.
110
+ */
111
+ useEffect(() => {
112
+ clearFormErrors();
113
+ const responseFieldErrors = (currentFlow?.data)?.fieldErrors;
114
+ if (!responseFieldErrors || responseFieldErrors.length === 0) return;
115
+ const errors = {};
116
+ for (const fe of responseFieldErrors) if (!(fe.identifier in errors)) errors[fe.identifier] = fe.message;
117
+ setFormErrors(errors);
118
+ Object.keys(errors).forEach((field) => setFormTouched(field, true));
119
+ }, [
120
+ currentFlow,
121
+ setFormErrors,
122
+ setFormTouched,
123
+ clearFormErrors
124
+ ]);
125
+ const setupFormFields = useCallback((flowResponse) => {
126
+ const fields = extractFormFields(flowResponse.data?.components || []);
127
+ const initialValues = {};
128
+ fields.forEach((field) => {
129
+ initialValues[field.name] = field.initialValue || "";
130
+ });
131
+ resetForm();
132
+ Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
133
+ }, [
134
+ extractFormFields,
135
+ resetForm,
136
+ setFormValue
137
+ ]);
138
+ const handleInputChange = (name, value) => {
139
+ setFormValue(name, value);
140
+ };
141
+ const handleInputBlur = (name) => {
142
+ setFormTouched(name, true);
143
+ };
144
+ const handleSubmit = async (component, data, skipValidation) => {
145
+ if (!currentFlow) return;
146
+ if (!skipValidation) {
147
+ touchAllFields();
148
+ if (!validateForm().isValid) return;
149
+ }
150
+ setIsLoading(true);
151
+ setApiError(null);
152
+ clearMessages();
153
+ try {
154
+ const filteredInputs = {};
155
+ if (data) Object.entries(data).forEach(([key, value]) => {
156
+ if (value !== null && value !== void 0 && value !== "") filteredInputs[key] = value;
157
+ });
158
+ const payload = {
159
+ ...currentFlow.executionId && { executionId: currentFlow.executionId },
160
+ ...component.id && { action: component.id },
161
+ ...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {},
162
+ inputs: filteredInputs
163
+ };
164
+ const rawResponse = await onSubmit?.(payload);
165
+ if (!rawResponse) return;
166
+ const response = normalizeFlowResponseLocal(rawResponse);
167
+ onFlowChange?.(response);
168
+ if (response.challengeToken !== void 0) challengeTokenRef.current = response.challengeToken ?? null;
169
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Error) {
170
+ handleError(response);
171
+ onError?.(new Error(extractErrorMessage(response, t)));
172
+ return;
173
+ }
174
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Complete) {
175
+ onComplete?.(response);
176
+ return;
177
+ }
178
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Incomplete) {
179
+ setCurrentFlow(response);
180
+ setupFormFields(response);
181
+ if (response?.error) handleError(response);
182
+ }
183
+ } catch (err) {
184
+ handleError(err);
185
+ onError?.(err);
186
+ } finally {
187
+ setIsLoading(false);
188
+ }
189
+ };
190
+ const containerClasses = cx([
191
+ withVendorCSSClassPrefix("recovery"),
192
+ withVendorCSSClassPrefix(`recovery--${size}`),
193
+ withVendorCSSClassPrefix(`recovery--${variant}`)
194
+ ], className);
195
+ const inputClasses = cx([
196
+ withVendorCSSClassPrefix("recovery__input"),
197
+ size === "small" && withVendorCSSClassPrefix("recovery__input--small"),
198
+ size === "large" && withVendorCSSClassPrefix("recovery__input--large")
199
+ ], inputClassName);
200
+ const buttonClasses = cx([
201
+ withVendorCSSClassPrefix("recovery__button"),
202
+ size === "small" && withVendorCSSClassPrefix("recovery__button--small"),
203
+ size === "large" && withVendorCSSClassPrefix("recovery__button--large")
204
+ ], buttonClassName);
205
+ const errorClasses = cx([withVendorCSSClassPrefix("recovery__error")], errorClassName);
206
+ const messageClasses = cx([withVendorCSSClassPrefix("recovery__messages")], messageClassName);
207
+ const renderComponents = useCallback((components) => renderRecoveryComponents(components, formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, {
208
+ _customRenderers: customRenderers,
209
+ _theme: theme,
210
+ buttonClassName: buttonClasses,
211
+ inputClassName: inputClasses,
212
+ meta,
213
+ onInputBlur: handleInputBlur,
214
+ onSubmit: handleSubmit,
215
+ size,
216
+ variant
217
+ }), [
218
+ customRenderers,
219
+ buttonClasses,
220
+ formErrors,
221
+ formValues,
222
+ handleInputBlur,
223
+ handleSubmit,
224
+ inputClasses,
225
+ isFormValid,
226
+ meta,
227
+ isLoading,
228
+ size,
229
+ theme,
230
+ touchedFields,
231
+ variant
232
+ ]);
233
+ useEffect(() => {
234
+ if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
235
+ initializationAttemptedRef.current = true;
236
+ (async () => {
237
+ setIsLoading(true);
238
+ setApiError(null);
239
+ clearMessages();
240
+ try {
241
+ const rawResponse = await onInitialize?.();
242
+ if (!rawResponse) return;
243
+ const response = normalizeFlowResponseLocal(rawResponse);
244
+ if (response.challengeToken !== void 0) challengeTokenRef.current = response.challengeToken ?? null;
245
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Error) {
246
+ handleError(response);
247
+ onError?.(new Error(extractErrorMessage(response, t)));
248
+ }
249
+ setCurrentFlow(response);
250
+ setIsFlowInitialized(true);
251
+ onFlowChange?.(response);
252
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Complete) {
253
+ onComplete?.(response);
254
+ return;
255
+ }
256
+ if (response.flowStatus === EmbeddedRecoveryFlowStatus.Incomplete) {
257
+ setupFormFields(response);
258
+ if (response?.error) handleError(response);
259
+ }
260
+ } catch (err) {
261
+ handleError(err);
262
+ onError?.(err);
263
+ } finally {
264
+ setIsLoading(false);
265
+ }
266
+ })();
267
+ }
268
+ }, [
269
+ isFlowInitialized,
270
+ isInitialized,
271
+ normalizeFlowResponseLocal,
272
+ onComplete,
273
+ onError,
274
+ onFlowChange,
275
+ onInitialize,
276
+ setupFormFields,
277
+ t
278
+ ]);
279
+ if (children) {
280
+ if (typeof children === "function") return /* @__PURE__ */ jsx("div", {
281
+ className: containerClasses,
282
+ children: children({
283
+ components: currentFlow?.data?.components || [],
284
+ error: apiError,
285
+ fieldErrors: formErrors,
286
+ handleInputChange,
287
+ handleSubmit,
288
+ isLoading,
289
+ isValid: isFormValid,
290
+ messages: flowMessages || [],
291
+ meta,
292
+ subtitle: flowSubtitle || t("recovery.subheading"),
293
+ title: flowTitle || t("recovery.heading"),
294
+ touched: touchedFields,
295
+ validateForm: () => {
296
+ const result = validateForm();
297
+ return {
298
+ fieldErrors: result.errors,
299
+ isValid: result.isValid
300
+ };
301
+ },
302
+ values: formValues
303
+ })
304
+ });
305
+ return /* @__PURE__ */ jsx("div", {
306
+ className: containerClasses,
307
+ children
308
+ });
309
+ }
310
+ if (!isFlowInitialized && isLoading) return /* @__PURE__ */ jsx(Card_default, {
311
+ className: cx(containerClasses, styles.card),
312
+ variant,
313
+ children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsx("div", {
314
+ className: styles.loadingContainer,
315
+ children: /* @__PURE__ */ jsx(Spinner_default, { size: "medium" })
316
+ }) })
317
+ });
318
+ if (!currentFlow) return /* @__PURE__ */ jsx(Card_default, {
319
+ className: cx(containerClasses, styles.card),
320
+ variant,
321
+ children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsxs(Alert_default, {
322
+ variant: "error",
323
+ className: errorClasses,
324
+ children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: t("errors.heading") }), /* @__PURE__ */ jsx(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })]
325
+ }) })
326
+ });
327
+ const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(currentFlow.data?.components || [], flowTitle, flowSubtitle, t("recovery.heading"), t("recovery.subheading"));
328
+ return /* @__PURE__ */ jsxs(Card_default, {
329
+ className: cx(containerClasses, styles.card),
330
+ variant,
331
+ children: [(showTitle || showSubtitle) && /* @__PURE__ */ jsxs(Card_default.Header, {
332
+ className: styles.header,
333
+ children: [showTitle && /* @__PURE__ */ jsx(Card_default.Title, {
334
+ level: 2,
335
+ className: styles.title,
336
+ children: title
337
+ }), showSubtitle && /* @__PURE__ */ jsx(Typography_default, {
338
+ variant: "body1",
339
+ className: styles.subtitle,
340
+ children: subtitle
341
+ })]
342
+ }), /* @__PURE__ */ jsxs(Card_default.Content, { children: [
343
+ externalError && /* @__PURE__ */ jsx("div", {
344
+ className: styles.flowMessagesContainer,
345
+ children: /* @__PURE__ */ jsx(Alert_default, {
346
+ variant: "error",
347
+ className: cx(styles.flowMessageItem, messageClasses),
348
+ children: /* @__PURE__ */ jsx(Alert_default.Description, { children: externalError.message })
349
+ })
350
+ }),
351
+ flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx("div", {
352
+ className: styles.flowMessagesContainer,
353
+ children: flowMessages.map((message, index) => /* @__PURE__ */ jsx(Alert_default, {
354
+ variant: message.type?.toLowerCase() === "error" ? "error" : "info",
355
+ className: cx(styles.flowMessageItem, messageClasses),
356
+ children: /* @__PURE__ */ jsx(Alert_default.Description, { children: message.message })
357
+ }, message.id || index))
358
+ }),
359
+ /* @__PURE__ */ jsx("div", {
360
+ className: styles.contentContainer,
361
+ children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx(Alert_default, {
362
+ variant: "warning",
363
+ children: /* @__PURE__ */ jsx(Typography_default, {
364
+ variant: "body1",
365
+ children: t("errors.recovery.components.not.available")
366
+ })
367
+ })
368
+ })
369
+ ] })]
370
+ });
12
371
  };
13
- var BaseRecovery_default$2 = BaseRecovery;
372
+ /**
373
+ * BaseRecovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
374
+ * Accepts API functions as props to maintain framework independence.
375
+ */
376
+ const BaseRecovery = ({ preferences, showLogo = true,...rest }) => {
377
+ const { theme, colorScheme } = useTheme_default();
378
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
379
+ const content = /* @__PURE__ */ jsxs("div", { children: [showLogo && /* @__PURE__ */ jsx("div", {
380
+ className: styles.logoContainer,
381
+ children: /* @__PURE__ */ jsx(Logo_default, { size: "large" })
382
+ }), /* @__PURE__ */ jsx(FlowProvider_default, { children: /* @__PURE__ */ jsx(BaseRecoveryContent, {
383
+ showLogo,
384
+ ...rest
385
+ }) })] });
386
+ if (!preferences) return content;
387
+ return /* @__PURE__ */ jsx(ComponentPreferencesContext_default.Provider, {
388
+ value: preferences,
389
+ children: content
390
+ });
391
+ };
392
+ var BaseRecovery_default = BaseRecovery;
14
393
 
15
394
  //#endregion
16
- export { BaseRecovery_default$2 as default };
395
+ export { BaseRecovery_default as default };
17
396
  //# sourceMappingURL=BaseRecovery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseRecovery.js","names":["BaseRecovery: FC<BaseRecoveryProps>","useThunderID","BaseRecoveryV2","BaseRecoveryV1"],"sources":["../../../../../src/components/presentation/auth/Recovery/BaseRecovery.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Platform} from '@thunderid/browser';\nimport {FC} from 'react';\nimport BaseRecoveryV1, {BaseRecoveryProps as BaseRecoveryV1Props} from './v1/BaseRecovery';\nimport BaseRecoveryV2, {BaseRecoveryProps as BaseRecoveryV2Props} from './v2/BaseRecovery';\nimport useThunderID from '../../../../contexts/ThunderID/useThunderID';\n\nexport type BaseRecoveryProps = BaseRecoveryV1Props | BaseRecoveryV2Props;\n\nconst BaseRecovery: FC<BaseRecoveryProps> = (props: BaseRecoveryProps) => {\n const {platform} = useThunderID();\n\n if (platform === Platform.ThunderID) {\n return <BaseRecoveryV2 {...(props as BaseRecoveryV2Props)} />;\n }\n\n return <BaseRecoveryV1 {...(props as BaseRecoveryV1Props)} />;\n};\n\nexport default BaseRecovery;\n"],"mappings":";;;;;;;AA0BA,MAAMA,gBAAuC,UAA6B;CACxE,MAAM,EAAC,aAAYC,sBAAc;AAEjC,KAAI,aAAa,SAAS,UACxB,QAAO,oBAACC,0BAAe,GAAK,QAAiC;AAG/D,QAAO,oBAACC,wBAAe,GAAK,QAAiC;;AAG/D,6BAAe"}
1
+ {"version":3,"file":"BaseRecovery.js","names":["BaseRecoveryContent: FC<BaseRecoveryProps>","useTheme","customRenderers: ComponentRendererMap","ComponentRendererContext","useTranslation","useFlow","useThunderID","styles: any","useStyles","initializationAttemptedRef: any","challengeTokenRef: any","handleError: any","errorMessage: string","normalizeFlowResponseLocal: any","extractFormFields: any","fields: FormField[]","fieldName: any","responseFieldErrors: FieldError[] | undefined","errors: Record<string, string>","setupFormFields: any","fields: any","initialValues: Record<string, string>","filteredInputs: Record<string, any>","payload: EmbeddedRecoveryFlowRequest","rawResponse: any","response: any","containerClasses: any","inputClasses: any","buttonClasses: any","errorClasses: any","messageClasses: any","renderComponents: any","result: ReturnType<typeof validateForm>","CardPrimitive","Spinner","AlertPrimitive","getAuthComponentHeadings","Typography","BaseRecovery: FC<BaseRecoveryProps>","content: ReactElement","Logo","FlowProvider","ComponentPreferencesContext"],"sources":["../../../../../src/components/presentation/auth/Recovery/BaseRecovery.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {\n EmbeddedRecoveryFlowRequest,\n EmbeddedRecoveryFlowResponse,\n EmbeddedRecoveryFlowStatus,\n EmbeddedFlowComponentType,\n FieldError,\n withVendorCSSClassPrefix,\n buildValidatorFromRules,\n Preferences,\n FlowMetadataResponse,\n} from '@thunderid/browser';\nimport {FC, ReactElement, ReactNode, useContext, useEffect, useState, useCallback, useRef} from 'react';\nimport ComponentRendererContext, {\n ComponentRendererMap,\n} from '../../../../contexts/ComponentRenderer/ComponentRendererContext';\nimport FlowProvider from '../../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../../contexts/Flow/useFlow';\nimport ComponentPreferencesContext from '../../../../contexts/I18n/ComponentPreferencesContext';\nimport useTheme from '../../../../contexts/Theme/useTheme';\nimport useThunderID from '../../../../contexts/ThunderID/useThunderID';\nimport {useForm, FormField} from '../../../../hooks/useForm';\nimport useTranslation from '../../../../hooks/useTranslation';\nimport {normalizeFlowResponse, extractErrorMessage} from '../../../../utils/flowTransformer';\nimport getAuthComponentHeadings from '../../../../utils/getAuthComponentHeadings';\nimport AlertPrimitive from '../../../primitives/Alert/Alert';\nimport CardPrimitive, {CardProps} from '../../../primitives/Card/Card';\nimport Logo from '../../../primitives/Logo/Logo';\nimport Spinner from '../../../primitives/Spinner/Spinner';\nimport Typography from '../../../primitives/Typography/Typography';\nimport {renderRecoveryComponents} from '../AuthOptionFactory';\nimport useStyles from '../SignUp/BaseSignUp.styles';\n\n/**\n * Render props for custom UI rendering.\n */\nexport interface BaseRecoveryRenderProps {\n components: any[];\n error?: Error | null;\n fieldErrors: Record<string, string>;\n handleInputChange: (name: string, value: string) => void;\n handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;\n isLoading: boolean;\n isValid: boolean;\n messages: {message: string; type: string}[];\n meta: FlowMetadataResponse | null;\n subtitle: string;\n title: string;\n touched: Record<string, boolean>;\n validateForm: () => {fieldErrors: Record<string, string>; isValid: boolean};\n values: Record<string, string>;\n}\n\n/**\n * Props for the BaseRecovery component.\n */\nexport interface BaseRecoveryProps {\n afterRecoveryUrl?: string;\n buttonClassName?: string;\n /**\n * Render props function for custom UI or static content\n */\n children?: ((props: BaseRecoveryRenderProps) => ReactNode) | ReactNode;\n className?: string;\n error?: Error | null;\n errorClassName?: string;\n inputClassName?: string;\n isInitialized?: boolean;\n messageClassName?: string;\n onComplete?: (response: EmbeddedRecoveryFlowResponse) => void;\n onError?: (error: Error) => void;\n onFlowChange?: (response: EmbeddedRecoveryFlowResponse) => void;\n onInitialize?: (payload?: EmbeddedRecoveryFlowRequest) => Promise<EmbeddedRecoveryFlowResponse>;\n onSubmit?: (payload: EmbeddedRecoveryFlowRequest) => Promise<EmbeddedRecoveryFlowResponse>;\n /**\n * Component-level preferences to override global i18n and theme settings.\n */\n preferences?: Preferences;\n showLogo?: boolean;\n showSubtitle?: boolean;\n showTitle?: boolean;\n size?: 'small' | 'medium' | 'large';\n variant?: CardProps['variant'];\n}\n\n/**\n * Internal component that renders the V2 recovery UI and manages flow state.\n *\n * @internal\n */\nconst BaseRecoveryContent: FC<BaseRecoveryProps> = ({\n onInitialize,\n onSubmit,\n onError,\n onFlowChange,\n onComplete,\n error: externalError,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n isInitialized,\n children,\n showTitle = true,\n showSubtitle = true,\n}: BaseRecoveryProps): ReactElement => {\n const {theme, colorScheme} = useTheme();\n const customRenderers: ComponentRendererMap = useContext(ComponentRendererContext);\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages} = useFlow();\n const {meta} = useThunderID();\n const styles: any = useStyles(theme, colorScheme);\n\n const [isLoading, setIsLoading] = useState(false);\n const [isFlowInitialized, setIsFlowInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedRecoveryFlowResponse | null>(null);\n const [apiError, setApiError] = useState<Error | null>(null);\n\n const initializationAttemptedRef: any = useRef(false);\n const challengeTokenRef: any = useRef<string | null>(null);\n\n const handleError: any = useCallback(\n (error: any) => {\n const errorMessage: string = extractErrorMessage(error, t);\n setApiError(error instanceof Error ? error : new Error(errorMessage));\n clearMessages();\n addMessage({message: errorMessage, type: 'error'});\n },\n [t, addMessage, clearMessages],\n );\n\n const normalizeFlowResponseLocal: any = useCallback(\n (response: EmbeddedRecoveryFlowResponse): EmbeddedRecoveryFlowResponse => {\n if (response?.data?.components && Array.isArray(response.data.components)) {\n return response;\n }\n\n if (response?.data) {\n const {components} = normalizeFlowResponse(\n response,\n t,\n {defaultErrorKey: 'components.recovery.errors.generic', resolveTranslations: false},\n meta,\n );\n\n return {...response, data: {...response.data, components: components as any}};\n }\n\n return response;\n },\n [t, meta],\n );\n\n const extractFormFields: any = useCallback(\n (components: any[]): FormField[] => {\n const fields: FormField[] = [];\n\n const processComponents = (comps: any[]): any => {\n comps.forEach((component: any) => {\n if (\n component.type === EmbeddedFlowComponentType.TextInput ||\n component.type === EmbeddedFlowComponentType.PasswordInput ||\n component.type === EmbeddedFlowComponentType.EmailInput ||\n component.type === EmbeddedFlowComponentType.Select ||\n component.type === EmbeddedFlowComponentType.DateInput\n ) {\n const fieldName: any = component.ref || component.id;\n const ruleValidator = buildValidatorFromRules(component.validation);\n fields.push({\n initialValue: '',\n name: fieldName,\n required: component.required || false,\n validator: (value: string) => {\n if (component.required && (!value || value.trim() === '')) {\n return t('validations.required.field.error');\n }\n if (\n (component.type === EmbeddedFlowComponentType.EmailInput || component.variant === 'EMAIL') &&\n value &&\n !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)\n ) {\n return t('field.email.invalid');\n }\n // Evaluate declarative validation rules from meta.components[].validation.\n if (ruleValidator && value) {\n const ruleMessage = ruleValidator(value);\n if (ruleMessage) {\n return t(ruleMessage);\n }\n }\n return null;\n },\n });\n }\n\n if (component.components && Array.isArray(component.components)) {\n processComponents(component.components);\n }\n });\n };\n\n processComponents(components);\n return fields;\n },\n [t],\n );\n\n const formFields: any = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];\n\n const form: any = useForm<Record<string, string>>({\n fields: formFields,\n initialValues: {},\n requiredMessage: t('validations.required.field.error'),\n validateOnBlur: true,\n validateOnChange: false,\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n setErrors: setFormErrors,\n clearErrors: clearFormErrors,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n /**\n * Project server-side validation errors from the most recent flow response into the\n * form's `errors` state. See BaseSignIn for the same pattern.\n */\n useEffect(() => {\n clearFormErrors();\n const responseFieldErrors: FieldError[] | undefined = (currentFlow?.data as any)?.fieldErrors;\n if (!responseFieldErrors || responseFieldErrors.length === 0) {\n return;\n }\n const errors: Record<string, string> = {};\n for (const fe of responseFieldErrors) {\n if (!(fe.identifier in errors)) {\n errors[fe.identifier] = fe.message;\n }\n }\n setFormErrors(errors);\n Object.keys(errors).forEach((field: string) => setFormTouched(field, true));\n }, [currentFlow, setFormErrors, setFormTouched, clearFormErrors]);\n\n const setupFormFields: any = useCallback(\n (flowResponse: EmbeddedRecoveryFlowResponse) => {\n const fields: any = extractFormFields(flowResponse.data?.components || []);\n const initialValues: Record<string, string> = {};\n fields.forEach((field: any) => {\n initialValues[field.name] = field.initialValue || '';\n });\n resetForm();\n Object.keys(initialValues).forEach((key: any) => setFormValue(key, initialValues[key]));\n },\n [extractFormFields, resetForm, setFormValue],\n );\n\n const handleInputChange = (name: string, value: string): void => {\n setFormValue(name, value);\n };\n\n const handleInputBlur = (name: string): void => {\n setFormTouched(name, true);\n };\n\n const handleSubmit = async (component: any, data?: Record<string, any>, skipValidation?: boolean): Promise<void> => {\n if (!currentFlow) return;\n\n if (!skipValidation) {\n touchAllFields();\n const validation: ReturnType<typeof validateForm> = validateForm();\n if (!validation.isValid) return;\n }\n\n setIsLoading(true);\n setApiError(null);\n clearMessages();\n\n try {\n const filteredInputs: Record<string, any> = {};\n if (data) {\n Object.entries(data).forEach(([key, value]: [string, any]) => {\n if (value !== null && value !== undefined && value !== '') {\n filteredInputs[key] = value;\n }\n });\n }\n\n const payload: EmbeddedRecoveryFlowRequest = {\n ...(currentFlow.executionId && {executionId: currentFlow.executionId}),\n ...(component.id && {action: component.id}),\n ...(challengeTokenRef.current ? {challengeToken: challengeTokenRef.current} : {}),\n inputs: filteredInputs,\n };\n\n const rawResponse: any = await onSubmit?.(payload);\n if (!rawResponse) return;\n const response: any = normalizeFlowResponseLocal(rawResponse);\n onFlowChange?.(response);\n\n if (response.challengeToken !== undefined) {\n challengeTokenRef.current = response.challengeToken ?? null;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Error) {\n handleError(response);\n onError?.(new Error(extractErrorMessage(response, t)));\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Incomplete) {\n setCurrentFlow(response);\n setupFormFields(response);\n\n // Display error from INCOMPLETE response\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (response?.error) {\n handleError(response);\n }\n }\n } catch (err) {\n handleError(err);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const containerClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery'),\n withVendorCSSClassPrefix(`recovery--${size}`),\n withVendorCSSClassPrefix(`recovery--${variant}`),\n ],\n className,\n );\n\n const inputClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery__input'),\n size === 'small' && withVendorCSSClassPrefix('recovery__input--small'),\n size === 'large' && withVendorCSSClassPrefix('recovery__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery__button'),\n size === 'small' && withVendorCSSClassPrefix('recovery__button--small'),\n size === 'large' && withVendorCSSClassPrefix('recovery__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses: any = cx([withVendorCSSClassPrefix('recovery__error')], errorClassName);\n const messageClasses: any = cx([withVendorCSSClassPrefix('recovery__messages')], messageClassName);\n\n const renderComponents: any = useCallback(\n (components: any[]): ReactElement[] =>\n renderRecoveryComponents(\n components,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n handleInputChange,\n {\n _customRenderers: customRenderers,\n _theme: theme,\n buttonClassName: buttonClasses,\n inputClassName: inputClasses,\n meta,\n onInputBlur: handleInputBlur,\n onSubmit: handleSubmit,\n size,\n variant,\n },\n ),\n [\n customRenderers,\n buttonClasses,\n formErrors,\n formValues,\n handleInputBlur,\n handleSubmit,\n inputClasses,\n isFormValid,\n meta,\n isLoading,\n size,\n theme,\n touchedFields,\n variant,\n ],\n );\n\n useEffect(() => {\n if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {\n initializationAttemptedRef.current = true;\n\n (async (): Promise<void> => {\n setIsLoading(true);\n setApiError(null);\n clearMessages();\n\n try {\n const rawResponse: any = await onInitialize?.();\n if (!rawResponse) return;\n const response: any = normalizeFlowResponseLocal(rawResponse);\n\n if (response.challengeToken !== undefined) {\n challengeTokenRef.current = response.challengeToken ?? null;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Error) {\n handleError(response);\n onError?.(new Error(extractErrorMessage(response, t)));\n }\n\n setCurrentFlow(response);\n setIsFlowInitialized(true);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatus.Incomplete) {\n setupFormFields(response);\n\n // Display error from INCOMPLETE response\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (response?.error) {\n handleError(response);\n }\n }\n } catch (err) {\n handleError(err);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }\n }, [\n isFlowInitialized,\n isInitialized,\n normalizeFlowResponseLocal,\n onComplete,\n onError,\n onFlowChange,\n onInitialize,\n setupFormFields,\n t,\n ]);\n\n if (children) {\n if (typeof children === 'function') {\n const renderProps: BaseRecoveryRenderProps = {\n components: currentFlow?.data?.components || [],\n error: apiError,\n fieldErrors: formErrors,\n handleInputChange,\n handleSubmit,\n isLoading,\n isValid: isFormValid,\n messages: flowMessages || [],\n meta,\n subtitle: flowSubtitle || t('recovery.subheading'),\n title: flowTitle || t('recovery.heading'),\n touched: touchedFields,\n validateForm: (): {fieldErrors: Record<string, string>; isValid: boolean} => {\n const result: ReturnType<typeof validateForm> = validateForm();\n return {fieldErrors: result.errors, isValid: result.isValid};\n },\n values: formValues,\n };\n\n return <div className={containerClasses}>{(children as any)(renderProps)}</div>;\n }\n\n return <div className={containerClasses}>{children}</div>;\n }\n\n if (!isFlowInitialized && isLoading) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n <CardPrimitive.Content>\n <div className={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n </div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n if (!currentFlow) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n <CardPrimitive.Content>\n <AlertPrimitive variant=\"error\" className={errorClasses}>\n <AlertPrimitive.Title>{t('errors.heading')}</AlertPrimitive.Title>\n <AlertPrimitive.Description>{t('errors.recovery.flow.initialization.failure')}</AlertPrimitive.Description>\n </AlertPrimitive>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n const componentsToRender: any = currentFlow.data?.components || [];\n const {title, subtitle, componentsWithoutHeadings} = getAuthComponentHeadings(\n componentsToRender,\n flowTitle,\n flowSubtitle,\n t('recovery.heading'),\n t('recovery.subheading'),\n );\n\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n {(showTitle || showSubtitle) && (\n <CardPrimitive.Header className={styles.header}>\n {showTitle && (\n <CardPrimitive.Title level={2} className={styles.title}>\n {title}\n </CardPrimitive.Title>\n )}\n {showSubtitle && (\n <Typography variant=\"body1\" className={styles.subtitle}>\n {subtitle}\n </Typography>\n )}\n </CardPrimitive.Header>\n )}\n <CardPrimitive.Content>\n {externalError && (\n <div className={styles.flowMessagesContainer}>\n <AlertPrimitive variant=\"error\" className={cx(styles.flowMessageItem, messageClasses)}>\n <AlertPrimitive.Description>{externalError.message}</AlertPrimitive.Description>\n </AlertPrimitive>\n </div>\n )}\n {flowMessages && flowMessages.length > 0 && (\n <div className={styles.flowMessagesContainer}>\n {flowMessages.map((message: any, index: number) => (\n <AlertPrimitive\n key={message.id || index}\n variant={message.type?.toLowerCase() === 'error' ? 'error' : 'info'}\n className={cx(styles.flowMessageItem, messageClasses)}\n >\n <AlertPrimitive.Description>{message.message}</AlertPrimitive.Description>\n </AlertPrimitive>\n ))}\n </div>\n )}\n <div className={styles.contentContainer}>\n {componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? (\n renderComponents(componentsWithoutHeadings)\n ) : (\n <AlertPrimitive variant=\"warning\">\n <Typography variant=\"body1\">{t('errors.recovery.components.not.available')}</Typography>\n </AlertPrimitive>\n )}\n </div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n};\n\n/**\n * BaseRecovery component for ThunderIDV2 that provides an embedded account/password recovery flow.\n * Accepts API functions as props to maintain framework independence.\n */\nconst BaseRecovery: FC<BaseRecoveryProps> = ({\n preferences,\n showLogo = true,\n ...rest\n}: BaseRecoveryProps): ReactElement => {\n const {theme, colorScheme} = useTheme();\n const styles: any = useStyles(theme, colorScheme);\n\n const content: ReactElement = (\n <div>\n {showLogo && (\n <div className={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n )}\n <FlowProvider>\n <BaseRecoveryContent showLogo={showLogo} {...rest} />\n </FlowProvider>\n </div>\n );\n\n if (!preferences) return content;\n\n return <ComponentPreferencesContext.Provider value={preferences}>{content}</ComponentPreferencesContext.Provider>;\n};\n\nexport default BaseRecovery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,MAAMA,uBAA8C,EAClD,cACA,UACA,SACA,cACA,YACA,OAAO,eACP,YAAY,IACZ,iBAAiB,IACjB,kBAAkB,IAClB,iBAAiB,IACjB,mBAAmB,IACnB,OAAO,UACP,UAAU,YACV,eACA,UACA,YAAY,MACZ,eAAe,WACsB;CACrC,MAAM,EAAC,OAAO,gBAAeC,kBAAU;CACvC,MAAMC,kBAAwC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AO,iBAAiB,eAAe;eAErD,oBAACA,cAAe,yBAAa,QAAQ,UAAqC;OAJrE,QAAQ,MAAM,MAKJ,CACjB;KACE;GAER,oBAAC;IAAI,WAAW,OAAO;cACpB,6BAA6B,0BAA0B,SAAS,IAC/D,iBAAiB,0BAA0B,GAE3C,oBAACA;KAAe,SAAQ;eACtB,oBAACE;MAAW,SAAQ;gBAAS,EAAE,2CAA2C;OAAc;MACzE;KAEf;MACgB;GACV;;;;;;AAQpB,MAAMC,gBAAuC,EAC3C,aACA,WAAW,KACX,GAAG,WACkC;CACrC,MAAM,EAAC,OAAO,gBAAerC,kBAAU;CACvC,MAAMM,SAAcC,0BAAU,OAAO,YAAY;CAEjD,MAAM+B,UACJ,qBAAC,oBACE,YACC,oBAAC;EAAI,WAAW,OAAO;YACrB,oBAACC,gBAAK,MAAK,UAAU;GACjB,EAER,oBAACC,kCACC,oBAAC;EAA8B;EAAU,GAAI;GAAQ,GACxC,IACX;AAGR,KAAI,CAAC,YAAa,QAAO;AAEzB,QAAO,oBAACC,oCAA4B;EAAS,OAAO;YAAc;GAA+C;;AAGnH,2BAAe"}
@@ -15,34 +15,33 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { FC } from 'react';
19
- import { RecoveryProps as RecoveryV1Props } from './v1/Recovery';
20
- import { RecoveryProps as RecoveryV2Props } from './v2/Recovery';
18
+ import { FC, PropsWithChildren } from 'react';
19
+ import { BaseRecoveryProps } from './BaseRecovery';
20
+ export type RecoveryProps = PropsWithChildren<BaseRecoveryProps & {
21
+ /**
22
+ * URL query parameter name that carries the recovery token when the user lands via a recovery link.
23
+ * When set and both `executionId` and this param are present in the URL, the component resumes the
24
+ * existing flow instead of starting a new one.
25
+ *
26
+ * @example
27
+ * // For a link like /recovery?executionId=xxx&recoveryToken=yyy
28
+ * <Recovery tokenUrlParam="recoveryToken" />
29
+ */
30
+ tokenUrlParam?: string;
31
+ }>;
21
32
  /**
22
- * Props for the Recovery component.
23
- * Extends RecoveryV1Props & RecoveryV2Props for full compatibility with both implementations.
24
- */
25
- export type RecoveryProps = RecoveryV1Props | RecoveryV2Props;
26
- /**
27
- * Recovery component that provides an embedded account/password recovery flow.
28
- * Routes to the appropriate version-specific implementation based on the platform.
33
+ * Recovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
29
34
  *
30
35
  * @example
31
36
  * ```tsx
32
- * import { Recovery } from '@thunderid/react';
33
- *
34
- * const App = () => (
35
- * <Recovery
36
- * afterRecoveryUrl="/sign-in"
37
- * onComplete={(response) => console.log('Recovery complete', response)}
38
- * onError={(error) => console.error('Recovery failed', error)}
39
- * />
40
- * );
41
- * ```
37
+ * // Default UI
38
+ * <Recovery
39
+ * afterRecoveryUrl="/sign-in"
40
+ * onComplete={(response) => console.log('Recovery complete', response)}
41
+ * onError={(error) => console.error('Recovery failed', error)}
42
+ * />
42
43
  *
43
- * @example
44
44
  * // Custom UI with render props
45
- * ```tsx
46
45
  * <Recovery>
47
46
  * {({ values, fieldErrors, handleInputChange, handleSubmit, isLoading, components }) => (
48
47
  * <form onSubmit={(e) => { e.preventDefault(); handleSubmit(components[0], values); }}>
@@ -1 +1 @@
1
- {"version":3,"file":"Recovery.d.ts","sourceRoot":"","sources":["../../../../../src/components/presentation/auth/Recovery/Recovery.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAmB,EAAC,aAAa,IAAI,eAAe,EAAC,MAAM,eAAe,CAAC;AAC3E,OAAmB,EAAC,aAAa,IAAI,eAAe,EAAC,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAQ/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Recovery.d.ts","sourceRoot":"","sources":["../../../../../src/components/presentation/auth/Recovery/Recovery.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AACvE,OAAqB,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAG/D,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAC3C,iBAAiB,GAAG;IAClB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA2E/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,30 +1,23 @@
1
1
  import useThunderID_default from "../../../../contexts/ThunderID/useThunderID.js";
2
- import Recovery_default from "./v1/Recovery.js";
3
- import Recovery_default$1 from "./v2/Recovery.js";
4
- import { Platform } from "@thunderid/browser";
2
+ import BaseRecovery_default from "./BaseRecovery.js";
3
+ import { EmbeddedFlowType } from "@thunderid/browser";
4
+ import { useCallback } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/presentation/auth/Recovery/Recovery.tsx
8
8
  /**
9
- * Recovery component that provides an embedded account/password recovery flow.
10
- * Routes to the appropriate version-specific implementation based on the platform.
9
+ * Recovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
11
10
  *
12
11
  * @example
13
12
  * ```tsx
14
- * import { Recovery } from '@thunderid/react';
13
+ * // Default UI
14
+ * <Recovery
15
+ * afterRecoveryUrl="/sign-in"
16
+ * onComplete={(response) => console.log('Recovery complete', response)}
17
+ * onError={(error) => console.error('Recovery failed', error)}
18
+ * />
15
19
  *
16
- * const App = () => (
17
- * <Recovery
18
- * afterRecoveryUrl="/sign-in"
19
- * onComplete={(response) => console.log('Recovery complete', response)}
20
- * onError={(error) => console.error('Recovery failed', error)}
21
- * />
22
- * );
23
- * ```
24
- *
25
- * @example
26
20
  * // Custom UI with render props
27
- * ```tsx
28
21
  * <Recovery>
29
22
  * {({ values, fieldErrors, handleInputChange, handleSubmit, isLoading, components }) => (
30
23
  * <form onSubmit={(e) => { e.preventDefault(); handleSubmit(components[0], values); }}>
@@ -34,13 +27,48 @@ import { jsx } from "react/jsx-runtime";
34
27
  * </Recovery>
35
28
  * ```
36
29
  */
37
- const Recovery = (props) => {
38
- const { platform } = useThunderID_default();
39
- if (platform === Platform.ThunderID) return /* @__PURE__ */ jsx(Recovery_default$1, { ...props });
40
- return /* @__PURE__ */ jsx(Recovery_default, { ...props });
30
+ const Recovery = ({ className, size = "medium", afterRecoveryUrl, onError, onComplete, tokenUrlParam, children,...rest }) => {
31
+ const { recover, isInitialized, applicationId } = useThunderID_default();
32
+ return /* @__PURE__ */ jsx(BaseRecovery_default, {
33
+ afterRecoveryUrl,
34
+ onInitialize: useCallback(async (payload) => {
35
+ const urlParams = new URL(window.location.href).searchParams;
36
+ const applicationIdFromUrl = urlParams.get("applicationId");
37
+ const effectiveApplicationId = applicationId ?? applicationIdFromUrl;
38
+ if (tokenUrlParam) {
39
+ const executionId = urlParams.get("executionId");
40
+ const tokenValue = urlParams.get(tokenUrlParam);
41
+ if (executionId && tokenValue) return await recover({
42
+ executionId,
43
+ inputs: { [tokenUrlParam]: tokenValue }
44
+ });
45
+ }
46
+ return await recover(payload ?? {
47
+ flowType: EmbeddedFlowType.Recovery,
48
+ ...effectiveApplicationId && { applicationId: effectiveApplicationId }
49
+ });
50
+ }, [
51
+ applicationId,
52
+ tokenUrlParam,
53
+ recover
54
+ ]),
55
+ onSubmit: useCallback(async (payload) => await recover(payload), [recover]),
56
+ onError,
57
+ onComplete: useCallback((response) => {
58
+ onComplete?.(response);
59
+ if (afterRecoveryUrl) window.location.href = afterRecoveryUrl;
60
+ }, [onComplete, afterRecoveryUrl]),
61
+ className,
62
+ size,
63
+ isInitialized,
64
+ showTitle: true,
65
+ showSubtitle: true,
66
+ children,
67
+ ...rest
68
+ });
41
69
  };
42
- var Recovery_default$2 = Recovery;
70
+ var Recovery_default = Recovery;
43
71
 
44
72
  //#endregion
45
- export { Recovery_default$2 as default };
73
+ export { Recovery_default as default };
46
74
  //# sourceMappingURL=Recovery.js.map