@onairos/react-native 3.0.20 → 3.0.22
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/lib/commonjs/components/OnairosButton.js +62 -7
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +90 -7
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/module/components/OnairosButton.js +62 -7
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/PinInput.js +91 -8
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +6 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/OnairosButton.tsx +365 -305
- package/src/components/PinInput.tsx +98 -5
- package/src/types.ts +6 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
1
|
+
import React, { useState, useCallback, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
TouchableOpacity,
|
|
8
8
|
Keyboard,
|
|
9
9
|
Dimensions,
|
|
10
|
+
Modal,
|
|
11
|
+
TouchableWithoutFeedback,
|
|
10
12
|
} from 'react-native';
|
|
11
13
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
12
14
|
import { COLORS } from '../constants';
|
|
@@ -24,6 +26,7 @@ export const PinInput: React.FC<PinInputProps> = ({
|
|
|
24
26
|
const [pin, setPin] = useState('');
|
|
25
27
|
const [error, setError] = useState<string | null>(null);
|
|
26
28
|
const [showPin, setShowPin] = useState(false);
|
|
29
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
27
30
|
|
|
28
31
|
const validatePin = useCallback((value: string) => {
|
|
29
32
|
if (value.length < minLength) {
|
|
@@ -61,7 +64,12 @@ export const PinInput: React.FC<PinInputProps> = ({
|
|
|
61
64
|
</TouchableOpacity>
|
|
62
65
|
)}
|
|
63
66
|
<Text style={styles.title}>Create your PIN</Text>
|
|
64
|
-
<
|
|
67
|
+
<TouchableOpacity
|
|
68
|
+
style={styles.helpButton}
|
|
69
|
+
onPress={() => setShowTooltip(true)}
|
|
70
|
+
>
|
|
71
|
+
<Icon name="help" size={24} color={COLORS.text.primary} />
|
|
72
|
+
</TouchableOpacity>
|
|
65
73
|
</View>
|
|
66
74
|
|
|
67
75
|
<Text style={styles.subtitle}>
|
|
@@ -75,7 +83,7 @@ export const PinInput: React.FC<PinInputProps> = ({
|
|
|
75
83
|
onChangeText={handlePinChange}
|
|
76
84
|
secureTextEntry={!showPin}
|
|
77
85
|
placeholder="Enter PIN"
|
|
78
|
-
keyboardType="
|
|
86
|
+
keyboardType="default"
|
|
79
87
|
maxLength={20}
|
|
80
88
|
autoCapitalize="none"
|
|
81
89
|
autoCorrect={false}
|
|
@@ -139,6 +147,44 @@ export const PinInput: React.FC<PinInputProps> = ({
|
|
|
139
147
|
<Text style={styles.submitButtonText}>Continue</Text>
|
|
140
148
|
</TouchableOpacity>
|
|
141
149
|
</View>
|
|
150
|
+
|
|
151
|
+
{/* PIN Information Tooltip Modal */}
|
|
152
|
+
<Modal
|
|
153
|
+
visible={showTooltip}
|
|
154
|
+
transparent
|
|
155
|
+
animationType="fade"
|
|
156
|
+
onRequestClose={() => setShowTooltip(false)}
|
|
157
|
+
>
|
|
158
|
+
<TouchableWithoutFeedback onPress={() => setShowTooltip(false)}>
|
|
159
|
+
<View style={styles.tooltipOverlay}>
|
|
160
|
+
<View style={styles.tooltipContainer}>
|
|
161
|
+
<Text style={styles.tooltipTitle}>About Your PIN</Text>
|
|
162
|
+
<Text style={styles.tooltipText}>
|
|
163
|
+
Your PIN is used to secure your account and protect your data. It will be required whenever you access sensitive information or perform important actions.
|
|
164
|
+
</Text>
|
|
165
|
+
<Text style={styles.tooltipText}>
|
|
166
|
+
For maximum security, your PIN should:
|
|
167
|
+
</Text>
|
|
168
|
+
<Text style={styles.tooltipBullet}>• Be at least {minLength} characters</Text>
|
|
169
|
+
{requireSpecialChar && (
|
|
170
|
+
<Text style={styles.tooltipBullet}>• Include special characters like !@#$%^&*()</Text>
|
|
171
|
+
)}
|
|
172
|
+
{requireNumber && (
|
|
173
|
+
<Text style={styles.tooltipBullet}>• Include at least one number</Text>
|
|
174
|
+
)}
|
|
175
|
+
<Text style={styles.tooltipText}>
|
|
176
|
+
Your PIN is stored securely and encrypted on your device.
|
|
177
|
+
</Text>
|
|
178
|
+
<TouchableOpacity
|
|
179
|
+
style={styles.tooltipButton}
|
|
180
|
+
onPress={() => setShowTooltip(false)}
|
|
181
|
+
>
|
|
182
|
+
<Text style={styles.tooltipButtonText}>Got it</Text>
|
|
183
|
+
</TouchableOpacity>
|
|
184
|
+
</View>
|
|
185
|
+
</View>
|
|
186
|
+
</TouchableWithoutFeedback>
|
|
187
|
+
</Modal>
|
|
142
188
|
</View>
|
|
143
189
|
);
|
|
144
190
|
};
|
|
@@ -160,8 +206,10 @@ const styles = StyleSheet.create({
|
|
|
160
206
|
backButton: {
|
|
161
207
|
padding: 8,
|
|
162
208
|
},
|
|
163
|
-
|
|
164
|
-
|
|
209
|
+
helpButton: {
|
|
210
|
+
padding: 8,
|
|
211
|
+
width: 40,
|
|
212
|
+
alignItems: 'center',
|
|
165
213
|
},
|
|
166
214
|
title: {
|
|
167
215
|
fontSize: 20,
|
|
@@ -247,4 +295,49 @@ const styles = StyleSheet.create({
|
|
|
247
295
|
fontSize: 16,
|
|
248
296
|
fontWeight: '600',
|
|
249
297
|
},
|
|
298
|
+
tooltipOverlay: {
|
|
299
|
+
flex: 1,
|
|
300
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
301
|
+
justifyContent: 'center',
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
padding: 20,
|
|
304
|
+
},
|
|
305
|
+
tooltipContainer: {
|
|
306
|
+
backgroundColor: '#fff',
|
|
307
|
+
borderRadius: 16,
|
|
308
|
+
padding: 20,
|
|
309
|
+
width: '90%',
|
|
310
|
+
maxWidth: 400,
|
|
311
|
+
},
|
|
312
|
+
tooltipTitle: {
|
|
313
|
+
fontSize: 18,
|
|
314
|
+
fontWeight: '600',
|
|
315
|
+
marginBottom: 12,
|
|
316
|
+
color: COLORS.text.primary,
|
|
317
|
+
textAlign: 'center',
|
|
318
|
+
},
|
|
319
|
+
tooltipText: {
|
|
320
|
+
fontSize: 14,
|
|
321
|
+
color: COLORS.text.secondary,
|
|
322
|
+
marginBottom: 12,
|
|
323
|
+
},
|
|
324
|
+
tooltipBullet: {
|
|
325
|
+
fontSize: 14,
|
|
326
|
+
color: COLORS.text.secondary,
|
|
327
|
+
marginBottom: 6,
|
|
328
|
+
marginLeft: 10,
|
|
329
|
+
},
|
|
330
|
+
tooltipButton: {
|
|
331
|
+
backgroundColor: COLORS.primary,
|
|
332
|
+
paddingVertical: 12,
|
|
333
|
+
paddingHorizontal: 24,
|
|
334
|
+
borderRadius: 8,
|
|
335
|
+
alignSelf: 'center',
|
|
336
|
+
marginTop: 12,
|
|
337
|
+
},
|
|
338
|
+
tooltipButtonText: {
|
|
339
|
+
color: '#fff',
|
|
340
|
+
fontSize: 16,
|
|
341
|
+
fontWeight: '600',
|
|
342
|
+
},
|
|
250
343
|
});
|
package/src/types.ts
CHANGED
|
@@ -54,6 +54,12 @@ export interface OnairosButtonProps {
|
|
|
54
54
|
darkMode?: boolean;
|
|
55
55
|
preferredPlatform?: string;
|
|
56
56
|
testMode?: boolean;
|
|
57
|
+
autoFetch?: boolean;
|
|
58
|
+
inferenceData?: any;
|
|
59
|
+
textLayout?: 'left' | 'right' | 'center';
|
|
60
|
+
textColor?: string;
|
|
61
|
+
proofMode?: boolean;
|
|
62
|
+
webpageName?: string;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
export interface PlatformListProps {
|