@pagamio/frontend-commons-lib 0.8.175 → 0.8.183

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 (508) hide show
  1. package/lib/api/client.d.ts +88 -0
  2. package/lib/api/client.js +339 -0
  3. package/lib/api/context.d.ts +112 -0
  4. package/lib/api/context.js +105 -0
  5. package/lib/api/index.d.ts +4 -0
  6. package/lib/api/index.js +4 -0
  7. package/lib/api/swr.d.ts +46 -0
  8. package/lib/api/swr.js +124 -0
  9. package/lib/api/types.d.ts +145 -0
  10. package/lib/api/types.js +10 -0
  11. package/lib/auth/authenticators/AuthenticatorFactory.d.ts +25 -0
  12. package/lib/auth/authenticators/AuthenticatorFactory.js +32 -0
  13. package/lib/auth/authenticators/index.d.ts +7 -0
  14. package/lib/auth/authenticators/index.js +7 -0
  15. package/lib/auth/authenticators/processors/DefaultAuthenticatorProcessor.d.ts +21 -0
  16. package/lib/auth/authenticators/processors/DefaultAuthenticatorProcessor.js +26 -0
  17. package/lib/auth/authenticators/processors/StrapiAuthenticatorProcessor.d.ts +74 -0
  18. package/lib/auth/authenticators/processors/StrapiAuthenticatorProcessor.js +99 -0
  19. package/lib/auth/authenticators/types.d.ts +26 -0
  20. package/lib/auth/authenticators/types.js +9 -0
  21. package/lib/auth/components/AppBanner.d.ts +7 -0
  22. package/lib/auth/components/AppBanner.js +9 -0
  23. package/lib/auth/components/AuthCard.d.ts +8 -0
  24. package/lib/auth/components/AuthCard.js +14 -0
  25. package/lib/auth/components/AuthFormUtils.d.ts +58 -0
  26. package/lib/auth/components/AuthFormUtils.js +52 -0
  27. package/lib/auth/components/AuthPageLayout.d.ts +45 -0
  28. package/lib/auth/components/AuthPageLayout.js +12 -0
  29. package/lib/auth/components/ChangePasswordPage.d.ts +12 -0
  30. package/lib/auth/components/ChangePasswordPage.js +59 -0
  31. package/lib/auth/components/CustomerRegistrationPage.d.ts +50 -0
  32. package/lib/auth/components/CustomerRegistrationPage.js +140 -0
  33. package/lib/auth/components/ForgotPasswordPage.d.ts +38 -0
  34. package/lib/auth/components/ForgotPasswordPage.js +76 -0
  35. package/lib/auth/components/LoginPage.d.ts +73 -0
  36. package/lib/auth/components/LoginPage.js +115 -0
  37. package/lib/auth/components/LogoutButton.d.ts +30 -0
  38. package/lib/auth/components/LogoutButton.js +47 -0
  39. package/lib/auth/components/ResetPasswordPage.d.ts +42 -0
  40. package/lib/auth/components/ResetPasswordPage.js +88 -0
  41. package/lib/auth/components/hooks/useChangeUserPassword.d.ts +26 -0
  42. package/lib/auth/components/hooks/useChangeUserPassword.js +63 -0
  43. package/lib/auth/components/index.d.ts +8 -0
  44. package/lib/auth/components/index.js +7 -0
  45. package/lib/auth/context/AuthContext.d.ts +65 -0
  46. package/lib/auth/context/AuthContext.js +150 -0
  47. package/lib/auth/context/index.d.ts +1 -0
  48. package/lib/auth/context/index.js +1 -0
  49. package/lib/auth/index.d.ts +7 -0
  50. package/lib/auth/index.js +7 -0
  51. package/lib/auth/services/AuthService.d.ts +230 -0
  52. package/lib/auth/services/AuthService.js +475 -0
  53. package/lib/auth/services/LogoutService.d.ts +27 -0
  54. package/lib/auth/services/LogoutService.js +98 -0
  55. package/lib/auth/services/index.d.ts +2 -0
  56. package/lib/auth/services/index.js +2 -0
  57. package/lib/auth/shared/index.d.ts +1 -0
  58. package/lib/auth/shared/index.js +1 -0
  59. package/lib/auth/shared/layout/AuthPageLayout.d.ts +10 -0
  60. package/lib/auth/shared/layout/AuthPageLayout.js +16 -0
  61. package/lib/auth/shared/layout/index.d.ts +1 -0
  62. package/lib/auth/shared/layout/index.js +1 -0
  63. package/lib/auth/types/auth.types.d.ts +234 -0
  64. package/lib/auth/types/auth.types.js +14 -0
  65. package/lib/auth/types/index.d.ts +1 -0
  66. package/lib/auth/types/index.js +1 -0
  67. package/lib/auth/utils/TokenManager.d.ts +43 -0
  68. package/lib/auth/utils/TokenManager.js +171 -0
  69. package/lib/auth/utils/Transformers.d.ts +158 -0
  70. package/lib/auth/utils/Transformers.js +263 -0
  71. package/lib/auth/utils/errorDetection.d.ts +22 -0
  72. package/lib/auth/utils/errorDetection.js +190 -0
  73. package/lib/auth/utils/index.d.ts +3 -0
  74. package/lib/auth/utils/index.js +3 -0
  75. package/lib/components/charts/LineGraph.d.ts +15 -0
  76. package/lib/components/charts/LineGraph.js +131 -0
  77. package/lib/components/icons/Icon.d.ts +8 -0
  78. package/lib/components/icons/Icon.js +13 -0
  79. package/lib/components/icons/index.d.ts +2 -0
  80. package/lib/components/icons/index.js +2 -0
  81. package/lib/components/icons/types.d.ts +26 -0
  82. package/lib/components/icons/types.js +33 -0
  83. package/lib/components/index.d.ts +3 -0
  84. package/lib/components/index.js +3 -0
  85. package/lib/components/layout/AppLayout.d.ts +34 -0
  86. package/lib/components/layout/AppLayout.js +19 -0
  87. package/lib/components/layout/AuthPageLayout.d.ts +13 -0
  88. package/lib/components/layout/AuthPageLayout.js +15 -0
  89. package/lib/components/layout/BreadcrumbNav.d.ts +2 -0
  90. package/lib/components/layout/BreadcrumbNav.js +10 -0
  91. package/lib/components/layout/LayoutContent.d.ts +6 -0
  92. package/lib/components/layout/LayoutContent.js +10 -0
  93. package/lib/components/layout/Navbar.d.ts +106 -0
  94. package/lib/components/layout/Navbar.js +66 -0
  95. package/lib/components/layout/PageHeader.d.ts +8 -0
  96. package/lib/components/layout/PageHeader.js +7 -0
  97. package/lib/components/layout/SessionExpiryModal.d.ts +10 -0
  98. package/lib/components/layout/SessionExpiryModal.js +9 -0
  99. package/lib/components/layout/Sidebar.d.ts +6 -0
  100. package/lib/components/layout/Sidebar.js +87 -0
  101. package/lib/components/layout/VerticalTabsLayout.d.ts +12 -0
  102. package/lib/components/layout/VerticalTabsLayout.js +14 -0
  103. package/lib/components/layout/index.d.ts +9 -0
  104. package/lib/components/layout/index.js +9 -0
  105. package/lib/components/ui/Avatar.d.ts +6 -0
  106. package/lib/components/ui/Avatar.js +11 -0
  107. package/lib/components/ui/AvatarIcon.d.ts +4 -0
  108. package/lib/components/ui/AvatarIcon.js +6 -0
  109. package/lib/components/ui/Button.d.ts +14 -0
  110. package/lib/components/ui/Button.js +30 -0
  111. package/lib/components/ui/Calendar.d.ts +9 -0
  112. package/lib/components/ui/Calendar.js +35 -0
  113. package/lib/components/ui/Card.d.ts +16 -0
  114. package/lib/components/ui/Card.js +6 -0
  115. package/lib/components/ui/Chart.d.ts +2 -0
  116. package/lib/components/ui/Chart.js +16 -0
  117. package/lib/components/ui/Checkbox.d.ts +4 -0
  118. package/lib/components/ui/Checkbox.js +8 -0
  119. package/lib/components/ui/Command.d.ts +80 -0
  120. package/lib/components/ui/Command.js +28 -0
  121. package/lib/components/ui/ContainedTab.d.ts +21 -0
  122. package/lib/components/ui/ContainedTab.js +37 -0
  123. package/lib/components/ui/DateFormat.d.ts +6 -0
  124. package/lib/components/ui/DateFormat.js +8 -0
  125. package/lib/components/ui/DatePicker.d.ts +14 -0
  126. package/lib/components/ui/DatePicker.js +91 -0
  127. package/lib/components/ui/DateRangeModal.d.ts +38 -0
  128. package/lib/components/ui/DateRangeModal.js +89 -0
  129. package/lib/components/ui/DetailsCard.d.ts +16 -0
  130. package/lib/components/ui/DetailsCard.js +14 -0
  131. package/lib/components/ui/DetailsPage.d.ts +36 -0
  132. package/lib/components/ui/DetailsPage.js +50 -0
  133. package/lib/components/ui/Dialog.d.ts +19 -0
  134. package/lib/components/ui/Dialog.js +22 -0
  135. package/lib/components/ui/EmptyState.d.ts +6 -0
  136. package/lib/components/ui/EmptyState.js +6 -0
  137. package/lib/components/ui/FilterComponent.d.ts +30 -0
  138. package/lib/components/ui/FilterComponent.js +80 -0
  139. package/lib/components/ui/FilterList.d.ts +52 -0
  140. package/lib/components/ui/FilterList.js +62 -0
  141. package/lib/components/ui/FilterSection.d.ts +31 -0
  142. package/lib/components/ui/FilterSection.js +21 -0
  143. package/lib/components/ui/FilterWrapper.d.ts +6 -0
  144. package/lib/components/ui/FilterWrapper.js +7 -0
  145. package/lib/components/ui/Form.d.ts +23 -0
  146. package/lib/components/ui/Form.js +62 -0
  147. package/lib/components/ui/HoverableValue.d.ts +7 -0
  148. package/lib/components/ui/HoverableValue.js +8 -0
  149. package/lib/components/ui/IconButton.d.ts +10 -0
  150. package/lib/components/ui/IconButton.js +10 -0
  151. package/lib/components/ui/ImageComponent.d.ts +8 -0
  152. package/lib/components/ui/ImageComponent.js +5 -0
  153. package/lib/components/ui/ImageUploader.d.ts +17 -0
  154. package/lib/components/ui/ImageUploader.js +144 -0
  155. package/lib/components/ui/Input.d.ts +4 -0
  156. package/lib/components/ui/Input.js +8 -0
  157. package/lib/components/ui/Label.d.ts +5 -0
  158. package/lib/components/ui/Label.js +9 -0
  159. package/lib/components/ui/Loader.d.ts +10 -0
  160. package/lib/components/ui/Loader.js +7 -0
  161. package/lib/components/ui/Modal.d.ts +72 -0
  162. package/lib/components/ui/Modal.js +31 -0
  163. package/lib/components/ui/MultiSelect.d.ts +16 -0
  164. package/lib/components/ui/MultiSelect.js +59 -0
  165. package/lib/components/ui/NotificationModal.d.ts +18 -0
  166. package/lib/components/ui/NotificationModal.js +40 -0
  167. package/lib/components/ui/PhoneInput.d.ts +12 -0
  168. package/lib/components/ui/PhoneInput.js +58 -0
  169. package/lib/components/ui/Popover.d.ts +7 -0
  170. package/lib/components/ui/Popover.js +10 -0
  171. package/lib/components/ui/Progress.d.ts +7 -0
  172. package/lib/components/ui/Progress.js +7 -0
  173. package/lib/components/ui/Radio.d.ts +5 -0
  174. package/lib/components/ui/Radio.js +14 -0
  175. package/lib/components/ui/RangeDatePicker.d.ts +78 -0
  176. package/lib/components/ui/RangeDatePicker.js +68 -0
  177. package/lib/components/ui/Select.d.ts +13 -0
  178. package/lib/components/ui/Select.js +57 -0
  179. package/lib/components/ui/Separator.d.ts +4 -0
  180. package/lib/components/ui/Separator.js +7 -0
  181. package/lib/components/ui/Sheet.d.ts +26 -0
  182. package/lib/components/ui/Sheet.js +37 -0
  183. package/lib/components/ui/StatusCell.d.ts +9 -0
  184. package/lib/components/ui/StatusCell.js +6 -0
  185. package/lib/components/ui/Switch.d.ts +10 -0
  186. package/lib/components/ui/Switch.js +22 -0
  187. package/lib/components/ui/Tab.d.ts +15 -0
  188. package/lib/components/ui/Tab.js +13 -0
  189. package/lib/components/ui/TableDownload.d.ts +11 -0
  190. package/lib/components/ui/TableDownload.js +82 -0
  191. package/lib/components/ui/TailwindIndicator.d.ts +1 -0
  192. package/lib/components/ui/TailwindIndicator.js +6 -0
  193. package/lib/components/ui/TextField.d.ts +60 -0
  194. package/lib/components/ui/TextField.js +42 -0
  195. package/lib/components/ui/Textarea.d.ts +5 -0
  196. package/lib/components/ui/Textarea.js +8 -0
  197. package/lib/components/ui/Toast.d.ts +12 -0
  198. package/lib/components/ui/Toast.js +25 -0
  199. package/lib/components/ui/UploadField.d.ts +15 -0
  200. package/lib/components/ui/UploadField.js +45 -0
  201. package/lib/components/ui/VerticalTab.d.ts +16 -0
  202. package/lib/components/ui/VerticalTab.js +13 -0
  203. package/lib/components/ui/index.d.ts +49 -0
  204. package/lib/components/ui/index.js +47 -0
  205. package/lib/context/BreadcrumbContext.d.ts +28 -0
  206. package/lib/context/BreadcrumbContext.js +238 -0
  207. package/lib/context/FormEngineDrawerProvider.d.ts +21 -0
  208. package/lib/context/FormEngineDrawerProvider.js +38 -0
  209. package/lib/context/MultiFormEngineDrawerProvider.d.ts +25 -0
  210. package/lib/context/MultiFormEngineDrawerProvider.js +89 -0
  211. package/lib/context/SidebarContext.d.ts +65 -0
  212. package/lib/context/SidebarContext.js +47 -0
  213. package/lib/context/ToastContext.d.ts +17 -0
  214. package/lib/context/ToastContext.js +29 -0
  215. package/lib/context/index.d.ts +5 -0
  216. package/lib/context/index.js +5 -0
  217. package/lib/dashboard-visuals/components/BaseChart.d.ts +55 -0
  218. package/lib/dashboard-visuals/components/BaseChart.js +201 -0
  219. package/lib/dashboard-visuals/components/CardWrapper.d.ts +10 -0
  220. package/lib/dashboard-visuals/components/CardWrapper.js +13 -0
  221. package/lib/dashboard-visuals/components/ChartDetailsModal.d.ts +57 -0
  222. package/lib/dashboard-visuals/components/ChartDetailsModal.js +27 -0
  223. package/lib/dashboard-visuals/components/ChartDetailsModalWrapper.d.ts +29 -0
  224. package/lib/dashboard-visuals/components/ChartDetailsModalWrapper.js +4 -0
  225. package/lib/dashboard-visuals/components/ChartFormatter.d.ts +22 -0
  226. package/lib/dashboard-visuals/components/ChartFormatter.js +46 -0
  227. package/lib/dashboard-visuals/components/ChartWrapper.d.ts +11 -0
  228. package/lib/dashboard-visuals/components/ChartWrapper.js +14 -0
  229. package/lib/dashboard-visuals/components/DashboardFilter.d.ts +8 -0
  230. package/lib/dashboard-visuals/components/DashboardFilter.js +17 -0
  231. package/lib/dashboard-visuals/components/DataTable.d.ts +3 -0
  232. package/lib/dashboard-visuals/components/DataTable.js +57 -0
  233. package/lib/dashboard-visuals/components/EmptyState.d.ts +6 -0
  234. package/lib/dashboard-visuals/components/EmptyState.js +6 -0
  235. package/lib/dashboard-visuals/components/ErrorState.d.ts +7 -0
  236. package/lib/dashboard-visuals/components/ErrorState.js +5 -0
  237. package/lib/dashboard-visuals/components/FilterComponentSkeleton.d.ts +3 -0
  238. package/lib/dashboard-visuals/components/FilterComponentSkeleton.js +11 -0
  239. package/lib/dashboard-visuals/components/Pagination.d.ts +10 -0
  240. package/lib/dashboard-visuals/components/Pagination.js +7 -0
  241. package/lib/dashboard-visuals/components/Switch.d.ts +8 -0
  242. package/lib/dashboard-visuals/components/Switch.js +10 -0
  243. package/lib/dashboard-visuals/components/TileSkeleton.d.ts +2 -0
  244. package/lib/dashboard-visuals/components/TileSkeleton.js +5 -0
  245. package/lib/dashboard-visuals/components/molecules/Analytics.d.ts +11 -0
  246. package/lib/dashboard-visuals/components/molecules/Analytics.js +9 -0
  247. package/lib/dashboard-visuals/components/molecules/DataGrid.d.ts +15 -0
  248. package/lib/dashboard-visuals/components/molecules/DataGrid.js +124 -0
  249. package/lib/dashboard-visuals/components/molecules/NoChartData.d.ts +6 -0
  250. package/lib/dashboard-visuals/components/molecules/NoChartData.js +6 -0
  251. package/lib/dashboard-visuals/components/molecules/VisualChart.d.ts +16 -0
  252. package/lib/dashboard-visuals/components/molecules/VisualChart.js +8 -0
  253. package/lib/dashboard-visuals/components/types.d.ts +62 -0
  254. package/lib/dashboard-visuals/components/types.js +1 -0
  255. package/lib/dashboard-visuals/hooks/useChartData.d.ts +15 -0
  256. package/lib/dashboard-visuals/hooks/useChartData.js +82 -0
  257. package/lib/dashboard-visuals/hooks/useTooltipFormatter.d.ts +13 -0
  258. package/lib/dashboard-visuals/hooks/useTooltipFormatter.js +10 -0
  259. package/lib/dashboard-visuals/index.d.ts +39 -0
  260. package/lib/dashboard-visuals/index.js +168 -0
  261. package/lib/dashboard-visuals/types/index.d.ts +83 -0
  262. package/lib/dashboard-visuals/types/index.js +1 -0
  263. package/lib/dashboard-visuals/types/metricDetailData.d.ts +25 -0
  264. package/lib/dashboard-visuals/types/metricDetailData.js +1 -0
  265. package/lib/dashboard-visuals/utils/api.d.ts +5 -0
  266. package/lib/dashboard-visuals/utils/api.js +6 -0
  267. package/lib/dashboard-visuals/utils/chartOptions.d.ts +481 -0
  268. package/lib/dashboard-visuals/utils/chartOptions.js +393 -0
  269. package/lib/dashboard-visuals/utils/chunkArray.d.ts +1 -0
  270. package/lib/dashboard-visuals/utils/chunkArray.js +7 -0
  271. package/lib/dashboard-visuals/utils/defaultColors.d.ts +1 -0
  272. package/lib/dashboard-visuals/utils/defaultColors.js +1 -0
  273. package/lib/dashboard-visuals/utils/formatUtil.d.ts +203 -0
  274. package/lib/dashboard-visuals/utils/formatUtil.js +472 -0
  275. package/lib/dashboard-visuals/utils/gridUtil.d.ts +11 -0
  276. package/lib/dashboard-visuals/utils/gridUtil.js +32 -0
  277. package/lib/dashboard-visuals/utils/index.d.ts +6 -0
  278. package/lib/dashboard-visuals/utils/index.js +6 -0
  279. package/lib/dashboard-visuals/utils/tooltipUtils.d.ts +11 -0
  280. package/lib/dashboard-visuals/utils/tooltipUtils.js +180 -0
  281. package/lib/dashboard-visuals/visualRegistry.d.ts +4 -0
  282. package/lib/dashboard-visuals/visualRegistry.js +41 -0
  283. package/lib/dashboard-visuals/visuals/BarChart.d.ts +58 -0
  284. package/lib/dashboard-visuals/visuals/BarChart.js +95 -0
  285. package/lib/dashboard-visuals/visuals/BarLineHybridChart.d.ts +33 -0
  286. package/lib/dashboard-visuals/visuals/BarLineHybridChart.js +60 -0
  287. package/lib/dashboard-visuals/visuals/BubbleChart.d.ts +25 -0
  288. package/lib/dashboard-visuals/visuals/BubbleChart.js +101 -0
  289. package/lib/dashboard-visuals/visuals/DistributionChart.d.ts +11 -0
  290. package/lib/dashboard-visuals/visuals/DistributionChart.js +48 -0
  291. package/lib/dashboard-visuals/visuals/DonutChart.d.ts +50 -0
  292. package/lib/dashboard-visuals/visuals/DonutChart.js +105 -0
  293. package/lib/dashboard-visuals/visuals/GaugeChart.d.ts +32 -0
  294. package/lib/dashboard-visuals/visuals/GaugeChart.js +53 -0
  295. package/lib/dashboard-visuals/visuals/GroupedBarChart.d.ts +47 -0
  296. package/lib/dashboard-visuals/visuals/GroupedBarChart.js +131 -0
  297. package/lib/dashboard-visuals/visuals/HeatmapChart.d.ts +79 -0
  298. package/lib/dashboard-visuals/visuals/HeatmapChart.js +146 -0
  299. package/lib/dashboard-visuals/visuals/HorizontalBarChart.d.ts +50 -0
  300. package/lib/dashboard-visuals/visuals/HorizontalBarChart.js +131 -0
  301. package/lib/dashboard-visuals/visuals/ItemPerformanceCard.d.ts +30 -0
  302. package/lib/dashboard-visuals/visuals/ItemPerformanceCard.js +31 -0
  303. package/lib/dashboard-visuals/visuals/LineChart.d.ts +56 -0
  304. package/lib/dashboard-visuals/visuals/LineChart.js +80 -0
  305. package/lib/dashboard-visuals/visuals/LineGraph.d.ts +50 -0
  306. package/lib/dashboard-visuals/visuals/LineGraph.js +189 -0
  307. package/lib/dashboard-visuals/visuals/MetricSummaryCard.d.ts +14 -0
  308. package/lib/dashboard-visuals/visuals/MetricSummaryCard.js +8 -0
  309. package/lib/dashboard-visuals/visuals/MultiGaugeChart.d.ts +39 -0
  310. package/lib/dashboard-visuals/visuals/MultiGaugeChart.js +119 -0
  311. package/lib/dashboard-visuals/visuals/PieChart.d.ts +59 -0
  312. package/lib/dashboard-visuals/visuals/PieChart.js +194 -0
  313. package/lib/dashboard-visuals/visuals/SelectedEventTile.d.ts +14 -0
  314. package/lib/dashboard-visuals/visuals/SelectedEventTile.js +35 -0
  315. package/lib/dashboard-visuals/visuals/SpeedometerChart.d.ts +53 -0
  316. package/lib/dashboard-visuals/visuals/SpeedometerChart.js +94 -0
  317. package/lib/dashboard-visuals/visuals/Table.d.ts +26 -0
  318. package/lib/dashboard-visuals/visuals/Table.js +113 -0
  319. package/lib/dashboard-visuals/visuals/Tile.d.ts +16 -0
  320. package/lib/dashboard-visuals/visuals/Tile.js +16 -0
  321. package/lib/dashboard-visuals/visuals/TreeMap.d.ts +25 -0
  322. package/lib/dashboard-visuals/visuals/TreeMap.js +45 -0
  323. package/lib/dashboard-visuals/visuals/WaterfallChart.d.ts +52 -0
  324. package/lib/dashboard-visuals/visuals/WaterfallChart.js +266 -0
  325. package/lib/form-engine/Form.d.ts +4 -0
  326. package/lib/form-engine/Form.js +14 -0
  327. package/lib/form-engine/FormEngine.d.ts +3 -0
  328. package/lib/form-engine/FormEngine.js +121 -0
  329. package/lib/form-engine/components/FieldWrapper.d.ts +18 -0
  330. package/lib/form-engine/components/FieldWrapper.js +63 -0
  331. package/lib/form-engine/components/index.d.ts +2 -0
  332. package/lib/form-engine/components/index.js +2 -0
  333. package/lib/form-engine/components/inputs/card-expiry-input/CardExpiryInput.d.ts +16 -0
  334. package/lib/form-engine/components/inputs/card-expiry-input/CardExpiryInput.js +48 -0
  335. package/lib/form-engine/components/inputs/checkbox-input/CheckboxInput.d.ts +4 -0
  336. package/lib/form-engine/components/inputs/checkbox-input/CheckboxInput.js +5 -0
  337. package/lib/form-engine/components/inputs/credit-card-input/CreditCardInput.d.ts +4 -0
  338. package/lib/form-engine/components/inputs/credit-card-input/CreditCardInput.js +82 -0
  339. package/lib/form-engine/components/inputs/date-input/DateInput.d.ts +4 -0
  340. package/lib/form-engine/components/inputs/date-input/DateInput.js +7 -0
  341. package/lib/form-engine/components/inputs/date-input/index.d.ts +1 -0
  342. package/lib/form-engine/components/inputs/date-input/index.js +1 -0
  343. package/lib/form-engine/components/inputs/email-input/EmailInput.d.ts +4 -0
  344. package/lib/form-engine/components/inputs/email-input/EmailInput.js +5 -0
  345. package/lib/form-engine/components/inputs/email-input/index.d.ts +1 -0
  346. package/lib/form-engine/components/inputs/email-input/index.js +1 -0
  347. package/lib/form-engine/components/inputs/index.d.ts +13 -0
  348. package/lib/form-engine/components/inputs/index.js +13 -0
  349. package/lib/form-engine/components/inputs/label-input/LabelInput.d.ts +4 -0
  350. package/lib/form-engine/components/inputs/label-input/LabelInput.js +7 -0
  351. package/lib/form-engine/components/inputs/label-input/index.d.ts +1 -0
  352. package/lib/form-engine/components/inputs/label-input/index.js +1 -0
  353. package/lib/form-engine/components/inputs/multi-select-input/MultiSelectInput.d.ts +4 -0
  354. package/lib/form-engine/components/inputs/multi-select-input/MultiSelectInput.js +5 -0
  355. package/lib/form-engine/components/inputs/number-input/NumberInput.d.ts +4 -0
  356. package/lib/form-engine/components/inputs/number-input/NumberInput.js +5 -0
  357. package/lib/form-engine/components/inputs/number-input/index.d.ts +1 -0
  358. package/lib/form-engine/components/inputs/number-input/index.js +1 -0
  359. package/lib/form-engine/components/inputs/password-input/PasswordInput.d.ts +4 -0
  360. package/lib/form-engine/components/inputs/password-input/PasswordInput.js +9 -0
  361. package/lib/form-engine/components/inputs/password-input/index.d.ts +1 -0
  362. package/lib/form-engine/components/inputs/password-input/index.js +1 -0
  363. package/lib/form-engine/components/inputs/radio-button/RadioInput.d.ts +4 -0
  364. package/lib/form-engine/components/inputs/radio-button/RadioInput.js +6 -0
  365. package/lib/form-engine/components/inputs/radio-button/index.d.ts +1 -0
  366. package/lib/form-engine/components/inputs/radio-button/index.js +1 -0
  367. package/lib/form-engine/components/inputs/select/SelectInput.d.ts +4 -0
  368. package/lib/form-engine/components/inputs/select/SelectInput.js +6 -0
  369. package/lib/form-engine/components/inputs/select/index.d.ts +1 -0
  370. package/lib/form-engine/components/inputs/select/index.js +1 -0
  371. package/lib/form-engine/components/inputs/textarea-input/TextareaInput.d.ts +4 -0
  372. package/lib/form-engine/components/inputs/textarea-input/TextareaInput.js +5 -0
  373. package/lib/form-engine/components/inputs/textarea-input/index.d.ts +1 -0
  374. package/lib/form-engine/components/inputs/textarea-input/index.js +1 -0
  375. package/lib/form-engine/components/inputs/time-input/TimeInput.d.ts +4 -0
  376. package/lib/form-engine/components/inputs/time-input/TimeInput.js +5 -0
  377. package/lib/form-engine/components/inputs/time-input/index.d.ts +1 -0
  378. package/lib/form-engine/components/inputs/time-input/index.js +1 -0
  379. package/lib/form-engine/components/inputs/toggle-switch-input/ToggleSwitchInput.d.ts +4 -0
  380. package/lib/form-engine/components/inputs/toggle-switch-input/ToggleSwitchInput.js +7 -0
  381. package/lib/form-engine/components/inputs/toggle-switch-input/index.d.ts +1 -0
  382. package/lib/form-engine/components/inputs/toggle-switch-input/index.js +1 -0
  383. package/lib/form-engine/components/inputs/upload-field/UploadFieldForm.d.ts +4 -0
  384. package/lib/form-engine/components/inputs/upload-field/UploadFieldForm.js +59 -0
  385. package/lib/form-engine/components/inputs/upload-field/index.d.ts +1 -0
  386. package/lib/form-engine/components/inputs/upload-field/index.js +1 -0
  387. package/lib/form-engine/hooks/useFormPersistence.d.ts +11 -0
  388. package/lib/form-engine/hooks/useFormPersistence.js +46 -0
  389. package/lib/form-engine/index.d.ts +5 -0
  390. package/lib/form-engine/index.js +5 -0
  391. package/lib/form-engine/registry/RegisterComponents.d.ts +1 -0
  392. package/lib/form-engine/registry/RegisterComponents.js +35 -0
  393. package/lib/form-engine/registry/Registry.d.ts +5 -0
  394. package/lib/form-engine/registry/Registry.js +13 -0
  395. package/lib/form-engine/registry/index.d.ts +2 -0
  396. package/lib/form-engine/registry/index.js +2 -0
  397. package/lib/form-engine/types/index.d.ts +311 -0
  398. package/lib/form-engine/types/index.js +1 -0
  399. package/lib/helpers/index.d.ts +2 -0
  400. package/lib/helpers/index.js +2 -0
  401. package/lib/helpers/utils.d.ts +37 -0
  402. package/lib/helpers/utils.js +77 -0
  403. package/lib/helpers/validations.d.ts +80 -0
  404. package/lib/helpers/validations.js +39 -0
  405. package/lib/index.d.ts +21 -0
  406. package/lib/index.js +30 -0
  407. package/lib/mocks/mockApiRequestsConfig.d.ts +2 -0
  408. package/lib/mocks/mockApiRequestsConfig.js +343 -0
  409. package/lib/pagamio-drawer/TopUpWalletDrawer/TopUpWalletContent.d.ts +14 -0
  410. package/lib/pagamio-drawer/TopUpWalletDrawer/TopUpWalletContent.js +40 -0
  411. package/lib/pagamio-drawer/TopUpWalletDrawer/index.d.ts +11 -0
  412. package/lib/pagamio-drawer/TopUpWalletDrawer/index.js +7 -0
  413. package/lib/pagamio-drawer/components/BaseDrawer.d.ts +11 -0
  414. package/lib/pagamio-drawer/components/BaseDrawer.js +10 -0
  415. package/lib/pagamio-drawer/components/DrawerContent.d.ts +27 -0
  416. package/lib/pagamio-drawer/components/DrawerContent.js +237 -0
  417. package/lib/pagamio-drawer/index.d.ts +22 -0
  418. package/lib/pagamio-drawer/index.js +133 -0
  419. package/lib/pagamio-table/data-table/ExportButton.d.ts +57 -0
  420. package/lib/pagamio-table/data-table/ExportButton.js +96 -0
  421. package/lib/pagamio-table/data-table/MantineCoreTable.d.ts +44 -0
  422. package/lib/pagamio-table/data-table/MantineCoreTable.js +129 -0
  423. package/lib/pagamio-table/data-table/Pagination.d.ts +10 -0
  424. package/lib/pagamio-table/data-table/Pagination.js +5 -0
  425. package/lib/pagamio-table/data-table/TableDownload.d.ts +8 -0
  426. package/lib/pagamio-table/data-table/TableDownload.js +81 -0
  427. package/lib/pagamio-table/data-table/TableToolbar.d.ts +3 -0
  428. package/lib/pagamio-table/data-table/TableToolbar.js +16 -0
  429. package/lib/pagamio-table/data-table/exportUtils.d.ts +42 -0
  430. package/lib/pagamio-table/data-table/exportUtils.js +782 -0
  431. package/lib/pagamio-table/data-table/index.d.ts +5 -0
  432. package/lib/pagamio-table/data-table/index.js +11 -0
  433. package/lib/pagamio-table/data-table/pdfExportUtils.d.ts +111 -0
  434. package/lib/pagamio-table/data-table/pdfExportUtils.js +113 -0
  435. package/lib/pagamio-table/data-table/types.d.ts +169 -0
  436. package/lib/pagamio-table/data-table/types.js +1 -0
  437. package/lib/pagamio-table/index.d.ts +4 -0
  438. package/lib/pagamio-table/index.js +4 -0
  439. package/lib/pagamio-table/utils/functionHelper.d.ts +12 -0
  440. package/lib/pagamio-table/utils/functionHelper.js +24 -0
  441. package/lib/pagamio-table/utils/index.d.ts +1 -0
  442. package/lib/pagamio-table/utils/index.js +1 -0
  443. package/lib/rbac/hooks.d.ts +39 -0
  444. package/lib/rbac/hooks.js +51 -0
  445. package/lib/rbac/index.d.ts +8 -0
  446. package/lib/rbac/index.js +11 -0
  447. package/lib/rbac/store.d.ts +24 -0
  448. package/lib/rbac/store.js +37 -0
  449. package/lib/rbac/types.d.ts +39 -0
  450. package/lib/rbac/types.js +4 -0
  451. package/lib/rbac/utils.d.ts +44 -0
  452. package/lib/rbac/utils.js +117 -0
  453. package/lib/shared/constants/index.d.ts +2 -0
  454. package/lib/shared/constants/index.js +2 -0
  455. package/lib/shared/hooks/index.d.ts +4 -0
  456. package/lib/shared/hooks/index.js +4 -0
  457. package/lib/shared/hooks/useAnyDrawerOpen.d.ts +4 -0
  458. package/lib/shared/hooks/useAnyDrawerOpen.js +18 -0
  459. package/lib/shared/hooks/useContainerWidth.d.ts +2 -0
  460. package/lib/shared/hooks/useContainerWidth.js +18 -0
  461. package/lib/shared/hooks/useImageUpload.d.ts +15 -0
  462. package/lib/shared/hooks/useImageUpload.js +66 -0
  463. package/lib/shared/hooks/useMediaQueries.d.ts +5 -0
  464. package/lib/shared/hooks/useMediaQueries.js +35 -0
  465. package/lib/shared/hooks/usePagamioTable.d.ts +158 -0
  466. package/lib/shared/hooks/usePagamioTable.js +475 -0
  467. package/lib/shared/hooks/useSessionTimer.d.ts +33 -0
  468. package/lib/shared/hooks/useSessionTimer.js +96 -0
  469. package/lib/shared/index.d.ts +4 -0
  470. package/lib/shared/index.js +4 -0
  471. package/lib/shared/types/index.d.ts +1 -0
  472. package/lib/shared/types/index.js +1 -0
  473. package/lib/shared/url/index.d.ts +9 -0
  474. package/lib/shared/url/index.js +20 -0
  475. package/lib/shared/utils/filterUtils.d.ts +5 -0
  476. package/lib/shared/utils/filterUtils.js +31 -0
  477. package/lib/shared/utils/functionHelper.d.ts +27 -0
  478. package/lib/shared/utils/functionHelper.js +124 -0
  479. package/lib/shared/utils/index.d.ts +2 -0
  480. package/lib/shared/utils/index.js +2 -0
  481. package/lib/shared/utils/localStorage.d.ts +53 -0
  482. package/lib/shared/utils/localStorage.js +139 -0
  483. package/lib/styles.css +6247 -0
  484. package/lib/translations/components/LocaleSwitcher.d.ts +7 -0
  485. package/lib/translations/components/LocaleSwitcher.js +18 -0
  486. package/lib/translations/components/index.d.ts +1 -0
  487. package/lib/translations/components/index.js +1 -0
  488. package/lib/translations/context/TranslationContext.d.ts +5 -0
  489. package/lib/translations/context/TranslationContext.js +151 -0
  490. package/lib/translations/context/index.d.ts +1 -0
  491. package/lib/translations/context/index.js +1 -0
  492. package/lib/translations/hooks/index.d.ts +2 -0
  493. package/lib/translations/hooks/index.js +2 -0
  494. package/lib/translations/hooks/useLibTranslations.d.ts +7 -0
  495. package/lib/translations/hooks/useLibTranslations.js +46 -0
  496. package/lib/translations/hooks/useTranslation.d.ts +7 -0
  497. package/lib/translations/hooks/useTranslation.js +11 -0
  498. package/lib/translations/index.d.ts +91 -0
  499. package/lib/translations/index.js +11 -0
  500. package/lib/translations/locales/en.json +21 -0
  501. package/lib/translations/locales/es.json +21 -0
  502. package/lib/translations/locales/fr.json +21 -0
  503. package/lib/translations/locales/pt.json +21 -0
  504. package/lib/translations/types/index.d.ts +24 -0
  505. package/lib/translations/types/index.js +1 -0
  506. package/lib/translations/utils/index.d.ts +6 -0
  507. package/lib/translations/utils/index.js +25 -0
  508. package/package.json +9 -1
