@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.
- package/dist/ThunderIDReactClient.d.ts +4 -4
- package/dist/ThunderIDReactClient.d.ts.map +1 -1
- package/dist/ThunderIDReactClient.js +6 -6
- package/dist/ThunderIDReactClient.js.map +1 -1
- package/dist/cjs/ThunderIDReactClient.cjs +5 -5
- package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
- package/dist/cjs/components/actions/SignInButton/SignInButton.cjs.map +1 -1
- package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
- package/dist/cjs/components/auth/Callback/Callback.cjs +1 -1
- package/dist/cjs/components/auth/Callback/Callback.cjs.map +1 -1
- package/dist/cjs/components/auth/Callback/TokenCallback.cjs +3 -3
- package/dist/cjs/components/auth/Callback/TokenCallback.cjs.map +1 -1
- package/dist/cjs/components/factories/FieldFactory.cjs +2 -2
- package/dist/cjs/components/factories/FieldFactory.cjs.map +1 -1
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs +1 -1
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs +1 -1
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs +3 -3
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.cjs → AcceptInvite.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/AcceptInvite/AcceptInvite.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.cjs → BaseAcceptInvite.cjs} +47 -18
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.cjs → BaseAcceptInvite.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +50 -32
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.cjs → BaseInviteUser.cjs} +44 -15
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.cjs → BaseInviteUser.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/InviteUser.cjs → InviteUser.cjs} +3 -3
- package/dist/cjs/components/presentation/auth/InviteUser/InviteUser.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.cjs → OrganizationUnitPicker.cjs} +3 -3
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.cjs → OrganizationUnitPicker.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs +389 -8
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs +51 -22
- package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs +346 -8
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs +547 -36
- package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs +691 -8
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs +66 -76
- package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs.map +1 -1
- package/dist/cjs/components/primitives/Alert/Alert.cjs +1 -1
- package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/primitives/FormControl/FormControl.cjs +1 -1
- package/dist/cjs/components/primitives/Toggle/Toggle.cjs +1 -1
- package/dist/cjs/contexts/ComponentRenderer/ComponentRendererContext.cjs.map +1 -1
- package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs +5 -7
- package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs.map +1 -1
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs +76 -37
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +0 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +0 -3
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
- package/dist/cjs/hooks/{v2/useOAuthCallback.cjs → useOAuthCallback.cjs} +2 -2
- package/dist/cjs/hooks/useOAuthCallback.cjs.map +1 -0
- package/dist/cjs/index.cjs +47 -50
- package/dist/cjs/utils/{v2/buildThemeConfigFromFlowMeta.cjs → buildThemeConfigFromFlowMeta.cjs} +1 -1
- package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs.map +1 -0
- package/dist/cjs/utils/{v2/flowTransformer.cjs → flowTransformer.cjs} +1 -1
- package/dist/cjs/utils/flowTransformer.cjs.map +1 -0
- package/dist/cjs/utils/{v2/getAuthComponentHeadings.cjs → getAuthComponentHeadings.cjs} +1 -1
- package/dist/cjs/utils/getAuthComponentHeadings.cjs.map +1 -0
- package/dist/cjs/utils/{v2/passkey.cjs → passkey.cjs} +2 -2
- package/dist/cjs/utils/passkey.cjs.map +1 -0
- package/dist/cjs/utils/{v2/resolveTranslationsInArray.cjs → resolveTranslationsInArray.cjs} +1 -1
- package/dist/cjs/utils/resolveTranslationsInArray.cjs.map +1 -0
- package/dist/cjs/utils/{v2/resolveTranslationsInObject.cjs → resolveTranslationsInObject.cjs} +2 -2
- package/dist/cjs/utils/resolveTranslationsInObject.cjs.map +1 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts.map +1 -1
- package/dist/components/actions/SignInButton/SignInButton.js.map +1 -1
- package/dist/components/adapters/Consent.d.ts +1 -1
- package/dist/components/adapters/Consent.d.ts.map +1 -1
- package/dist/components/adapters/Consent.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
- package/dist/components/auth/Callback/Callback.d.ts +1 -1
- package/dist/components/auth/Callback/Callback.js +1 -1
- package/dist/components/auth/Callback/Callback.js.map +1 -1
- package/dist/components/auth/Callback/TokenCallback.js +4 -4
- package/dist/components/auth/Callback/TokenCallback.js.map +1 -1
- package/dist/components/factories/FieldFactory.d.ts +2 -2
- package/dist/components/factories/FieldFactory.js +2 -2
- package/dist/components/factories/FieldFactory.js.map +1 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js +1 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.js +3 -3
- package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.js → AcceptInvite.js} +1 -1
- package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.d.ts → BaseAcceptInvite.d.ts} +3 -2
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.js → BaseAcceptInvite.js} +45 -17
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.js → BaseAcceptInvite.styles.js} +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +4 -4
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.js +51 -33
- package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.d.ts → BaseInviteUser.d.ts} +3 -2
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.js → BaseInviteUser.js} +44 -15
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.js → BaseInviteUser.styles.js} +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/InviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.js → InviteUser.js} +2 -2
- package/dist/components/presentation/auth/InviteUser/InviteUser.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts +4 -4
- package/dist/components/presentation/auth/InviteUser/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.js → OrganizationUnitPicker.js} +2 -2
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.js → OrganizationUnitPicker.styles.js} +1 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +2 -2
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +63 -4
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js +389 -10
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js.map +1 -1
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts +21 -22
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/Recovery.js +51 -23
- package/dist/components/presentation/auth/Recovery/Recovery.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts +213 -6
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js +346 -10
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts +122 -13
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/SignIn.js +548 -38
- package/dist/components/presentation/auth/SignIn/SignIn.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts +164 -6
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js +691 -10
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts +15 -74
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/SignUp.js +67 -77
- package/dist/components/presentation/auth/SignUp/SignUp.js.map +1 -1
- package/dist/components/primitives/Alert/Alert.js +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.js +1 -1
- package/dist/components/primitives/FormControl/FormControl.js +1 -1
- package/dist/components/primitives/Toggle/Toggle.js +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.js.map +1 -1
- package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts.map +1 -1
- package/dist/contexts/FlowMeta/FlowMetaProvider.js +6 -8
- package/dist/contexts/FlowMeta/FlowMetaProvider.js.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.d.ts +19 -39
- package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.js +76 -38
- package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +1 -2
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js +0 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js +1 -4
- package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
- package/dist/hooks/useOAuthCallback.d.ts.map +1 -0
- package/dist/hooks/{v2/useOAuthCallback.js → useOAuthCallback.js} +1 -1
- package/dist/hooks/useOAuthCallback.js.map +1 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -35
- package/dist/utils/buildThemeConfigFromFlowMeta.d.ts.map +1 -0
- package/dist/utils/{v2/buildThemeConfigFromFlowMeta.js → buildThemeConfigFromFlowMeta.js} +1 -1
- package/dist/utils/buildThemeConfigFromFlowMeta.js.map +1 -0
- package/dist/utils/{v2/flowTransformer.d.ts → flowTransformer.d.ts} +3 -3
- package/dist/utils/flowTransformer.d.ts.map +1 -0
- package/dist/utils/{v2/flowTransformer.js → flowTransformer.js} +1 -1
- package/dist/utils/flowTransformer.js.map +1 -0
- package/dist/utils/{v2/getAuthComponentHeadings.d.ts → getAuthComponentHeadings.d.ts} +1 -1
- package/dist/utils/getAuthComponentHeadings.d.ts.map +1 -0
- package/dist/utils/{v2/getAuthComponentHeadings.js → getAuthComponentHeadings.js} +1 -1
- package/dist/utils/getAuthComponentHeadings.js.map +1 -0
- package/dist/utils/passkey.d.ts.map +1 -0
- package/dist/utils/{v2/passkey.js → passkey.js} +1 -1
- package/dist/utils/passkey.js.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInArray.d.ts → resolveTranslationsInArray.d.ts} +1 -1
- package/dist/utils/resolveTranslationsInArray.d.ts.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInArray.js → resolveTranslationsInArray.js} +1 -1
- package/dist/utils/resolveTranslationsInArray.js.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInObject.d.ts → resolveTranslationsInObject.d.ts} +1 -1
- package/dist/utils/resolveTranslationsInObject.d.ts.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInObject.js → resolveTranslationsInObject.js} +1 -1
- package/dist/utils/resolveTranslationsInObject.js.map +1 -0
- package/package.json +10 -10
- package/dist/cjs/components/adapters/CheckboxInput.cjs +0 -30
- package/dist/cjs/components/adapters/CheckboxInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/DateInput.cjs +0 -30
- package/dist/cjs/components/adapters/DateInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/DividerComponent.cjs +0 -24
- package/dist/cjs/components/adapters/DividerComponent.cjs.map +0 -1
- package/dist/cjs/components/adapters/EmailInput.cjs +0 -30
- package/dist/cjs/components/adapters/EmailInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/FormContainer.cjs +0 -36
- package/dist/cjs/components/adapters/FormContainer.cjs.map +0 -1
- package/dist/cjs/components/adapters/NumberInput.cjs +0 -30
- package/dist/cjs/components/adapters/NumberInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/PasswordInput.cjs +0 -52
- package/dist/cjs/components/adapters/PasswordInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/SelectInput.cjs +0 -36
- package/dist/cjs/components/adapters/SelectInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/SubmitButton.cjs +0 -61
- package/dist/cjs/components/adapters/SubmitButton.cjs.map +0 -1
- package/dist/cjs/components/adapters/TelephoneInput.cjs +0 -32
- package/dist/cjs/components/adapters/TelephoneInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/TextInput.cjs +0 -30
- package/dist/cjs/components/adapters/TextInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/Typography.cjs +0 -60
- package/dist/cjs/components/adapters/Typography.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/AcceptInvite.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/InviteUser.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs +0 -293
- package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs +0 -43
- package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs +0 -163
- package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs +0 -378
- package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs +0 -78
- package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs +0 -734
- package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs +0 -59
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs +0 -139
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs +0 -147
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs +0 -38
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs +0 -60
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs +0 -330
- package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs +0 -560
- package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs +0 -451
- package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs +0 -54
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs +0 -164
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs +0 -656
- package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs +0 -80
- package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs.map +0 -1
- package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs +0 -190
- package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs.map +0 -1
- package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs +0 -108
- package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs.map +0 -1
- package/dist/cjs/hooks/v2/useOAuthCallback.cjs.map +0 -1
- package/dist/cjs/utils/v2/buildThemeConfigFromFlowMeta.cjs.map +0 -1
- package/dist/cjs/utils/v2/flowTransformer.cjs.map +0 -1
- package/dist/cjs/utils/v2/getAuthComponentHeadings.cjs.map +0 -1
- package/dist/cjs/utils/v2/passkey.cjs.map +0 -1
- package/dist/cjs/utils/v2/resolveTranslationsInArray.cjs.map +0 -1
- package/dist/cjs/utils/v2/resolveTranslationsInObject.cjs.map +0 -1
- package/dist/components/adapters/CheckboxInput.d.ts +0 -25
- package/dist/components/adapters/CheckboxInput.d.ts.map +0 -1
- package/dist/components/adapters/CheckboxInput.js +0 -28
- package/dist/components/adapters/CheckboxInput.js.map +0 -1
- package/dist/components/adapters/DateInput.d.ts +0 -25
- package/dist/components/adapters/DateInput.d.ts.map +0 -1
- package/dist/components/adapters/DateInput.js +0 -28
- package/dist/components/adapters/DateInput.js.map +0 -1
- package/dist/components/adapters/DividerComponent.d.ts +0 -25
- package/dist/components/adapters/DividerComponent.d.ts.map +0 -1
- package/dist/components/adapters/DividerComponent.js +0 -22
- package/dist/components/adapters/DividerComponent.js.map +0 -1
- package/dist/components/adapters/EmailInput.d.ts +0 -25
- package/dist/components/adapters/EmailInput.d.ts.map +0 -1
- package/dist/components/adapters/EmailInput.js +0 -28
- package/dist/components/adapters/EmailInput.js.map +0 -1
- package/dist/components/adapters/FormContainer.d.ts +0 -25
- package/dist/components/adapters/FormContainer.d.ts.map +0 -1
- package/dist/components/adapters/FormContainer.js +0 -34
- package/dist/components/adapters/FormContainer.js.map +0 -1
- package/dist/components/adapters/NumberInput.d.ts +0 -25
- package/dist/components/adapters/NumberInput.d.ts.map +0 -1
- package/dist/components/adapters/NumberInput.js +0 -28
- package/dist/components/adapters/NumberInput.js.map +0 -1
- package/dist/components/adapters/PasswordInput.d.ts +0 -25
- package/dist/components/adapters/PasswordInput.d.ts.map +0 -1
- package/dist/components/adapters/PasswordInput.js +0 -50
- package/dist/components/adapters/PasswordInput.js.map +0 -1
- package/dist/components/adapters/SelectInput.d.ts +0 -25
- package/dist/components/adapters/SelectInput.d.ts.map +0 -1
- package/dist/components/adapters/SelectInput.js +0 -34
- package/dist/components/adapters/SelectInput.js.map +0 -1
- package/dist/components/adapters/SocialButton.d.ts +0 -25
- package/dist/components/adapters/SocialButton.d.ts.map +0 -1
- package/dist/components/adapters/SubmitButton.d.ts +0 -25
- package/dist/components/adapters/SubmitButton.d.ts.map +0 -1
- package/dist/components/adapters/SubmitButton.js +0 -59
- package/dist/components/adapters/SubmitButton.js.map +0 -1
- package/dist/components/adapters/TelephoneInput.d.ts +0 -25
- package/dist/components/adapters/TelephoneInput.d.ts.map +0 -1
- package/dist/components/adapters/TelephoneInput.js +0 -30
- package/dist/components/adapters/TelephoneInput.js.map +0 -1
- package/dist/components/adapters/TextInput.d.ts +0 -25
- package/dist/components/adapters/TextInput.d.ts.map +0 -1
- package/dist/components/adapters/TextInput.js +0 -28
- package/dist/components/adapters/TextInput.js.map +0 -1
- package/dist/components/adapters/Typography.d.ts +0 -25
- package/dist/components/adapters/Typography.d.ts.map +0 -1
- package/dist/components/adapters/Typography.js +0 -58
- package/dist/components/adapters/Typography.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +0 -74
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js +0 -288
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +0 -26
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/Recovery.js +0 -40
- package/dist/components/presentation/auth/Recovery/v1/Recovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +0 -46
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js +0 -160
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +0 -83
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js +0 -373
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +0 -56
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/Recovery.js +0 -74
- package/dist/components/presentation/auth/Recovery/v2/Recovery.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +0 -131
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js +0 -729
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js +0 -55
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts +0 -27
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js +0 -136
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +0 -77
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js +0 -143
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js +0 -36
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js +0 -56
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts +0 -125
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +0 -222
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js +0 -325
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +0 -165
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/SignIn.js +0 -556
- package/dist/components/presentation/auth/SignIn/v2/SignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +0 -174
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js +0 -446
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts +0 -39
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUp.js +0 -51
- package/dist/components/presentation/auth/SignUp/v1/SignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +0 -46
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js +0 -160
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +0 -186
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js +0 -651
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts +0 -39
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/SignUp.js +0 -77
- package/dist/components/presentation/auth/SignUp/v2/SignUp.js.map +0 -1
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts +0 -89
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts.map +0 -1
- package/dist/contexts/Theme/v1/ThemeProvider.js +0 -186
- package/dist/contexts/Theme/v1/ThemeProvider.js.map +0 -1
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts +0 -58
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts.map +0 -1
- package/dist/contexts/Theme/v2/ThemeProvider.js +0 -104
- package/dist/contexts/Theme/v2/ThemeProvider.js.map +0 -1
- package/dist/hooks/v2/useOAuthCallback.d.ts.map +0 -1
- package/dist/hooks/v2/useOAuthCallback.js.map +0 -1
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts.map +0 -1
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.js.map +0 -1
- package/dist/utils/v2/flowTransformer.d.ts.map +0 -1
- package/dist/utils/v2/flowTransformer.js.map +0 -1
- package/dist/utils/v2/getAuthComponentHeadings.d.ts.map +0 -1
- package/dist/utils/v2/getAuthComponentHeadings.js.map +0 -1
- package/dist/utils/v2/passkey.d.ts.map +0 -1
- package/dist/utils/v2/passkey.js.map +0 -1
- package/dist/utils/v2/resolveTranslationsInArray.d.ts.map +0 -1
- package/dist/utils/v2/resolveTranslationsInArray.js.map +0 -1
- package/dist/utils/v2/resolveTranslationsInObject.d.ts.map +0 -1
- package/dist/utils/v2/resolveTranslationsInObject.js.map +0 -1
- /package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.d.ts → AcceptInvite.d.ts} +0 -0
- /package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.d.ts → BaseAcceptInvite.styles.d.ts} +0 -0
- /package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.d.ts → BaseInviteUser.styles.d.ts} +0 -0
- /package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.d.ts → InviteUser.d.ts} +0 -0
- /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.d.ts → OrganizationUnitPicker.d.ts} +0 -0
- /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.d.ts → OrganizationUnitPicker.styles.d.ts} +0 -0
- /package/dist/hooks/{v2/useOAuthCallback.d.ts → useOAuthCallback.d.ts} +0 -0
- /package/dist/utils/{v2/buildThemeConfigFromFlowMeta.d.ts → buildThemeConfigFromFlowMeta.d.ts} +0 -0
- /package/dist/utils/{v2/passkey.d.ts → passkey.d.ts} +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
-
*
|
|
4
|
-
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
import { EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from '@thunderid/browser';
|
|
19
|
-
import { FC, ReactNode } from 'react';
|
|
20
|
-
import { CardProps } from '../../../../primitives/Card/Card';
|
|
21
|
-
/**
|
|
22
|
-
* Render props for custom UI rendering
|
|
23
|
-
*/
|
|
24
|
-
export interface BaseSignUpRenderProps {
|
|
25
|
-
/**
|
|
26
|
-
* Flow components
|
|
27
|
-
*/
|
|
28
|
-
components: any[];
|
|
29
|
-
/**
|
|
30
|
-
* Form errors
|
|
31
|
-
*/
|
|
32
|
-
errors: Record<string, string>;
|
|
33
|
-
/**
|
|
34
|
-
* Function to handle input changes
|
|
35
|
-
*/
|
|
36
|
-
handleInputChange: (name: string, value: string) => void;
|
|
37
|
-
/**
|
|
38
|
-
* Function to handle form submission
|
|
39
|
-
*/
|
|
40
|
-
handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Loading state
|
|
43
|
-
*/
|
|
44
|
-
isLoading: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Whether the form is valid
|
|
47
|
-
*/
|
|
48
|
-
isValid: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Flow messages
|
|
51
|
-
*/
|
|
52
|
-
messages: {
|
|
53
|
-
message: string;
|
|
54
|
-
type: string;
|
|
55
|
-
}[];
|
|
56
|
-
/**
|
|
57
|
-
* Flow subtitle
|
|
58
|
-
*/
|
|
59
|
-
subtitle: string;
|
|
60
|
-
/**
|
|
61
|
-
* Flow title
|
|
62
|
-
*/
|
|
63
|
-
title: string;
|
|
64
|
-
/**
|
|
65
|
-
* Touched fields
|
|
66
|
-
*/
|
|
67
|
-
touched: Record<string, boolean>;
|
|
68
|
-
/**
|
|
69
|
-
* Function to validate the form
|
|
70
|
-
*/
|
|
71
|
-
validateForm: () => {
|
|
72
|
-
errors: Record<string, string>;
|
|
73
|
-
isValid: boolean;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Form values
|
|
77
|
-
*/
|
|
78
|
-
values: Record<string, string>;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Props for the BaseSignUp component.
|
|
82
|
-
*/
|
|
83
|
-
export interface BaseSignUpProps {
|
|
84
|
-
/**
|
|
85
|
-
* URL to redirect after successful sign-up.
|
|
86
|
-
*/
|
|
87
|
-
afterSignUpUrl?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Custom CSS class name for the submit button.
|
|
90
|
-
*/
|
|
91
|
-
buttonClassName?: string;
|
|
92
|
-
/**
|
|
93
|
-
* Render props function for custom UI
|
|
94
|
-
*/
|
|
95
|
-
children?: (props: BaseSignUpRenderProps) => ReactNode;
|
|
96
|
-
/**
|
|
97
|
-
* Custom CSS class name for the form container.
|
|
98
|
-
*/
|
|
99
|
-
className?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Custom CSS class name for error messages.
|
|
102
|
-
*/
|
|
103
|
-
errorClassName?: string;
|
|
104
|
-
/**
|
|
105
|
-
* Custom CSS class name for form inputs.
|
|
106
|
-
*/
|
|
107
|
-
inputClassName?: string;
|
|
108
|
-
isInitialized?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Custom CSS class name for info messages.
|
|
111
|
-
*/
|
|
112
|
-
messageClassName?: string;
|
|
113
|
-
/**
|
|
114
|
-
* Callback function called when the sign-up flow completes and requires redirection.
|
|
115
|
-
* This allows platform-specific handling of redirects (e.g., Next.js router.push).
|
|
116
|
-
* @param response - The response from the sign-up flow containing the redirect URL, etc.
|
|
117
|
-
*/
|
|
118
|
-
onComplete?: (response: EmbeddedFlowExecuteResponse) => void;
|
|
119
|
-
/**
|
|
120
|
-
* Callback function called when sign-up fails.
|
|
121
|
-
* @param error - The error that occurred during sign-up.
|
|
122
|
-
*/
|
|
123
|
-
onError?: (error: Error) => void;
|
|
124
|
-
/**
|
|
125
|
-
* Callback function called when sign-up flow status changes.
|
|
126
|
-
* @param response - The current sign-up response.
|
|
127
|
-
*/
|
|
128
|
-
onFlowChange?: (response: EmbeddedFlowExecuteResponse) => void;
|
|
129
|
-
/**
|
|
130
|
-
* Function to initialize sign-up flow.
|
|
131
|
-
* @returns Promise resolving to the initial sign-up response.
|
|
132
|
-
*/
|
|
133
|
-
onInitialize?: (payload?: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
|
|
134
|
-
/**
|
|
135
|
-
* Function to handle sign-up steps.
|
|
136
|
-
* @param payload - The sign-up payload.
|
|
137
|
-
* @returns Promise resolving to the sign-up response.
|
|
138
|
-
*/
|
|
139
|
-
onSubmit?: (payload: EmbeddedFlowExecuteRequestPayload) => Promise<EmbeddedFlowExecuteResponse>;
|
|
140
|
-
/**
|
|
141
|
-
* Whether to redirect after sign-up.
|
|
142
|
-
*/
|
|
143
|
-
shouldRedirectAfterSignUp?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Whether to show the logo.
|
|
146
|
-
*/
|
|
147
|
-
showLogo?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Whether to show the subtitle.
|
|
150
|
-
*/
|
|
151
|
-
showSubtitle?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Whether to show the title.
|
|
154
|
-
*/
|
|
155
|
-
showTitle?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* Size variant for the component.
|
|
158
|
-
*/
|
|
159
|
-
size?: 'small' | 'medium' | 'large';
|
|
160
|
-
/**
|
|
161
|
-
* Theme variant for the component.
|
|
162
|
-
*/
|
|
163
|
-
variant?: CardProps['variant'];
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* BaseSignUp component that provides embedded sign-up flow for ThunderID.
|
|
167
|
-
* This component handles both the presentation layer and sign-up flow logic.
|
|
168
|
-
* It accepts API functions as props to maintain framework independence.
|
|
169
|
-
*
|
|
170
|
-
* @internal
|
|
171
|
-
*/
|
|
172
|
-
declare const BaseSignUp: FC<BaseSignUpProps>;
|
|
173
|
-
export default BaseSignUp;
|
|
174
|
-
//# sourceMappingURL=BaseSignUp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSignUp.d.ts","sourceRoot":"","sources":["../../../../../../src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAM5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,EAAE,EAAgB,SAAS,EAA2C,MAAM,OAAO,CAAC;AAU5F,OAAsB,EAAC,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAW1E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,UAAU,EAAE,GAAG,EAAE,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/B;;OAEG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzD;;OAEG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5E;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAE5C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;OAEG;IACH,YAAY,EAAE,MAAM;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC;IAEvE;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,SAAS,CAAC;IAEvD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAC;IAE/D;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,iCAAiC,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAErG;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAChG;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEpC;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAmlBD;;;;;;GAMG;AACH,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAgBnC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
import FlowProvider_default from "../../../../../contexts/Flow/FlowProvider.js";
|
|
2
|
-
import useThunderID_default from "../../../../../contexts/ThunderID/useThunderID.js";
|
|
3
|
-
import useFlow_default from "../../../../../contexts/Flow/useFlow.js";
|
|
4
|
-
import useTheme_default from "../../../../../contexts/Theme/useTheme.js";
|
|
5
|
-
import useTranslation_default from "../../../../../hooks/useTranslation.js";
|
|
6
|
-
import { useForm } from "../../../../../hooks/useForm.js";
|
|
7
|
-
import Spinner_default from "../../../../primitives/Spinner/Spinner.js";
|
|
8
|
-
import Typography_default from "../../../../primitives/Typography/Typography.js";
|
|
9
|
-
import Alert_default from "../../../../primitives/Alert/Alert.js";
|
|
10
|
-
import Card_default from "../../../../primitives/Card/Card.js";
|
|
11
|
-
import Logo_default from "../../../../primitives/Logo/Logo.js";
|
|
12
|
-
import { renderSignUpComponents } from "./SignUpOptionFactory.js";
|
|
13
|
-
import BaseSignUp_styles_default from "../BaseSignUp.styles.js";
|
|
14
|
-
import { EmbeddedFlowComponentType, EmbeddedFlowResponseType, EmbeddedFlowStatus, createPackageComponentLogger, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
15
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { cx } from "@emotion/css";
|
|
18
|
-
|
|
19
|
-
//#region src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
20
|
-
const logger$1 = createPackageComponentLogger("@thunderid/react", "BaseSignUp");
|
|
21
|
-
/**
|
|
22
|
-
* Component that consumes FlowContext and renders the sign-up UI.
|
|
23
|
-
*
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
const BaseSignUpContent = ({ afterSignUpUrl, onInitialize, onSubmit, onError, onFlowChange, onComplete, className = "", inputClassName = "", buttonClassName = "", errorClassName = "", messageClassName = "", size = "medium", variant = "outlined", isInitialized, children, showTitle = true, showSubtitle = true }) => {
|
|
27
|
-
const { theme, colorScheme } = useTheme_default();
|
|
28
|
-
const { t } = useTranslation_default();
|
|
29
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
30
|
-
useThunderID_default();
|
|
31
|
-
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
32
|
-
const handleError = useCallback((error) => {
|
|
33
|
-
let errorMessage = t("errors.signup.flow.failure");
|
|
34
|
-
if (error && typeof error === "object") {
|
|
35
|
-
if (error.code && (error.message || error.description)) errorMessage = error.description || error.message;
|
|
36
|
-
else if (error instanceof Error && error.name === "ThunderIDAPIError") try {
|
|
37
|
-
const errorResponse = JSON.parse(error.message);
|
|
38
|
-
if (errorResponse.description) errorMessage = errorResponse.description;
|
|
39
|
-
else if (errorResponse.message) errorMessage = errorResponse.message;
|
|
40
|
-
else errorMessage = error.message;
|
|
41
|
-
} catch {
|
|
42
|
-
errorMessage = error.message;
|
|
43
|
-
}
|
|
44
|
-
else if (error.message) errorMessage = error.message;
|
|
45
|
-
} else if (typeof error === "string") errorMessage = error;
|
|
46
|
-
clearMessages();
|
|
47
|
-
addMessage({
|
|
48
|
-
message: errorMessage,
|
|
49
|
-
type: "error"
|
|
50
|
-
});
|
|
51
|
-
}, [
|
|
52
|
-
t,
|
|
53
|
-
addMessage,
|
|
54
|
-
clearMessages
|
|
55
|
-
]);
|
|
56
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
57
|
-
const [isFlowInitialized, setIsFlowInitialized] = useState(false);
|
|
58
|
-
const [currentFlow, setCurrentFlow] = useState(null);
|
|
59
|
-
const initializationAttemptedRef = useRef(false);
|
|
60
|
-
/**
|
|
61
|
-
* Extract form fields from flow components
|
|
62
|
-
*/
|
|
63
|
-
const extractFormFields = useCallback((components) => {
|
|
64
|
-
const fields = [];
|
|
65
|
-
const processComponents = (comps) => {
|
|
66
|
-
comps.forEach((component) => {
|
|
67
|
-
if (component.type === EmbeddedFlowComponentType.Input) {
|
|
68
|
-
const config = component.config || {};
|
|
69
|
-
fields.push({
|
|
70
|
-
initialValue: config.defaultValue || "",
|
|
71
|
-
name: config.name || component.id,
|
|
72
|
-
required: config.required || false,
|
|
73
|
-
validator: (value) => {
|
|
74
|
-
if (config.required && (!value || value.trim() === "")) return t("validations.required.field.error");
|
|
75
|
-
if (config.type === "email" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) return t("field.email.invalid");
|
|
76
|
-
if (config.type === "password" && value && value.length < 8) return t("field.password.weak");
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (component.components && Array.isArray(component.components)) processComponents(component.components);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
processComponents(components);
|
|
85
|
-
return fields;
|
|
86
|
-
}, [t]);
|
|
87
|
-
const { values: formValues, touched: touchedFields, errors: formErrors, isValid: isFormValid, setValue: setFormValue, setTouched: setFormTouched, validateForm, reset: resetForm } = useForm({
|
|
88
|
-
fields: currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [],
|
|
89
|
-
initialValues: {},
|
|
90
|
-
requiredMessage: t("validations.required.field.error"),
|
|
91
|
-
validateOnBlur: true,
|
|
92
|
-
validateOnChange: true
|
|
93
|
-
});
|
|
94
|
-
/**
|
|
95
|
-
* Setup form fields based on the current flow.
|
|
96
|
-
*/
|
|
97
|
-
const setupFormFields = useCallback((flowResponse) => {
|
|
98
|
-
const fields = extractFormFields(flowResponse.data?.components || []);
|
|
99
|
-
const initialValues = {};
|
|
100
|
-
fields.forEach((field) => {
|
|
101
|
-
initialValues[field.name] = field.initialValue || "";
|
|
102
|
-
});
|
|
103
|
-
resetForm();
|
|
104
|
-
Object.keys(initialValues).forEach((key) => {
|
|
105
|
-
setFormValue(key, initialValues[key]);
|
|
106
|
-
});
|
|
107
|
-
}, [
|
|
108
|
-
extractFormFields,
|
|
109
|
-
resetForm,
|
|
110
|
-
setFormValue
|
|
111
|
-
]);
|
|
112
|
-
/**
|
|
113
|
-
* Handle input value changes.
|
|
114
|
-
*/
|
|
115
|
-
const handleInputChange = (name, value) => {
|
|
116
|
-
setFormValue(name, value);
|
|
117
|
-
setFormTouched(name, true);
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Check if the response contains a redirection URL and perform the redirect if necessary.
|
|
121
|
-
* @param response - The sign-up response
|
|
122
|
-
* @returns true if a redirect was performed, false otherwise
|
|
123
|
-
*/
|
|
124
|
-
const handleRedirectionIfNeeded = (response) => {
|
|
125
|
-
if (response?.type === EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
126
|
-
/**
|
|
127
|
-
* Open a popup window to handle redirection prompts for social sign-up
|
|
128
|
-
*/
|
|
129
|
-
const redirectUrl = response.data.redirectURL;
|
|
130
|
-
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
131
|
-
if (!popup) {
|
|
132
|
-
logger$1.error("Failed to open popup window");
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Use `let` for messageHandler and popupMonitor to resolve circular references:
|
|
137
|
-
* messageHandler <-> cleanup <-> popupMonitor.
|
|
138
|
-
* All are assigned before any of them can be invoked at runtime.
|
|
139
|
-
*/
|
|
140
|
-
let hasProcessedCallback = false;
|
|
141
|
-
let popupMonitor;
|
|
142
|
-
let messageHandler;
|
|
143
|
-
const cleanup = () => {
|
|
144
|
-
window.removeEventListener("message", messageHandler);
|
|
145
|
-
if (popupMonitor) clearInterval(popupMonitor);
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Add an event listener to the window to capture the message from the popup
|
|
149
|
-
*/
|
|
150
|
-
messageHandler = async function messageEventHandler(event) {
|
|
151
|
-
/**
|
|
152
|
-
* Check if the message is from our popup window
|
|
153
|
-
*/
|
|
154
|
-
if (event.source !== popup) return;
|
|
155
|
-
/**
|
|
156
|
-
* Check the origin of the message to ensure it's from a trusted source
|
|
157
|
-
*/
|
|
158
|
-
const expectedOrigin = afterSignUpUrl ? new URL(afterSignUpUrl).origin : window.location.origin;
|
|
159
|
-
if (event.origin !== expectedOrigin && event.origin !== window.location.origin) return;
|
|
160
|
-
const { code, state } = event.data;
|
|
161
|
-
if (code && state) {
|
|
162
|
-
const payload = {
|
|
163
|
-
...currentFlow.flowId && { flowId: currentFlow.flowId },
|
|
164
|
-
actionId: "",
|
|
165
|
-
flowType: currentFlow.flowType || "REGISTRATION",
|
|
166
|
-
inputs: {
|
|
167
|
-
code,
|
|
168
|
-
state
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
try {
|
|
172
|
-
const continueResponse = await onSubmit(payload);
|
|
173
|
-
onFlowChange?.(continueResponse);
|
|
174
|
-
if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) onComplete?.(continueResponse);
|
|
175
|
-
else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {
|
|
176
|
-
setCurrentFlow(continueResponse);
|
|
177
|
-
setupFormFields(continueResponse);
|
|
178
|
-
}
|
|
179
|
-
popup.close();
|
|
180
|
-
cleanup();
|
|
181
|
-
} catch (err) {
|
|
182
|
-
handleError(err);
|
|
183
|
-
onError?.(err);
|
|
184
|
-
popup.close();
|
|
185
|
-
cleanup();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
window.addEventListener("message", messageHandler);
|
|
190
|
-
/**
|
|
191
|
-
* Monitor popup for closure and URL changes
|
|
192
|
-
*/
|
|
193
|
-
popupMonitor = setInterval(async () => {
|
|
194
|
-
try {
|
|
195
|
-
if (popup.closed) {
|
|
196
|
-
cleanup();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
if (hasProcessedCallback) return;
|
|
200
|
-
try {
|
|
201
|
-
const popupUrl = popup.location.href;
|
|
202
|
-
if (popupUrl && (popupUrl.includes("code=") || popupUrl.includes("error="))) {
|
|
203
|
-
hasProcessedCallback = true;
|
|
204
|
-
const url = new URL(popupUrl);
|
|
205
|
-
const code = url.searchParams.get("code");
|
|
206
|
-
const state = url.searchParams.get("state");
|
|
207
|
-
if (url.searchParams.get("error")) {
|
|
208
|
-
logger$1.error("OAuth error:");
|
|
209
|
-
popup.close();
|
|
210
|
-
cleanup();
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
if (code && state) {
|
|
214
|
-
const payload = {
|
|
215
|
-
...currentFlow.flowId && { flowId: currentFlow.flowId },
|
|
216
|
-
actionId: "",
|
|
217
|
-
flowType: currentFlow.flowType || "REGISTRATION",
|
|
218
|
-
inputs: {
|
|
219
|
-
code,
|
|
220
|
-
state
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
try {
|
|
224
|
-
const continueResponse = await onSubmit(payload);
|
|
225
|
-
onFlowChange?.(continueResponse);
|
|
226
|
-
if (continueResponse.flowStatus === EmbeddedFlowStatus.Complete) onComplete?.(continueResponse);
|
|
227
|
-
else if (continueResponse.flowStatus === EmbeddedFlowStatus.Incomplete) {
|
|
228
|
-
setCurrentFlow(continueResponse);
|
|
229
|
-
setupFormFields(continueResponse);
|
|
230
|
-
}
|
|
231
|
-
popup.close();
|
|
232
|
-
} catch (err) {
|
|
233
|
-
handleError(err);
|
|
234
|
-
onError?.(err);
|
|
235
|
-
popup.close();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
} catch (e) {}
|
|
240
|
-
} catch (e) {
|
|
241
|
-
logger$1.error("Error monitoring popup:");
|
|
242
|
-
}
|
|
243
|
-
}, 1e3);
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
return false;
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* Handle component submission (for buttons outside forms).
|
|
250
|
-
*/
|
|
251
|
-
const handleSubmit = async (component, data) => {
|
|
252
|
-
if (!currentFlow) return;
|
|
253
|
-
setIsLoading(true);
|
|
254
|
-
clearMessages();
|
|
255
|
-
try {
|
|
256
|
-
const filteredInputs = {};
|
|
257
|
-
if (data) Object.entries(data).forEach(([key, value]) => {
|
|
258
|
-
if (value !== null && value !== void 0 && value !== "") filteredInputs[key] = value;
|
|
259
|
-
});
|
|
260
|
-
const actionId = component.id;
|
|
261
|
-
const response = await onSubmit({
|
|
262
|
-
...currentFlow.flowId && { flowId: currentFlow.flowId },
|
|
263
|
-
flowType: currentFlow.flowType || "REGISTRATION",
|
|
264
|
-
inputs: filteredInputs,
|
|
265
|
-
...actionId && { actionId }
|
|
266
|
-
});
|
|
267
|
-
onFlowChange?.(response);
|
|
268
|
-
if (response.flowStatus === EmbeddedFlowStatus.Complete) {
|
|
269
|
-
onComplete?.(response);
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
if (response.flowStatus === EmbeddedFlowStatus.Incomplete) {
|
|
273
|
-
if (handleRedirectionIfNeeded(response)) return;
|
|
274
|
-
setCurrentFlow(response);
|
|
275
|
-
setupFormFields(response);
|
|
276
|
-
}
|
|
277
|
-
} catch (err) {
|
|
278
|
-
handleError(err);
|
|
279
|
-
onError?.(err);
|
|
280
|
-
} finally {
|
|
281
|
-
setIsLoading(false);
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
const containerClasses = cx([
|
|
285
|
-
withVendorCSSClassPrefix("signup"),
|
|
286
|
-
withVendorCSSClassPrefix(`signup--${size}`),
|
|
287
|
-
withVendorCSSClassPrefix(`signup--${variant}`)
|
|
288
|
-
], className);
|
|
289
|
-
const inputClasses = cx([
|
|
290
|
-
withVendorCSSClassPrefix("signup__input"),
|
|
291
|
-
size === "small" && withVendorCSSClassPrefix("signup__input--small"),
|
|
292
|
-
size === "large" && withVendorCSSClassPrefix("signup__input--large")
|
|
293
|
-
], inputClassName);
|
|
294
|
-
const buttonClasses = cx([
|
|
295
|
-
withVendorCSSClassPrefix("signup__button"),
|
|
296
|
-
size === "small" && withVendorCSSClassPrefix("signup__button--small"),
|
|
297
|
-
size === "large" && withVendorCSSClassPrefix("signup__button--large")
|
|
298
|
-
], buttonClassName);
|
|
299
|
-
const errorClasses = cx([withVendorCSSClassPrefix("signup__error")], errorClassName);
|
|
300
|
-
const messageClasses = cx([withVendorCSSClassPrefix("signup__messages")], messageClassName);
|
|
301
|
-
/**
|
|
302
|
-
* Render form components based on flow data using the factory
|
|
303
|
-
*/
|
|
304
|
-
const renderComponents = useCallback((components) => renderSignUpComponents(components, formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, {
|
|
305
|
-
buttonClassName: buttonClasses,
|
|
306
|
-
inputClassName: inputClasses,
|
|
307
|
-
onSubmit: handleSubmit,
|
|
308
|
-
size,
|
|
309
|
-
variant
|
|
310
|
-
}), [
|
|
311
|
-
formValues,
|
|
312
|
-
touchedFields,
|
|
313
|
-
formErrors,
|
|
314
|
-
isFormValid,
|
|
315
|
-
isLoading,
|
|
316
|
-
size,
|
|
317
|
-
variant,
|
|
318
|
-
inputClasses,
|
|
319
|
-
buttonClasses,
|
|
320
|
-
handleSubmit
|
|
321
|
-
]);
|
|
322
|
-
useEffect(() => {
|
|
323
|
-
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
324
|
-
initializationAttemptedRef.current = true;
|
|
325
|
-
(async () => {
|
|
326
|
-
setIsLoading(true);
|
|
327
|
-
clearMessages();
|
|
328
|
-
try {
|
|
329
|
-
const response = await onInitialize?.();
|
|
330
|
-
setCurrentFlow(response);
|
|
331
|
-
setIsFlowInitialized(true);
|
|
332
|
-
onFlowChange?.(response);
|
|
333
|
-
if (response.flowStatus === EmbeddedFlowStatus.Complete) {
|
|
334
|
-
onComplete?.(response);
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
if (response.flowStatus === EmbeddedFlowStatus.Incomplete) setupFormFields(response);
|
|
338
|
-
} catch (err) {
|
|
339
|
-
handleError(err);
|
|
340
|
-
onError?.(err);
|
|
341
|
-
} finally {
|
|
342
|
-
setIsLoading(false);
|
|
343
|
-
}
|
|
344
|
-
})();
|
|
345
|
-
}
|
|
346
|
-
}, [
|
|
347
|
-
isInitialized,
|
|
348
|
-
isFlowInitialized,
|
|
349
|
-
onInitialize,
|
|
350
|
-
onComplete,
|
|
351
|
-
onError,
|
|
352
|
-
onFlowChange,
|
|
353
|
-
setupFormFields,
|
|
354
|
-
afterSignUpUrl,
|
|
355
|
-
t
|
|
356
|
-
]);
|
|
357
|
-
if (children) return /* @__PURE__ */ jsx("div", {
|
|
358
|
-
className: containerClasses,
|
|
359
|
-
children: children({
|
|
360
|
-
components: currentFlow?.data?.components || [],
|
|
361
|
-
errors: formErrors,
|
|
362
|
-
handleInputChange,
|
|
363
|
-
handleSubmit,
|
|
364
|
-
isLoading,
|
|
365
|
-
isValid: isFormValid,
|
|
366
|
-
messages: flowMessages || [],
|
|
367
|
-
subtitle: flowSubtitle || t("signup.subheading"),
|
|
368
|
-
title: flowTitle || t("signup.heading"),
|
|
369
|
-
touched: touchedFields,
|
|
370
|
-
validateForm,
|
|
371
|
-
values: formValues
|
|
372
|
-
})
|
|
373
|
-
});
|
|
374
|
-
if (!isFlowInitialized && isLoading) return /* @__PURE__ */ jsx(Card_default, {
|
|
375
|
-
className: cx(containerClasses, styles.card),
|
|
376
|
-
variant,
|
|
377
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsx("div", {
|
|
378
|
-
className: styles.loadingContainer,
|
|
379
|
-
children: /* @__PURE__ */ jsx(Spinner_default, { size: "medium" })
|
|
380
|
-
}) })
|
|
381
|
-
});
|
|
382
|
-
if (!currentFlow) return /* @__PURE__ */ jsx(Card_default, {
|
|
383
|
-
className: cx(containerClasses, styles.card),
|
|
384
|
-
variant,
|
|
385
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsxs(Alert_default, {
|
|
386
|
-
variant: "error",
|
|
387
|
-
className: errorClasses,
|
|
388
|
-
children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: t("errors.heading") }), /* @__PURE__ */ jsx(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })]
|
|
389
|
-
}) })
|
|
390
|
-
});
|
|
391
|
-
return /* @__PURE__ */ jsxs(Card_default, {
|
|
392
|
-
className: cx(containerClasses, styles.card),
|
|
393
|
-
variant,
|
|
394
|
-
children: [(showTitle || showSubtitle) && /* @__PURE__ */ jsxs(Card_default.Header, {
|
|
395
|
-
className: styles.header,
|
|
396
|
-
children: [showTitle && /* @__PURE__ */ jsx(Card_default.Title, {
|
|
397
|
-
level: 2,
|
|
398
|
-
className: styles.title,
|
|
399
|
-
children: flowTitle || t("signup.heading")
|
|
400
|
-
}), showSubtitle && /* @__PURE__ */ jsx(Typography_default, {
|
|
401
|
-
variant: "body1",
|
|
402
|
-
className: styles.subtitle,
|
|
403
|
-
children: flowSubtitle || t("signup.subheading")
|
|
404
|
-
})]
|
|
405
|
-
}), /* @__PURE__ */ jsxs(Card_default.Content, { children: [flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
406
|
-
className: styles.flowMessagesContainer,
|
|
407
|
-
children: flowMessages.map((message, index) => /* @__PURE__ */ jsx(Alert_default, {
|
|
408
|
-
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
409
|
-
className: cx(styles.flowMessageItem, messageClasses),
|
|
410
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: message.message })
|
|
411
|
-
}, message.id || index))
|
|
412
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
413
|
-
className: styles.contentContainer,
|
|
414
|
-
children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx(Alert_default, {
|
|
415
|
-
variant: "warning",
|
|
416
|
-
children: /* @__PURE__ */ jsx(Typography_default, {
|
|
417
|
-
variant: "body1",
|
|
418
|
-
children: t("errors.signup.components.not.available")
|
|
419
|
-
})
|
|
420
|
-
})
|
|
421
|
-
})] })]
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
/**
|
|
425
|
-
* BaseSignUp component that provides embedded sign-up flow for ThunderID.
|
|
426
|
-
* This component handles both the presentation layer and sign-up flow logic.
|
|
427
|
-
* It accepts API functions as props to maintain framework independence.
|
|
428
|
-
*
|
|
429
|
-
* @internal
|
|
430
|
-
*/
|
|
431
|
-
const BaseSignUp = ({ showLogo = true,...rest }) => {
|
|
432
|
-
const { theme, colorScheme } = useTheme_default();
|
|
433
|
-
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
434
|
-
return /* @__PURE__ */ jsxs("div", { children: [showLogo && /* @__PURE__ */ jsx("div", {
|
|
435
|
-
className: styles.logoContainer,
|
|
436
|
-
children: /* @__PURE__ */ jsx(Logo_default, { size: "large" })
|
|
437
|
-
}), /* @__PURE__ */ jsx(FlowProvider_default, { children: /* @__PURE__ */ jsx(BaseSignUpContent, {
|
|
438
|
-
showLogo,
|
|
439
|
-
...rest
|
|
440
|
-
}) })] });
|
|
441
|
-
};
|
|
442
|
-
var BaseSignUp_default = BaseSignUp;
|
|
443
|
-
|
|
444
|
-
//#endregion
|
|
445
|
-
export { BaseSignUp_default as default };
|
|
446
|
-
//# sourceMappingURL=BaseSignUp.js.map
|