@oxyhq/services 0.1.18 → 5.1.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.
Files changed (183) hide show
  1. package/README.md +17 -138
  2. package/UI_COMPONENTS.md +142 -0
  3. package/lib/commonjs/assets/OxyLogo.svg +1 -0
  4. package/lib/commonjs/assets/assets/OxyLogo.svg +1 -0
  5. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  6. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  7. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  8. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  9. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  10. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  11. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  12. package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  13. package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  14. package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  15. package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  16. package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  17. package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  18. package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  19. package/lib/commonjs/core/index.js +783 -0
  20. package/lib/commonjs/core/index.js.map +1 -0
  21. package/lib/commonjs/index.js +128 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/models/interfaces.js +2 -0
  24. package/lib/commonjs/models/interfaces.js.map +1 -0
  25. package/lib/commonjs/package.json +1 -0
  26. package/lib/commonjs/ui/components/FontLoader.js +181 -0
  27. package/lib/commonjs/ui/components/FontLoader.js.map +1 -0
  28. package/lib/commonjs/ui/components/OxyLogo.js +56 -0
  29. package/lib/commonjs/ui/components/OxyLogo.js.map +1 -0
  30. package/lib/commonjs/ui/components/OxyProvider.js +464 -0
  31. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -0
  32. package/lib/commonjs/ui/components/OxySignInButton.js +178 -0
  33. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -0
  34. package/lib/commonjs/ui/components/bottomSheet/index.js +37 -0
  35. package/lib/commonjs/ui/components/bottomSheet/index.js.map +1 -0
  36. package/lib/commonjs/ui/context/OxyContext.js +296 -0
  37. package/lib/commonjs/ui/context/OxyContext.js.map +1 -0
  38. package/lib/commonjs/ui/index.js +136 -0
  39. package/lib/commonjs/ui/index.js.map +1 -0
  40. package/lib/commonjs/ui/navigation/OxyRouter.js +140 -0
  41. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -0
  42. package/lib/commonjs/ui/navigation/types.js +6 -0
  43. package/lib/commonjs/ui/navigation/types.js.map +1 -0
  44. package/lib/commonjs/ui/screens/AccountCenterScreen.js +280 -0
  45. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -0
  46. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +578 -0
  47. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -0
  48. package/lib/commonjs/ui/screens/SignInScreen.js +230 -0
  49. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -0
  50. package/lib/commonjs/ui/screens/SignUpScreen.js +673 -0
  51. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -0
  52. package/lib/commonjs/ui/styles/FONTS.md +126 -0
  53. package/lib/commonjs/ui/styles/fonts.js +84 -0
  54. package/lib/commonjs/ui/styles/fonts.js.map +1 -0
  55. package/lib/commonjs/ui/styles/index.js +28 -0
  56. package/lib/commonjs/ui/styles/index.js.map +1 -0
  57. package/lib/commonjs/ui/styles/theme.js +122 -0
  58. package/lib/commonjs/ui/styles/theme.js.map +1 -0
  59. package/lib/module/assets/OxyLogo.svg +1 -0
  60. package/lib/module/assets/assets/OxyLogo.svg +1 -0
  61. package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  62. package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  63. package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  64. package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  65. package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  66. package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  67. package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  68. package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  69. package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  70. package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  71. package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  72. package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  73. package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  74. package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  75. package/lib/module/core/index.js +777 -0
  76. package/lib/module/core/index.js.map +1 -0
  77. package/lib/module/index.js +29 -0
  78. package/lib/module/index.js.map +1 -0
  79. package/lib/module/models/interfaces.js +2 -0
  80. package/lib/module/models/interfaces.js.map +1 -0
  81. package/lib/module/package.json +1 -0
  82. package/lib/module/ui/components/FontLoader.js +176 -0
  83. package/lib/module/ui/components/FontLoader.js.map +1 -0
  84. package/lib/module/ui/components/OxyLogo.js +49 -0
  85. package/lib/module/ui/components/OxyLogo.js.map +1 -0
  86. package/lib/module/ui/components/OxyProvider.js +458 -0
  87. package/lib/module/ui/components/OxyProvider.js.map +1 -0
  88. package/lib/module/ui/components/OxySignInButton.js +172 -0
  89. package/lib/module/ui/components/OxySignInButton.js.map +1 -0
  90. package/lib/module/ui/components/bottomSheet/index.js +8 -0
  91. package/lib/module/ui/components/bottomSheet/index.js.map +1 -0
  92. package/lib/module/ui/context/OxyContext.js +291 -0
  93. package/lib/module/ui/context/OxyContext.js.map +1 -0
  94. package/lib/module/ui/index.js +25 -0
  95. package/lib/module/ui/index.js.map +1 -0
  96. package/lib/module/ui/navigation/OxyRouter.js +133 -0
  97. package/lib/module/ui/navigation/OxyRouter.js.map +1 -0
  98. package/lib/module/ui/navigation/types.js +4 -0
  99. package/lib/module/ui/navigation/types.js.map +1 -0
  100. package/lib/module/ui/screens/AccountCenterScreen.js +275 -0
  101. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -0
  102. package/lib/module/ui/screens/AccountOverviewScreen.js +573 -0
  103. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -0
  104. package/lib/module/ui/screens/SignInScreen.js +224 -0
  105. package/lib/module/ui/screens/SignInScreen.js.map +1 -0
  106. package/lib/module/ui/screens/SignUpScreen.js +668 -0
  107. package/lib/module/ui/screens/SignUpScreen.js.map +1 -0
  108. package/lib/module/ui/styles/FONTS.md +126 -0
  109. package/lib/module/ui/styles/fonts.js +81 -0
  110. package/lib/module/ui/styles/fonts.js.map +1 -0
  111. package/lib/module/ui/styles/index.js +5 -0
  112. package/lib/module/ui/styles/index.js.map +1 -0
  113. package/lib/module/ui/styles/theme.js +115 -0
  114. package/lib/module/ui/styles/theme.js.map +1 -0
  115. package/lib/typescript/core/index.d.ts +304 -0
  116. package/lib/typescript/core/index.d.ts.map +1 -0
  117. package/lib/typescript/index.d.ts +11 -0
  118. package/lib/typescript/index.d.ts.map +1 -0
  119. package/lib/typescript/models/interfaces.d.ts +98 -0
  120. package/lib/typescript/models/interfaces.d.ts.map +1 -0
  121. package/lib/typescript/ui/components/FontLoader.d.ts +15 -0
  122. package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -0
  123. package/lib/typescript/ui/components/OxyLogo.d.ts +29 -0
  124. package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -0
  125. package/lib/typescript/ui/components/OxyProvider.d.ts +12 -0
  126. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -0
  127. package/lib/typescript/ui/components/OxySignInButton.d.ts +65 -0
  128. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -0
  129. package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -0
  130. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -0
  131. package/lib/typescript/ui/context/OxyContext.d.ts +26 -0
  132. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -0
  133. package/lib/typescript/ui/index.d.ts +15 -0
  134. package/lib/typescript/ui/index.d.ts.map +1 -0
  135. package/lib/typescript/ui/navigation/OxyRouter.d.ts +5 -0
  136. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -0
  137. package/lib/typescript/ui/navigation/types.d.ts +107 -0
  138. package/lib/typescript/ui/navigation/types.d.ts.map +1 -0
  139. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +5 -0
  140. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -0
  141. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +5 -0
  142. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -0
  143. package/lib/typescript/ui/screens/SignInScreen.d.ts +5 -0
  144. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -0
  145. package/lib/typescript/ui/screens/SignUpScreen.d.ts +5 -0
  146. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -0
  147. package/lib/typescript/ui/styles/fonts.d.ts +21 -0
  148. package/lib/typescript/ui/styles/fonts.d.ts.map +1 -0
  149. package/lib/typescript/ui/styles/index.d.ts +3 -0
  150. package/lib/typescript/ui/styles/index.d.ts.map +1 -0
  151. package/lib/typescript/ui/styles/theme.d.ts +69 -0
  152. package/lib/typescript/ui/styles/theme.d.ts.map +1 -0
  153. package/package.json +95 -51
  154. package/src/assets/OxyLogo.svg +1 -0
  155. package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  156. package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  157. package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  158. package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  159. package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  160. package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  161. package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  162. package/src/core/index.ts +768 -0
  163. package/src/index.ts +46 -0
  164. package/src/models/interfaces.ts +128 -0
  165. package/src/ui/components/FontLoader.tsx +180 -0
  166. package/src/ui/components/OxyLogo.tsx +73 -0
  167. package/src/ui/components/OxyProvider.tsx +490 -0
  168. package/src/ui/components/OxySignInButton.tsx +207 -0
  169. package/src/ui/components/bottomSheet/index.tsx +12 -0
  170. package/src/ui/context/OxyContext.tsx +344 -0
  171. package/src/ui/index.ts +27 -0
  172. package/src/ui/navigation/OxyRouter.tsx +137 -0
  173. package/src/ui/navigation/types.ts +124 -0
  174. package/src/ui/screens/AccountCenterScreen.tsx +240 -0
  175. package/src/ui/screens/AccountOverviewScreen.tsx +519 -0
  176. package/src/ui/screens/SignInScreen.tsx +210 -0
  177. package/src/ui/screens/SignUpScreen.tsx +607 -0
  178. package/src/ui/styles/FONTS.md +126 -0
  179. package/src/ui/styles/fonts.ts +77 -0
  180. package/src/ui/styles/index.ts +2 -0
  181. package/src/ui/styles/theme.ts +142 -0
  182. package/dist/index.d.ts +0 -152
  183. package/dist/index.js +0 -1
