@kiosinc/commons-rn 0.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 (338) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +31 -0
  3. package/lib/commonjs/auth/api/authentication.js +20 -0
  4. package/lib/commonjs/auth/api/authentication.js.map +1 -0
  5. package/lib/commonjs/auth/appLogo.svg +9 -0
  6. package/lib/commonjs/auth/hooks/useAuthenticateRequests.js +52 -0
  7. package/lib/commonjs/auth/hooks/useAuthenticateRequests.js.map +1 -0
  8. package/lib/commonjs/auth/hooks/useAuthentication.js +89 -0
  9. package/lib/commonjs/auth/hooks/useAuthentication.js.map +1 -0
  10. package/lib/commonjs/auth/index.js +33 -0
  11. package/lib/commonjs/auth/index.js.map +1 -0
  12. package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js +57 -0
  13. package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js.map +1 -0
  14. package/lib/commonjs/auth/providers/authentication/actions/authentication.actions.js +13 -0
  15. package/lib/commonjs/auth/providers/authentication/actions/authentication.actions.js.map +1 -0
  16. package/lib/commonjs/auth/providers/authentication/index.js +50 -0
  17. package/lib/commonjs/auth/providers/authentication/index.js.map +1 -0
  18. package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js +21 -0
  19. package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -0
  20. package/lib/commonjs/auth/providers/authentication/types/authentication.types.js +11 -0
  21. package/lib/commonjs/auth/providers/authentication/types/authentication.types.js.map +1 -0
  22. package/lib/commonjs/auth/screens/LoginScreen.js +131 -0
  23. package/lib/commonjs/auth/screens/LoginScreen.js.map +1 -0
  24. package/lib/commonjs/auth/screens/ResetPassword.js +90 -0
  25. package/lib/commonjs/auth/screens/ResetPassword.js.map +1 -0
  26. package/lib/commonjs/auth/screens/ResetPasswordInstructionsSent.js +34 -0
  27. package/lib/commonjs/auth/screens/ResetPasswordInstructionsSent.js.map +1 -0
  28. package/lib/commonjs/auth/screens/SignUp.js +176 -0
  29. package/lib/commonjs/auth/screens/SignUp.js.map +1 -0
  30. package/lib/commonjs/auth/screens/SignUpPassword.js +103 -0
  31. package/lib/commonjs/auth/screens/SignUpPassword.js.map +1 -0
  32. package/lib/commonjs/auth/screens/VerifyPhoneNumber.js +95 -0
  33. package/lib/commonjs/auth/screens/VerifyPhoneNumber.js.map +1 -0
  34. package/lib/commonjs/auth/screens/index.js +37 -0
  35. package/lib/commonjs/auth/screens/index.js.map +1 -0
  36. package/lib/commonjs/auth/screens/validators.js +39 -0
  37. package/lib/commonjs/auth/screens/validators.js.map +1 -0
  38. package/lib/commonjs/components/Alert.js +109 -0
  39. package/lib/commonjs/components/Alert.js.map +1 -0
  40. package/lib/commonjs/components/Badge.js +20 -0
  41. package/lib/commonjs/components/Badge.js.map +1 -0
  42. package/lib/commonjs/components/BottomSheet.js +60 -0
  43. package/lib/commonjs/components/BottomSheet.js.map +1 -0
  44. package/lib/commonjs/components/Button.js +20 -0
  45. package/lib/commonjs/components/Button.js.map +1 -0
  46. package/lib/commonjs/components/Card.js +19 -0
  47. package/lib/commonjs/components/Card.js.map +1 -0
  48. package/lib/commonjs/components/Divider.js +19 -0
  49. package/lib/commonjs/components/Divider.js.map +1 -0
  50. package/lib/commonjs/components/FAB.js +19 -0
  51. package/lib/commonjs/components/FAB.js.map +1 -0
  52. package/lib/commonjs/components/Header.js +73 -0
  53. package/lib/commonjs/components/Header.js.map +1 -0
  54. package/lib/commonjs/components/IconButton.js +19 -0
  55. package/lib/commonjs/components/IconButton.js.map +1 -0
  56. package/lib/commonjs/components/Image.js +45 -0
  57. package/lib/commonjs/components/Image.js.map +1 -0
  58. package/lib/commonjs/components/KeyboardAvoidingView.js +23 -0
  59. package/lib/commonjs/components/KeyboardAvoidingView.js.map +1 -0
  60. package/lib/commonjs/components/LineLoader.js +61 -0
  61. package/lib/commonjs/components/LineLoader.js.map +1 -0
  62. package/lib/commonjs/components/LinkButton.js +32 -0
  63. package/lib/commonjs/components/LinkButton.js.map +1 -0
  64. package/lib/commonjs/components/OtpInputs.js +97 -0
  65. package/lib/commonjs/components/OtpInputs.js.map +1 -0
  66. package/lib/commonjs/components/ParentView.js +81 -0
  67. package/lib/commonjs/components/ParentView.js.map +1 -0
  68. package/lib/commonjs/components/Searchbar.js +22 -0
  69. package/lib/commonjs/components/Searchbar.js.map +1 -0
  70. package/lib/commonjs/components/SelectionDialog.js +130 -0
  71. package/lib/commonjs/components/SelectionDialog.js.map +1 -0
  72. package/lib/commonjs/components/Snackbar.js +69 -0
  73. package/lib/commonjs/components/Snackbar.js.map +1 -0
  74. package/lib/commonjs/components/Surface.js +19 -0
  75. package/lib/commonjs/components/Surface.js.map +1 -0
  76. package/lib/commonjs/components/Text.js +20 -0
  77. package/lib/commonjs/components/Text.js.map +1 -0
  78. package/lib/commonjs/components/TextInput.js +65 -0
  79. package/lib/commonjs/components/TextInput.js.map +1 -0
  80. package/lib/commonjs/components/ToggleButton.js +19 -0
  81. package/lib/commonjs/components/ToggleButton.js.map +1 -0
  82. package/lib/commonjs/components/Video.js +42 -0
  83. package/lib/commonjs/components/Video.js.map +1 -0
  84. package/lib/commonjs/components/View.js +20 -0
  85. package/lib/commonjs/components/View.js.map +1 -0
  86. package/lib/commonjs/components/index.js +174 -0
  87. package/lib/commonjs/components/index.js.map +1 -0
  88. package/lib/commonjs/index.js +37 -0
  89. package/lib/commonjs/index.js.map +1 -0
  90. package/lib/commonjs/theme/index.js +43 -0
  91. package/lib/commonjs/theme/index.js.map +1 -0
  92. package/lib/commonjs/theme/theme.js +126 -0
  93. package/lib/commonjs/theme/theme.js.map +1 -0
  94. package/lib/commonjs/theme/tokens.js +204 -0
  95. package/lib/commonjs/theme/tokens.js.map +1 -0
  96. package/lib/commonjs/types/index.d.js +2 -0
  97. package/lib/commonjs/types/index.d.js.map +1 -0
  98. package/lib/commonjs/types/svg.d.js +2 -0
  99. package/lib/commonjs/types/svg.d.js.map +1 -0
  100. package/lib/module/auth/api/authentication.js +11 -0
  101. package/lib/module/auth/api/authentication.js.map +1 -0
  102. package/lib/module/auth/appLogo.svg +9 -0
  103. package/lib/module/auth/hooks/useAuthenticateRequests.js +44 -0
  104. package/lib/module/auth/hooks/useAuthenticateRequests.js.map +1 -0
  105. package/lib/module/auth/hooks/useAuthentication.js +81 -0
  106. package/lib/module/auth/hooks/useAuthentication.js.map +1 -0
  107. package/lib/module/auth/index.js +5 -0
  108. package/lib/module/auth/index.js.map +1 -0
  109. package/lib/module/auth/providers/authentication/AuthenticationProvider.js +45 -0
  110. package/lib/module/auth/providers/authentication/AuthenticationProvider.js.map +1 -0
  111. package/lib/module/auth/providers/authentication/actions/authentication.actions.js +6 -0
  112. package/lib/module/auth/providers/authentication/actions/authentication.actions.js.map +1 -0
  113. package/lib/module/auth/providers/authentication/index.js +5 -0
  114. package/lib/module/auth/providers/authentication/index.js.map +1 -0
  115. package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js +14 -0
  116. package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -0
  117. package/lib/module/auth/providers/authentication/types/authentication.types.js +5 -0
  118. package/lib/module/auth/providers/authentication/types/authentication.types.js.map +1 -0
  119. package/lib/module/auth/screens/LoginScreen.js +121 -0
  120. package/lib/module/auth/screens/LoginScreen.js.map +1 -0
  121. package/lib/module/auth/screens/ResetPassword.js +82 -0
  122. package/lib/module/auth/screens/ResetPassword.js.map +1 -0
  123. package/lib/module/auth/screens/ResetPasswordInstructionsSent.js +26 -0
  124. package/lib/module/auth/screens/ResetPasswordInstructionsSent.js.map +1 -0
  125. package/lib/module/auth/screens/SignUp.js +168 -0
  126. package/lib/module/auth/screens/SignUp.js.map +1 -0
  127. package/lib/module/auth/screens/SignUpPassword.js +95 -0
  128. package/lib/module/auth/screens/SignUpPassword.js.map +1 -0
  129. package/lib/module/auth/screens/VerifyPhoneNumber.js +87 -0
  130. package/lib/module/auth/screens/VerifyPhoneNumber.js.map +1 -0
  131. package/lib/module/auth/screens/index.js +29 -0
  132. package/lib/module/auth/screens/index.js.map +1 -0
  133. package/lib/module/auth/screens/validators.js +31 -0
  134. package/lib/module/auth/screens/validators.js.map +1 -0
  135. package/lib/module/components/Alert.js +100 -0
  136. package/lib/module/components/Alert.js.map +1 -0
  137. package/lib/module/components/Badge.js +12 -0
  138. package/lib/module/components/Badge.js.map +1 -0
  139. package/lib/module/components/BottomSheet.js +52 -0
  140. package/lib/module/components/BottomSheet.js.map +1 -0
  141. package/lib/module/components/Button.js +12 -0
  142. package/lib/module/components/Button.js.map +1 -0
  143. package/lib/module/components/Card.js +11 -0
  144. package/lib/module/components/Card.js.map +1 -0
  145. package/lib/module/components/Divider.js +11 -0
  146. package/lib/module/components/Divider.js.map +1 -0
  147. package/lib/module/components/FAB.js +11 -0
  148. package/lib/module/components/FAB.js.map +1 -0
  149. package/lib/module/components/Header.js +66 -0
  150. package/lib/module/components/Header.js.map +1 -0
  151. package/lib/module/components/IconButton.js +11 -0
  152. package/lib/module/components/IconButton.js.map +1 -0
  153. package/lib/module/components/Image.js +35 -0
  154. package/lib/module/components/Image.js.map +1 -0
  155. package/lib/module/components/KeyboardAvoidingView.js +15 -0
  156. package/lib/module/components/KeyboardAvoidingView.js.map +1 -0
  157. package/lib/module/components/LineLoader.js +52 -0
  158. package/lib/module/components/LineLoader.js.map +1 -0
  159. package/lib/module/components/LinkButton.js +24 -0
  160. package/lib/module/components/LinkButton.js.map +1 -0
  161. package/lib/module/components/OtpInputs.js +87 -0
  162. package/lib/module/components/OtpInputs.js.map +1 -0
  163. package/lib/module/components/ParentView.js +72 -0
  164. package/lib/module/components/ParentView.js.map +1 -0
  165. package/lib/module/components/Searchbar.js +14 -0
  166. package/lib/module/components/Searchbar.js.map +1 -0
  167. package/lib/module/components/SelectionDialog.js +121 -0
  168. package/lib/module/components/SelectionDialog.js.map +1 -0
  169. package/lib/module/components/Snackbar.js +60 -0
  170. package/lib/module/components/Snackbar.js.map +1 -0
  171. package/lib/module/components/Surface.js +11 -0
  172. package/lib/module/components/Surface.js.map +1 -0
  173. package/lib/module/components/Text.js +12 -0
  174. package/lib/module/components/Text.js.map +1 -0
  175. package/lib/module/components/TextInput.js +56 -0
  176. package/lib/module/components/TextInput.js.map +1 -0
  177. package/lib/module/components/ToggleButton.js +11 -0
  178. package/lib/module/components/ToggleButton.js.map +1 -0
  179. package/lib/module/components/Video.js +32 -0
  180. package/lib/module/components/Video.js.map +1 -0
  181. package/lib/module/components/View.js +12 -0
  182. package/lib/module/components/View.js.map +1 -0
  183. package/lib/module/components/index.js +25 -0
  184. package/lib/module/components/index.js.map +1 -0
  185. package/lib/module/index.js +6 -0
  186. package/lib/module/index.js.map +1 -0
  187. package/lib/module/theme/index.js +36 -0
  188. package/lib/module/theme/index.js.map +1 -0
  189. package/lib/module/theme/theme.js +119 -0
  190. package/lib/module/theme/theme.js.map +1 -0
  191. package/lib/module/theme/tokens.js +198 -0
  192. package/lib/module/theme/tokens.js.map +1 -0
  193. package/lib/module/types/index.d.js +2 -0
  194. package/lib/module/types/index.d.js.map +1 -0
  195. package/lib/module/types/svg.d.js +2 -0
  196. package/lib/module/types/svg.d.js.map +1 -0
  197. package/lib/typescript/src/auth/api/authentication.d.ts +4 -0
  198. package/lib/typescript/src/auth/api/authentication.d.ts.map +1 -0
  199. package/lib/typescript/src/auth/hooks/useAuthenticateRequests.d.ts +2 -0
  200. package/lib/typescript/src/auth/hooks/useAuthenticateRequests.d.ts.map +1 -0
  201. package/lib/typescript/src/auth/hooks/useAuthentication.d.ts +19 -0
  202. package/lib/typescript/src/auth/hooks/useAuthentication.d.ts.map +1 -0
  203. package/lib/typescript/src/auth/index.d.ts +5 -0
  204. package/lib/typescript/src/auth/index.d.ts.map +1 -0
  205. package/lib/typescript/src/auth/providers/authentication/AuthenticationProvider.d.ts +8 -0
  206. package/lib/typescript/src/auth/providers/authentication/AuthenticationProvider.d.ts.map +1 -0
  207. package/lib/typescript/src/auth/providers/authentication/actions/authentication.actions.d.ts +3 -0
  208. package/lib/typescript/src/auth/providers/authentication/actions/authentication.actions.d.ts.map +1 -0
  209. package/lib/typescript/src/auth/providers/authentication/index.d.ts +5 -0
  210. package/lib/typescript/src/auth/providers/authentication/index.d.ts.map +1 -0
  211. package/lib/typescript/src/auth/providers/authentication/reducer/authentication.reducer.d.ts +3 -0
  212. package/lib/typescript/src/auth/providers/authentication/reducer/authentication.reducer.d.ts.map +1 -0
  213. package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts +15 -0
  214. package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts.map +1 -0
  215. package/lib/typescript/src/auth/screens/LoginScreen.d.ts +3 -0
  216. package/lib/typescript/src/auth/screens/LoginScreen.d.ts.map +1 -0
  217. package/lib/typescript/src/auth/screens/ResetPassword.d.ts +3 -0
  218. package/lib/typescript/src/auth/screens/ResetPassword.d.ts.map +1 -0
  219. package/lib/typescript/src/auth/screens/ResetPasswordInstructionsSent.d.ts +8 -0
  220. package/lib/typescript/src/auth/screens/ResetPasswordInstructionsSent.d.ts.map +1 -0
  221. package/lib/typescript/src/auth/screens/SignUp.d.ts +9 -0
  222. package/lib/typescript/src/auth/screens/SignUp.d.ts.map +1 -0
  223. package/lib/typescript/src/auth/screens/SignUpPassword.d.ts +8 -0
  224. package/lib/typescript/src/auth/screens/SignUpPassword.d.ts.map +1 -0
  225. package/lib/typescript/src/auth/screens/VerifyPhoneNumber.d.ts +8 -0
  226. package/lib/typescript/src/auth/screens/VerifyPhoneNumber.d.ts.map +1 -0
  227. package/lib/typescript/src/auth/screens/index.d.ts +3 -0
  228. package/lib/typescript/src/auth/screens/index.d.ts.map +1 -0
  229. package/lib/typescript/src/auth/screens/validators.d.ts +36 -0
  230. package/lib/typescript/src/auth/screens/validators.d.ts.map +1 -0
  231. package/lib/typescript/src/components/Alert.d.ts +19 -0
  232. package/lib/typescript/src/components/Alert.d.ts.map +1 -0
  233. package/lib/typescript/src/components/Badge.d.ts +9 -0
  234. package/lib/typescript/src/components/Badge.d.ts.map +1 -0
  235. package/lib/typescript/src/components/BottomSheet.d.ts +7 -0
  236. package/lib/typescript/src/components/BottomSheet.d.ts.map +1 -0
  237. package/lib/typescript/src/components/Button.d.ts +9 -0
  238. package/lib/typescript/src/components/Button.d.ts.map +1 -0
  239. package/lib/typescript/src/components/Card.d.ts +9 -0
  240. package/lib/typescript/src/components/Card.d.ts.map +1 -0
  241. package/lib/typescript/src/components/Divider.d.ts +9 -0
  242. package/lib/typescript/src/components/Divider.d.ts.map +1 -0
  243. package/lib/typescript/src/components/FAB.d.ts +9 -0
  244. package/lib/typescript/src/components/FAB.d.ts.map +1 -0
  245. package/lib/typescript/src/components/Header.d.ts +18 -0
  246. package/lib/typescript/src/components/Header.d.ts.map +1 -0
  247. package/lib/typescript/src/components/IconButton.d.ts +9 -0
  248. package/lib/typescript/src/components/IconButton.d.ts.map +1 -0
  249. package/lib/typescript/src/components/Image.d.ts +9 -0
  250. package/lib/typescript/src/components/Image.d.ts.map +1 -0
  251. package/lib/typescript/src/components/KeyboardAvoidingView.d.ts +9 -0
  252. package/lib/typescript/src/components/KeyboardAvoidingView.d.ts.map +1 -0
  253. package/lib/typescript/src/components/LineLoader.d.ts +10 -0
  254. package/lib/typescript/src/components/LineLoader.d.ts.map +1 -0
  255. package/lib/typescript/src/components/LinkButton.d.ts +9 -0
  256. package/lib/typescript/src/components/LinkButton.d.ts.map +1 -0
  257. package/lib/typescript/src/components/OtpInputs.d.ts +18 -0
  258. package/lib/typescript/src/components/OtpInputs.d.ts.map +1 -0
  259. package/lib/typescript/src/components/ParentView.d.ts +19 -0
  260. package/lib/typescript/src/components/ParentView.d.ts.map +1 -0
  261. package/lib/typescript/src/components/Searchbar.d.ts +9 -0
  262. package/lib/typescript/src/components/Searchbar.d.ts.map +1 -0
  263. package/lib/typescript/src/components/SelectionDialog.d.ts +20 -0
  264. package/lib/typescript/src/components/SelectionDialog.d.ts.map +1 -0
  265. package/lib/typescript/src/components/Snackbar.d.ts +15 -0
  266. package/lib/typescript/src/components/Snackbar.d.ts.map +1 -0
  267. package/lib/typescript/src/components/Surface.d.ts +9 -0
  268. package/lib/typescript/src/components/Surface.d.ts.map +1 -0
  269. package/lib/typescript/src/components/Text.d.ts +13 -0
  270. package/lib/typescript/src/components/Text.d.ts.map +1 -0
  271. package/lib/typescript/src/components/TextInput.d.ts +12 -0
  272. package/lib/typescript/src/components/TextInput.d.ts.map +1 -0
  273. package/lib/typescript/src/components/ToggleButton.d.ts +9 -0
  274. package/lib/typescript/src/components/ToggleButton.d.ts.map +1 -0
  275. package/lib/typescript/src/components/Video.d.ts +4 -0
  276. package/lib/typescript/src/components/Video.d.ts.map +1 -0
  277. package/lib/typescript/src/components/View.d.ts +9 -0
  278. package/lib/typescript/src/components/View.d.ts.map +1 -0
  279. package/lib/typescript/src/components/index.d.ts +25 -0
  280. package/lib/typescript/src/components/index.d.ts.map +1 -0
  281. package/lib/typescript/src/index.d.ts +4 -0
  282. package/lib/typescript/src/index.d.ts.map +1 -0
  283. package/lib/typescript/src/theme/index.d.ts +284 -0
  284. package/lib/typescript/src/theme/index.d.ts.map +1 -0
  285. package/lib/typescript/src/theme/theme.d.ts +4 -0
  286. package/lib/typescript/src/theme/theme.d.ts.map +1 -0
  287. package/lib/typescript/src/theme/tokens.d.ts +371 -0
  288. package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
  289. package/package.json +191 -0
  290. package/src/auth/api/authentication.ts +13 -0
  291. package/src/auth/appLogo.svg +9 -0
  292. package/src/auth/hooks/useAuthenticateRequests.ts +56 -0
  293. package/src/auth/hooks/useAuthentication.ts +106 -0
  294. package/src/auth/index.ts +4 -0
  295. package/src/auth/providers/authentication/AuthenticationProvider.tsx +68 -0
  296. package/src/auth/providers/authentication/actions/authentication.actions.ts +10 -0
  297. package/src/auth/providers/authentication/index.ts +4 -0
  298. package/src/auth/providers/authentication/reducer/authentication.reducer.ts +21 -0
  299. package/src/auth/providers/authentication/types/authentication.types.ts +17 -0
  300. package/src/auth/screens/LoginScreen.tsx +140 -0
  301. package/src/auth/screens/ResetPassword.tsx +85 -0
  302. package/src/auth/screens/ResetPasswordInstructionsSent.tsx +32 -0
  303. package/src/auth/screens/SignUp.tsx +176 -0
  304. package/src/auth/screens/SignUpPassword.tsx +124 -0
  305. package/src/auth/screens/VerifyPhoneNumber.tsx +100 -0
  306. package/src/auth/screens/index.tsx +26 -0
  307. package/src/auth/screens/validators.ts +73 -0
  308. package/src/components/Alert.tsx +157 -0
  309. package/src/components/Badge.tsx +50 -0
  310. package/src/components/BottomSheet.tsx +72 -0
  311. package/src/components/Button.tsx +47 -0
  312. package/src/components/Card.tsx +47 -0
  313. package/src/components/Divider.tsx +47 -0
  314. package/src/components/FAB.tsx +47 -0
  315. package/src/components/Header.tsx +123 -0
  316. package/src/components/IconButton.tsx +47 -0
  317. package/src/components/Image.tsx +78 -0
  318. package/src/components/KeyboardAvoidingView.tsx +55 -0
  319. package/src/components/LineLoader.tsx +70 -0
  320. package/src/components/LinkButton.tsx +64 -0
  321. package/src/components/OtpInputs.tsx +149 -0
  322. package/src/components/ParentView.tsx +164 -0
  323. package/src/components/Searchbar.tsx +47 -0
  324. package/src/components/SelectionDialog.tsx +191 -0
  325. package/src/components/Snackbar.tsx +83 -0
  326. package/src/components/Surface.tsx +47 -0
  327. package/src/components/Text.tsx +70 -0
  328. package/src/components/TextInput.tsx +116 -0
  329. package/src/components/ToggleButton.tsx +47 -0
  330. package/src/components/Video.tsx +37 -0
  331. package/src/components/View.tsx +55 -0
  332. package/src/components/index.ts +24 -0
  333. package/src/index.tsx +5 -0
  334. package/src/theme/index.ts +37 -0
  335. package/src/theme/theme.ts +125 -0
  336. package/src/theme/tokens.ts +209 -0
  337. package/src/types/index.d.ts +1 -0
  338. package/src/types/svg.d.ts +4 -0
