@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,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Themed text input with optional inline error message.
|
|
3
|
+
*
|
|
4
|
+
* Matches `.vl-hbi__input` semantics:
|
|
5
|
+
* - 44 px min height tap target.
|
|
6
|
+
* - Border switches to `errorColor` and a subtle ring when `errorMessage` is set.
|
|
7
|
+
* - Pairs an externally controlled label rendered above (see `<Field>` helper).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { forwardRef, useId } from 'react';
|
|
11
|
+
import {
|
|
12
|
+
StyleSheet,
|
|
13
|
+
Text,
|
|
14
|
+
TextInput,
|
|
15
|
+
View,
|
|
16
|
+
type StyleProp,
|
|
17
|
+
type TextInputProps,
|
|
18
|
+
type ViewStyle,
|
|
19
|
+
} from 'react-native';
|
|
20
|
+
import { useTheme } from '../theme';
|
|
21
|
+
|
|
22
|
+
export interface InputProps extends Omit<TextInputProps, 'style'> {
|
|
23
|
+
label?: string;
|
|
24
|
+
errorMessage?: string | null;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Input = forwardRef<TextInput, InputProps>(function Input(
|
|
30
|
+
{ label, errorMessage, required, containerStyle, ...rest },
|
|
31
|
+
ref,
|
|
32
|
+
) {
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const errorId = useId();
|
|
35
|
+
const hasError = Boolean(errorMessage && errorMessage.length > 0);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<View style={[styles.wrap, containerStyle]}>
|
|
39
|
+
{label ? (
|
|
40
|
+
<Text style={[styles.label, { color: theme.textColor }]}>
|
|
41
|
+
{label}
|
|
42
|
+
{required ? (
|
|
43
|
+
<Text style={[styles.required, { color: theme.textSecondaryColor }]}>
|
|
44
|
+
{' '}*
|
|
45
|
+
</Text>
|
|
46
|
+
) : null}
|
|
47
|
+
</Text>
|
|
48
|
+
) : null}
|
|
49
|
+
<TextInput
|
|
50
|
+
ref={ref}
|
|
51
|
+
accessibilityLabel={rest.accessibilityLabel ?? label}
|
|
52
|
+
accessibilityState={{ disabled: rest.editable === false }}
|
|
53
|
+
accessibilityHint={hasError ? errorMessage ?? undefined : undefined}
|
|
54
|
+
placeholderTextColor={theme.textSecondaryColor}
|
|
55
|
+
{...rest}
|
|
56
|
+
style={[
|
|
57
|
+
styles.input,
|
|
58
|
+
{
|
|
59
|
+
color: theme.textColor,
|
|
60
|
+
backgroundColor: theme.backgroundColor,
|
|
61
|
+
borderRadius: theme.borderRadiusPx,
|
|
62
|
+
borderColor: hasError ? theme.errorColor : theme.borderColor,
|
|
63
|
+
},
|
|
64
|
+
hasError && {
|
|
65
|
+
shadowColor: theme.errorColor,
|
|
66
|
+
shadowOpacity: 0.18,
|
|
67
|
+
shadowRadius: 6,
|
|
68
|
+
shadowOffset: { width: 0, height: 0 },
|
|
69
|
+
},
|
|
70
|
+
]}
|
|
71
|
+
/>
|
|
72
|
+
{hasError ? (
|
|
73
|
+
<Text
|
|
74
|
+
nativeID={errorId}
|
|
75
|
+
accessibilityLiveRegion="polite"
|
|
76
|
+
style={[styles.error, { color: theme.errorColor }]}
|
|
77
|
+
>
|
|
78
|
+
{errorMessage}
|
|
79
|
+
</Text>
|
|
80
|
+
) : null}
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const styles = StyleSheet.create({
|
|
86
|
+
wrap: {
|
|
87
|
+
width: '100%',
|
|
88
|
+
marginBottom: 4,
|
|
89
|
+
},
|
|
90
|
+
label: {
|
|
91
|
+
fontSize: 14,
|
|
92
|
+
fontWeight: '500',
|
|
93
|
+
marginBottom: 4,
|
|
94
|
+
},
|
|
95
|
+
required: {
|
|
96
|
+
fontWeight: '400',
|
|
97
|
+
},
|
|
98
|
+
input: {
|
|
99
|
+
minHeight: 44,
|
|
100
|
+
paddingHorizontal: 12,
|
|
101
|
+
paddingVertical: 10,
|
|
102
|
+
fontSize: 15,
|
|
103
|
+
borderWidth: 1,
|
|
104
|
+
},
|
|
105
|
+
error: {
|
|
106
|
+
fontSize: 13,
|
|
107
|
+
marginTop: 4,
|
|
108
|
+
lineHeight: 18,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight select — uses a modal-anchored option list. Matches the rhythm
|
|
3
|
+
* of `<Input>` (label, 44 px tap target, error styling) so step forms can mix
|
|
4
|
+
* the two primitives interchangeably.
|
|
5
|
+
*
|
|
6
|
+
* Intentionally simple: no search, no virtualisation. For searchable country
|
|
7
|
+
* pickers use `CountrySelect`.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useId, useMemo, useState } from 'react';
|
|
11
|
+
import {
|
|
12
|
+
Modal,
|
|
13
|
+
Pressable,
|
|
14
|
+
ScrollView,
|
|
15
|
+
StyleSheet,
|
|
16
|
+
Text,
|
|
17
|
+
View,
|
|
18
|
+
type StyleProp,
|
|
19
|
+
type ViewStyle,
|
|
20
|
+
} from 'react-native';
|
|
21
|
+
import { useTheme, withAlpha } from '../theme';
|
|
22
|
+
|
|
23
|
+
export interface SelectOption {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface SelectProps {
|
|
29
|
+
label?: string;
|
|
30
|
+
options: SelectOption[];
|
|
31
|
+
value: string | null;
|
|
32
|
+
onChange: (value: string) => void;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
errorMessage?: string | null;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function Select({
|
|
41
|
+
label,
|
|
42
|
+
options,
|
|
43
|
+
value,
|
|
44
|
+
onChange,
|
|
45
|
+
placeholder,
|
|
46
|
+
errorMessage,
|
|
47
|
+
required,
|
|
48
|
+
disabled = false,
|
|
49
|
+
containerStyle,
|
|
50
|
+
}: SelectProps) {
|
|
51
|
+
const theme = useTheme();
|
|
52
|
+
const errorId = useId();
|
|
53
|
+
const [open, setOpen] = useState(false);
|
|
54
|
+
const hasError = Boolean(errorMessage && errorMessage.length > 0);
|
|
55
|
+
|
|
56
|
+
const selected = useMemo(
|
|
57
|
+
() => options.find((o) => o.value === value) ?? null,
|
|
58
|
+
[options, value],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<View style={[styles.wrap, containerStyle]}>
|
|
63
|
+
{label ? (
|
|
64
|
+
<Text style={[styles.label, { color: theme.textColor }]}>
|
|
65
|
+
{label}
|
|
66
|
+
{required ? (
|
|
67
|
+
<Text style={[styles.required, { color: theme.textSecondaryColor }]}>
|
|
68
|
+
{' '}*
|
|
69
|
+
</Text>
|
|
70
|
+
) : null}
|
|
71
|
+
</Text>
|
|
72
|
+
) : null}
|
|
73
|
+
<Pressable
|
|
74
|
+
accessibilityRole="combobox"
|
|
75
|
+
accessibilityState={{ disabled, expanded: open }}
|
|
76
|
+
accessibilityLabel={label}
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
onPress={() => setOpen(true)}
|
|
79
|
+
style={[
|
|
80
|
+
styles.trigger,
|
|
81
|
+
{
|
|
82
|
+
backgroundColor: theme.backgroundColor,
|
|
83
|
+
borderColor: hasError ? theme.errorColor : theme.borderColor,
|
|
84
|
+
borderRadius: theme.borderRadiusPx,
|
|
85
|
+
},
|
|
86
|
+
disabled && styles.disabled,
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<Text
|
|
90
|
+
numberOfLines={1}
|
|
91
|
+
style={[
|
|
92
|
+
styles.triggerText,
|
|
93
|
+
{
|
|
94
|
+
color: selected ? theme.textColor : theme.textSecondaryColor,
|
|
95
|
+
},
|
|
96
|
+
]}
|
|
97
|
+
>
|
|
98
|
+
{selected?.label ?? placeholder ?? ''}
|
|
99
|
+
</Text>
|
|
100
|
+
<Text style={[styles.chevron, { color: theme.textSecondaryColor }]}>
|
|
101
|
+
▾
|
|
102
|
+
</Text>
|
|
103
|
+
</Pressable>
|
|
104
|
+
|
|
105
|
+
{hasError ? (
|
|
106
|
+
<Text
|
|
107
|
+
nativeID={errorId}
|
|
108
|
+
accessibilityLiveRegion="polite"
|
|
109
|
+
style={[styles.error, { color: theme.errorColor }]}
|
|
110
|
+
>
|
|
111
|
+
{errorMessage}
|
|
112
|
+
</Text>
|
|
113
|
+
) : null}
|
|
114
|
+
|
|
115
|
+
<Modal
|
|
116
|
+
visible={open}
|
|
117
|
+
transparent
|
|
118
|
+
animationType="fade"
|
|
119
|
+
onRequestClose={() => setOpen(false)}
|
|
120
|
+
>
|
|
121
|
+
<Pressable
|
|
122
|
+
style={styles.backdrop}
|
|
123
|
+
onPress={() => setOpen(false)}
|
|
124
|
+
accessibilityLabel="Close"
|
|
125
|
+
>
|
|
126
|
+
<Pressable
|
|
127
|
+
style={[
|
|
128
|
+
styles.sheet,
|
|
129
|
+
{
|
|
130
|
+
backgroundColor: theme.backgroundColor,
|
|
131
|
+
borderRadius: theme.borderRadiusPx,
|
|
132
|
+
borderColor: theme.borderColor,
|
|
133
|
+
},
|
|
134
|
+
]}
|
|
135
|
+
onPress={() => undefined}
|
|
136
|
+
>
|
|
137
|
+
{label ? (
|
|
138
|
+
<Text style={[styles.sheetTitle, { color: theme.textColor }]}>
|
|
139
|
+
{label}
|
|
140
|
+
</Text>
|
|
141
|
+
) : null}
|
|
142
|
+
<ScrollView style={styles.sheetList}>
|
|
143
|
+
{options.map((opt) => {
|
|
144
|
+
const isSelected = opt.value === value;
|
|
145
|
+
return (
|
|
146
|
+
<Pressable
|
|
147
|
+
key={opt.value}
|
|
148
|
+
accessibilityRole="menuitem"
|
|
149
|
+
accessibilityState={{ selected: isSelected }}
|
|
150
|
+
onPress={() => {
|
|
151
|
+
onChange(opt.value);
|
|
152
|
+
setOpen(false);
|
|
153
|
+
}}
|
|
154
|
+
style={({ pressed }) => [
|
|
155
|
+
styles.option,
|
|
156
|
+
isSelected && {
|
|
157
|
+
backgroundColor: withAlpha(theme.primaryColor, 0.12),
|
|
158
|
+
},
|
|
159
|
+
pressed && {
|
|
160
|
+
backgroundColor: withAlpha(theme.primaryColor, 0.18),
|
|
161
|
+
},
|
|
162
|
+
]}
|
|
163
|
+
>
|
|
164
|
+
<Text
|
|
165
|
+
style={[
|
|
166
|
+
styles.optionText,
|
|
167
|
+
{
|
|
168
|
+
color: isSelected
|
|
169
|
+
? theme.primaryColor
|
|
170
|
+
: theme.textColor,
|
|
171
|
+
fontWeight: isSelected ? '600' : '400',
|
|
172
|
+
},
|
|
173
|
+
]}
|
|
174
|
+
>
|
|
175
|
+
{opt.label}
|
|
176
|
+
</Text>
|
|
177
|
+
</Pressable>
|
|
178
|
+
);
|
|
179
|
+
})}
|
|
180
|
+
</ScrollView>
|
|
181
|
+
</Pressable>
|
|
182
|
+
</Pressable>
|
|
183
|
+
</Modal>
|
|
184
|
+
</View>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const styles = StyleSheet.create({
|
|
189
|
+
wrap: {
|
|
190
|
+
width: '100%',
|
|
191
|
+
marginBottom: 4,
|
|
192
|
+
},
|
|
193
|
+
label: {
|
|
194
|
+
fontSize: 14,
|
|
195
|
+
fontWeight: '500',
|
|
196
|
+
marginBottom: 4,
|
|
197
|
+
},
|
|
198
|
+
required: {
|
|
199
|
+
fontWeight: '400',
|
|
200
|
+
},
|
|
201
|
+
trigger: {
|
|
202
|
+
minHeight: 44,
|
|
203
|
+
paddingHorizontal: 12,
|
|
204
|
+
paddingVertical: 10,
|
|
205
|
+
borderWidth: 1,
|
|
206
|
+
flexDirection: 'row',
|
|
207
|
+
alignItems: 'center',
|
|
208
|
+
justifyContent: 'space-between',
|
|
209
|
+
},
|
|
210
|
+
triggerText: {
|
|
211
|
+
fontSize: 15,
|
|
212
|
+
flex: 1,
|
|
213
|
+
},
|
|
214
|
+
chevron: {
|
|
215
|
+
fontSize: 14,
|
|
216
|
+
marginLeft: 8,
|
|
217
|
+
},
|
|
218
|
+
disabled: {
|
|
219
|
+
opacity: 0.5,
|
|
220
|
+
},
|
|
221
|
+
error: {
|
|
222
|
+
fontSize: 13,
|
|
223
|
+
marginTop: 4,
|
|
224
|
+
lineHeight: 18,
|
|
225
|
+
},
|
|
226
|
+
backdrop: {
|
|
227
|
+
flex: 1,
|
|
228
|
+
backgroundColor: 'rgba(0,0,0,0.4)',
|
|
229
|
+
justifyContent: 'center',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
padding: 20,
|
|
232
|
+
},
|
|
233
|
+
sheet: {
|
|
234
|
+
width: '100%',
|
|
235
|
+
maxWidth: 420,
|
|
236
|
+
maxHeight: '70%',
|
|
237
|
+
borderWidth: 1,
|
|
238
|
+
paddingTop: 12,
|
|
239
|
+
paddingBottom: 6,
|
|
240
|
+
},
|
|
241
|
+
sheetTitle: {
|
|
242
|
+
fontSize: 16,
|
|
243
|
+
fontWeight: '600',
|
|
244
|
+
paddingHorizontal: 16,
|
|
245
|
+
marginBottom: 8,
|
|
246
|
+
},
|
|
247
|
+
sheetList: {
|
|
248
|
+
flexShrink: 1,
|
|
249
|
+
},
|
|
250
|
+
option: {
|
|
251
|
+
minHeight: 44,
|
|
252
|
+
paddingHorizontal: 16,
|
|
253
|
+
paddingVertical: 12,
|
|
254
|
+
justifyContent: 'center',
|
|
255
|
+
},
|
|
256
|
+
optionText: {
|
|
257
|
+
fontSize: 15,
|
|
258
|
+
},
|
|
259
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity spinner that respects reduced-motion. RN ships `ActivityIndicator`
|
|
3
|
+
* natively which already complies with platform accessibility settings.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ActivityIndicator } from 'react-native';
|
|
7
|
+
import { useTheme } from '../theme';
|
|
8
|
+
|
|
9
|
+
export interface SpinnerProps {
|
|
10
|
+
size?: number | 'small' | 'large';
|
|
11
|
+
color?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function Spinner({ size = 'large', color }: SpinnerProps) {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
return <ActivityIndicator size={size} color={color ?? theme.primaryColor} />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Button, type ButtonProps, type ButtonVariant } from './Button';
|
|
2
|
+
export { Input, type InputProps } from './Input';
|
|
3
|
+
export { Select, type SelectProps, type SelectOption } from './Select';
|
|
4
|
+
export { Card, type CardProps } from './Card';
|
|
5
|
+
export { Banner, type BannerProps } from './Banner';
|
|
6
|
+
export { Spinner, type SpinnerProps } from './Spinner';
|
|
7
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
8
|
+
export { DatePicker, type DatePickerProps } from './DatePicker';
|
|
9
|
+
export { CountrySelect, type CountrySelectProps } from './CountrySelect';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ThemeProvider + hooks.
|
|
3
|
+
*
|
|
4
|
+
* - `ThemeProvider` resolves tokens from `VelionConfig.theme` + colorMode and
|
|
5
|
+
* exposes them to descendants.
|
|
6
|
+
* - `useTheme()` returns the active `ResolvedTheme`.
|
|
7
|
+
* - `useReducedMotion()` honours the OS-level `prefers-reduced-motion` flag —
|
|
8
|
+
* components disable animations when true.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import React, {
|
|
12
|
+
createContext,
|
|
13
|
+
useContext,
|
|
14
|
+
useEffect,
|
|
15
|
+
useMemo,
|
|
16
|
+
useState,
|
|
17
|
+
type ReactNode,
|
|
18
|
+
} from 'react';
|
|
19
|
+
import { AccessibilityInfo, useColorScheme } from 'react-native';
|
|
20
|
+
import type { VelionTheme } from '../../types';
|
|
21
|
+
import { resolveTheme, type ResolvedTheme } from './tokens';
|
|
22
|
+
|
|
23
|
+
interface ThemeContextValue {
|
|
24
|
+
theme: ResolvedTheme;
|
|
25
|
+
reduceMotion: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ThemeContext = createContext<ThemeContextValue | null>(null);
|
|
29
|
+
|
|
30
|
+
export interface ThemeProviderProps {
|
|
31
|
+
/** Consumer-supplied overrides (subset of tokens). */
|
|
32
|
+
themeOverrides?: VelionTheme | undefined;
|
|
33
|
+
/** Explicit mode. `'auto'` follows the system color scheme. */
|
|
34
|
+
colorMode?: 'light' | 'dark' | 'auto' | undefined;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function ThemeProvider({
|
|
39
|
+
themeOverrides,
|
|
40
|
+
colorMode = 'auto',
|
|
41
|
+
children,
|
|
42
|
+
}: ThemeProviderProps) {
|
|
43
|
+
const systemScheme = useColorScheme();
|
|
44
|
+
const reduceMotion = useReducedMotionInternal();
|
|
45
|
+
|
|
46
|
+
const resolvedMode: 'light' | 'dark' = useMemo(() => {
|
|
47
|
+
if (colorMode === 'light' || colorMode === 'dark') return colorMode;
|
|
48
|
+
return systemScheme === 'dark' ? 'dark' : 'light';
|
|
49
|
+
}, [colorMode, systemScheme]);
|
|
50
|
+
|
|
51
|
+
const theme = useMemo(
|
|
52
|
+
() => resolveTheme(themeOverrides, resolvedMode),
|
|
53
|
+
[themeOverrides, resolvedMode],
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const value = useMemo<ThemeContextValue>(
|
|
57
|
+
() => ({ theme, reduceMotion }),
|
|
58
|
+
[theme, reduceMotion],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function useTheme(): ResolvedTheme {
|
|
67
|
+
const ctx = useContext(ThemeContext);
|
|
68
|
+
if (!ctx) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
'useTheme must be used inside <ThemeProvider>. Did you mount <VelionOnboardingScreen> at the root of your screen?',
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return ctx.theme;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function useReducedMotion(): boolean {
|
|
77
|
+
const ctx = useContext(ThemeContext);
|
|
78
|
+
return ctx?.reduceMotion ?? false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function useReducedMotionInternal(): boolean {
|
|
82
|
+
const [enabled, setEnabled] = useState(false);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
let mounted = true;
|
|
85
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
86
|
+
.then((v) => {
|
|
87
|
+
if (mounted) setEnabled(v);
|
|
88
|
+
})
|
|
89
|
+
.catch(() => {
|
|
90
|
+
// The API is best-effort on every platform; default to false on error.
|
|
91
|
+
});
|
|
92
|
+
const sub = AccessibilityInfo.addEventListener(
|
|
93
|
+
'reduceMotionChanged',
|
|
94
|
+
(v) => setEnabled(v),
|
|
95
|
+
);
|
|
96
|
+
return () => {
|
|
97
|
+
mounted = false;
|
|
98
|
+
sub.remove();
|
|
99
|
+
};
|
|
100
|
+
}, []);
|
|
101
|
+
return enabled;
|
|
102
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ThemeProvider,
|
|
3
|
+
useTheme,
|
|
4
|
+
useReducedMotion,
|
|
5
|
+
type ThemeProviderProps,
|
|
6
|
+
} from './ThemeProvider';
|
|
7
|
+
export {
|
|
8
|
+
LIGHT_TOKENS,
|
|
9
|
+
DARK_TOKENS,
|
|
10
|
+
getDefaultThemeTokens,
|
|
11
|
+
resolveTheme,
|
|
12
|
+
mixHex,
|
|
13
|
+
withAlpha,
|
|
14
|
+
isHexDark,
|
|
15
|
+
type ResolvedTheme,
|
|
16
|
+
type ThemeTokenSet,
|
|
17
|
+
} from './tokens';
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Theme tokens for the React Native SDK.
|
|
3
|
+
*
|
|
4
|
+
* Exposes logical tokens as a plain JS object that components consume via
|
|
5
|
+
* `useTheme()`.
|
|
6
|
+
*
|
|
7
|
+
* Light and dark are tuned independently (Material Design 3 / Apple HIG dark
|
|
8
|
+
* pairing). Consumer overrides from `VelionConfig.theme` are layered on top.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { VelionTheme } from '../../types';
|
|
12
|
+
|
|
13
|
+
/** Tonal token set. Shape matches `VelionTheme` (all required, no undefineds). */
|
|
14
|
+
export type ThemeTokenSet = Required<VelionTheme>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Resolved values that components actually read from. We keep colors as plain
|
|
18
|
+
* hex strings; consumers that want to layer translucency use `mixHex` instead
|
|
19
|
+
* of CSS `color-mix()` (which does not exist in RN).
|
|
20
|
+
*/
|
|
21
|
+
export interface ResolvedTheme extends ThemeTokenSet {
|
|
22
|
+
/** The mode that components should consider active (post-luminance check). */
|
|
23
|
+
effectiveMode: 'light' | 'dark';
|
|
24
|
+
/** The numeric pixel value parsed from `borderRadius` (the SDK-wide default). */
|
|
25
|
+
borderRadiusPx: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const LIGHT_TOKENS: ThemeTokenSet = {
|
|
29
|
+
primaryColor: '#2563EB',
|
|
30
|
+
secondaryColor: '#1D4ED8',
|
|
31
|
+
backgroundColor: '#FFFFFF',
|
|
32
|
+
textColor: '#111827',
|
|
33
|
+
textSecondaryColor: '#6B7280',
|
|
34
|
+
borderRadius: '8px',
|
|
35
|
+
fontFamily: 'System',
|
|
36
|
+
errorColor: '#DC2626',
|
|
37
|
+
successColor: '#16A34A',
|
|
38
|
+
warningColor: '#D97706',
|
|
39
|
+
borderColor: '#E5E7EB',
|
|
40
|
+
cardShadow: '0 4px 6px -1px rgba(0,0,0,0.10), 0 2px 4px -2px rgba(0,0,0,0.10)',
|
|
41
|
+
hideStepIcons: false,
|
|
42
|
+
hideProgressBar: false,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const DARK_TOKENS: ThemeTokenSet = {
|
|
46
|
+
primaryColor: '#3B82F6',
|
|
47
|
+
secondaryColor: '#60A5FA',
|
|
48
|
+
backgroundColor: '#0B1220',
|
|
49
|
+
textColor: '#F1F5F9',
|
|
50
|
+
textSecondaryColor: '#94A3B8',
|
|
51
|
+
borderRadius: '8px',
|
|
52
|
+
fontFamily: 'System',
|
|
53
|
+
errorColor: '#F87171',
|
|
54
|
+
successColor: '#34D399',
|
|
55
|
+
warningColor: '#FBBF24',
|
|
56
|
+
borderColor: '#1E293B',
|
|
57
|
+
cardShadow: '0 8px 18px -4px rgba(0,0,0,0.55), 0 4px 8px -4px rgba(0,0,0,0.40)',
|
|
58
|
+
hideStepIcons: false,
|
|
59
|
+
hideProgressBar: false,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export function getDefaultThemeTokens(
|
|
63
|
+
colorMode: 'light' | 'dark' = 'light',
|
|
64
|
+
): ThemeTokenSet {
|
|
65
|
+
return colorMode === 'dark' ? { ...DARK_TOKENS } : { ...LIGHT_TOKENS };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Layers consumer overrides on top of the base tokens for the requested mode. */
|
|
69
|
+
export function resolveTheme(
|
|
70
|
+
theme: VelionTheme | undefined,
|
|
71
|
+
colorMode: 'light' | 'dark',
|
|
72
|
+
): ResolvedTheme {
|
|
73
|
+
const base = colorMode === 'dark' ? DARK_TOKENS : LIGHT_TOKENS;
|
|
74
|
+
const merged: ThemeTokenSet = { ...base, ...theme };
|
|
75
|
+
// Recompute the effective mode from the resolved background luminance, so a
|
|
76
|
+
// consumer that passes `colorMode: "light"` but overrides `backgroundColor`
|
|
77
|
+
// with a dark hex still gets icons / images that branch on the mode right.
|
|
78
|
+
const effectiveMode: 'light' | 'dark' = isHexDark(merged.backgroundColor)
|
|
79
|
+
? 'dark'
|
|
80
|
+
: 'light';
|
|
81
|
+
const borderRadiusPx = parsePx(merged.borderRadius, 8);
|
|
82
|
+
return { ...merged, effectiveMode, borderRadiusPx };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** WCAG relative-luminance check. Returns false on unparsable input. */
|
|
86
|
+
export function isHexDark(hex: string): boolean {
|
|
87
|
+
const parsed = parseHex(hex);
|
|
88
|
+
if (!parsed) return false;
|
|
89
|
+
const linearize = (c: number): number => {
|
|
90
|
+
const n = c / 255;
|
|
91
|
+
return n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4);
|
|
92
|
+
};
|
|
93
|
+
const luminance =
|
|
94
|
+
0.2126 * linearize(parsed.r) +
|
|
95
|
+
0.7152 * linearize(parsed.g) +
|
|
96
|
+
0.0722 * linearize(parsed.b);
|
|
97
|
+
return luminance < 0.5;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Mix two hex colors at the given ratio (0–100). Cheap stand-in for the web's
|
|
102
|
+
* `color-mix(in srgb, A x%, B)` so we can render the soft halos and tinted
|
|
103
|
+
* backgrounds the design system uses (.vl-retry-dialog, .vl-sworn__option).
|
|
104
|
+
*/
|
|
105
|
+
export function mixHex(a: string, b: string, ratioOfA: number): string {
|
|
106
|
+
const ar = clamp(ratioOfA, 0, 100) / 100;
|
|
107
|
+
const ca = parseHex(a);
|
|
108
|
+
const cb = parseHex(b);
|
|
109
|
+
if (!ca || !cb) return a;
|
|
110
|
+
const r = Math.round(ca.r * ar + cb.r * (1 - ar));
|
|
111
|
+
const g = Math.round(ca.g * ar + cb.g * (1 - ar));
|
|
112
|
+
const blue = Math.round(ca.b * ar + cb.b * (1 - ar));
|
|
113
|
+
return `#${toHex(r)}${toHex(g)}${toHex(blue)}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns an `rgba()` string with the supplied alpha (0–1). Use for translucent
|
|
118
|
+
* borders / fills that should not blend with the host background.
|
|
119
|
+
*/
|
|
120
|
+
export function withAlpha(hex: string, alpha: number): string {
|
|
121
|
+
const c = parseHex(hex);
|
|
122
|
+
if (!c) return hex;
|
|
123
|
+
const a = clamp(alpha, 0, 1);
|
|
124
|
+
return `rgba(${c.r}, ${c.g}, ${c.b}, ${a})`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function parseHex(hex: string): { r: number; g: number; b: number } | null {
|
|
128
|
+
const match = hex.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);
|
|
129
|
+
if (!match || !match[1]) return null;
|
|
130
|
+
const raw = match[1];
|
|
131
|
+
const full =
|
|
132
|
+
raw.length === 3
|
|
133
|
+
? raw[0]! + raw[0]! + raw[1]! + raw[1]! + raw[2]! + raw[2]!
|
|
134
|
+
: raw;
|
|
135
|
+
return {
|
|
136
|
+
r: parseInt(full.slice(0, 2), 16),
|
|
137
|
+
g: parseInt(full.slice(2, 4), 16),
|
|
138
|
+
b: parseInt(full.slice(4, 6), 16),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function toHex(n: number): string {
|
|
143
|
+
return clamp(n, 0, 255).toString(16).padStart(2, '0').toUpperCase();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function clamp(n: number, min: number, max: number): number {
|
|
147
|
+
if (n < min) return min;
|
|
148
|
+
if (n > max) return max;
|
|
149
|
+
return n;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function parsePx(value: string, fallback: number): number {
|
|
153
|
+
const m = value.trim().match(/^(\d+(?:\.\d+)?)\s*px$/i);
|
|
154
|
+
if (m && m[1]) {
|
|
155
|
+
const parsed = Number(m[1]);
|
|
156
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
157
|
+
}
|
|
158
|
+
return fallback;
|
|
159
|
+
}
|