@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
package/dist/cjs/index.cjs
CHANGED
|
@@ -13,7 +13,6 @@ const require_useThunderID = require('./contexts/ThunderID/useThunderID.cjs');
|
|
|
13
13
|
const require_FlowMetaProvider = require('./contexts/FlowMeta/FlowMetaProvider.cjs');
|
|
14
14
|
const require_I18nProvider = require('./contexts/I18n/I18nProvider.cjs');
|
|
15
15
|
const require_OrganizationProvider = require('./contexts/Organization/OrganizationProvider.cjs');
|
|
16
|
-
const require_useBrandingContext = require('./contexts/Branding/useBrandingContext.cjs');
|
|
17
16
|
const require_ThemeContext = require('./contexts/Theme/ThemeContext.cjs');
|
|
18
17
|
const require_ThemeProvider = require('./contexts/Theme/ThemeProvider.cjs');
|
|
19
18
|
const require_UserContext = require('./contexts/User/UserContext.cjs');
|
|
@@ -23,6 +22,7 @@ const require_useUser = require('./contexts/User/useUser.cjs');
|
|
|
23
22
|
const require_useOrganization = require('./contexts/Organization/useOrganization.cjs');
|
|
24
23
|
const require_useFlow = require('./contexts/Flow/useFlow.cjs');
|
|
25
24
|
const require_useTheme = require('./contexts/Theme/useTheme.cjs');
|
|
25
|
+
const require_useBrandingContext = require('./contexts/Branding/useBrandingContext.cjs');
|
|
26
26
|
const require_useTranslation = require('./hooks/useTranslation.cjs');
|
|
27
27
|
const require_useForm = require('./hooks/useForm.cjs');
|
|
28
28
|
const require_useBranding = require('./hooks/useBranding.cjs');
|
|
@@ -38,9 +38,27 @@ const require_SignedIn = require('./components/control/SignedIn.cjs');
|
|
|
38
38
|
const require_SignedOut = require('./components/control/SignedOut.cjs');
|
|
39
39
|
const require_Loading = require('./components/control/Loading.cjs');
|
|
40
40
|
const require_OrganizationContext = require('./components/control/OrganizationContext/OrganizationContext.cjs');
|
|
41
|
+
const require_CircleAlert = require('./components/primitives/Icons/CircleAlert.cjs');
|
|
42
|
+
const require_CircleCheck = require('./components/primitives/Icons/CircleCheck.cjs');
|
|
43
|
+
const require_Info = require('./components/primitives/Icons/Info.cjs');
|
|
44
|
+
const require_TriangleAlert = require('./components/primitives/Icons/TriangleAlert.cjs');
|
|
41
45
|
const require_Typography = require('./components/primitives/Typography/Typography.cjs');
|
|
46
|
+
const require_Alert = require('./components/primitives/Alert/Alert.cjs');
|
|
47
|
+
const require_Card = require('./components/primitives/Card/Card.cjs');
|
|
48
|
+
const require_OrganizationUnitPicker = require('./components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs');
|
|
49
|
+
const require_Divider = require('./components/primitives/Divider/Divider.cjs');
|
|
42
50
|
const require_FormControl = require('./components/primitives/FormControl/FormControl.cjs');
|
|
43
51
|
const require_InputLabel = require('./components/primitives/InputLabel/InputLabel.cjs');
|
|
52
|
+
const require_Toggle = require('./components/primitives/Toggle/Toggle.cjs');
|
|
53
|
+
const require_ConsentCheckboxList = require('./components/adapters/ConsentCheckboxList.cjs');
|
|
54
|
+
const require_Consent = require('./components/adapters/Consent.cjs');
|
|
55
|
+
const require_FacebookButton = require('./components/adapters/FacebookButton.cjs');
|
|
56
|
+
const require_FlowTimer = require('./components/adapters/FlowTimer.cjs');
|
|
57
|
+
const require_GitHubButton = require('./components/adapters/GitHubButton.cjs');
|
|
58
|
+
const require_GoogleButton = require('./components/adapters/GoogleButton.cjs');
|
|
59
|
+
const require_LinkedInButton = require('./components/adapters/LinkedInButton.cjs');
|
|
60
|
+
const require_MicrosoftButton = require('./components/adapters/MicrosoftButton.cjs');
|
|
61
|
+
const require_SignInWithEthereumButton = require('./components/adapters/SignInWithEthereumButton.cjs');
|
|
44
62
|
const require_Checkbox = require('./components/primitives/Checkbox/Checkbox.cjs');
|
|
45
63
|
const require_DatePicker = require('./components/primitives/DatePicker/DatePicker.cjs');
|
|
46
64
|
const require_OtpField = require('./components/primitives/OtpField/OtpField.cjs');
|
|
@@ -50,45 +68,20 @@ const require_TextField = require('./components/primitives/TextField/TextField.c
|
|
|
50
68
|
const require_PasswordField = require('./components/primitives/PasswordField/PasswordField.cjs');
|
|
51
69
|
const require_Select = require('./components/primitives/Select/Select.cjs');
|
|
52
70
|
const require_FieldFactory = require('./components/factories/FieldFactory.cjs');
|
|
53
|
-
const require_EmailOtp = require('./components/presentation/auth/SignIn/v1/options/EmailOtp.cjs');
|
|
54
|
-
const require_IdentifierFirst = require('./components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs');
|
|
55
|
-
const require_MultiOptionButton = require('./components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs');
|
|
56
|
-
const require_SmsOtp = require('./components/presentation/auth/SignIn/v1/options/SmsOtp.cjs');
|
|
57
|
-
const require_SocialButton = require('./components/presentation/auth/SignIn/v1/options/SocialButton.cjs');
|
|
58
|
-
const require_Totp = require('./components/presentation/auth/SignIn/v1/options/Totp.cjs');
|
|
59
|
-
const require_UsernamePassword = require('./components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs');
|
|
60
|
-
const require_FacebookButton = require('./components/adapters/FacebookButton.cjs');
|
|
61
|
-
const require_GitHubButton = require('./components/adapters/GitHubButton.cjs');
|
|
62
|
-
const require_GoogleButton = require('./components/adapters/GoogleButton.cjs');
|
|
63
|
-
const require_LinkedInButton = require('./components/adapters/LinkedInButton.cjs');
|
|
64
|
-
const require_MicrosoftButton = require('./components/adapters/MicrosoftButton.cjs');
|
|
65
|
-
const require_SignInWithEthereumButton = require('./components/adapters/SignInWithEthereumButton.cjs');
|
|
66
|
-
const require_SignInOptionFactory = require('./components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs');
|
|
67
|
-
const require_CircleAlert = require('./components/primitives/Icons/CircleAlert.cjs');
|
|
68
|
-
const require_CircleCheck = require('./components/primitives/Icons/CircleCheck.cjs');
|
|
69
|
-
const require_Info = require('./components/primitives/Icons/Info.cjs');
|
|
70
|
-
const require_TriangleAlert = require('./components/primitives/Icons/TriangleAlert.cjs');
|
|
71
|
-
const require_Alert = require('./components/primitives/Alert/Alert.cjs');
|
|
72
|
-
const require_Card = require('./components/primitives/Card/Card.cjs');
|
|
73
|
-
const require_Divider = require('./components/primitives/Divider/Divider.cjs');
|
|
74
|
-
const require_Logo = require('./components/primitives/Logo/Logo.cjs');
|
|
75
|
-
const require_OrganizationUnitPicker = require('./components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.cjs');
|
|
76
|
-
const require_Toggle = require('./components/primitives/Toggle/Toggle.cjs');
|
|
77
|
-
const require_ConsentCheckboxList = require('./components/adapters/ConsentCheckboxList.cjs');
|
|
78
|
-
const require_Consent = require('./components/adapters/Consent.cjs');
|
|
79
|
-
const require_FlowTimer = require('./components/adapters/FlowTimer.cjs');
|
|
80
71
|
const require_BaseSignIn = require('./components/presentation/auth/SignIn/BaseSignIn.cjs');
|
|
72
|
+
const require_useOAuthCallback = require('./hooks/useOAuthCallback.cjs');
|
|
81
73
|
const require_SignIn = require('./components/presentation/auth/SignIn/SignIn.cjs');
|
|
74
|
+
const require_Logo = require('./components/primitives/Logo/Logo.cjs');
|
|
82
75
|
const require_BaseSignUp = require('./components/presentation/auth/SignUp/BaseSignUp.cjs');
|
|
83
76
|
const require_SignUp = require('./components/presentation/auth/SignUp/SignUp.cjs');
|
|
84
77
|
const require_BaseRecovery = require('./components/presentation/auth/Recovery/BaseRecovery.cjs');
|
|
85
78
|
const require_Recovery = require('./components/presentation/auth/Recovery/Recovery.cjs');
|
|
86
|
-
const require_BaseInviteUser = require('./components/presentation/auth/InviteUser/
|
|
87
|
-
const require_InviteUser = require('./components/presentation/auth/InviteUser/
|
|
88
|
-
const require_BaseAcceptInvite = require('./components/presentation/auth/AcceptInvite/
|
|
89
|
-
const require_AcceptInvite = require('./components/presentation/auth/AcceptInvite/
|
|
90
|
-
const require_TokenCallback = require('./components/auth/Callback/TokenCallback.cjs');
|
|
79
|
+
const require_BaseInviteUser = require('./components/presentation/auth/InviteUser/BaseInviteUser.cjs');
|
|
80
|
+
const require_InviteUser = require('./components/presentation/auth/InviteUser/InviteUser.cjs');
|
|
81
|
+
const require_BaseAcceptInvite = require('./components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs');
|
|
82
|
+
const require_AcceptInvite = require('./components/presentation/auth/AcceptInvite/AcceptInvite.cjs');
|
|
91
83
|
const require_OAuthCallback = require('./components/auth/Callback/OAuthCallback.cjs');
|
|
84
|
+
const require_TokenCallback = require('./components/auth/Callback/TokenCallback.cjs');
|
|
92
85
|
const require_Callback = require('./components/auth/Callback/Callback.cjs');
|
|
93
86
|
const require_BaseUser = require('./components/presentation/User/BaseUser.cjs');
|
|
94
87
|
const require_User = require('./components/presentation/User/User.cjs');
|
|
@@ -161,53 +154,64 @@ Object.defineProperty(exports, 'EMOJI_URI_SCHEME', {
|
|
|
161
154
|
return __thunderid_browser.EMOJI_URI_SCHEME;
|
|
162
155
|
}
|
|
163
156
|
});
|
|
164
|
-
exports.EmailOtp = require_EmailOtp.default;
|
|
165
157
|
Object.defineProperty(exports, 'EmbeddedFlowActionVariant', {
|
|
166
158
|
enumerable: true,
|
|
167
159
|
get: function () {
|
|
168
|
-
return __thunderid_browser.
|
|
160
|
+
return __thunderid_browser.EmbeddedFlowActionVariant;
|
|
169
161
|
}
|
|
170
162
|
});
|
|
171
163
|
Object.defineProperty(exports, 'EmbeddedFlowComponentType', {
|
|
172
164
|
enumerable: true,
|
|
173
165
|
get: function () {
|
|
174
|
-
return __thunderid_browser.
|
|
166
|
+
return __thunderid_browser.EmbeddedFlowComponentType;
|
|
175
167
|
}
|
|
176
168
|
});
|
|
177
169
|
Object.defineProperty(exports, 'EmbeddedFlowEventType', {
|
|
178
170
|
enumerable: true,
|
|
179
171
|
get: function () {
|
|
180
|
-
return __thunderid_browser.
|
|
172
|
+
return __thunderid_browser.EmbeddedFlowEventType;
|
|
181
173
|
}
|
|
182
174
|
});
|
|
183
175
|
Object.defineProperty(exports, 'EmbeddedFlowTextVariant', {
|
|
184
176
|
enumerable: true,
|
|
185
177
|
get: function () {
|
|
186
|
-
return __thunderid_browser.
|
|
178
|
+
return __thunderid_browser.EmbeddedFlowTextVariant;
|
|
187
179
|
}
|
|
188
180
|
});
|
|
189
181
|
Object.defineProperty(exports, 'EmbeddedRecoveryFlowStatus', {
|
|
190
182
|
enumerable: true,
|
|
191
183
|
get: function () {
|
|
192
|
-
return __thunderid_browser.
|
|
184
|
+
return __thunderid_browser.EmbeddedRecoveryFlowStatus;
|
|
193
185
|
}
|
|
194
186
|
});
|
|
195
187
|
Object.defineProperty(exports, 'EmbeddedRecoveryFlowType', {
|
|
196
188
|
enumerable: true,
|
|
197
189
|
get: function () {
|
|
198
|
-
return __thunderid_browser.
|
|
190
|
+
return __thunderid_browser.EmbeddedRecoveryFlowType;
|
|
199
191
|
}
|
|
200
192
|
});
|
|
201
193
|
Object.defineProperty(exports, 'EmbeddedSignInFlowStatus', {
|
|
202
194
|
enumerable: true,
|
|
203
195
|
get: function () {
|
|
204
|
-
return __thunderid_browser.
|
|
196
|
+
return __thunderid_browser.EmbeddedSignInFlowStatus;
|
|
205
197
|
}
|
|
206
198
|
});
|
|
207
199
|
Object.defineProperty(exports, 'EmbeddedSignInFlowType', {
|
|
208
200
|
enumerable: true,
|
|
209
201
|
get: function () {
|
|
210
|
-
return __thunderid_browser.
|
|
202
|
+
return __thunderid_browser.EmbeddedSignInFlowType;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
Object.defineProperty(exports, 'EmbeddedSignUpFlowStatus', {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function () {
|
|
208
|
+
return __thunderid_browser.EmbeddedSignUpFlowStatus;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(exports, 'EmbeddedSignUpFlowType', {
|
|
212
|
+
enumerable: true,
|
|
213
|
+
get: function () {
|
|
214
|
+
return __thunderid_browser.EmbeddedSignUpFlowType;
|
|
211
215
|
}
|
|
212
216
|
});
|
|
213
217
|
exports.Eye = require_Eye.default;
|
|
@@ -223,7 +227,6 @@ exports.GitHubButton = require_GitHubButton.default;
|
|
|
223
227
|
exports.GoogleButton = require_GoogleButton.default;
|
|
224
228
|
exports.I18nContext = require_I18nContext.default;
|
|
225
229
|
exports.I18nProvider = require_I18nProvider.default;
|
|
226
|
-
exports.IdentifierFirst = require_IdentifierFirst.default;
|
|
227
230
|
exports.Info = require_Info.default;
|
|
228
231
|
exports.InputLabel = require_InputLabel.default;
|
|
229
232
|
exports.InviteUser = require_InviteUser.default;
|
|
@@ -235,7 +238,6 @@ exports.LogOut = require_LogOut.default;
|
|
|
235
238
|
exports.Logo = require_Logo.default;
|
|
236
239
|
exports.MicrosoftButton = require_MicrosoftButton.default;
|
|
237
240
|
exports.MultiInput = require_MultiInput.default;
|
|
238
|
-
exports.MultiOptionButton = require_MultiOptionButton.default;
|
|
239
241
|
exports.OAuthCallback = require_OAuthCallback.OAuthCallback;
|
|
240
242
|
exports.Organization = require_Organization.default;
|
|
241
243
|
exports.OrganizationContext = require_OrganizationContext.default;
|
|
@@ -256,8 +258,6 @@ exports.SignUp = require_SignUp.default;
|
|
|
256
258
|
exports.SignUpButton = require_SignUpButton.default;
|
|
257
259
|
exports.SignedIn = require_SignedIn.default;
|
|
258
260
|
exports.SignedOut = require_SignedOut.default;
|
|
259
|
-
exports.SmsOtp = require_SmsOtp.default;
|
|
260
|
-
exports.SocialButton = require_SocialButton.default;
|
|
261
261
|
exports.Spinner = require_Spinner.default;
|
|
262
262
|
exports.TextField = require_TextField.default;
|
|
263
263
|
exports.ThemeContext = require_ThemeContext.default;
|
|
@@ -272,7 +272,6 @@ Object.defineProperty(exports, 'ThunderIDRuntimeError', {
|
|
|
272
272
|
});
|
|
273
273
|
exports.Toggle = require_Toggle.default;
|
|
274
274
|
exports.TokenCallback = require_TokenCallback.TokenCallback;
|
|
275
|
-
exports.Totp = require_Totp.default;
|
|
276
275
|
exports.TriangleAlert = require_TriangleAlert.default;
|
|
277
276
|
exports.Typography = require_Typography.default;
|
|
278
277
|
exports.User = require_User.default;
|
|
@@ -281,7 +280,6 @@ exports.UserDropdown = require_UserDropdown.default;
|
|
|
281
280
|
exports.UserIcon = require_User$1.default;
|
|
282
281
|
exports.UserProfile = require_UserProfile.default;
|
|
283
282
|
exports.UserProvider = require_UserProvider.default;
|
|
284
|
-
exports.UsernamePassword = require_UsernamePassword.default;
|
|
285
283
|
Object.defineProperty(exports, 'countryCodeToFlagEmoji', {
|
|
286
284
|
enumerable: true,
|
|
287
285
|
get: function () {
|
|
@@ -291,8 +289,6 @@ Object.defineProperty(exports, 'countryCodeToFlagEmoji', {
|
|
|
291
289
|
exports.createField = require_FieldFactory.createField;
|
|
292
290
|
exports.createOrganization = require_createOrganization.default;
|
|
293
291
|
exports.createPatchOperations = __thunderid_browser.createPatchOperations;
|
|
294
|
-
exports.createSignInOption = require_SignInOptionFactory.createSignInOption;
|
|
295
|
-
exports.createSignInOptionFromAuthenticator = require_SignInOptionFactory.createSignInOptionFromAuthenticator;
|
|
296
292
|
Object.defineProperty(exports, 'extractEmojiFromUri', {
|
|
297
293
|
enumerable: true,
|
|
298
294
|
get: function () {
|
|
@@ -367,6 +363,7 @@ exports.useBrowserUrl = require_useBrowserUrl.default;
|
|
|
367
363
|
exports.useFlow = require_useFlow.default;
|
|
368
364
|
exports.useForm = require_useForm.default;
|
|
369
365
|
exports.useI18n = require_useI18n.default;
|
|
366
|
+
exports.useOAuthCallback = require_useOAuthCallback.useOAuthCallback;
|
|
370
367
|
exports.useOrganization = require_useOrganization.default;
|
|
371
368
|
exports.useTheme = require_useTheme.default;
|
|
372
369
|
exports.useThunderID = require_useThunderID.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildThemeConfigFromFlowMeta.cjs","names":["scheme: FlowMetaThemeColorScheme | undefined","borderRadius: number | undefined","borderRadiusStr: string | undefined","colors: RecursivePartial<ThemeConfig['colors']> | undefined","bg: RecursivePartial<ThemeConfig['colors']['background']>"],"sources":["../../../src/utils/buildThemeConfigFromFlowMeta.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FlowMetaTheme, FlowMetaThemeColorScheme, RecursivePartial, ThemeConfig} from '@thunderid/browser';\n\n/**\n * Converts a v2 `FlowMetaTheme` into a `RecursivePartial<ThemeConfig>` that\n * `createTheme` can consume.\n *\n * Only fields explicitly present in the FlowMeta response are included so that\n * `createTheme` can deep-merge them onto its base (light/dark) defaults without\n * accidentally dropping sibling keys that were not returned by the server.\n *\n * For example, when FlowMeta returns only `background.default` and\n * `background.paper`, only `body.main` and `surface` are set — the base\n * theme's `background.disabled` and `background.dark` are **not** overridden\n * and therefore keep their default CSS variable values.\n */\nconst buildThemeConfigFromFlowMeta = (\n flowMetaTheme: FlowMetaTheme,\n colorScheme: 'light' | 'dark',\n): RecursivePartial<ThemeConfig> => {\n const scheme: FlowMetaThemeColorScheme | undefined = flowMetaTheme.colorSchemes?.[colorScheme];\n const borderRadius: number | undefined = flowMetaTheme.shape?.borderRadius;\n const borderRadiusStr: string | undefined = borderRadius !== undefined ? `${borderRadius}px` : undefined;\n\n // Build only the colors that the server actually provided.\n // Each nested object is constructed incrementally so that absent fields are\n // simply omitted rather than set to `undefined`, which would shadow the\n // base-theme defaults inside `createTheme`.\n let colors: RecursivePartial<ThemeConfig['colors']> | undefined;\n\n if (scheme?.palette) {\n colors = {};\n\n if (scheme.palette.primary) {\n colors.primary = scheme.palette.primary;\n }\n if (scheme.palette.secondary) {\n colors.secondary = scheme.palette.secondary;\n }\n if (scheme.palette.text) {\n colors.text = scheme.palette.text;\n }\n\n // Build background incrementally to avoid replacing the full base object.\n if (scheme.palette.background) {\n const bg: RecursivePartial<ThemeConfig['colors']['background']> = {};\n\n if (scheme.palette.background.default) {\n bg.body = {main: scheme.palette.background.default};\n }\n if (scheme.palette.background.paper) {\n bg.surface = scheme.palette.background.paper;\n }\n\n if (Object.keys(bg).length > 0) {\n colors.background = bg;\n }\n }\n }\n\n return {\n ...(flowMetaTheme.direction ? {direction: flowMetaTheme.direction} : {}),\n ...(borderRadiusStr\n ? {\n borderRadius: {\n large: borderRadiusStr,\n medium: borderRadiusStr,\n small: borderRadiusStr,\n },\n }\n : {}),\n ...(colors && Object.keys(colors).length > 0 ? {colors} : {}),\n ...(flowMetaTheme.typography?.fontFamily ? {typography: {fontFamily: flowMetaTheme.typography.fontFamily}} : {}),\n };\n};\n\nexport default buildThemeConfigFromFlowMeta;\n"],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAM,gCACJ,eACA,gBACkC;CAClC,MAAMA,SAA+C,cAAc,eAAe;CAClF,MAAMC,eAAmC,cAAc,OAAO;CAC9D,MAAMC,kBAAsC,iBAAiB,SAAY,GAAG,aAAa,MAAM;CAM/F,IAAIC;AAEJ,KAAI,QAAQ,SAAS;AACnB,WAAS,EAAE;AAEX,MAAI,OAAO,QAAQ,QACjB,QAAO,UAAU,OAAO,QAAQ;AAElC,MAAI,OAAO,QAAQ,UACjB,QAAO,YAAY,OAAO,QAAQ;AAEpC,MAAI,OAAO,QAAQ,KACjB,QAAO,OAAO,OAAO,QAAQ;AAI/B,MAAI,OAAO,QAAQ,YAAY;GAC7B,MAAMC,KAA4D,EAAE;AAEpE,OAAI,OAAO,QAAQ,WAAW,QAC5B,IAAG,OAAO,EAAC,MAAM,OAAO,QAAQ,WAAW,SAAQ;AAErD,OAAI,OAAO,QAAQ,WAAW,MAC5B,IAAG,UAAU,OAAO,QAAQ,WAAW;AAGzC,OAAI,OAAO,KAAK,GAAG,CAAC,SAAS,EAC3B,QAAO,aAAa;;;AAK1B,QAAO;EACL,GAAI,cAAc,YAAY,EAAC,WAAW,cAAc,WAAU,GAAG,EAAE;EACvE,GAAI,kBACA,EACE,cAAc;GACZ,OAAO;GACP,QAAQ;GACR,OAAO;GACR,EACF,GACD,EAAE;EACN,GAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,IAAI,EAAC,QAAO,GAAG,EAAE;EAC5D,GAAI,cAAc,YAAY,aAAa,EAAC,YAAY,EAAC,YAAY,cAAc,WAAW,YAAW,EAAC,GAAG,EAAE;EAChH;;AAGH,2CAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_resolveTranslationsInArray = require('./resolveTranslationsInArray.cjs');
|
|
2
2
|
|
|
3
|
-
//#region src/utils/
|
|
3
|
+
//#region src/utils/flowTransformer.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create a mapping from ref to identifier based on data.inputs array.
|
|
6
6
|
* This handles cases where meta.components use 'ref' to reference inputs,
|
|
@@ -0,0 +1 @@
|
|
|
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/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/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 {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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAuthComponentHeadings.cjs","names":["heading: EmbeddedFlowComponent | null","subheading: EmbeddedFlowComponent | null","filteredNestedComponents: EmbeddedFlowComponent[]","headingText: string","subheadingText: string"],"sources":["../../../src/utils/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 {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,8 +1,8 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let __thunderid_browser = require("@thunderid/browser");
|
|
3
3
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
4
|
|
|
5
|
-
//#region src/utils/
|
|
5
|
+
//#region src/utils/passkey.ts
|
|
6
6
|
/**
|
|
7
7
|
* Handles WebAuthn/Passkey registration flow for browser environments.
|
|
8
8
|
*
|
|
@@ -0,0 +1 @@
|
|
|
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/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,6 +1,6 @@
|
|
|
1
1
|
const require_resolveTranslationsInObject = require('./resolveTranslationsInObject.cjs');
|
|
2
2
|
|
|
3
|
-
//#region src/utils/
|
|
3
|
+
//#region src/utils/resolveTranslationsInArray.ts
|
|
4
4
|
/**
|
|
5
5
|
* Recursively resolves translation and meta template strings in an array of objects.
|
|
6
6
|
* @param items - Array of objects to process
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTranslationsInArray.cjs","names":["resolved: T","resolveTranslationsInObject"],"sources":["../../../src/utils/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"}
|
package/dist/cjs/utils/{v2/resolveTranslationsInObject.cjs → resolveTranslationsInObject.cjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let __thunderid_browser = require("@thunderid/browser");
|
|
3
3
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
4
|
|
|
5
|
-
//#region src/utils/
|
|
5
|
+
//#region src/utils/resolveTranslationsInObject.ts
|
|
6
6
|
/**
|
|
7
7
|
* Resolves all {{ t() }} and {{ meta() }} template expressions in an object's string properties.
|
|
8
8
|
* @param obj - The object to process
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTranslationsInObject.cjs","names":["resolved: T"],"sources":["../../../src/utils/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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAI3E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAI3E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAmEjG,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInButton.js","names":["SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>>","useThunderID","useTranslation","BaseSignInButton"],"sources":["../../../../src/components/actions/SignInButton/SignInButton.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 {ThunderIDRuntimeError, navigate} from '@thunderid/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps & {\n /**\n * Additional parameters to pass to the `authorize` request.\n */\n signInOptions?: Record<string, any>;\n /**\n * Additional parameters to pass to the token request body.\n */\n tokenRequest?: {params?: Record<string, unknown>};\n};\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(\n (\n {children
|
|
1
|
+
{"version":3,"file":"SignInButton.js","names":["SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>>","useThunderID","useTranslation","BaseSignInButton"],"sources":["../../../../src/components/actions/SignInButton/SignInButton.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 {ThunderIDRuntimeError, navigate} from '@thunderid/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps & {\n /**\n * Additional parameters to pass to the `authorize` request.\n */\n signInOptions?: Record<string, any>;\n /**\n * Additional parameters to pass to the token request body.\n */\n tokenRequest?: {params?: Record<string, unknown>};\n};\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(\n (\n {\n children,\n onClick,\n preferences,\n signInOptions: overriddenSignInOptions,\n tokenRequest: overriddenTokenRequest,\n ...rest\n }: SignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n const {signIn, signInUrl, signInOptions, tokenRequest, meta} = useThunderID();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignIn = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signInUrl` is provided, use it for navigation.\n if (signInUrl) {\n navigate(signInUrl);\n } else {\n const mergedParams = (overriddenTokenRequest ?? tokenRequest)?.params;\n await signIn(\n overriddenSignInOptions ?? signInOptions,\n undefined,\n undefined,\n undefined,\n mergedParams && Object.keys(mergedParams).length > 0 ? {params: mergedParams} : undefined,\n );\n }\n\n if (onClick) {\n onClick(e!);\n }\n } catch (error) {\n throw new ThunderIDRuntimeError(\n `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,\n 'SignInButton-handleSignIn-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign in. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignInButton\n ref={ref}\n onClick={handleSignIn}\n isLoading={isLoading}\n meta={meta}\n signIn={handleSignIn}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signin.text')}\n </BaseSignInButton>\n );\n },\n);\n\nSignInButton.displayName = 'SignInButton';\n\nexport default SignInButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,MAAMA,eAAgG,YAKlG,EACE,UACA,SACA,aACA,eAAe,yBACf,cAAc,uBACd,GAAG,QAEL,QACiB;CACjB,MAAM,EAAC,QAAQ,WAAW,eAAe,cAAc,SAAQC,sBAAc;CAC7E,MAAM,EAAC,MAAKC,uBAAe,aAAa,KAAK;CAE7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAEjD,MAAM,eAAe,OAAO,MAAqD;AAC/E,MAAI;AACF,gBAAa,KAAK;AAGlB,OAAI,UACF,UAAS,UAAU;QACd;IACL,MAAM,gBAAgB,0BAA0B,eAAe;AAC/D,UAAM,OACJ,2BAA2B,eAC3B,QACA,QACA,QACA,gBAAgB,OAAO,KAAK,aAAa,CAAC,SAAS,IAAI,EAAC,QAAQ,cAAa,GAAG,OACjF;;AAGH,OAAI,QACF,SAAQ,EAAG;WAEN,OAAO;AACd,SAAM,IAAI,sBACR,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,CAAC,IACzF,8CACA,SACA,wEACD;YACO;AACR,gBAAa,MAAM;;;AAIvB,QACE,oBAACC;EACM;EACL,SAAS;EACE;EACL;EACN,QAAQ;EACK;EACb,GAAI;YAEH,YAAY,EAAE,+BAA+B;GAC7B;EAGxB;AAED,aAAa,cAAc;AAE3B,2BAAe"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { type
|
|
18
|
+
import { type ConsentPurposeData } from '@thunderid/browser';
|
|
19
19
|
import { FC, ReactNode } from 'react';
|
|
20
20
|
/**
|
|
21
21
|
* Backward-compatible consent purpose type exported by @thunderid/react.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Consent.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/Consent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Consent.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/Consent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,KAAK,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,EAAE,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAIpC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,kEAAkE;IAClE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,uEAAuE;IACvE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,GAAG;QAAC,QAAQ,EAAE,kBAAkB,EAAE,CAAA;KAAC,CAAC;IAC/E;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAgE7B,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Consent.js","names":["Consent: FC<ConsentProps>","purposes: ConsentPurposeData[]","parsed: ConsentPurposeData[] | {purposes: ConsentPurposeData[]}","Typography","ConsentCheckboxList"],"sources":["../../../src/components/adapters/Consent.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {type
|
|
1
|
+
{"version":3,"file":"Consent.js","names":["Consent: FC<ConsentProps>","purposes: ConsentPurposeData[]","parsed: ConsentPurposeData[] | {purposes: ConsentPurposeData[]}","Typography","ConsentCheckboxList"],"sources":["../../../src/components/adapters/Consent.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {type ConsentPurposeData} from '@thunderid/browser';\nimport {FC, ReactNode} from 'react';\nimport ConsentCheckboxList from './ConsentCheckboxList';\nimport Typography from '../primitives/Typography/Typography';\n\n/**\n * Backward-compatible consent purpose type exported by @thunderid/react.\n *\n * Some consumers import this name directly; keep it as an alias to the v2 model.\n */\nexport type ConsentPurpose = ConsentPurposeData;\n\n/**\n * Render props exposed by Consent when using the render-prop pattern.\n */\nexport interface ConsentRenderProps {\n /** Current form values - used to read optional checkbox state. */\n formValues: Record<string, string>;\n /** Callback invoked when a user toggles an optional attribute. */\n onInputChange: (name: string, value: string) => void;\n /** The resolved list of consent purposes parsed from `consentData`. */\n purposes: ConsentPurposeData[];\n}\n\n/**\n * Props for the Consent component.\n */\nexport interface ConsentProps {\n /**\n * Render-props callback. When provided, the default consent UI is replaced with\n * whatever JSX the callback returns. The parsed `purposes` list is injected so\n * consumers do not need to re-parse `consentData` themselves.\n *\n * @example\n * ```tsx\n * <Consent consentData={raw} formValues={formInputs} onInputChange={onChange} t={t}>\n * {({ purposes, formValues, onInputChange, t }) => (\n * <div>\n * {purposes.map(p => <MyConsentSection key={p.purposeId} purpose={p} />)}\n * </div>\n * )}\n * </Consent>\n * ```\n */\n children?: (props: ConsentRenderProps) => ReactNode;\n /**\n * The raw JSON string returned by the backend in `additionalData.consentPrompt`.\n */\n consentData?: string | ConsentPurposeData[] | {purposes: ConsentPurposeData[]};\n /**\n * Current form values - used to read optional checkbox state.\n */\n formValues: Record<string, string>;\n /**\n * Callback invoked when a user toggles an optional attribute.\n */\n onInputChange: (name: string, value: string) => void;\n}\n\n/**\n * Consent component renders the list of purposes and their associated attributes (essential and optional)\n * based on the data provided by the backend. It allows users to toggle optional attributes while essential\n * attributes are displayed as read-only.\n */\nconst Consent: FC<ConsentProps> = ({consentData, formValues, onInputChange, children}: ConsentProps) => {\n if (!consentData) return null;\n\n let purposes: ConsentPurposeData[] = [];\n\n try {\n const parsed: ConsentPurposeData[] | {purposes: ConsentPurposeData[]} =\n typeof consentData === 'string' ? JSON.parse(consentData) : consentData;\n\n purposes = Array.isArray(parsed) ? parsed : parsed.purposes || [];\n } catch (e) {\n // Failed to parse consent prompt data\n return null;\n }\n\n if (purposes.length === 0) return null;\n\n if (children) {\n return <>{children({formValues, onInputChange, purposes: purposes})}</>;\n }\n\n return (\n <div style={{display: 'flex', flexDirection: 'column', gap: '1rem', marginTop: '0.25rem'}}>\n {purposes.map((purpose: ConsentPurposeData, purposeIndex: number) => (\n <div key={purpose.purposeId || purposeIndex} style={{paddingBottom: '1rem'}}>\n {/* TODO: Uncomment when the backend supports multiple purposes for a application */}\n {/* <Typography variant=\"h6\" fontWeight={600} gutterBottom color=\"inherit\">\n {purpose.purposeName}\n </Typography>\n <Typography variant=\"body2\" color=\"inherit\" style={{marginBottom: '1rem', opacity: 0.85}}>\n {purpose.description}\n </Typography> */}\n\n {purpose.essential && purpose.essential.length > 0 && (\n <div style={{marginTop: '0.5rem'}}>\n <Typography variant=\"subtitle2\" fontWeight=\"bold\">\n Essential Attributes\n </Typography>\n <ConsentCheckboxList\n variant=\"ESSENTIAL\"\n purpose={purpose}\n formValues={formValues}\n onInputChange={onInputChange}\n />\n </div>\n )}\n\n {purpose.optional && purpose.optional.length > 0 && (\n <div style={{marginTop: '0.5rem'}}>\n <Typography variant=\"subtitle2\" fontWeight=\"bold\">\n {purpose.type === 'permissions' ? 'Permissions' : 'Optional Attributes'}\n </Typography>\n <ConsentCheckboxList\n variant=\"OPTIONAL\"\n purpose={purpose}\n formValues={formValues}\n onInputChange={onInputChange}\n />\n </div>\n )}\n </div>\n ))}\n </div>\n );\n};\n\nexport default Consent;\n"],"mappings":";;;;;;;;;;AAkFA,MAAMA,WAA6B,EAAC,aAAa,YAAY,eAAe,eAA4B;AACtG,KAAI,CAAC,YAAa,QAAO;CAEzB,IAAIC,WAAiC,EAAE;AAEvC,KAAI;EACF,MAAMC,SACJ,OAAO,gBAAgB,WAAW,KAAK,MAAM,YAAY,GAAG;AAE9D,aAAW,MAAM,QAAQ,OAAO,GAAG,SAAS,OAAO,YAAY,EAAE;UAC1D,GAAG;AAEV,SAAO;;AAGT,KAAI,SAAS,WAAW,EAAG,QAAO;AAElC,KAAI,SACF,QAAO,0CAAG,SAAS;EAAC;EAAY;EAAyB;EAAS,CAAC,GAAI;AAGzE,QACE,oBAAC;EAAI,OAAO;GAAC,SAAS;GAAQ,eAAe;GAAU,KAAK;GAAQ,WAAW;GAAU;YACtF,SAAS,KAAK,SAA6B,iBAC1C,qBAAC;GAA4C,OAAO,EAAC,eAAe,QAAO;cASxE,QAAQ,aAAa,QAAQ,UAAU,SAAS,KAC/C,qBAAC;IAAI,OAAO,EAAC,WAAW,UAAS;eAC/B,oBAACC;KAAW,SAAQ;KAAY,YAAW;eAAO;MAErC,EACb,oBAACC;KACC,SAAQ;KACC;KACG;KACG;MACf;KACE,EAGP,QAAQ,YAAY,QAAQ,SAAS,SAAS,KAC7C,qBAAC;IAAI,OAAO,EAAC,WAAW,UAAS;eAC/B,oBAACD;KAAW,SAAQ;KAAY,YAAW;eACxC,QAAQ,SAAS,gBAAgB,gBAAgB;MACvC,EACb,oBAACC;KACC,SAAQ;KACC;KACG;KACG;MACf;KACE;KAlCA,QAAQ,aAAa,aAoCzB,CACN;GACE;;AAIV,sBAAe"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { type
|
|
18
|
+
import { type ConsentPurposeData } from '@thunderid/browser';
|
|
19
19
|
import { FC, ReactNode } from 'react';
|
|
20
20
|
/**
|
|
21
21
|
* Computes the form value key for tracking an optional attribute's consent state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsentCheckboxList.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/ConsentCheckboxList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"ConsentCheckboxList.d.ts","sourceRoot":"","sources":["../../../src/components/adapters/ConsentCheckboxList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,KAAK,kBAAkB,EAAgC,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAmB,EAAE,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAOtD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,MAChC,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,6CAA6C;IAC7C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;OAGG;IACH,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,sEAAsE;IACtE,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,SAAS,CAAC;IAChE,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,sEAAsE;IACtE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,0DAA0D;IAC1D,OAAO,EAAE,kBAAkB,CAAC;IAC5B,iFAAiF;IACjF,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAwFrD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useTheme_default from "../../contexts/Theme/useTheme.js";
|
|
2
2
|
import Typography_default from "../primitives/Typography/Typography.js";
|
|
3
|
-
import Divider_default from "../primitives/Divider/Divider.js";
|
|
4
3
|
import ConsentCheckboxList_styles_default from "./ConsentCheckboxList.styles.js";
|
|
4
|
+
import Divider_default from "../primitives/Divider/Divider.js";
|
|
5
5
|
import Toggle_default from "../primitives/Toggle/Toggle.js";
|
|
6
6
|
import { bem, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsentCheckboxList.js","names":["ConsentCheckboxList: FC<ConsentCheckboxListProps>","useTheme","styles: Record<string, string>","useStyles","attributes: string[]","isEssential: boolean","checked: boolean","Typography","Toggle","Divider"],"sources":["../../../src/components/adapters/ConsentCheckboxList.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {type
|
|
1
|
+
{"version":3,"file":"ConsentCheckboxList.js","names":["ConsentCheckboxList: FC<ConsentCheckboxListProps>","useTheme","styles: Record<string, string>","useStyles","attributes: string[]","isEssential: boolean","checked: boolean","Typography","Toggle","Divider"],"sources":["../../../src/components/adapters/ConsentCheckboxList.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {type ConsentPurposeData, withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {type ChangeEvent, FC, ReactNode} from 'react';\nimport useStyles from './ConsentCheckboxList.styles';\nimport useTheme from '../../contexts/Theme/useTheme';\nimport Divider from '../primitives/Divider/Divider';\nimport Toggle from '../primitives/Toggle/Toggle';\nimport Typography from '../primitives/Typography/Typography';\n\n/**\n * Computes the form value key for tracking an optional attribute's consent state.\n *\n * @param purposeId - The ID of the consent purpose.\n * @param attrName - The name of the attribute.\n * @returns A stable form key string.\n */\nexport const getConsentOptionalKey = (purposeId: string, attrName: string): string =>\n `__consent_opt__${purposeId}__${attrName}`;\n\n/**\n * ConsentInputVariant defines whether the ConsentCheckboxList is rendering essential (read-only) or\n * optional (toggleable) attributes.\n */\nexport type ConsentInputVariant = 'ESSENTIAL' | 'OPTIONAL';\n\n/**\n * Render props exposed by ConsentCheckboxList when using the render-prop pattern.\n */\nexport interface ConsentCheckboxListRenderProps {\n /** The list of attribute names to render. */\n attributes: string[];\n /**\n * Call this when an optional attribute checkbox is toggled.\n * No-op for ESSENTIAL attributes (they cannot be changed).\n */\n handleChange: (attrName: string, checked: boolean) => void;\n /**\n * Returns the current checked state for the given attribute name.\n * Always returns true for ESSENTIAL attributes.\n */\n isChecked: (attrName: string) => boolean;\n /** Whether the list is rendering essential or optional attributes. */\n variant: ConsentInputVariant;\n}\n\n/**\n * Props for the ConsentCheckboxList component.\n */\nexport interface ConsentCheckboxListProps {\n /**\n * Render-props callback. When provided, the default checkbox list UI is replaced\n * with whatever JSX the callback returns.\n *\n * @example\n * ```tsx\n * <ConsentCheckboxList variant=\"OPTIONAL\" purpose={purpose} formValues={formValues} onInputChange={onChange}>\n * {({ attributes, isChecked, handleChange }) => (\n * <ul>\n * {attributes.map(attr => (\n * <li key={attr}>\n * <Checkbox checked={isChecked(attr)} onChange={e => handleChange(attr, e.target.checked)} />\n * {attr}\n * </li>\n * ))}\n * </ul>\n * )}\n * </ConsentCheckboxList>\n * ```\n */\n children?: (props: ConsentCheckboxListRenderProps) => ReactNode;\n /** Current form values - used to read optional checkbox state */\n formValues: Record<string, string>;\n /** Callback invoked when an optional attribute checkbox is toggled */\n onInputChange: (name: string, value: string) => void;\n /** The consent purpose data containing attribute lists */\n purpose: ConsentPurposeData;\n /** Whether to render essential (disabled) or optional (toggleable) attributes */\n variant: ConsentInputVariant;\n}\n\n/**\n * Renders a list of consent attribute checkboxes.\n *\n * - ESSENTIAL variant: renders read-only checked checkboxes for required attributes.\n * - OPTIONAL variant: renders toggleable checkboxes for optional attributes.\n * Opt-in is the default when no prior form value exists.\n */\nconst ConsentCheckboxList: FC<ConsentCheckboxListProps> = ({\n variant,\n purpose,\n formValues,\n onInputChange,\n children,\n}: ConsentCheckboxListProps) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n\n const attributes: string[] = (variant === 'ESSENTIAL' ? purpose.essential : purpose.optional).map(\n (e): string => e.name,\n );\n\n if (!attributes || attributes.length === 0) {\n return null;\n }\n\n const isEssential: boolean = variant === 'ESSENTIAL';\n\n const isChecked = (attrName: string): boolean => {\n if (isEssential) {\n return true;\n }\n const key: string = getConsentOptionalKey(purpose.purposeId, attrName);\n // Default to opted-in (true) when there's no explicit form value\n return formValues[key] !== 'false';\n };\n\n const handleChange = (attrName: string, checked: boolean): void => {\n const key: string = getConsentOptionalKey(purpose.purposeId, attrName);\n onInputChange(key, checked ? 'true' : 'false');\n };\n\n if (children) {\n return <>{children({attributes, handleChange, isChecked, variant})}</>;\n }\n\n return (\n <div className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list')), styles['listContainer'])}>\n {attributes.map((attr: string) => {\n const inputId = `consent_${isEssential ? 'ess' : 'opt'}_${purpose.purposeId}_${attr}`;\n const checked: boolean = isChecked(attr);\n\n return (\n <div\n key={attr}\n className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list', 'item')), styles['listItem'])}\n >\n <div className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list', 'row')), styles['listRow'])}>\n <div\n className={cx(\n withVendorCSSClassPrefix(bem('consent-checkbox-list', 'label-container')),\n styles['labelContainer'],\n )}\n >\n <div\n className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list', 'bullet')), styles['bullet'])}\n />\n <Typography\n variant=\"body2\"\n className={cx(\n withVendorCSSClassPrefix(bem('consent-checkbox-list', 'typography')),\n styles['typography'],\n )}\n >\n {attr}\n </Typography>\n </div>\n <Toggle\n id={inputId}\n checked={checked}\n disabled={isEssential}\n onChange={\n isEssential\n ? undefined\n : (e: ChangeEvent<HTMLInputElement>): void => handleChange(attr, e.target.checked)\n }\n />\n </div>\n <Divider\n className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list', 'divider')), styles['divider'])}\n />\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ConsentCheckboxList;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAa,yBAAyB,WAAmB,aACvD,kBAAkB,UAAU,IAAI;;;;;;;;AAsElC,MAAMA,uBAAqD,EACzD,SACA,SACA,YACA,eACA,eAC8B;CAC9B,MAAM,EAAC,OAAO,gBAA4CC,kBAAU;CACpE,MAAMC,SAAiCC,mCAAU,OAAO,YAAY;CAEpE,MAAMC,cAAwB,YAAY,cAAc,QAAQ,YAAY,QAAQ,UAAU,KAC3F,MAAc,EAAE,KAClB;AAED,KAAI,CAAC,cAAc,WAAW,WAAW,EACvC,QAAO;CAGT,MAAMC,cAAuB,YAAY;CAEzC,MAAM,aAAa,aAA8B;AAC/C,MAAI,YACF,QAAO;AAIT,SAAO,WAFa,sBAAsB,QAAQ,WAAW,SAAS,MAE3C;;CAG7B,MAAM,gBAAgB,UAAkB,YAA2B;AAEjE,gBADoB,sBAAsB,QAAQ,WAAW,SAAS,EACnD,UAAU,SAAS,QAAQ;;AAGhD,KAAI,SACF,QAAO,0CAAG,SAAS;EAAC;EAAY;EAAc;EAAW;EAAQ,CAAC,GAAI;AAGxE,QACE,oBAAC;EAAI,WAAW,GAAG,yBAAyB,IAAI,wBAAwB,CAAC,EAAE,OAAO,iBAAiB;YAChG,WAAW,KAAK,SAAiB;GAChC,MAAM,UAAU,WAAW,cAAc,QAAQ,MAAM,GAAG,QAAQ,UAAU,GAAG;GAC/E,MAAMC,UAAmB,UAAU,KAAK;AAExC,UACE,qBAAC;IAEC,WAAW,GAAG,yBAAyB,IAAI,yBAAyB,OAAO,CAAC,EAAE,OAAO,YAAY;eAEjG,qBAAC;KAAI,WAAW,GAAG,yBAAyB,IAAI,yBAAyB,MAAM,CAAC,EAAE,OAAO,WAAW;gBAClG,qBAAC;MACC,WAAW,GACT,yBAAyB,IAAI,yBAAyB,kBAAkB,CAAC,EACzE,OAAO,kBACR;iBAED,oBAAC,SACC,WAAW,GAAG,yBAAyB,IAAI,yBAAyB,SAAS,CAAC,EAAE,OAAO,UAAU,GACjG,EACF,oBAACC;OACC,SAAQ;OACR,WAAW,GACT,yBAAyB,IAAI,yBAAyB,aAAa,CAAC,EACpE,OAAO,cACR;iBAEA;QACU;OACT,EACN,oBAACC;MACC,IAAI;MACK;MACT,UAAU;MACV,UACE,cACI,UACC,MAA2C,aAAa,MAAM,EAAE,OAAO,QAAQ;OAEtF;MACE,EACN,oBAACC,mBACC,WAAW,GAAG,yBAAyB,IAAI,yBAAyB,UAAU,CAAC,EAAE,OAAO,WAAW,GACnG;MApCG,KAqCD;IAER;GACE;;AAIV,kCAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { TokenCallbackProps } from './TokenCallback';
|
|
3
2
|
import { OAuthCallbackProps } from './OAuthCallback';
|
|
3
|
+
import { TokenCallbackProps } from './TokenCallback';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the unified Callback component, combining properties for both Token and OAuth callbacks.
|
|
6
6
|
*/
|