@tap-payments/auth-jsconnect 2.0.42-test → 2.0.42

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 (310) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +21 -12
  4. package/build/api/auth.d.ts +28 -5
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +51 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +9 -2
  25. package/build/app/settings.js +22 -11
  26. package/build/app/store.d.ts +0 -2
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/DatePicker/customStyle.css +86 -0
  41. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  42. package/build/components/FileInput/DragAndDrop.js +108 -8
  43. package/build/components/Lottie/Lottie.d.ts +878 -0
  44. package/build/components/Lottie/Lottie.js +58 -0
  45. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  46. package/build/components/Lottie/files/success.json +425 -0
  47. package/build/components/Lottie/index.d.ts +3 -0
  48. package/build/components/Lottie/index.js +3 -0
  49. package/build/components/OTPField/OTPField.d.ts +2 -1
  50. package/build/components/OTPField/OTPField.js +2 -2
  51. package/build/components/OTPTimer/OTPTimer.js +1 -1
  52. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  53. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  54. package/build/components/ProgressBar/index.d.ts +2 -0
  55. package/build/components/ProgressBar/index.js +2 -0
  56. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  57. package/build/components/RadioLabel/RadioLabel.js +2 -2
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  59. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  60. package/build/constants/api.d.ts +6 -0
  61. package/build/constants/api.js +14 -1
  62. package/build/constants/app.d.ts +5 -5
  63. package/build/constants/app.js +62 -32
  64. package/build/constants/assets.d.ts +14 -0
  65. package/build/constants/assets.js +16 -2
  66. package/build/constants/dummy.d.ts +1 -1
  67. package/build/constants/dummy.js +2 -2
  68. package/build/constants/validation.d.ts +10 -0
  69. package/build/constants/validation.js +11 -1
  70. package/build/features/app/auth/authStore.d.ts +30 -4
  71. package/build/features/app/auth/authStore.js +182 -20
  72. package/build/features/app/bank/bankStore.d.ts +16 -0
  73. package/build/features/app/bank/bankStore.js +88 -41
  74. package/build/features/app/business/businessStore.d.ts +22 -3
  75. package/build/features/app/business/businessStore.js +445 -296
  76. package/build/features/app/connect/connectStore.d.ts +34 -31
  77. package/build/features/app/connect/connectStore.js +427 -300
  78. package/build/features/app/entity/entityStore.d.ts +40 -8
  79. package/build/features/app/entity/entityStore.js +389 -149
  80. package/build/features/app/individual/individualStore.d.ts +18 -0
  81. package/build/features/app/individual/individualStore.js +178 -85
  82. package/build/features/app/password/passwordStore.d.ts +1 -7
  83. package/build/features/app/password/passwordStore.js +31 -20
  84. package/build/features/app/tax/taxStore.js +23 -16
  85. package/build/features/auth/Auth.d.ts +2 -1
  86. package/build/features/auth/Auth.js +37 -9
  87. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  88. package/build/features/auth/screens/NID/DOB.js +47 -0
  89. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  90. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  91. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  92. package/build/features/auth/screens/NID/NID.js +68 -0
  93. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  94. package/build/features/auth/screens/NID/TAC.js +87 -0
  95. package/build/features/auth/screens/NID/index.d.ts +3 -0
  96. package/build/features/auth/screens/NID/index.js +2 -0
  97. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  98. package/build/features/auth/screens/NID/validation.js +19 -0
  99. package/build/features/auth/screens/OTP/OTP.js +8 -4
  100. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  101. package/build/features/bank/Bank.js +4 -4
  102. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  103. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  104. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  105. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  106. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  107. package/build/features/bank/screens/Success/Success.js +7 -3
  108. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  109. package/build/features/business/Business.js +4 -4
  110. package/build/features/business/screens/Activities/Activities.js +16 -17
  111. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  112. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  113. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  114. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  115. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  116. package/build/features/business/screens/Activities/validation.js +0 -9
  117. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  118. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  121. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  122. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  123. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  124. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  126. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  127. package/build/features/business/screens/BusinessType/validation.js +52 -3
  128. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  129. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  130. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  131. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  132. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  133. package/build/features/business/screens/CivilID/index.js +2 -0
  134. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  135. package/build/features/business/screens/CivilID/validation.js +4 -0
  136. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  137. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  138. package/build/features/business/screens/Customers/Customers.js +15 -9
  139. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  140. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  141. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  142. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  143. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  144. package/build/features/business/screens/OTP/OTP.js +15 -2
  145. package/build/features/business/screens/Success/Success.js +10 -3
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +1 -0
  157. package/build/features/connect/Connect.js +38 -10
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +44 -28
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  177. package/build/features/connect/screens/Merchant/validation.js +108 -173
  178. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  179. package/build/features/connect/screens/NID/NID.js +5 -1
  180. package/build/features/connect/screens/OTP/OTP.js +20 -6
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  188. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  189. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  190. package/build/features/entity/Entity.js +6 -6
  191. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  192. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  193. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  194. package/build/features/entity/screens/Customers/Customers.js +90 -0
  195. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  196. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  197. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  198. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  199. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  200. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  201. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  202. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  203. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  204. package/build/features/entity/screens/Customers/index.js +2 -0
  205. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  206. package/build/features/entity/screens/Customers/validation.js +13 -0
  207. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  208. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  209. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  210. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  211. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  212. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  213. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  214. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  215. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  216. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  217. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  218. package/build/features/entity/screens/Success/Success.js +7 -3
  219. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
  220. package/build/features/entity/screens/Verify/Verify.js +18 -5
  221. package/build/features/featuresScreens.d.ts +0 -1
  222. package/build/features/featuresScreens.js +30 -7
  223. package/build/features/individual/Individual.js +4 -4
  224. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  225. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  226. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  227. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  228. package/build/features/individual/screens/Success/Success.js +7 -3
  229. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  230. package/build/features/individual/screens/Verify/Verify.js +18 -5
  231. package/build/features/password/Password.js +4 -4
  232. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  233. package/build/features/password/screens/OTP/OTP.js +15 -2
  234. package/build/features/password/screens/Success/Success.js +7 -3
  235. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
  236. package/build/features/password/screens/Verify/Verify.js +16 -3
  237. package/build/features/shared/Background/Background.d.ts +2 -5
  238. package/build/features/shared/Background/Background.js +7 -3
  239. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  240. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  241. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  242. package/build/features/shared/Button/MobileButton.js +2 -2
  243. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  244. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  245. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  246. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  247. package/build/features/shared/Dialog/index.d.ts +4 -0
  248. package/build/features/shared/Dialog/index.js +4 -0
  249. package/build/features/shared/Input/Input.d.ts +1 -1
  250. package/build/features/shared/Input/Input.js +2 -2
  251. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  252. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  253. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  254. package/build/features/signIn/SignIn.js +4 -4
  255. package/build/features/signIn/screens/Email/Email.js +4 -2
  256. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  257. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  258. package/build/features/signIn/screens/Password/Password.js +15 -2
  259. package/build/features/tax/Tax.js +6 -6
  260. package/build/features/tax/screens/Success/Success.js +9 -3
  261. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
  262. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  263. package/build/features/tax/screens/Verify/Verify.js +16 -3
  264. package/build/hooks/index.d.ts +2 -0
  265. package/build/hooks/index.js +2 -0
  266. package/build/hooks/useAppConfig.d.ts +3 -1
  267. package/build/hooks/useAppConfig.js +2 -2
  268. package/build/hooks/useAppDispatch.d.ts +0 -1
  269. package/build/hooks/useErrorListener.js +0 -6
  270. package/build/hooks/useScreen.d.ts +3 -0
  271. package/build/hooks/useScreen.js +14 -0
  272. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  273. package/build/hooks/useSetFromDefaultValues.js +24 -0
  274. package/build/index.css +140 -0
  275. package/build/index.d.ts +2 -3
  276. package/build/index.js +1 -4
  277. package/build/utils/array.d.ts +49 -1
  278. package/build/utils/array.js +58 -0
  279. package/build/utils/common.d.ts +1 -0
  280. package/build/utils/common.js +3 -0
  281. package/build/utils/device.d.ts +1 -0
  282. package/build/utils/device.js +13 -0
  283. package/build/utils/index.d.ts +1 -0
  284. package/build/utils/index.js +1 -0
  285. package/build/utils/locale.js +1 -1
  286. package/build/utils/object.d.ts +1 -0
  287. package/build/utils/object.js +12 -0
  288. package/build/utils/string.d.ts +13 -0
  289. package/build/utils/string.js +71 -1
  290. package/build/utils/validation.d.ts +2 -0
  291. package/build/utils/validation.js +6 -0
  292. package/package.json +4 -3
  293. package/build/features/app/otp/otpStore.d.ts +0 -28
  294. package/build/features/app/otp/otpStore.js +0 -153
  295. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  296. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  297. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  298. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  299. package/build/features/otp/OTP.d.ts +0 -7
  300. package/build/features/otp/OTP.js +0 -58
  301. package/build/features/otp/index.d.ts +0 -0
  302. package/build/features/otp/index.js +0 -1
  303. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  304. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  305. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  306. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  307. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  308. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  309. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  310. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -0,0 +1,94 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import React, { memo } from 'react';
