@oxyhq/services 5.3.10 → 5.3.11

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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -571
  3. package/lib/commonjs/core/index.js +103 -34
  4. package/lib/commonjs/core/index.js.map +1 -1
  5. package/lib/commonjs/lib/sonner.js +17 -0
  6. package/lib/commonjs/lib/sonner.js.map +1 -0
  7. package/lib/commonjs/lib/sonner.web.js +17 -0
  8. package/lib/commonjs/lib/sonner.web.js.map +1 -0
  9. package/lib/commonjs/ui/components/FollowButton.js +54 -4
  10. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  11. package/lib/commonjs/ui/components/OxyProvider.js +22 -3
  12. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  13. package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -3
  14. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  15. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +15 -14
  16. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  17. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +10 -9
  18. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  19. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +17 -16
  20. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  21. package/lib/commonjs/ui/screens/AppInfoScreen.js +4 -5
  22. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/SessionManagementScreen.js +7 -6
  24. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/SignInScreen.js +821 -74
  26. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  27. package/lib/commonjs/ui/screens/SignUpScreen.js +7 -5
  28. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  29. package/lib/commonjs/ui/styles/theme.js +1 -1
  30. package/lib/module/core/index.js +103 -34
  31. package/lib/module/core/index.js.map +1 -1
  32. package/lib/module/lib/sonner.js +4 -0
  33. package/lib/module/lib/sonner.js.map +1 -0
  34. package/lib/module/lib/sonner.web.js +4 -0
  35. package/lib/module/lib/sonner.web.js.map +1 -0
  36. package/lib/module/ui/components/FollowButton.js +54 -4
  37. package/lib/module/ui/components/FollowButton.js.map +1 -1
  38. package/lib/module/ui/components/OxyProvider.js +22 -3
  39. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  40. package/lib/module/ui/screens/AccountCenterScreen.js +4 -3
  41. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  42. package/lib/module/ui/screens/AccountOverviewScreen.js +15 -14
  43. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  44. package/lib/module/ui/screens/AccountSettingsScreen.js +10 -9
  45. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  46. package/lib/module/ui/screens/AccountSwitcherScreen.js +17 -16
  47. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  48. package/lib/module/ui/screens/AppInfoScreen.js +5 -6
  49. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  50. package/lib/module/ui/screens/SessionManagementScreen.js +7 -6
  51. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  52. package/lib/module/ui/screens/SignInScreen.js +824 -77
  53. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  54. package/lib/module/ui/screens/SignUpScreen.js +7 -5
  55. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  56. package/lib/module/ui/styles/theme.js +1 -1
  57. package/lib/typescript/core/index.d.ts +44 -23
  58. package/lib/typescript/core/index.d.ts.map +1 -1
  59. package/lib/typescript/lib/sonner.d.ts +2 -0
  60. package/lib/typescript/lib/sonner.d.ts.map +1 -0
  61. package/lib/typescript/lib/sonner.web.d.ts +2 -0
  62. package/lib/typescript/lib/sonner.web.d.ts.map +1 -0
  63. package/lib/typescript/models/interfaces.d.ts +24 -0
  64. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  65. package/lib/typescript/ui/components/FollowButton.d.ts +32 -1
  66. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  67. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  68. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  69. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  70. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  71. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  72. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  73. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  74. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  75. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
  76. package/package.json +5 -3
  77. package/src/core/index.ts +104 -36
  78. package/src/lib/sonner.ts +1 -0
  79. package/src/lib/sonner.web.ts +1 -0
  80. package/src/models/interfaces.ts +29 -0
  81. package/src/ui/components/FollowButton.tsx +67 -3
  82. package/src/ui/components/OxyProvider.tsx +15 -0
  83. package/src/ui/screens/AccountCenterScreen.tsx +4 -3
  84. package/src/ui/screens/AccountOverviewScreen.tsx +15 -14
  85. package/src/ui/screens/AccountSettingsScreen.tsx +10 -9
  86. package/src/ui/screens/AccountSwitcherScreen.tsx +17 -16
  87. package/src/ui/screens/AppInfoScreen.tsx +4 -7
  88. package/src/ui/screens/SessionManagementScreen.tsx +7 -15
  89. package/src/ui/screens/SignInScreen.tsx +729 -52
  90. package/src/ui/screens/SignUpScreen.tsx +7 -5
  91. package/src/ui/styles/theme.ts +1 -1
  92. package/CHANGELOG.md +0 -97
  93. package/UI_COMPONENTS.md +0 -462
