@velion-la/onboarding-sdk-react-native 1.0.0-beta.5 → 1.0.0-beta.7

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 (182) hide show
  1. package/README.md +85 -0
  2. package/lib/commonjs/core/VelionOnboarding.js +296 -15
  3. package/lib/commonjs/core/VelionOnboarding.js.map +1 -1
  4. package/lib/commonjs/core/retryStepCopy.js +43 -0
  5. package/lib/commonjs/core/retryStepCopy.js.map +1 -0
  6. package/lib/commonjs/core/routingCommands.js +62 -0
  7. package/lib/commonjs/core/routingCommands.js.map +1 -0
  8. package/lib/commonjs/core/sessionStateMapper.js +63 -0
  9. package/lib/commonjs/core/sessionStateMapper.js.map +1 -1
  10. package/lib/commonjs/i18n/strings/en.js +28 -0
  11. package/lib/commonjs/i18n/strings/en.js.map +1 -1
  12. package/lib/commonjs/i18n/strings/es.js +28 -0
  13. package/lib/commonjs/i18n/strings/es.js.map +1 -1
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/steps/AddressInfoStep.js +30 -18
  16. package/lib/commonjs/steps/AddressInfoStep.js.map +1 -1
  17. package/lib/commonjs/steps/DocumentsOcrStep.js +4 -0
  18. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
  19. package/lib/commonjs/steps/EmailContactStep.js +5 -0
  20. package/lib/commonjs/steps/EmailContactStep.js.map +1 -1
  21. package/lib/commonjs/steps/EmailOtpStep.js +5 -0
  22. package/lib/commonjs/steps/EmailOtpStep.js.map +1 -1
  23. package/lib/commonjs/steps/FaceMatchStep.js +16 -13
  24. package/lib/commonjs/steps/FaceMatchStep.js.map +1 -1
  25. package/lib/commonjs/steps/HumanBasicInfoStep.js +12 -4
  26. package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -1
  27. package/lib/commonjs/steps/HumanExtendedInfoStep.js +15 -8
  28. package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -1
  29. package/lib/commonjs/steps/LegalBasicInfoStep.js +13 -6
  30. package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -1
  31. package/lib/commonjs/steps/LegalExtendedInfoStep.js +9 -2
  32. package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -1
  33. package/lib/commonjs/steps/PhoneContactStep.js +5 -0
  34. package/lib/commonjs/steps/PhoneContactStep.js.map +1 -1
  35. package/lib/commonjs/steps/PhoneOtpStep.js +5 -0
  36. package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -1
  37. package/lib/commonjs/steps/SwornDeclarationStep.js +16 -6
  38. package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -1
  39. package/lib/commonjs/steps/TaxInfoStep.js +10 -3
  40. package/lib/commonjs/steps/TaxInfoStep.js.map +1 -1
  41. package/lib/commonjs/steps/TermsAndConditionsStep.js +7 -0
  42. package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -1
  43. package/lib/commonjs/steps/_shared.js +21 -0
  44. package/lib/commonjs/steps/_shared.js.map +1 -1
  45. package/lib/commonjs/types/index.js +36 -1
  46. package/lib/commonjs/types/index.js.map +1 -1
  47. package/lib/commonjs/ui/StepShell.js +10 -2
  48. package/lib/commonjs/ui/StepShell.js.map +1 -1
  49. package/lib/commonjs/ui/VelionOnboardingScreen.js +25 -5
  50. package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -1
  51. package/lib/commonjs/ui/icons/StepIcon.js.map +1 -1
  52. package/lib/commonjs/ui/primitives/BackButton.js +75 -0
  53. package/lib/commonjs/ui/primitives/BackButton.js.map +1 -0
  54. package/lib/commonjs/ui/primitives/index.js +7 -0
  55. package/lib/commonjs/ui/primitives/index.js.map +1 -1
  56. package/lib/module/core/VelionOnboarding.js +297 -16
  57. package/lib/module/core/VelionOnboarding.js.map +1 -1
  58. package/lib/module/core/retryStepCopy.js +39 -0
  59. package/lib/module/core/retryStepCopy.js.map +1 -0
  60. package/lib/module/core/routingCommands.js +57 -0
  61. package/lib/module/core/routingCommands.js.map +1 -0
  62. package/lib/module/core/sessionStateMapper.js +61 -0
  63. package/lib/module/core/sessionStateMapper.js.map +1 -1
  64. package/lib/module/i18n/strings/en.js +28 -0
  65. package/lib/module/i18n/strings/en.js.map +1 -1
  66. package/lib/module/i18n/strings/es.js +28 -0
  67. package/lib/module/i18n/strings/es.js.map +1 -1
  68. package/lib/module/index.js.map +1 -1
  69. package/lib/module/steps/AddressInfoStep.js +31 -19
  70. package/lib/module/steps/AddressInfoStep.js.map +1 -1
  71. package/lib/module/steps/DocumentsOcrStep.js +4 -0
  72. package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
  73. package/lib/module/steps/EmailContactStep.js +5 -0
  74. package/lib/module/steps/EmailContactStep.js.map +1 -1
  75. package/lib/module/steps/EmailOtpStep.js +5 -0
  76. package/lib/module/steps/EmailOtpStep.js.map +1 -1
  77. package/lib/module/steps/FaceMatchStep.js +16 -13
  78. package/lib/module/steps/FaceMatchStep.js.map +1 -1
  79. package/lib/module/steps/HumanBasicInfoStep.js +12 -4
  80. package/lib/module/steps/HumanBasicInfoStep.js.map +1 -1
  81. package/lib/module/steps/HumanExtendedInfoStep.js +16 -9
  82. package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -1
  83. package/lib/module/steps/LegalBasicInfoStep.js +14 -7
  84. package/lib/module/steps/LegalBasicInfoStep.js.map +1 -1
  85. package/lib/module/steps/LegalExtendedInfoStep.js +10 -3
  86. package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -1
  87. package/lib/module/steps/PhoneContactStep.js +5 -0
  88. package/lib/module/steps/PhoneContactStep.js.map +1 -1
  89. package/lib/module/steps/PhoneOtpStep.js +5 -0
  90. package/lib/module/steps/PhoneOtpStep.js.map +1 -1
  91. package/lib/module/steps/SwornDeclarationStep.js +18 -6
  92. package/lib/module/steps/SwornDeclarationStep.js.map +1 -1
  93. package/lib/module/steps/TaxInfoStep.js +11 -4
  94. package/lib/module/steps/TaxInfoStep.js.map +1 -1
  95. package/lib/module/steps/TermsAndConditionsStep.js +7 -0
  96. package/lib/module/steps/TermsAndConditionsStep.js.map +1 -1
  97. package/lib/module/steps/_shared.js +19 -0
  98. package/lib/module/steps/_shared.js.map +1 -1
  99. package/lib/module/types/index.js +38 -1
  100. package/lib/module/types/index.js.map +1 -1
  101. package/lib/module/ui/StepShell.js +10 -2
  102. package/lib/module/ui/StepShell.js.map +1 -1
  103. package/lib/module/ui/VelionOnboardingScreen.js +25 -5
  104. package/lib/module/ui/VelionOnboardingScreen.js.map +1 -1
  105. package/lib/module/ui/icons/StepIcon.js.map +1 -1
  106. package/lib/module/ui/primitives/BackButton.js +71 -0
  107. package/lib/module/ui/primitives/BackButton.js.map +1 -0
  108. package/lib/module/ui/primitives/index.js +1 -0
  109. package/lib/module/ui/primitives/index.js.map +1 -1
  110. package/lib/typescript/core/VelionOnboarding.d.ts +56 -2
  111. package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -1
  112. package/lib/typescript/core/retryStepCopy.d.ts +27 -0
  113. package/lib/typescript/core/retryStepCopy.d.ts.map +1 -0
  114. package/lib/typescript/core/routingCommands.d.ts +39 -0
  115. package/lib/typescript/core/routingCommands.d.ts.map +1 -0
  116. package/lib/typescript/core/sessionStateMapper.d.ts +20 -1
  117. package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -1
  118. package/lib/typescript/i18n/strings/en.d.ts.map +1 -1
  119. package/lib/typescript/i18n/strings/es.d.ts +25 -0
  120. package/lib/typescript/i18n/strings/es.d.ts.map +1 -1
  121. package/lib/typescript/index.d.ts +1 -1
  122. package/lib/typescript/index.d.ts.map +1 -1
  123. package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -1
  124. package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -1
  125. package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -1
  126. package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -1
  127. package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -1
  128. package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -1
  129. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -1
  130. package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -1
  131. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -1
  132. package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -1
  133. package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -1
  134. package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -1
  135. package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -1
  136. package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -1
  137. package/lib/typescript/steps/_shared.d.ts +11 -0
  138. package/lib/typescript/steps/_shared.d.ts.map +1 -1
  139. package/lib/typescript/steps/types.d.ts +15 -0
  140. package/lib/typescript/steps/types.d.ts.map +1 -1
  141. package/lib/typescript/types/index.d.ts +127 -5
  142. package/lib/typescript/types/index.d.ts.map +1 -1
  143. package/lib/typescript/ui/StepShell.d.ts +11 -1
  144. package/lib/typescript/ui/StepShell.d.ts.map +1 -1
  145. package/lib/typescript/ui/VelionOnboardingScreen.d.ts +9 -2
  146. package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -1
  147. package/lib/typescript/ui/icons/StepIcon.d.ts +1 -1
  148. package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -1
  149. package/lib/typescript/ui/primitives/BackButton.d.ts +20 -0
  150. package/lib/typescript/ui/primitives/BackButton.d.ts.map +1 -0
  151. package/lib/typescript/ui/primitives/index.d.ts +1 -0
  152. package/lib/typescript/ui/primitives/index.d.ts.map +1 -1
  153. package/package.json +1 -1
  154. package/src/core/VelionOnboarding.ts +315 -16
  155. package/src/core/retryStepCopy.ts +54 -0
  156. package/src/core/routingCommands.ts +63 -0
  157. package/src/core/sessionStateMapper.ts +65 -0
  158. package/src/i18n/strings/en.ts +33 -0
  159. package/src/i18n/strings/es.ts +33 -0
  160. package/src/index.ts +2 -0
  161. package/src/steps/AddressInfoStep.tsx +38 -20
  162. package/src/steps/DocumentsOcrStep.tsx +5 -0
  163. package/src/steps/EmailContactStep.tsx +6 -0
  164. package/src/steps/EmailOtpStep.tsx +6 -0
  165. package/src/steps/FaceMatchStep.tsx +18 -19
  166. package/src/steps/HumanBasicInfoStep.tsx +16 -4
  167. package/src/steps/HumanExtendedInfoStep.tsx +18 -9
  168. package/src/steps/LegalBasicInfoStep.tsx +16 -7
  169. package/src/steps/LegalExtendedInfoStep.tsx +16 -3
  170. package/src/steps/PhoneContactStep.tsx +6 -0
  171. package/src/steps/PhoneOtpStep.tsx +6 -0
  172. package/src/steps/SwornDeclarationStep.tsx +23 -6
  173. package/src/steps/TaxInfoStep.tsx +15 -4
  174. package/src/steps/TermsAndConditionsStep.tsx +8 -0
  175. package/src/steps/_shared.ts +25 -0
  176. package/src/steps/types.ts +15 -0
  177. package/src/types/index.ts +131 -3
  178. package/src/ui/StepShell.tsx +17 -0
  179. package/src/ui/VelionOnboardingScreen.tsx +36 -2
  180. package/src/ui/icons/StepIcon.tsx +2 -1
  181. package/src/ui/primitives/BackButton.tsx +65 -0
  182. package/src/ui/primitives/index.ts +1 -0
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @fileoverview BackButton — the "Atrás" / "Back" control for reversible steps.
3
+ *
4
+ * A small, top-left chevron-back pill rendered by `StepShell` only when the
5
+ * current step is reversible (the backend's `reversible` flag drives this; the
6
+ * SDK never decides reversibility on its own). Tapping it asks the orchestrator
7
+ * to navigate to the previous reversible step — the actual transition is driven
8
+ * by the backend's `ROUTING_COMMAND / PREVIOUS_STEP` over SSE.
9
+ *
10
+ * The chevron uses `MaterialIcons` (via `StepIcon`); when `@expo/vector-icons`
11
+ * is unavailable the icon falls back gracefully and only the label shows.
12
+ */
13
+
14
+ import { Pressable, StyleSheet, Text } from 'react-native';
15
+ import { useTheme, withAlpha } from '../theme';
16
+ import { StepIcon } from '../icons/StepIcon';
17
+
18
+ export interface BackButtonProps {
19
+ label: string;
20
+ onPress: () => void;
21
+ /** Disables the control (e.g. while a back request is already in flight). */
22
+ disabled?: boolean;
23
+ }
24
+
25
+ export function BackButton({ label, onPress, disabled = false }: BackButtonProps) {
26
+ const theme = useTheme();
27
+ return (
28
+ <Pressable
29
+ accessibilityRole="button"
30
+ accessibilityLabel={label}
31
+ accessibilityState={{ disabled }}
32
+ disabled={disabled}
33
+ onPress={onPress}
34
+ hitSlop={8}
35
+ style={({ pressed }) => [
36
+ styles.base,
37
+ pressed && !disabled && { backgroundColor: withAlpha(theme.textColor, 0.06) },
38
+ disabled && styles.disabled,
39
+ ]}
40
+ >
41
+ <StepIcon name="chevron-left" size={20} color={theme.textColor} />
42
+ <Text style={[styles.label, { color: theme.textColor }]}>{label}</Text>
43
+ </Pressable>
44
+ );
45
+ }
46
+
47
+ const styles = StyleSheet.create({
48
+ base: {
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ alignSelf: 'flex-start',
52
+ minHeight: 44,
53
+ paddingRight: 10,
54
+ paddingVertical: 6,
55
+ marginLeft: -4,
56
+ },
57
+ disabled: {
58
+ opacity: 0.45,
59
+ },
60
+ label: {
61
+ fontSize: 15,
62
+ fontWeight: '600',
63
+ marginLeft: 2,
64
+ },
65
+ });
@@ -1,4 +1,5 @@
1
1
  export { Button, type ButtonProps, type ButtonVariant } from './Button';
2
+ export { BackButton, type BackButtonProps } from './BackButton';
2
3
  export { Input, type InputProps } from './Input';
3
4
  export { Select, type SelectProps, type SelectOption } from './Select';
4
5
  export { Card, type CardProps } from './Card';