25
+ import { Calendar, toDateObject } from 'react-multi-date-picker';
26
+ import arabic from 'react-date-object/calendars/arabic';
27
+ import arabic_ar from 'react-date-object/locales/arabic_ar';
28
+ import Box from '@mui/material/Box';
29
+ import { styled } from '@mui/material/styles';
30
+ import Divider from '@mui/material/Divider';
31
+ import Collapse from '../Collapse';
32
+ import ExpandIcon from '../ExpandIcon';
33
+ import CalendarTodayOutlined from '@mui/icons-material/CalendarTodayOutlined';
34
+ import Input from '../Input';
35
+ import Text from '../Text';
36
+ import './style.css';
37
+ var ContainerIcon = styled(CalendarTodayOutlined)(function (_a) {
38
+ var theme = _a.theme;
39
+ return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: 'pointer', width: theme.spacing(2.5), height: theme.spacing(2.5) }));
40
+ });
41
+ var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
42
+ var theme = _a.theme, disabled = _a.disabled;
43
+ return ({
44
+ cursor: disabled ? 'auto' : 'pointer',
45
+ fontFamily: theme.typography.fontFamily
46
+ });
47
+ });
48
+ var InputFieldStyled = styled(Input)(function (_a) {
49
+ var theme = _a.theme, disabled = _a.disabled;
50
+ return ({
51
+ cursor: disabled ? 'auto' : 'pointer',
52
+ '&::placeholder': __assign(__assign({ opacity: 1, color: theme.palette.text.primary, lineHeight: theme.spacing(2.125) }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight }),
53
+ '& .MuiInputBase-input': {
54
+ WebkitTextFillColor: 'inherit'
55
+ }
56
+ });
57
+ });
58
+ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
59
+ var theme = _a.theme, disabled = _a.disabled;
60
+ return ({
61
+ cursor: disabled ? 'auto' : 'pointer',
62
+ marginInlineEnd: theme.spacing(2.5)
63
+ });
64
+ });
65
+ var DatePicker = function (_a) {
66
+ var disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, rest = __rest(_a, ["disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value"]);
67
+ var _b = React.useState(null), anchor = _b[0], setAnchor = _b[1];
68
+ var calenderIcon = _jsx(ContainerIcon, {});
69
+ var defaultMax = new Date();
70
+ var defaultMin = new Date('1900-01-01');
71
+ var DATE_FORMAT = 'YYYY-MM-DD';
72
+ var toggleCalender = function (event) {
73
+ if (disabled)
74
+ return;
75
+ if (anchor) {
76
+ onDatePicked && onDatePicked();
77
+ setAnchor(null);
78
+ return;
79
+ }
80
+ setAnchor(event.currentTarget);
81
+ onClick && onClick(event);
82
+ };
83
+ var handleOnDateChange = function (date) {
84
+ onDateChange && onDateChange(date.toDate().toLocaleDateString('en-CA'));
85
+ setAnchor(null);
86
+ onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
87
+ };
88
+ var formateDate = function (date) {
89
+ var dateObject = toDateObject(date);
90
+ return dateObject.convert(arabic).format(DATE_FORMAT);
91
+ };
92
+ return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: disabled ? '' : _jsx(ExpandIcon, { anchorEl: !!anchor }) })), value: value ? formateDate(value) : '', placeholder: DATE_FORMAT, onClick: toggleCalender, startAdornment: calenderIcon, disabled: !disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: !!anchor }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: arabic_ar, maxDate: defaultMax, minDate: defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: value, className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
93
+ };
94
+ export default memo(DatePicker);
@@ -0,0 +1,2 @@
1
+ import ArabicDatePicker from './ArabicDatePicker';
2
+ export default ArabicDatePicker;
@@ -0,0 +1,2 @@
1
+ import ArabicDatePicker from './ArabicDatePicker';
2
+ export default ArabicDatePicker;
@@ -0,0 +1,24 @@
1
+ .rmdp-wrapper {
2
+ box-shadow: none !important;
3
+ width: 100% !important;
4
+ z-index: 0 !important;
5
+ }
6
+
7
+ .rmdp-day-picker > div {
8
+ width: 100%;
9
+ }
10
+
11
+ .rmdp-calendar {
12
+ width: 100%;
13
+ }
14
+ /* .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
15
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
16
+ color: black !important;
17
+ background-color: unset !important;
18
+ } */
19
+
20
+ .rmdp-day.rmdp-selected span:not(.highlight) {
21
+ /* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
22
+ color: #ffffff !important;
23
+ background-color: black !important;
24
+ }
@@ -0,0 +1,86 @@
1
+ .date_picker_input {
2
+ cursor: pointer;
3
+ }
4
+
5
+ .react-calendar {
6
+ width: 100%;
7
+ border: none;
8
+ padding: 15px 0px 15px 0px;
9
+ }
10
+
11
+ .react-calendar__navigation {
12
+ display: flex;
13
+ position: relative;
14
+ }
15
+ .react-calendar__navigation__label__labelText {
16
+ font-family: 'Lato', 'Roboto';
17
+ }
18
+ .react-calendar__navigation button:enabled:hover,
19
+ .react-calendar__navigation button:enabled:focus {
20
+ background-color: #ffffff;
21
+ }
22
+ .react-calendar__navigation__prev-button {
23
+ top: 20px;
24
+ left: 86px;
25
+ }
26
+
27
+ .react-calendar__navigation__next-button {
28
+ top: 0px;
29
+ left: 86px;
30
+ }
31
+
32
+ .react-calendar__navigation__prev2-button {
33
+ top: 20px;
34
+ right: 13px;
35
+ }
36
+
37
+ .react-calendar__navigation__next2-button {
38
+ top: 0px;
39
+ right: 13px;
40
+ }
41
+
42
+ .react-calendar__navigation__arrow {
43
+ background-color: transparent !important;
44
+ }
45
+
46
+ abbr[title] {
47
+ text-decoration: none;
48
+ font-weight: 400;
49
+ color: #abaeb6;
50
+ }
51
+
52
+ .react-calendar__tile {
53
+ transition: all 0.5s ease;
54
+ }
55
+
56
+ .react-calendar__tile:enabled:hover,
57
+ .react-calendar__tile:enabled:focus {
58
+ background-color: transparent;
59
+ }
60
+
61
+ .react-calendar__tile:enabled:hover {
62
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
63
+ }
64
+
65
+ .react-calendar__month-view__days__day--weekend,
66
+ .react-calendar__tile {
67
+ color: #3a4154;
68
+ }
69
+ .react-calendar__tile--hasActive {
70
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
71
+ }
72
+
73
+ .react-calendar__tile--active,
74
+ .react-calendar__tile--active:enabled:hover,
75
+ .react-calendar__tile--active:enabled:focus {
76
+ background-color: transparent;
77
+ background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
78
+ color: #ffffff;
79
+ }
80
+ .react-calendar__tile--now {
81
+ background-color: transparent;
82
+ }
83
+ .react-calendar__navigation button:disabled {
84
+ background-color: #ffffff;
85
+ color: #3a4154;
86
+ }
@@ -1,7 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  interface DragAndDropProps {
3
3
  title: string;
4
+ subTitle: string;
5
+ description: string;
6
+ uploadingTitle: string;
7
+ successTitle: string;
8
+ error?: string;
9
+ progress?: number;
10
+ uploading?: boolean;
11
+ uploadSuccess?: boolean;
12
+ fileExists: boolean;
4
13
  onSuccess?: (files: File) => void;
5
14
  }
6
- declare const DragAndDrop: ({ title, onSuccess }: DragAndDropProps) => JSX.Element;
15
+ declare const DragAndDrop: ({ title, subTitle, description, error, uploadingTitle, successTitle, progress, uploading, fileExists, uploadSuccess, onSuccess }: DragAndDropProps) => JSX.Element;
7
16
  export default DragAndDrop;
@@ -9,30 +9,130 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import React from 'react';
13
14
  import Box from '@mui/material/Box';
14
15
  import { alpha, styled } from '@mui/material/styles';
15
16
  import Input from '../Input';
16
17
  import Text from '../Text';
17
18
  import { useDropzone } from 'react-dropzone';
18
- var BoxStyled = styled(Box)(function (_a) {
19
- var theme = _a.theme;
20
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightRegular, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), border: "1px dashed ".concat(alpha(theme.palette.divider, 0.8)), width: '50%', cursor: 'pointer' }));
19
+ import Icon from '../../components/Icon';
20
+ import { ICONS_NAMES } from '../../constants';
21
+ import { CircularProgress } from '../../components/ProgressBar';
22
+ import Collapse from '../../components/Collapse';
23
+ import Fade from '@mui/material/Fade';
24
+ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'active'; } })(function (_a) {
25
+ var theme = _a.theme, active = _a.active;
26
+ return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightRegular, background: theme.palette.background.paper, paddingInline: theme.spacing(2.5), border: "2px dashed ".concat(active ? theme.palette.primary.main : alpha(theme.palette.divider, 0.8)), width: '350px', height: '158px', cursor: 'default', display: 'flex', justifyContent: 'center', alignItems: 'center', borderRadius: theme.spacing(2.5) }));
21
27
  });
22
28
  var UploadInputStyled = styled(Input)(function () { return ({
23
29
  display: 'none'
24
30
  }); });
31
+ var CenterBoxStyled = styled(Box)(function () { return ({
32
+ display: 'flex',
33
+ justifyContent: 'center',
34
+ alignItems: 'center'
35
+ }); });
36
+ var IconStyled = styled(Icon)(function (_a) {
37
+ var theme = _a.theme;
38
+ return ({
39
+ width: theme.spacing(11.25),
40
+ height: theme.spacing(10),
41
+ cursor: 'pointer'
42
+ });
43
+ });
44
+ var DoneIconStyled = styled(Icon)(function (_a) {
45
+ var theme = _a.theme;
46
+ return ({
47
+ width: theme.spacing(6.75),
48
+ height: theme.spacing(6.75),
49
+ cursor: 'pointer'
50
+ });
51
+ });
52
+ var VerticalCenterBox = styled(Box)(function (_a) {
53
+ var theme = _a.theme;
54
+ return ({
55
+ display: 'flex',
56
+ justifyContent: 'center',
57
+ flexDirection: 'column',
58
+ alignItems: 'center'
59
+ });
60
+ });
61
+ var DescTextStyled = styled(Text)(function (_a) {
62
+ var theme = _a.theme;
63
+ return ({
64
+ fontSize: theme.spacing(1.5),
65
+ width: theme.spacing(27.5),
66
+ wordBreak: 'break-all',
67
+ textAlign: 'center',
68
+ marginBlockStart: theme.spacing(1),
69
+ marginBlockEnd: theme.spacing(0)
70
+ });
71
+ });
72
+ var SubTitleStyled = styled(Text)(function (_a) {
73
+ var theme = _a.theme;
74
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.primary.main, marginInlineStart: theme.spacing(0.5) }));
75
+ });
76
+ var WarningIconStyled = styled(Icon)(function (_a) {
77
+ var theme = _a.theme;
78
+ return ({
79
+ width: theme.spacing(1.625),
80
+ height: theme.spacing(1.625),
81
+ marginInline: theme.spacing(0.5)
82
+ });
83
+ });
84
+ var DropFileIcon = styled(Icon)(function (_a) {
85
+ var theme = _a.theme;
86
+ return ({
87
+ width: theme.spacing(9.375),
88
+ height: theme.spacing(9.375),
89
+ zIndex: 2,
90
+ position: 'absolute',
91
+ right: 0,
92
+ marginInline: theme.spacing(-1.25)
93
+ });
94
+ });
95
+ var TextDoneStyled = styled(Text)(function (_a) {
96
+ var theme = _a.theme;
97
+ return ({
98
+ marginBlockStart: theme.spacing(1),
99
+ color: theme.palette.text.primary
100
+ });
101
+ });
102
+ var WarningContainer = styled(Box)(function (_a) {
103
+ var theme = _a.theme;
104
+ return (__assign({ background: theme.palette.warning.dark, paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), border: '0.5px solid', display: 'flex', justifyContent: 'space-around', borderColor: theme.palette.warning.main, color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: theme.spacing(12.5) }, theme.typography.caption));
105
+ });
25
106
  var DragAndDrop = function (_a) {
26
- var title = _a.title, onSuccess = _a.onSuccess;
27
- var _b = useDropzone({
107
+ var title = _a.title, subTitle = _a.subTitle, description = _a.description, error = _a.error, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, progress = _a.progress, uploading = _a.uploading, fileExists = _a.fileExists, uploadSuccess = _a.uploadSuccess, onSuccess = _a.onSuccess;
108
+ var _b = React.useState(false), dragActive = _b[0], setDragActive = _b[1];
109
+ var _c = React.useState(false), showDone = _c[0], setShowDone = _c[1];
110
+ var _d = useDropzone({
28
111
  maxFiles: 1,
29
112
  noKeyboard: true,
30
113
  noClick: false,
31
114
  multiple: false,
115
+ onDragOver: function () {
116
+ if (!dragActive)
117
+ setDragActive(true);
118
+ },
119
+ onDragLeave: function () {
120
+ setDragActive(false);
121
+ },
32
122
  onDrop: function (files) {
33
123
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(files === null || files === void 0 ? void 0 : files[0]);
124
+ setDragActive(false);
125
+ }
126
+ }), getRootProps = _d.getRootProps, getInputProps = _d.getInputProps;
127
+ React.useEffect(function () {
128
+ setDragActive(false);
129
+ if (uploadSuccess) {
130
+ setShowDone(true);
131
+ setTimeout(function () {
132
+ setShowDone(false);
133
+ }, 400);
34
134
  }
35
- }), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps;
36
- return (_jsxs(BoxStyled, __assign({}, getRootProps({ className: 'dropzone' }), { children: [_jsx(Text, __assign({ sx: { fontSize: '12px' } }, { children: title })), _jsx(UploadInputStyled, { inputProps: __assign({}, getInputProps()) })] })));
135
+ }, [uploading]);
136
+ return (_jsx(Box, __assign({ id: 'upload-container' }, { children: _jsxs(BoxStyled, __assign({ active: dragActive }, getRootProps({ className: 'dropzone' }), { children: [_jsx(Fade, __assign({ in: (!uploading && !uploadSuccess) || !fileExists, unmountOnExit: true, timeout: 100 }, { children: _jsxs(Box, { children: [_jsx(CenterBoxStyled, { children: _jsx(IconStyled, { src: dragActive ? ICONS_NAMES.ACTIVE_UPLOAD_ICON : ICONS_NAMES.UPLOAD_ICON }) }), _jsxs(VerticalCenterBox, __assign({ sx: { marginBlockEnd: '20px' } }, { children: [_jsxs(CenterBoxStyled, { children: [_jsx(Text, __assign({ sx: { fontSize: '16px' } }, { children: title })), _jsx(SubTitleStyled, { children: subTitle })] }), _jsx(DescTextStyled, { children: description }), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: error })] }) }))] })), _jsx(UploadInputStyled, { inputProps: __assign({}, getInputProps()) })] }) })), _jsx(CenterBoxStyled, { children: showDone ? (_jsxs(VerticalCenterBox, { children: [_jsx(DoneIconStyled, { src: ICONS_NAMES.DONE_ICON }), _jsx(TextDoneStyled, { children: successTitle })] })) : uploading ? (_jsxs(VerticalCenterBox, { children: [_jsx(CircularProgress, { value: progress, size: 54 }), _jsx(Text, { children: uploadingTitle })] })) : (_jsx(_Fragment, {})) })] })) })));
37
137
  };
38
138
  export default DragAndDrop;