@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.
- package/README.md +85 -0
- package/lib/commonjs/core/VelionOnboarding.js +296 -15
- package/lib/commonjs/core/VelionOnboarding.js.map +1 -1
- package/lib/commonjs/core/retryStepCopy.js +43 -0
- package/lib/commonjs/core/retryStepCopy.js.map +1 -0
- package/lib/commonjs/core/routingCommands.js +62 -0
- package/lib/commonjs/core/routingCommands.js.map +1 -0
- package/lib/commonjs/core/sessionStateMapper.js +63 -0
- package/lib/commonjs/core/sessionStateMapper.js.map +1 -1
- package/lib/commonjs/i18n/strings/en.js +28 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -1
- package/lib/commonjs/i18n/strings/es.js +28 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/steps/AddressInfoStep.js +30 -18
- package/lib/commonjs/steps/AddressInfoStep.js.map +1 -1
- package/lib/commonjs/steps/DocumentsOcrStep.js +4 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
- package/lib/commonjs/steps/EmailContactStep.js +5 -0
- package/lib/commonjs/steps/EmailContactStep.js.map +1 -1
- package/lib/commonjs/steps/EmailOtpStep.js +5 -0
- package/lib/commonjs/steps/EmailOtpStep.js.map +1 -1
- package/lib/commonjs/steps/FaceMatchStep.js +16 -13
- package/lib/commonjs/steps/FaceMatchStep.js.map +1 -1
- package/lib/commonjs/steps/HumanBasicInfoStep.js +12 -4
- package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -1
- package/lib/commonjs/steps/HumanExtendedInfoStep.js +15 -8
- package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -1
- package/lib/commonjs/steps/LegalBasicInfoStep.js +13 -6
- package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -1
- package/lib/commonjs/steps/LegalExtendedInfoStep.js +9 -2
- package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -1
- package/lib/commonjs/steps/PhoneContactStep.js +5 -0
- package/lib/commonjs/steps/PhoneContactStep.js.map +1 -1
- package/lib/commonjs/steps/PhoneOtpStep.js +5 -0
- package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -1
- package/lib/commonjs/steps/SwornDeclarationStep.js +16 -6
- package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -1
- package/lib/commonjs/steps/TaxInfoStep.js +10 -3
- package/lib/commonjs/steps/TaxInfoStep.js.map +1 -1
- package/lib/commonjs/steps/TermsAndConditionsStep.js +7 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -1
- package/lib/commonjs/steps/_shared.js +21 -0
- package/lib/commonjs/steps/_shared.js.map +1 -1
- package/lib/commonjs/types/index.js +36 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/ui/StepShell.js +10 -2
- package/lib/commonjs/ui/StepShell.js.map +1 -1
- package/lib/commonjs/ui/VelionOnboardingScreen.js +25 -5
- package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -1
- package/lib/commonjs/ui/icons/StepIcon.js.map +1 -1
- package/lib/commonjs/ui/primitives/BackButton.js +75 -0
- package/lib/commonjs/ui/primitives/BackButton.js.map +1 -0
- package/lib/commonjs/ui/primitives/index.js +7 -0
- package/lib/commonjs/ui/primitives/index.js.map +1 -1
- package/lib/module/core/VelionOnboarding.js +297 -16
- package/lib/module/core/VelionOnboarding.js.map +1 -1
- package/lib/module/core/retryStepCopy.js +39 -0
- package/lib/module/core/retryStepCopy.js.map +1 -0
- package/lib/module/core/routingCommands.js +57 -0
- package/lib/module/core/routingCommands.js.map +1 -0
- package/lib/module/core/sessionStateMapper.js +61 -0
- package/lib/module/core/sessionStateMapper.js.map +1 -1
- package/lib/module/i18n/strings/en.js +28 -0
- package/lib/module/i18n/strings/en.js.map +1 -1
- package/lib/module/i18n/strings/es.js +28 -0
- package/lib/module/i18n/strings/es.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/steps/AddressInfoStep.js +31 -19
- package/lib/module/steps/AddressInfoStep.js.map +1 -1
- package/lib/module/steps/DocumentsOcrStep.js +4 -0
- package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
- package/lib/module/steps/EmailContactStep.js +5 -0
- package/lib/module/steps/EmailContactStep.js.map +1 -1
- package/lib/module/steps/EmailOtpStep.js +5 -0
- package/lib/module/steps/EmailOtpStep.js.map +1 -1
- package/lib/module/steps/FaceMatchStep.js +16 -13
- package/lib/module/steps/FaceMatchStep.js.map +1 -1
- package/lib/module/steps/HumanBasicInfoStep.js +12 -4
- package/lib/module/steps/HumanBasicInfoStep.js.map +1 -1
- package/lib/module/steps/HumanExtendedInfoStep.js +16 -9
- package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -1
- package/lib/module/steps/LegalBasicInfoStep.js +14 -7
- package/lib/module/steps/LegalBasicInfoStep.js.map +1 -1
- package/lib/module/steps/LegalExtendedInfoStep.js +10 -3
- package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -1
- package/lib/module/steps/PhoneContactStep.js +5 -0
- package/lib/module/steps/PhoneContactStep.js.map +1 -1
- package/lib/module/steps/PhoneOtpStep.js +5 -0
- package/lib/module/steps/PhoneOtpStep.js.map +1 -1
- package/lib/module/steps/SwornDeclarationStep.js +18 -6
- package/lib/module/steps/SwornDeclarationStep.js.map +1 -1
- package/lib/module/steps/TaxInfoStep.js +11 -4
- package/lib/module/steps/TaxInfoStep.js.map +1 -1
- package/lib/module/steps/TermsAndConditionsStep.js +7 -0
- package/lib/module/steps/TermsAndConditionsStep.js.map +1 -1
- package/lib/module/steps/_shared.js +19 -0
- package/lib/module/steps/_shared.js.map +1 -1
- package/lib/module/types/index.js +38 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/ui/StepShell.js +10 -2
- package/lib/module/ui/StepShell.js.map +1 -1
- package/lib/module/ui/VelionOnboardingScreen.js +25 -5
- package/lib/module/ui/VelionOnboardingScreen.js.map +1 -1
- package/lib/module/ui/icons/StepIcon.js.map +1 -1
- package/lib/module/ui/primitives/BackButton.js +71 -0
- package/lib/module/ui/primitives/BackButton.js.map +1 -0
- package/lib/module/ui/primitives/index.js +1 -0
- package/lib/module/ui/primitives/index.js.map +1 -1
- package/lib/typescript/core/VelionOnboarding.d.ts +56 -2
- package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -1
- package/lib/typescript/core/retryStepCopy.d.ts +27 -0
- package/lib/typescript/core/retryStepCopy.d.ts.map +1 -0
- package/lib/typescript/core/routingCommands.d.ts +39 -0
- package/lib/typescript/core/routingCommands.d.ts.map +1 -0
- package/lib/typescript/core/sessionStateMapper.d.ts +20 -1
- package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -1
- package/lib/typescript/i18n/strings/en.d.ts.map +1 -1
- package/lib/typescript/i18n/strings/es.d.ts +25 -0
- package/lib/typescript/i18n/strings/es.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -1
- package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -1
- package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -1
- package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -1
- package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -1
- package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -1
- package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -1
- package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -1
- package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -1
- package/lib/typescript/steps/_shared.d.ts +11 -0
- package/lib/typescript/steps/_shared.d.ts.map +1 -1
- package/lib/typescript/steps/types.d.ts +15 -0
- package/lib/typescript/steps/types.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +127 -5
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/ui/StepShell.d.ts +11 -1
- package/lib/typescript/ui/StepShell.d.ts.map +1 -1
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts +9 -2
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -1
- package/lib/typescript/ui/icons/StepIcon.d.ts +1 -1
- package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -1
- package/lib/typescript/ui/primitives/BackButton.d.ts +20 -0
- package/lib/typescript/ui/primitives/BackButton.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/index.d.ts +1 -0
- package/lib/typescript/ui/primitives/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/VelionOnboarding.ts +315 -16
- package/src/core/retryStepCopy.ts +54 -0
- package/src/core/routingCommands.ts +63 -0
- package/src/core/sessionStateMapper.ts +65 -0
- package/src/i18n/strings/en.ts +33 -0
- package/src/i18n/strings/es.ts +33 -0
- package/src/index.ts +2 -0
- package/src/steps/AddressInfoStep.tsx +38 -20
- package/src/steps/DocumentsOcrStep.tsx +5 -0
- package/src/steps/EmailContactStep.tsx +6 -0
- package/src/steps/EmailOtpStep.tsx +6 -0
- package/src/steps/FaceMatchStep.tsx +18 -19
- package/src/steps/HumanBasicInfoStep.tsx +16 -4
- package/src/steps/HumanExtendedInfoStep.tsx +18 -9
- package/src/steps/LegalBasicInfoStep.tsx +16 -7
- package/src/steps/LegalExtendedInfoStep.tsx +16 -3
- package/src/steps/PhoneContactStep.tsx +6 -0
- package/src/steps/PhoneOtpStep.tsx +6 -0
- package/src/steps/SwornDeclarationStep.tsx +23 -6
- package/src/steps/TaxInfoStep.tsx +15 -4
- package/src/steps/TermsAndConditionsStep.tsx +8 -0
- package/src/steps/_shared.ts +25 -0
- package/src/steps/types.ts +15 -0
- package/src/types/index.ts +131 -3
- package/src/ui/StepShell.tsx +17 -0
- package/src/ui/VelionOnboardingScreen.tsx +36 -2
- package/src/ui/icons/StepIcon.tsx +2 -1
- package/src/ui/primitives/BackButton.tsx +65 -0
- 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';
|