@oxyhq/services 5.11.9 → 5.11.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 (305) hide show
  1. package/lib/commonjs/ui/components/AnimationExample.js +213 -0
  2. package/lib/commonjs/ui/components/AnimationExample.js.map +1 -0
  3. package/lib/commonjs/ui/components/FollowButton.js +58 -47
  4. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  5. package/lib/commonjs/ui/components/GroupedItem.js +2 -1
  6. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  7. package/lib/commonjs/ui/components/GroupedSection.js +3 -0
  8. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
  9. package/lib/commonjs/ui/components/Header.js +26 -12
  10. package/lib/commonjs/ui/components/Header.js.map +1 -1
  11. package/lib/commonjs/ui/components/OxyProvider.js +69 -33
  12. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  13. package/lib/commonjs/ui/components/ProfileCard.js +5 -1
  14. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  15. package/lib/commonjs/ui/components/StepBasedScreen.README.md +337 -0
  16. package/lib/commonjs/ui/components/StepBasedScreen.js +361 -0
  17. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -0
  18. package/lib/commonjs/ui/components/icon/OxyIcon.js +3 -3
  19. package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
  20. package/lib/commonjs/ui/components/index.js +0 -7
  21. package/lib/commonjs/ui/components/index.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/PinInput.js +1 -1
  23. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/TextField.js +8 -4
  25. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  26. package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +161 -0
  27. package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -0
  28. package/lib/commonjs/ui/context/OxyContext.js +103 -44
  29. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  30. package/lib/commonjs/ui/hooks/useFollow.types.js +2 -0
  31. package/lib/commonjs/ui/hooks/useFollow.types.js.map +1 -0
  32. package/lib/commonjs/ui/navigation/OxyRouter.js +10 -0
  33. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  34. package/lib/commonjs/ui/screens/AccountCenterScreen.js +26 -14
  35. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  36. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +3 -3
  37. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  38. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +64 -15
  39. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  40. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +4 -4
  41. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  42. package/lib/commonjs/ui/screens/FeedbackScreen.js +72 -75
  43. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  44. package/lib/commonjs/ui/screens/FileManagementScreen.js +286 -126
  45. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  46. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +322 -0
  47. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -0
  48. package/lib/commonjs/ui/screens/ProfileScreen.js +56 -56
  49. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  50. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +87 -219
  51. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
  52. package/lib/commonjs/ui/screens/SessionManagementScreen.js +176 -174
  53. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/SignInScreen.js +138 -244
  55. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  56. package/lib/commonjs/ui/screens/SignUpScreen.js +143 -744
  57. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +386 -0
  59. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -0
  60. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +25 -15
  61. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  62. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +16 -9
  63. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  64. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
  65. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +110 -0
  67. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -0
  68. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +138 -0
  69. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -0
  70. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +141 -0
  71. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -0
  72. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +165 -0
  73. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -0
  74. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +150 -0
  75. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -0
  76. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +171 -0
  77. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -0
  78. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +163 -0
  79. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -0
  80. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +170 -0
  81. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -0
  82. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +72 -0
  83. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -0
  84. package/lib/commonjs/ui/styles/authStyles.js +1 -1
  85. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  86. package/lib/module/ui/components/AnimationExample.js +209 -0
  87. package/lib/module/ui/components/AnimationExample.js.map +1 -0
  88. package/lib/module/ui/components/FollowButton.js +58 -47
  89. package/lib/module/ui/components/FollowButton.js.map +1 -1
  90. package/lib/module/ui/components/GroupedItem.js +2 -1
  91. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  92. package/lib/module/ui/components/GroupedSection.js +3 -0
  93. package/lib/module/ui/components/GroupedSection.js.map +1 -1
  94. package/lib/module/ui/components/Header.js +26 -12
  95. package/lib/module/ui/components/Header.js.map +1 -1
  96. package/lib/module/ui/components/OxyProvider.js +70 -34
  97. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  98. package/lib/module/ui/components/ProfileCard.js +5 -1
  99. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  100. package/lib/module/ui/components/Section.js.map +1 -1
  101. package/lib/module/ui/components/SectionTitle.js.map +1 -1
  102. package/lib/module/ui/components/StepBasedScreen.README.md +337 -0
  103. package/lib/module/ui/components/StepBasedScreen.js +356 -0
  104. package/lib/module/ui/components/StepBasedScreen.js.map +1 -0
  105. package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -1
  106. package/lib/module/ui/components/icon/OxyIcon.js +3 -3
  107. package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
  108. package/lib/module/ui/components/index.js +0 -1
  109. package/lib/module/ui/components/index.js.map +1 -1
  110. package/lib/module/ui/components/internal/PinInput.js +1 -1
  111. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  112. package/lib/module/ui/components/internal/TextField.js +8 -4
  113. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  114. package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +156 -0
  115. package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -0
  116. package/lib/module/ui/context/OxyContext.js +103 -45
  117. package/lib/module/ui/context/OxyContext.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.types.js +2 -0
  119. package/lib/module/ui/hooks/useFollow.types.js.map +1 -0
  120. package/lib/module/ui/navigation/OxyRouter.js +10 -0
  121. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  122. package/lib/module/ui/screens/AccountCenterScreen.js +12 -1
  123. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  124. package/lib/module/ui/screens/AccountOverviewScreen.js +3 -3
  125. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  126. package/lib/module/ui/screens/AccountSettingsScreen.js +64 -15
  127. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  128. package/lib/module/ui/screens/AccountSwitcherScreen.js +4 -4
  129. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  130. package/lib/module/ui/screens/FeedbackScreen.js +72 -75
  131. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  132. package/lib/module/ui/screens/FileManagementScreen.js +285 -125
  133. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  134. package/lib/module/ui/screens/LanguageSelectorScreen.js +319 -0
  135. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -0
  136. package/lib/module/ui/screens/ProfileScreen.js +56 -56
  137. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  138. package/lib/module/ui/screens/RecoverAccountScreen.js +91 -222
  139. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
  140. package/lib/module/ui/screens/SessionManagementScreen.js +177 -175
  141. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  142. package/lib/module/ui/screens/SignInScreen.js +140 -246
  143. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  144. package/lib/module/ui/screens/SignUpScreen.js +145 -745
  145. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  146. package/lib/module/ui/screens/WelcomeNewUserScreen.js +382 -0
  147. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -0
  148. package/lib/module/ui/screens/internal/SignInPasswordStep.js +23 -14
  149. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  150. package/lib/module/ui/screens/internal/SignInUsernameStep.js +15 -9
  151. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  152. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
  153. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  154. package/lib/module/ui/screens/steps/RecoverRequestStep.js +105 -0
  155. package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -0
  156. package/lib/module/ui/screens/steps/RecoverSuccessStep.js +133 -0
  157. package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -0
  158. package/lib/module/ui/screens/steps/RecoverVerifyStep.js +136 -0
  159. package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -0
  160. package/lib/module/ui/screens/steps/SignInPasswordStep.js +160 -0
  161. package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -0
  162. package/lib/module/ui/screens/steps/SignInUsernameStep.js +145 -0
  163. package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -0
  164. package/lib/module/ui/screens/steps/SignUpIdentityStep.js +166 -0
  165. package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -0
  166. package/lib/module/ui/screens/steps/SignUpSecurityStep.js +158 -0
  167. package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -0
  168. package/lib/module/ui/screens/steps/SignUpSummaryStep.js +165 -0
  169. package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -0
  170. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +67 -0
  171. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -0
  172. package/lib/module/ui/styles/authStyles.js +1 -1
  173. package/lib/module/ui/styles/authStyles.js.map +1 -1
  174. package/lib/typescript/models/interfaces.d.ts +5 -8
  175. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  176. package/lib/typescript/models/session.d.ts +1 -4
  177. package/lib/typescript/models/session.d.ts.map +1 -1
  178. package/lib/typescript/ui/components/AnimationExample.d.ts +4 -0
  179. package/lib/typescript/ui/components/AnimationExample.d.ts.map +1 -0
  180. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  181. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  182. package/lib/typescript/ui/components/Header.d.ts +9 -0
  183. package/lib/typescript/ui/components/Header.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/OxyPayButton.d.ts +2 -2
  185. package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
  186. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/ProfileCard.d.ts +1 -3
  188. package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
  189. package/lib/typescript/ui/components/Section.d.ts +2 -1
  190. package/lib/typescript/ui/components/Section.d.ts.map +1 -1
  191. package/lib/typescript/ui/components/SectionTitle.d.ts +2 -1
  192. package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
  193. package/lib/typescript/ui/components/StepBasedScreen.d.ts +24 -0
  194. package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -0
  195. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +2 -1
  196. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -1
  197. package/lib/typescript/ui/components/icon/OxyIcon.d.ts +1 -1
  198. package/lib/typescript/ui/components/icon/OxyIcon.d.ts.map +1 -1
  199. package/lib/typescript/ui/components/index.d.ts +0 -1
  200. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  201. package/lib/typescript/ui/components/internal/PinInput.d.ts +9 -1
  202. package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
  203. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  204. package/lib/typescript/ui/components/photogrid/JustifiedPhotoGrid.d.ts +27 -0
  205. package/lib/typescript/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -0
  206. package/lib/typescript/ui/context/OxyContext.d.ts +8 -3
  207. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  208. package/lib/typescript/ui/hooks/useFollow.types.d.ts +33 -0
  209. package/lib/typescript/ui/hooks/useFollow.types.d.ts.map +1 -0
  210. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  211. package/lib/typescript/ui/navigation/types.d.ts +5 -0
  212. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  215. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/FileManagementScreen.d.ts +18 -1
  217. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +7 -0
  219. package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -0
  220. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +2 -2
  221. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  223. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +2 -9
  224. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/SignUpScreen.d.ts +1 -1
  228. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
  229. package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts +13 -0
  230. package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -0
  231. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +5 -5
  232. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
  233. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +4 -4
  234. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
  235. package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +21 -0
  236. package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -0
  237. package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +18 -0
  238. package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -0
  239. package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +24 -0
  240. package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -0
  241. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +27 -0
  242. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -0
  243. package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +27 -0
  244. package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -0
  245. package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +25 -0
  246. package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -0
  247. package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +26 -0
  248. package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -0
  249. package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +16 -0
  250. package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -0
  251. package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +13 -0
  252. package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -0
  253. package/lib/typescript/ui/styles/authStyles.d.ts +1 -1
  254. package/package.json +10 -3
  255. package/src/models/interfaces.ts +7 -8
  256. package/src/models/session.ts +1 -4
  257. package/src/ui/components/AnimationExample.tsx +195 -0
  258. package/src/ui/components/FollowButton.tsx +65 -45
  259. package/src/ui/components/GroupedItem.tsx +1 -0
  260. package/src/ui/components/GroupedSection.tsx +1 -1
  261. package/src/ui/components/Header.tsx +37 -13
  262. package/src/ui/components/OxyPayButton.tsx +2 -2
  263. package/src/ui/components/OxyProvider.tsx +67 -33
  264. package/src/ui/components/ProfileCard.tsx +6 -8
  265. package/src/ui/components/Section.tsx +7 -7
  266. package/src/ui/components/SectionTitle.tsx +2 -2
  267. package/src/ui/components/StepBasedScreen.README.md +337 -0
  268. package/src/ui/components/StepBasedScreen.tsx +417 -0
  269. package/src/ui/components/icon/FAIRWalletIcon.tsx +2 -2
  270. package/src/ui/components/icon/OxyIcon.tsx +10 -11
  271. package/src/ui/components/index.ts +0 -1
  272. package/src/ui/components/internal/PinInput.tsx +13 -4
  273. package/src/ui/components/internal/TextField.tsx +12 -6
  274. package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -0
  275. package/src/ui/context/OxyContext.tsx +90 -59
  276. package/src/ui/hooks/useFollow.types.ts +33 -0
  277. package/src/ui/navigation/OxyRouter.tsx +10 -0
  278. package/src/ui/navigation/types.ts +6 -0
  279. package/src/ui/screens/AccountCenterScreen.tsx +13 -7
  280. package/src/ui/screens/AccountOverviewScreen.tsx +3 -3
  281. package/src/ui/screens/AccountSettingsScreen.tsx +65 -13
  282. package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
  283. package/src/ui/screens/FeedbackScreen.tsx +57 -80
  284. package/src/ui/screens/FileManagementScreen.tsx +278 -175
  285. package/src/ui/screens/LanguageSelectorScreen.tsx +322 -0
  286. package/src/ui/screens/PaymentGatewayScreen.tsx +2 -2
  287. package/src/ui/screens/ProfileScreen.tsx +60 -55
  288. package/src/ui/screens/RecoverAccountScreen.tsx +98 -211
  289. package/src/ui/screens/SessionManagementScreen.tsx +148 -151
  290. package/src/ui/screens/SignInScreen.tsx +148 -290
  291. package/src/ui/screens/SignUpScreen.tsx +147 -751
  292. package/src/ui/screens/WelcomeNewUserScreen.tsx +272 -0
  293. package/src/ui/screens/internal/SignInPasswordStep.tsx +28 -13
  294. package/src/ui/screens/internal/SignInUsernameStep.tsx +21 -11
  295. package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -1
  296. package/src/ui/screens/steps/RecoverRequestStep.tsx +130 -0
  297. package/src/ui/screens/steps/RecoverSuccessStep.tsx +131 -0
  298. package/src/ui/screens/steps/RecoverVerifyStep.tsx +153 -0
  299. package/src/ui/screens/steps/SignInPasswordStep.tsx +172 -0
  300. package/src/ui/screens/steps/SignInUsernameStep.tsx +176 -0
  301. package/src/ui/screens/steps/SignUpIdentityStep.tsx +204 -0
  302. package/src/ui/screens/steps/SignUpSecurityStep.tsx +191 -0
  303. package/src/ui/screens/steps/SignUpSummaryStep.tsx +130 -0
  304. package/src/ui/screens/steps/SignUpWelcomeStep.tsx +65 -0
  305. package/src/ui/styles/authStyles.ts +1 -1
