@myazahq/kyc-sdk-react-native 2.3.0 → 2.4.0
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/package.json +1 -2
- package/src/components/BrandBar.tsx +137 -0
- package/src/components/DialCodePicker.tsx +11 -17
- package/src/components/DocumentReviewSide.tsx +34 -14
- package/src/components/Icon.tsx +5 -0
- package/src/components/KycSheet.tsx +39 -140
- package/src/components/MediaSourceSheet.tsx +7 -37
- package/src/components/MyazaDateField.tsx +6 -20
- package/src/components/MyazaSelect.tsx +15 -39
- package/src/components/SandboxBanner.tsx +92 -0
- package/src/components/StepHeader.tsx +15 -2
- package/src/components/glass/ChromeGlass.tsx +65 -0
- package/src/components/glass/FloatingSheet.tsx +190 -0
- package/src/components/glass/GlassSheet.tsx +38 -0
- package/src/components/glass/GlassSurface.tsx +31 -3
- package/src/components/viewfinder/ImmersiveBottomBar.tsx +28 -17
- package/src/components/viewfinder/ImmersiveControls.tsx +26 -14
- package/src/components/viewfinder/ViewfinderControls.tsx +29 -7
- package/src/services/deviceMetadata.ts +1 -1
- package/src/types/config.ts +7 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActivityIndicator, Pressable, View } from 'react-native';
|
|
2
|
+
import { ActivityIndicator, Pressable, View, type ViewStyle } from 'react-native';
|
|
3
3
|
import Svg, { Circle } from 'react-native-svg';
|
|
4
4
|
|
|
5
5
|
import { radius, spacing } from '../../config/theme';
|
|
@@ -7,6 +7,7 @@ import { useTheme } from '../runtime';
|
|
|
7
7
|
import { MyazaText } from '../Typography';
|
|
8
8
|
import { Icon } from '../Icon';
|
|
9
9
|
import { CountryFlag } from '../CountryFlag';
|
|
10
|
+
import { CHROME_SCRIM, ChromeGlass } from '../glass/ChromeGlass';
|
|
10
11
|
|
|
11
12
|
// ---------------------------------------------------------------------------
|
|
12
13
|
// Immersive capture chrome — 1:1 with the Flutter SDK's full-screen camera.
|
|
@@ -18,9 +19,16 @@ import { CountryFlag } from '../CountryFlag';
|
|
|
18
19
|
// • the side badge and document pill sit top, out of the frame's way.
|
|
19
20
|
// ---------------------------------------------------------------------------
|
|
20
21
|
|
|
21
|
-
const SCRIM =
|
|
22
|
+
const SCRIM = CHROME_SCRIM;
|
|
22
23
|
|
|
23
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Round translucent control — back, torch.
|
|
26
|
+
*
|
|
27
|
+
* Liquid Glass when idle; SOLID brand fill when `active`. An "on" state has to
|
|
28
|
+
* be unmistakable, and a translucent material that samples the scene behind it
|
|
29
|
+
* cannot promise that — the torch would look on or off depending on what the
|
|
30
|
+
* camera happened to be pointed at.
|
|
31
|
+
*/
|
|
24
32
|
export function RoundControl({
|
|
25
33
|
icon,
|
|
26
34
|
label,
|
|
@@ -37,23 +45,27 @@ export function RoundControl({
|
|
|
37
45
|
style: object;
|
|
38
46
|
}): React.ReactElement {
|
|
39
47
|
const { colors } = useTheme();
|
|
48
|
+
const fill: ViewStyle = {
|
|
49
|
+
flex: 1,
|
|
50
|
+
borderRadius: radius.full,
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
};
|
|
54
|
+
const glyph = <Icon name={icon} size={20} color="#FFFFFF" />;
|
|
40
55
|
return (
|
|
41
56
|
<Pressable
|
|
42
57
|
onPress={onPress}
|
|
43
58
|
accessibilityRole="button"
|
|
44
59
|
accessibilityLabel={label}
|
|
45
|
-
style={{
|
|
46
|
-
position: 'absolute',
|
|
47
|
-
width: size,
|
|
48
|
-
height: size,
|
|
49
|
-
borderRadius: radius.full,
|
|
50
|
-
backgroundColor: active ? colors.primary : SCRIM,
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
justifyContent: 'center',
|
|
53
|
-
...style,
|
|
54
|
-
}}
|
|
60
|
+
style={{ position: 'absolute', width: size, height: size, ...style }}
|
|
55
61
|
>
|
|
56
|
-
|
|
62
|
+
{active ? (
|
|
63
|
+
<View style={[fill, { backgroundColor: colors.primary }]}>{glyph}</View>
|
|
64
|
+
) : (
|
|
65
|
+
<ChromeGlass interactive style={fill}>
|
|
66
|
+
{glyph}
|
|
67
|
+
</ChromeGlass>
|
|
68
|
+
)}
|
|
57
69
|
</Pressable>
|
|
58
70
|
);
|
|
59
71
|
}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActivityIndicator, Pressable, View } from 'react-native';
|
|
2
|
+
import { ActivityIndicator, Pressable, View, type ViewStyle } from 'react-native';
|
|
3
3
|
import Svg, { Circle } from 'react-native-svg';
|
|
4
4
|
|
|
5
5
|
import { radius, spacing } from '../../config/theme';
|
|
6
6
|
import { useTheme } from '../runtime';
|
|
7
7
|
import { MyazaText } from '../Typography';
|
|
8
8
|
import { Icon } from '../Icon';
|
|
9
|
+
import { ChromeGlass } from '../glass/ChromeGlass';
|
|
10
|
+
|
|
11
|
+
/** This overlay's own scrim, kept so non-glass devices look unchanged. */
|
|
12
|
+
const OVERLAY_SCRIM = 'rgba(0,0,0,0.4)';
|
|
13
|
+
|
|
14
|
+
/** Fills a sized Pressable with a round surface. */
|
|
15
|
+
const ROUND_FILL: ViewStyle = {
|
|
16
|
+
flex: 1,
|
|
17
|
+
borderRadius: radius.full,
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
};
|
|
9
21
|
|
|
10
22
|
/** Top offset that clears the status bar when the camera runs full-bleed. */
|
|
11
23
|
export function topInset(fill: boolean): number {
|
|
@@ -49,7 +61,13 @@ export function HintBanner({
|
|
|
49
61
|
);
|
|
50
62
|
}
|
|
51
63
|
|
|
52
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* A round overlay button — the torch and the immersive back control.
|
|
66
|
+
*
|
|
67
|
+
* Liquid Glass when idle; SOLID brand fill when `active`. An "on" state has to
|
|
68
|
+
* be unmistakable, and a translucent material that samples the scene behind it
|
|
69
|
+
* cannot promise that.
|
|
70
|
+
*/
|
|
53
71
|
export function OverlayButton({
|
|
54
72
|
icon,
|
|
55
73
|
onPress,
|
|
@@ -77,13 +95,17 @@ export function OverlayButton({
|
|
|
77
95
|
[side]: spacing.md,
|
|
78
96
|
width: 36,
|
|
79
97
|
height: 36,
|
|
80
|
-
borderRadius: radius.full,
|
|
81
|
-
backgroundColor: active ? colors.primary : 'rgba(0,0,0,0.4)',
|
|
82
|
-
alignItems: 'center',
|
|
83
|
-
justifyContent: 'center',
|
|
84
98
|
}}
|
|
85
99
|
>
|
|
86
|
-
|
|
100
|
+
{active ? (
|
|
101
|
+
<View style={[ROUND_FILL, { backgroundColor: colors.primary }]}>
|
|
102
|
+
<Icon name={icon} size={18} color="#FFFFFF" />
|
|
103
|
+
</View>
|
|
104
|
+
) : (
|
|
105
|
+
<ChromeGlass interactive scrim={OVERLAY_SCRIM} style={ROUND_FILL}>
|
|
106
|
+
<Icon name={icon} size={18} color="#FFFFFF" />
|
|
107
|
+
</ChromeGlass>
|
|
108
|
+
)}
|
|
87
109
|
</Pressable>
|
|
88
110
|
);
|
|
89
111
|
}
|
|
@@ -15,7 +15,7 @@ export type DeviceType = 'mobile' | 'tablet' | 'desktop' | 'unknown';
|
|
|
15
15
|
* Single source of truth for the SDK version — also used by `services/api.ts`
|
|
16
16
|
* for the `X-SDK-Version` header. Keep in sync with `package.json`.
|
|
17
17
|
*/
|
|
18
|
-
export const SDK_VERSION = '2.
|
|
18
|
+
export const SDK_VERSION = '2.4.0';
|
|
19
19
|
|
|
20
20
|
export interface ReactNativeDeviceMetadata {
|
|
21
21
|
sdkType: 'react-native';
|
package/src/types/config.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type KYCStep =
|
|
|
62
62
|
// ---------------------------------------------------------------------------
|
|
63
63
|
|
|
64
64
|
/** How flow progress is drawn — see {@link MyazaKYCConfig.progressStyle}. */
|
|
65
|
-
export type ProgressStyle = 'steps' | 'bar';
|
|
65
|
+
export type ProgressStyle = 'steps' | 'bar' | 'none';
|
|
66
66
|
|
|
67
67
|
export interface MyazaKYCConfig<C extends SupportedCountry = SupportedCountry> {
|
|
68
68
|
/**
|
|
@@ -215,8 +215,13 @@ export interface MyazaKYCConfig<C extends SupportedCountry = SupportedCountry> {
|
|
|
215
215
|
* • `'bar'` — a single thin bar pinned to the bottom edge of the header.
|
|
216
216
|
* Quieter, and unaffected by step count, so it suits long flows and hosts
|
|
217
217
|
* who would rather the chrome said less.
|
|
218
|
+
* • `'none'` — no progress in the header at all. For hosts whose own
|
|
219
|
+
* surface already communicates progress, or short flows where a
|
|
220
|
+
* step count is more noise than reassurance. The header keeps its
|
|
221
|
+
* brand row and controls; only the progress element is dropped.
|
|
218
222
|
*
|
|
219
|
-
*
|
|
223
|
+
* `'steps'` and `'bar'` convey the same fraction; the choice is how much room
|
|
224
|
+
* it takes. `'none'` opts out of conveying it here.
|
|
220
225
|
*/
|
|
221
226
|
progressStyle?: ProgressStyle;
|
|
222
227
|
|