@@ -9,17 +9,34 @@ var _reactNative = require("react-native");
9
9
  var _OxyContext = require("../context/OxyContext");
10
10
  var _styles = require("../styles");
11
11
  var _OxyLogo = _interopRequireDefault(require("../components/OxyLogo"));
12
+ var _Avatar = _interopRequireDefault(require("../components/Avatar"));
12
13
  var _bottomSheet = require("@gorhom/bottom-sheet");
14
+ var _vectorIcons = require("@expo/vector-icons");
15
+ var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
16
+ var _sonner = require("../../lib/sonner");
13
17
  var _jsxRuntime = require("react/jsx-runtime");
14
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
20
  const SignInScreen = ({
17
21
  navigate,
22
+ goBack,
18
23
  theme
19
24
  }) => {
25
+ // Form data states
20
26
  const [username, setUsername] = (0, _react.useState)('');
21
27
  const [password, setPassword] = (0, _react.useState)('');
22
28
  const [errorMessage, setErrorMessage] = (0, _react.useState)('');
29
+ const [userProfile, setUserProfile] = (0, _react.useState)(null);
30
+
31
+ // Multi-step form states
32
+ const [currentStep, setCurrentStep] = (0, _react.useState)(0);
33
+ const [isInputFocused, setIsInputFocused] = (0, _react.useState)(false);
34
+ const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
35
+ const slideAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
36
+ const scaleAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
37
+ const inputScaleAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
38
+ const logoAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
39
+ const progressAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0.5)).current;
23
40
  const {
24
41
  login,
25
42
  isLoading,
@@ -32,9 +49,126 @@ const SignInScreen = ({
32
49
 
33
50
  // Check if this should be treated as "Add Account" mode
34
51
  const isAddAccountMode = user && isAuthenticated && sessions && sessions.length > 0;
52
+
53
+ // Initialize logo animation
54
+ (0, _react.useEffect)(() => {
55
+ _reactNative.Animated.spring(logoAnim, {
56
+ toValue: 1,
57
+ tension: 50,
58
+ friction: 8,
59
+ useNativeDriver: true
60
+ }).start();
61
+ }, []);
62
+
63
+ // Input focus animations
64
+ const handleInputFocus = () => {
65
+ setIsInputFocused(true);
66
+ _reactNative.Animated.spring(inputScaleAnim, {
67
+ toValue: 1.02,
68
+ useNativeDriver: true
69
+ }).start();
70
+ };
71
+ const handleInputBlur = () => {
72
+ setIsInputFocused(false);
73
+ _reactNative.Animated.spring(inputScaleAnim, {
74
+ toValue: 1,
75
+ useNativeDriver: true
76
+ }).start();
77
+ };
78
+
79
+ // Animation functions
80
+ const animateTransition = nextStep => {
81
+ // Scale down current content
82
+ _reactNative.Animated.timing(scaleAnim, {
83
+ toValue: 0.95,
84
+ duration: 150,
85
+ useNativeDriver: true
86
+ }).start();
87
+
88
+ // Fade out
89
+ _reactNative.Animated.timing(fadeAnim, {
90
+ toValue: 0,
91
+ duration: 200,
92
+ useNativeDriver: true
93
+ }).start(() => {
94
+ setCurrentStep(nextStep);
95
+
96
+ // Reset animations
97
+ slideAnim.setValue(-50);
98
+ scaleAnim.setValue(0.95);
99
+
100
+ // Animate in new content
101
+ _reactNative.Animated.parallel([_reactNative.Animated.timing(fadeAnim, {
102
+ toValue: 1,
103
+ duration: 300,
104
+ useNativeDriver: true
105
+ }), _reactNative.Animated.spring(slideAnim, {
106
+ toValue: 0,
107
+ tension: 80,
108
+ friction: 8,
109
+ useNativeDriver: true
110
+ }), _reactNative.Animated.spring(scaleAnim, {
111
+ toValue: 1,
112
+ tension: 80,
113
+ friction: 8,
114
+ useNativeDriver: true
115
+ })]).start();
116
+ });
117
+ };
118
+ const nextStep = () => {
119
+ if (currentStep < 1) {
120
+ // Animate progress bar
121
+ _reactNative.Animated.timing(progressAnim, {
122
+ toValue: 1.0,
123
+ duration: 300,
124
+ useNativeDriver: false
125
+ }).start();
126
+ animateTransition(currentStep + 1);
127
+ }
128
+ };
129
+ const prevStep = () => {
130
+ if (currentStep > 0) {
131
+ // Animate progress bar
132
+ _reactNative.Animated.timing(progressAnim, {
133
+ toValue: 0.5,
134
+ duration: 300,
135
+ useNativeDriver: false
136
+ }).start();
137
+ animateTransition(currentStep - 1);
138
+ }
139
+ };
140
+
141
+ // Fetch user profile when username is entered
142
+ (0, _react.useEffect)(() => {
143
+ const fetchUserProfile = async () => {
144
+ if (username.length >= 3 && currentStep === 1) {
145
+ try {
146
+ // For now, we'll create a mock profile based on username
147
+ // In a real app, you'd fetch this from your API
148
+ setUserProfile({
149
+ displayName: username,
150
+ name: username,
151
+ avatar: null // Could be fetched from API
152
+ });
153
+ } catch (error) {
154
+ // If user not found, we'll show a generic avatar
155
+ setUserProfile(null);
156
+ }
157
+ }
158
+ };
159
+ fetchUserProfile();
160
+ }, [username, currentStep]);
161
+ const handleUsernameNext = () => {
162
+ if (!username) {
163
+ _sonner.toast.error('Please enter your username');
164
+ return;
165
+ }
166
+ setErrorMessage('');
167
+ nextStep();
168
+ };
35
169
  const handleLogin = async () => {
36
170
  if (!username || !password) {
37
- setErrorMessage('Please enter both username and password');
171
+ _sonner.toast.error('Please enter both username and password');
38
172
  return;
39
173
  }
40
174
  try {
@@ -42,114 +176,431 @@ const SignInScreen = ({
42
176
  await login(username, password);
43
177
  // The authentication state change will be handled through context
44
178
  } catch (error) {
45
- setErrorMessage(error.message || 'Login failed');
179
+ _sonner.toast.error(error.message || 'Login failed');
46
180
  }
47
181
  };
48
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_bottomSheet.BottomSheetScrollView, {
49
- contentContainerStyle: commonStyles.scrollContainer,
50
- keyboardShouldPersistTaps: "handled",
51
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
52
- style: {
53
- marginBottom: 24
54
- },
55
- width: 50,
56
- height: 50
57
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
58
- style: [styles.title, {
59
- color: colors.text
60
- }],
61
- children: isAddAccountMode ? 'Add Another Account' : 'Sign In'
62
- }), isAddAccountMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
63
- style: [styles.infoContainer, {
182
+
183
+ // Step components
184
+ const renderUsernameStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
185
+ style: [styles.stepContainer, {
186
+ opacity: fadeAnim,
187
+ transform: [{
188
+ translateX: slideAnim
189
+ }, {
190
+ scale: scaleAnim
191
+ }]
192
+ }],
193
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
194
+ style: styles.modernImageContainer,
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
196
+ width: 280,
197
+ height: 160,
198
+ viewBox: "0 0 280 160",
199
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Defs, {
200
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
201
+ id: "primaryGradient",
202
+ x1: "0%",
203
+ y1: "0%",
204
+ x2: "100%",
205
+ y2: "100%",
206
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
207
+ offset: "0%",
208
+ stopColor: colors.primary,
209
+ stopOpacity: "0.8"
210
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
211
+ offset: "100%",
212
+ stopColor: colors.primary,
213
+ stopOpacity: "0.2"
214
+ })]
215
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
216
+ id: "secondaryGradient",
217
+ x1: "0%",
218
+ y1: "0%",
219
+ x2: "100%",
220
+ y2: "100%",
221
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
222
+ offset: "0%",
223
+ stopColor: colors.primary,
224
+ stopOpacity: "0.1"
225
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
226
+ offset: "100%",
227
+ stopColor: colors.primary,
228
+ stopOpacity: "0.3"
229
+ })]
230
+ })]
231
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
232
+ cx: "80",
233
+ cy: "80",
234
+ r: "45",
235
+ fill: "url(#primaryGradient)"
236
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
237
+ cx: "200",
238
+ cy: "80",
239
+ r: "35",
240
+ fill: "url(#secondaryGradient)"
241
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
242
+ d: "M40 120 Q80 40 140 80 Q200 120 240 60",
243
+ stroke: colors.primary,
244
+ strokeWidth: "4",
245
+ fill: "none",
246
+ strokeLinecap: "round"
247
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
248
+ cx: "60",
249
+ cy: "50",
250
+ r: "8",
251
+ fill: colors.primary,
252
+ opacity: "0.6"
253
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
254
+ cx: "220",
255
+ cy: "120",
256
+ r: "6",
257
+ fill: colors.primary,
258
+ opacity: "0.4"
259
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
260
+ cx: "250",
261
+ cy: "40",
262
+ r: "4",
263
+ fill: colors.primary,
264
+ opacity: "0.8"
265
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
266
+ cx: "140",
267
+ cy: "80",
268
+ r: "25",
269
+ fill: colors.background,
270
+ opacity: "0.9"
271
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
272
+ cx: "135",
273
+ cy: "75",
274
+ r: "3",
275
+ fill: colors.primary
276
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Circle, {
277
+ cx: "145",
278
+ cy: "75",
279
+ r: "3",
280
+ fill: colors.primary
281
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Path, {
282
+ d: "M132 85 Q140 92 148 85",
283
+ stroke: colors.primary,
284
+ strokeWidth: "2",
285
+ fill: "none",
286
+ strokeLinecap: "round"
287
+ })]
288
+ })
289
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
290
+ style: styles.modernHeader,
291
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
292
+ style: [styles.modernTitle, {
293
+ color: colors.text
294
+ }],
295
+ children: isAddAccountMode ? 'Add Account' : 'Welcome Back'
296
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
297
+ style: [styles.modernSubtitle, {
298
+ color: colors.secondaryText
299
+ }],
300
+ children: isAddAccountMode ? 'Sign in with another account' : 'Sign in to continue your journey'
301
+ })]
302
+ }), isAddAccountMode && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
303
+ style: [styles.modernInfoCard, {
64
304
  backgroundColor: colors.inputBackground
65
305
  }],
