@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowTransformer.cjs","names":["mapping: Map<string, string>","transformedComponent: any","inputData: any","value: string","refMapping: Map<string, string>","actionMapping: Map<string, string>","inputsData: any[]","resolveTranslationsInArray","flowError: FlowErrorResponse['error']","translated: string","systemTranslated: string","fallback: string | undefined","additionalData: Record<string, any>","parsed: any"],"sources":["../../../../src/utils/v2/flowTransformer.ts"],"sourcesContent":["/**\n * Copyright (c) 2025-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\n/**\n * @fileoverview Shared flow response transformer utilities for v2 embedded flows.\n *\n * This module provides reusable transformation functions for normalizing embedded flow\n * responses from ThunderID APIs. It handles both successful responses with component\n * extraction and error responses with proper error message extraction.\n *\n * Key features:\n * - Component extraction from flow meta structure\n * - Translation string resolution in components\n * - Error response detection and message extraction\n * - Configurable error handling (throw vs return errors)\n *\n * Usage:\n * ```typescript\n * import { normalizeFlowResponse } from '../../../utils/v2/flowTransformer';\n *\n * const { executionId, components } = normalizeFlowResponse(apiResponse, t, {\n * defaultErrorKey: 'components.signIn.errors.generic'\n * });\n * ```\n *\n * This transformer is used by both SignIn and SignUp v2 components to ensure\n * consistent response handling across all embedded flows.\n */\n\nimport {EmbeddedFlowComponentV2 as EmbeddedFlowComponent, FlowMetadataResponse} from '@thunderid/browser';\nimport resolveTranslationsInArray from './resolveTranslationsInArray';\nimport {UseTranslation} from '../../hooks/useTranslation';\n\n/**\n * Generic flow error response interface that covers common error structure\n */\nexport interface FlowErrorResponse {\n error?: {\n code: string;\n description: {key: string; defaultValue?: string};\n message: {key: string; defaultValue?: string};\n };\n executionId: string;\n flowStatus: 'ERROR';\n}\n\n/**\n * Configuration options for flow transformation\n */\nexport interface FlowTransformOptions {\n /**\n * Default error message key for translation fallback\n * @default 'errors.flow.generic'\n */\n defaultErrorKey?: string;\n /**\n * Whether to resolve translation strings or keep them as i18n keys\n * @default true\n */\n resolveTranslations?: boolean;\n /**\n * Whether to throw errors or return them as normalized response\n * @default true\n */\n throwOnError?: boolean;\n}\n\n/**\n * Create a mapping from ref to identifier based on data.inputs array.\n * This handles cases where meta.components use 'ref' to reference inputs,\n * and data.inputs contain the actual 'identifier' field.\n *\n * @param response - The flow response object\n * @returns Map of ref to identifier\n */\nconst createInputRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.inputs && Array.isArray(response.data.inputs)) {\n response.data.inputs.forEach((input: any) => {\n if (input.ref && input.identifier) {\n mapping.set(input.ref, input.identifier);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Create a mapping from action ref to nextNode based on data.actions array.\n * This handles cases where meta.components reference actions by ref,\n * and data.actions contain the actual nextNode field for routing.\n *\n * @param response - The flow response object\n * @returns Map of action ref to nextNode\n */\nconst createActionRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.actions && Array.isArray(response.data.actions)) {\n response.data.actions.forEach((action: any) => {\n if (action.ref && action.nextNode) {\n mapping.set(action.ref, action.nextNode);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Apply input ref mapping to components recursively.\n * This ensures that component.ref values are mapped to the correct identifier\n * from data.inputs, enabling proper form submission.\n *\n * @param components - Array of components to transform\n * @param refMapping - Map of ref to identifier\n * @param actionMapping - Map of action ref to nextNode\n * @param inputsData - Array of input data for resolving SELECT options\n * @returns Transformed components with correct identifiers and action references\n */\nconst applyInputRefMapping = (\n components: EmbeddedFlowComponent[],\n refMapping: Map<string, string>,\n actionMapping: Map<string, string>,\n inputsData: any[] = [],\n): EmbeddedFlowComponent[] =>\n components.map((component: EmbeddedFlowComponent) => {\n const transformedComponent: any = {...component} as EmbeddedFlowComponent & {\n actionRef?: string;\n options?: {label: string; value: string}[];\n };\n\n // If this component has a ref that maps to an identifier, update it\n if (transformedComponent.ref && refMapping.has(transformedComponent.ref)) {\n transformedComponent.ref = refMapping.get(transformedComponent.ref);\n }\n\n // For SELECT components, copy options from data.inputs\n // The component.id matches the input.ref in the data structure\n if (transformedComponent.type === 'SELECT' && component.id) {\n const inputData: any = inputsData.find((input: any) => input.ref === component.id);\n if (inputData?.options) {\n transformedComponent.options = inputData.options.map((opt: any) => {\n if (typeof opt === 'string') {\n return {label: opt, value: opt};\n }\n // Safely handle non-string values to prevent React key crashes\n const value: string = typeof opt.value === 'object' ? JSON.stringify(opt.value) : String(opt.value || '');\n const label: string = typeof opt.label === 'object' ? JSON.stringify(opt.label) : String(opt.label || value);\n\n return {label, value};\n });\n }\n }\n\n // If this is an action component, map its id to the nextNode\n // Store the nextNode reference as actionRef property for later use\n if (\n transformedComponent.type === 'ACTION' &&\n transformedComponent.id &&\n actionMapping.has(transformedComponent.id)\n ) {\n transformedComponent.actionRef = actionMapping.get(transformedComponent.id);\n }\n\n // Recursively apply to nested components\n if (transformedComponent.components && Array.isArray(transformedComponent.components)) {\n transformedComponent.components = applyInputRefMapping(\n transformedComponent.components,\n refMapping,\n actionMapping,\n inputsData,\n );\n }\n\n return transformedComponent;\n });\n\n/**\n * Transform and resolve translations in components from flow response.\n * This function extracts components from the response meta structure and optionally resolves\n * any translation strings within them. It also handles mapping of input refs to identifiers\n * and action refs to nextNode values.\n *\n * @param response - The flow response object containing components in meta structure\n * @param t - Translation function from useTranslation hook\n * @param resolveTranslations - Whether to resolve translation strings or keep them as i18n keys (default: true)\n * @returns Array of flow components with resolved or unresolved translations\n */\nexport const transformComponents = (\n response: any,\n t: UseTranslation['t'],\n resolveTranslations = true,\n meta?: FlowMetadataResponse | null,\n): EmbeddedFlowComponent[] => {\n if (!response?.data?.meta?.components) {\n return [];\n }\n\n let {components} = response.data.meta;\n\n // Create mapping from ref to identifier based on data.inputs\n const refMapping: Map<string, string> = createInputRefMapping(response);\n\n // Create mapping from action ref to nextNode based on data.actions\n const actionMapping: Map<string, string> = createActionRefMapping(response);\n\n // Get inputs data for SELECT option resolution\n const inputsData: any[] = response?.data?.inputs || [];\n\n // Apply ref and action mapping if there are any mappings\n if (refMapping.size > 0 || actionMapping.size > 0 || inputsData.length > 0) {\n components = applyInputRefMapping(components, refMapping, actionMapping, inputsData);\n }\n\n return resolveTranslations ? resolveTranslationsInArray(components, t, undefined, meta) : components;\n};\n\n/**\n * Extract error message from flow error response.\n *\n * Resolution order:\n * 1. Structured `error` object: try i18n lookup via `t(error.message.key)`.\n * 2. Fallback to `defaultValue` from `message`, then `description`.\n * 3. Standard `Error.message`.\n * 4. Generic translated fallback via `defaultErrorKey`.\n */\nexport const extractErrorMessage = (\n error: FlowErrorResponse | any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string => {\n if (error && typeof error === 'object' && error.error) {\n const flowError: FlowErrorResponse['error'] = error.error;\n\n // 1. Try i18n lookup on message.key first (preferred for user-facing errors)\n if (flowError?.message?.key) {\n const translated: string = t(flowError.message.key);\n if (translated && translated !== flowError.message.key) {\n return translated;\n }\n\n // If the key resolved to itself, retry under the 'system:' namespace\n const systemKey = `system.${flowError.message.key}`;\n const systemTranslated: string = t(systemKey);\n if (systemTranslated && systemTranslated !== systemKey) {\n return systemTranslated;\n }\n }\n\n // 2. Fall back to defaultValue from message, then description\n const fallback: string | undefined = flowError?.message?.defaultValue ?? flowError?.description?.defaultValue;\n if (fallback) {\n return fallback;\n }\n }\n\n // Legacy backward compatibility\n if (error && typeof error === 'object' && error.failureReason) {\n return error.failureReason;\n }\n\n if (error instanceof Error && error.message) {\n return error.message;\n }\n\n return t(defaultErrorKey);\n};\n\n/**\n * Check if a response is an error response and extract the error message.\n * This function identifies error responses by checking for ERROR status and failure reasons.\n *\n * @param response - The flow response to check\n * @param t - Translation function for error messages\n * @param defaultErrorKey - Default translation key for generic errors\n * @returns Error message string if response is an error, null otherwise\n */\nexport const checkForErrorResponse = (\n response: any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string | null => {\n if (response?.flowStatus === 'ERROR') {\n return extractErrorMessage(response, t, defaultErrorKey);\n }\n\n return null;\n};\n\n/**\n * Generic flow response normalizer that handles both success and error responses.\n * This is the main transformer function that should be used by all flow components.\n *\n * @param response - The raw flow response from the API\n * @param t - Translation function from useTranslation hook\n * @param options - Configuration options for transformation behavior\n * @returns Normalized flow response with executionId and transformed components\n * @throws {any} The original response if it's an error and throwOnError is true\n */\nexport const normalizeFlowResponse = (\n response: any,\n t: UseTranslation['t'],\n options: FlowTransformOptions = {},\n meta?: FlowMetadataResponse | null,\n): {\n additionalData: Record<string, any>;\n components: EmbeddedFlowComponent[];\n executionId: string;\n} => {\n const {throwOnError = true, defaultErrorKey = 'errors.flow.generic', resolveTranslations = true} = options;\n\n // Check if this is an error response\n const errorMessage: string | null = checkForErrorResponse(response, t, defaultErrorKey);\n\n if (errorMessage && throwOnError) {\n // Throw the original response so it can be caught by error handling\n throw response;\n }\n\n const additionalData: Record<string, any> = (response?.data?.additionalData as Record<string, any>) ?? {};\n\n // The consent prompt is serialized as a JSON string (array) by the backend.\n // Parse it and wrap in the expected {purposes: [...]} structure.\n if (typeof additionalData['consentPrompt'] === 'string') {\n try {\n const parsed: any = JSON.parse(additionalData['consentPrompt']);\n additionalData['consentPrompt'] = {purposes: Array.isArray(parsed) ? parsed : []};\n } catch {\n // Leave unparseable value as-is\n }\n }\n\n return {\n additionalData,\n components: transformComponents(response, t, resolveTranslations, meta),\n executionId: response.executionId,\n };\n};\n"],"mappings":";;;;;;;;;;;AA0FA,MAAM,yBAAyB,aAAuC;CACpE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,UAAU,MAAM,QAAQ,SAAS,KAAK,OAAO,CAC/D,UAAS,KAAK,OAAO,SAAS,UAAe;AAC3C,MAAI,MAAM,OAAO,MAAM,WACrB,SAAQ,IAAI,MAAM,KAAK,MAAM,WAAW;GAE1C;AAGJ,QAAO;;;;;;;;;;AAWT,MAAM,0BAA0B,aAAuC;CACrE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,WAAW,MAAM,QAAQ,SAAS,KAAK,QAAQ,CACjE,UAAS,KAAK,QAAQ,SAAS,WAAgB;AAC7C,MAAI,OAAO,OAAO,OAAO,SACvB,SAAQ,IAAI,OAAO,KAAK,OAAO,SAAS;GAE1C;AAGJ,QAAO;;;;;;;;;;;;;AAcT,MAAM,wBACJ,YACA,YACA,eACA,aAAoB,EAAE,KAEtB,WAAW,KAAK,cAAqC;CACnD,MAAMC,uBAA4B,EAAC,GAAG,WAAU;AAMhD,KAAI,qBAAqB,OAAO,WAAW,IAAI,qBAAqB,IAAI,CACtE,sBAAqB,MAAM,WAAW,IAAI,qBAAqB,IAAI;AAKrE,KAAI,qBAAqB,SAAS,YAAY,UAAU,IAAI;EAC1D,MAAMC,YAAiB,WAAW,MAAM,UAAe,MAAM,QAAQ,UAAU,GAAG;AAClF,MAAI,WAAW,QACb,sBAAqB,UAAU,UAAU,QAAQ,KAAK,QAAa;AACjE,OAAI,OAAO,QAAQ,SACjB,QAAO;IAAC,OAAO;IAAK,OAAO;IAAI;GAGjC,MAAMC,QAAgB,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,GAAG;AAGzG,UAAO;IAAC,OAFc,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,MAAM;IAE7F;IAAM;IACrB;;AAMN,KACE,qBAAqB,SAAS,YAC9B,qBAAqB,MACrB,cAAc,IAAI,qBAAqB,GAAG,CAE1C,sBAAqB,YAAY,cAAc,IAAI,qBAAqB,GAAG;AAI7E,KAAI,qBAAqB,cAAc,MAAM,QAAQ,qBAAqB,WAAW,CACnF,sBAAqB,aAAa,qBAChC,qBAAqB,YACrB,YACA,eACA,WACD;AAGH,QAAO;EACP;;;;;;;;;;;;AAaJ,MAAa,uBACX,UACA,GACA,sBAAsB,MACtB,SAC4B;AAC5B,KAAI,CAAC,UAAU,MAAM,MAAM,WACzB,QAAO,EAAE;CAGX,IAAI,EAAC,eAAc,SAAS,KAAK;CAGjC,MAAMC,aAAkC,sBAAsB,SAAS;CAGvE,MAAMC,gBAAqC,uBAAuB,SAAS;CAG3E,MAAMC,aAAoB,UAAU,MAAM,UAAU,EAAE;AAGtD,KAAI,WAAW,OAAO,KAAK,cAAc,OAAO,KAAK,WAAW,SAAS,EACvE,cAAa,qBAAqB,YAAY,YAAY,eAAe,WAAW;AAGtF,QAAO,sBAAsBC,2CAA2B,YAAY,GAAG,QAAW,KAAK,GAAG;;;;;;;;;;;AAY5F,MAAa,uBACX,OACA,GACA,kBAAkB,0BACP;AACX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,OAAO;EACrD,MAAMC,YAAwC,MAAM;AAGpD,MAAI,WAAW,SAAS,KAAK;GAC3B,MAAMC,aAAqB,EAAE,UAAU,QAAQ,IAAI;AACnD,OAAI,cAAc,eAAe,UAAU,QAAQ,IACjD,QAAO;GAIT,MAAM,YAAY,UAAU,UAAU,QAAQ;GAC9C,MAAMC,mBAA2B,EAAE,UAAU;AAC7C,OAAI,oBAAoB,qBAAqB,UAC3C,QAAO;;EAKX,MAAMC,WAA+B,WAAW,SAAS,gBAAgB,WAAW,aAAa;AACjG,MAAI,SACF,QAAO;;AAKX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,cAC9C,QAAO,MAAM;AAGf,KAAI,iBAAiB,SAAS,MAAM,QAClC,QAAO,MAAM;AAGf,QAAO,EAAE,gBAAgB;;;;;;;;;;;AAY3B,MAAa,yBACX,UACA,GACA,kBAAkB,0BACA;AAClB,KAAI,UAAU,eAAe,QAC3B,QAAO,oBAAoB,UAAU,GAAG,gBAAgB;AAG1D,QAAO;;;;;;;;;;;;AAaT,MAAa,yBACX,UACA,GACA,UAAgC,EAAE,EAClC,SAKG;CACH,MAAM,EAAC,eAAe,MAAM,kBAAkB,uBAAuB,sBAAsB,SAAQ;AAKnG,KAFoC,sBAAsB,UAAU,GAAG,gBAAgB,IAEnE,aAElB,OAAM;CAGR,MAAMC,iBAAuC,UAAU,MAAM,kBAA0C,EAAE;AAIzG,KAAI,OAAO,eAAe,qBAAqB,SAC7C,KAAI;EACF,MAAMC,SAAc,KAAK,MAAM,eAAe,iBAAiB;AAC/D,iBAAe,mBAAmB,EAAC,UAAU,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE,EAAC;SAC3E;AAKV,QAAO;EACL;EACA,YAAY,oBAAoB,UAAU,GAAG,qBAAqB,KAAK;EACvE,aAAa,SAAS;EACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAuthComponentHeadings.cjs","names":["heading: EmbeddedFlowComponent | null","subheading: EmbeddedFlowComponent | null","filteredNestedComponents: EmbeddedFlowComponent[]","headingText: string","subheadingText: string"],"sources":["../../../../src/utils/v2/getAuthComponentHeadings.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {EmbeddedFlowComponentV2 as EmbeddedFlowComponent} from '@thunderid/browser';\n\n/**\n * Result of heading extraction from flow components\n */\nexport interface HeadingExtractionResult {\n heading: EmbeddedFlowComponent | null;\n subheading: EmbeddedFlowComponent | null;\n}\n\n/**\n * Complete result of authentication component heading extraction\n */\nexport interface AuthComponentHeadingsResult {\n componentsWithoutHeadings: EmbeddedFlowComponent[];\n headingComponents: HeadingExtractionResult;\n subtitle: string;\n title: string;\n}\n\n/**\n * Extracts heading and subheading components from authentication flow components\n * and provides resolved title/subtitle text with fallback logic.\n *\n * This utility helps maintain consistent heading extraction across authentication\n * components (SignIn, SignUp, etc.) by identifying heading components within the\n * flow structure and providing clean fallback behavior.\n *\n * @param components - Array of flow components to search\n * @param flowTitle - Title from flow context (highest priority)\n * @param flowSubtitle - Subtitle from flow context (highest priority)\n * @param defaultTitle - Default title fallback (lowest priority)\n * @param defaultSubtitle - Default subtitle fallback (lowest priority)\n * @returns Object with resolved title and subtitle text, plus filtered components\n *\n * @example\n * ```typescript\n * const result = getAuthComponentHeadings(\n * components,\n * flowTitle,\n * flowSubtitle,\n * t('signin.heading'),\n * t('signin.subheading')\n * );\n *\n * // Use resolved titles\n * <Card.Title>{result.title}</Card.Title>\n * <Typography>{result.subtitle}</Typography>\n *\n * // Render filtered components (without headings)\n * renderComponents(result.componentsWithoutHeadings);\n * ```\n */\nconst getAuthComponentHeadings = (\n components: EmbeddedFlowComponent[],\n flowTitle?: string,\n flowSubtitle?: string,\n defaultTitle?: string,\n defaultSubtitle?: string,\n): AuthComponentHeadingsResult => {\n let heading: EmbeddedFlowComponent | null = null;\n let subheading: EmbeddedFlowComponent | null = null;\n\n /**\n * Recursively search for heading components\n */\n const findHeadings = (comps: EmbeddedFlowComponent[]): void => {\n for (const component of comps) {\n if (component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n if (!heading) {\n heading = component;\n } else if (!subheading) {\n subheading = component;\n break; // We found both, no need to continue\n }\n }\n if (component.components && component.components.length > 0) {\n findHeadings(component.components);\n if (heading && subheading) break; // Early exit if both found\n }\n }\n };\n\n /**\n * Filter out heading components from the flow\n */\n const filterComponents = (comps: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] => {\n let foundHeadings = 0;\n const maxHeadings = 2;\n\n const filter = (items: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] =>\n items.reduce((acc: EmbeddedFlowComponent[], component: EmbeddedFlowComponent) => {\n if (foundHeadings < maxHeadings && component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n foundHeadings += 1;\n return acc;\n }\n\n if (component.components && component.components.length > 0) {\n const filteredNestedComponents: EmbeddedFlowComponent[] = filter(component.components);\n if (filteredNestedComponents.length > 0) {\n acc.push({\n ...component,\n components: filteredNestedComponents,\n });\n }\n } else {\n acc.push(component);\n }\n\n return acc;\n }, []);\n\n return filter(comps);\n };\n\n /**\n * Extract text content from a component\n */\n const getComponentText = (component: EmbeddedFlowComponent | null): string => {\n if (!component) return '';\n return component.label || '';\n };\n\n findHeadings(components);\n\n const headingText: string = getComponentText(heading);\n const subheadingText: string = getComponentText(subheading);\n\n const result: AuthComponentHeadingsResult = {\n componentsWithoutHeadings: filterComponents(components),\n headingComponents: {heading, subheading},\n subtitle: flowSubtitle || subheadingText || defaultSubtitle || '',\n title: flowTitle || headingText || defaultTitle || '',\n };\n\n return result;\n};\n\nexport default getAuthComponentHeadings;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAM,4BACJ,YACA,WACA,cACA,cACA,oBACgC;CAChC,IAAIA,UAAwC;CAC5C,IAAIC,aAA2C;;;;CAK/C,MAAM,gBAAgB,UAAyC;AAC7D,OAAK,MAAM,aAAa,OAAO;AAC7B,OAAI,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EACxE;QAAI,CAAC,QACH,WAAU;aACD,CAAC,YAAY;AACtB,kBAAa;AACb;;;AAGJ,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;AAC3D,iBAAa,UAAU,WAAW;AAClC,QAAI,WAAW,WAAY;;;;;;;CAQjC,MAAM,oBAAoB,UAA4D;EACpF,IAAI,gBAAgB;EACpB,MAAM,cAAc;EAEpB,MAAM,UAAU,UACd,MAAM,QAAQ,KAA8B,cAAqC;AAC/E,OAAI,gBAAgB,eAAe,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EAAE;AACzG,qBAAiB;AACjB,WAAO;;AAGT,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;IAC3D,MAAMC,2BAAoD,OAAO,UAAU,WAAW;AACtF,QAAI,yBAAyB,SAAS,EACpC,KAAI,KAAK;KACP,GAAG;KACH,YAAY;KACb,CAAC;SAGJ,KAAI,KAAK,UAAU;AAGrB,UAAO;KACN,EAAE,CAAC;AAER,SAAO,OAAO,MAAM;;;;;CAMtB,MAAM,oBAAoB,cAAoD;AAC5E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,SAAS;;AAG5B,cAAa,WAAW;CAExB,MAAMC,cAAsB,iBAAiB,QAAQ;CACrD,MAAMC,iBAAyB,iBAAiB,WAAW;AAS3D,QAP4C;EAC1C,2BAA2B,iBAAiB,WAAW;EACvD,mBAAmB;GAAC;GAAS;GAAW;EACxC,UAAU,gBAAgB,kBAAkB,mBAAmB;EAC/D,OAAO,aAAa,eAAe,gBAAgB;EACpD;;AAKH,uCAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.cjs","names":["ThunderIDRuntimeError","creationOptions: any","publicKey: any","credential: PublicKeyCredential","response: AuthenticatorAttestationResponse","registrationResponse: any","requestOptions: any","response: AuthenticatorAssertionResponse","authenticationResponse: any"],"sources":["../../../../src/utils/v2/passkey.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {ThunderIDRuntimeError, arrayBufferToBase64url, base64urlToArrayBuffer} from '@thunderid/browser';\n\n/**\n * Handles WebAuthn/Passkey registration flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn creation options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn registration response.\n */\nexport const handlePasskeyRegistration = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.create) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey registration requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const creationOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and user ID from base64url to BufferSource\n const publicKey: any = {\n ...creationOptions,\n challenge: base64urlToArrayBuffer(creationOptions.challenge),\n user: {\n ...creationOptions.user,\n id: base64urlToArrayBuffer(creationOptions.user.id),\n },\n ...(creationOptions.excludeCredentials && {\n excludeCredentials: creationOptions.excludeCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.create({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn registration.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn registration ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAttestationResponse = credential.response as AuthenticatorAttestationResponse;\n\n // Encode response fields back to base64url\n const registrationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n attestationObject: arrayBufferToBase64url(response.attestationObject),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n ...(response.getTransports && {\n transports: response.getTransports(),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(registrationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n // Map specific WebAuthn errors to ThunderIDRuntimeError/friendly messages as needed\n throw new ThunderIDRuntimeError(\n `Passkey registration failed: ${error.message}`,\n 'browser-webauthn-registration-error',\n 'browser',\n `WebAuthn registration failed with error: ${error.name}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey registration failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn registration.',\n );\n }\n};\n\n/**\n * Handles WebAuthn/Passkey authentication flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn request options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn authentication response.\n */\nexport const handlePasskeyAuthentication = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.get) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey authentication requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const requestOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and allowed credentials from base64url to BufferSource\n const publicKey: any = {\n ...requestOptions,\n challenge: base64urlToArrayBuffer(requestOptions.challenge),\n ...(requestOptions.allowCredentials && {\n allowCredentials: requestOptions.allowCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.get({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn authentication.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn authentication ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAssertionResponse = credential.response as AuthenticatorAssertionResponse;\n\n // Encode response fields back to base64url\n const authenticationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n authenticatorData: arrayBufferToBase64url(response.authenticatorData),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n signature: arrayBufferToBase64url(response.signature),\n ...(response.userHandle && {\n userHandle: arrayBufferToBase64url(response.userHandle),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(authenticationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n throw new ThunderIDRuntimeError(\n `Passkey authentication failed: ${error.message}`,\n 'browser-webauthn-authentication-error',\n 'browser',\n `WebAuthn authentication failed with error: ${error.name}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey authentication failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn authentication.',\n );\n }\n};\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,4BAA4B,OAAO,kBAA2C;AACzF,KAAI,CAAC,OAAO,UAAU,aAAa,OACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,6FACD;AAGH,KAAI;EACF,MAAMC,kBAAuB,KAAK,MAAM,cAAc;EAGtD,MAAMC,YAAiB;GACrB,GAAG;GACH,2DAAkC,gBAAgB,UAAU;GAC5D,MAAM;IACJ,GAAG,gBAAgB;IACnB,oDAA2B,gBAAgB,KAAK,GAAG;IACpD;GACD,GAAI,gBAAgB,sBAAsB,EACxC,oBAAoB,gBAAgB,mBAAmB,KAAK,UAAe;IACzE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,OAAO,EAC1E,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,sDACA,kCACA,WACA,sFACD;EAGH,MAAMI,WAA6C,WAAW;EAG9D,MAAMC,uBAA4B;GAChC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,GAAI,SAAS,iBAAiB,EAC5B,YAAY,SAAS,eAAe,EACrC;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,qBAAqB;UACpC,OAAO;AACd,MAAI,iBAAiBL,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MAEnB,OAAM,IAAIA,0CACR,gCAAgC,MAAM,WACtC,uCACA,WACA,4CAA4C,MAAM,OACnD;AAGH,QAAM,IAAIA,0CACR,2DACA,qCACA,WACA,6DACD;;;;;;;;;AAUL,MAAa,8BAA8B,OAAO,kBAA2C;AAC3F,KAAI,CAAC,OAAO,UAAU,aAAa,IACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,+FACD;AAGH,KAAI;EACF,MAAMM,iBAAsB,KAAK,MAAM,cAAc;EAGrD,MAAMJ,YAAiB;GACrB,GAAG;GACH,2DAAkC,eAAe,UAAU;GAC3D,GAAI,eAAe,oBAAoB,EACrC,kBAAkB,eAAe,iBAAiB,KAAK,UAAe;IACpE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,IAAI,EACvE,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,wDACA,kCACA,WACA,wFACD;EAGH,MAAMO,WAA2C,WAAW;EAG5D,MAAMC,yBAA8B;GAClC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,2DAAkC,SAAS,UAAU;IACrD,GAAI,SAAS,cAAc,EACzB,4DAAmC,SAAS,WAAW,EACxD;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,uBAAuB;UACtC,OAAO;AACd,MAAI,iBAAiBR,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MACnB,OAAM,IAAIA,0CACR,kCAAkC,MAAM,WACxC,yCACA,WACA,8CAA8C,MAAM,OACrD;AAGH,QAAM,IAAIA,0CACR,6DACA,qCACA,WACA,+DACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTranslationsInArray.cjs","names":["resolved: T","resolveTranslationsInObject"],"sources":["../../../../src/utils/v2/resolveTranslationsInArray.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FlowMetadataResponse} from '@thunderid/browser';\nimport {resolveTranslationsInObject} from './resolveTranslationsInObject';\nimport {UseTranslation} from '../../hooks/useTranslation';\n\n/**\n * Recursively resolves translation and meta template strings in an array of objects.\n * @param items - Array of objects to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new array with resolved translations\n */\nconst resolveTranslationsInArray = <T extends Record<string, any>>(\n items: T[],\n t: UseTranslation['t'],\n properties?: string[],\n meta?: FlowMetadataResponse | null,\n): T[] =>\n items.map((item: T) => {\n const resolved: T = resolveTranslationsInObject(item, t, properties, meta);\n\n // If the item has nested components (like BLOCK or STACK type), resolve those too\n if (resolved['components'] && Array.isArray(resolved['components'])) {\n (resolved as any).components = resolveTranslationsInArray(resolved['components'], t, properties, meta);\n }\n\n return resolved;\n });\n\nexport default resolveTranslationsInArray;\n"],"mappings":";;;;;;;;;;;AA8BA,MAAM,8BACJ,OACA,GACA,YACA,SAEA,MAAM,KAAK,SAAY;CACrB,MAAMA,WAAcC,gEAA4B,MAAM,GAAG,YAAY,KAAK;AAG1E,KAAI,SAAS,iBAAiB,MAAM,QAAQ,SAAS,cAAc,CACjE,CAAC,SAAiB,aAAa,2BAA2B,SAAS,eAAe,GAAG,YAAY,KAAK;AAGxG,QAAO;EACP;AAEJ,yCAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTranslationsInObject.cjs","names":["resolved: T"],"sources":["../../../../src/utils/v2/resolveTranslationsInObject.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FlowMetadataResponse, resolveFlowTemplateLiterals} from '@thunderid/browser';\nimport {UseTranslation} from '../../hooks/useTranslation';\n\n/**\n * Resolves all {{ t() }} and {{ meta() }} template expressions in an object's string properties.\n * @param obj - The object to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional, defaults to common properties)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new object with resolved template strings\n */\nexport const resolveTranslationsInObject = <T extends Record<string, any>>(\n obj: T,\n t: UseTranslation['t'],\n properties: string[] = ['label', 'placeholder', 'text', 'title', 'subtitle'],\n meta?: FlowMetadataResponse | null,\n): T => {\n const resolved: T = {...obj};\n\n properties.forEach((prop: string) => {\n if (resolved[prop] && typeof resolved[prop] === 'string') {\n (resolved as any)[prop] = resolveFlowTemplateLiterals(resolved[prop], {meta, t});\n }\n });\n\n return resolved;\n};\n\nexport default resolveTranslationsInObject;\n"],"mappings":";;;;;;;;;;;;;AA6BA,MAAa,+BACX,KACA,GACA,aAAuB;CAAC;CAAS;CAAe;CAAQ;CAAS;CAAW,EAC5E,SACM;CACN,MAAMA,WAAc,EAAC,GAAG,KAAI;AAE5B,YAAW,SAAS,SAAiB;AACnC,MAAI,SAAS,SAAS,OAAO,SAAS,UAAU,SAC9C,CAAC,SAAiB,6DAAoC,SAAS,OAAO;GAAC;GAAM;GAAE,CAAC;GAElF;AAEF,QAAO"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Checkbox input component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const CheckboxInput: FC<AdapterProps>;
|
|
24
|
-
export default CheckboxInput;
|
|
25
|
-
//# sourceMappingURL=CheckboxInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/CheckboxInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,YAAY,CAwBnC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createField } from "../factories/FieldFactory.js";
|
|
2
|
-
import { FieldType } from "@thunderid/browser";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/CheckboxInput.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Checkbox input component for sign-up forms.
|
|
7
|
-
*/
|
|
8
|
-
const CheckboxInput = ({ component, formValues, touchedFields, formErrors, onInputChange, inputClassName }) => {
|
|
9
|
-
const config = component.config || {};
|
|
10
|
-
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
11
|
-
const value = formValues[fieldName] || false;
|
|
12
|
-
return createField({
|
|
13
|
-
className: inputClassName,
|
|
14
|
-
error: touchedFields[fieldName] ? formErrors[fieldName] : void 0,
|
|
15
|
-
label: config["label"] || "",
|
|
16
|
-
name: fieldName,
|
|
17
|
-
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
18
|
-
placeholder: config["placeholder"] || "",
|
|
19
|
-
required: config["required"] || false,
|
|
20
|
-
type: FieldType.Checkbox,
|
|
21
|
-
value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var CheckboxInput_default = CheckboxInput;
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { CheckboxInput_default as default };
|
|
28
|
-
//# sourceMappingURL=CheckboxInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.js","names":["CheckboxInput: FC<AdapterProps>","config: Record<string, unknown>","fieldName: string","value: string | boolean"],"sources":["../../../src/components/adapters/CheckboxInput.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FieldType} from '@thunderid/browser';\nimport {FC} from 'react';\nimport {AdapterProps} from '../../models/adapters';\nimport {createField} from '../factories/FieldFactory';\n\n/**\n * Checkbox input component for sign-up forms.\n */\nconst CheckboxInput: FC<AdapterProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}: AdapterProps) => {\n const config: Record<string, unknown> = component.config || {};\n const fieldName: string = (config['identifier'] as string) || (config['name'] as string) || component.id;\n const value: string | boolean = formValues[fieldName] || false;\n const error: string | undefined = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n className: inputClassName,\n error,\n label: (config['label'] as string) || '',\n name: fieldName,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n placeholder: (config['placeholder'] as string) || '',\n required: (config['required'] as boolean) || false,\n type: FieldType.Checkbox,\n value: value as string,\n });\n};\n\nexport default CheckboxInput;\n"],"mappings":";;;;;;;AA0BA,MAAMA,iBAAmC,EACvC,WACA,YACA,eACA,YACA,eACA,qBACkB;CAClB,MAAMC,SAAkC,UAAU,UAAU,EAAE;CAC9D,MAAMC,YAAqB,OAAO,iBAA6B,OAAO,WAAsB,UAAU;CACtG,MAAMC,QAA0B,WAAW,cAAc;AAGzD,QAAO,YAAY;EACjB,WAAW;EACX,OAJgC,cAAc,aAAa,WAAW,aAAa;EAKnF,OAAQ,OAAO,YAAuB;EACtC,MAAM;EACN,WAAW,aAAqB,cAAc,WAAW,SAAS;EAClE,aAAc,OAAO,kBAA6B;EAClD,UAAW,OAAO,eAA2B;EAC7C,MAAM,UAAU;EACT;EACR,CAAC;;AAGJ,4BAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Date input component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const DateInput: FC<AdapterProps>;
|
|
24
|
-
export default DateInput;
|
|
25
|
-
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/DateInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,YAAY,CAwB/B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createField } from "../factories/FieldFactory.js";
|
|
2
|
-
import { FieldType } from "@thunderid/browser";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/DateInput.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Date input component for sign-up forms.
|
|
7
|
-
*/
|
|
8
|
-
const DateInput = ({ component, formValues, touchedFields, formErrors, onInputChange, inputClassName }) => {
|
|
9
|
-
const config = component.config || {};
|
|
10
|
-
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
11
|
-
const value = formValues[fieldName] || "";
|
|
12
|
-
return createField({
|
|
13
|
-
className: inputClassName,
|
|
14
|
-
error: touchedFields[fieldName] ? formErrors[fieldName] : void 0,
|
|
15
|
-
label: config["label"] || "",
|
|
16
|
-
name: fieldName,
|
|
17
|
-
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
18
|
-
placeholder: config["placeholder"] || "",
|
|
19
|
-
required: config["required"] || false,
|
|
20
|
-
type: FieldType.Date,
|
|
21
|
-
value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var DateInput_default = DateInput;
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { DateInput_default as default };
|
|
28
|
-
//# sourceMappingURL=DateInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.js","names":["DateInput: FC<AdapterProps>","config: Record<string, unknown>","fieldName: string","value: string"],"sources":["../../../src/components/adapters/DateInput.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FieldType} from '@thunderid/browser';\nimport {FC} from 'react';\nimport {AdapterProps} from '../../models/adapters';\nimport {createField} from '../factories/FieldFactory';\n\n/**\n * Date input component for sign-up forms.\n */\nconst DateInput: FC<AdapterProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}: AdapterProps) => {\n const config: Record<string, unknown> = component.config || {};\n const fieldName: string = (config['identifier'] as string) || (config['name'] as string) || component.id;\n const value: string = formValues[fieldName] || '';\n const error: string | undefined = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n className: inputClassName,\n error,\n label: (config['label'] as string) || '',\n name: fieldName,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n placeholder: (config['placeholder'] as string) || '',\n required: (config['required'] as boolean) || false,\n type: FieldType.Date,\n value,\n });\n};\n\nexport default DateInput;\n"],"mappings":";;;;;;;AA0BA,MAAMA,aAA+B,EACnC,WACA,YACA,eACA,YACA,eACA,qBACkB;CAClB,MAAMC,SAAkC,UAAU,UAAU,EAAE;CAC9D,MAAMC,YAAqB,OAAO,iBAA6B,OAAO,WAAsB,UAAU;CACtG,MAAMC,QAAgB,WAAW,cAAc;AAG/C,QAAO,YAAY;EACjB,WAAW;EACX,OAJgC,cAAc,aAAa,WAAW,aAAa;EAKnF,OAAQ,OAAO,YAAuB;EACtC,MAAM;EACN,WAAW,aAAqB,cAAc,WAAW,SAAS;EAClE,aAAc,OAAO,kBAA6B;EAClD,UAAW,OAAO,eAA2B;EAC7C,MAAM,UAAU;EAChB;EACD,CAAC;;AAGJ,wBAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Divider component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const DividerComponent: FC<AdapterProps>;
|
|
24
|
-
export default DividerComponent;
|
|
25
|
-
//# sourceMappingURL=DividerComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DividerComponent.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/DividerComponent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAEzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,YAAY,CAetC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import useTheme_default from "../../contexts/Theme/useTheme.js";
|
|
2
|
-
import Divider_default from "../primitives/Divider/Divider.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/components/adapters/DividerComponent.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Divider component for sign-up forms.
|
|
8
|
-
*/
|
|
9
|
-
const DividerComponent = ({ component }) => {
|
|
10
|
-
const { theme } = useTheme_default();
|
|
11
|
-
const text = (component.config || {})["text"] || "";
|
|
12
|
-
return /* @__PURE__ */ jsx(Divider_default, {
|
|
13
|
-
orientation: (component.variant?.toLowerCase() || "horizontal") === "vertical" ? "vertical" : "horizontal",
|
|
14
|
-
style: { margin: `calc(${theme.vars.spacing.unit} * 2) 0` },
|
|
15
|
-
children: text
|
|
16
|
-
}, component.id);
|
|
17
|
-
};
|
|
18
|
-
var DividerComponent_default = DividerComponent;
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { DividerComponent_default as default };
|
|
22
|
-
//# sourceMappingURL=DividerComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DividerComponent.js","names":["DividerComponent: FC<AdapterProps>","useTheme","text: string","Divider"],"sources":["../../../src/components/adapters/DividerComponent.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FC} from 'react';\nimport useTheme from '../../contexts/Theme/useTheme';\nimport {AdapterProps} from '../../models/adapters';\nimport Divider from '../primitives/Divider/Divider';\n\n/**\n * Divider component for sign-up forms.\n */\nconst DividerComponent: FC<AdapterProps> = ({component}: AdapterProps) => {\n const {theme} = useTheme();\n const config: Record<string, unknown> = component.config || {};\n const text: string = (config['text'] as string) || '';\n const variant: string = component.variant?.toLowerCase() || 'horizontal';\n\n return (\n <Divider\n key={component.id}\n orientation={variant === 'vertical' ? 'vertical' : 'horizontal'}\n style={{margin: `calc(${theme.vars.spacing.unit} * 2) 0`}}\n >\n {text}\n </Divider>\n );\n};\n\nexport default DividerComponent;\n"],"mappings":";;;;;;;;AA0BA,MAAMA,oBAAsC,EAAC,gBAA6B;CACxE,MAAM,EAAC,UAASC,kBAAU;CAE1B,MAAMC,QADkC,UAAU,UAAU,EAAE,EACjC,WAAsB;AAGnD,QACE,oBAACC;EAEC,cALoB,UAAU,SAAS,aAAa,IAAI,kBAK/B,aAAa,aAAa;EACnD,OAAO,EAAC,QAAQ,QAAQ,MAAM,KAAK,QAAQ,KAAK,UAAS;YAExD;IAJI,UAAU,GAKP;;AAId,+BAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Email input component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const EmailInput: FC<AdapterProps>;
|
|
24
|
-
export default EmailInput;
|
|
25
|
-
//# sourceMappingURL=EmailInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmailInput.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/EmailInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,YAAY,CAwBhC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createField } from "../factories/FieldFactory.js";
|
|
2
|
-
import { FieldType } from "@thunderid/browser";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/EmailInput.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Email input component for sign-up forms.
|
|
7
|
-
*/
|
|
8
|
-
const EmailInput = ({ component, formValues, touchedFields, formErrors, onInputChange, inputClassName }) => {
|
|
9
|
-
const config = component.config || {};
|
|
10
|
-
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
11
|
-
const value = formValues[fieldName] || "";
|
|
12
|
-
return createField({
|
|
13
|
-
className: inputClassName,
|
|
14
|
-
error: touchedFields[fieldName] ? formErrors[fieldName] : void 0,
|
|
15
|
-
label: config["label"] || "Email",
|
|
16
|
-
name: fieldName,
|
|
17
|
-
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
18
|
-
placeholder: config["placeholder"] || "Enter your email",
|
|
19
|
-
required: config["required"] || false,
|
|
20
|
-
type: FieldType.Email,
|
|
21
|
-
value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var EmailInput_default = EmailInput;
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { EmailInput_default as default };
|
|
28
|
-
//# sourceMappingURL=EmailInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmailInput.js","names":["EmailInput: FC<AdapterProps>","config: Record<string, unknown>","fieldName: string","value: string"],"sources":["../../../src/components/adapters/EmailInput.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FieldType} from '@thunderid/browser';\nimport {FC} from 'react';\nimport {AdapterProps} from '../../models/adapters';\nimport {createField} from '../factories/FieldFactory';\n\n/**\n * Email input component for sign-up forms.\n */\nconst EmailInput: FC<AdapterProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}: AdapterProps) => {\n const config: Record<string, unknown> = component.config || {};\n const fieldName: string = (config['identifier'] as string) || (config['name'] as string) || component.id;\n const value: string = formValues[fieldName] || '';\n const error: string | undefined = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n className: inputClassName,\n error,\n label: (config['label'] as string) || 'Email',\n name: fieldName,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n placeholder: (config['placeholder'] as string) || 'Enter your email',\n required: (config['required'] as boolean) || false,\n type: FieldType.Email,\n value,\n });\n};\n\nexport default EmailInput;\n"],"mappings":";;;;;;;AA0BA,MAAMA,cAAgC,EACpC,WACA,YACA,eACA,YACA,eACA,qBACkB;CAClB,MAAMC,SAAkC,UAAU,UAAU,EAAE;CAC9D,MAAMC,YAAqB,OAAO,iBAA6B,OAAO,WAAsB,UAAU;CACtG,MAAMC,QAAgB,WAAW,cAAc;AAG/C,QAAO,YAAY;EACjB,WAAW;EACX,OAJgC,cAAc,aAAa,WAAW,aAAa;EAKnF,OAAQ,OAAO,YAAuB;EACtC,MAAM;EACN,WAAW,aAAqB,cAAc,WAAW,SAAS;EAClE,aAAc,OAAO,kBAA6B;EAClD,UAAW,OAAO,eAA2B;EAC7C,MAAM,UAAU;EAChB;EACD,CAAC;;AAGJ,yBAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Form container component that renders child components.
|
|
22
|
-
*/
|
|
23
|
-
declare const FormContainer: FC<AdapterProps>;
|
|
24
|
-
export default FormContainer;
|
|
25
|
-
//# sourceMappingURL=FormContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormContainer.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/FormContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,EAAE,EAAY,MAAM,OAAO,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAInD;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,YAAY,CAkCnC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createSignUpComponent } from "../presentation/auth/SignUp/v1/SignUpOptionFactory.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/FormContainer.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Form container component that renders child components.
|
|
7
|
-
*/
|
|
8
|
-
const FormContainer = (props) => {
|
|
9
|
-
const { component } = props;
|
|
10
|
-
if (component.components && component.components.length > 0) {
|
|
11
|
-
const handleFormSubmit = (e) => {
|
|
12
|
-
e.preventDefault();
|
|
13
|
-
const submitButton = component.components?.find((child) => child.type === "BUTTON" && (child.variant === "PRIMARY" || child.variant === "SECONDARY" || child.config?.type === "submit"));
|
|
14
|
-
if (submitButton && props.onSubmit) props.onSubmit(submitButton, props.formValues);
|
|
15
|
-
};
|
|
16
|
-
return /* @__PURE__ */ jsx("form", {
|
|
17
|
-
onSubmit: handleFormSubmit,
|
|
18
|
-
style: {
|
|
19
|
-
display: "flex",
|
|
20
|
-
flexDirection: "column"
|
|
21
|
-
},
|
|
22
|
-
children: component.components.map((childComponent) => createSignUpComponent({
|
|
23
|
-
...props,
|
|
24
|
-
component: childComponent
|
|
25
|
-
}))
|
|
26
|
-
}, component.id);
|
|
27
|
-
}
|
|
28
|
-
return /* @__PURE__ */ jsx("div", {}, component.id);
|
|
29
|
-
};
|
|
30
|
-
var FormContainer_default = FormContainer;
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
export { FormContainer_default as default };
|
|
34
|
-
//# sourceMappingURL=FormContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormContainer.js","names":["FormContainer: FC<AdapterProps>","handleFormSubmit: (e: FormEvent) => void","submitButton: any"],"sources":["../../../src/components/adapters/FormContainer.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FC, FormEvent} from 'react';\nimport {AdapterProps} from '../../models/adapters';\n// eslint-disable-next-line import/no-cycle\nimport {createSignUpComponent} from '../presentation/auth/SignUp/v1/SignUpOptionFactory';\n\n/**\n * Form container component that renders child components.\n */\nconst FormContainer: FC<AdapterProps> = (props: AdapterProps) => {\n const {component} = props;\n\n // If the form has child components, render them wrapped in a form element\n if (component.components && component.components.length > 0) {\n const handleFormSubmit: (e: FormEvent) => void = (e: FormEvent): void => {\n e.preventDefault();\n\n // Find submit button in child components and trigger its submission\n const submitButton: any = component.components?.find(\n (child: any) =>\n child.type === 'BUTTON' &&\n (child.variant === 'PRIMARY' || child.variant === 'SECONDARY' || child.config?.type === 'submit'),\n );\n\n if (submitButton && props.onSubmit) {\n props.onSubmit(submitButton, props.formValues);\n }\n };\n\n return (\n <form key={component.id} onSubmit={handleFormSubmit} style={{display: 'flex', flexDirection: 'column'}}>\n {component.components.map((childComponent: any) =>\n createSignUpComponent({\n ...props,\n component: childComponent,\n }),\n )}\n </form>\n );\n }\n\n // Empty form container\n return <div key={component.id} />;\n};\n\nexport default FormContainer;\n"],"mappings":";;;;;;;AA0BA,MAAMA,iBAAmC,UAAwB;CAC/D,MAAM,EAAC,cAAa;AAGpB,KAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;EAC3D,MAAMC,oBAA4C,MAAuB;AACvE,KAAE,gBAAgB;GAGlB,MAAMC,eAAoB,UAAU,YAAY,MAC7C,UACC,MAAM,SAAS,aACd,MAAM,YAAY,aAAa,MAAM,YAAY,eAAe,MAAM,QAAQ,SAAS,UAC3F;AAED,OAAI,gBAAgB,MAAM,SACxB,OAAM,SAAS,cAAc,MAAM,WAAW;;AAIlD,SACE,oBAAC;GAAwB,UAAU;GAAkB,OAAO;IAAC,SAAS;IAAQ,eAAe;IAAS;aACnG,UAAU,WAAW,KAAK,mBACzB,sBAAsB;IACpB,GAAG;IACH,WAAW;IACZ,CAAC,CACH;KANQ,UAAU,GAOd;;AAKX,QAAO,oBAAC,WAAS,UAAU,GAAM;;AAGnC,4BAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Number input component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const NumberInput: FC<AdapterProps>;
|
|
24
|
-
export default NumberInput;
|
|
25
|
-
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/NumberInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,YAAY,CAwBjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createField } from "../factories/FieldFactory.js";
|
|
2
|
-
import { FieldType } from "@thunderid/browser";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/NumberInput.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Number input component for sign-up forms.
|
|
7
|
-
*/
|
|
8
|
-
const NumberInput = ({ component, formValues, touchedFields, formErrors, onInputChange, inputClassName }) => {
|
|
9
|
-
const config = component.config || {};
|
|
10
|
-
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
11
|
-
const value = formValues[fieldName] || "";
|
|
12
|
-
return createField({
|
|
13
|
-
className: inputClassName,
|
|
14
|
-
error: touchedFields[fieldName] ? formErrors[fieldName] : void 0,
|
|
15
|
-
label: config["label"] || "",
|
|
16
|
-
name: fieldName,
|
|
17
|
-
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
18
|
-
placeholder: config["placeholder"] || "",
|
|
19
|
-
required: config["required"] || false,
|
|
20
|
-
type: FieldType.Number,
|
|
21
|
-
value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var NumberInput_default = NumberInput;
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { NumberInput_default as default };
|
|
28
|
-
//# sourceMappingURL=NumberInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","names":["NumberInput: FC<AdapterProps>","config: Record<string, unknown>","fieldName: string","value: string"],"sources":["../../../src/components/adapters/NumberInput.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FieldType} from '@thunderid/browser';\nimport {FC} from 'react';\nimport {AdapterProps} from '../../models/adapters';\nimport {createField} from '../factories/FieldFactory';\n\n/**\n * Number input component for sign-up forms.\n */\nconst NumberInput: FC<AdapterProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}: AdapterProps) => {\n const config: Record<string, unknown> = component.config || {};\n const fieldName: string = (config['identifier'] as string) || (config['name'] as string) || component.id;\n const value: string = formValues[fieldName] || '';\n const error: string | undefined = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n return createField({\n className: inputClassName,\n error,\n label: (config['label'] as string) || '',\n name: fieldName,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n placeholder: (config['placeholder'] as string) || '',\n required: (config['required'] as boolean) || false,\n type: FieldType.Number,\n value,\n });\n};\n\nexport default NumberInput;\n"],"mappings":";;;;;;;AA0BA,MAAMA,eAAiC,EACrC,WACA,YACA,eACA,YACA,eACA,qBACkB;CAClB,MAAMC,SAAkC,UAAU,UAAU,EAAE;CAC9D,MAAMC,YAAqB,OAAO,iBAA6B,OAAO,WAAsB,UAAU;CACtG,MAAMC,QAAgB,WAAW,cAAc;AAG/C,QAAO,YAAY;EACjB,WAAW;EACX,OAJgC,cAAc,aAAa,WAAW,aAAa;EAKnF,OAAQ,OAAO,YAAuB;EACtC,MAAM;EACN,WAAW,aAAqB,cAAc,WAAW,SAAS;EAClE,aAAc,OAAO,kBAA6B;EAClD,UAAW,OAAO,eAA2B;EAC7C,MAAM,UAAU;EAChB;EACD,CAAC;;AAGJ,0BAAe"}
|
|
@@ -1,25 +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 { FC } from 'react';
|
|
19
|
-
import { AdapterProps } from '../../models/adapters';
|
|
20
|
-
/**
|
|
21
|
-
* Password input component for sign-up forms.
|
|
22
|
-
*/
|
|
23
|
-
declare const PasswordInput: FC<AdapterProps>;
|
|
24
|
-
export default PasswordInput;
|
|
25
|
-
//# sourceMappingURL=PasswordInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/PasswordInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AACzB,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,YAAY,CAiEnC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createField } from "../factories/FieldFactory.js";
|
|
2
|
-
import { FieldType } from "@thunderid/browser";
|
|
3
|
-
|
|
4
|
-
//#region src/components/adapters/PasswordInput.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Password input component for sign-up forms.
|
|
7
|
-
*/
|
|
8
|
-
const PasswordInput = ({ component, formValues, touchedFields, formErrors, onInputChange, inputClassName }) => {
|
|
9
|
-
const config = component.config || {};
|
|
10
|
-
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
11
|
-
const value = formValues[fieldName] || "";
|
|
12
|
-
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
13
|
-
const validations = config["validations"] || [];
|
|
14
|
-
const validationHints = [];
|
|
15
|
-
validations.forEach((validation) => {
|
|
16
|
-
if (validation.name === "LengthValidator") {
|
|
17
|
-
const minLength = validation.conditions?.find((c) => c.key === "min.length")?.value;
|
|
18
|
-
const maxLength = validation.conditions?.find((c) => c.key === "max.length")?.value;
|
|
19
|
-
if (minLength || maxLength) validationHints.push(`Length: ${minLength || "0"}-${maxLength || "∞"} characters`);
|
|
20
|
-
} else if (validation.name === "UpperCaseValidator") {
|
|
21
|
-
const minLength = validation.conditions?.find((c) => c.key === "min.length")?.value;
|
|
22
|
-
if (minLength && parseInt(minLength, 10) > 0) validationHints.push("Must contain uppercase letter(s)");
|
|
23
|
-
} else if (validation.name === "LowerCaseValidator") {
|
|
24
|
-
const minLength = validation.conditions?.find((c) => c.key === "min.length")?.value;
|
|
25
|
-
if (minLength && parseInt(minLength, 10) > 0) validationHints.push("Must contain lowercase letter(s)");
|
|
26
|
-
} else if (validation.name === "NumeralValidator") {
|
|
27
|
-
const minLength = validation.conditions?.find((c) => c.key === "min.length")?.value;
|
|
28
|
-
if (minLength && parseInt(minLength, 10) > 0) validationHints.push("Must contain number(s)");
|
|
29
|
-
} else if (validation.name === "SpecialCharacterValidator") {
|
|
30
|
-
const minLength = validation.conditions?.find((c) => c.key === "min.length")?.value;
|
|
31
|
-
if (minLength && parseInt(minLength, 10) > 0) validationHints.push("Must contain special character(s)");
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return createField({
|
|
35
|
-
className: inputClassName,
|
|
36
|
-
error,
|
|
37
|
-
label: config["label"] || "Password",
|
|
38
|
-
name: fieldName,
|
|
39
|
-
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
40
|
-
placeholder: config["placeholder"] || "Enter your password",
|
|
41
|
-
required: config["required"] || false,
|
|
42
|
-
type: FieldType.Password,
|
|
43
|
-
value
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var PasswordInput_default = PasswordInput;
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { PasswordInput_default as default };
|
|
50
|
-
//# sourceMappingURL=PasswordInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","names":["PasswordInput: FC<AdapterProps>","config: Record<string, unknown>","fieldName: string","value: string","error: string | undefined","validations: {\n conditions?: {key: string; value: string}[];\n name: string;\n }[]","validationHints: string[]","minLength: string | undefined","maxLength: string | undefined"],"sources":["../../../src/components/adapters/PasswordInput.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, 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 {FieldType} from '@thunderid/browser';\nimport {FC} from 'react';\nimport {AdapterProps} from '../../models/adapters';\nimport {createField} from '../factories/FieldFactory';\n\n/**\n * Password input component for sign-up forms.\n */\nconst PasswordInput: FC<AdapterProps> = ({\n component,\n formValues,\n touchedFields,\n formErrors,\n onInputChange,\n inputClassName,\n}: AdapterProps) => {\n const config: Record<string, unknown> = component.config || {};\n const fieldName: string = (config['identifier'] as string) || (config['name'] as string) || component.id;\n const value: string = formValues[fieldName] || '';\n const error: string | undefined = touchedFields[fieldName] ? formErrors[fieldName] : undefined;\n\n // Extract validation rules from the component config if available\n const validations: {\n conditions?: {key: string; value: string}[];\n name: string;\n }[] =\n (config['validations'] as {\n conditions?: {key: string; value: string}[];\n name: string;\n }[]) || [];\n const validationHints: string[] = [];\n\n validations.forEach((validation: any) => {\n if (validation.name === 'LengthValidator') {\n const minLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n const maxLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'max.length')?.value;\n if (minLength || maxLength) {\n validationHints.push(`Length: ${minLength || '0'}-${maxLength || '∞'} characters`);\n }\n } else if (validation.name === 'UpperCaseValidator') {\n const minLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain uppercase letter(s)');\n }\n } else if (validation.name === 'LowerCaseValidator') {\n const minLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain lowercase letter(s)');\n }\n } else if (validation.name === 'NumeralValidator') {\n const minLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain number(s)');\n }\n } else if (validation.name === 'SpecialCharacterValidator') {\n const minLength: string | undefined = validation.conditions?.find((c: any) => c.key === 'min.length')?.value;\n if (minLength && parseInt(minLength, 10) > 0) {\n validationHints.push('Must contain special character(s)');\n }\n }\n });\n\n return createField({\n className: inputClassName,\n error,\n label: (config['label'] as string) || 'Password',\n name: fieldName,\n onChange: (newValue: string) => onInputChange(fieldName, newValue),\n placeholder: (config['placeholder'] as string) || 'Enter your password',\n required: (config['required'] as boolean) || false,\n type: FieldType.Password,\n value,\n });\n};\n\nexport default PasswordInput;\n"],"mappings":";;;;;;;AA0BA,MAAMA,iBAAmC,EACvC,WACA,YACA,eACA,YACA,eACA,qBACkB;CAClB,MAAMC,SAAkC,UAAU,UAAU,EAAE;CAC9D,MAAMC,YAAqB,OAAO,iBAA6B,OAAO,WAAsB,UAAU;CACtG,MAAMC,QAAgB,WAAW,cAAc;CAC/C,MAAMC,QAA4B,cAAc,aAAa,WAAW,aAAa;CAGrF,MAAMC,cAIH,OAAO,kBAGA,EAAE;CACZ,MAAMC,kBAA4B,EAAE;AAEpC,aAAY,SAAS,eAAoB;AACvC,MAAI,WAAW,SAAS,mBAAmB;GACzC,MAAMC,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;GACvG,MAAMC,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;AACvG,OAAI,aAAa,UACf,iBAAgB,KAAK,WAAW,aAAa,IAAI,GAAG,aAAa,IAAI,aAAa;aAE3E,WAAW,SAAS,sBAAsB;GACnD,MAAMD,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;AACvG,OAAI,aAAa,SAAS,WAAW,GAAG,GAAG,EACzC,iBAAgB,KAAK,mCAAmC;aAEjD,WAAW,SAAS,sBAAsB;GACnD,MAAMA,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;AACvG,OAAI,aAAa,SAAS,WAAW,GAAG,GAAG,EACzC,iBAAgB,KAAK,mCAAmC;aAEjD,WAAW,SAAS,oBAAoB;GACjD,MAAMA,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;AACvG,OAAI,aAAa,SAAS,WAAW,GAAG,GAAG,EACzC,iBAAgB,KAAK,yBAAyB;aAEvC,WAAW,SAAS,6BAA6B;GAC1D,MAAMA,YAAgC,WAAW,YAAY,MAAM,MAAW,EAAE,QAAQ,aAAa,EAAE;AACvG,OAAI,aAAa,SAAS,WAAW,GAAG,GAAG,EACzC,iBAAgB,KAAK,oCAAoC;;GAG7D;AAEF,QAAO,YAAY;EACjB,WAAW;EACX;EACA,OAAQ,OAAO,YAAuB;EACtC,MAAM;EACN,WAAW,aAAqB,cAAc,WAAW,SAAS;EAClE,aAAc,OAAO,kBAA6B;EAClD,UAAW,OAAO,eAA2B;EAC7C,MAAM,UAAU;EAChB;EACD,CAAC;;AAGJ,4BAAe"}
|