@onairos/react-native 3.0.15 → 3.0.17
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/Overlay.js +119 -122
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/Overlay.tsx.new +516 -0
- package/lib/commonjs/components/UniversalOnboarding.js +223 -79
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/commonjs/index.js +2 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Overlay.js +119 -123
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/Overlay.tsx.new +516 -0
- package/lib/module/components/UniversalOnboarding.js +224 -80
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Overlay.d.ts +5 -0
- package/lib/typescript/components/Overlay.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Overlay.tsx +144 -161
- package/src/components/Overlay.tsx.new +516 -0
- package/src/components/UniversalOnboarding.tsx +455 -289
- package/src/components/UniversalOnboarding.tsx.new +455 -0
- package/src/index.ts +1 -1
- package/lib/commonjs/components/screens/SignInScreen.js +0 -129
- package/lib/commonjs/components/screens/SignInScreen.js.map +0 -1
- package/lib/module/components/screens/SignInScreen.js +0 -121
- package/lib/module/components/screens/SignInScreen.js.map +0 -1
- package/lib/typescript/components/screens/SignInScreen.d.ts +0 -10
- package/lib/typescript/components/screens/SignInScreen.d.ts.map +0 -1
- package/src/components/screens/SignInScreen.tsx +0 -138
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, SafeAreaView, TextInput, TouchableOpacity } from 'react-native';
|
|
3
|
-
import { OnboardingHeader } from '../onboarding/OnboardingHeader';
|
|
4
|
-
import { updateCredentials } from '../../utils/secureStorage';
|
|
5
|
-
import { COLORS } from '../../constants';
|
|
6
|
-
export const SignInScreen = ({
|
|
7
|
-
onComplete,
|
|
8
|
-
onBack,
|
|
9
|
-
onClose,
|
|
10
|
-
AppName
|
|
11
|
-
}) => {
|
|
12
|
-
const [username, setUsername] = useState('');
|
|
13
|
-
const [password, setPassword] = useState('');
|
|
14
|
-
const [error, setError] = useState('');
|
|
15
|
-
const handleSignIn = useCallback(async () => {
|
|
16
|
-
// Validate inputs
|
|
17
|
-
if (!username || !password) {
|
|
18
|
-
setError('Please enter both username and password');
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
// Save credentials - store only the username
|
|
23
|
-
// Password would typically be used for authentication with backend
|
|
24
|
-
// but not stored in the credentials object
|
|
25
|
-
await updateCredentials({
|
|
26
|
-
username,
|
|
27
|
-
// Using accessToken property instead of password
|
|
28
|
-
accessToken: password
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Move to next step
|
|
32
|
-
onComplete();
|
|
33
|
-
} catch (err) {
|
|
34
|
-
console.error('Error signing in:', err);
|
|
35
|
-
setError('Failed to sign in. Please try again.');
|
|
36
|
-
}
|
|
37
|
-
}, [username, password, onComplete]);
|
|
38
|
-
return /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
39
|
-
style: styles.container
|
|
40
|
-
}, /*#__PURE__*/React.createElement(OnboardingHeader, {
|
|
41
|
-
title: "Sign In",
|
|
42
|
-
subtitle: `Sign in to your ${AppName} account`,
|
|
43
|
-
showBackButton: true,
|
|
44
|
-
onBack: onBack,
|
|
45
|
-
onClose: onClose
|
|
46
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
47
|
-
style: styles.content
|
|
48
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
49
|
-
style: styles.inputContainer
|
|
50
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
51
|
-
style: styles.label
|
|
52
|
-
}, "Username"), /*#__PURE__*/React.createElement(TextInput, {
|
|
53
|
-
style: styles.input,
|
|
54
|
-
placeholder: "Enter your username",
|
|
55
|
-
value: username,
|
|
56
|
-
onChangeText: setUsername,
|
|
57
|
-
autoCapitalize: "none"
|
|
58
|
-
})), /*#__PURE__*/React.createElement(View, {
|
|
59
|
-
style: styles.inputContainer
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
61
|
-
style: styles.label
|
|
62
|
-
}, "Password"), /*#__PURE__*/React.createElement(TextInput, {
|
|
63
|
-
style: styles.input,
|
|
64
|
-
placeholder: "Enter your password",
|
|
65
|
-
value: password,
|
|
66
|
-
onChangeText: setPassword,
|
|
67
|
-
secureTextEntry: true
|
|
68
|
-
})), error ? /*#__PURE__*/React.createElement(Text, {
|
|
69
|
-
style: styles.errorText
|
|
70
|
-
}, error) : null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
71
|
-
style: styles.signInButton,
|
|
72
|
-
onPress: handleSignIn
|
|
73
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
74
|
-
style: styles.signInButtonText
|
|
75
|
-
}, "Sign In"))));
|
|
76
|
-
};
|
|
77
|
-
const styles = StyleSheet.create({
|
|
78
|
-
container: {
|
|
79
|
-
flex: 1,
|
|
80
|
-
backgroundColor: '#fff'
|
|
81
|
-
},
|
|
82
|
-
content: {
|
|
83
|
-
padding: 24
|
|
84
|
-
},
|
|
85
|
-
inputContainer: {
|
|
86
|
-
marginBottom: 20
|
|
87
|
-
},
|
|
88
|
-
label: {
|
|
89
|
-
fontSize: 16,
|
|
90
|
-
fontWeight: 'bold',
|
|
91
|
-
marginBottom: 8,
|
|
92
|
-
color: '#333'
|
|
93
|
-
},
|
|
94
|
-
input: {
|
|
95
|
-
height: 50,
|
|
96
|
-
borderWidth: 1,
|
|
97
|
-
borderColor: '#ddd',
|
|
98
|
-
borderRadius: 8,
|
|
99
|
-
paddingHorizontal: 16,
|
|
100
|
-
fontSize: 16,
|
|
101
|
-
backgroundColor: '#f9f9f9'
|
|
102
|
-
},
|
|
103
|
-
errorText: {
|
|
104
|
-
color: '#f44336',
|
|
105
|
-
marginBottom: 16
|
|
106
|
-
},
|
|
107
|
-
signInButton: {
|
|
108
|
-
backgroundColor: COLORS.primary,
|
|
109
|
-
borderRadius: 25,
|
|
110
|
-
height: 50,
|
|
111
|
-
alignItems: 'center',
|
|
112
|
-
justifyContent: 'center',
|
|
113
|
-
marginTop: 16
|
|
114
|
-
},
|
|
115
|
-
signInButtonText: {
|
|
116
|
-
color: '#fff',
|
|
117
|
-
fontSize: 16,
|
|
118
|
-
fontWeight: '600'
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
//# sourceMappingURL=SignInScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","View","Text","StyleSheet","SafeAreaView","TextInput","TouchableOpacity","OnboardingHeader","updateCredentials","COLORS","SignInScreen","onComplete","onBack","onClose","AppName","username","setUsername","password","setPassword","error","setError","handleSignIn","accessToken","err","console","createElement","style","styles","container","title","subtitle","showBackButton","content","inputContainer","label","input","placeholder","value","onChangeText","autoCapitalize","secureTextEntry","errorText","signInButton","onPress","signInButtonText","create","flex","backgroundColor","padding","marginBottom","fontSize","fontWeight","color","height","borderWidth","borderColor","borderRadius","paddingHorizontal","primary","alignItems","justifyContent","marginTop"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/screens/SignInScreen.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,YAAY,EAAEC,SAAS,EAAEC,gBAAgB,QAAQ,cAAc;AAChG,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAAS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AC;EAC/BjB,SAAS,EAAE;IACTkB,IAAI,EAAE,CAAC;IACPC,eAAe,EAAE;EACnB,CAAC;EACDf,OAAO,EAAE;IACPgB,OAAO,EAAE;EACX,CAAC;EACDf,cAAc,EAAE;IACdgB,YAAY,EAAE;EAChB,CAAC;EACDf,KAAK,EAAE;IACLgB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBF,YAAY,EAAE,CAAC;IACfG,KAAK,EAAE;EACT,CAAC;EACDjB,KAAK,EAAE;IACLkB,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE,CAAC;IACfC,iBAAiB,EAAE,EAAE;IACrBP,QAAQ,EAAE,EAAE;IACZH,eAAe,EAAE;EACnB,CAAC;EACDN,SAAS,EAAE;IACTW,KAAK,EAAE,SAAS;IAChBH,YAAY,EAAE;EAChB,CAAC;EACDP,YAAY,EAAE;IACZK,eAAe,EAAEtC,MAAM,CAACiD,OAAO;IAC/BF,YAAY,EAAE,EAAE;IAChBH,MAAM,EAAE,EAAE;IACVM,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE;EACb,CAAC;EACDjB,gBAAgB,EAAE;IAChBQ,KAAK,EAAE,MAAM;IACbF,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface SignInScreenProps {
|
|
3
|
-
onComplete: () => void;
|
|
4
|
-
onBack: () => void;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
AppName: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const SignInScreen: React.FC<SignInScreenProps>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=SignInScreen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignInScreen.d.ts","sourceRoot":"","sources":["../../../../src/components/screens/SignInScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAMrD,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+EpD,CAAC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, SafeAreaView, TextInput, TouchableOpacity } from 'react-native';
|
|
3
|
-
import { OnboardingHeader } from '../onboarding/OnboardingHeader';
|
|
4
|
-
import { updateCredentials } from '../../utils/secureStorage';
|
|
5
|
-
import { COLORS } from '../../constants';
|
|
6
|
-
|
|
7
|
-
interface SignInScreenProps {
|
|
8
|
-
onComplete: () => void;
|
|
9
|
-
onBack: () => void;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
AppName: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const SignInScreen: React.FC<SignInScreenProps> = ({
|
|
15
|
-
onComplete,
|
|
16
|
-
onBack,
|
|
17
|
-
onClose,
|
|
18
|
-
AppName,
|
|
19
|
-
}) => {
|
|
20
|
-
const [username, setUsername] = useState('');
|
|
21
|
-
const [password, setPassword] = useState('');
|
|
22
|
-
const [error, setError] = useState('');
|
|
23
|
-
|
|
24
|
-
const handleSignIn = useCallback(async () => {
|
|
25
|
-
// Validate inputs
|
|
26
|
-
if (!username || !password) {
|
|
27
|
-
setError('Please enter both username and password');
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
// Save credentials - store only the username
|
|
33
|
-
// Password would typically be used for authentication with backend
|
|
34
|
-
// but not stored in the credentials object
|
|
35
|
-
await updateCredentials({
|
|
36
|
-
username,
|
|
37
|
-
// Using accessToken property instead of password
|
|
38
|
-
accessToken: password,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// Move to next step
|
|
42
|
-
onComplete();
|
|
43
|
-
} catch (err) {
|
|
44
|
-
console.error('Error signing in:', err);
|
|
45
|
-
setError('Failed to sign in. Please try again.');
|
|
46
|
-
}
|
|
47
|
-
}, [username, password, onComplete]);
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<SafeAreaView style={styles.container}>
|
|
51
|
-
<OnboardingHeader
|
|
52
|
-
title="Sign In"
|
|
53
|
-
subtitle={`Sign in to your ${AppName} account`}
|
|
54
|
-
showBackButton
|
|
55
|
-
onBack={onBack}
|
|
56
|
-
onClose={onClose}
|
|
57
|
-
/>
|
|
58
|
-
|
|
59
|
-
<View style={styles.content}>
|
|
60
|
-
<View style={styles.inputContainer}>
|
|
61
|
-
<Text style={styles.label}>Username</Text>
|
|
62
|
-
<TextInput
|
|
63
|
-
style={styles.input}
|
|
64
|
-
placeholder="Enter your username"
|
|
65
|
-
value={username}
|
|
66
|
-
onChangeText={setUsername}
|
|
67
|
-
autoCapitalize="none"
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
70
|
-
|
|
71
|
-
<View style={styles.inputContainer}>
|
|
72
|
-
<Text style={styles.label}>Password</Text>
|
|
73
|
-
<TextInput
|
|
74
|
-
style={styles.input}
|
|
75
|
-
placeholder="Enter your password"
|
|
76
|
-
value={password}
|
|
77
|
-
onChangeText={setPassword}
|
|
78
|
-
secureTextEntry
|
|
79
|
-
/>
|
|
80
|
-
</View>
|
|
81
|
-
|
|
82
|
-
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
83
|
-
|
|
84
|
-
<TouchableOpacity
|
|
85
|
-
style={styles.signInButton}
|
|
86
|
-
onPress={handleSignIn}
|
|
87
|
-
>
|
|
88
|
-
<Text style={styles.signInButtonText}>Sign In</Text>
|
|
89
|
-
</TouchableOpacity>
|
|
90
|
-
</View>
|
|
91
|
-
</SafeAreaView>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const styles = StyleSheet.create({
|
|
96
|
-
container: {
|
|
97
|
-
flex: 1,
|
|
98
|
-
backgroundColor: '#fff',
|
|
99
|
-
},
|
|
100
|
-
content: {
|
|
101
|
-
padding: 24,
|
|
102
|
-
},
|
|
103
|
-
inputContainer: {
|
|
104
|
-
marginBottom: 20,
|
|
105
|
-
},
|
|
106
|
-
label: {
|
|
107
|
-
fontSize: 16,
|
|
108
|
-
fontWeight: 'bold',
|
|
109
|
-
marginBottom: 8,
|
|
110
|
-
color: '#333',
|
|
111
|
-
},
|
|
112
|
-
input: {
|
|
113
|
-
height: 50,
|
|
114
|
-
borderWidth: 1,
|
|
115
|
-
borderColor: '#ddd',
|
|
116
|
-
borderRadius: 8,
|
|
117
|
-
paddingHorizontal: 16,
|
|
118
|
-
fontSize: 16,
|
|
119
|
-
backgroundColor: '#f9f9f9',
|
|
120
|
-
},
|
|
121
|
-
errorText: {
|
|
122
|
-
color: '#f44336',
|
|
123
|
-
marginBottom: 16,
|
|
124
|
-
},
|
|
125
|
-
signInButton: {
|
|
126
|
-
backgroundColor: COLORS.primary,
|
|
127
|
-
borderRadius: 25,
|
|
128
|
-
height: 50,
|
|
129
|
-
alignItems: 'center',
|
|
130
|
-
justifyContent: 'center',
|
|
131
|
-
marginTop: 16,
|
|
132
|
-
},
|
|
133
|
-
signInButtonText: {
|
|
134
|
-
color: '#fff',
|
|
135
|
-
fontSize: 16,
|
|
136
|
-
fontWeight: '600',
|
|
137
|
-
},
|
|
138
|
-
});
|