66
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
67
- style: [styles.infoText, {
68
- color: colors.secondaryText
306
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
307
+ name: "information-circle",
308
+ size: 20,
309
+ color: colors.primary
310
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
311
+ style: [styles.modernInfoText, {
312
+ color: colors.text
313
+ }],
314
+ children: ["Currently signed in as ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
315
+ style: {
316
+ fontWeight: 'bold'
317
+ },
318
+ children: user?.username
319
+ })]
320
+ })]
321
+ }), errorMessage ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
322
+ style: [styles.modernErrorCard, {
323
+ backgroundColor: '#FF6B6B20'
324
+ }],
325
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
326
+ name: "alert-circle",
327
+ size: 20,
328
+ color: "#FF6B6B"
329
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
330
+ style: [styles.errorText, {
331
+ color: '#FF6B6B'
69
332
  }],
70
- children: ["Currently signed in as ", user?.username, ". Sign in with another account to add it to this device."]
71
- })
72
- }), errorMessage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
73
- style: commonStyles.errorContainer,
74
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
75
- style: commonStyles.errorText,
76
333
  children: errorMessage
77
- })
78
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
79
- style: styles.formContainer,
80
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
81
- style: styles.inputContainer,
82
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
83
- style: [styles.label, {
334
+ })]
335
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
336
+ style: [styles.modernInputContainer, {
337
+ transform: [{
338
+ scale: inputScaleAnim
339
+ }]
340
+ }],
341
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
342
+ style: [styles.inputWrapper, {
343
+ borderColor: isInputFocused ? colors.primary : colors.border
344
+ }],
345
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
346
+ name: "person-outline",
347
+ size: 20,
348
+ color: isInputFocused ? colors.primary : colors.secondaryText,
349
+ style: styles.inputIcon
350
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
351
+ style: [styles.modernInput, {
84
352
  color: colors.text
85
353
  }],