@@ -0,0 +1,240 @@
1
+ import React from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ StyleSheet,
7
+ ActivityIndicator,
8
+ ScrollView,
9
+ Alert,
10
+ Platform,
11
+ TextStyle,
12
+ } from 'react-native';
13
+ import { BaseScreenProps } from '../navigation/types';
14
+ import { useOxy } from '../context/OxyContext';
15
+ import { fontFamilies } from '../styles/fonts';
16
+
17
+ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
18
+ onClose,
19
+ theme,
20
+ }) => {
21
+ const { user, logout, isLoading } = useOxy();
22
+
23
+ const isDarkTheme = theme === 'dark';
24
+ const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
25
+ const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
26
+ const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#F5F5F5';
27
+ const borderColor = isDarkTheme ? '#444444' : '#E0E0E0';
28
+ const primaryColor = '#0066CC';
29
+ const dangerColor = '#D32F2F';
30
+
31
+ const handleLogout = async () => {
32
+ try {
33
+ await logout();
34
+ if (onClose) {
35
+ onClose();
36
+ }
37
+ } catch (error) {
38
+ console.error('Logout failed:', error);
39
+ Alert.alert('Logout Failed', 'There was a problem signing you out. Please try again.');
40
+ }
41
+ };
42
+
43
+ const confirmLogout = () => {
44
+ Alert.alert(
45
+ 'Sign Out',
46
+ 'Are you sure you want to sign out?',
47
+ [
48
+ {
49
+ text: 'Cancel',
50
+ style: 'cancel',
51
+ },
52
+ {
53
+ text: 'Sign Out',
54
+ onPress: handleLogout,
55
+ style: 'destructive',
56
+ },
57
+ ],
58
+ { cancelable: true }
59
+ );
60
+ };
61
+
62
+ if (!user) {
63
+ return (
64
+ <View style={[styles.container, { backgroundColor }]}>
65
+ <Text style={[styles.message, { color: textColor }]}>Not signed in</Text>
66
+ </View>
67
+ );
68
+ }
69
+
70
+ if (isLoading) {
71
+ return (
72
+ <View style={[styles.container, { backgroundColor, justifyContent: 'center' }]}>
73
+ <ActivityIndicator size="large" color={primaryColor} />
74
+ </View>
75
+ );
76
+ }
77
+
78
+ return (
79
+ <View style={[styles.container, { backgroundColor }]}>
80
+ <ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollContainer}>
81
+ <View style={styles.header}>
82
+ <Text style={[styles.title, { color: textColor }]}>Account</Text>
83
+ </View>
84
+
85
+ <View style={[styles.userInfoContainer, { backgroundColor: secondaryBackgroundColor, borderColor }]}>
86
+ <Text style={[styles.userName, { color: textColor }]}>{user.username}</Text>
87
+ {user.email && (
88
+ <Text style={[styles.userEmail, { color: isDarkTheme ? '#BBBBBB' : '#666666' }]}>
89
+ {user.email}
90
+ </Text>
91
+ )}
92
+ </View>
93
+
94
+ <View style={styles.actionsContainer}>
95
+ <TouchableOpacity
96
+ style={[styles.actionButton, { borderColor }]}
97
+ onPress={() => Alert.alert('Profile', 'Edit Profile feature coming soon!')}
98
+ >
99
+ <Text style={[styles.actionButtonText, { color: textColor }]}>Edit Profile</Text>
100
+ </TouchableOpacity>
101
+
102
+ <TouchableOpacity
103
+ style={[styles.actionButton, { borderColor }]}
104
+ onPress={() => Alert.alert('Settings', 'Account Settings feature coming soon!')}
105
+ >
106
+ <Text style={[styles.actionButtonText, { color: textColor }]}>Account Settings</Text>
107
+ </TouchableOpacity>
108
+
109
+ {Platform.OS !== 'web' && (
110
+ <TouchableOpacity
111
+ style={[styles.actionButton, { borderColor }]}
112
+ onPress={() => Alert.alert('Notifications', 'Notifications feature coming soon!')}
113
+ >
114
+ <Text style={[styles.actionButtonText, { color: textColor }]}>Notifications</Text>
115
+ </TouchableOpacity>
116
+ )}
117
+
118
+ <TouchableOpacity
119
+ style={[styles.actionButton, { borderColor }]}
120
+ onPress={() => Alert.alert('Help', 'Help & Support feature coming soon!')}
121
+ >
122
+ <Text style={[styles.actionButtonText, { color: textColor }]}>Help & Support</Text>
123
+ </TouchableOpacity>
124
+ </View>
125
+
126
+ <TouchableOpacity
127
+ style={[styles.logoutButton, { backgroundColor: isDarkTheme ? '#300000' : '#FFEBEE' }]}
128
+ onPress={confirmLogout}
129
+ disabled={isLoading}
130
+ >
131
+ {isLoading ? (
132
+ <ActivityIndicator color={dangerColor} size="small" />
133
+ ) : (
134
+ <Text style={[styles.logoutButtonText, { color: dangerColor }]}>Sign Out</Text>
135
+ )}
136
+ </TouchableOpacity>
137
+
138
+ <View style={styles.versionContainer}>
139
+ <Text style={[styles.versionText, { color: isDarkTheme ? '#666666' : '#999999' }]}>
140
+ Version 5.1.4
141
+ </Text>
142
+ </View>
143
+ </ScrollView>
144
+
145
+ <View style={styles.footer}>
146
+ <TouchableOpacity style={styles.closeButton} onPress={onClose}>
147
+ <Text style={[styles.closeButtonText, { color: primaryColor }]}>Close</Text>
148
+ </TouchableOpacity>
149
+ </View>
150
+ </View>
151
+ );
152
+ };
153
+
154
+ const styles = StyleSheet.create({
155
+ container: {
156
+ flex: 1,
157
+ },
158
+ scrollView: {
159
+ flex: 1,
160
+ },
161
+ scrollContainer: {
162
+ padding: 20,
163
+ },
164
+ header: {
165
+ marginBottom: 24,
166
+ alignItems: 'center',
167
+ },
168
+ title: {
169
+ fontFamily: Platform.OS === 'web'
170
+ ? 'Phudu' // Use CSS font name directly for web
171
+ : 'Phudu-Bold', // Use exact font name as registered with Font.loadAsync
172
+ fontWeight: Platform.OS === 'web' ? 'bold' : undefined, // Only apply fontWeight on web
173
+ fontSize: 24,
174
+ },
175
+ userInfoContainer: {
176
+ padding: 20,
177
+ borderRadius: 35,
178
+ borderWidth: 1,
179
+ marginBottom: 24,
180
+ alignItems: 'center',
181
+ },
182
+ userName: {
183
+ fontSize: 20,
184
+ fontWeight: 'bold',
185
+ marginBottom: 8,
186
+ },
187
+ userEmail: {
188
+ fontSize: 16,
189
+ },
190
+ actionsContainer: {
191
+ marginBottom: 24,
192
+ },
193
+ actionButton: {
194
+ paddingVertical: 16,
195
+ paddingHorizontal: 20,
196
+ borderBottomWidth: 1,
197
+ },
198
+ actionButtonText: {
199
+ fontSize: 16,
200
+ },
201
+ logoutButton: {
202
+ height: 50,
203
+ borderRadius: 35,
204
+ alignItems: 'center',
205
+ justifyContent: 'center',
206
+ marginBottom: 24,
207
+ },
208
+ logoutButtonText: {
209
+ fontSize: 16,
210
+ fontWeight: '600',
211
+ },
212
+ versionContainer: {
213
+ alignItems: 'center',
214
+ marginBottom: 20,
215
+ },
216
+ versionText: {
217
+ fontSize: 14,
218
+ },
219
+ footer: {
220
+ padding: 16,
221
+ borderTopWidth: 1,
222
+ borderTopColor: '#E0E0E0',
223
+ alignItems: 'center',
224
+ },
225
+ closeButton: {
226
+ paddingVertical: 8,
227
+ paddingHorizontal: 16,
228
+ },
229
+ closeButtonText: {
230
+ fontSize: 16,
231
+ fontWeight: '600',
232
+ },
233
+ message: {
234
+ fontSize: 16,
235
+ textAlign: 'center',
236
+ marginTop: 24,
237
+ },
238
+ });
239
+
240
+ export default AccountCenterScreen;