@@ -0,0 +1,73 @@
1
+ import { t } from 'i18next';
2
+ import * as yup from 'yup';
3
+
4
+ export const EMAIL_REGEX =
5
+ /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$|^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[^@\s]+\.[^@\s]+$/;
6
+
7
+ const displayName = yup
8
+ .string()
9
+ .required(t('authentication.displayNameRequired'))
10
+ .label(t('authentication.displayNameRequired'));
11
+
12
+ const businessName = yup
13
+ .string()
14
+ .required(t('authentication.businessNameRequired'))
15
+ .label(t('authentication.businessName'));
16
+
17
+ const emailForLogin = yup
18
+ .string()
19
+ .required(t('authentication.requiredEmailForLogin'))
20
+ .matches(EMAIL_REGEX, t('authentication.validEmail'))
21
+ .label(t('authentication.email'));
22
+
23
+ const emailForSignup = yup
24
+ .string()
25
+ .required(t('authentication.requiredEmailForSignUp'))
26
+ .matches(EMAIL_REGEX, t('authentication.validEmail'))
27
+ .label(t('authentication.email'));
28
+
29
+ const phoneNumber = yup
30
+ .string()
31
+ .required(t('authentication.requiredPhoneNumber'))
32
+ .label(t('authentication.phoneNumber'));
33
+
34
+ const password = yup
35
+ .string()
36
+ .required(t('authentication.requiredPassword'))
37
+ .label(t('authentication.password'));
38
+
39
+ const newPassword = yup
40
+ .string()
41
+ .required()
42
+ .min(8, t('authentication.minLength'))
43
+ .matches(/[a-z]/, t('authentication.1lowerChar'))
44
+ .matches(/[A-Z]/, t('authentication.1upperChar'))
45
+ .matches(/[0-9]/, t('authentication.1number'))
46
+ .matches(/[!@#$%^&*(),.?":{}|<>]/, t('authentication.1special'))
47
+ .label(t('authentication.password'));
48
+
49
+ const code = yup.string().required().min(6);
50
+
51
+ export const signUpValidationSchema = yup.object().shape({
52
+ displayName,
53
+ email: emailForSignup,
54
+ phoneNumber,
55
+ name: businessName,
56
+ });
57
+
58
+ export const loginValidationSchema = yup.object().shape({
59
+ email: emailForLogin,
60
+ password,
61
+ });
62
+
63
+ export const resetPasswordValidationSchema = yup.object().shape({
64
+ email: emailForLogin,
65
+ });
66
+
67
+ export const verificationValidationSchema = yup.object().shape({
68
+ code,
69
+ });
70
+
71
+ export const passwordVerificationSchema = yup.object().shape({
72
+ password: newPassword,
73
+ });
@@ -0,0 +1,157 @@
1
+ import React, { useState, useCallback } from 'react';
2
+ import { Dialog, Text, useTheme } from 'react-native-paper';
3
+ import { t } from 'i18next';
4
+ import { Button } from './Button';
5
+
6
+ interface ButtonProps {
7
+ label: string;
8
+ onPress?: () => void;
9
+ mode?: 'text' | 'outlined' | 'contained' | 'elevated' | 'contained-tonal';
10
+ }
11
+
12
+ interface AlertParams {
13
+ title?: string;
14
+ description?: string;
15
+ isDismissable?: boolean;
16
+ buttons?: ButtonProps[];
17
+ }
18
+
19
+ interface AlertHandle {
20
+ show: (params: AlertParams) => void;
21
+ }
22
+
23
+ const useAlertHook = () => {
24
+ const [isVisible, setIsVisible] = useState(false);
25
+ const [params, setParams] = useState<AlertParams>({});
26
+ const {
27
+ title = '',
28
+ description = '',
29
+ isDismissable = true,
30
+ buttons = [],
31
+ } = params;
32
+
33
+ const show = useCallback((parameters: AlertParams) => {
34
+ setParams(parameters);
35
+ setIsVisible(true);
36
+ }, []);
37
+
38
+ const hide = useCallback(() => {
39
+ setIsVisible(false);
40
+ }, []);
41
+
42
+ return {
43
+ isVisible,
44
+ show,
45
+ hide,
46
+ title,
47
+ description,
48
+ isDismissable,
49
+ buttons,
50
+ };
51
+ };
52
+
53
+ let rootLevelRef: AlertHandle | null = null;
54
+
55
+ export const Alert = () => {
56
+ const { isVisible, show, hide, buttons, isDismissable, title, description } =
57
+ useAlertHook();
58
+ const theme = useTheme();
59
+
60
+ const [
61
+ button1 = {
62
+ label: t('ok'),
63
+ onPress: () => {},
64
+ mode: 'text',
65
+ },
66
+ button2,
67
+ button3,
68
+ ] = buttons;
69
+
70
+ const ref: any = React.useRef(null);
71
+
72
+ React.useImperativeHandle(
73
+ ref,
74
+ React.useCallback(
75
+ () => ({
76
+ show,
77
+ }),
78
+ [show]
79
+ )
80
+ );
81
+
82
+ React.useEffect(() => {
83
+ rootLevelRef = ref.current;
84
+ }, [ref]);
85
+
86
+ return (
87
+ <Dialog
88
+ style={{
89
+ backgroundColor: theme.colors.background,
90
+ }}
91
+ dismissable={isDismissable}
92
+ dismissableBackButton={isDismissable}
93
+ onDismiss={() => {
94
+ if (isVisible) {
95
+ hide();
96
+ }
97
+ }}
98
+ visible={isVisible}
99
+ >
100
+ {Boolean(title) && (
101
+ <Dialog.Content>
102
+ <Text variant="titleMedium">{title}</Text>
103
+ </Dialog.Content>
104
+ )}
105
+ {Boolean(description) && (
106
+ <Dialog.Content>
107
+ <Text variant="bodyMedium">{description}</Text>
108
+ </Dialog.Content>
109
+ )}
110
+ <Dialog.Actions>
111
+ {button3 && (
112
+ <Button
113
+ mx="8"
114
+ mode={button3?.mode || 'text'}
115
+ onPress={() => {
116
+ hide();
117
+ button3?.onPress?.();
118
+ }}
119
+ >
120
+ {button3.label}
121
+ </Button>
122
+ )}
123
+ {button2 && (
124
+ <Button
125
+ ml="2"
126
+ mode={button2?.mode || 'text'}
127
+ onPress={() => {
128
+ hide();
129
+ button2?.onPress?.();
130
+ }}
131
+ >
132
+ {button2?.label}
133
+ </Button>
134
+ )}
135
+ {button1 && (
136
+ <Button
137
+ ml="2"
138
+ mode={button1?.mode || 'text'}
139
+ onPress={() => {
140
+ hide();
141
+ button1?.onPress?.();
142
+ }}
143
+ >
144
+ {button1.label}
145
+ </Button>
146
+ )}
147
+ </Dialog.Actions>
148
+ </Dialog>
149
+ );
150
+ };
151
+
152
+ Alert.displayName = 'Alert';
153
+
154
+ //@ts-ignore
155
+ Alert.show = (params: AlertParams) => {
156
+ rootLevelRef?.show(params);
157
+ };
@@ -0,0 +1,50 @@
1
+ import { Badge as B, type BadgeProps } from 'react-native-paper';
2
+
3
+ import {
4
+ backgroundColor,
5
+ backgroundColorShorthand,
6
+ type BackgroundColorProps,
7
+ border,
8
+ type BorderProps,
9
+ type ColorProps,
10
+ composeRestyleFunctions,
11
+ layout,
12
+ type LayoutProps,
13
+ position,
14
+ type PositionProps,
15
+ spacing,
16
+ type SpacingProps,
17
+ spacingShorthand,
18
+ type SpacingShorthandProps,
19
+ useRestyle,
20
+ type BackgroundColorShorthandProps,
21
+ } from '@shopify/restyle';
22
+
23
+ import { type ThemeType } from '../theme';
24
+ import React from 'react';
25
+
26
+ type RestyleProps = ColorProps<ThemeType> &
27
+ SpacingProps<ThemeType> &
28
+ SpacingShorthandProps<ThemeType> &
29
+ LayoutProps<ThemeType> &
30
+ PositionProps<ThemeType> &
31
+ BorderProps<ThemeType> &
32
+ BackgroundColorProps<ThemeType> &
33
+ BackgroundColorShorthandProps<ThemeType>;
34
+
35
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
36
+ spacing,
37
+ spacingShorthand,
38
+ layout,
39
+ position,
40
+ border,
41
+ backgroundColor,
42
+ backgroundColorShorthand,
43
+ ]);
44
+
45
+ type propsType = RestyleProps & BadgeProps;
46
+
47
+ export const Badge = ({ children, ...rest }: propsType) => {
48
+ const props = useRestyle(restyleFunctions, rest);
49
+ return <B {...props}>{children}</B>;
50
+ };
@@ -0,0 +1,72 @@
1
+ import React, { useCallback } from 'react';
2
+ import { useTheme } from 'react-native-paper';
3
+ import { ParentView, View } from '../components';
4
+ import BS, { BottomSheetBackdrop } from '@gorhom/bottom-sheet';
5
+ import { StyleSheet } from 'react-native';
6
+
7
+ export const BottomSheet = React.forwardRef<
8
+ typeof BS,
9
+ {
10
+ children: React.ReactNode;
11
+ pressBehavior?: 'close' | 'collapse' | 'none';
12
+ snapPoints: Array<string>;
13
+ }
14
+ >(({ children, pressBehavior = 'none', snapPoints, ...rest }, ref) => {
15
+ const theme = useTheme();
16
+
17
+ const renderBackdrop = useCallback(
18
+ (props: any) => (
19
+ <BottomSheetBackdrop
20
+ {...props}
21
+ pressBehavior={pressBehavior}
22
+ disappearsOnIndex={-1}
23
+ appearsOnIndex={1}
24
+ >
25
+ <View
26
+ style={[
27
+ styles.backdrop,
28
+ {
29
+ backgroundColor: theme.colors.backdrop,
30
+ },
31
+ ]}
32
+ />
33
+ </BottomSheetBackdrop>
34
+ ),
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ []
37
+ );
38
+
39
+ return (
40
+ <BS
41
+ android_keyboardInputMode="adjustPan"
42
+ keyboardBlurBehavior="restore"
43
+ handleStyle={[
44
+ styles.handleStyle,
45
+ {
46
+ backgroundColor: theme.colors.background,
47
+ },
48
+ ]}
49
+ handleIndicatorStyle={{
50
+ backgroundColor: theme.colors.onBackground,
51
+ }}
52
+ backdropComponent={renderBackdrop}
53
+ enablePanDownToClose={true}
54
+ snapPoints={snapPoints}
55
+ ref={ref as any}
56
+ index={-1}
57
+ {...rest}
58
+ >
59
+ <ParentView topInset={false}>{children}</ParentView>
60
+ </BS>
61
+ );
62
+ });
63
+
64
+ const styles = StyleSheet.create({
65
+ backdrop: {
66
+ flex: 1,
67
+ },
68
+ handleStyle: {
69
+ borderTopRightRadius: 10,
70
+ borderTopLeftRadius: 10,
71
+ },
72
+ });
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Button as B, type ButtonProps } from 'react-native-paper';
3
+ import {
4
+ useRestyle,
5
+ spacing,
6
+ border,
7
+ composeRestyleFunctions,
8
+ type SpacingProps,
9
+ type BorderProps,
10
+ type BackgroundColorProps,
11
+ backgroundColor,
12
+ backgroundColorShorthand,
13
+ layout,
14
+ position,
15
+ spacingShorthand,
16
+ type SpacingShorthandProps,
17
+ type LayoutProps,
18
+ type PositionProps,
19
+ type BackgroundColorShorthandProps,
20
+ } from '@shopify/restyle';
21
+ import { type ThemeType } from '../theme';
22
+
23
+ type RestyleProps = SpacingProps<ThemeType> &
24
+ SpacingShorthandProps<ThemeType> &
25
+ LayoutProps<ThemeType> &
26
+ PositionProps<ThemeType> &
27
+ BorderProps<ThemeType> &
28
+ BackgroundColorProps<ThemeType> &
29
+ BackgroundColorShorthandProps<ThemeType>;
30
+
31
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
32
+ spacing,
33
+ spacingShorthand,
34
+ layout,
35
+ position,
36
+ border,
37
+ backgroundColor,
38
+ backgroundColorShorthand,
39
+ ]);
40
+
41
+ type TextProps = Omit<RestyleProps, 'variant'> & ButtonProps;
42
+
43
+ export const Button: React.FC<TextProps> = ({ children, ...rest }) => {
44
+ const restyleProps = useRestyle(restyleFunctions, rest);
45
+
46
+ return <B {...restyleProps}>{children}</B>;
47
+ };
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Card as C, type CardProps } from 'react-native-paper';
3
+ import {
4
+ useRestyle,
5
+ spacing,
6
+ border,
7
+ backgroundColor,
8
+ backgroundColorShorthand,
9
+ type SpacingProps,
10
+ type BorderProps,
11
+ type BackgroundColorProps,
12
+ composeRestyleFunctions,
13
+ type SpacingShorthandProps,
14
+ type LayoutProps,
15
+ type PositionProps,
16
+ spacingShorthand,
17
+ layout,
18
+ position,
19
+ type BackgroundColorShorthandProps,
20
+ } from '@shopify/restyle';
21
+ import { type ThemeType } from '../theme';
22
+
23
+ type RestyleProps = SpacingProps<ThemeType> &
24
+ SpacingShorthandProps<ThemeType> &
25
+ LayoutProps<ThemeType> &
26
+ PositionProps<ThemeType> &
27
+ BorderProps<ThemeType> &
28
+ BackgroundColorProps<ThemeType> &
29
+ BackgroundColorShorthandProps<ThemeType>;
30
+
31
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
32
+ spacing,
33
+ spacingShorthand,
34
+ layout,
35
+ position,
36
+ border,
37
+ backgroundColor,
38
+ backgroundColorShorthand,
39
+ ]);
40
+
41
+ type Props = RestyleProps & CardProps;
42
+
43
+ export const Card = ({ ...rest }: Props) => {
44
+ const props = useRestyle(restyleFunctions as any, rest);
45
+
46
+ return <C {...(props as any)} />;
47
+ };
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Divider as D, type DividerProps } from 'react-native-paper';
3
+ import {
4
+ useRestyle,
5
+ spacing,
6
+ border,
7
+ backgroundColor,
8
+ backgroundColorShorthand,
9
+ type SpacingProps,
10
+ type BorderProps,
11
+ type BackgroundColorProps,
12
+ composeRestyleFunctions,
13
+ type SpacingShorthandProps,
14
+ type LayoutProps,
15
+ type PositionProps,
16
+ spacingShorthand,
17
+ layout,
18
+ position,
19
+ type BackgroundColorShorthandProps,
20
+ } from '@shopify/restyle';
21
+ import { type ThemeType } from '../theme';
22
+
23
+ type RestyleProps = SpacingProps<ThemeType> &
24
+ SpacingShorthandProps<ThemeType> &
25
+ LayoutProps<ThemeType> &
26
+ PositionProps<ThemeType> &
27
+ BorderProps<ThemeType> &
28
+ BackgroundColorProps<ThemeType> &
29
+ BackgroundColorShorthandProps<ThemeType>;
30
+
31
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
32
+ spacing,
33
+ spacingShorthand,
34
+ layout,
35
+ position,
36
+ border,
37
+ backgroundColor,
38
+ backgroundColorShorthand,
39
+ ]);
40
+
41
+ type Props = RestyleProps & DividerProps;
42
+
43
+ export const Divider = ({ ...rest }: Props) => {
44
+ const props = useRestyle(restyleFunctions as any, rest);
45
+
46
+ return <D {...props} />;
47
+ };
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { FAB as F, type FABProps } from 'react-native-paper';
3
+ import {
4
+ useRestyle,
5
+ spacing,
6
+ border,
7
+ backgroundColor,
8
+ backgroundColorShorthand,
9
+ type SpacingProps,
10
+ type BorderProps,
11
+ type BackgroundColorProps,
12
+ composeRestyleFunctions,
13
+ type SpacingShorthandProps,
14
+ type LayoutProps,
15
+ type PositionProps,
16
+ spacingShorthand,
17
+ layout,
18
+ position,
19
+ type BackgroundColorShorthandProps,
20
+ } from '@shopify/restyle';
21
+ import { type ThemeType } from '../theme';
22
+
23
+ type RestyleProps = SpacingProps<ThemeType> &
24
+ SpacingShorthandProps<ThemeType> &
25
+ LayoutProps<ThemeType> &
26
+ PositionProps<ThemeType> &
27
+ BorderProps<ThemeType> &
28
+ BackgroundColorProps<ThemeType> &
29
+ BackgroundColorShorthandProps<ThemeType>;
30
+
31
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
32
+ spacing,
33
+ spacingShorthand,
34
+ layout,
35
+ position,
36
+ border,
37
+ backgroundColor,
38
+ backgroundColorShorthand,
39
+ ]);
40
+
41
+ type Props = RestyleProps & FABProps;
42
+
43
+ export const FAB = ({ ...rest }: Props) => {
44
+ const props = useRestyle(restyleFunctions as any, rest);
45
+
46
+ return <F {...props} />;
47
+ };
@@ -0,0 +1,123 @@
1
+ import * as React from 'react';
2
+ import { Text } from '../components';
3
+ import { Appbar, Menu, useTheme } from 'react-native-paper';
4
+ import { IconButton } from '../components';
5
+ import { View } from '../components';
6
+ import { useNavigation } from '@react-navigation/native';
7
+ import { type GestureResponderEvent, type ViewProps } from 'react-native';
8
+ import {
9
+ useRestyle,
10
+ spacing,
11
+ border,
12
+ backgroundColor,
13
+ backgroundColorShorthand,
14
+ type SpacingProps,
15
+ type BorderProps,
16
+ type BackgroundColorProps,
17
+ composeRestyleFunctions,
18
+ type SpacingShorthandProps,
19
+ type LayoutProps,
20
+ type PositionProps,
21
+ spacingShorthand,
22
+ layout,
23
+ position,
24
+ type BackgroundColorShorthandProps,
25
+ } from '@shopify/restyle';
26
+ import { type ThemeType } from '../theme';
27
+
28
+ type RestyleProps = SpacingProps<ThemeType> &
29
+ SpacingShorthandProps<ThemeType> &
30
+ LayoutProps<ThemeType> &
31
+ PositionProps<ThemeType> &
32
+ BorderProps<ThemeType> &
33
+ BackgroundColorProps<ThemeType> &
34
+ BackgroundColorShorthandProps<ThemeType>;
35
+
36
+ const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
37
+ spacing,
38
+ spacingShorthand,
39
+ layout,
40
+ position,
41
+ border,
42
+ backgroundColor,
43
+ backgroundColorShorthand,
44
+ ]);
45
+
46
+ type Props = RestyleProps &
47
+ ViewProps & {
48
+ textAlign?: 'center' | 'right' | 'left';
49
+ title?: string;
50
+ customRightOptions?: React.ReactNode;
51
+ menuOptions?: Array<{
52
+ leadingIcon: string;
53
+ title: string;
54
+ onPress: (e?: GestureResponderEvent) => void;
55
+ }>;
56
+ };
57
+
58
+ export const Header: React.FC<Props> = ({
59
+ title,
60
+ menuOptions,
61
+ textAlign = 'center',
62
+ customRightOptions = null,
63
+ ...rest
64
+ }) => {
65
+ const props = useRestyle(restyleFunctions, rest);
66
+
67
+ const navigation = useNavigation();
68
+ const [visible, setVisible] = React.useState(false);
69
+ const theme = useTheme();
70
+
71
+ const openMenu = () => setVisible(true);
72
+ const closeMenu = () => setVisible(false);
73
+
74
+ return (
75
+ <View
76
+ height={60}
77
+ flexDirection="row"
78
+ alignItems="center"
79
+ {...(props as ViewProps)}
80
+ >
81
+ {navigation.canGoBack() ? (
82
+ <IconButton icon="arrow-left" onPress={navigation.goBack} />
83
+ ) : (
84
+ <View width={40} />
85
+ )}
86
+ <Text flex={1} textAlign={textAlign} variant="titleMedium">
87
+ {title}
88
+ </Text>
89
+ {menuOptions && (
90
+ <Menu
91
+ style={{
92
+ backgroundColor: theme.colors.background,
93
+ }}
94
+ contentStyle={{
95
+ backgroundColor: theme.colors.background,
96
+ }}
97
+ visible={visible}
98
+ onDismiss={closeMenu}
99
+ anchor={<Appbar.Action icon="dots-vertical" onPress={openMenu} />}
100
+ >
101
+ {menuOptions.map((menuOption) => {
102
+ const onPress = () => {
103
+ closeMenu();
104
+ menuOption.onPress();
105
+ };
106
+ return (
107
+ <Menu.Item
108
+ style={{
109
+ backgroundColor: theme.colors.background,
110
+ }}
111
+ key={menuOption.title}
112
+ {...menuOption}
113
+ onPress={onPress}
114
+ />
115
+ );
116
+ })}
117
+ </Menu>
118
+ )}
119
+ {customRightOptions}
120
+ {!menuOptions && !customRightOptions && <View width={40} />}
121
+ </View>
122
+ );
123
+ };