86
- children: "Username"
87
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
88
- style: commonStyles.input,
89
354
  placeholder: "Enter your username",
90
355
  placeholderTextColor: colors.placeholder,
91
356
  value: username,
92
357
  onChangeText: setUsername,
358
+ onFocus: handleInputFocus,
359
+ onBlur: handleInputBlur,
93
360
  autoCapitalize: "none",
94
361
  testID: "username-input"
95
362
  })]
363
+ })
364
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
365
+ style: [styles.modernButton, {
366
+ backgroundColor: colors.primary,
367
+ opacity: !username ? 0.5 : 1,
368
+ shadowColor: colors.primary
369
+ }],
370
+ onPress: handleUsernameNext,
371
+ disabled: !username,
372
+ testID: "username-next-button",
373
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
374
+ style: styles.modernButtonText,
375
+ children: "Continue"
376
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
377
+ name: "arrow-forward",
378
+ size: 20,
379
+ color: "#FFFFFF",
380
+ style: styles.buttonIcon
381
+ })]
382
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
383
+ style: styles.footerTextContainer,
384
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
385
+ style: [styles.footerText, {
386
+ color: colors.secondaryText
387
+ }],
388
+ children: ["Don't have an account?", ' ']
389
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
390
+ onPress: () => navigate('SignUp'),
391
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
392
+ style: [styles.modernLinkText, {
393
+ color: colors.primary
394
+ }],
395
+ children: "Sign Up"
396
+ })
397
+ })]
398
+ })]
399
+ });
400
+ const renderPasswordStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
401
+ style: [styles.stepContainer, {
402
+ opacity: fadeAnim,
403
+ transform: [{
404
+ translateX: slideAnim
405
+ }, {
406
+ scale: scaleAnim
407
+ }]
408
+ }],
409
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
410
+ style: styles.modernUserProfileContainer,
411
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
412
+ style: [styles.avatarContainer, {
413
+ transform: [{
414
+ scale: logoAnim
415
+ }]
416
+ }],
417
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
418
+ uri: userProfile?.avatar,
419
+ name: userProfile?.displayName || userProfile?.name || username,
420
+ size: 100,
421
+ theme: theme,
422
+ style: styles.modernUserAvatar
423
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
424
+ style: [styles.statusIndicator, {
425
+ backgroundColor: colors.primary
426
+ }]
427
+ })]
428
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
429
+ style: [styles.modernUserDisplayName, {
430
+ color: colors.text
431
+ }],
432
+ children: userProfile?.displayName || userProfile?.name || username
433
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
434
+ style: [styles.modernUsernameSubtext, {
435
+ color: colors.secondaryText
436
+ }],
437
+ children: ["@", username]
96
438
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
97
- style: styles.inputContainer,
98
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
99
- style: [styles.label, {
100
- color: colors.text
439
+ style: [styles.welcomeBackBadge, {
440
+ backgroundColor: colors.primary + '15'
441
+ }],
442
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
443
+ name: "checkmark-circle",
444
+ size: 16,
445
+ color: colors.primary
446
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
447
+ style: [styles.welcomeBackText, {
448
+ color: colors.primary
101
449
  }],
102
- children: "Password"
450
+ children: "Welcome back!"
451
+ })]
452
+ })]
453
+ }), errorMessage ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
454
+ style: [styles.modernErrorCard, {
455
+ backgroundColor: '#FF6B6B20'
456
+ }],
457
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
458
+ name: "alert-circle",
459
+ size: 20,
460
+ color: "#FF6B6B"
461
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
462
+ style: [styles.errorText, {
463
+ color: '#FF6B6B'
464
+ }],
465
+ children: errorMessage
466
+ })]
467
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
468
+ style: [styles.modernInputContainer, {
469
+ transform: [{
470
+ scale: inputScaleAnim
471
+ }]
472
+ }],
473
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
474
+ style: [styles.inputWrapper, {
475
+ borderColor: isInputFocused ? colors.primary : colors.border
476
+ }],
477
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
478
+ name: "lock-closed-outline",
479
+ size: 20,
480
+ color: isInputFocused ? colors.primary : colors.secondaryText,
481
+ style: styles.inputIcon
103
482
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
104
- style: commonStyles.input,
483
+ style: [styles.modernInput, {
484
+ color: colors.text
485
+ }],
105
486
  placeholder: "Enter your password",