@@ -4,367 +4,72 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
7
+ var _react = require("react");
9
8
  var _OxyContext = require("../context/OxyContext");
10
9
  var _styles = require("../styles");
11
- var _vectorIcons = require("@expo/vector-icons");
12
10
  var _sonner = require("../../lib/sonner");
13
- var _SignUpIdentityStep = _interopRequireDefault(require("./internal/SignUpIdentityStep"));
14
- var _SignUpSecurityStep = _interopRequireDefault(require("./internal/SignUpSecurityStep"));
15
- var _SignUpSummaryStep = _interopRequireDefault(require("./internal/SignUpSummaryStep"));
16
- var _SignUpWelcomeStep = _interopRequireDefault(require("./internal/SignUpWelcomeStep"));
11
+ var _StepBasedScreen = _interopRequireDefault(require("../components/StepBasedScreen"));
12
+ var _SignUpWelcomeStep = _interopRequireDefault(require("./steps/SignUpWelcomeStep"));
13
+ var _SignUpIdentityStep = _interopRequireDefault(require("./steps/SignUpIdentityStep"));
14
+ var _SignUpSecurityStep = _interopRequireDefault(require("./steps/SignUpSecurityStep"));
15
+ var _SignUpSummaryStep = _interopRequireDefault(require("./steps/SignUpSummaryStep"));
17
16
  var _jsxRuntime = require("react/jsx-runtime");
