@hexar/biometric-identity-sdk-react-native 1.0.2 → 1.0.3
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Main UI component for identity verification with backend AI support
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { ViewStyle } from 'react-native';
|
|
6
7
|
import { ValidationResult, ThemeConfig, BiometricError, SupportedLanguage } from '@hexar/biometric-identity-sdk-core';
|
|
7
8
|
export interface BiometricIdentityFlowProps {
|
|
8
9
|
onValidationComplete: (result: ValidationResult) => void;
|
|
@@ -11,6 +12,10 @@ export interface BiometricIdentityFlowProps {
|
|
|
11
12
|
language?: SupportedLanguage;
|
|
12
13
|
customTranslations?: Record<string, string>;
|
|
13
14
|
smartLivenessMode?: boolean;
|
|
15
|
+
styles?: {
|
|
16
|
+
container?: ViewStyle;
|
|
17
|
+
content?: ViewStyle;
|
|
18
|
+
};
|
|
14
19
|
}
|
|
15
20
|
export declare const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps>;
|
|
16
21
|
export default BiometricIdentityFlow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAOL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,cAAc,EAId,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAU5C,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsStE,CAAC;AAiOF,eAAe,qBAAqB,CAAC"}
|
|
@@ -48,7 +48,7 @@ const ValidationProgress_1 = require("./ValidationProgress");
|
|
|
48
48
|
const ResultScreen_1 = require("./ResultScreen");
|
|
49
49
|
const ErrorScreen_1 = require("./ErrorScreen");
|
|
50
50
|
const InstructionsScreen_1 = require("./InstructionsScreen");
|
|
51
|
-
const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language, customTranslations, smartLivenessMode = true, }) => {
|
|
51
|
+
const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language, customTranslations, smartLivenessMode = true, styles: customStyles, }) => {
|
|
52
52
|
const { sdk, state, isInitialized, isUsingBackend, challenges, uploadFrontID, uploadBackID, storeVideoRecording, fetchChallenges, validateIdentity, reset, } = (0, useBiometricSDK_1.useBiometricSDK)();
|
|
53
53
|
const [showCamera, setShowCamera] = (0, react_1.useState)(false);
|
|
54
54
|
const [cameraMode, setCameraMode] = (0, react_1.useState)('front');
|
|
@@ -145,7 +145,7 @@ const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language,
|
|
|
145
145
|
}, [reset]);
|
|
146
146
|
// Show loading while initializing
|
|
147
147
|
if (!isInitialized) {
|
|
148
|
-
return (react_1.default.createElement(react_native_1.SafeAreaView, { style: styles.container },
|
|
148
|
+
return (react_1.default.createElement(react_native_1.SafeAreaView, { style: [styles.container, customStyles?.container] },
|
|
149
149
|
react_1.default.createElement(react_native_1.View, { style: styles.loadingFullScreen },
|
|
150
150
|
react_1.default.createElement(react_native_1.ActivityIndicator, { size: "large", color: theme?.primaryColor || '#6366F1' }),
|
|
151
151
|
react_1.default.createElement(react_native_1.Text, { style: styles.loadingText }, strings.initialization.initializing))));
|
|
@@ -176,8 +176,8 @@ const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language,
|
|
|
176
176
|
if (state.currentStep === biometric_identity_sdk_core_1.SDKStep.ERROR && state.error) {
|
|
177
177
|
return (react_1.default.createElement(ErrorScreen_1.ErrorScreen, { error: state.error, theme: theme, language: language, onRetry: handleRetry, onClose: () => onError(state.error) }));
|
|
178
178
|
}
|
|
179
|
-
return (react_1.default.createElement(react_native_1.SafeAreaView, { style: styles.container },
|
|
180
|
-
react_1.default.createElement(react_native_1.View, { style: styles.content },
|
|
179
|
+
return (react_1.default.createElement(react_native_1.SafeAreaView, { style: [styles.container, customStyles?.container] },
|
|
180
|
+
react_1.default.createElement(react_native_1.View, { style: [styles.content, customStyles?.content] },
|
|
181
181
|
react_1.default.createElement(react_native_1.Text, { style: styles.title }, strings.instructions.title),
|
|
182
182
|
react_1.default.createElement(react_native_1.Text, { style: styles.subtitle }, strings.instructions.subtitle),
|
|
183
183
|
isUsingBackend && (react_1.default.createElement(react_native_1.View, { style: styles.backendBadge },
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
TouchableOpacity,
|
|
12
12
|
ActivityIndicator,
|
|
13
13
|
SafeAreaView,
|
|
14
|
+
ViewStyle,
|
|
14
15
|
} from 'react-native';
|
|
15
16
|
import {
|
|
16
17
|
ValidationResult,
|
|
@@ -37,6 +38,10 @@ export interface BiometricIdentityFlowProps {
|
|
|
37
38
|
language?: SupportedLanguage;
|
|
38
39
|
customTranslations?: Record<string, string>;
|
|
39
40
|
smartLivenessMode?: boolean;
|
|
41
|
+
styles?: {
|
|
42
|
+
container?: ViewStyle;
|
|
43
|
+
content?: ViewStyle;
|
|
44
|
+
};
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
@@ -46,6 +51,7 @@ export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
|
46
51
|
language,
|
|
47
52
|
customTranslations,
|
|
48
53
|
smartLivenessMode = true,
|
|
54
|
+
styles: customStyles,
|
|
49
55
|
}) => {
|
|
50
56
|
const {
|
|
51
57
|
sdk,
|
|
@@ -165,7 +171,7 @@ export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
|
165
171
|
// Show loading while initializing
|
|
166
172
|
if (!isInitialized) {
|
|
167
173
|
return (
|
|
168
|
-
<SafeAreaView style={styles.container}>
|
|
174
|
+
<SafeAreaView style={[styles.container, customStyles?.container]}>
|
|
169
175
|
<View style={styles.loadingFullScreen}>
|
|
170
176
|
<ActivityIndicator size="large" color={theme?.primaryColor || '#6366F1'} />
|
|
171
177
|
<Text style={styles.loadingText}>{strings.initialization.initializing}</Text>
|
|
@@ -251,8 +257,8 @@ export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
|
251
257
|
}
|
|
252
258
|
|
|
253
259
|
return (
|
|
254
|
-
<SafeAreaView style={styles.container}>
|
|
255
|
-
<View style={styles.content}>
|
|
260
|
+
<SafeAreaView style={[styles.container, customStyles?.container]}>
|
|
261
|
+
<View style={[styles.content, customStyles?.content]}>
|
|
256
262
|
<Text style={styles.title}>{strings.instructions.title}</Text>
|
|
257
263
|
<Text style={styles.subtitle}>{strings.instructions.subtitle}</Text>
|
|
258
264
|
|