106
487
  placeholderTextColor: colors.placeholder,
107
488
  value: password,
108
489
  onChangeText: setPassword,
490
+ onFocus: handleInputFocus,
491
+ onBlur: handleInputBlur,
109
492
  secureTextEntry: true,
110
493
  testID: "password-input"
111
494
  })]
112
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
113
- style: [commonStyles.button, {
114
- opacity: isLoading ? 0.8 : 1
115
- }],
116
- onPress: handleLogin,
117
- disabled: isLoading,
118
- testID: "login-button",
119
- children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
120
- color: "#FFFFFF",
121
- size: "small"
122
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
123
- style: commonStyles.buttonText,
495
+ })
496
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
497
+ style: [styles.modernButton, {
498
+ backgroundColor: colors.primary,
499
+ opacity: isLoading ? 0.8 : 1,
500
+ shadowColor: colors.primary
501
+ }],
502
+ onPress: handleLogin,
503
+ disabled: isLoading,
504
+ testID: "login-button",
505
+ children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
506
+ color: "#FFFFFF",
507
+ size: "small"
508
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
509
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
510
+ style: styles.modernButtonText,
124
511
  children: isAddAccountMode ? 'Add Account' : 'Sign In'
125
- })
126
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
127
- style: styles.footerTextContainer,
128
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
129
- style: [styles.footerText, {
512
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
513
+ name: "arrow-forward",
514
+ size: 20,
515
+ color: "#FFFFFF",
516
+ style: styles.buttonIcon
517
+ })]
518
+ })
519
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
520
+ style: styles.modernNavigationButtons,
521
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
522
+ style: [styles.modernBackButton, {
523
+ borderColor: colors.border
524
+ }],
525
+ onPress: prevStep,
526
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
527
+ name: "chevron-back",
528
+ size: 20,
529
+ color: colors.text
530
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
531
+ style: [styles.modernBackButtonText, {
130
532
  color: colors.text
131
533
  }],
