@velion-la/onboarding-sdk-react-native 1.0.0-beta.10

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.
Files changed (614) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/LICENSE +12 -0
  3. package/README.md +888 -0
  4. package/app.plugin.js +101 -0
  5. package/lib/commonjs/camera/AddressSearchBar.js +304 -0
  6. package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
  7. package/lib/commonjs/camera/DocumentCapture.js +513 -0
  8. package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
  9. package/lib/commonjs/camera/LivenessCamera.js +628 -0
  10. package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
  11. package/lib/commonjs/camera/MapAddressPicker.js +331 -0
  12. package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
  13. package/lib/commonjs/core/VelionOnboarding.js +1113 -0
  14. package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
  15. package/lib/commonjs/core/retryStepCopy.js +43 -0
  16. package/lib/commonjs/core/retryStepCopy.js.map +1 -0
  17. package/lib/commonjs/core/routingCommands.js +62 -0
  18. package/lib/commonjs/core/routingCommands.js.map +1 -0
  19. package/lib/commonjs/core/sessionDeclinedCopy.js +56 -0
  20. package/lib/commonjs/core/sessionDeclinedCopy.js.map +1 -0
  21. package/lib/commonjs/core/sessionStateMapper.js +200 -0
  22. package/lib/commonjs/core/sessionStateMapper.js.map +1 -0
  23. package/lib/commonjs/core/sseReasonMessages.js +450 -0
  24. package/lib/commonjs/core/sseReasonMessages.js.map +1 -0
  25. package/lib/commonjs/data/iso3166Alpha2Codes.json +1 -0
  26. package/lib/commonjs/data/iso3166CountryNames.json +251 -0
  27. package/lib/commonjs/i18n/index.js +30 -0
  28. package/lib/commonjs/i18n/index.js.map +1 -0
  29. package/lib/commonjs/i18n/strings/en.js +301 -0
  30. package/lib/commonjs/i18n/strings/en.js.map +1 -0
  31. package/lib/commonjs/i18n/strings/es.js +306 -0
  32. package/lib/commonjs/i18n/strings/es.js.map +1 -0
  33. package/lib/commonjs/index.js +225 -0
  34. package/lib/commonjs/index.js.map +1 -0
  35. package/lib/commonjs/package.json +1 -0
  36. package/lib/commonjs/steps/AddressInfoStep.js +662 -0
  37. package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
  38. package/lib/commonjs/steps/DocumentsOcrStep.js +405 -0
  39. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
  40. package/lib/commonjs/steps/EconomicActivityStep.js +214 -0
  41. package/lib/commonjs/steps/EconomicActivityStep.js.map +1 -0
  42. package/lib/commonjs/steps/EmailContactStep.js +150 -0
  43. package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
  44. package/lib/commonjs/steps/EmailOtpStep.js +225 -0
  45. package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
  46. package/lib/commonjs/steps/FaceMatchStep.js +169 -0
  47. package/lib/commonjs/steps/FaceMatchStep.js.map +1 -0
  48. package/lib/commonjs/steps/FingerprintStep.js +92 -0
  49. package/lib/commonjs/steps/FingerprintStep.js.map +1 -0
  50. package/lib/commonjs/steps/HumanBasicInfoStep.js +251 -0
  51. package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
  52. package/lib/commonjs/steps/HumanExtendedInfoStep.js +275 -0
  53. package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
  54. package/lib/commonjs/steps/LegalBasicInfoStep.js +195 -0
  55. package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
  56. package/lib/commonjs/steps/LegalExtendedInfoStep.js +173 -0
  57. package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
  58. package/lib/commonjs/steps/LivenessMatchStep.js +1184 -0
  59. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
  60. package/lib/commonjs/steps/PhoneContactStep.js +151 -0
  61. package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
  62. package/lib/commonjs/steps/PhoneOtpStep.js +224 -0
  63. package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
  64. package/lib/commonjs/steps/SwornDeclarationStep.js +206 -0
  65. package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
  66. package/lib/commonjs/steps/TaxInfoStep.js +251 -0
  67. package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
  68. package/lib/commonjs/steps/TermsAndConditionsStep.js +245 -0
  69. package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
  70. package/lib/commonjs/steps/_shared.js +61 -0
  71. package/lib/commonjs/steps/_shared.js.map +1 -0
  72. package/lib/commonjs/steps/types.js +6 -0
  73. package/lib/commonjs/steps/types.js.map +1 -0
  74. package/lib/commonjs/transport/api.js +176 -0
  75. package/lib/commonjs/transport/api.js.map +1 -0
  76. package/lib/commonjs/transport/irisWebSocket.js +121 -0
  77. package/lib/commonjs/transport/irisWebSocket.js.map +1 -0
  78. package/lib/commonjs/transport/secureUrl.js +50 -0
  79. package/lib/commonjs/transport/secureUrl.js.map +1 -0
  80. package/lib/commonjs/transport/sse.js +248 -0
  81. package/lib/commonjs/transport/sse.js.map +1 -0
  82. package/lib/commonjs/types/index.js +458 -0
  83. package/lib/commonjs/types/index.js.map +1 -0
  84. package/lib/commonjs/ui/MapFallbackBoundary.js +42 -0
  85. package/lib/commonjs/ui/MapFallbackBoundary.js.map +1 -0
  86. package/lib/commonjs/ui/StepShell.js +251 -0
  87. package/lib/commonjs/ui/StepShell.js.map +1 -0
  88. package/lib/commonjs/ui/VelionOnboardingScreen.js +276 -0
  89. package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -0
  90. package/lib/commonjs/ui/forms/index.js +38 -0
  91. package/lib/commonjs/ui/forms/index.js.map +1 -0
  92. package/lib/commonjs/ui/forms/useInlineValidation.js +88 -0
  93. package/lib/commonjs/ui/forms/useInlineValidation.js.map +1 -0
  94. package/lib/commonjs/ui/forms/validators.js +34 -0
  95. package/lib/commonjs/ui/forms/validators.js.map +1 -0
  96. package/lib/commonjs/ui/icons/HomeHeartIcon.js +38 -0
  97. package/lib/commonjs/ui/icons/HomeHeartIcon.js.map +1 -0
  98. package/lib/commonjs/ui/icons/StepIcon.js +59 -0
  99. package/lib/commonjs/ui/icons/StepIcon.js.map +1 -0
  100. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js +284 -0
  101. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js.map +1 -0
  102. package/lib/commonjs/ui/overlays/LoadingOverlay.js +108 -0
  103. package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -0
  104. package/lib/commonjs/ui/overlays/ProgressBar.js +101 -0
  105. package/lib/commonjs/ui/overlays/ProgressBar.js.map +1 -0
  106. package/lib/commonjs/ui/overlays/RetryDialog.js +125 -0
  107. package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -0
  108. package/lib/commonjs/ui/overlays/index.js +33 -0
  109. package/lib/commonjs/ui/overlays/index.js.map +1 -0
  110. package/lib/commonjs/ui/primitives/BackButton.js +75 -0
  111. package/lib/commonjs/ui/primitives/BackButton.js.map +1 -0
  112. package/lib/commonjs/ui/primitives/Banner.js +81 -0
  113. package/lib/commonjs/ui/primitives/Banner.js.map +1 -0
  114. package/lib/commonjs/ui/primitives/Button.js +142 -0
  115. package/lib/commonjs/ui/primitives/Button.js.map +1 -0
  116. package/lib/commonjs/ui/primitives/Card.js +50 -0
  117. package/lib/commonjs/ui/primitives/Card.js.map +1 -0
  118. package/lib/commonjs/ui/primitives/Checkbox.js +139 -0
  119. package/lib/commonjs/ui/primitives/Checkbox.js.map +1 -0
  120. package/lib/commonjs/ui/primitives/CountrySelect.js +288 -0
  121. package/lib/commonjs/ui/primitives/CountrySelect.js.map +1 -0
  122. package/lib/commonjs/ui/primitives/DatePicker.js +245 -0
  123. package/lib/commonjs/ui/primitives/DatePicker.js.map +1 -0
  124. package/lib/commonjs/ui/primitives/Input.js +101 -0
  125. package/lib/commonjs/ui/primitives/Input.js.map +1 -0
  126. package/lib/commonjs/ui/primitives/SearchableSingleSelectList.js +162 -0
  127. package/lib/commonjs/ui/primitives/SearchableSingleSelectList.js.map +1 -0
  128. package/lib/commonjs/ui/primitives/Select.js +209 -0
  129. package/lib/commonjs/ui/primitives/Select.js.map +1 -0
  130. package/lib/commonjs/ui/primitives/Spinner.js +25 -0
  131. package/lib/commonjs/ui/primitives/Spinner.js.map +1 -0
  132. package/lib/commonjs/ui/primitives/index.js +89 -0
  133. package/lib/commonjs/ui/primitives/index.js.map +1 -0
  134. package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.js +31 -0
  135. package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.js.map +1 -0
  136. package/lib/commonjs/ui/theme/ThemeProvider.js +74 -0
  137. package/lib/commonjs/ui/theme/ThemeProvider.js.map +1 -0
  138. package/lib/commonjs/ui/theme/index.js +68 -0
  139. package/lib/commonjs/ui/theme/index.js.map +1 -0
  140. package/lib/commonjs/ui/theme/tokens.js +154 -0
  141. package/lib/commonjs/ui/theme/tokens.js.map +1 -0
  142. package/lib/commonjs/utils/EventEmitter.js +144 -0
  143. package/lib/commonjs/utils/EventEmitter.js.map +1 -0
  144. package/lib/commonjs/utils/base64.js +53 -0
  145. package/lib/commonjs/utils/base64.js.map +1 -0
  146. package/lib/commonjs/utils/deviceFingerprint.js +132 -0
  147. package/lib/commonjs/utils/deviceFingerprint.js.map +1 -0
  148. package/lib/commonjs/utils/documentTypeOptions.js +35 -0
  149. package/lib/commonjs/utils/documentTypeOptions.js.map +1 -0
  150. package/lib/commonjs/utils/googleMapsPreflight.js +88 -0
  151. package/lib/commonjs/utils/googleMapsPreflight.js.map +1 -0
  152. package/lib/commonjs/utils/hmac.js +58 -0
  153. package/lib/commonjs/utils/hmac.js.map +1 -0
  154. package/lib/commonjs/utils/iso3166Countries.js +98 -0
  155. package/lib/commonjs/utils/iso3166Countries.js.map +1 -0
  156. package/lib/commonjs/utils/jpegFromUri.js +44 -0
  157. package/lib/commonjs/utils/jpegFromUri.js.map +1 -0
  158. package/lib/commonjs/utils/keepAwake.js +58 -0
  159. package/lib/commonjs/utils/keepAwake.js.map +1 -0
  160. package/lib/commonjs/utils/log.js +42 -0
  161. package/lib/commonjs/utils/log.js.map +1 -0
  162. package/lib/commonjs/utils/osGeocoder.js +70 -0
  163. package/lib/commonjs/utils/osGeocoder.js.map +1 -0
  164. package/lib/commonjs/utils/parseGoogleAddressComponents.js +74 -0
  165. package/lib/commonjs/utils/parseGoogleAddressComponents.js.map +1 -0
  166. package/lib/commonjs/utils/personNameNormalize.js +24 -0
  167. package/lib/commonjs/utils/personNameNormalize.js.map +1 -0
  168. package/lib/commonjs/utils/sdkError.js +34 -0
  169. package/lib/commonjs/utils/sdkError.js.map +1 -0
  170. package/lib/commonjs/utils/sdkVersion.js +13 -0
  171. package/lib/commonjs/utils/sdkVersion.js.map +1 -0
  172. package/lib/commonjs/utils/stepConfig.js +65 -0
  173. package/lib/commonjs/utils/stepConfig.js.map +1 -0
  174. package/lib/commonjs/utils/taxInfoConfig.js +19 -0
  175. package/lib/commonjs/utils/taxInfoConfig.js.map +1 -0
  176. package/lib/commonjs/utils/useSafeAreaInsets.js +41 -0
  177. package/lib/commonjs/utils/useSafeAreaInsets.js.map +1 -0
  178. package/lib/commonjs/utils/velionExtra.js +48 -0
  179. package/lib/commonjs/utils/velionExtra.js.map +1 -0
  180. package/lib/module/camera/AddressSearchBar.js +299 -0
  181. package/lib/module/camera/AddressSearchBar.js.map +1 -0
  182. package/lib/module/camera/DocumentCapture.js +508 -0
  183. package/lib/module/camera/DocumentCapture.js.map +1 -0
  184. package/lib/module/camera/LivenessCamera.js +623 -0
  185. package/lib/module/camera/LivenessCamera.js.map +1 -0
  186. package/lib/module/camera/MapAddressPicker.js +326 -0
  187. package/lib/module/camera/MapAddressPicker.js.map +1 -0
  188. package/lib/module/core/VelionOnboarding.js +1109 -0
  189. package/lib/module/core/VelionOnboarding.js.map +1 -0
  190. package/lib/module/core/retryStepCopy.js +39 -0
  191. package/lib/module/core/retryStepCopy.js.map +1 -0
  192. package/lib/module/core/routingCommands.js +57 -0
  193. package/lib/module/core/routingCommands.js.map +1 -0
  194. package/lib/module/core/sessionDeclinedCopy.js +52 -0
  195. package/lib/module/core/sessionDeclinedCopy.js.map +1 -0
  196. package/lib/module/core/sessionStateMapper.js +189 -0
  197. package/lib/module/core/sessionStateMapper.js.map +1 -0
  198. package/lib/module/core/sseReasonMessages.js +446 -0
  199. package/lib/module/core/sseReasonMessages.js.map +1 -0
  200. package/lib/module/data/iso3166Alpha2Codes.json +1 -0
  201. package/lib/module/data/iso3166CountryNames.json +251 -0
  202. package/lib/module/i18n/index.js +25 -0
  203. package/lib/module/i18n/index.js.map +1 -0
  204. package/lib/module/i18n/strings/en.js +297 -0
  205. package/lib/module/i18n/strings/en.js.map +1 -0
  206. package/lib/module/i18n/strings/es.js +302 -0
  207. package/lib/module/i18n/strings/es.js.map +1 -0
  208. package/lib/module/index.js +36 -0
  209. package/lib/module/index.js.map +1 -0
  210. package/lib/module/steps/AddressInfoStep.js +658 -0
  211. package/lib/module/steps/AddressInfoStep.js.map +1 -0
  212. package/lib/module/steps/DocumentsOcrStep.js +399 -0
  213. package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
  214. package/lib/module/steps/EconomicActivityStep.js +209 -0
  215. package/lib/module/steps/EconomicActivityStep.js.map +1 -0
  216. package/lib/module/steps/EmailContactStep.js +145 -0
  217. package/lib/module/steps/EmailContactStep.js.map +1 -0
  218. package/lib/module/steps/EmailOtpStep.js +220 -0
  219. package/lib/module/steps/EmailOtpStep.js.map +1 -0
  220. package/lib/module/steps/FaceMatchStep.js +164 -0
  221. package/lib/module/steps/FaceMatchStep.js.map +1 -0
  222. package/lib/module/steps/FingerprintStep.js +87 -0
  223. package/lib/module/steps/FingerprintStep.js.map +1 -0
  224. package/lib/module/steps/HumanBasicInfoStep.js +246 -0
  225. package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
  226. package/lib/module/steps/HumanExtendedInfoStep.js +270 -0
  227. package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
  228. package/lib/module/steps/LegalBasicInfoStep.js +190 -0
  229. package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
  230. package/lib/module/steps/LegalExtendedInfoStep.js +168 -0
  231. package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
  232. package/lib/module/steps/LivenessMatchStep.js +1177 -0
  233. package/lib/module/steps/LivenessMatchStep.js.map +1 -0
  234. package/lib/module/steps/PhoneContactStep.js +146 -0
  235. package/lib/module/steps/PhoneContactStep.js.map +1 -0
  236. package/lib/module/steps/PhoneOtpStep.js +219 -0
  237. package/lib/module/steps/PhoneOtpStep.js.map +1 -0
  238. package/lib/module/steps/SwornDeclarationStep.js +203 -0
  239. package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
  240. package/lib/module/steps/TaxInfoStep.js +246 -0
  241. package/lib/module/steps/TaxInfoStep.js.map +1 -0
  242. package/lib/module/steps/TermsAndConditionsStep.js +240 -0
  243. package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
  244. package/lib/module/steps/_shared.js +52 -0
  245. package/lib/module/steps/_shared.js.map +1 -0
  246. package/lib/module/steps/types.js +4 -0
  247. package/lib/module/steps/types.js.map +1 -0
  248. package/lib/module/transport/api.js +173 -0
  249. package/lib/module/transport/api.js.map +1 -0
  250. package/lib/module/transport/irisWebSocket.js +115 -0
  251. package/lib/module/transport/irisWebSocket.js.map +1 -0
  252. package/lib/module/transport/secureUrl.js +45 -0
  253. package/lib/module/transport/secureUrl.js.map +1 -0
  254. package/lib/module/transport/sse.js +242 -0
  255. package/lib/module/transport/sse.js.map +1 -0
  256. package/lib/module/types/index.js +532 -0
  257. package/lib/module/types/index.js.map +1 -0
  258. package/lib/module/ui/MapFallbackBoundary.js +37 -0
  259. package/lib/module/ui/MapFallbackBoundary.js.map +1 -0
  260. package/lib/module/ui/StepShell.js +246 -0
  261. package/lib/module/ui/StepShell.js.map +1 -0
  262. package/lib/module/ui/VelionOnboardingScreen.js +273 -0
  263. package/lib/module/ui/VelionOnboardingScreen.js.map +1 -0
  264. package/lib/module/ui/forms/index.js +5 -0
  265. package/lib/module/ui/forms/index.js.map +1 -0
  266. package/lib/module/ui/forms/useInlineValidation.js +84 -0
  267. package/lib/module/ui/forms/useInlineValidation.js.map +1 -0
  268. package/lib/module/ui/forms/validators.js +27 -0
  269. package/lib/module/ui/forms/validators.js.map +1 -0
  270. package/lib/module/ui/icons/HomeHeartIcon.js +33 -0
  271. package/lib/module/ui/icons/HomeHeartIcon.js.map +1 -0
  272. package/lib/module/ui/icons/StepIcon.js +55 -0
  273. package/lib/module/ui/icons/StepIcon.js.map +1 -0
  274. package/lib/module/ui/overlays/AnalyzingOverlay.js +279 -0
  275. package/lib/module/ui/overlays/AnalyzingOverlay.js.map +1 -0
  276. package/lib/module/ui/overlays/LoadingOverlay.js +104 -0
  277. package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -0
  278. package/lib/module/ui/overlays/ProgressBar.js +97 -0
  279. package/lib/module/ui/overlays/ProgressBar.js.map +1 -0
  280. package/lib/module/ui/overlays/RetryDialog.js +121 -0
  281. package/lib/module/ui/overlays/RetryDialog.js.map +1 -0
  282. package/lib/module/ui/overlays/index.js +6 -0
  283. package/lib/module/ui/overlays/index.js.map +1 -0
  284. package/lib/module/ui/primitives/BackButton.js +71 -0
  285. package/lib/module/ui/primitives/BackButton.js.map +1 -0
  286. package/lib/module/ui/primitives/Banner.js +77 -0
  287. package/lib/module/ui/primitives/Banner.js.map +1 -0
  288. package/lib/module/ui/primitives/Button.js +138 -0
  289. package/lib/module/ui/primitives/Button.js.map +1 -0
  290. package/lib/module/ui/primitives/Card.js +46 -0
  291. package/lib/module/ui/primitives/Card.js.map +1 -0
  292. package/lib/module/ui/primitives/Checkbox.js +136 -0
  293. package/lib/module/ui/primitives/Checkbox.js.map +1 -0
  294. package/lib/module/ui/primitives/CountrySelect.js +284 -0
  295. package/lib/module/ui/primitives/CountrySelect.js.map +1 -0
  296. package/lib/module/ui/primitives/DatePicker.js +241 -0
  297. package/lib/module/ui/primitives/DatePicker.js.map +1 -0
  298. package/lib/module/ui/primitives/Input.js +97 -0
  299. package/lib/module/ui/primitives/Input.js.map +1 -0
  300. package/lib/module/ui/primitives/SearchableSingleSelectList.js +153 -0
  301. package/lib/module/ui/primitives/SearchableSingleSelectList.js.map +1 -0
  302. package/lib/module/ui/primitives/Select.js +205 -0
  303. package/lib/module/ui/primitives/Select.js.map +1 -0
  304. package/lib/module/ui/primitives/Spinner.js +21 -0
  305. package/lib/module/ui/primitives/Spinner.js.map +1 -0
  306. package/lib/module/ui/primitives/index.js +14 -0
  307. package/lib/module/ui/primitives/index.js.map +1 -0
  308. package/lib/module/ui/primitives/searchableSingleSelectFilter.js +27 -0
  309. package/lib/module/ui/primitives/searchableSingleSelectFilter.js.map +1 -0
  310. package/lib/module/ui/theme/ThemeProvider.js +67 -0
  311. package/lib/module/ui/theme/ThemeProvider.js.map +1 -0
  312. package/lib/module/ui/theme/index.js +5 -0
  313. package/lib/module/ui/theme/index.js.map +1 -0
  314. package/lib/module/ui/theme/tokens.js +145 -0
  315. package/lib/module/ui/theme/tokens.js.map +1 -0
  316. package/lib/module/utils/EventEmitter.js +139 -0
  317. package/lib/module/utils/EventEmitter.js.map +1 -0
  318. package/lib/module/utils/base64.js +47 -0
  319. package/lib/module/utils/base64.js.map +1 -0
  320. package/lib/module/utils/deviceFingerprint.js +129 -0
  321. package/lib/module/utils/deviceFingerprint.js.map +1 -0
  322. package/lib/module/utils/documentTypeOptions.js +31 -0
  323. package/lib/module/utils/documentTypeOptions.js.map +1 -0
  324. package/lib/module/utils/googleMapsPreflight.js +84 -0
  325. package/lib/module/utils/googleMapsPreflight.js.map +1 -0
  326. package/lib/module/utils/hmac.js +53 -0
  327. package/lib/module/utils/hmac.js.map +1 -0
  328. package/lib/module/utils/iso3166Countries.js +92 -0
  329. package/lib/module/utils/iso3166Countries.js.map +1 -0
  330. package/lib/module/utils/jpegFromUri.js +40 -0
  331. package/lib/module/utils/jpegFromUri.js.map +1 -0
  332. package/lib/module/utils/keepAwake.js +53 -0
  333. package/lib/module/utils/keepAwake.js.map +1 -0
  334. package/lib/module/utils/log.js +37 -0
  335. package/lib/module/utils/log.js.map +1 -0
  336. package/lib/module/utils/osGeocoder.js +65 -0
  337. package/lib/module/utils/osGeocoder.js.map +1 -0
  338. package/lib/module/utils/parseGoogleAddressComponents.js +69 -0
  339. package/lib/module/utils/parseGoogleAddressComponents.js.map +1 -0
  340. package/lib/module/utils/personNameNormalize.js +20 -0
  341. package/lib/module/utils/personNameNormalize.js.map +1 -0
  342. package/lib/module/utils/sdkError.js +29 -0
  343. package/lib/module/utils/sdkError.js.map +1 -0
  344. package/lib/module/utils/sdkVersion.js +9 -0
  345. package/lib/module/utils/sdkVersion.js.map +1 -0
  346. package/lib/module/utils/stepConfig.js +59 -0
  347. package/lib/module/utils/stepConfig.js.map +1 -0
  348. package/lib/module/utils/taxInfoConfig.js +15 -0
  349. package/lib/module/utils/taxInfoConfig.js.map +1 -0
  350. package/lib/module/utils/useSafeAreaInsets.js +37 -0
  351. package/lib/module/utils/useSafeAreaInsets.js.map +1 -0
  352. package/lib/module/utils/velionExtra.js +44 -0
  353. package/lib/module/utils/velionExtra.js.map +1 -0
  354. package/lib/typescript/camera/AddressSearchBar.d.ts +37 -0
  355. package/lib/typescript/camera/AddressSearchBar.d.ts.map +1 -0
  356. package/lib/typescript/camera/DocumentCapture.d.ts +34 -0
  357. package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -0
  358. package/lib/typescript/camera/LivenessCamera.d.ts +67 -0
  359. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -0
  360. package/lib/typescript/camera/MapAddressPicker.d.ts +57 -0
  361. package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -0
  362. package/lib/typescript/core/VelionOnboarding.d.ts +169 -0
  363. package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
  364. package/lib/typescript/core/retryStepCopy.d.ts +27 -0
  365. package/lib/typescript/core/retryStepCopy.d.ts.map +1 -0
  366. package/lib/typescript/core/routingCommands.d.ts +39 -0
  367. package/lib/typescript/core/routingCommands.d.ts.map +1 -0
  368. package/lib/typescript/core/sessionDeclinedCopy.d.ts +16 -0
  369. package/lib/typescript/core/sessionDeclinedCopy.d.ts.map +1 -0
  370. package/lib/typescript/core/sessionStateMapper.d.ts +52 -0
  371. package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -0
  372. package/lib/typescript/core/sseReasonMessages.d.ts +20 -0
  373. package/lib/typescript/core/sseReasonMessages.d.ts.map +1 -0
  374. package/lib/typescript/i18n/index.d.ts +13 -0
  375. package/lib/typescript/i18n/index.d.ts.map +1 -0
  376. package/lib/typescript/i18n/strings/en.d.ts +3 -0
  377. package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
  378. package/lib/typescript/i18n/strings/es.d.ts +297 -0
  379. package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
  380. package/lib/typescript/index.d.ts +26 -0
  381. package/lib/typescript/index.d.ts.map +1 -0
  382. package/lib/typescript/steps/AddressInfoStep.d.ts +26 -0
  383. package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -0
  384. package/lib/typescript/steps/DocumentsOcrStep.d.ts +26 -0
  385. package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -0
  386. package/lib/typescript/steps/EconomicActivityStep.d.ts +29 -0
  387. package/lib/typescript/steps/EconomicActivityStep.d.ts.map +1 -0
  388. package/lib/typescript/steps/EmailContactStep.d.ts +15 -0
  389. package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -0
  390. package/lib/typescript/steps/EmailOtpStep.d.ts +21 -0
  391. package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -0
  392. package/lib/typescript/steps/FaceMatchStep.d.ts +27 -0
  393. package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -0
  394. package/lib/typescript/steps/FingerprintStep.d.ts +25 -0
  395. package/lib/typescript/steps/FingerprintStep.d.ts.map +1 -0
  396. package/lib/typescript/steps/HumanBasicInfoStep.d.ts +25 -0
  397. package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -0
  398. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts +23 -0
  399. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -0
  400. package/lib/typescript/steps/LegalBasicInfoStep.d.ts +17 -0
  401. package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -0
  402. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts +17 -0
  403. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -0
  404. package/lib/typescript/steps/LivenessMatchStep.d.ts +26 -0
  405. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -0
  406. package/lib/typescript/steps/PhoneContactStep.d.ts +15 -0
  407. package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -0
  408. package/lib/typescript/steps/PhoneOtpStep.d.ts +19 -0
  409. package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -0
  410. package/lib/typescript/steps/SwornDeclarationStep.d.ts +20 -0
  411. package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -0
  412. package/lib/typescript/steps/TaxInfoStep.d.ts +19 -0
  413. package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -0
  414. package/lib/typescript/steps/TermsAndConditionsStep.d.ts +21 -0
  415. package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -0
  416. package/lib/typescript/steps/_shared.d.ts +22 -0
  417. package/lib/typescript/steps/_shared.d.ts.map +1 -0
  418. package/lib/typescript/steps/types.d.ts +89 -0
  419. package/lib/typescript/steps/types.d.ts.map +1 -0
  420. package/lib/typescript/transport/api.d.ts +35 -0
  421. package/lib/typescript/transport/api.d.ts.map +1 -0
  422. package/lib/typescript/transport/irisWebSocket.d.ts +72 -0
  423. package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -0
  424. package/lib/typescript/transport/secureUrl.d.ts +14 -0
  425. package/lib/typescript/transport/secureUrl.d.ts.map +1 -0
  426. package/lib/typescript/transport/sse.d.ts +54 -0
  427. package/lib/typescript/transport/sse.d.ts.map +1 -0
  428. package/lib/typescript/types/index.d.ts +1219 -0
  429. package/lib/typescript/types/index.d.ts.map +1 -0
  430. package/lib/typescript/ui/MapFallbackBoundary.d.ts +28 -0
  431. package/lib/typescript/ui/MapFallbackBoundary.d.ts.map +1 -0
  432. package/lib/typescript/ui/StepShell.d.ts +29 -0
  433. package/lib/typescript/ui/StepShell.d.ts.map +1 -0
  434. package/lib/typescript/ui/VelionOnboardingScreen.d.ts +26 -0
  435. package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -0
  436. package/lib/typescript/ui/forms/index.d.ts +3 -0
  437. package/lib/typescript/ui/forms/index.d.ts.map +1 -0
  438. package/lib/typescript/ui/forms/useInlineValidation.d.ts +30 -0
  439. package/lib/typescript/ui/forms/useInlineValidation.d.ts.map +1 -0
  440. package/lib/typescript/ui/forms/validators.d.ts +11 -0
  441. package/lib/typescript/ui/forms/validators.d.ts.map +1 -0
  442. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts +14 -0
  443. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts.map +1 -0
  444. package/lib/typescript/ui/icons/StepIcon.d.ts +26 -0
  445. package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -0
  446. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts +24 -0
  447. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts.map +1 -0
  448. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts +19 -0
  449. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts.map +1 -0
  450. package/lib/typescript/ui/overlays/ProgressBar.d.ts +32 -0
  451. package/lib/typescript/ui/overlays/ProgressBar.d.ts.map +1 -0
  452. package/lib/typescript/ui/overlays/RetryDialog.d.ts +17 -0
  453. package/lib/typescript/ui/overlays/RetryDialog.d.ts.map +1 -0
  454. package/lib/typescript/ui/overlays/index.d.ts +4 -0
  455. package/lib/typescript/ui/overlays/index.d.ts.map +1 -0
  456. package/lib/typescript/ui/primitives/BackButton.d.ts +20 -0
  457. package/lib/typescript/ui/primitives/BackButton.d.ts.map +1 -0
  458. package/lib/typescript/ui/primitives/Banner.d.ts +11 -0
  459. package/lib/typescript/ui/primitives/Banner.d.ts.map +1 -0
  460. package/lib/typescript/ui/primitives/Button.d.ts +27 -0
  461. package/lib/typescript/ui/primitives/Button.d.ts.map +1 -0
  462. package/lib/typescript/ui/primitives/Card.d.ts +10 -0
  463. package/lib/typescript/ui/primitives/Card.d.ts.map +1 -0
  464. package/lib/typescript/ui/primitives/Checkbox.d.ts +25 -0
  465. package/lib/typescript/ui/primitives/Checkbox.d.ts.map +1 -0
  466. package/lib/typescript/ui/primitives/CountrySelect.d.ts +31 -0
  467. package/lib/typescript/ui/primitives/CountrySelect.d.ts.map +1 -0
  468. package/lib/typescript/ui/primitives/DatePicker.d.ts +42 -0
  469. package/lib/typescript/ui/primitives/DatePicker.d.ts.map +1 -0
  470. package/lib/typescript/ui/primitives/Input.d.ts +17 -0
  471. package/lib/typescript/ui/primitives/Input.d.ts.map +1 -0
  472. package/lib/typescript/ui/primitives/SearchableSingleSelectList.d.ts +33 -0
  473. package/lib/typescript/ui/primitives/SearchableSingleSelectList.d.ts.map +1 -0
  474. package/lib/typescript/ui/primitives/Select.d.ts +26 -0
  475. package/lib/typescript/ui/primitives/Select.d.ts.map +1 -0
  476. package/lib/typescript/ui/primitives/Spinner.d.ts +10 -0
  477. package/lib/typescript/ui/primitives/Spinner.d.ts.map +1 -0
  478. package/lib/typescript/ui/primitives/index.d.ts +12 -0
  479. package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
  480. package/lib/typescript/ui/primitives/searchableSingleSelectFilter.d.ts +25 -0
  481. package/lib/typescript/ui/primitives/searchableSingleSelectFilter.d.ts.map +1 -0
  482. package/lib/typescript/ui/theme/ThemeProvider.d.ts +23 -0
  483. package/lib/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
  484. package/lib/typescript/ui/theme/index.d.ts +3 -0
  485. package/lib/typescript/ui/theme/index.d.ts.map +1 -0
  486. package/lib/typescript/ui/theme/tokens.d.ts +42 -0
  487. package/lib/typescript/ui/theme/tokens.d.ts.map +1 -0
  488. package/lib/typescript/utils/EventEmitter.d.ts +98 -0
  489. package/lib/typescript/utils/EventEmitter.d.ts.map +1 -0
  490. package/lib/typescript/utils/base64.d.ts +19 -0
  491. package/lib/typescript/utils/base64.d.ts.map +1 -0
  492. package/lib/typescript/utils/deviceFingerprint.d.ts +42 -0
  493. package/lib/typescript/utils/deviceFingerprint.d.ts.map +1 -0
  494. package/lib/typescript/utils/documentTypeOptions.d.ts +13 -0
  495. package/lib/typescript/utils/documentTypeOptions.d.ts.map +1 -0
  496. package/lib/typescript/utils/googleMapsPreflight.d.ts +52 -0
  497. package/lib/typescript/utils/googleMapsPreflight.d.ts.map +1 -0
  498. package/lib/typescript/utils/hmac.d.ts +39 -0
  499. package/lib/typescript/utils/hmac.d.ts.map +1 -0
  500. package/lib/typescript/utils/iso3166Countries.d.ts +27 -0
  501. package/lib/typescript/utils/iso3166Countries.d.ts.map +1 -0
  502. package/lib/typescript/utils/jpegFromUri.d.ts +29 -0
  503. package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -0
  504. package/lib/typescript/utils/keepAwake.d.ts +16 -0
  505. package/lib/typescript/utils/keepAwake.d.ts.map +1 -0
  506. package/lib/typescript/utils/log.d.ts +18 -0
  507. package/lib/typescript/utils/log.d.ts.map +1 -0
  508. package/lib/typescript/utils/osGeocoder.d.ts +38 -0
  509. package/lib/typescript/utils/osGeocoder.d.ts.map +1 -0
  510. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts +43 -0
  511. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts.map +1 -0
  512. package/lib/typescript/utils/personNameNormalize.d.ts +10 -0
  513. package/lib/typescript/utils/personNameNormalize.d.ts.map +1 -0
  514. package/lib/typescript/utils/sdkError.d.ts +14 -0
  515. package/lib/typescript/utils/sdkError.d.ts.map +1 -0
  516. package/lib/typescript/utils/sdkVersion.d.ts +7 -0
  517. package/lib/typescript/utils/sdkVersion.d.ts.map +1 -0
  518. package/lib/typescript/utils/stepConfig.d.ts +8 -0
  519. package/lib/typescript/utils/stepConfig.d.ts.map +1 -0
  520. package/lib/typescript/utils/taxInfoConfig.d.ts +7 -0
  521. package/lib/typescript/utils/taxInfoConfig.d.ts.map +1 -0
  522. package/lib/typescript/utils/useSafeAreaInsets.d.ts +26 -0
  523. package/lib/typescript/utils/useSafeAreaInsets.d.ts.map +1 -0
  524. package/lib/typescript/utils/velionExtra.d.ts +24 -0
  525. package/lib/typescript/utils/velionExtra.d.ts.map +1 -0
  526. package/package.json +107 -0
  527. package/src/camera/AddressSearchBar.tsx +363 -0
  528. package/src/camera/DocumentCapture.tsx +514 -0
  529. package/src/camera/LivenessCamera.tsx +706 -0
  530. package/src/camera/MapAddressPicker.tsx +391 -0
  531. package/src/core/VelionOnboarding.ts +1291 -0
  532. package/src/core/retryStepCopy.ts +54 -0
  533. package/src/core/routingCommands.ts +63 -0
  534. package/src/core/sessionDeclinedCopy.ts +76 -0
  535. package/src/core/sessionStateMapper.ts +232 -0
  536. package/src/core/sseReasonMessages.ts +531 -0
  537. package/src/data/iso3166Alpha2Codes.json +1 -0
  538. package/src/data/iso3166CountryNames.json +251 -0
  539. package/src/i18n/index.ts +26 -0
  540. package/src/i18n/strings/en.ts +335 -0
  541. package/src/i18n/strings/es.ts +337 -0
  542. package/src/index.ts +146 -0
  543. package/src/steps/AddressInfoStep.tsx +744 -0
  544. package/src/steps/DocumentsOcrStep.tsx +481 -0
  545. package/src/steps/EconomicActivityStep.tsx +230 -0
  546. package/src/steps/EmailContactStep.tsx +165 -0
  547. package/src/steps/EmailOtpStep.tsx +256 -0
  548. package/src/steps/FaceMatchStep.tsx +176 -0
  549. package/src/steps/FingerprintStep.tsx +99 -0
  550. package/src/steps/HumanBasicInfoStep.tsx +286 -0
  551. package/src/steps/HumanExtendedInfoStep.tsx +362 -0
  552. package/src/steps/LegalBasicInfoStep.tsx +214 -0
  553. package/src/steps/LegalExtendedInfoStep.tsx +184 -0
  554. package/src/steps/LivenessMatchStep.tsx +1351 -0
  555. package/src/steps/PhoneContactStep.tsx +166 -0
  556. package/src/steps/PhoneOtpStep.tsx +255 -0
  557. package/src/steps/SwornDeclarationStep.tsx +237 -0
  558. package/src/steps/TaxInfoStep.tsx +288 -0
  559. package/src/steps/TermsAndConditionsStep.tsx +269 -0
  560. package/src/steps/_shared.ts +69 -0
  561. package/src/steps/types.ts +93 -0
  562. package/src/transport/api.ts +257 -0
  563. package/src/transport/irisWebSocket.ts +186 -0
  564. package/src/transport/secureUrl.ts +47 -0
  565. package/src/transport/sse.ts +310 -0
  566. package/src/types/index.ts +1421 -0
  567. package/src/ui/MapFallbackBoundary.tsx +46 -0
  568. package/src/ui/StepShell.tsx +273 -0
  569. package/src/ui/VelionOnboardingScreen.tsx +297 -0
  570. package/src/ui/forms/index.ts +12 -0
  571. package/src/ui/forms/useInlineValidation.ts +115 -0
  572. package/src/ui/forms/validators.ts +29 -0
  573. package/src/ui/icons/HomeHeartIcon.tsx +34 -0
  574. package/src/ui/icons/StepIcon.tsx +78 -0
  575. package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
  576. package/src/ui/overlays/LoadingOverlay.tsx +115 -0
  577. package/src/ui/overlays/ProgressBar.tsx +106 -0
  578. package/src/ui/overlays/RetryDialog.tsx +128 -0
  579. package/src/ui/overlays/index.ts +3 -0
  580. package/src/ui/primitives/BackButton.tsx +65 -0
  581. package/src/ui/primitives/Banner.tsx +81 -0
  582. package/src/ui/primitives/Button.tsx +164 -0
  583. package/src/ui/primitives/Card.tsx +55 -0
  584. package/src/ui/primitives/Checkbox.tsx +153 -0
  585. package/src/ui/primitives/CountrySelect.tsx +356 -0
  586. package/src/ui/primitives/DatePicker.tsx +266 -0
  587. package/src/ui/primitives/Input.tsx +110 -0
  588. package/src/ui/primitives/SearchableSingleSelectList.tsx +195 -0
  589. package/src/ui/primitives/Select.tsx +259 -0
  590. package/src/ui/primitives/Spinner.tsx +17 -0
  591. package/src/ui/primitives/index.ts +16 -0
  592. package/src/ui/primitives/searchableSingleSelectFilter.ts +38 -0
  593. package/src/ui/theme/ThemeProvider.tsx +102 -0
  594. package/src/ui/theme/index.ts +17 -0
  595. package/src/ui/theme/tokens.ts +159 -0
  596. package/src/utils/EventEmitter.ts +155 -0
  597. package/src/utils/base64.ts +44 -0
  598. package/src/utils/deviceFingerprint.ts +184 -0
  599. package/src/utils/documentTypeOptions.ts +31 -0
  600. package/src/utils/googleMapsPreflight.ts +89 -0
  601. package/src/utils/hmac.ts +61 -0
  602. package/src/utils/iso3166Countries.ts +111 -0
  603. package/src/utils/jpegFromUri.ts +42 -0
  604. package/src/utils/keepAwake.ts +62 -0
  605. package/src/utils/log.ts +37 -0
  606. package/src/utils/osGeocoder.ts +75 -0
  607. package/src/utils/parseGoogleAddressComponents.ts +123 -0
  608. package/src/utils/personNameNormalize.ts +17 -0
  609. package/src/utils/sdkError.ts +40 -0
  610. package/src/utils/sdkVersion.ts +6 -0
  611. package/src/utils/stepConfig.ts +75 -0
  612. package/src/utils/taxInfoConfig.ts +14 -0
  613. package/src/utils/useSafeAreaInsets.ts +37 -0
  614. package/src/utils/velionExtra.ts +46 -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,273 @@
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 { useRef } from 'react';
11
+ import {
12
+ Animated,
13
+ KeyboardAvoidingView,
14
+ Platform,
15
+ StyleSheet,
16
+ Text,
17
+ View,
18
+ } from 'react-native';
19
+ import Svg, {
20
+ Defs,
21
+ LinearGradient as SvgLinearGradient,
22
+ Rect,
23
+ Stop,
24
+ } from 'react-native-svg';
25
+ import { useTheme, withAlpha } from './theme';
26
+ import { BackButton } from './primitives/BackButton';
27
+ import { PROGRESS_BAR_HEIGHT } from './overlays/ProgressBar';
28
+ import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
29
+
30
+ export interface StepShellProps {
31
+ title: string;
32
+ subtitle?: string | undefined;
33
+ /** Optional icon-bearing element (e.g. SVG). Falls back to a colored disc. */
34
+ iconNode?: ReactNode | undefined;
35
+ children: ReactNode;
36
+ /** When true, the body is wrapped in a `KeyboardAvoidingView` (form-friendly). */
37
+ avoidKeyboard?: boolean | undefined;
38
+ /**
39
+ * When provided, renders a top-left "back" (chevron) control. Only reversible
40
+ * steps wire this — the orchestrator decides based on the backend's
41
+ * `reversible` flag, so non-reversible steps simply omit it.
42
+ */
43
+ onBack?: (() => void) | undefined;
44
+ /** Label for the back control (localized). Defaults are provided by callers. */
45
+ backLabel?: string | undefined;
46
+ /** Disables the back control (e.g. while a back request is already in flight). */
47
+ backDisabled?: boolean | undefined;
48
+ }
49
+
50
+ export function StepShell({
51
+ title,
52
+ subtitle,
53
+ iconNode,
54
+ children,
55
+ avoidKeyboard = true,
56
+ onBack,
57
+ backLabel = 'Atrás',
58
+ backDisabled = false,
59
+ }: StepShellProps) {
60
+ const theme = useTheme();
61
+ const insets = useSafeAreaInsets();
62
+
63
+ const showIconCircle = !theme.hideStepIcons && iconNode != null;
64
+ const showBack = onBack != null;
65
+
66
+ // Drive the top-fade opacity from the scroll offset so the gradient is fully
67
+ // invisible at rest (scrollY = 0) — the header/icon reads crisp — and only
68
+ // ramps in as the content scrolls up under the fixed back strip (OSDKR-12).
69
+ const scrollY = useRef(new Animated.Value(0)).current;
70
+ const fadeOpacity = scrollY.interpolate({
71
+ inputRange: [0, FADE_RAMP_DISTANCE],
72
+ outputRange: [0, 1],
73
+ extrapolate: 'clamp',
74
+ });
75
+
76
+ const scroll = (
77
+ <Animated.ScrollView
78
+ style={styles.scroll}
79
+ scrollEventThrottle={16}
80
+ onScroll={Animated.event(
81
+ [{ nativeEvent: { contentOffset: { y: scrollY } } }],
82
+ { useNativeDriver: true },
83
+ )}
84
+ // When the fixed back strip is present it already clears the status bar +
85
+ // progress bar, so the scroll body only needs its base top padding.
86
+ // Without it, add the device safe-area insets so the header (icon + title)
87
+ // clears the top camera / notch. The bottom inset always clears the
88
+ // navigation bar / gesture area on edge-to-edge Android and on iOS devices
89
+ // with a home indicator.
90
+ contentContainerStyle={[
91
+ styles.scrollBody,
92
+ {
93
+ paddingTop: showBack ? BASE_PADDING_TOP : BASE_PADDING_TOP + insets.top,
94
+ paddingBottom: BASE_PADDING_BOTTOM + insets.bottom,
95
+ },
96
+ ]}
97
+ keyboardShouldPersistTaps="handled"
98
+ >
99
+ <View style={styles.header}>
100
+ {showIconCircle ? (
101
+ <View
102
+ style={[
103
+ styles.iconCircle,
104
+ {
105
+ backgroundColor: theme.primaryColor,
106
+ shadowColor: withAlpha(theme.primaryColor, 0.5),
107
+ },
108
+ ]}
109
+ accessibilityElementsHidden
110
+ importantForAccessibility="no"
111
+ >
112
+ {iconNode}
113
+ </View>
114
+ ) : null}
115
+ <Text style={[styles.title, { color: theme.textColor }]}>{title}</Text>
116
+ {subtitle ? (
117
+ <Text
118
+ style={[styles.subtitle, { color: theme.textSecondaryColor }]}
119
+ >
120
+ {subtitle}
121
+ </Text>
122
+ ) : null}
123
+ </View>
124
+ <View style={styles.column}>{children}</View>
125
+ </Animated.ScrollView>
126
+ );
127
+
128
+ // The back control lives in a fixed strip OUTSIDE the ScrollView so it stays
129
+ // pinned just below the (fixed) ProgressBar while the form scrolls behind it.
130
+ // `paddingTop` clears the status-bar / notch inset plus the progress bar's
131
+ // own height so "Atrás" never tucks under the bar (OSDKR-12).
132
+ const body = (
133
+ <View style={styles.flex}>
134
+ {showBack ? (
135
+ <View
136
+ style={[
137
+ styles.backStrip,
138
+ { paddingTop: insets.top + PROGRESS_BAR_HEIGHT },
139
+ ]}
140
+ >
141
+ <BackButton
142
+ label={backLabel}
143
+ onPress={onBack}
144
+ disabled={backDisabled}
145
+ />
146
+ </View>
147
+ ) : null}
148
+ <View style={styles.scrollWrap}>
149
+ {scroll}
150
+ {/* Soft top fade: the ScrollView hard-clips content at its top edge,
151
+ which reads as an abrupt cut as the header scrolls up under the
152
+ fixed back strip. A short background-to-transparent gradient lets
153
+ the content dissolve instead (OSDKR-12). Its opacity is tied to the
154
+ scroll offset so it stays invisible at rest and only appears once
155
+ the user scrolls. pointerEvents="none" so it never intercepts
156
+ touches / scroll. */}
157
+ <Animated.View
158
+ pointerEvents="none"
159
+ style={[styles.topFade, { height: TOP_FADE_HEIGHT, opacity: fadeOpacity }]}
160
+ >
161
+ <Svg width="100%" height="100%">
162
+ <Defs>
163
+ <SvgLinearGradient id="stepTopFade" x1="0" y1="0" x2="0" y2="1">
164
+ {/* Eased falloff (not linear): opaque near the top, then a long
165
+ gentle tail toward transparent, so the dissolve has no
166
+ perceptible edge. */}
167
+ <Stop offset="0" stopColor={theme.backgroundColor} stopOpacity={1} />
168
+ <Stop offset="0.35" stopColor={theme.backgroundColor} stopOpacity={0.85} />
169
+ <Stop offset="0.6" stopColor={theme.backgroundColor} stopOpacity={0.5} />
170
+ <Stop offset="0.82" stopColor={theme.backgroundColor} stopOpacity={0.18} />
171
+ <Stop offset="1" stopColor={theme.backgroundColor} stopOpacity={0} />
172
+ </SvgLinearGradient>
173
+ </Defs>
174
+ <Rect
175
+ x="0"
176
+ y="0"
177
+ width="100%"
178
+ height="100%"
179
+ fill="url(#stepTopFade)"
180
+ />
181
+ </Svg>
182
+ </Animated.View>
183
+ </View>
184
+ </View>
185
+ );
186
+
187
+ if (avoidKeyboard) {
188
+ return (
189
+ <KeyboardAvoidingView
190
+ style={styles.flex}
191
+ behavior={Platform.OS === 'ios' ? 'padding' : undefined}
192
+ >
193
+ {body}
194
+ </KeyboardAvoidingView>
195
+ );
196
+ }
197
+ return body;
198
+ }
199
+
200
+ // Base vertical padding for the scroll body. Safe-area insets are added on top
201
+ // of these at render time (see `contentContainerStyle` above).
202
+ const BASE_PADDING_TOP = 12;
203
+ const BASE_PADDING_BOTTOM = 28;
204
+ // Height of the background-to-transparent gradient masking the ScrollView's
205
+ // top clip edge. Tall on purpose: a long band makes the dissolve a gradual
206
+ // transition rather than a visible line.
207
+ const TOP_FADE_HEIGHT = 120;
208
+ // Scroll distance (px) over which the fade ramps from invisible (at rest) to
209
+ // fully active. Decoupled from TOP_FADE_HEIGHT so the long gradient still kicks
210
+ // in promptly as the user starts scrolling.
211
+ const FADE_RAMP_DISTANCE = 36;
212
+
213
+ const styles = StyleSheet.create({
214
+ flex: {
215
+ flex: 1,
216
+ },
217
+ scroll: {
218
+ flex: 1,
219
+ },
220
+ scrollWrap: {
221
+ flex: 1,
222
+ },
223
+ topFade: {
224
+ position: 'absolute',
225
+ top: 0,
226
+ left: 0,
227
+ right: 0,
228
+ },
229
+ backStrip: {
230
+ paddingHorizontal: 18,
231
+ },
232
+ scrollBody: {
233
+ paddingHorizontal: 18,
234
+ paddingTop: BASE_PADDING_TOP,
235
+ paddingBottom: BASE_PADDING_BOTTOM,
236
+ },
237
+ header: {
238
+ alignItems: 'center',
239
+ marginBottom: 14,
240
+ },
241
+ iconCircle: {
242
+ width: 56,
243
+ height: 56,
244
+ borderRadius: 28,
245
+ marginBottom: 10,
246
+ alignItems: 'center',
247
+ justifyContent: 'center',
248
+ shadowOpacity: 0.25,
249
+ shadowRadius: 8,
250
+ shadowOffset: { width: 0, height: 3 },
251
+ elevation: 3,
252
+ },
253
+ title: {
254
+ fontSize: 20,
255
+ fontWeight: '700',
256
+ letterSpacing: -0.3,
257
+ textAlign: 'center',
258
+ },
259
+ subtitle: {
260
+ marginTop: 6,
261
+ fontSize: 14,
262
+ fontWeight: '400',
263
+ textAlign: 'center',
264
+ lineHeight: 20,
265
+ maxWidth: 320,
266
+ },
267
+ column: {
268
+ width: '100%',
269
+ maxWidth: 360,
270
+ alignSelf: 'center',
271
+ gap: 10,
272
+ },
273
+ });
@@ -0,0 +1,297 @@
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 {
21
+ OnboardingExit,
22
+ OnboardingResult,
23
+ OnboardingStep,
24
+ SdkError,
25
+ } from '../types';
26
+ import { ThemeProvider, useTheme } from './theme';
27
+ import { LoadingOverlay } from './overlays/LoadingOverlay';
28
+ import { PROGRESS_BAR, ProgressBar } from './overlays/ProgressBar';
29
+ import { getStrings } from '../i18n';
30
+ import {
31
+ activateScreenKeepAwake,
32
+ deactivateScreenKeepAwake,
33
+ } from '../utils/keepAwake';
34
+ import { useSafeAreaInsets } from '../utils/useSafeAreaInsets';
35
+
36
+ /**
37
+ * Mounts `react-native-safe-area-context`'s `SafeAreaProvider` so descendant
38
+ * `useSafeAreaInsets()` calls resolve real device insets (notch / nav bar). The
39
+ * library is loaded dynamically with a fail-safe: hosts that strip it (or that
40
+ * already mount their own provider higher up) still render — a nested provider
41
+ * returns correct insets, and a missing module degrades to zero insets.
42
+ */
43
+ function SafeAreaBoundary({ children }: { children: ReactNode }) {
44
+ try {
45
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
46
+ const mod = require('react-native-safe-area-context');
47
+ const Provider = mod.SafeAreaProvider;
48
+ return (
49
+ <Provider initialMetrics={mod.initialWindowMetrics}>{children}</Provider>
50
+ );
51
+ } catch {
52
+ return <>{children}</>;
53
+ }
54
+ }
55
+
56
+ export interface VelionOnboardingScreenProps {
57
+ config: VelionConfig;
58
+ onComplete?: ((result: OnboardingResult) => void) | undefined;
59
+ onFail?: ((err: SdkError) => void) | undefined;
60
+ /**
61
+ * Fires when the user leaves the flow without a verdict — they tapped "back"
62
+ * on the first reversible step (`BACK_EXIT`). The SDK has cleared its UI; the
63
+ * host should dismiss/unmount this screen and return the user to the previous
64
+ * context. Mirrors `VelionConfig.onExit`.
65
+ */
66
+ onExit?: ((exit: OnboardingExit) => void) | undefined;
67
+ }
68
+
69
+ interface ViewState {
70
+ loading: string | null;
71
+ stepNode: ReactNode | null;
72
+ error: SdkError | null;
73
+ result: OnboardingResult | null;
74
+ /** Set once the user backed out of the first step; renders a blank surface. */
75
+ exited: boolean;
76
+ }
77
+
78
+ const INITIAL_STATE: ViewState = {
79
+ loading: null,
80
+ stepNode: null,
81
+ error: null,
82
+ result: null,
83
+ exited: false,
84
+ };
85
+
86
+ export function VelionOnboardingScreen({
87
+ config,
88
+ onComplete,
89
+ onFail,
90
+ onExit,
91
+ }: VelionOnboardingScreenProps) {
92
+ return (
93
+ <SafeAreaBoundary>
94
+ <ThemeProvider
95
+ themeOverrides={config.theme}
96
+ colorMode={config.colorMode ?? 'auto'}
97
+ >
98
+ <VelionOnboardingInner
99
+ config={config}
100
+ onComplete={onComplete}
101
+ onFail={onFail}
102
+ onExit={onExit}
103
+ />
104
+ </ThemeProvider>
105
+ </SafeAreaBoundary>
106
+ );
107
+ }
108
+
109
+ function VelionOnboardingInner({
110
+ config,
111
+ onComplete,
112
+ onFail,
113
+ onExit,
114
+ }: VelionOnboardingScreenProps) {
115
+ const theme = useTheme();
116
+ const insets = useSafeAreaInsets();
117
+ const t = getStrings(config.locale);
118
+ const [state, setState] = useState<ViewState>(INITIAL_STATE);
119
+ const [progress, setProgress] = useState(0);
120
+ const [progressHidden, setProgressHidden] = useState(false);
121
+
122
+ const sdk = useMemo(
123
+ () => new VelionOnboarding(config),
124
+ // Recreate the SDK only when the session changes — host must keep
125
+ // callbacks stable (or wrap them in refs).
126
+ // eslint-disable-next-line react-hooks/exhaustive-deps
127
+ [config.sessionId, config.apiUrl],
128
+ );
129
+ const sdkRef = useRef(sdk);
130
+ sdkRef.current = sdk;
131
+
132
+ const onCompleteRef = useRef(onComplete);
133
+ const onFailRef = useRef(onFail);
134
+ const onExitRef = useRef(onExit);
135
+ onCompleteRef.current = onComplete;
136
+ onFailRef.current = onFail;
137
+ onExitRef.current = onExit;
138
+
139
+ useEffect(() => {
140
+ // Hold a wake lock for the full duration of the flow. Camera-heavy steps
141
+ // (LIVENESS_MATCH, DOCUMENTS_OCR) involve the user holding still, so the
142
+ // OS screen-timeout would otherwise dim and lock the device mid-session.
143
+ activateScreenKeepAwake();
144
+
145
+ sdk.attachView({
146
+ setLoading: (text) => setState((s) => ({ ...s, loading: text })),
147
+ setStepNode: (node) => setState((s) => ({ ...s, stepNode: node })),
148
+ setError: (err) => {
149
+ setState((s) => ({ ...s, error: err, loading: null, stepNode: null }));
150
+ setProgressHidden(true);
151
+ onFailRef.current?.(err);
152
+ },
153
+ setResult: (result) => {
154
+ setState((s) => ({ ...s, result, loading: null, stepNode: null }));
155
+ setProgress(PROGRESS_BAR.complete());
156
+ // Fade after a small delay so the "100%" jump is visible.
157
+ setTimeout(() => setProgressHidden(true), 400);
158
+ onCompleteRef.current?.(result);
159
+ },
160
+ setExit: (exit) => {
161
+ // User backed out of the first step: blank the surface (no overlay, no
162
+ // result) and let the host dismiss the screen via onExit.
163
+ setState((s) => ({
164
+ ...s,
165
+ exited: true,
166
+ loading: null,
167
+ stepNode: null,
168
+ error: null,
169
+ result: null,
170
+ }));
171
+ setProgressHidden(true);
172
+ onExitRef.current?.(exit);
173
+ },
174
+ });
175
+
176
+ const unsubStepChange = sdk.on('step:change', () => {
177
+ setProgress((curr) => PROGRESS_BAR.tick(curr));
178
+ });
179
+
180
+ void sdk.start();
181
+
182
+ return () => {
183
+ unsubStepChange();
184
+ sdk.detachView();
185
+ sdk.destroy();
186
+ deactivateScreenKeepAwake();
187
+ };
188
+ }, [sdk]);
189
+
190
+ const renderBody = useCallback((): ReactNode => {
191
+ if (state.error) {
192
+ return (
193
+ <View style={styles.message}>
194
+ <Text style={[styles.title, { color: theme.errorColor }]}>
195
+ {state.error.declineTitle ?? t.result.declineHeadline}
196
+ </Text>
197
+ <Text style={[styles.body, { color: theme.textColor }]}>
198
+ {state.error.declineMessage ?? state.error.message}
199
+ </Text>
200
+ </View>
201
+ );
202
+ }
203
+ if (state.result) {
204
+ const status = state.result.status;
205
+ let title = t.result.approvedTitle;
206
+ let body = t.result.approvedBody;
207
+ if (status === 'MANUAL_REVIEW') {
208
+ title = t.result.manualReviewTitle;
209
+ body = t.result.manualReviewBody;
210
+ } else if (status === 'REJECTED' || status === 'DECLINED') {
211
+ title = t.result.rejectedTitle;
212
+ body = t.result.rejectedBody;
213
+ }
214
+ return (
215
+ <View style={styles.message}>
216
+ <Text style={[styles.title, { color: theme.textColor }]}>{title}</Text>
217
+ <Text style={[styles.body, { color: theme.textSecondaryColor }]}>
218
+ {body}
219
+ </Text>
220
+ </View>
221
+ );
222
+ }
223
+ if (state.stepNode) {
224
+ return state.stepNode;
225
+ }
226
+ return null;
227
+ }, [state, theme, t]);
228
+
229
+ const showLoadingOverlay =
230
+ !state.error && !state.result && !state.stepNode && !state.exited;
231
+ const loadingText = state.loading ?? t.common.loading;
232
+ // Progress bar is shown unless EITHER `config.showProgressBar === false`
233
+ // OR `theme.hideProgressBar === true`. Both paths exist for parity with
234
+ // `hideStepIcons` (theme-side) and for hosts that already wire the
235
+ // legacy `showProgressBar` flag (config-side).
236
+ const showProgress =
237
+ config.showProgressBar !== false && !theme.hideProgressBar;
238
+
239
+ return (
240
+ <View style={[styles.root, { backgroundColor: theme.backgroundColor }]}>
241
+ {/* Content fills the screen edge-to-edge so camera / map steps stay
242
+ full-bleed. The progress bar floats on top, pushed below the top
243
+ safe-area inset (status bar / notch / punch-hole). Form steps offset
244
+ their own header via StepShell, and camera steps offset their chrome
245
+ internally — so we never inset the content container here. */}
246
+ <View style={styles.content}>{renderBody()}</View>
247
+ {showProgress ? (
248
+ <View
249
+ pointerEvents="none"
250
+ style={[styles.progressOverlay, { paddingTop: insets.top }]}
251
+ >
252
+ <ProgressBar value={progress} hidden={progressHidden} />
253
+ </View>
254
+ ) : null}
255
+ {showLoadingOverlay ? <LoadingOverlay message={loadingText} /> : null}
256
+ </View>
257
+ );
258
+ }
259
+
260
+ const styles = StyleSheet.create({
261
+ root: {
262
+ flex: 1,
263
+ },
264
+ content: {
265
+ flex: 1,
266
+ overflow: 'hidden',
267
+ },
268
+ progressOverlay: {
269
+ position: 'absolute',
270
+ top: 0,
271
+ left: 0,
272
+ right: 0,
273
+ },
274
+ message: {
275
+ flex: 1,
276
+ alignItems: 'center',
277
+ justifyContent: 'center',
278
+ paddingHorizontal: 24,
279
+ gap: 12,
280
+ },
281
+ title: {
282
+ fontSize: 20,
283
+ fontWeight: '600',
284
+ textAlign: 'center',
285
+ },
286
+ body: {
287
+ fontSize: 15,
288
+ lineHeight: 22,
289
+ textAlign: 'center',
290
+ maxWidth: 360,
291
+ },
292
+ });
293
+
294
+ // Type tag used so consumers can identify the step that triggered an event.
295
+ // Currently unused but kept here so future adapters (e.g. analytics wrappers)
296
+ // can hook into orchestrator events without re-exporting types.
297
+ export type { OnboardingStep };
@@ -0,0 +1,12 @@
1
+ export {
2
+ useInlineValidation,
3
+ type FieldRule,
4
+ type InlineValidationHandle,
5
+ } from './useInlineValidation';
6
+ export {
7
+ required,
8
+ minLength,
9
+ pattern,
10
+ compose,
11
+ type FieldValidator,
12
+ } from './validators';