18
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
20
18
  // Types for better type safety
21
19
 
22
20
  // Constants
23
21
  const USERNAME_MIN_LENGTH = 3;
24
22
  const PASSWORD_MIN_LENGTH = 8;
25
- const VALIDATION_DEBOUNCE_MS = 800;
26
- const CACHE_DURATION_MS = 5 * 60 * 1000; // 5 minutes
27
23
 
28
24
  // Email validation regex
29
25
  const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
30
26
 
31
- // Styles factory function
32
- const createStyles = (colors, theme) => _reactNative.StyleSheet.create({
33
- container: {
34
- flex: 1
35
- },
36
- scrollContent: {
37
- flexGrow: 1,
38
- paddingHorizontal: 24,
39
- paddingTop: 4,
40
- paddingBottom: 20
41
- },
42
- stepContainer: {
43
- flex: 1,
44
- justifyContent: 'flex-start',
45
- alignItems: 'flex-start'
46
- },
47
- modernHeader: {
48
- alignItems: 'flex-start',
49
- width: '100%',
50
- marginBottom: 24
51
- },
52
- modernTitle: {
53
- fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
54
- fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
55
- fontSize: 62,
56
- lineHeight: 48,
57
- marginBottom: 18,
58
- textAlign: 'left',
59
- letterSpacing: -1
60
- },
61
- modernSubtitle: {
62
- fontSize: 18,
63
- lineHeight: 24,
64
- textAlign: 'left',
65
- opacity: 0.8,
66
- marginBottom: 24
67
- },
68
- welcomeImageContainer: {
69
- alignItems: 'center',
70
- justifyContent: 'center',
71
- marginVertical: 20
72
- },
73
- welcomeTitle: {
74
- fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
75
- fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
76
- fontSize: 42,
77
- lineHeight: 48,
78
- marginBottom: 12,
79
- textAlign: 'left',
80
- letterSpacing: -1
81
- },
82
- welcomeText: {
83
- fontSize: 18,
84
- lineHeight: 24,
85
- textAlign: 'left',
86
- opacity: 0.8,
87
- marginBottom: 24
88
- },
89
- stepTitle: {
90
- fontFamily: _reactNative.Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
91
- fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
92
- fontSize: 42,
93
- lineHeight: 48,
94
- marginBottom: 12,
95
- textAlign: 'left',
96
- letterSpacing: -1
97
- },
98
- inputContainer: {
99
- width: '100%',
100
- marginBottom: 24
101
- },
102
- premiumInputWrapper: {
103
- flexDirection: 'row',
104
- alignItems: 'center',
105
- height: 56,
106
- borderRadius: 16,
107
- paddingHorizontal: 20,
108
- borderWidth: 2,
109
- backgroundColor: colors.inputBackground
110
- },
111
- inputIcon: {
112
- marginRight: 12
113
- },
114
- inputContent: {
115
- flex: 1
116
- },
117
- modernLabel: {
118
- fontSize: 12,
119
- fontWeight: '500',
120
- marginBottom: 2
121
- },
122
- modernInput: {
123
- flex: 1,
124
- fontSize: 16,
125
- height: '100%'
126
- },
127
- validationIndicator: {
128
- marginLeft: 8
129
- },
130
- validationCard: {
131
- flexDirection: 'row',
132
- alignItems: 'center',
133
- padding: 12,
134
- borderRadius: 12,
135
- marginTop: 8,
136
- gap: 8
137
- },
138
- belowInputMessage: {
139
- flexDirection: 'row',
140
- alignItems: 'center',
141
- marginTop: 4,
142
- marginBottom: 0,
143
- gap: 6
144
- },
145
- belowInputText: {
146
- fontSize: 13,
147
- fontWeight: '500'
148
- },
149
- validationIconContainer: {
150
- width: 32,
151
- height: 32,
152
- borderRadius: 16,
153
- justifyContent: 'center',
154
- alignItems: 'center',
155
- marginRight: 12
156
- },
157
- validationTextContainer: {
158
- flex: 1
159
- },
160
- validationTitle: {
161
- fontSize: 12,
162
- fontWeight: '600',
163
- marginBottom: 2
164
- },
165
- validationSubtitle: {
166
- fontSize: 11,
167
- opacity: 0.8
168
- },
169
- passwordToggle: {
170
- padding: 4
171
- },
172
- passwordHint: {
173
- fontSize: 12,
174
- marginTop: 4
175
- },
176
- button: {
177
- flexDirection: 'row',
178
- alignItems: 'center',
179
- justifyContent: 'center',
180
- paddingVertical: 18,
181
- paddingHorizontal: 32,
182
- borderRadius: 16,
183
- marginVertical: 8,
184
- gap: 8,
185
- width: '100%',
186
- ..._reactNative.Platform.select({
187
- web: {
188
- boxShadow: '0 4px 8px rgba(0,0,0,0.3)'
189
- },
190
- default: {
191
- shadowOffset: {
192
- width: 0,
193
- height: 4
194
- },
195
- shadowOpacity: 0.3,
196
- shadowRadius: 8,
197
- elevation: 6
198
- }
199
- })
200
- },
201
- buttonText: {
202
- color: '#FFFFFF',
203
- fontSize: 16,
204
- fontWeight: '600',
205
- letterSpacing: 0.5
206
- },
207
- footerTextContainer: {
208
- flexDirection: 'row',
209
- justifyContent: 'center',
210
- marginTop: 16
211
- },
212
- footerText: {
213
- fontSize: 15
214
- },
215
- linkText: {
216
- fontSize: 14,
217
- lineHeight: 20,
218
- fontWeight: '600',
219
- textDecorationLine: 'underline'
220
- },
221
- userInfoContainer: {
222
- padding: 20,
223
- marginVertical: 20,
224
- borderRadius: 24,
225
- alignItems: 'center',
226
- ..._reactNative.Platform.select({
227
- web: {
228
- boxShadow: '0 1px 4px rgba(0,0,0,0.04)'
229
- },
230
- default: {
231
- shadowColor: '#000',
232
- shadowOpacity: 0.04,
233
- shadowOffset: {
234
- width: 0,
235
- height: 1
236
- },
237
- shadowRadius: 4,
238
- elevation: 1
239
- }
240
- })
241
- },
242
- userInfoText: {
243
- fontSize: 16,
244
- marginBottom: 8,
245
- textAlign: 'center'
246
- },
247
- actionButtonsContainer: {
248
- marginTop: 24
249
- },
250
- navigationButtons: {
251
- flexDirection: 'row',
252
- justifyContent: 'center',
253
- marginTop: 16,
254
- marginBottom: 8,
255
- width: '100%',
256
- gap: 8
257
- },
258
- navButton: {
259
- flexDirection: 'row',
260
- alignItems: 'center',
261
- paddingVertical: 6,
262
- paddingHorizontal: 12,
263
- gap: 6,
264
- minWidth: 70,
265
- borderWidth: 1,
266
- ..._reactNative.Platform.select({
267
- web: {
268
- boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
269
- },
270
- default: {
271
- shadowOffset: {
272
- width: 0,
273
- height: 2
274
- },
275
- shadowOpacity: 0.1,
276
- shadowRadius: 4,
277
- elevation: 2
278
- }
279
- })
280
- },
281
- backButton: {
282
- backgroundColor: 'transparent',
283
- borderTopLeftRadius: 35,
284
- borderBottomLeftRadius: 35,
285
- borderTopRightRadius: 12,
286
- borderBottomRightRadius: 12
287
- },
288
- nextButton: {
289
- backgroundColor: 'transparent',
290
- borderTopRightRadius: 35,
291
- borderBottomRightRadius: 35,
292
- borderTopLeftRadius: 12,
293
- borderBottomLeftRadius: 12
294
- },
295
- navButtonText: {
296
- fontSize: 13,
297
- fontWeight: '500'
298
- },
299
- progressContainer: {
300
- flexDirection: 'row',
301
- justifyContent: 'center',
302
- marginBottom: 20,
303
- marginTop: 8
304
- },
305
- progressDot: {
306
- height: 10,
307
- width: 10,
308
- borderRadius: 5,
309
- marginHorizontal: 6,
310
- borderWidth: 2,
311
- borderColor: '#fff',
312
- ..._reactNative.Platform.select({
313
- web: {
314
- boxShadow: '0 1px 2px rgba(0,0,0,0.08)'
315
- },
316
- default: {
317
- shadowColor: colors.primary,
318
- shadowOpacity: 0.08,
319
- shadowOffset: {
320
- width: 0,
321
- height: 1
322
- },
323
- shadowRadius: 2,
324
- elevation: 1
325
- }
326
- })
327
- },
328
- summaryContainer: {
329
- padding: 0,
330
- marginBottom: 24,
331
- width: '100%'
332
- },
333
- summaryRow: {
334
- flexDirection: 'row',
335
- marginBottom: 10
336
- },
337
- summaryLabel: {
338
- fontSize: 15,
339
- width: 90
340
- },
341
- summaryValue: {
342
- fontSize: 15,
343
- fontWeight: '600',
344
- flex: 1
345
- }
346
- });
27
+ // Main component
28
+ const SignUpScreen = ({
29
+ navigate,
30
+ goBack,
31
+ onAuthenticated,
32
+ theme
33
+ }) => {
34
+ const {
35
+ signUp,
36
+ oxyServices
37
+ } = (0, _OxyContext.useOxy)();
38
+ const colors = (0, _styles.useThemeColors)(theme);
347
39
 
348
- // Custom hooks for better separation of concerns
349
- const useFormValidation = oxyServices => {
40
+ // Form data state
41
+ const [username, setUsername] = (0, _react.useState)('');
42
+ const [email, setEmail] = (0, _react.useState)('');
43
+ const [password, setPassword] = (0, _react.useState)('');
44
+ const [confirmPassword, setConfirmPassword] = (0, _react.useState)('');
45
+ const [showPassword, setShowPassword] = (0, _react.useState)(false);
46
+ const [showConfirmPassword, setShowConfirmPassword] = (0, _react.useState)(false);
47
+ const [isLoading, setIsLoading] = (0, _react.useState)(false);
48
+
49
+ // Validation state
350
50
  const [validationState, setValidationState] = (0, _react.useState)({
351
51
  status: 'idle',
352
52
  message: ''
353
53
  });
354
- const validationCache = (0, _react.useRef)(new Map());
355
- const validateUsername = (0, _react.useCallback)(async username => {
356
- if (!username || username.length < USERNAME_MIN_LENGTH) {
54
+
55
+ // Error message state
56
+ const [errorMessage, setErrorMessage] = (0, _react.useState)('');
57
+
58
+ // Username validation with caching
59
+ const usernameCache = (0, _react.useRef)(new Map());
60
+ const validateUsername = (0, _react.useCallback)(async usernameToValidate => {
61
+ if (!usernameToValidate || usernameToValidate.length < USERNAME_MIN_LENGTH) {
357
62
  setValidationState({
358
63
  status: 'invalid',
359
- message: ''
64
+ message: 'Username must be at least 3 characters'
360
65
  });
361
66
  return false;
362
67
  }
363
68
 
364
69
  // Check cache first
365
- const cached = validationCache.current.get(username);
70
+ const cached = usernameCache.current.get(usernameToValidate);
366
71
  const now = Date.now();
367
- if (cached && now - cached.timestamp < CACHE_DURATION_MS) {
72
+ if (cached && now - cached.timestamp < 5 * 60 * 1000) {
368
73
  const isValid = cached.available;
369
74
  setValidationState({
370
75
  status: isValid ? 'valid' : 'invalid',
@@ -377,11 +82,11 @@ const useFormValidation = oxyServices => {
377
82
  message: ''
378
83
  });
379
84
  try {
380
- const result = await oxyServices.checkUsernameAvailability(username);
85
+ const result = await oxyServices.checkUsernameAvailability(usernameToValidate);
381
86
  const isValid = result.available;
382
87
 
383
88
  // Cache the result
384
- validationCache.current.set(username, {
89
+ usernameCache.current.set(usernameToValidate, {
385
90
  available: isValid,
386
91
  timestamp: now
387
92
  });
@@ -399,433 +104,127 @@ const useFormValidation = oxyServices => {
399
104
  return false;
400
105
  }
401
106
  }, [oxyServices]);
402
- const validateEmail = (0, _react.useCallback)(email => {
403
- return EMAIL_REGEX.test(email);
404
- }, []);
405
- const validatePassword = (0, _react.useCallback)(password => {
406
- return password.length >= PASSWORD_MIN_LENGTH;
407
- }, []);
408
- const validatePasswordsMatch = (0, _react.useCallback)((password, confirmPassword) => {
409
- return password === confirmPassword;
410
- }, []);
411
107
 
412
- // Cleanup cache on unmount
413
- (0, _react.useEffect)(() => {
414
- return () => {
415
- validationCache.current.clear();
416
- };
108
+ // Email validation
109
+ const validateEmail = (0, _react.useCallback)(emailToValidate => {
110
+ return EMAIL_REGEX.test(emailToValidate);
417
111
  }, []);
418
- return {
419
- validationState,
420
- validateUsername,
421
- validateEmail,
422
- validatePassword,
423
- validatePasswordsMatch
424
- };
425
- };
426
- const useFormData = () => {
427
- const [formData, setFormData] = (0, _react.useState)({
428
- username: '',
429
- email: '',
430
- password: '',
431
- confirmPassword: ''
432
- });
433
- const [passwordVisibility, setPasswordVisibility] = (0, _react.useState)({
434
- password: false,
435
- confirmPassword: false
436
- });
437
- const updateField = (0, _react.useCallback)((field, value) => {
438
- setFormData(prev => ({
439
- ...prev,
440
- [field]: value
441
- }));
442
- }, []);
443
- const togglePasswordVisibility = (0, _react.useCallback)(field => {
444
- setPasswordVisibility(prev => ({
445
- ...prev,
446
- [field]: !prev[field]
447
- }));
448
- }, []);
449
- const resetForm = (0, _react.useCallback)(() => {
450
- setFormData({
451
- username: '',
452
- email: '',
453
- password: '',
454
- confirmPassword: ''
455
- });
456
- setPasswordVisibility({
457
- password: false,
458
- confirmPassword: false
459
- });
460
- }, []);
461
- return {
462
- formData,
463
- passwordVisibility,
464
- updateField,
465
- togglePasswordVisibility,
466
- resetForm
467
- };
468
- };
469
-
470
- // Reusable components
471
- const ValidationIndicator = /*#__PURE__*/_react.default.memo(({
472
- status,
473
- colors,
474
- styles
475
- }) => {
476
- if (status === 'validating') {
477
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
478
- size: "small",
479
- color: colors.primary,
480
- style: styles.validationIndicator
481
- });
482
- }
483
- if (status === 'valid') {
484
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
485
- name: "checkmark-circle",
486
- size: 22,
487
- color: colors.success,
488
- style: styles.validationIndicator
489
- });
490
- }
491
- if (status === 'invalid') {
492
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
493
- name: "close-circle",
494
- size: 22,
495
- color: colors.error,
496
- style: styles.validationIndicator
497
- });
498
- }
499
- return null;
500
- });
501
- const ValidationMessage = /*#__PURE__*/_react.default.memo(({
502
- validationState,
503
- colors,
504
- styles
505
- }) => {
506
- if (validationState.status === 'idle' || !validationState.message) return null;
507
- const isSuccess = validationState.status === 'valid';
508
- const backgroundColor = isSuccess ? colors.success + '10' : colors.error + '10';
509
- const borderColor = isSuccess ? colors.success + '30' : colors.error + '30';
510
- const iconColor = isSuccess ? colors.success : colors.error;
511
- const iconName = isSuccess ? 'checkmark-circle' : 'alert-circle';
512
- const title = isSuccess ? 'Username Available' : 'Username Taken';
513
- const subtitle = isSuccess ? 'Good choice! This username is available' : validationState.message;
514
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
515
- style: [styles.validationCard, {
516
- backgroundColor,
517
- borderColor
518
- }],
519
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
520
- style: [styles.validationIconContainer, {
521
- backgroundColor: iconColor + '20'
522
- }],
523
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
524
- name: iconName,
525
- size: 16,
526
- color: iconColor
527
- })
528
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
529
- style: styles.validationTextContainer,
530
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
531
- style: [styles.validationTitle, {
532
- color: iconColor
533
- }],
534
- children: title
535
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
536
- style: [styles.validationSubtitle, {
537
- color: colors.secondaryText
538
- }],
539
- children: subtitle
540
- })]
541
- })]
542
- });
543
- });
544
- const FormInput = /*#__PURE__*/_react.default.memo(({
545
- icon,
546
- label,
547
- value,
548
- onChangeText,
549
- secureTextEntry = false,
550
- keyboardType = 'default',
551
- autoCapitalize = 'sentences',
552
- autoCorrect = true,
553
- testID,
554
- colors,
555
- styles,
556
- borderColor,
557
- rightComponent
558
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
559
- style: styles.inputContainer,
560
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
561
- style: [styles.premiumInputWrapper, {
562
- borderColor: borderColor || colors.border,
563
- backgroundColor: colors.inputBackground,
564
- shadowColor: colors.primary,
565
- shadowOffset: {
566
- width: 0,
567
- height: 4
568
- },
569
- shadowOpacity: 0.1,
570
- shadowRadius: 12,
571
- elevation: 3
572
- }],
573
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
574
- name: icon,
575
- size: 22,
576
- color: colors.secondaryText,
577
- style: styles.inputIcon
578
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
579
- style: styles.inputContent,
580
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
581
- style: [styles.modernLabel, {
582
- color: colors.secondaryText
583
- }],
584
- children: label
585
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
586
- style: [styles.modernInput, {
587
- color: colors.text
588
- }],
589
- value: value,
590
- onChangeText: onChangeText,
591
- secureTextEntry: secureTextEntry,
592
- keyboardType: keyboardType,
593
- autoCapitalize: autoCapitalize,
594
- autoCorrect: autoCorrect,
595
- testID: testID,
596
- placeholderTextColor: "transparent"
597
- })]
598
- }), rightComponent]
599
- })
600
- }));
601
- const ProgressIndicator = /*#__PURE__*/_react.default.memo(({
602
- currentStep,
603
- totalSteps,
604
- colors,
605
- styles
606
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
607
- style: styles.progressContainer,
608
- children: Array.from({
609
- length: totalSteps
610
- }, (_, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
611
- style: [styles.progressDot, currentStep === index ? {
612
- backgroundColor: colors.primary,
613
- width: 24
614
- } : {
615
- backgroundColor: colors.border
616
- }]
617
- }, index))
618
- }));
619
112
 