132
- children: ["Don't have an account?", ' ']
133
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
134
- onPress: () => navigate('SignUp'),
135
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
136
- style: [styles.linkText, {
137
- color: colors.primary
138
- }],
139
- children: "Sign Up"
140
- })
534
+ children: "Back"
141
535
  })]
536
+ })
537
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
538
+ style: styles.securityNotice,
539
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
540
+ name: "shield-checkmark",
541
+ size: 16,
542
+ color: colors.secondaryText
543
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
544
+ style: [styles.securityText, {
545
+ color: colors.secondaryText
546
+ }],
547
+ children: "Your connection is secure and encrypted"
142
548
  })]
143
549
  })]
144
550
  });
551
+ const renderCurrentStep = () => {
552
+ switch (currentStep) {
553
+ case 0:
554
+ return renderUsernameStep();
555
+ case 1:
556
+ return renderPasswordStep();
557
+ default:
558
+ return renderUsernameStep();
559
+ }
560
+ };
561
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_bottomSheet.BottomSheetScrollView, {
562
+ contentContainerStyle: commonStyles.scrollContainer,
563
+ keyboardShouldPersistTaps: "handled",
564
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
565
+ style: [styles.logoContainer, {
566
+ transform: [{
567
+ scale: logoAnim
568
+ }]
569
+ }],
570
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
571
+ style: {
572
+ marginBottom: 24
573
+ },
574
+ width: 50,
575
+ height: 50
576
+ })
577
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
578
+ style: styles.modernProgressContainer,
579
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
580
+ style: styles.progressTrack,
581
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
582
+ style: [styles.progressFill, {
583
+ backgroundColor: colors.primary,
584
+ width: progressAnim.interpolate({
585
+ inputRange: [0, 1],
586
+ outputRange: ['50%', '100%']
587
+ })
588
+ }]
589
+ })
590
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
591
+ style: [styles.progressText, {
592
+ color: colors.secondaryText
593
+ }],
594
+ children: ["Step ", currentStep + 1, " of 2"]
595
+ })]
596
+ }), renderCurrentStep()]
597
+ });
145
598
  };