@@ -0,0 +1,77 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
6
+ /**
7
+ * Formats a number as currency using en-US locale standards.
8
+ *
9
+ * @param {number} price - The numeric value to format as currency
10
+ * @param {string} [currency="ZAR"] - ISO 4217 currency code (default: "ZAR")
11
+ * @param {number} [minimumFractionDigits=2] - Minimum fraction digits (default: 2)
12
+ * @param {number} [maximumFractionDigits] - Optional maximum fraction digits
13
+ * @param {string} [displaySymbol] - Optional custom symbol to display instead of ISO code
14
+ * @returns {string} Formatted currency string
15
+ *
16
+ * @example
17
+ * // Basic usage with ZAR (South African Rand)
18
+ * formatPrice(1234.56); // Returns "ZAR 1,234.56"
19
+ *
20
+ * @example
21
+ * // USD with 2 decimal places
22
+ * formatPrice(1234.56, "USD"); // Returns "$1,234.56"
23
+ *
24
+ * @example
25
+ * // Euro with standard formatting
26
+ * formatPrice(1234.56, "EUR"); // Returns "€1,234.56"
27
+ *
28
+ * @example
29
+ * // Custom display symbol for ZAR
30
+ * formatPrice(1234.56, "ZAR", 2, undefined, "R"); // Returns "R 1,234.56"
31
+ *
32
+ * @example
33
+ * // Custom decimal places (clamping)
34
+ * formatPrice(1234.5678, "GBP", 2, 3); // Returns "£1,234.568"
35
+ *
36
+ * @example
37
+ * // Fallback behavior with invalid currency
38
+ * formatPrice(1234.56, "XYZ"); // Returns "XYZ 1,234.56"
39
+ */
40
+ export const formatPrice = (price, currency = 'ZAR', minimumFractionDigits = 2, maximumFractionDigits, displaySymbol) => {
41
+ const options = {
42
+ style: 'currency',
43
+ currency,
44
+ minimumFractionDigits,
45
+ };
46
+ if (maximumFractionDigits !== undefined) {
47
+ options.maximumFractionDigits = maximumFractionDigits;
48
+ }
49
+ try {
50
+ const formatted = price.toLocaleString('en-US', options);
51
+ // If a custom display symbol is provided, replace the currency symbol/code
52
+ if (displaySymbol) {
53
+ // Handle different currency formats by finding and replacing the currency part
54
+ // For currencies like USD ($1,234.56), EUR (€1,234.56), GBP (£1,234.56)
55
+ const symbolRegex = /^[^\d\s,.-]+/;
56
+ const symbolMatch = symbolRegex.exec(formatted);
57
+ if (symbolMatch) {
58
+ return formatted.replace(symbolMatch[0], displaySymbol);
59
+ }
60
+ // For currencies that show as codes like ZAR (ZAR 1,234.56)
61
+ const codeRegex = /^[A-Z]{3}\s/;
62
+ const codeMatch = codeRegex.exec(formatted);
63
+ if (codeMatch) {
64
+ return formatted.replace(codeMatch[0], `${displaySymbol} `);
65
+ }
66
+ // Fallback: just replace the currency code anywhere in the string
67
+ return formatted.replace(currency, displaySymbol);
68
+ }
69
+ return formatted;
70
+ }
71
+ catch (error) {
72
+ console.error('Error formatting currency:', error);
73
+ // Fallback to basic formatting when Intl fails
74
+ const fallbackFormatted = `${displaySymbol || currency} ${price.toLocaleString('en-US', { minimumFractionDigits })}`;
75
+ return fallbackFormatted;
76
+ }
77
+ };
@@ -0,0 +1,80 @@
1
+ import { z } from 'zod';
2
+ export declare const loginFormSchema: z.ZodObject<{
3
+ username: z.ZodString;
4
+ password: z.ZodString;
5
+ rememberMe: z.ZodOptional<z.ZodBoolean>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ username: string;
8
+ password: string;
9
+ rememberMe?: boolean | undefined;
10
+ }, {
11
+ username: string;
12
+ password: string;
13
+ rememberMe?: boolean | undefined;
14
+ }>;
15
+ export type LoginFormSchemaType = z.infer<typeof loginFormSchema>;
16
+ export declare const signupFormSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
17
+ firstName: z.ZodString;
18
+ lastName: z.ZodString;
19
+ username: z.ZodString;
20
+ password: z.ZodString;
21
+ confirmPassword: z.ZodString;
22
+ emailAddress: z.ZodString;
23
+ profile: z.ZodString;
24
+ role: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ username: string;
27
+ password: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ confirmPassword: string;
31
+ emailAddress: string;
32
+ profile: string;
33
+ role?: string | undefined;
34
+ }, {
35
+ username: string;
36
+ password: string;
37
+ firstName: string;
38
+ lastName: string;
39
+ confirmPassword: string;
40
+ emailAddress: string;
41
+ profile: string;
42
+ role?: string | undefined;
43
+ }>, {
44
+ username: string;
45
+ password: string;
46
+ firstName: string;
47
+ lastName: string;
48
+ confirmPassword: string;
49
+ emailAddress: string;
50
+ profile: string;
51
+ role?: string | undefined;
52
+ }, {
53
+ username: string;
54
+ password: string;
55
+ firstName: string;
56
+ lastName: string;
57
+ confirmPassword: string;
58
+ emailAddress: string;
59
+ profile: string;
60
+ role?: string | undefined;
61
+ }>, {
62
+ username: string;
63
+ password: string;
64
+ firstName: string;
65
+ lastName: string;
66
+ confirmPassword: string;
67
+ emailAddress: string;
68
+ profile: string;
69
+ role?: string | undefined;
70
+ }, {
71
+ username: string;
72
+ password: string;
73
+ firstName: string;
74
+ lastName: string;
75
+ confirmPassword: string;
76
+ emailAddress: string;
77
+ profile: string;
78
+ role?: string | undefined;
79
+ }>;
80
+ export type SignupFormSchemaType = z.infer<typeof signupFormSchema>;
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export const loginFormSchema = z.object({
3
+ username: z
4
+ .string()
5
+ .min(1, { message: 'Username is required.' })
6
+ .max(255, { message: 'Username must be at most 255 characters long.' }),
7
+ password: z
8
+ .string()
9
+ .min(1, { message: 'Password is required.' })
10
+ .max(255, { message: 'Password must be at most 255 characters long.' }),
11
+ rememberMe: z.boolean().optional(),
12
+ });
13
+ export const signupFormSchema = z
14
+ .object({
15
+ firstName: z.string().min(1, 'First name is required'),
16
+ lastName: z.string().min(1, 'Last name is required'),
17
+ username: z.string().min(1, { message: 'Username is required.' }).min(8, 'Password confirmation is required'),
18
+ password: z
19
+ .string()
20
+ .min(8, { message: 'Be at least 8 characters long' })
21
+ .regex(/[a-zA-Z]/, { message: 'Contain at least one letter.' })
22
+ .regex(/\d/, { message: 'Contain at least one number.' })
23
+ .regex(/[^a-zA-Z0-9]/, {
24
+ message: 'Contain at least one special character.',
25
+ })
26
+ .trim(),
27
+ confirmPassword: z.string().min(8, 'Password confirmation is required'),
28
+ emailAddress: z.string().email({ message: 'Please enter a valid email.' }).trim(),
29
+ profile: z.string(),
30
+ role: z.string().optional(),
31
+ })
32
+ .refine((data) => data.password === data.confirmPassword, {
33
+ message: "Passwords don't match",
34
+ path: ['confirmPassword'],
35
+ })
36
+ .refine((data) => data.role, {
37
+ message: 'This field is required',
38
+ path: ['role'],
39
+ });
package/lib/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ export * from './form-engine';
2
+ export { default as PagamioTable, type CoreTableColumnDef, type PagamioMantineTableProps } from './pagamio-table';
3
+ export { default as DashboardVisualWrapper, type DashboardWrapperProps } from './dashboard-visuals';
4
+ export { default as FormEngineDrawer, type FormEngineDrawerProps } from './pagamio-drawer';
5
+ export { default as TopUpWalletDrawer, type TopUpWalletDrawerProps } from './pagamio-drawer/TopUpWalletDrawer';
6
+ export * from './components';
7
+ export * from './auth';
8
+ export * from './api';
9
+ export * from './context';
10
+ export * from './shared';
11
+ export * from './helpers';
12
+ export * from './dashboard-visuals/utils';
13
+ export * from './pagamio-table/utils';
14
+ export * from './pagamio-table/data-table/pdfExportUtils';
15
+ export * from './pagamio-table/data-table/types';
16
+ export * from './dashboard-visuals/types';
17
+ export type { TopUpWalletPaymentData } from './pagamio-drawer/TopUpWalletDrawer/TopUpWalletContent';
18
+ export * from './translations';
19
+ export * from './rbac';
20
+ export { useImageUpload } from './shared/hooks/useImageUpload';
21
+ export type { UseImageUploadProps, UploadResponse } from './shared/hooks/useImageUpload';
package/lib/index.js ADDED
@@ -0,0 +1,30 @@
1
+ // Feature Components
2
+ export * from './form-engine';
3
+ export { default as PagamioTable } from './pagamio-table';
4
+ export { default as DashboardVisualWrapper } from './dashboard-visuals';
5
+ export { default as FormEngineDrawer } from './pagamio-drawer';
6
+ export { default as TopUpWalletDrawer } from './pagamio-drawer/TopUpWalletDrawer';
7
+ // Core UI Components
8
+ export * from './components';
9
+ // Authentication & API
10
+ export * from './auth';
11
+ export * from './api';
12
+ // Context Providers
13
+ export * from './context';
14
+ // Utilities & Helpers
15
+ export * from './shared';
16
+ export * from './helpers';
17
+ // Dashboard Visual Utils
18
+ export * from './dashboard-visuals/utils';
19
+ // Pagamio Table Utils
20
+ export * from './pagamio-table/utils';
21
+ export * from './pagamio-table/data-table/pdfExportUtils';
22
+ export * from './pagamio-table/data-table/types';
23
+ // Pagamio types
24
+ export * from './dashboard-visuals/types';
25
+ // translations
26
+ export * from './translations';
27
+ // Role-Based Access Control (RBAC)
28
+ export * from './rbac';
29
+ // Hooks
30
+ export { useImageUpload } from './shared/hooks/useImageUpload';
@@ -0,0 +1,2 @@
1
+ import type { MockConfig } from 'src';
2
+ export declare const mockApiRequestsConfig: MockConfig[];
@@ -0,0 +1,343 @@
1
+ // Common product data
2
+ const products = {
3
+ PROCESSED_MILK: 'Processed Milk',
4
+ BILTONG: 'Biltong Sliced Chill',
5
+ MUFFIN: 'Muffin',
6
+ BLUEBERRY_MUFFIN: 'Blueberry Muffin',
7
+ JELLY_TOTS: 'Jelly Tots',
8
+ CHOCOLATE_BAR: 'Chocolate Bar',
9
+ COLA: 'Cola 330ml',
10
+ PREMIUM_BEER: 'Premium Beer',
11
+ DRY_PEANUTS: 'Dry Roasted Peanuts',
12
+ };
13
+ // Common locations
14
+ const locations = {
15
+ VIP_LOUNGE: 'VIP LOUNGE',
16
+ SPIRIT_BAR: 'SPIRIT BAR',
17
+ MAIN_ENTRANCE: 'MAIN ENTRANCE',
18
+ FOOD_COURT: 'FOOD COURT',
19
+ };
20
+ // Common metrics config
21
+ const metricEndpoints = {
22
+ METRICS: '/dashboard/metrics',
23
+ QUERY: '/dashboard/query',
24
+ };
25
+ // Common query parameter configurations
26
+ const queryParams = {
27
+ METRICS: {
28
+ COUNT: { aggregationType: 'COUNT' },
29
+ SUM: { aggregationType: 'SUM' },
30
+ },
31
+ SORT: {
32
+ ASC: 'ASC',
33
+ DESC: 'DESC',
34
+ },
35
+ DIMENSIONS: {
36
+ PRODUCT: ['productName'],
37
+ LOCATION_PRODUCT: ['stationName', 'productName'],
38
+ TIME_PRODUCT: ['date', 'productName'],
39
+ STOCK_DETAIL: ['stationName', 'productName', 'initialStock', 'reorderLevel', 'unitPrice'],
40
+ },
41
+ };
42
+ // Helper function to create metric response
43
+ const createMetricResponse = (metric, currentValue, previousValue) => ({
44
+ metric,
45
+ currentValue,
46
+ previousValue,
47
+ percentageChange: ((currentValue - previousValue) / previousValue) * 100,
48
+ formattedValue: null,
49
+ formattedChange: null,
50
+ additionalData: {
51
+ [metric]: currentValue,
52
+ },
53
+ });
54
+ // Helper function to create product stock data
55
+ const createProductStock = (stationName, productName, { currentStock, initialStock, reorderLevel, unitPrice, daysInStock, }) => {
56
+ const stockRatio = Math.round((currentStock / initialStock) * 100);
57
+ return {
58
+ stationName,
59
+ productName,
60
+ currentStock,
61
+ initialStock,
62
+ reorderLevel,
63
+ unitPrice,
64
+ daysInStock,
65
+ stockRatio,
66
+ };
67
+ };
68
+ // Helper function for time series data
69
+ const generateTimeSeriesData = (date, products) => products.map((p) => ({ date, productName: p.name, stockLevel: p.level }));
70
+ // Helper function to create query params
71
+ const createQueryParams = (dimensions, metrics, { limit, sortBy, sortDirection, aggregationType, } = {}) => ({
72
+ dimensions,
73
+ metrics,
74
+ ...(limit && { limit }),
75
+ ...(sortBy && { sortBy }),
76
+ ...(sortDirection && { sortDirection }),
77
+ ...(aggregationType && { aggregationType }),
78
+ });
79
+ // Helper function for depletion metrics
80
+ const createDepletionData = (productName, { depletionPercentage, initialStock, currentStock, }) => ({
81
+ productName,
82
+ depletionPercentage,
83
+ initialStock,
84
+ currentStock,
85
+ });
86
+ export const mockApiRequestsConfig = [
87
+ // Total SKUs metric
88
+ {
89
+ path: metricEndpoints.METRICS,
90
+ method: 'POST',
91
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['totalSKUs'], queryParams.METRICS.COUNT),
92
+ response: createMetricResponse('totalSKUs', 156, 142),
93
+ },
94
+ // Stock Value metric
95
+ {
96
+ path: metricEndpoints.METRICS,
97
+ method: 'POST',
98
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['stockValue'], queryParams.METRICS.SUM),
99
+ response: createMetricResponse('stockValue', 1256780.45, 1345890.23),
100
+ },
101
+ // Low Stock Items metric
102
+ {
103
+ path: metricEndpoints.METRICS,
104
+ method: 'POST',
105
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['lowStockCount'], queryParams.METRICS.COUNT),
106
+ response: createMetricResponse('lowStockCount', 12, 8),
107
+ },
108
+ // Initial vs Current Inventory per SKU
109
+ {
110
+ path: metricEndpoints.QUERY,
111
+ method: 'POST',
112
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['initialStock', 'currentStock'], {
113
+ limit: 10,
114
+ sortBy: 'initialStock',
115
+ sortDirection: queryParams.SORT.DESC,
116
+ }),
117
+ response: [
118
+ createProductStock(locations.VIP_LOUNGE, products.BLUEBERRY_MUFFIN, {
119
+ currentStock: 2,
120
+ initialStock: 40,
121
+ reorderLevel: 10,
122
+ unitPrice: 3.0,
123
+ daysInStock: 5,
124
+ }),
125
+ createProductStock(locations.SPIRIT_BAR, products.BLUEBERRY_MUFFIN, {
126
+ currentStock: 5,
127
+ initialStock: 50,
128
+ reorderLevel: 10,
129
+ unitPrice: 2.25,
130
+ daysInStock: 3,
131
+ }),
132
+ createProductStock(locations.MAIN_ENTRANCE, products.PREMIUM_BEER, {
133
+ currentStock: 8,
134
+ initialStock: 100,
135
+ reorderLevel: 20,
136
+ unitPrice: 4.75,
137
+ daysInStock: 15,
138
+ }),
139
+ createProductStock(locations.FOOD_COURT, products.BLUEBERRY_MUFFIN, {
140
+ currentStock: 12,
141
+ initialStock: 120,
142
+ reorderLevel: 30,
143
+ unitPrice: 2.25,
144
+ daysInStock: 10,
145
+ }),
146
+ createProductStock(locations.SPIRIT_BAR, products.COLA, {
147
+ currentStock: 15,
148
+ initialStock: 100,
149
+ reorderLevel: 30,
150
+ unitPrice: 2.5,
151
+ daysInStock: 45,
152
+ }),
153
+ createProductStock(locations.MAIN_ENTRANCE, products.DRY_PEANUTS, {
154
+ currentStock: 15,
155
+ initialStock: 50,
156
+ reorderLevel: 15,
157
+ unitPrice: 1.99,
158
+ daysInStock: 40,
159
+ }),
160
+ createProductStock(locations.SPIRIT_BAR, products.PREMIUM_BEER, {
161
+ currentStock: 27,
162
+ initialStock: 120,
163
+ reorderLevel: 25,
164
+ unitPrice: 4.75,
165
+ daysInStock: 30,
166
+ }),
167
+ createProductStock(locations.FOOD_COURT, products.PREMIUM_BEER, {
168
+ currentStock: 29,
169
+ initialStock: 80,
170
+ reorderLevel: 20,
171
+ unitPrice: 4.5,
172
+ daysInStock: 20,
173
+ }),
174
+ createProductStock(locations.VIP_LOUNGE, products.DRY_PEANUTS, {
175
+ currentStock: 30,
176
+ initialStock: 50,
177
+ reorderLevel: 15,
178
+ unitPrice: 2.5,
179
+ daysInStock: 45,
180
+ }),
181
+ createProductStock(locations.MAIN_ENTRANCE, products.COLA, {
182
+ currentStock: 32,
183
+ initialStock: 150,
184
+ reorderLevel: 40,
185
+ unitPrice: 2.5,
186
+ daysInStock: 20,
187
+ }),
188
+ ],
189
+ },
190
+ // SKU Depletion Over Time
191
+ {
192
+ path: metricEndpoints.QUERY,
193
+ method: 'POST',
194
+ params: createQueryParams(queryParams.DIMENSIONS.TIME_PRODUCT, ['stockLevel'], {
195
+ limit: 30,
196
+ sortBy: 'date',
197
+ sortDirection: queryParams.SORT.ASC,
198
+ }),
199
+ response: [
200
+ ...generateTimeSeriesData('2025-01-01', [
201
+ { name: products.PROCESSED_MILK, level: 100 },
202
+ { name: products.BILTONG, level: 100 },
203
+ { name: products.MUFFIN, level: 100 },
204
+ { name: products.JELLY_TOTS, level: 100 },
205
+ { name: products.CHOCOLATE_BAR, level: 100 },
206
+ ]),
207
+ ...generateTimeSeriesData('2025-01-08', [
208
+ { name: products.PROCESSED_MILK, level: 78 },
209
+ { name: products.BILTONG, level: 82 },
210
+ { name: products.MUFFIN, level: 85 },
211
+ { name: products.JELLY_TOTS, level: 92 },
212
+ { name: products.CHOCOLATE_BAR, level: 87 },
213
+ ]),
214
+ ...generateTimeSeriesData('2025-01-15', [
215
+ { name: products.PROCESSED_MILK, level: 62 },
216
+ { name: products.BILTONG, level: 72 },
217
+ { name: products.MUFFIN, level: 73 },
218
+ { name: products.JELLY_TOTS, level: 85 },
219
+ { name: products.CHOCOLATE_BAR, level: 78 },
220
+ ]),
221
+ ...generateTimeSeriesData('2025-01-22', [
222
+ { name: products.PROCESSED_MILK, level: 48 },
223
+ { name: products.BILTONG, level: 59 },
224
+ { name: products.MUFFIN, level: 62 },
225
+ { name: products.JELLY_TOTS, level: 73 },
226
+ { name: products.CHOCOLATE_BAR, level: 65 },
227
+ ]),
228
+ ...generateTimeSeriesData('2025-01-29', [
229
+ { name: products.PROCESSED_MILK, level: 32 },
230
+ { name: products.BILTONG, level: 45 },
231
+ { name: products.MUFFIN, level: 50 },
232
+ { name: products.JELLY_TOTS, level: 62 },
233
+ { name: products.CHOCOLATE_BAR, level: 53 },
234
+ ]),
235
+ ...generateTimeSeriesData('2025-02-05', [
236
+ { name: products.PROCESSED_MILK, level: 20 },
237
+ { name: products.BILTONG, level: 32 },
238
+ { name: products.MUFFIN, level: 35 },
239
+ { name: products.JELLY_TOTS, level: 43 },
240
+ { name: products.CHOCOLATE_BAR, level: 40 },
241
+ ]),
242
+ ],
243
+ },
244
+ // Top Fast-Moving SKUs
245
+ {
246
+ path: metricEndpoints.QUERY,
247
+ method: 'POST',
248
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['depletionRate'], {
249
+ limit: 3,
250
+ sortBy: 'depletionRate',
251
+ sortDirection: queryParams.SORT.DESC,
252
+ }),
253
+ response: [
254
+ { productName: products.PROCESSED_MILK, depletionRate: 80.0 },
255
+ { productName: products.BILTONG, depletionRate: 68.0 },
256
+ { productName: products.MUFFIN, depletionRate: 65.0 },
257
+ ],
258
+ },
259
+ // Stock Status for Critical Items
260
+ {
261
+ path: metricEndpoints.QUERY,
262
+ method: 'POST',
263
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['stockPercentage'], {
264
+ limit: 4,
265
+ sortBy: 'stockPercentage',
266
+ sortDirection: queryParams.SORT.ASC,
267
+ }),
268
+ response: [
269
+ { productName: products.PROCESSED_MILK, stockPercentage: 20.0 },
270
+ { productName: products.BILTONG, stockPercentage: 32.0 },
271
+ { productName: products.MUFFIN, stockPercentage: 35.0 },
272
+ ],
273
+ },
274
+ // Inventory Depletion by Product
275
+ {
276
+ path: metricEndpoints.QUERY,
277
+ method: 'POST',
278
+ params: createQueryParams(queryParams.DIMENSIONS.PRODUCT, ['depletionPercentage'], {
279
+ limit: 5,
280
+ sortBy: 'depletionPercentage',
281
+ sortDirection: queryParams.SORT.DESC,
282
+ }),
283
+ response: [
284
+ createDepletionData(products.PROCESSED_MILK, {
285
+ depletionPercentage: 80,
286
+ initialStock: 500,
287
+ currentStock: 100,
288
+ }),
289
+ createDepletionData(products.BILTONG, {
290
+ depletionPercentage: 68,
291
+ initialStock: 625,
292
+ currentStock: 200,
293
+ }),
294
+ createDepletionData(products.MUFFIN, {
295
+ depletionPercentage: 65,
296
+ initialStock: 800,
297
+ currentStock: 280,
298
+ }),
299
+ createDepletionData(products.JELLY_TOTS, {
300
+ depletionPercentage: 57,
301
+ initialStock: 300,
302
+ currentStock: 129,
303
+ }),
304
+ createDepletionData(products.CHOCOLATE_BAR, {
305
+ depletionPercentage: 64,
306
+ initialStock: 750,
307
+ currentStock: 270,
308
+ }),
309
+ ],
310
+ },
311
+ // Low Stock Items by Location
312
+ {
313
+ path: metricEndpoints.QUERY,
314
+ method: 'POST',
315
+ params: createQueryParams(queryParams.DIMENSIONS.STOCK_DETAIL, ['currentStock'], {
316
+ sortBy: 'currentStock',
317
+ sortDirection: queryParams.SORT.ASC,
318
+ }),
319
+ response: [
320
+ createProductStock(locations.VIP_LOUNGE, products.BLUEBERRY_MUFFIN, {
321
+ currentStock: 2,
322
+ initialStock: 40,
323
+ reorderLevel: 10,
324
+ unitPrice: 3.0,
325
+ daysInStock: 5,
326
+ }),
327
+ createProductStock(locations.MAIN_ENTRANCE, products.PREMIUM_BEER, {
328
+ currentStock: 8,
329
+ initialStock: 100,
330
+ reorderLevel: 20,
331
+ unitPrice: 4.75,
332
+ daysInStock: 15,
333
+ }),
334
+ createProductStock(locations.SPIRIT_BAR, products.BLUEBERRY_MUFFIN, {
335
+ currentStock: 5,
336
+ initialStock: 50,
337
+ reorderLevel: 10,
338
+ unitPrice: 2.25,
339
+ daysInStock: 3,
340
+ }),
341
+ ],
342
+ },
343
+ ];
@@ -0,0 +1,14 @@
1
+ interface TopUpModalProps {
2
+ isSubmitting: boolean;
3
+ handleCloseDrawer: () => void;
4
+ handleProcessPayment: (data: TopUpWalletPaymentData) => void;
5
+ }
6
+ type PaymentMethod = 'eft' | 'mobile_money';
7
+ type MobileProvider = 'mtn' | 'vodacom' | 'cell_c' | 'telkom';
8
+ export interface TopUpWalletPaymentData {
9
+ amount: string;
10
+ paymentMethod: PaymentMethod;
11
+ mobileProvider?: MobileProvider;
12
+ }
13
+ declare const TopUpWalletContent: ({ isSubmitting, handleCloseDrawer, handleProcessPayment }: TopUpModalProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default TopUpWalletContent;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label, Radio, TextInput } from 'flowbite-react';
3
+ import { BsBank } from 'react-icons/bs';
4
+ import { FaCreditCard, FaMobileAlt } from 'react-icons/fa';
5
+ import { useState } from 'react';
6
+ import Button from '../../components/ui/Button';
7
+ const TopUpWalletContent = ({ isSubmitting, handleCloseDrawer, handleProcessPayment }) => {
8
+ const [amount, setAmount] = useState('');
9
+ const [paymentMethod, setPaymentMethod] = useState('eft');
10
+ const [mobileProvider, setMobileProvider] = useState('mtn');
11
+ const handleSubmit = async (e) => {
12
+ e.preventDefault();
13
+ const data = {
14
+ amount,
15
+ paymentMethod,
16
+ mobileProvider,
17
+ };
18
+ handleProcessPayment(data);
19
+ };
20
+ return (_jsxs("div", { children: [_jsx("div", { className: "px-5 pt-5", children: _jsxs("form", { onSubmit: handleSubmit, children: [_jsxs("div", { className: "mb-5", children: [_jsx(Label, { htmlFor: "amount", value: "Amount (ZAR)" }), _jsx(TextInput, { id: "amount", type: "number", value: amount, onChange: (e) => setAmount(e.target.value), placeholder: "Enter amount in Rands", required: true, min: "1", step: "0.01", theme: {
21
+ field: {
22
+ base: 'mt-1 w-full',
23
+ input: {
24
+ base: 'w-full h-[39px] !bg-transparent border-gray-300 text-gray-900',
25
+ },
26
+ },
27
+ } })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(Label, { value: "Select Payment Method" }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsxs("button", { type: "button", className: `flex w-full cursor-pointer items-center justify-between rounded-lg border p-4 hover:bg-gray-50 ${paymentMethod === 'eft' ? 'border-primary-500 bg-primary-500/5' : 'border-gray-200'}`, onClick: () => setPaymentMethod('eft'), children: [_jsxs("div", { className: "flex items-center space-x-3", children: [_jsx(Radio, { id: "eft", name: "paymentMethod", value: "eft", checked: paymentMethod === 'eft', onChange: () => setPaymentMethod('eft'), className: "checked:!bg-primary-500 checked:!border-primary-500" }), _jsxs("div", { className: "space-y-0.5", children: [_jsx(Label, { htmlFor: "eft", className: "mb-0 cursor-pointer", children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(FaCreditCard, { className: "text-primary" }), "Credit/Debit Card (EFT)"] }) }), _jsx("p", { className: "text-xs text-gray-500", children: "Instant transfer via secure payment" })] })] }), _jsx(BsBank, { className: "h-6 w-6 text-gray-400" })] }), _jsxs("button", { type: "button", className: `flex w-full cursor-pointer items-center justify-between rounded-lg border p-4 hover:bg-gray-50 ${paymentMethod === 'mobile_money' ? 'border-primary-500 bg-primary-500/5' : 'border-gray-200'}`, onClick: () => setPaymentMethod('mobile_money'), children: [_jsxs("div", { className: "flex items-center space-x-3", children: [_jsx(Radio, { id: "mobile_money", name: "paymentMethod", value: "mobile_money", checked: paymentMethod === 'mobile_money', onChange: () => setPaymentMethod('mobile_money'), className: "checked:!bg-primary-500 checked:!border-primary-500" }), _jsxs("div", { className: "space-y-0.5", children: [_jsx(Label, { htmlFor: "mobile_money", className: "mb-0 cursor-pointer", children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(FaMobileAlt, { className: "text-primary" }), "Mobile Money"] }) }), _jsx("p", { className: "text-xs text-gray-500", children: "Pay using mobile wallet" })] })] }), _jsx("div", { className: "flex h-6 w-6 items-center justify-center text-gray-400", children: _jsx(FaMobileAlt, {}) })] })] })] }), paymentMethod === 'mobile_money' && (_jsxs("div", { className: "space-y-3 mt-5", children: [_jsx(Label, { value: "Select Mobile Provider" }), _jsx("div", { className: "grid grid-cols-1 gap-3", children: [
28
+ { id: 'mtn', name: 'MTN' },
29
+ { id: 'vodacom', name: 'Vodacom' },
30
+ { id: 'cell_c', name: 'Cell C' },
31
+ { id: 'telkom', name: 'Telkom' },
32
+ ].map((provider) => (_jsxs("button", { type: "button", className: `flex w-full cursor-pointer items-center rounded-lg border p-3 hover:bg-gray-50 ${mobileProvider === provider.id ? 'border-primary-500 bg-primary-500/5' : 'border-gray-200'}`, onClick: () => setMobileProvider(provider.id), children: [_jsx(Radio, { id: provider.id, name: "mobileProvider", value: provider.id, checked: mobileProvider === provider.id, onChange: () => setMobileProvider(provider.id), className: "checked:!bg-primary-500 checked:!border-primary-500" }), _jsx(Label, { htmlFor: provider.id, className: "ml-2 cursor-pointer", children: provider.name })] }, provider.id))) })] }))] }) }), _jsxs("div", { className: "flex border-t bg-white", style: {
33
+ height: '50px',
34
+ position: 'fixed',
35
+ bottom: 0,
36
+ zIndex: 100,
37
+ width: '420px',
38
+ }, children: [_jsx(Button, { className: "w-full flex-1 h-full rounded-none", disabled: isSubmitting, onClick: handleCloseDrawer, children: "Cancel" }), _jsx(Button, { className: "text-white flex-1 h-full rounded-none", disabled: isSubmitting, type: "submit", onClick: handleSubmit, children: "Continue to Payment" })] })] }));
39
+ };
40
+ export default TopUpWalletContent;
@@ -0,0 +1,11 @@
1
+ interface TopUpWalletDrawerProps {
2
+ title: string;
3
+ isOpen: boolean;
4
+ isSubmitting: boolean;
5
+ marginTop?: string;
6
+ onSubmit: (data: any) => Promise<void>;
7
+ onClose: () => void;
8
+ }
9
+ declare const TopUpWalletDrawer: React.FC<TopUpWalletDrawerProps>;
10
+ export default TopUpWalletDrawer;
11
+ export type { TopUpWalletDrawerProps };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import BaseDrawer from '../components/BaseDrawer';
3
+ import TopUpWalletContent from './TopUpWalletContent';
4
+ const TopUpWalletDrawer = ({ title, isOpen, isSubmitting, marginTop = '0px', onClose, onSubmit, }) => {
5
+ return (_jsx(BaseDrawer, { title: title, isOpen: isOpen, marginTop: marginTop, onClose: onClose, children: _jsx(TopUpWalletContent, { isSubmitting: isSubmitting, handleProcessPayment: onSubmit, handleCloseDrawer: onClose }) }));
6
+ };
7
+ export default TopUpWalletDrawer;