620
- // Main component
621
- const SignUpScreen = ({
622
- navigate,
623
- goBack,
624
- onAuthenticated,
625
- theme
626
- }) => {
627
- const {
628
- signUp,
629
- isLoading,
630
- user,
631
- isAuthenticated,
632
- oxyServices
633
- } = (0, _OxyContext.useOxy)();
634
- const colors = (0, _styles.useThemeColors)(theme);
635
-
636
- // Form state
637
- const {
638
- formData,
639
- passwordVisibility,
640
- updateField,
641
- togglePasswordVisibility,
642
- resetForm
643
- } = useFormData();
644
- const {
645
- validationState,
646
- validateUsername,
647
- validateEmail,
648
- validatePassword,
649
- validatePasswordsMatch
650
- } = useFormValidation(oxyServices);
651
-
652
- // UI state
653
- const [currentStep, setCurrentStep] = (0, _react.useState)(0);
654
- const [errorMessage, setErrorMessage] = (0, _react.useState)('');
655
-
656
- // Animation refs
657
- const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
658
- const slideAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
659
-
660
- // Memoized styles
661
- const styles = (0, _react.useMemo)(() => (0, _styles.createAuthStyles)(colors, theme), [colors, theme]);
113
+ // Password validation
114
+ const validatePassword = (0, _react.useCallback)(passwordToValidate => {
115
+ return passwordToValidate.length >= PASSWORD_MIN_LENGTH;
116
+ }, []);
662
117
 
663
- // Debounced username validation
664
- (0, _react.useEffect)(() => {
665
- if (!formData.username || formData.username.length < USERNAME_MIN_LENGTH) {
118
+ // Handle form completion
119
+ const handleComplete = (0, _react.useCallback)(async stepData => {
120
+ if (!username || !email || !password) {
121
+ _sonner.toast.error('Please fill in all required fields');
666
122
  return;
667
123
  }
668
- const timeoutId = setTimeout(() => {
669
- validateUsername(formData.username);
670
- }, VALIDATION_DEBOUNCE_MS);
671
- return () => clearTimeout(timeoutId);
672
- }, [formData.username, validateUsername]);
673
-
674
- // Animation functions
675
- const animateTransition = (0, _react.useCallback)(nextStep => {
676
- _reactNative.Animated.timing(fadeAnim, {
677
- toValue: 0,
678
- duration: 250,
679
- useNativeDriver: _reactNative.Platform.OS !== 'web'
680
- }).start(() => {
681
- setCurrentStep(nextStep);
682
- slideAnim.setValue(-100);
683
- _reactNative.Animated.parallel([_reactNative.Animated.timing(fadeAnim, {
684
- toValue: 1,
685
- duration: 250,
686
- useNativeDriver: _reactNative.Platform.OS !== 'web'
687
- }), _reactNative.Animated.timing(slideAnim, {
688
- toValue: 0,
689
- duration: 300,
690
- useNativeDriver: _reactNative.Platform.OS !== 'web'
691
- })]).start();
692
- });
693
- }, [fadeAnim, slideAnim]);
694
- const nextStep = (0, _react.useCallback)(() => {
695
- if (currentStep < 3) {
696
- animateTransition(currentStep + 1);
697
- }
698
- }, [currentStep, animateTransition]);
699
- const prevStep = (0, _react.useCallback)(() => {
700
- if (currentStep > 0) {
701
- animateTransition(currentStep - 1);
702
- }
703
- }, [currentStep, animateTransition]);
704
-
705
- // Form validation helpers
706
- const isIdentityStepValid = (0, _react.useCallback)(() => {
707
- return formData.username && formData.email && validateEmail(formData.email) && validationState.status === 'valid';
708
- }, [formData.username, formData.email, validateEmail, validationState.status]);
709
- const isSecurityStepValid = (0, _react.useCallback)(() => {
710
- return formData.password && validatePassword(formData.password) && validatePasswordsMatch(formData.password, formData.confirmPassword);
711
- }, [formData.password, formData.confirmPassword, validatePassword, validatePasswordsMatch]);
712
-
713
- // Custom next handlers for validation
714
- const handleIdentityNext = (0, _react.useCallback)(() => {
715
- if (!isIdentityStepValid()) {
716
- _sonner.toast.error('Please enter a valid username and email.');
124
+ if (!validateEmail(email)) {
125
+ _sonner.toast.error('Please enter a valid email address');
717
126
  return;
718
127
  }
719
- nextStep();
720
- }, [isIdentityStepValid, nextStep]);
721
- const handleSecurityNext = (0, _react.useCallback)(() => {
722
- if (!isSecurityStepValid()) {
723
- _sonner.toast.error('Please enter a valid password and confirm it.');
128
+ if (!validatePassword(password)) {
129
+ _sonner.toast.error('Password must be at least 8 characters long');
724
130
  return;
725
131
  }
726
- nextStep();
727
- }, [isSecurityStepValid, nextStep]);
728
-
729
- // Sign up handler
730
- const handleSignUp = (0, _react.useCallback)(async () => {
731
- if (!isIdentityStepValid() || !isSecurityStepValid()) {
732
- _sonner.toast.error('Please fill in all fields correctly');
132
+ if (password !== confirmPassword) {
133
+ _sonner.toast.error('Passwords do not match');
733
134
  return;
734
135
  }
735
136
  try {
736
- setErrorMessage('');
737
- const user = await signUp(formData.username, formData.email, formData.password);
137
+ setIsLoading(true);
138
+ const user = await signUp(username, email, password);
738
139
  _sonner.toast.success('Account created successfully! Welcome to Oxy!');
739
- if (onAuthenticated) {
740
- onAuthenticated(user);
741
- }
742
- resetForm();
140
+
141
+ // Navigate to welcome screen or handle authentication
142
+ navigate('WelcomeNewUser', {
143
+ newUser: user
144
+ });
743
145
  } catch (error) {
744
146
  _sonner.toast.error(error.message || 'Sign up failed');
147
+ } finally {
148
+ setIsLoading(false);
745
149
  }
746
- }, [formData, isIdentityStepValid, isSecurityStepValid, signUp, onAuthenticated, resetForm]);
150
+ }, [username, email, password, confirmPassword, validateEmail, validatePassword, signUp, navigate]);
151
+
152
+ // Cleanup cache on unmount
153
+ (0, _react.useEffect)(() => {
154
+ return () => {
155
+ usernameCache.current.clear();
156
+ };
157
+ }, []);
747
158
 
748
- // Memoized step components
749
- const updateFieldString = (field, value) => updateField(field, value);
750
- const validatePasswordsMatchNoArgs = () => validatePasswordsMatch(formData.password, formData.confirmPassword);
751
- const togglePasswordVisibilityNoArgs = () => togglePasswordVisibility('password');
752
- const renderWelcomeStep = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignUpWelcomeStep.default, {
753
- styles: styles,
754
- fadeAnim: fadeAnim,
755
- slideAnim: slideAnim,
756
- colors: colors,
757
- nextStep: nextStep,
758
- navigate: navigate
759
- }), [styles, fadeAnim, slideAnim, colors, nextStep, navigate]);
760
- const renderIdentityStep = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignUpIdentityStep.default, {
761
- styles: styles,
762
- fadeAnim: fadeAnim,
763
- slideAnim: slideAnim,
764
- colors: colors,
765
- formData: formData,
766
- validationState: validationState,
767
- updateField: updateFieldString,
768
- setErrorMessage: setErrorMessage,
769
- prevStep: prevStep,
770
- handleIdentityNext: handleIdentityNext,
771
- ValidationMessage: ValidationMessage,
772
- validateEmail: validateEmail,
773
- navigate: navigate
774
- }), [styles, fadeAnim, slideAnim, colors, formData, validationState, updateFieldString, setErrorMessage, prevStep, handleIdentityNext, ValidationMessage, validateEmail, navigate]);
775
- const renderSecurityStep = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignUpSecurityStep.default, {
776
- styles: styles,
777
- fadeAnim: fadeAnim,
778
- slideAnim: slideAnim,
779
- colors: colors,
780
- formData: formData,
781
- passwordVisibility: passwordVisibility,
782
- updateField: updateFieldString,
783
- validatePassword: validatePassword,
784
- validatePasswordsMatch: validatePasswordsMatchNoArgs,
785
- prevStep: prevStep,
786
- handleSecurityNext: handleSecurityNext,
787
- setErrorMessage: setErrorMessage,
788
- togglePasswordVisibility: togglePasswordVisibilityNoArgs,
789
- PASSWORD_MIN_LENGTH: PASSWORD_MIN_LENGTH
790
- }), [styles, fadeAnim, slideAnim, colors, formData, passwordVisibility, updateFieldString, validatePassword, validatePasswordsMatchNoArgs, prevStep, handleSecurityNext, setErrorMessage, togglePasswordVisibilityNoArgs, PASSWORD_MIN_LENGTH]);
791
- const renderSummaryStep = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SignUpSummaryStep.default, {
792
- styles: styles,
793
- fadeAnim: fadeAnim,
794
- slideAnim: slideAnim,
795
- colors: colors,
796
- formData: formData,
797
- isLoading: isLoading,
798
- handleSignUp: handleSignUp,
799
- prevStep: prevStep
800
- }), [styles, fadeAnim, slideAnim, colors, formData, isLoading, handleSignUp, prevStep]);
801
- const renderCurrentStep = (0, _react.useCallback)(() => {
802
- switch (currentStep) {
803
- case 0:
804
- return renderWelcomeStep;
805
- case 1:
806
- return renderIdentityStep;
807
- case 2:
808
- return renderSecurityStep;
809
- case 3:
810
- return renderSummaryStep;
811
- default:
812
- return renderWelcomeStep;
159
+ // Step configurations
160
+ const steps = (0, _react.useMemo)(() => [{
161
+ id: 'welcome',
162
+ component: _SignUpWelcomeStep.default,
163
+ canProceed: () => true
164
+ }, {
165
+ id: 'identity',
166
+ component: _SignUpIdentityStep.default,
167
+ canProceed: () => !!(username.trim() && email.trim() && validateEmail(email) && validationState.status === 'valid'),
168
+ onEnter: () => {
169
+ // Auto-validate username when entering this step
170
+ if (username && validationState.status === 'idle') {
171
+ validateUsername(username);
172
+ }
813
173
  }
814
- }, [currentStep, renderWelcomeStep, renderIdentityStep, renderSecurityStep, renderSummaryStep]);
815
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.KeyboardAvoidingView, {
816
- style: [styles.container, {
817
- backgroundColor: colors.background
818
- }],
819
- behavior: _reactNative.Platform.OS === 'ios' ? 'padding' : 'height',
820
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.StatusBar, {
821
- barStyle: theme === 'dark' ? 'light-content' : 'dark-content',
822
- backgroundColor: colors.background
823
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
824
- contentContainerStyle: styles.scrollContent,
825
- showsVerticalScrollIndicator: false,
826
- keyboardShouldPersistTaps: "handled",
827
- children: renderCurrentStep()
828
- })]
174
+ }, {
175
+ id: 'security',
176
+ component: _SignUpSecurityStep.default,
177
+ canProceed: () => !!(password && validatePassword(password) && password === confirmPassword)
178
+ }, {
179
+ id: 'summary',
180
+ component: _SignUpSummaryStep.default,
181
+ canProceed: () => true
182
+ }], [username, email, password, confirmPassword, validationState.status, validateEmail, validatePassword, validateUsername]);
183
+
184
+ // Step data for the reusable component
185
+ const stepData = (0, _react.useMemo)(() => [
186
+ // Welcome step - no data needed
187
+ {},
188
+ // Identity step
189
+ {
190
+ username,
191
+ email,
192
+ setUsername,
193
+ setEmail,
194
+ validationState,
195
+ setValidationState,
196
+ setErrorMessage,
197
+ validateEmail,
198
+ validateUsername
199
+ },
200
+ // Security step
201
+ {
202
+ password,
203
+ confirmPassword,
204
+ setPassword,
205
+ setConfirmPassword,
206
+ showPassword,
207
+ showConfirmPassword,
208
+ setShowPassword,
209
+ setShowConfirmPassword,
210
+ setErrorMessage,
211
+ validatePassword
212
+ },
213
+ // Summary step
214
+ {
215
+ isLoading
216
+ }], [username, email, password, confirmPassword, showPassword, showConfirmPassword, validationState, errorMessage, validateEmail, validatePassword, isLoading]);
217
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepBasedScreen.default, {
218
+ steps: steps,
219
+ stepData: stepData,
220
+ onComplete: handleComplete,
221
+ navigate: navigate,
222
+ goBack: goBack,
223
+ onAuthenticated: onAuthenticated,
224
+ theme: theme,
225
+ showProgressIndicator: true,
226
+ enableAnimations: true,
227
+ oxyServices: oxyServices
829
228
  });
830
229
  };
831
230
  var _default = exports.default = SignUpScreen;