146
599
  const styles = _reactNative.StyleSheet.create({
600
+ // Legacy styles (keeping for compatibility)
147
601
  title: {
148
- fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' // Use CSS font name directly for web
149
- : 'Phudu-Bold',
150
- // Use exact font name as registered with Font.loadAsync
602
+ fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
151
603
  fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
152
- // Only apply fontWeight on web
153
604
  fontSize: 54,
154
605
  marginBottom: 24
155
606
  },
@@ -178,7 +629,6 @@ const styles = _reactNative.StyleSheet.create({
178
629
  lineHeight: 20,
179
630
  fontWeight: '600'
180
631
  },
181
- // New styles for authenticated user view
182
632
  userInfoContainer: {
183
633
  padding: 20,
184
634
  marginVertical: 20,
@@ -203,6 +653,303 @@ const styles = _reactNative.StyleSheet.create({
203
653
  fontSize: 14,
204
654
  lineHeight: 20,
205
655
  textAlign: 'center'
656
+ },
657
+ // Modern UI Styles
658
+ logoContainer: {
659
+ alignItems: 'center',
660
+ marginBottom: 16
661
+ },
662
+ modernProgressContainer: {
663
+ alignItems: 'center',
664
+ marginBottom: 40,
665
+ paddingHorizontal: 20
666
+ },
667
+ progressTrack: {
668
+ width: '100%',
669
+ height: 4,
670
+ backgroundColor: '#E5E5E5',
671
+ borderRadius: 2,
672
+ marginBottom: 8,
673
+ overflow: 'hidden'
674
+ },
675
+ progressFill: {
676
+ height: '100%',
677
+ borderRadius: 2
678
+ },
679
+ progressText: {
680
+ fontSize: 12,
681
+ fontWeight: '500'
682
+ },
683
+ stepContainer: {
684
+ width: '100%',
685
+ minHeight: 450,
686
+ paddingHorizontal: 20
687
+ },
688
+ // Modern Image Container
689
+ modernImageContainer: {
690
+ alignItems: 'center',
691
+ marginBottom: 40,
692
+ paddingVertical: 20
693
+ },
694
+ modernHeader: {
695
+ alignItems: 'center',
696
+ marginBottom: 24
697
+ },
698
+ modernTitle: {
699
+ fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
700
+ fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
701
+ fontSize: 54,
702
+ textAlign: 'center',
703
+ marginBottom: 8,
704
+ letterSpacing: -0.5
705
+ },
706
+ modernSubtitle: {
707
+ fontSize: 16,
708
+ lineHeight: 22,
709
+ textAlign: 'center',
710
+ opacity: 0.8
711
+ },
712
+ // Modern Cards
713
+ modernInfoCard: {
714
+ flexDirection: 'row',
715
+ alignItems: 'center',
716
+ padding: 16,
717
+ marginVertical: 16,
718
+ borderRadius: 12,
719
+ gap: 12
720
+ },
721
+ modernInfoText: {
722
+ fontSize: 14,
723
+ lineHeight: 20,
724
+ flex: 1
725
+ },
726
+ modernErrorCard: {
727
+ flexDirection: 'row',
728
+ alignItems: 'center',
729
+ padding: 16,
730
+ marginVertical: 16,
731
+ borderRadius: 12,
732
+ gap: 12
733
+ },
734
+ errorText: {
735
+ fontSize: 14,
736
+ lineHeight: 20,
737
+ flex: 1
738
+ },
739
+ // Modern Input Styles
740
+ modernInputContainer: {
741
+ marginBottom: 24
742
+ },
743
+ inputWrapper: {
744
+ flexDirection: 'row',
745
+ alignItems: 'center',
746
+ borderWidth: 2,
747
+ borderRadius: 16,
748
+ paddingHorizontal: 16,
749
+ paddingVertical: 4,
750
+ backgroundColor: 'rgba(0,0,0,0.02)'
751
+ },
752
+ inputIcon: {
753
+ marginRight: 12
754
+ },
755
+ modernInput: {
756
+ flex: 1,
757
+ fontSize: 16,
758
+ paddingVertical: 16,
759
+ fontWeight: '500'
760
+ },
761
+ // Modern Button Styles
762
+ modernButton: {
763
+ flexDirection: 'row',
764
+ alignItems: 'center',
765
+ justifyContent: 'center',
766
+ paddingVertical: 18,
767
+ paddingHorizontal: 32,
768
+ borderRadius: 16,
769
+ marginVertical: 8,
770
+ shadowOffset: {
771
+ width: 0,
772
+ height: 4
773
+ },
774
+ shadowOpacity: 0.3,
775
+ shadowRadius: 8,
776
+ elevation: 6,
777
+ gap: 8
778
+ },
779
+ modernButtonText: {
780
+ color: '#FFFFFF',
781
+ fontSize: 16,
782
+ fontWeight: '600',
783
+ letterSpacing: 0.5
784
+ },
785
+ buttonIcon: {
786
+ marginLeft: 4
787
+ },
788
+ modernLinkText: {
789
+ fontSize: 14,
790
+ lineHeight: 20,
791
+ fontWeight: '600',
792
+ textDecorationLine: 'underline'
793
+ },
794
+ // Modern User Profile Styles
795
+ modernUserProfileContainer: {
796
+ alignItems: 'center',
797
+ marginBottom: 32,
798
+ paddingVertical: 24
799
+ },
800
+ avatarContainer: {
801
+ position: 'relative',
802
+ marginBottom: 20
803
+ },
804
+ modernUserAvatar: {
805
+ borderWidth: 4,
806
+ borderColor: 'rgba(209, 105, 229, 0.2)'
807
+ },
808
+ statusIndicator: {
809
+ position: 'absolute',
810
+ bottom: 4,
811
+ right: 4,
812
+ width: 20,
813
+ height: 20,
814
+ borderRadius: 10,
815
+ borderWidth: 3,
816
+ borderColor: '#FFFFFF'
817
+ },
818
+ modernUserDisplayName: {
819
+ fontSize: 26,
820
+ fontWeight: '700',
821
+ marginBottom: 4,
822
+ textAlign: 'center',
823
+ letterSpacing: -0.5
824
+ },
825
+ modernUsernameSubtext: {
826
+ fontSize: 16,
827
+ textAlign: 'center',
828
+ marginBottom: 16,
829
+ opacity: 0.7
830
+ },
831
+ welcomeBackBadge: {
832
+ flexDirection: 'row',
833
+ alignItems: 'center',
834
+ paddingHorizontal: 12,
835
+ paddingVertical: 6,
836
+ borderRadius: 20,
837
+ gap: 6
838
+ },
839
+ welcomeBackText: {
840
+ fontSize: 12,
841
+ fontWeight: '600',
842
+ textTransform: 'uppercase',
843
+ letterSpacing: 0.5
844
+ },
845
+ // Modern Navigation
846
+ modernNavigationButtons: {
847
+ flexDirection: 'row',
848
+ justifyContent: 'center',
849
+ marginTop: 24,
850
+ marginBottom: 16
851
+ },
852
+ modernBackButton: {
853
+ flexDirection: 'row',
854
+ alignItems: 'center',
855
+ paddingVertical: 12,
856
+ paddingHorizontal: 20,
857
+ borderRadius: 12,
858
+ borderWidth: 1,
859
+ gap: 8
860
+ },
861
+ modernBackButtonText: {
862
+ fontSize: 16,
863
+ fontWeight: '500'
864
+ },
865
+ // Security Notice
866
+ securityNotice: {
867
+ flexDirection: 'row',
868
+ alignItems: 'center',
869
+ justifyContent: 'center',
870
+ marginTop: 20,
871
+ gap: 6
872
+ },
873
+ securityText: {
874
+ fontSize: 12,
875
+ fontWeight: '500'
876
+ },
877
+ // Legacy compatibility styles
878
+ progressContainer: {
879
+ flexDirection: 'row',
880
+ alignItems: 'center',
881
+ justifyContent: 'center',
882
+ marginBottom: 32,
883
+ paddingHorizontal: 40
884
+ },
885
+ progressDot: {
886
+ width: 12,
887
+ height: 12,
888
+ borderRadius: 6,
889
+ marginHorizontal: 4
890
+ },
891
+ progressLine: {
892
+ flex: 1,
893
+ height: 2,
894
+ marginHorizontal: 8
895
+ },
896
+ welcomeImageContainer: {
897
+ alignItems: 'center',
898
+ marginBottom: 32
899
+ },
900
+ header: {
901
+ alignItems: 'center',
902
+ marginBottom: 16
903
+ },
904
+ welcomeTitle: {
905
+ fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
906
+ fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
907
+ fontSize: 32,
908
+ textAlign: 'center',
909
+ marginBottom: 8
910
+ },
911
+ welcomeText: {
912
+ fontSize: 16,
913
+ lineHeight: 24,
914
+ textAlign: 'center',
915
+ marginBottom: 32,
916
+ paddingHorizontal: 20
917
+ },
918
+ userProfileContainer: {
919
+ alignItems: 'center',
920
+ marginBottom: 32,
921
+ paddingVertical: 20
922
+ },
923
+ userAvatar: {
924
+ marginBottom: 16
925
+ },
926
+ userDisplayName: {
927
+ fontSize: 24,
928
+ fontWeight: 'bold',
929
+ marginBottom: 4,
930
+ textAlign: 'center'
931
+ },
932
+ usernameSubtext: {
933
+ fontSize: 16,
934
+ textAlign: 'center'
935
+ },
936
+ navigationButtons: {
937
+ flexDirection: 'row',
938
+ justifyContent: 'center',
939
+ marginTop: 24
940
+ },
941
+ backButton: {
942
+ flexDirection: 'row',
943
+ alignItems: 'center',
944
+ paddingVertical: 12,
945
+ paddingHorizontal: 20,
946
+ borderRadius: 12,
947
+ borderWidth: 1
948
+ },
949
+ backButtonText: {
950
+ fontSize: 16,
951
+ fontWeight: '500',
952
+ marginLeft: 8
206
953
  }
207
954
  });
208
955
  var _default = exports.default = SignInScreen;