@velion-la/onboarding-sdk-react-native 1.0.0-beta.2
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/CHANGELOG.md +66 -0
- package/LICENSE +12 -0
- package/README.md +803 -0
- package/lib/commonjs/camera/AddressSearchBar.js +304 -0
- package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
- package/lib/commonjs/camera/DocumentCapture.js +505 -0
- package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
- package/lib/commonjs/camera/LivenessCamera.js +534 -0
- package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
- package/lib/commonjs/camera/MapAddressPicker.js +341 -0
- package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
- package/lib/commonjs/core/VelionOnboarding.js +815 -0
- package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
- package/lib/commonjs/core/sessionDeclinedCopy.js +56 -0
- package/lib/commonjs/core/sessionDeclinedCopy.js.map +1 -0
- package/lib/commonjs/core/sessionStateMapper.js +137 -0
- package/lib/commonjs/core/sessionStateMapper.js.map +1 -0
- package/lib/commonjs/core/sseReasonMessages.js +450 -0
- package/lib/commonjs/core/sseReasonMessages.js.map +1 -0
- package/lib/commonjs/data/iso3166Alpha2Codes.json +1 -0
- package/lib/commonjs/data/iso3166CountryNames.json +251 -0
- package/lib/commonjs/i18n/index.js +30 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/strings/en.js +261 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -0
- package/lib/commonjs/i18n/strings/es.js +266 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -0
- package/lib/commonjs/index.js +213 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/steps/AddressInfoStep.js +650 -0
- package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js +397 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/commonjs/steps/EmailContactStep.js +145 -0
- package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
- package/lib/commonjs/steps/EmailOtpStep.js +220 -0
- package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
- package/lib/commonjs/steps/FaceMatchStep.js +166 -0
- package/lib/commonjs/steps/FaceMatchStep.js.map +1 -0
- package/lib/commonjs/steps/FingerprintStep.js +92 -0
- package/lib/commonjs/steps/FingerprintStep.js.map +1 -0
- package/lib/commonjs/steps/HumanBasicInfoStep.js +243 -0
- package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js +268 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js +188 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js +166 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LivenessMatchStep.js +707 -0
- package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneContactStep.js +146 -0
- package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneOtpStep.js +219 -0
- package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js +196 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/commonjs/steps/TaxInfoStep.js +244 -0
- package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js +238 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/commonjs/steps/_shared.js +40 -0
- package/lib/commonjs/steps/_shared.js.map +1 -0
- package/lib/commonjs/steps/types.js +6 -0
- package/lib/commonjs/steps/types.js.map +1 -0
- package/lib/commonjs/transport/api.js +176 -0
- package/lib/commonjs/transport/api.js.map +1 -0
- package/lib/commonjs/transport/irisWebSocket.js +121 -0
- package/lib/commonjs/transport/irisWebSocket.js.map +1 -0
- package/lib/commonjs/transport/secureUrl.js +50 -0
- package/lib/commonjs/transport/secureUrl.js.map +1 -0
- package/lib/commonjs/transport/sse.js +248 -0
- package/lib/commonjs/transport/sse.js.map +1 -0
- package/lib/commonjs/types/index.js +391 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/ui/MapFallbackBoundary.js +42 -0
- package/lib/commonjs/ui/MapFallbackBoundary.js.map +1 -0
- package/lib/commonjs/ui/StepShell.js +118 -0
- package/lib/commonjs/ui/StepShell.js.map +1 -0
- package/lib/commonjs/ui/VelionOnboardingScreen.js +217 -0
- package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -0
- package/lib/commonjs/ui/forms/index.js +38 -0
- package/lib/commonjs/ui/forms/index.js.map +1 -0
- package/lib/commonjs/ui/forms/useInlineValidation.js +88 -0
- package/lib/commonjs/ui/forms/useInlineValidation.js.map +1 -0
- package/lib/commonjs/ui/forms/validators.js +34 -0
- package/lib/commonjs/ui/forms/validators.js.map +1 -0
- package/lib/commonjs/ui/icons/HomeHeartIcon.js +38 -0
- package/lib/commonjs/ui/icons/HomeHeartIcon.js.map +1 -0
- package/lib/commonjs/ui/icons/StepIcon.js +59 -0
- package/lib/commonjs/ui/icons/StepIcon.js.map +1 -0
- package/lib/commonjs/ui/overlays/AnalyzingOverlay.js +284 -0
- package/lib/commonjs/ui/overlays/AnalyzingOverlay.js.map +1 -0
- package/lib/commonjs/ui/overlays/LoadingOverlay.js +108 -0
- package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -0
- package/lib/commonjs/ui/overlays/ProgressBar.js +95 -0
- package/lib/commonjs/ui/overlays/ProgressBar.js.map +1 -0
- package/lib/commonjs/ui/overlays/RetryDialog.js +125 -0
- package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -0
- package/lib/commonjs/ui/overlays/index.js +33 -0
- package/lib/commonjs/ui/overlays/index.js.map +1 -0
- package/lib/commonjs/ui/primitives/Banner.js +81 -0
- package/lib/commonjs/ui/primitives/Banner.js.map +1 -0
- package/lib/commonjs/ui/primitives/Button.js +142 -0
- package/lib/commonjs/ui/primitives/Button.js.map +1 -0
- package/lib/commonjs/ui/primitives/Card.js +50 -0
- package/lib/commonjs/ui/primitives/Card.js.map +1 -0
- package/lib/commonjs/ui/primitives/Checkbox.js +139 -0
- package/lib/commonjs/ui/primitives/Checkbox.js.map +1 -0
- package/lib/commonjs/ui/primitives/CountrySelect.js +288 -0
- package/lib/commonjs/ui/primitives/CountrySelect.js.map +1 -0
- package/lib/commonjs/ui/primitives/DatePicker.js +245 -0
- package/lib/commonjs/ui/primitives/DatePicker.js.map +1 -0
- package/lib/commonjs/ui/primitives/Input.js +101 -0
- package/lib/commonjs/ui/primitives/Input.js.map +1 -0
- package/lib/commonjs/ui/primitives/Select.js +209 -0
- package/lib/commonjs/ui/primitives/Select.js.map +1 -0
- package/lib/commonjs/ui/primitives/Spinner.js +25 -0
- package/lib/commonjs/ui/primitives/Spinner.js.map +1 -0
- package/lib/commonjs/ui/primitives/index.js +69 -0
- package/lib/commonjs/ui/primitives/index.js.map +1 -0
- package/lib/commonjs/ui/theme/ThemeProvider.js +74 -0
- package/lib/commonjs/ui/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/ui/theme/index.js +68 -0
- package/lib/commonjs/ui/theme/index.js.map +1 -0
- package/lib/commonjs/ui/theme/tokens.js +154 -0
- package/lib/commonjs/ui/theme/tokens.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +144 -0
- package/lib/commonjs/utils/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/base64.js +53 -0
- package/lib/commonjs/utils/base64.js.map +1 -0
- package/lib/commonjs/utils/deviceFingerprint.js +132 -0
- package/lib/commonjs/utils/deviceFingerprint.js.map +1 -0
- package/lib/commonjs/utils/documentTypeOptions.js +35 -0
- package/lib/commonjs/utils/documentTypeOptions.js.map +1 -0
- package/lib/commonjs/utils/googleMapsPreflight.js +77 -0
- package/lib/commonjs/utils/googleMapsPreflight.js.map +1 -0
- package/lib/commonjs/utils/hmac.js +58 -0
- package/lib/commonjs/utils/hmac.js.map +1 -0
- package/lib/commonjs/utils/iso3166Countries.js +98 -0
- package/lib/commonjs/utils/iso3166Countries.js.map +1 -0
- package/lib/commonjs/utils/jpegFromUri.js +44 -0
- package/lib/commonjs/utils/jpegFromUri.js.map +1 -0
- package/lib/commonjs/utils/keepAwake.js +58 -0
- package/lib/commonjs/utils/keepAwake.js.map +1 -0
- package/lib/commonjs/utils/log.js +42 -0
- package/lib/commonjs/utils/log.js.map +1 -0
- package/lib/commonjs/utils/osGeocoder.js +70 -0
- package/lib/commonjs/utils/osGeocoder.js.map +1 -0
- package/lib/commonjs/utils/parseGoogleAddressComponents.js +74 -0
- package/lib/commonjs/utils/parseGoogleAddressComponents.js.map +1 -0
- package/lib/commonjs/utils/personNameNormalize.js +24 -0
- package/lib/commonjs/utils/personNameNormalize.js.map +1 -0
- package/lib/commonjs/utils/sdkError.js +34 -0
- package/lib/commonjs/utils/sdkError.js.map +1 -0
- package/lib/commonjs/utils/sdkVersion.js +13 -0
- package/lib/commonjs/utils/sdkVersion.js.map +1 -0
- package/lib/commonjs/utils/stepConfig.js +65 -0
- package/lib/commonjs/utils/stepConfig.js.map +1 -0
- package/lib/commonjs/utils/taxInfoConfig.js +19 -0
- package/lib/commonjs/utils/taxInfoConfig.js.map +1 -0
- package/lib/module/camera/AddressSearchBar.js +299 -0
- package/lib/module/camera/AddressSearchBar.js.map +1 -0
- package/lib/module/camera/DocumentCapture.js +500 -0
- package/lib/module/camera/DocumentCapture.js.map +1 -0
- package/lib/module/camera/LivenessCamera.js +529 -0
- package/lib/module/camera/LivenessCamera.js.map +1 -0
- package/lib/module/camera/MapAddressPicker.js +337 -0
- package/lib/module/camera/MapAddressPicker.js.map +1 -0
- package/lib/module/core/VelionOnboarding.js +811 -0
- package/lib/module/core/VelionOnboarding.js.map +1 -0
- package/lib/module/core/sessionDeclinedCopy.js +52 -0
- package/lib/module/core/sessionDeclinedCopy.js.map +1 -0
- package/lib/module/core/sessionStateMapper.js +128 -0
- package/lib/module/core/sessionStateMapper.js.map +1 -0
- package/lib/module/core/sseReasonMessages.js +446 -0
- package/lib/module/core/sseReasonMessages.js.map +1 -0
- package/lib/module/data/iso3166Alpha2Codes.json +1 -0
- package/lib/module/data/iso3166CountryNames.json +251 -0
- package/lib/module/i18n/index.js +25 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/strings/en.js +257 -0
- package/lib/module/i18n/strings/en.js.map +1 -0
- package/lib/module/i18n/strings/es.js +262 -0
- package/lib/module/i18n/strings/es.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/steps/AddressInfoStep.js +646 -0
- package/lib/module/steps/AddressInfoStep.js.map +1 -0
- package/lib/module/steps/DocumentsOcrStep.js +391 -0
- package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/module/steps/EmailContactStep.js +140 -0
- package/lib/module/steps/EmailContactStep.js.map +1 -0
- package/lib/module/steps/EmailOtpStep.js +215 -0
- package/lib/module/steps/EmailOtpStep.js.map +1 -0
- package/lib/module/steps/FaceMatchStep.js +161 -0
- package/lib/module/steps/FaceMatchStep.js.map +1 -0
- package/lib/module/steps/FingerprintStep.js +87 -0
- package/lib/module/steps/FingerprintStep.js.map +1 -0
- package/lib/module/steps/HumanBasicInfoStep.js +238 -0
- package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/module/steps/HumanExtendedInfoStep.js +263 -0
- package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LegalBasicInfoStep.js +183 -0
- package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/module/steps/LegalExtendedInfoStep.js +161 -0
- package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LivenessMatchStep.js +701 -0
- package/lib/module/steps/LivenessMatchStep.js.map +1 -0
- package/lib/module/steps/PhoneContactStep.js +141 -0
- package/lib/module/steps/PhoneContactStep.js.map +1 -0
- package/lib/module/steps/PhoneOtpStep.js +214 -0
- package/lib/module/steps/PhoneOtpStep.js.map +1 -0
- package/lib/module/steps/SwornDeclarationStep.js +191 -0
- package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/module/steps/TaxInfoStep.js +239 -0
- package/lib/module/steps/TaxInfoStep.js.map +1 -0
- package/lib/module/steps/TermsAndConditionsStep.js +233 -0
- package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/module/steps/_shared.js +33 -0
- package/lib/module/steps/_shared.js.map +1 -0
- package/lib/module/steps/types.js +4 -0
- package/lib/module/steps/types.js.map +1 -0
- package/lib/module/transport/api.js +173 -0
- package/lib/module/transport/api.js.map +1 -0
- package/lib/module/transport/irisWebSocket.js +115 -0
- package/lib/module/transport/irisWebSocket.js.map +1 -0
- package/lib/module/transport/secureUrl.js +45 -0
- package/lib/module/transport/secureUrl.js.map +1 -0
- package/lib/module/transport/sse.js +242 -0
- package/lib/module/transport/sse.js.map +1 -0
- package/lib/module/types/index.js +457 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/ui/MapFallbackBoundary.js +37 -0
- package/lib/module/ui/MapFallbackBoundary.js.map +1 -0
- package/lib/module/ui/StepShell.js +114 -0
- package/lib/module/ui/StepShell.js.map +1 -0
- package/lib/module/ui/VelionOnboardingScreen.js +212 -0
- package/lib/module/ui/VelionOnboardingScreen.js.map +1 -0
- package/lib/module/ui/forms/index.js +5 -0
- package/lib/module/ui/forms/index.js.map +1 -0
- package/lib/module/ui/forms/useInlineValidation.js +84 -0
- package/lib/module/ui/forms/useInlineValidation.js.map +1 -0
- package/lib/module/ui/forms/validators.js +27 -0
- package/lib/module/ui/forms/validators.js.map +1 -0
- package/lib/module/ui/icons/HomeHeartIcon.js +33 -0
- package/lib/module/ui/icons/HomeHeartIcon.js.map +1 -0
- package/lib/module/ui/icons/StepIcon.js +55 -0
- package/lib/module/ui/icons/StepIcon.js.map +1 -0
- package/lib/module/ui/overlays/AnalyzingOverlay.js +279 -0
- package/lib/module/ui/overlays/AnalyzingOverlay.js.map +1 -0
- package/lib/module/ui/overlays/LoadingOverlay.js +104 -0
- package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -0
- package/lib/module/ui/overlays/ProgressBar.js +90 -0
- package/lib/module/ui/overlays/ProgressBar.js.map +1 -0
- package/lib/module/ui/overlays/RetryDialog.js +121 -0
- package/lib/module/ui/overlays/RetryDialog.js.map +1 -0
- package/lib/module/ui/overlays/index.js +6 -0
- package/lib/module/ui/overlays/index.js.map +1 -0
- package/lib/module/ui/primitives/Banner.js +77 -0
- package/lib/module/ui/primitives/Banner.js.map +1 -0
- package/lib/module/ui/primitives/Button.js +138 -0
- package/lib/module/ui/primitives/Button.js.map +1 -0
- package/lib/module/ui/primitives/Card.js +46 -0
- package/lib/module/ui/primitives/Card.js.map +1 -0
- package/lib/module/ui/primitives/Checkbox.js +136 -0
- package/lib/module/ui/primitives/Checkbox.js.map +1 -0
- package/lib/module/ui/primitives/CountrySelect.js +284 -0
- package/lib/module/ui/primitives/CountrySelect.js.map +1 -0
- package/lib/module/ui/primitives/DatePicker.js +241 -0
- package/lib/module/ui/primitives/DatePicker.js.map +1 -0
- package/lib/module/ui/primitives/Input.js +97 -0
- package/lib/module/ui/primitives/Input.js.map +1 -0
- package/lib/module/ui/primitives/Select.js +205 -0
- package/lib/module/ui/primitives/Select.js.map +1 -0
- package/lib/module/ui/primitives/Spinner.js +21 -0
- package/lib/module/ui/primitives/Spinner.js.map +1 -0
- package/lib/module/ui/primitives/index.js +12 -0
- package/lib/module/ui/primitives/index.js.map +1 -0
- package/lib/module/ui/theme/ThemeProvider.js +67 -0
- package/lib/module/ui/theme/ThemeProvider.js.map +1 -0
- package/lib/module/ui/theme/index.js +5 -0
- package/lib/module/ui/theme/index.js.map +1 -0
- package/lib/module/ui/theme/tokens.js +145 -0
- package/lib/module/ui/theme/tokens.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +139 -0
- package/lib/module/utils/EventEmitter.js.map +1 -0
- package/lib/module/utils/base64.js +47 -0
- package/lib/module/utils/base64.js.map +1 -0
- package/lib/module/utils/deviceFingerprint.js +129 -0
- package/lib/module/utils/deviceFingerprint.js.map +1 -0
- package/lib/module/utils/documentTypeOptions.js +31 -0
- package/lib/module/utils/documentTypeOptions.js.map +1 -0
- package/lib/module/utils/googleMapsPreflight.js +73 -0
- package/lib/module/utils/googleMapsPreflight.js.map +1 -0
- package/lib/module/utils/hmac.js +53 -0
- package/lib/module/utils/hmac.js.map +1 -0
- package/lib/module/utils/iso3166Countries.js +92 -0
- package/lib/module/utils/iso3166Countries.js.map +1 -0
- package/lib/module/utils/jpegFromUri.js +40 -0
- package/lib/module/utils/jpegFromUri.js.map +1 -0
- package/lib/module/utils/keepAwake.js +53 -0
- package/lib/module/utils/keepAwake.js.map +1 -0
- package/lib/module/utils/log.js +37 -0
- package/lib/module/utils/log.js.map +1 -0
- package/lib/module/utils/osGeocoder.js +65 -0
- package/lib/module/utils/osGeocoder.js.map +1 -0
- package/lib/module/utils/parseGoogleAddressComponents.js +69 -0
- package/lib/module/utils/parseGoogleAddressComponents.js.map +1 -0
- package/lib/module/utils/personNameNormalize.js +20 -0
- package/lib/module/utils/personNameNormalize.js.map +1 -0
- package/lib/module/utils/sdkError.js +29 -0
- package/lib/module/utils/sdkError.js.map +1 -0
- package/lib/module/utils/sdkVersion.js +9 -0
- package/lib/module/utils/sdkVersion.js.map +1 -0
- package/lib/module/utils/stepConfig.js +59 -0
- package/lib/module/utils/stepConfig.js.map +1 -0
- package/lib/module/utils/taxInfoConfig.js +15 -0
- package/lib/module/utils/taxInfoConfig.js.map +1 -0
- package/lib/typescript/camera/AddressSearchBar.d.ts +37 -0
- package/lib/typescript/camera/AddressSearchBar.d.ts.map +1 -0
- package/lib/typescript/camera/DocumentCapture.d.ts +34 -0
- package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -0
- package/lib/typescript/camera/LivenessCamera.d.ts +50 -0
- package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -0
- package/lib/typescript/camera/MapAddressPicker.d.ts +57 -0
- package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -0
- package/lib/typescript/core/VelionOnboarding.d.ts +115 -0
- package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
- package/lib/typescript/core/sessionDeclinedCopy.d.ts +16 -0
- package/lib/typescript/core/sessionDeclinedCopy.d.ts.map +1 -0
- package/lib/typescript/core/sessionStateMapper.d.ts +33 -0
- package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -0
- package/lib/typescript/core/sseReasonMessages.d.ts +20 -0
- package/lib/typescript/core/sseReasonMessages.d.ts.map +1 -0
- package/lib/typescript/i18n/index.d.ts +13 -0
- package/lib/typescript/i18n/index.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/en.d.ts +3 -0
- package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/es.d.ts +260 -0
- package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +26 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/steps/AddressInfoStep.d.ts +26 -0
- package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/DocumentsOcrStep.d.ts +26 -0
- package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -0
- package/lib/typescript/steps/EmailContactStep.d.ts +15 -0
- package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -0
- package/lib/typescript/steps/EmailOtpStep.d.ts +21 -0
- package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -0
- package/lib/typescript/steps/FaceMatchStep.d.ts +27 -0
- package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -0
- package/lib/typescript/steps/FingerprintStep.d.ts +25 -0
- package/lib/typescript/steps/FingerprintStep.d.ts.map +1 -0
- package/lib/typescript/steps/HumanBasicInfoStep.d.ts +25 -0
- package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/HumanExtendedInfoStep.d.ts +23 -0
- package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LegalBasicInfoStep.d.ts +17 -0
- package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LegalExtendedInfoStep.d.ts +17 -0
- package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LivenessMatchStep.d.ts +26 -0
- package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -0
- package/lib/typescript/steps/PhoneContactStep.d.ts +15 -0
- package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -0
- package/lib/typescript/steps/PhoneOtpStep.d.ts +19 -0
- package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -0
- package/lib/typescript/steps/SwornDeclarationStep.d.ts +20 -0
- package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -0
- package/lib/typescript/steps/TaxInfoStep.d.ts +19 -0
- package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/TermsAndConditionsStep.d.ts +21 -0
- package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -0
- package/lib/typescript/steps/_shared.d.ts +11 -0
- package/lib/typescript/steps/_shared.d.ts.map +1 -0
- package/lib/typescript/steps/types.d.ts +68 -0
- package/lib/typescript/steps/types.d.ts.map +1 -0
- package/lib/typescript/transport/api.d.ts +35 -0
- package/lib/typescript/transport/api.d.ts.map +1 -0
- package/lib/typescript/transport/irisWebSocket.d.ts +72 -0
- package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -0
- package/lib/typescript/transport/secureUrl.d.ts +14 -0
- package/lib/typescript/transport/secureUrl.d.ts.map +1 -0
- package/lib/typescript/transport/sse.d.ts +54 -0
- package/lib/typescript/transport/sse.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +1010 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/ui/MapFallbackBoundary.d.ts +28 -0
- package/lib/typescript/ui/MapFallbackBoundary.d.ts.map +1 -0
- package/lib/typescript/ui/StepShell.d.ts +19 -0
- package/lib/typescript/ui/StepShell.d.ts.map +1 -0
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts +19 -0
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -0
- package/lib/typescript/ui/forms/index.d.ts +3 -0
- package/lib/typescript/ui/forms/index.d.ts.map +1 -0
- package/lib/typescript/ui/forms/useInlineValidation.d.ts +30 -0
- package/lib/typescript/ui/forms/useInlineValidation.d.ts.map +1 -0
- package/lib/typescript/ui/forms/validators.d.ts +11 -0
- package/lib/typescript/ui/forms/validators.d.ts.map +1 -0
- package/lib/typescript/ui/icons/HomeHeartIcon.d.ts +14 -0
- package/lib/typescript/ui/icons/HomeHeartIcon.d.ts.map +1 -0
- package/lib/typescript/ui/icons/StepIcon.d.ts +26 -0
- package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts +24 -0
- package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/LoadingOverlay.d.ts +19 -0
- package/lib/typescript/ui/overlays/LoadingOverlay.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/ProgressBar.d.ts +26 -0
- package/lib/typescript/ui/overlays/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/RetryDialog.d.ts +17 -0
- package/lib/typescript/ui/overlays/RetryDialog.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/index.d.ts +4 -0
- package/lib/typescript/ui/overlays/index.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Banner.d.ts +11 -0
- package/lib/typescript/ui/primitives/Banner.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Button.d.ts +27 -0
- package/lib/typescript/ui/primitives/Button.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Card.d.ts +10 -0
- package/lib/typescript/ui/primitives/Card.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Checkbox.d.ts +25 -0
- package/lib/typescript/ui/primitives/Checkbox.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/CountrySelect.d.ts +31 -0
- package/lib/typescript/ui/primitives/CountrySelect.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/DatePicker.d.ts +42 -0
- package/lib/typescript/ui/primitives/DatePicker.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Input.d.ts +17 -0
- package/lib/typescript/ui/primitives/Input.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Select.d.ts +26 -0
- package/lib/typescript/ui/primitives/Select.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Spinner.d.ts +10 -0
- package/lib/typescript/ui/primitives/Spinner.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/index.d.ts +10 -0
- package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
- package/lib/typescript/ui/theme/ThemeProvider.d.ts +23 -0
- package/lib/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/ui/theme/index.d.ts +3 -0
- package/lib/typescript/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/ui/theme/tokens.d.ts +42 -0
- package/lib/typescript/ui/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/utils/EventEmitter.d.ts +98 -0
- package/lib/typescript/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/utils/base64.d.ts +19 -0
- package/lib/typescript/utils/base64.d.ts.map +1 -0
- package/lib/typescript/utils/deviceFingerprint.d.ts +42 -0
- package/lib/typescript/utils/deviceFingerprint.d.ts.map +1 -0
- package/lib/typescript/utils/documentTypeOptions.d.ts +13 -0
- package/lib/typescript/utils/documentTypeOptions.d.ts.map +1 -0
- package/lib/typescript/utils/googleMapsPreflight.d.ts +44 -0
- package/lib/typescript/utils/googleMapsPreflight.d.ts.map +1 -0
- package/lib/typescript/utils/hmac.d.ts +39 -0
- package/lib/typescript/utils/hmac.d.ts.map +1 -0
- package/lib/typescript/utils/iso3166Countries.d.ts +27 -0
- package/lib/typescript/utils/iso3166Countries.d.ts.map +1 -0
- package/lib/typescript/utils/jpegFromUri.d.ts +29 -0
- package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -0
- package/lib/typescript/utils/keepAwake.d.ts +16 -0
- package/lib/typescript/utils/keepAwake.d.ts.map +1 -0
- package/lib/typescript/utils/log.d.ts +18 -0
- package/lib/typescript/utils/log.d.ts.map +1 -0
- package/lib/typescript/utils/osGeocoder.d.ts +38 -0
- package/lib/typescript/utils/osGeocoder.d.ts.map +1 -0
- package/lib/typescript/utils/parseGoogleAddressComponents.d.ts +43 -0
- package/lib/typescript/utils/parseGoogleAddressComponents.d.ts.map +1 -0
- package/lib/typescript/utils/personNameNormalize.d.ts +10 -0
- package/lib/typescript/utils/personNameNormalize.d.ts.map +1 -0
- package/lib/typescript/utils/sdkError.d.ts +14 -0
- package/lib/typescript/utils/sdkError.d.ts.map +1 -0
- package/lib/typescript/utils/sdkVersion.d.ts +7 -0
- package/lib/typescript/utils/sdkVersion.d.ts.map +1 -0
- package/lib/typescript/utils/stepConfig.d.ts +8 -0
- package/lib/typescript/utils/stepConfig.d.ts.map +1 -0
- package/lib/typescript/utils/taxInfoConfig.d.ts +7 -0
- package/lib/typescript/utils/taxInfoConfig.d.ts.map +1 -0
- package/package.json +99 -0
- package/src/camera/AddressSearchBar.tsx +363 -0
- package/src/camera/DocumentCapture.tsx +505 -0
- package/src/camera/LivenessCamera.tsx +602 -0
- package/src/camera/MapAddressPicker.tsx +397 -0
- package/src/core/VelionOnboarding.ts +974 -0
- package/src/core/sessionDeclinedCopy.ts +76 -0
- package/src/core/sessionStateMapper.ts +167 -0
- package/src/core/sseReasonMessages.ts +531 -0
- package/src/data/iso3166Alpha2Codes.json +1 -0
- package/src/data/iso3166CountryNames.json +251 -0
- package/src/i18n/index.ts +26 -0
- package/src/i18n/strings/en.ts +289 -0
- package/src/i18n/strings/es.ts +291 -0
- package/src/index.ts +137 -0
- package/src/steps/AddressInfoStep.tsx +726 -0
- package/src/steps/DocumentsOcrStep.tsx +472 -0
- package/src/steps/EmailContactStep.tsx +159 -0
- package/src/steps/EmailOtpStep.tsx +250 -0
- package/src/steps/FaceMatchStep.tsx +177 -0
- package/src/steps/FingerprintStep.tsx +99 -0
- package/src/steps/HumanBasicInfoStep.tsx +274 -0
- package/src/steps/HumanExtendedInfoStep.tsx +353 -0
- package/src/steps/LegalBasicInfoStep.tsx +205 -0
- package/src/steps/LegalExtendedInfoStep.tsx +171 -0
- package/src/steps/LivenessMatchStep.tsx +846 -0
- package/src/steps/PhoneContactStep.tsx +160 -0
- package/src/steps/PhoneOtpStep.tsx +249 -0
- package/src/steps/SwornDeclarationStep.tsx +220 -0
- package/src/steps/TaxInfoStep.tsx +277 -0
- package/src/steps/TermsAndConditionsStep.tsx +261 -0
- package/src/steps/_shared.ts +44 -0
- package/src/steps/types.ts +72 -0
- package/src/transport/api.ts +257 -0
- package/src/transport/irisWebSocket.ts +186 -0
- package/src/transport/secureUrl.ts +47 -0
- package/src/transport/sse.ts +310 -0
- package/src/types/index.ts +1198 -0
- package/src/ui/MapFallbackBoundary.tsx +46 -0
- package/src/ui/StepShell.tsx +137 -0
- package/src/ui/VelionOnboardingScreen.tsx +223 -0
- package/src/ui/forms/index.ts +12 -0
- package/src/ui/forms/useInlineValidation.ts +115 -0
- package/src/ui/forms/validators.ts +29 -0
- package/src/ui/icons/HomeHeartIcon.tsx +34 -0
- package/src/ui/icons/StepIcon.tsx +77 -0
- package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
- package/src/ui/overlays/LoadingOverlay.tsx +115 -0
- package/src/ui/overlays/ProgressBar.tsx +99 -0
- package/src/ui/overlays/RetryDialog.tsx +128 -0
- package/src/ui/overlays/index.ts +3 -0
- package/src/ui/primitives/Banner.tsx +81 -0
- package/src/ui/primitives/Button.tsx +164 -0
- package/src/ui/primitives/Card.tsx +55 -0
- package/src/ui/primitives/Checkbox.tsx +153 -0
- package/src/ui/primitives/CountrySelect.tsx +356 -0
- package/src/ui/primitives/DatePicker.tsx +266 -0
- package/src/ui/primitives/Input.tsx +110 -0
- package/src/ui/primitives/Select.tsx +259 -0
- package/src/ui/primitives/Spinner.tsx +17 -0
- package/src/ui/primitives/index.ts +9 -0
- package/src/ui/theme/ThemeProvider.tsx +102 -0
- package/src/ui/theme/index.ts +17 -0
- package/src/ui/theme/tokens.ts +159 -0
- package/src/utils/EventEmitter.ts +155 -0
- package/src/utils/base64.ts +44 -0
- package/src/utils/deviceFingerprint.ts +184 -0
- package/src/utils/documentTypeOptions.ts +31 -0
- package/src/utils/googleMapsPreflight.ts +72 -0
- package/src/utils/hmac.ts +61 -0
- package/src/utils/iso3166Countries.ts +111 -0
- package/src/utils/jpegFromUri.ts +42 -0
- package/src/utils/keepAwake.ts +62 -0
- package/src/utils/log.ts +37 -0
- package/src/utils/osGeocoder.ts +75 -0
- package/src/utils/parseGoogleAddressComponents.ts +123 -0
- package/src/utils/personNameNormalize.ts +17 -0
- package/src/utils/sdkError.ts +40 -0
- package/src/utils/sdkVersion.ts +6 -0
- package/src/utils/stepConfig.ts +75 -0
- package/src/utils/taxInfoConfig.ts +14 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error boundary that catches render failures from `react-native-maps` and
|
|
3
|
+
* lets the parent fall back to the manual address form.
|
|
4
|
+
*
|
|
5
|
+
* Specifically the `AirGoogleMaps` runtime error (`AirGoogleMaps dir must be
|
|
6
|
+
* added to your xCode project to support GoogleMaps on iOS`) only surfaces
|
|
7
|
+
* when the MapView mounts. The preflight check cannot detect it because the
|
|
8
|
+
* native module exists — it's just missing its iOS sub-target.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Component, type ReactNode } from 'react';
|
|
12
|
+
import { log } from '../utils/log';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** Called once when the boundary catches an error from any descendant. */
|
|
17
|
+
onError: (error: Error) => void;
|
|
18
|
+
/** Rendered while the boundary is in the errored state, before the parent reacts. */
|
|
19
|
+
fallback?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface State {
|
|
23
|
+
hasError: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class MapFallbackBoundary extends Component<Props, State> {
|
|
27
|
+
state: State = { hasError: false };
|
|
28
|
+
|
|
29
|
+
static getDerivedStateFromError(): State {
|
|
30
|
+
return { hasError: true };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
componentDidCatch(error: Error): void {
|
|
34
|
+
log.warn('[MapFallbackBoundary] map render failed, switching to manual', {
|
|
35
|
+
message: error.message,
|
|
36
|
+
});
|
|
37
|
+
this.props.onError(error);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
if (this.state.hasError) {
|
|
42
|
+
return this.props.fallback ?? null;
|
|
43
|
+
}
|
|
44
|
+
return this.props.children;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Step shell — header + scrollable body.
|
|
3
|
+
*
|
|
4
|
+
* Rounded header icon, title, subtitle, then a centered column with the
|
|
5
|
+
* step's form. Used by every form-style step (HUMAN_BASIC_INFO, TAX_INFO, …)
|
|
6
|
+
* so they read as a single visual family.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ReactNode } from 'react';
|
|
10
|
+
import {
|
|
11
|
+
KeyboardAvoidingView,
|
|
12
|
+
Platform,
|
|
13
|
+
ScrollView,
|
|
14
|
+
StyleSheet,
|
|
15
|
+
Text,
|
|
16
|
+
View,
|
|
17
|
+
} from 'react-native';
|
|
18
|
+
import { useTheme, withAlpha } from './theme';
|
|
19
|
+
|
|
20
|
+
export interface StepShellProps {
|
|
21
|
+
title: string;
|
|
22
|
+
subtitle?: string | undefined;
|
|
23
|
+
/** Optional icon-bearing element (e.g. SVG). Falls back to a colored disc. */
|
|
24
|
+
iconNode?: ReactNode | undefined;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** When true, the body is wrapped in a `KeyboardAvoidingView` (form-friendly). */
|
|
27
|
+
avoidKeyboard?: boolean | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function StepShell({
|
|
31
|
+
title,
|
|
32
|
+
subtitle,
|
|
33
|
+
iconNode,
|
|
34
|
+
children,
|
|
35
|
+
avoidKeyboard = true,
|
|
36
|
+
}: StepShellProps) {
|
|
37
|
+
const theme = useTheme();
|
|
38
|
+
|
|
39
|
+
const showIconCircle = !theme.hideStepIcons && iconNode != null;
|
|
40
|
+
|
|
41
|
+
const body = (
|
|
42
|
+
<ScrollView
|
|
43
|
+
style={styles.scroll}
|
|
44
|
+
contentContainerStyle={styles.scrollBody}
|
|
45
|
+
keyboardShouldPersistTaps="handled"
|
|
46
|
+
>
|
|
47
|
+
<View style={styles.header}>
|
|
48
|
+
{showIconCircle ? (
|
|
49
|
+
<View
|
|
50
|
+
style={[
|
|
51
|
+
styles.iconCircle,
|
|
52
|
+
{
|
|
53
|
+
backgroundColor: theme.primaryColor,
|
|
54
|
+
shadowColor: withAlpha(theme.primaryColor, 0.5),
|
|
55
|
+
},
|
|
56
|
+
]}
|
|
57
|
+
accessibilityElementsHidden
|
|
58
|
+
importantForAccessibility="no"
|
|
59
|
+
>
|
|
60
|
+
{iconNode}
|
|
61
|
+
</View>
|
|
62
|
+
) : null}
|
|
63
|
+
<Text style={[styles.title, { color: theme.textColor }]}>{title}</Text>
|
|
64
|
+
{subtitle ? (
|
|
65
|
+
<Text
|
|
66
|
+
style={[styles.subtitle, { color: theme.textSecondaryColor }]}
|
|
67
|
+
>
|
|
68
|
+
{subtitle}
|
|
69
|
+
</Text>
|
|
70
|
+
) : null}
|
|
71
|
+
</View>
|
|
72
|
+
<View style={styles.column}>{children}</View>
|
|
73
|
+
</ScrollView>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
if (avoidKeyboard) {
|
|
77
|
+
return (
|
|
78
|
+
<KeyboardAvoidingView
|
|
79
|
+
style={styles.flex}
|
|
80
|
+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
81
|
+
>
|
|
82
|
+
{body}
|
|
83
|
+
</KeyboardAvoidingView>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return body;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const styles = StyleSheet.create({
|
|
90
|
+
flex: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
},
|
|
93
|
+
scroll: {
|
|
94
|
+
flex: 1,
|
|
95
|
+
},
|
|
96
|
+
scrollBody: {
|
|
97
|
+
paddingHorizontal: 18,
|
|
98
|
+
paddingTop: 12,
|
|
99
|
+
paddingBottom: 28,
|
|
100
|
+
},
|
|
101
|
+
header: {
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
marginBottom: 14,
|
|
104
|
+
},
|
|
105
|
+
iconCircle: {
|
|
106
|
+
width: 56,
|
|
107
|
+
height: 56,
|
|
108
|
+
borderRadius: 28,
|
|
109
|
+
marginBottom: 10,
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
shadowOpacity: 0.25,
|
|
113
|
+
shadowRadius: 8,
|
|
114
|
+
shadowOffset: { width: 0, height: 3 },
|
|
115
|
+
elevation: 3,
|
|
116
|
+
},
|
|
117
|
+
title: {
|
|
118
|
+
fontSize: 20,
|
|
119
|
+
fontWeight: '700',
|
|
120
|
+
letterSpacing: -0.3,
|
|
121
|
+
textAlign: 'center',
|
|
122
|
+
},
|
|
123
|
+
subtitle: {
|
|
124
|
+
marginTop: 6,
|
|
125
|
+
fontSize: 14,
|
|
126
|
+
fontWeight: '400',
|
|
127
|
+
textAlign: 'center',
|
|
128
|
+
lineHeight: 20,
|
|
129
|
+
maxWidth: 320,
|
|
130
|
+
},
|
|
131
|
+
column: {
|
|
132
|
+
width: '100%',
|
|
133
|
+
maxWidth: 360,
|
|
134
|
+
alignSelf: 'center',
|
|
135
|
+
gap: 10,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Top-level React component the host app mounts.
|
|
3
|
+
*
|
|
4
|
+
* Owns the `VelionOnboarding` instance lifecycle, mounts the `ThemeProvider`,
|
|
5
|
+
* and renders the orchestrator's view bridge: a sticky `ProgressBar`, the
|
|
6
|
+
* active step's React node, and (when a step is between transitions or the
|
|
7
|
+
* flow finishes) a themed `LoadingOverlay` / final-result message.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React, {
|
|
11
|
+
useCallback,
|
|
12
|
+
useEffect,
|
|
13
|
+
useMemo,
|
|
14
|
+
useRef,
|
|
15
|
+
useState,
|
|
16
|
+
type ReactNode,
|
|
17
|
+
} from 'react';
|
|
18
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
19
|
+
import { VelionOnboarding, type VelionConfig } from '../core/VelionOnboarding';
|
|
20
|
+
import type { OnboardingResult, OnboardingStep, SdkError } from '../types';
|
|
21
|
+
import { ThemeProvider, useTheme } from './theme';
|
|
22
|
+
import { LoadingOverlay } from './overlays/LoadingOverlay';
|
|
23
|
+
import { PROGRESS_BAR, ProgressBar } from './overlays/ProgressBar';
|
|
24
|
+
import { getStrings } from '../i18n';
|
|
25
|
+
import {
|
|
26
|
+
activateScreenKeepAwake,
|
|
27
|
+
deactivateScreenKeepAwake,
|
|
28
|
+
} from '../utils/keepAwake';
|
|
29
|
+
|
|
30
|
+
export interface VelionOnboardingScreenProps {
|
|
31
|
+
config: VelionConfig;
|
|
32
|
+
onComplete?: ((result: OnboardingResult) => void) | undefined;
|
|
33
|
+
onFail?: ((err: SdkError) => void) | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface ViewState {
|
|
37
|
+
loading: string | null;
|
|
38
|
+
stepNode: ReactNode | null;
|
|
39
|
+
error: SdkError | null;
|
|
40
|
+
result: OnboardingResult | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const INITIAL_STATE: ViewState = {
|
|
44
|
+
loading: null,
|
|
45
|
+
stepNode: null,
|
|
46
|
+
error: null,
|
|
47
|
+
result: null,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export function VelionOnboardingScreen({
|
|
51
|
+
config,
|
|
52
|
+
onComplete,
|
|
53
|
+
onFail,
|
|
54
|
+
}: VelionOnboardingScreenProps) {
|
|
55
|
+
return (
|
|
56
|
+
<ThemeProvider
|
|
57
|
+
themeOverrides={config.theme}
|
|
58
|
+
colorMode={config.colorMode ?? 'auto'}
|
|
59
|
+
>
|
|
60
|
+
<VelionOnboardingInner
|
|
61
|
+
config={config}
|
|
62
|
+
onComplete={onComplete}
|
|
63
|
+
onFail={onFail}
|
|
64
|
+
/>
|
|
65
|
+
</ThemeProvider>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function VelionOnboardingInner({
|
|
70
|
+
config,
|
|
71
|
+
onComplete,
|
|
72
|
+
onFail,
|
|
73
|
+
}: VelionOnboardingScreenProps) {
|
|
74
|
+
const theme = useTheme();
|
|
75
|
+
const t = getStrings(config.locale);
|
|
76
|
+
const [state, setState] = useState<ViewState>(INITIAL_STATE);
|
|
77
|
+
const [progress, setProgress] = useState(0);
|
|
78
|
+
const [progressHidden, setProgressHidden] = useState(false);
|
|
79
|
+
|
|
80
|
+
const sdk = useMemo(
|
|
81
|
+
() => new VelionOnboarding(config),
|
|
82
|
+
// Recreate the SDK only when the session changes — host must keep
|
|
83
|
+
// callbacks stable (or wrap them in refs).
|
|
84
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
|
+
[config.sessionId, config.apiUrl],
|
|
86
|
+
);
|
|
87
|
+
const sdkRef = useRef(sdk);
|
|
88
|
+
sdkRef.current = sdk;
|
|
89
|
+
|
|
90
|
+
const onCompleteRef = useRef(onComplete);
|
|
91
|
+
const onFailRef = useRef(onFail);
|
|
92
|
+
onCompleteRef.current = onComplete;
|
|
93
|
+
onFailRef.current = onFail;
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
// Hold a wake lock for the full duration of the flow. Camera-heavy steps
|
|
97
|
+
// (LIVENESS_MATCH, DOCUMENTS_OCR) involve the user holding still, so the
|
|
98
|
+
// OS screen-timeout would otherwise dim and lock the device mid-session.
|
|
99
|
+
activateScreenKeepAwake();
|
|
100
|
+
|
|
101
|
+
sdk.attachView({
|
|
102
|
+
setLoading: (text) => setState((s) => ({ ...s, loading: text })),
|
|
103
|
+
setStepNode: (node) => setState((s) => ({ ...s, stepNode: node })),
|
|
104
|
+
setError: (err) => {
|
|
105
|
+
setState((s) => ({ ...s, error: err, loading: null, stepNode: null }));
|
|
106
|
+
setProgressHidden(true);
|
|
107
|
+
onFailRef.current?.(err);
|
|
108
|
+
},
|
|
109
|
+
setResult: (result) => {
|
|
110
|
+
setState((s) => ({ ...s, result, loading: null, stepNode: null }));
|
|
111
|
+
setProgress(PROGRESS_BAR.complete());
|
|
112
|
+
// Fade after a small delay so the "100%" jump is visible.
|
|
113
|
+
setTimeout(() => setProgressHidden(true), 400);
|
|
114
|
+
onCompleteRef.current?.(result);
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const unsubStepChange = sdk.on('step:change', () => {
|
|
119
|
+
setProgress((curr) => PROGRESS_BAR.tick(curr));
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
void sdk.start();
|
|
123
|
+
|
|
124
|
+
return () => {
|
|
125
|
+
unsubStepChange();
|
|
126
|
+
sdk.detachView();
|
|
127
|
+
sdk.destroy();
|
|
128
|
+
deactivateScreenKeepAwake();
|
|
129
|
+
};
|
|
130
|
+
}, [sdk]);
|
|
131
|
+
|
|
132
|
+
const renderBody = useCallback((): ReactNode => {
|
|
133
|
+
if (state.error) {
|
|
134
|
+
return (
|
|
135
|
+
<View style={styles.message}>
|
|
136
|
+
<Text style={[styles.title, { color: theme.errorColor }]}>
|
|
137
|
+
{state.error.declineTitle ?? t.result.declineHeadline}
|
|
138
|
+
</Text>
|
|
139
|
+
<Text style={[styles.body, { color: theme.textColor }]}>
|
|
140
|
+
{state.error.declineMessage ?? state.error.message}
|
|
141
|
+
</Text>
|
|
142
|
+
</View>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
if (state.result) {
|
|
146
|
+
const status = state.result.status;
|
|
147
|
+
let title = t.result.approvedTitle;
|
|
148
|
+
let body = t.result.approvedBody;
|
|
149
|
+
if (status === 'MANUAL_REVIEW') {
|
|
150
|
+
title = t.result.manualReviewTitle;
|
|
151
|
+
body = t.result.manualReviewBody;
|
|
152
|
+
} else if (status === 'REJECTED' || status === 'DECLINED') {
|
|
153
|
+
title = t.result.rejectedTitle;
|
|
154
|
+
body = t.result.rejectedBody;
|
|
155
|
+
}
|
|
156
|
+
return (
|
|
157
|
+
<View style={styles.message}>
|
|
158
|
+
<Text style={[styles.title, { color: theme.textColor }]}>{title}</Text>
|
|
159
|
+
<Text style={[styles.body, { color: theme.textSecondaryColor }]}>
|
|
160
|
+
{body}
|
|
161
|
+
</Text>
|
|
162
|
+
</View>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
if (state.stepNode) {
|
|
166
|
+
return state.stepNode;
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}, [state, theme, t]);
|
|
170
|
+
|
|
171
|
+
const showLoadingOverlay =
|
|
172
|
+
!state.error && !state.result && !state.stepNode;
|
|
173
|
+
const loadingText = state.loading ?? t.common.loading;
|
|
174
|
+
// Progress bar is shown unless EITHER `config.showProgressBar === false`
|
|
175
|
+
// OR `theme.hideProgressBar === true`. Both paths exist for parity with
|
|
176
|
+
// `hideStepIcons` (theme-side) and for hosts that already wire the
|
|
177
|
+
// legacy `showProgressBar` flag (config-side).
|
|
178
|
+
const showProgress =
|
|
179
|
+
config.showProgressBar !== false && !theme.hideProgressBar;
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<View style={[styles.root, { backgroundColor: theme.backgroundColor }]}>
|
|
183
|
+
{showProgress ? (
|
|
184
|
+
<ProgressBar value={progress} hidden={progressHidden} />
|
|
185
|
+
) : null}
|
|
186
|
+
<View style={styles.content}>{renderBody()}</View>
|
|
187
|
+
{showLoadingOverlay ? <LoadingOverlay message={loadingText} /> : null}
|
|
188
|
+
</View>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const styles = StyleSheet.create({
|
|
193
|
+
root: {
|
|
194
|
+
flex: 1,
|
|
195
|
+
},
|
|
196
|
+
content: {
|
|
197
|
+
flex: 1,
|
|
198
|
+
overflow: 'hidden',
|
|
199
|
+
},
|
|
200
|
+
message: {
|
|
201
|
+
flex: 1,
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
justifyContent: 'center',
|
|
204
|
+
paddingHorizontal: 24,
|
|
205
|
+
gap: 12,
|
|
206
|
+
},
|
|
207
|
+
title: {
|
|
208
|
+
fontSize: 20,
|
|
209
|
+
fontWeight: '600',
|
|
210
|
+
textAlign: 'center',
|
|
211
|
+
},
|
|
212
|
+
body: {
|
|
213
|
+
fontSize: 15,
|
|
214
|
+
lineHeight: 22,
|
|
215
|
+
textAlign: 'center',
|
|
216
|
+
maxWidth: 360,
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Type tag used so consumers can identify the step that triggered an event.
|
|
221
|
+
// Currently unused but kept here so future adapters (e.g. analytics wrappers)
|
|
222
|
+
// can hook into orchestrator events without re-exporting types.
|
|
223
|
+
export type { OnboardingStep };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Inline form validation hook.
|
|
3
|
+
*
|
|
4
|
+
* Implements the on-blur validation heuristic from Material Design's
|
|
5
|
+
* `inline-validation` guidelines — error appears on blur (not keystroke),
|
|
6
|
+
* clears optimistically when the user resumes typing, and re-evaluates on
|
|
7
|
+
* the next blur. The form's submit handler can call `validateAll()` to gate.
|
|
8
|
+
*
|
|
9
|
+
* Returns plain handlers + an errors map that step modules feed into
|
|
10
|
+
* `<Input errorMessage={…} />` props.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
14
|
+
import type { FieldValidator } from './validators';
|
|
15
|
+
|
|
16
|
+
export interface FieldRule<TFieldName extends string> {
|
|
17
|
+
name: TFieldName;
|
|
18
|
+
validate: FieldValidator;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface InlineValidationHandle<TFieldName extends string> {
|
|
22
|
+
errors: Partial<Record<TFieldName, string>>;
|
|
23
|
+
/** Bind these props to your `<Input>` to wire validation. */
|
|
24
|
+
bind: (
|
|
25
|
+
name: TFieldName,
|
|
26
|
+
value: string,
|
|
27
|
+
) => {
|
|
28
|
+
onBlur: () => void;
|
|
29
|
+
onChangeText: (text: string) => void;
|
|
30
|
+
errorMessage: string | null;
|
|
31
|
+
};
|
|
32
|
+
validateAll: (values: Record<TFieldName, string>) => boolean;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
setFieldError: (name: TFieldName, message: string | null) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function useInlineValidation<TFieldName extends string>(
|
|
38
|
+
rules: ReadonlyArray<FieldRule<TFieldName>>,
|
|
39
|
+
onChange?: (name: TFieldName, value: string) => void,
|
|
40
|
+
): InlineValidationHandle<TFieldName> {
|
|
41
|
+
const [errors, setErrors] = useState<Partial<Record<TFieldName, string>>>({});
|
|
42
|
+
const rulesRef = useRef(rules);
|
|
43
|
+
rulesRef.current = rules;
|
|
44
|
+
|
|
45
|
+
const validateOne = useCallback(
|
|
46
|
+
(name: TFieldName, value: string): string | null => {
|
|
47
|
+
const rule = rulesRef.current.find((r) => r.name === name);
|
|
48
|
+
if (!rule) return null;
|
|
49
|
+
return rule.validate(value);
|
|
50
|
+
},
|
|
51
|
+
[],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const setFieldError = useCallback(
|
|
55
|
+
(name: TFieldName, message: string | null) => {
|
|
56
|
+
setErrors((prev) => {
|
|
57
|
+
if (message) {
|
|
58
|
+
if (prev[name] === message) return prev;
|
|
59
|
+
return { ...prev, [name]: message };
|
|
60
|
+
}
|
|
61
|
+
if (!(name in prev)) return prev;
|
|
62
|
+
const next = { ...prev };
|
|
63
|
+
delete next[name];
|
|
64
|
+
return next;
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
[],
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const bind = useCallback(
|
|
71
|
+
(name: TFieldName, value: string) => ({
|
|
72
|
+
onBlur: () => {
|
|
73
|
+
const message = validateOne(name, value);
|
|
74
|
+
setFieldError(name, message);
|
|
75
|
+
},
|
|
76
|
+
onChangeText: (text: string) => {
|
|
77
|
+
onChange?.(name, text);
|
|
78
|
+
// Optimistic clear while editing — equivalent to the input listener
|
|
79
|
+
// in the web inlineValidation helper.
|
|
80
|
+
setErrors((prev) => {
|
|
81
|
+
if (!(name in prev)) return prev;
|
|
82
|
+
const next = { ...prev };
|
|
83
|
+
delete next[name];
|
|
84
|
+
return next;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
errorMessage: errors[name] ?? null,
|
|
88
|
+
}),
|
|
89
|
+
[errors, onChange, setFieldError, validateOne],
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const validateAll = useCallback(
|
|
93
|
+
(values: Record<TFieldName, string>): boolean => {
|
|
94
|
+
const next: Partial<Record<TFieldName, string>> = {};
|
|
95
|
+
let allOk = true;
|
|
96
|
+
for (const rule of rulesRef.current) {
|
|
97
|
+
const message = rule.validate(values[rule.name] ?? '');
|
|
98
|
+
if (message) {
|
|
99
|
+
next[rule.name] = message;
|
|
100
|
+
allOk = false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
setErrors(next);
|
|
104
|
+
return allOk;
|
|
105
|
+
},
|
|
106
|
+
[],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const reset = useCallback(() => setErrors({}), []);
|
|
110
|
+
|
|
111
|
+
return useMemo(
|
|
112
|
+
() => ({ errors, bind, validateAll, reset, setFieldError }),
|
|
113
|
+
[errors, bind, validateAll, reset, setFieldError],
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable field validators. Each validator returns either an error message or
|
|
3
|
+
* `null` when valid — same contract as `InlineFieldRule.validate` in the web
|
|
4
|
+
* SDK so step authors can move logic between platforms with minimal churn.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type FieldValidator = (value: string) => string | null;
|
|
8
|
+
|
|
9
|
+
export function required(message: string): FieldValidator {
|
|
10
|
+
return (value) => (value.trim().length > 0 ? null : message);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function minLength(min: number, message: string): FieldValidator {
|
|
14
|
+
return (value) => (value.trim().length >= min ? null : message);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function pattern(regex: RegExp, message: string): FieldValidator {
|
|
18
|
+
return (value) => (regex.test(value) ? null : message);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function compose(...validators: FieldValidator[]): FieldValidator {
|
|
22
|
+
return (value) => {
|
|
23
|
+
for (const v of validators) {
|
|
24
|
+
const msg = v(value);
|
|
25
|
+
if (msg) return msg;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom "home with heart" step icon for the ADDRESS_INFO step.
|
|
3
|
+
*
|
|
4
|
+
* Drawn inline with react-native-svg (already in deps for the liveness oval)
|
|
5
|
+
* so we don't depend on MaterialIcons having an exact match — none of the
|
|
6
|
+
* Material set bundles a house with a heart inside.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Svg, { Path } from 'react-native-svg';
|
|
10
|
+
|
|
11
|
+
interface HomeHeartIconProps {
|
|
12
|
+
size?: number;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function HomeHeartIcon({ size = 28, color = '#FFFFFF' }: HomeHeartIconProps) {
|
|
17
|
+
return (
|
|
18
|
+
<Svg width={size} height={size} viewBox="0 0 24 24">
|
|
19
|
+
{/* House silhouette (outline) */}
|
|
20
|
+
<Path
|
|
21
|
+
d="M3 11.5 L12 3.5 L21 11.5 L21 20.5 A1.5 1.5 0 0 1 19.5 22 L4.5 22 A1.5 1.5 0 0 1 3 20.5 Z"
|
|
22
|
+
fill="none"
|
|
23
|
+
stroke={color}
|
|
24
|
+
strokeWidth={1.7}
|
|
25
|
+
strokeLinejoin="round"
|
|
26
|
+
/>
|
|
27
|
+
{/* Heart inside */}
|
|
28
|
+
<Path
|
|
29
|
+
d="M12 18.2 C 9.4 16.3 7.7 14.7 7.7 13.0 C 7.7 11.7 8.7 10.7 9.9 10.7 C 10.7 10.7 11.5 11.1 12 11.8 C 12.5 11.1 13.3 10.7 14.1 10.7 C 15.3 10.7 16.3 11.7 16.3 13.0 C 16.3 14.7 14.6 16.3 12 18.2 Z"
|
|
30
|
+
fill={color}
|
|
31
|
+
/>
|
|
32
|
+
</Svg>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview StepIcon — small wrapper around `MaterialIcons` (shipped with
|
|
3
|
+
* `@expo/vector-icons`, which Expo SDK 54 includes by default).
|
|
4
|
+
*
|
|
5
|
+
* Steps pass an icon by name (e.g. `<StepIcon name="badge" />`) and the
|
|
6
|
+
* shell renders it inside the colored circle next to the title. When the
|
|
7
|
+
* library can't be loaded (bare-RN host without `@expo/vector-icons`
|
|
8
|
+
* installed) we fall back silently to `null` so the circle is empty rather
|
|
9
|
+
* than crashing — the host can switch off the circle altogether via
|
|
10
|
+
* `VelionTheme.hideStepIcons`.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { ReactElement } from 'react';
|
|
14
|
+
import { Text } from 'react-native';
|
|
15
|
+
import { log } from '../../utils/log';
|
|
16
|
+
|
|
17
|
+
export type MaterialIconName =
|
|
18
|
+
| 'badge'
|
|
19
|
+
| 'business'
|
|
20
|
+
| 'business-center'
|
|
21
|
+
| 'gavel'
|
|
22
|
+
| 'description'
|
|
23
|
+
| 'receipt-long'
|
|
24
|
+
| 'person'
|
|
25
|
+
| 'home'
|
|
26
|
+
| 'mail-outline'
|
|
27
|
+
| 'phone-iphone'
|
|
28
|
+
| 'face'
|
|
29
|
+
| 'photo-camera'
|
|
30
|
+
| 'fingerprint';
|
|
31
|
+
|
|
32
|
+
let MaterialIcons:
|
|
33
|
+
| (new () => unknown)
|
|
34
|
+
| ((props: {
|
|
35
|
+
name: string;
|
|
36
|
+
size?: number;
|
|
37
|
+
color?: string;
|
|
38
|
+
}) => unknown)
|
|
39
|
+
| null = null;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
43
|
+
const mod = require('@expo/vector-icons');
|
|
44
|
+
MaterialIcons = mod.MaterialIcons ?? null;
|
|
45
|
+
} catch {
|
|
46
|
+
log.warn(
|
|
47
|
+
'[StepIcon] @expo/vector-icons is not installed — step header icons will be hidden. ' +
|
|
48
|
+
'Either install it (Expo SDK 54+ ships it by default) or set VelionTheme.hideStepIcons=true.',
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface StepIconProps {
|
|
53
|
+
name: MaterialIconName;
|
|
54
|
+
/** Defaults to 28 px to match the circle the shell renders. */
|
|
55
|
+
size?: number;
|
|
56
|
+
/** Defaults to white (the circle is filled with `primaryColor`). */
|
|
57
|
+
color?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Renders a Material icon centered inside the step's title circle. Returns
|
|
62
|
+
* `null` when `@expo/vector-icons` is unavailable so the SDK still mounts
|
|
63
|
+
* gracefully on hosts without it.
|
|
64
|
+
*/
|
|
65
|
+
export function StepIcon({ name, size = 28, color = '#FFFFFF' }: StepIconProps) {
|
|
66
|
+
if (!MaterialIcons) {
|
|
67
|
+
// Plain text fallback — keeps the circle from being blank when the
|
|
68
|
+
// library is missing. Picks a neutral character; not localized.
|
|
69
|
+
return <Text style={{ color, fontSize: size, fontWeight: '700' }}>•</Text>;
|
|
70
|
+
}
|
|
71
|
+
const Icon = MaterialIcons as unknown as (props: {
|
|
72
|
+
name: string;
|
|
73
|
+
size: number;
|
|
74
|
+
color: string;
|
|
75
|
+
}) => ReactElement;
|
|
76
|
+
return <Icon name={name} size={size} color={color} />;
|
|
77
|
+
}
|