@wealthx/ui 0.0.1 → 1.0.1

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 (567) hide show
  1. package/.turbo/turbo-build.log +369 -0
  2. package/CHANGELOG.md +7 -0
  3. package/dist/accordion-details.d.mts +7 -0
  4. package/dist/accordion-details.d.ts +7 -0
  5. package/dist/accordion-details.js +62 -0
  6. package/dist/accordion-details.mjs +17 -0
  7. package/dist/accordion-summary.d.mts +7 -0
  8. package/dist/accordion-summary.d.ts +7 -0
  9. package/dist/accordion-summary.js +62 -0
  10. package/dist/accordion-summary.mjs +17 -0
  11. package/dist/accordion.d.mts +7 -0
  12. package/dist/accordion.d.ts +7 -0
  13. package/dist/accordion.js +62 -0
  14. package/dist/accordion.mjs +17 -0
  15. package/dist/alert.d.mts +7 -0
  16. package/dist/alert.d.ts +7 -0
  17. package/dist/alert.js +62 -0
  18. package/dist/alert.mjs +17 -0
  19. package/dist/app-bar.d.mts +7 -0
  20. package/dist/app-bar.d.ts +7 -0
  21. package/dist/app-bar.js +62 -0
  22. package/dist/app-bar.mjs +17 -0
  23. package/dist/autocomplete.d.mts +7 -0
  24. package/dist/autocomplete.d.ts +7 -0
  25. package/dist/autocomplete.js +62 -0
  26. package/dist/autocomplete.mjs +17 -0
  27. package/dist/avatar.d.mts +7 -0
  28. package/dist/avatar.d.ts +7 -0
  29. package/dist/avatar.js +62 -0
  30. package/dist/avatar.mjs +17 -0
  31. package/dist/backdrop.d.mts +7 -0
  32. package/dist/backdrop.d.ts +7 -0
  33. package/dist/backdrop.js +62 -0
  34. package/dist/backdrop.mjs +17 -0
  35. package/dist/badge.d.mts +7 -0
  36. package/dist/badge.d.ts +7 -0
  37. package/dist/badge.js +62 -0
  38. package/dist/badge.mjs +17 -0
  39. package/dist/bottom-navigation-action.d.mts +7 -0
  40. package/dist/bottom-navigation-action.d.ts +7 -0
  41. package/dist/bottom-navigation-action.js +62 -0
  42. package/dist/bottom-navigation-action.mjs +17 -0
  43. package/dist/bottom-navigation.d.mts +7 -0
  44. package/dist/bottom-navigation.d.ts +7 -0
  45. package/dist/bottom-navigation.js +62 -0
  46. package/dist/bottom-navigation.mjs +17 -0
  47. package/dist/box.d.mts +7 -0
  48. package/dist/box.d.ts +7 -0
  49. package/dist/box.js +62 -0
  50. package/dist/box.mjs +17 -0
  51. package/dist/breadcrumbs.d.mts +7 -0
  52. package/dist/breadcrumbs.d.ts +7 -0
  53. package/dist/breadcrumbs.js +62 -0
  54. package/dist/breadcrumbs.mjs +17 -0
  55. package/dist/button-group.d.mts +7 -0
  56. package/dist/button-group.d.ts +7 -0
  57. package/dist/button-group.js +62 -0
  58. package/dist/button-group.mjs +17 -0
  59. package/dist/button.d.mts +7 -0
  60. package/dist/button.d.ts +7 -0
  61. package/dist/button.js +62 -0
  62. package/dist/button.mjs +17 -0
  63. package/dist/card-actions.d.mts +7 -0
  64. package/dist/card-actions.d.ts +7 -0
  65. package/dist/card-actions.js +62 -0
  66. package/dist/card-actions.mjs +17 -0
  67. package/dist/card-content.d.mts +7 -0
  68. package/dist/card-content.d.ts +7 -0
  69. package/dist/card-content.js +62 -0
  70. package/dist/card-content.mjs +17 -0
  71. package/dist/card-header.d.mts +7 -0
  72. package/dist/card-header.d.ts +7 -0
  73. package/dist/card-header.js +62 -0
  74. package/dist/card-header.mjs +17 -0
  75. package/dist/card-media.d.mts +7 -0
  76. package/dist/card-media.d.ts +7 -0
  77. package/dist/card-media.js +62 -0
  78. package/dist/card-media.mjs +17 -0
  79. package/dist/card.d.mts +7 -0
  80. package/dist/card.d.ts +7 -0
  81. package/dist/card.js +62 -0
  82. package/dist/card.mjs +17 -0
  83. package/dist/charts/index.d.mts +260 -0
  84. package/dist/charts/index.d.ts +260 -0
  85. package/dist/charts/index.js +2514 -0
  86. package/dist/charts/index.mjs +2442 -0
  87. package/dist/checkbox.d.mts +9 -0
  88. package/dist/checkbox.d.ts +9 -0
  89. package/dist/checkbox.js +62 -0
  90. package/dist/checkbox.mjs +17 -0
  91. package/dist/chip.d.mts +7 -0
  92. package/dist/chip.d.ts +7 -0
  93. package/dist/chip.js +62 -0
  94. package/dist/chip.mjs +17 -0
  95. package/dist/chunk-2VVJGTUG.mjs +18 -0
  96. package/dist/chunk-3INC3CHA.mjs +702 -0
  97. package/dist/chunk-3LGY4LPH.mjs +671 -0
  98. package/dist/chunk-3ZAK7JKB.mjs +17 -0
  99. package/dist/chunk-4PT5CSRI.mjs +635 -0
  100. package/dist/chunk-4RSXKKJ3.mjs +677 -0
  101. package/dist/chunk-4YL3IDTL.mjs +712 -0
  102. package/dist/chunk-5PTI2A2O.mjs +635 -0
  103. package/dist/chunk-5QGN2CVX.mjs +738 -0
  104. package/dist/chunk-5WVSR7VI.mjs +30 -0
  105. package/dist/chunk-6XKA7TMO.mjs +654 -0
  106. package/dist/chunk-75AEPNQV.mjs +663 -0
  107. package/dist/chunk-7VN5YMMV.mjs +666 -0
  108. package/dist/chunk-7Y4J73GF.mjs +22 -0
  109. package/dist/chunk-A4GTTYXS.mjs +725 -0
  110. package/dist/chunk-A6UVH2MS.mjs +638 -0
  111. package/dist/chunk-AFUVAGQ7.mjs +717 -0
  112. package/dist/chunk-AU6MS36I.mjs +687 -0
  113. package/dist/chunk-AZ4T75GP.mjs +716 -0
  114. package/dist/chunk-B26DAG54.mjs +729 -0
  115. package/dist/chunk-B6MLUNDY.mjs +641 -0
  116. package/dist/chunk-BEP42F7C.mjs +704 -0
  117. package/dist/chunk-CDQYIC4L.mjs +638 -0
  118. package/dist/chunk-CJ5XEQAB.mjs +707 -0
  119. package/dist/chunk-CLRGEEBS.mjs +695 -0
  120. package/dist/chunk-EDDP4RXX.mjs +731 -0
  121. package/dist/chunk-EYFZ6Q2I.mjs +30 -0
  122. package/dist/chunk-EZEFJ62V.mjs +723 -0
  123. package/dist/chunk-F3Y22UH3.mjs +704 -0
  124. package/dist/chunk-FCUQVOXM.mjs +707 -0
  125. package/dist/chunk-FMFAYI6F.mjs +727 -0
  126. package/dist/chunk-FWCSY2DS.mjs +37 -0
  127. package/dist/chunk-FYHAFWVF.mjs +719 -0
  128. package/dist/chunk-G5LVCGAZ.mjs +715 -0
  129. package/dist/chunk-GC7M6Q7Q.mjs +712 -0
  130. package/dist/chunk-GJP3ZHQZ.mjs +712 -0
  131. package/dist/chunk-GTCMGRVH.mjs +576 -0
  132. package/dist/chunk-GXYSMEFL.mjs +704 -0
  133. package/dist/chunk-GYEEDPWP.mjs +646 -0
  134. package/dist/chunk-H5JOUGZ7.mjs +7 -0
  135. package/dist/chunk-HAXRNHML.mjs +17 -0
  136. package/dist/chunk-HGDOFGU4.mjs +717 -0
  137. package/dist/chunk-HR7CZZZU.mjs +34 -0
  138. package/dist/chunk-I4E63NIC.mjs +24 -0
  139. package/dist/chunk-I5H76ESF.mjs +671 -0
  140. package/dist/chunk-IIBNCIGO.mjs +713 -0
  141. package/dist/chunk-INHKGMOA.mjs +705 -0
  142. package/dist/chunk-ISFJIOTZ.mjs +668 -0
  143. package/dist/chunk-IU4IZB74.mjs +729 -0
  144. package/dist/chunk-IXJXFW7K.mjs +712 -0
  145. package/dist/chunk-JUNAYNXW.mjs +667 -0
  146. package/dist/chunk-K2Z5MFPN.mjs +717 -0
  147. package/dist/chunk-KJDBWFV4.mjs +15 -0
  148. package/dist/chunk-KOR3RFXT.mjs +616 -0
  149. package/dist/chunk-KRCDJE37.mjs +616 -0
  150. package/dist/chunk-KX3KGQM5.mjs +704 -0
  151. package/dist/chunk-MJF7PMCN.mjs +713 -0
  152. package/dist/chunk-MSMSEKLJ.mjs +727 -0
  153. package/dist/chunk-MWVIJSXF.mjs +723 -0
  154. package/dist/chunk-MZ6NCHFH.mjs +712 -0
  155. package/dist/chunk-NHR5EVP5.mjs +34 -0
  156. package/dist/chunk-NLOG75HP.mjs +712 -0
  157. package/dist/chunk-NPIFU7NP.mjs +717 -0
  158. package/dist/chunk-NUTTLEFB.mjs +675 -0
  159. package/dist/chunk-P3F3JWWN.mjs +707 -0
  160. package/dist/chunk-PPGJLNI5.mjs +704 -0
  161. package/dist/chunk-PUPP26OX.mjs +707 -0
  162. package/dist/chunk-Q43USMAB.mjs +638 -0
  163. package/dist/chunk-QUYESF5V.mjs +706 -0
  164. package/dist/chunk-R4NJDEQL.mjs +686 -0
  165. package/dist/chunk-RE7K3H64.mjs +707 -0
  166. package/dist/chunk-RIDPXVXH.mjs +706 -0
  167. package/dist/chunk-RQIAE3MB.mjs +721 -0
  168. package/dist/chunk-RRYH5A6K.mjs +727 -0
  169. package/dist/chunk-RTUIKVKP.mjs +705 -0
  170. package/dist/chunk-RYZ2UYKN.mjs +707 -0
  171. package/dist/chunk-S37HUFPH.mjs +719 -0
  172. package/dist/chunk-S4TZORUT.mjs +708 -0
  173. package/dist/chunk-SOMFG24T.mjs +675 -0
  174. package/dist/chunk-SP3LL4DC.mjs +704 -0
  175. package/dist/chunk-TJZXXGH3.mjs +641 -0
  176. package/dist/chunk-TWFYWUDV.mjs +707 -0
  177. package/dist/chunk-U2JQUQ2B.mjs +712 -0
  178. package/dist/chunk-UCFJXIGR.mjs +671 -0
  179. package/dist/chunk-UFKECQBD.mjs +736 -0
  180. package/dist/chunk-UNZHSAWG.mjs +704 -0
  181. package/dist/chunk-UORPGX7S.mjs +637 -0
  182. package/dist/chunk-VA7BMOMQ.mjs +712 -0
  183. package/dist/chunk-VKJEODYN.mjs +705 -0
  184. package/dist/chunk-VST6TRHA.mjs +15 -0
  185. package/dist/chunk-VSTSMCNW.mjs +169 -0
  186. package/dist/chunk-W35RLK2G.mjs +714 -0
  187. package/dist/chunk-WLX3YEFG.mjs +713 -0
  188. package/dist/chunk-WUKYLWAZ.mjs +0 -0
  189. package/dist/chunk-XJFQ6VLH.mjs +676 -0
  190. package/dist/chunk-XUAVHHPE.mjs +715 -0
  191. package/dist/chunk-YHEJWFKH.mjs +711 -0
  192. package/dist/chunk-YJ5Q4Z6X.mjs +37 -0
  193. package/dist/chunk-YMWHUJU5.mjs +15 -0
  194. package/dist/chunk-YNFJJWV4.mjs +712 -0
  195. package/dist/chunk-YOEKQLSM.mjs +715 -0
  196. package/dist/chunk-ZIIKFFIL.mjs +21 -0
  197. package/dist/chunk-ZLBX4R5M.mjs +711 -0
  198. package/dist/container.d.mts +7 -0
  199. package/dist/container.d.ts +7 -0
  200. package/dist/container.js +62 -0
  201. package/dist/container.mjs +17 -0
  202. package/dist/dialog-actions.d.mts +7 -0
  203. package/dist/dialog-actions.d.ts +7 -0
  204. package/dist/dialog-actions.js +62 -0
  205. package/dist/dialog-actions.mjs +17 -0
  206. package/dist/dialog-content.d.mts +7 -0
  207. package/dist/dialog-content.d.ts +7 -0
  208. package/dist/dialog-content.js +62 -0
  209. package/dist/dialog-content.mjs +17 -0
  210. package/dist/dialog-title.d.mts +7 -0
  211. package/dist/dialog-title.d.ts +7 -0
  212. package/dist/dialog-title.js +62 -0
  213. package/dist/dialog-title.mjs +17 -0
  214. package/dist/dialog.d.mts +7 -0
  215. package/dist/dialog.d.ts +7 -0
  216. package/dist/dialog.js +62 -0
  217. package/dist/dialog.mjs +17 -0
  218. package/dist/divider.d.mts +7 -0
  219. package/dist/divider.d.ts +7 -0
  220. package/dist/divider.js +62 -0
  221. package/dist/divider.mjs +17 -0
  222. package/dist/drawer.d.mts +7 -0
  223. package/dist/drawer.d.ts +7 -0
  224. package/dist/drawer.js +62 -0
  225. package/dist/drawer.mjs +17 -0
  226. package/dist/fab.d.mts +7 -0
  227. package/dist/fab.d.ts +7 -0
  228. package/dist/fab.js +62 -0
  229. package/dist/fab.mjs +17 -0
  230. package/dist/form-control.d.mts +7 -0
  231. package/dist/form-control.d.ts +7 -0
  232. package/dist/form-control.js +62 -0
  233. package/dist/form-control.mjs +17 -0
  234. package/dist/grid.d.mts +7 -0
  235. package/dist/grid.d.ts +7 -0
  236. package/dist/grid.js +62 -0
  237. package/dist/grid.mjs +17 -0
  238. package/dist/icon-button.d.mts +7 -0
  239. package/dist/icon-button.d.ts +7 -0
  240. package/dist/icon-button.js +62 -0
  241. package/dist/icon-button.mjs +17 -0
  242. package/dist/image-list-item.d.mts +7 -0
  243. package/dist/image-list-item.d.ts +7 -0
  244. package/dist/image-list-item.js +62 -0
  245. package/dist/image-list-item.mjs +17 -0
  246. package/dist/image-list.d.mts +7 -0
  247. package/dist/image-list.d.ts +7 -0
  248. package/dist/image-list.js +62 -0
  249. package/dist/image-list.mjs +17 -0
  250. package/dist/index.d.mts +5 -0
  251. package/dist/index.d.ts +5 -0
  252. package/dist/index.js +697 -0
  253. package/dist/index.mjs +61 -0
  254. package/dist/input-label.d.mts +7 -0
  255. package/dist/input-label.d.ts +7 -0
  256. package/dist/input-label.js +62 -0
  257. package/dist/input-label.mjs +17 -0
  258. package/dist/link.d.mts +7 -0
  259. package/dist/link.d.ts +7 -0
  260. package/dist/link.js +62 -0
  261. package/dist/link.mjs +17 -0
  262. package/dist/list-item-icon.d.mts +7 -0
  263. package/dist/list-item-icon.d.ts +7 -0
  264. package/dist/list-item-icon.js +62 -0
  265. package/dist/list-item-icon.mjs +17 -0
  266. package/dist/list-item-text.d.mts +7 -0
  267. package/dist/list-item-text.d.ts +7 -0
  268. package/dist/list-item-text.js +62 -0
  269. package/dist/list-item-text.mjs +17 -0
  270. package/dist/list-item.d.mts +7 -0
  271. package/dist/list-item.d.ts +7 -0
  272. package/dist/list-item.js +62 -0
  273. package/dist/list-item.mjs +17 -0
  274. package/dist/list.d.mts +7 -0
  275. package/dist/list.d.ts +7 -0
  276. package/dist/list.js +62 -0
  277. package/dist/list.mjs +17 -0
  278. package/dist/masonry.d.mts +7 -0
  279. package/dist/masonry.d.ts +7 -0
  280. package/dist/masonry.js +62 -0
  281. package/dist/masonry.mjs +17 -0
  282. package/dist/menu-item.d.mts +7 -0
  283. package/dist/menu-item.d.ts +7 -0
  284. package/dist/menu-item.js +62 -0
  285. package/dist/menu-item.mjs +17 -0
  286. package/dist/menu.d.mts +7 -0
  287. package/dist/menu.d.ts +7 -0
  288. package/dist/menu.js +62 -0
  289. package/dist/menu.mjs +17 -0
  290. package/dist/mui-augmentation-DKlyQ0kQ.d.mts +19 -0
  291. package/dist/mui-augmentation-DKlyQ0kQ.d.ts +19 -0
  292. package/dist/pagination.d.mts +7 -0
  293. package/dist/pagination.d.ts +7 -0
  294. package/dist/pagination.js +62 -0
  295. package/dist/pagination.mjs +17 -0
  296. package/dist/paper.d.mts +7 -0
  297. package/dist/paper.d.ts +7 -0
  298. package/dist/paper.js +62 -0
  299. package/dist/paper.mjs +17 -0
  300. package/dist/progress.d.mts +10 -0
  301. package/dist/progress.d.ts +10 -0
  302. package/dist/progress.js +71 -0
  303. package/dist/progress.mjs +25 -0
  304. package/dist/radio-group.d.mts +7 -0
  305. package/dist/radio-group.d.ts +7 -0
  306. package/dist/radio-group.js +62 -0
  307. package/dist/radio-group.mjs +17 -0
  308. package/dist/radio.d.mts +10 -0
  309. package/dist/radio.d.ts +10 -0
  310. package/dist/radio.js +62 -0
  311. package/dist/radio.mjs +18 -0
  312. package/dist/rating.d.mts +7 -0
  313. package/dist/rating.d.ts +7 -0
  314. package/dist/rating.js +62 -0
  315. package/dist/rating.mjs +17 -0
  316. package/dist/select.d.mts +7 -0
  317. package/dist/select.d.ts +7 -0
  318. package/dist/select.js +62 -0
  319. package/dist/select.mjs +17 -0
  320. package/dist/selection-button-group.d.mts +16 -0
  321. package/dist/selection-button-group.d.ts +16 -0
  322. package/dist/selection-button-group.js +109 -0
  323. package/dist/selection-button-group.mjs +42 -0
  324. package/dist/skeleton.d.mts +7 -0
  325. package/dist/skeleton.d.ts +7 -0
  326. package/dist/skeleton.js +62 -0
  327. package/dist/skeleton.mjs +17 -0
  328. package/dist/slider.d.mts +7 -0
  329. package/dist/slider.d.ts +7 -0
  330. package/dist/slider.js +62 -0
  331. package/dist/slider.mjs +17 -0
  332. package/dist/snackbar.d.mts +7 -0
  333. package/dist/snackbar.d.ts +7 -0
  334. package/dist/snackbar.js +62 -0
  335. package/dist/snackbar.mjs +17 -0
  336. package/dist/speed-dial-action.d.mts +7 -0
  337. package/dist/speed-dial-action.d.ts +7 -0
  338. package/dist/speed-dial-action.js +62 -0
  339. package/dist/speed-dial-action.mjs +17 -0
  340. package/dist/speed-dial.d.mts +7 -0
  341. package/dist/speed-dial.d.ts +7 -0
  342. package/dist/speed-dial.js +62 -0
  343. package/dist/speed-dial.mjs +17 -0
  344. package/dist/stack.d.mts +7 -0
  345. package/dist/stack.d.ts +7 -0
  346. package/dist/stack.js +62 -0
  347. package/dist/stack.mjs +17 -0
  348. package/dist/step-content.d.mts +7 -0
  349. package/dist/step-content.d.ts +7 -0
  350. package/dist/step-content.js +62 -0
  351. package/dist/step-content.mjs +17 -0
  352. package/dist/step-label.d.mts +7 -0
  353. package/dist/step-label.d.ts +7 -0
  354. package/dist/step-label.js +62 -0
  355. package/dist/step-label.mjs +17 -0
  356. package/dist/step.d.mts +7 -0
  357. package/dist/step.d.ts +7 -0
  358. package/dist/step.js +62 -0
  359. package/dist/step.mjs +17 -0
  360. package/dist/stepper.d.mts +7 -0
  361. package/dist/stepper.d.ts +7 -0
  362. package/dist/stepper.js +62 -0
  363. package/dist/stepper.mjs +17 -0
  364. package/dist/switch.d.mts +10 -0
  365. package/dist/switch.d.ts +10 -0
  366. package/dist/switch.js +62 -0
  367. package/dist/switch.mjs +18 -0
  368. package/dist/tab-context.d.mts +9 -0
  369. package/dist/tab-context.d.ts +9 -0
  370. package/dist/tab-context.js +59 -0
  371. package/dist/tab-context.mjs +14 -0
  372. package/dist/tab-list.d.mts +7 -0
  373. package/dist/tab-list.d.ts +7 -0
  374. package/dist/tab-list.js +62 -0
  375. package/dist/tab-list.mjs +17 -0
  376. package/dist/tab-panel.d.mts +7 -0
  377. package/dist/tab-panel.d.ts +7 -0
  378. package/dist/tab-panel.js +62 -0
  379. package/dist/tab-panel.mjs +17 -0
  380. package/dist/tab.d.mts +7 -0
  381. package/dist/tab.d.ts +7 -0
  382. package/dist/tab.js +62 -0
  383. package/dist/tab.mjs +17 -0
  384. package/dist/table-body.d.mts +7 -0
  385. package/dist/table-body.d.ts +7 -0
  386. package/dist/table-body.js +62 -0
  387. package/dist/table-body.mjs +17 -0
  388. package/dist/table-cell.d.mts +7 -0
  389. package/dist/table-cell.d.ts +7 -0
  390. package/dist/table-cell.js +62 -0
  391. package/dist/table-cell.mjs +17 -0
  392. package/dist/table-container.d.mts +7 -0
  393. package/dist/table-container.d.ts +7 -0
  394. package/dist/table-container.js +62 -0
  395. package/dist/table-container.mjs +17 -0
  396. package/dist/table-head.d.mts +7 -0
  397. package/dist/table-head.d.ts +7 -0
  398. package/dist/table-head.js +62 -0
  399. package/dist/table-head.mjs +17 -0
  400. package/dist/table-row.d.mts +7 -0
  401. package/dist/table-row.d.ts +7 -0
  402. package/dist/table-row.js +62 -0
  403. package/dist/table-row.mjs +17 -0
  404. package/dist/table.d.mts +7 -0
  405. package/dist/table.d.ts +7 -0
  406. package/dist/table.js +62 -0
  407. package/dist/table.mjs +17 -0
  408. package/dist/tabs.d.mts +7 -0
  409. package/dist/tabs.d.ts +7 -0
  410. package/dist/tabs.js +62 -0
  411. package/dist/tabs.mjs +17 -0
  412. package/dist/text-field.d.mts +8 -0
  413. package/dist/text-field.d.ts +8 -0
  414. package/dist/text-field.js +62 -0
  415. package/dist/text-field.mjs +17 -0
  416. package/dist/theme/index.d.mts +255 -0
  417. package/dist/theme/index.d.ts +255 -0
  418. package/dist/theme/index.js +811 -0
  419. package/dist/theme/index.mjs +62 -0
  420. package/dist/timeline-connector.d.mts +7 -0
  421. package/dist/timeline-connector.d.ts +7 -0
  422. package/dist/timeline-connector.js +62 -0
  423. package/dist/timeline-connector.mjs +17 -0
  424. package/dist/timeline-content.d.mts +7 -0
  425. package/dist/timeline-content.d.ts +7 -0
  426. package/dist/timeline-content.js +62 -0
  427. package/dist/timeline-content.mjs +17 -0
  428. package/dist/timeline-dot.d.mts +7 -0
  429. package/dist/timeline-dot.d.ts +7 -0
  430. package/dist/timeline-dot.js +62 -0
  431. package/dist/timeline-dot.mjs +17 -0
  432. package/dist/timeline-item.d.mts +7 -0
  433. package/dist/timeline-item.d.ts +7 -0
  434. package/dist/timeline-item.js +62 -0
  435. package/dist/timeline-item.mjs +17 -0
  436. package/dist/timeline-separator.d.mts +7 -0
  437. package/dist/timeline-separator.d.ts +7 -0
  438. package/dist/timeline-separator.js +62 -0
  439. package/dist/timeline-separator.mjs +17 -0
  440. package/dist/timeline.d.mts +7 -0
  441. package/dist/timeline.d.ts +7 -0
  442. package/dist/timeline.js +62 -0
  443. package/dist/timeline.mjs +17 -0
  444. package/dist/toggle-button-group.d.mts +14 -0
  445. package/dist/toggle-button-group.d.ts +14 -0
  446. package/dist/toggle-button-group.js +90 -0
  447. package/dist/toggle-button-group.mjs +32 -0
  448. package/dist/toggle-button.d.mts +8 -0
  449. package/dist/toggle-button.d.ts +8 -0
  450. package/dist/toggle-button.js +62 -0
  451. package/dist/toggle-button.mjs +8 -0
  452. package/dist/tooltip.d.mts +7 -0
  453. package/dist/tooltip.d.ts +7 -0
  454. package/dist/tooltip.js +62 -0
  455. package/dist/tooltip.mjs +17 -0
  456. package/dist/typography.d.mts +7 -0
  457. package/dist/typography.d.ts +7 -0
  458. package/dist/typography.js +62 -0
  459. package/dist/typography.mjs +17 -0
  460. package/package.json +439 -7
  461. package/src/accordion-details.tsx +14 -0
  462. package/src/accordion-summary.tsx +14 -0
  463. package/src/accordion.tsx +14 -0
  464. package/src/alert.tsx +12 -0
  465. package/src/app-bar.tsx +12 -0
  466. package/src/autocomplete.tsx +26 -0
  467. package/src/avatar.tsx +12 -0
  468. package/src/backdrop.tsx +14 -0
  469. package/src/badge.tsx +12 -0
  470. package/src/bottom-navigation-action.tsx +14 -0
  471. package/src/bottom-navigation.tsx +14 -0
  472. package/src/box.tsx +12 -0
  473. package/src/breadcrumbs.tsx +14 -0
  474. package/src/button-group.tsx +14 -0
  475. package/src/button.tsx +9 -4
  476. package/src/card-actions.tsx +14 -0
  477. package/src/card-content.tsx +14 -0
  478. package/src/card-header.tsx +14 -0
  479. package/src/card-media.tsx +14 -0
  480. package/src/card.tsx +12 -0
  481. package/src/charts/BackofficeSwitchableChart.tsx +325 -0
  482. package/src/charts/FrontendBarChart.tsx +134 -0
  483. package/src/charts/FrontendDoughnutChart.tsx +372 -0
  484. package/src/charts/FrontendIncomeExpenseHorizontalBarChart.tsx +138 -0
  485. package/src/charts/FrontendLiabilitiesChart.tsx +97 -0
  486. package/src/charts/FrontendLineChart.tsx +299 -0
  487. package/src/charts/FrontendLineChartMobile.tsx +383 -0
  488. package/src/charts/FrontendMixedChart.tsx +264 -0
  489. package/src/charts/FrontendPercentageBar.tsx +247 -0
  490. package/src/charts/FrontendScenarioLineChart.tsx +308 -0
  491. package/src/charts/FrontendStackedChart.tsx +184 -0
  492. package/src/charts/LoadingChartBackdrop.tsx +32 -0
  493. package/src/charts/chart-utils.ts +58 -0
  494. package/src/charts/index.ts +59 -0
  495. package/src/charts/mock-data.ts +153 -0
  496. package/src/checkbox.tsx +16 -0
  497. package/src/chip.tsx +12 -0
  498. package/src/container.tsx +14 -0
  499. package/src/dialog-actions.tsx +14 -0
  500. package/src/dialog-content.tsx +14 -0
  501. package/src/dialog-title.tsx +14 -0
  502. package/src/dialog.tsx +12 -0
  503. package/src/divider.tsx +12 -0
  504. package/src/drawer.tsx +12 -0
  505. package/src/fab.tsx +12 -0
  506. package/src/form-control.tsx +14 -0
  507. package/src/grid.tsx +12 -0
  508. package/src/icon-button.tsx +14 -0
  509. package/src/image-list-item.tsx +14 -0
  510. package/src/image-list.tsx +14 -0
  511. package/src/input-label.tsx +14 -0
  512. package/src/link.tsx +12 -0
  513. package/src/list-item-icon.tsx +14 -0
  514. package/src/list-item-text.tsx +14 -0
  515. package/src/list-item.tsx +14 -0
  516. package/src/list.tsx +12 -0
  517. package/src/masonry.tsx +14 -0
  518. package/src/menu-item.tsx +14 -0
  519. package/src/menu.tsx +12 -0
  520. package/src/mui-augmentation.ts +23 -0
  521. package/src/pagination.tsx +14 -0
  522. package/src/paper.tsx +12 -0
  523. package/src/progress.tsx +25 -0
  524. package/src/radio-group.tsx +14 -0
  525. package/src/radio.tsx +15 -0
  526. package/src/rating.tsx +12 -0
  527. package/src/select.tsx +12 -0
  528. package/src/selection-button-group.tsx +58 -0
  529. package/src/skeleton.tsx +14 -0
  530. package/src/slider.tsx +12 -0
  531. package/src/snackbar.tsx +14 -0
  532. package/src/speed-dial-action.tsx +14 -0
  533. package/src/speed-dial.tsx +14 -0
  534. package/src/stack.tsx +12 -0
  535. package/src/step-content.tsx +14 -0
  536. package/src/step-label.tsx +14 -0
  537. package/src/step.tsx +12 -0
  538. package/src/stepper.tsx +12 -0
  539. package/src/switch.tsx +15 -0
  540. package/src/tab-context.tsx +11 -0
  541. package/src/tab-list.tsx +14 -0
  542. package/src/tab-panel.tsx +14 -0
  543. package/src/tab.tsx +12 -0
  544. package/src/table-body.tsx +14 -0
  545. package/src/table-cell.tsx +14 -0
  546. package/src/table-container.tsx +14 -0
  547. package/src/table-head.tsx +14 -0
  548. package/src/table-row.tsx +14 -0
  549. package/src/table.tsx +12 -0
  550. package/src/tabs.tsx +12 -0
  551. package/src/text-field.tsx +14 -0
  552. package/src/theme/buildCssVariables.ts +6 -0
  553. package/src/theme/createDesignTheme.ts +118 -2
  554. package/src/theme/index.ts +1 -0
  555. package/src/theme/spacing.ts +23 -0
  556. package/src/timeline-connector.tsx +14 -0
  557. package/src/timeline-content.tsx +14 -0
  558. package/src/timeline-dot.tsx +14 -0
  559. package/src/timeline-item.tsx +14 -0
  560. package/src/timeline-separator.tsx +14 -0
  561. package/src/timeline.tsx +14 -0
  562. package/src/toggle-button-group.tsx +35 -0
  563. package/src/toggle-button.tsx +15 -0
  564. package/src/tooltip.tsx +14 -0
  565. package/src/typography.tsx +14 -0
  566. package/tsup.config.ts +89 -1
  567. package/README.md +0 -124
@@ -0,0 +1,299 @@
1
+ import React, { useMemo, useRef } from "react";
2
+ import { styled } from "@mui/material/styles";
3
+ import {
4
+ CategoryScale,
5
+ Chart as ChartJS,
6
+ Legend,
7
+ LinearScale,
8
+ LineController,
9
+ LineElement,
10
+ PointElement,
11
+ TimeScale,
12
+ Title,
13
+ Tooltip,
14
+ } from "chart.js";
15
+ import "chartjs-adapter-date-fns";
16
+ import { Chart } from "react-chartjs-2";
17
+ import { tooltipsBaseOption, formatNumber, formatNumberWithText } from "./chart-utils";
18
+
19
+ ChartJS.register(
20
+ CategoryScale,
21
+ LinearScale,
22
+ PointElement,
23
+ LineElement,
24
+ LineController,
25
+ Title,
26
+ Tooltip,
27
+ Legend,
28
+ TimeScale
29
+ );
30
+
31
+ export interface LineChartDataItem {
32
+ x: string | Date;
33
+ y: number;
34
+ }
35
+
36
+ export interface LineChartDataset {
37
+ data: LineChartDataItem[];
38
+ label?: string;
39
+ customOptions?: Record<string, any>;
40
+ }
41
+
42
+ export interface FrontendLineChartProps {
43
+ lineChartData?: LineChartDataset[];
44
+ legendDisplay?: boolean;
45
+ title?: string;
46
+ customChartOptions?: Record<string, any>;
47
+ height?: number;
48
+ invertYAxis?: boolean;
49
+ referenceLineValue?: number;
50
+ referenceLineLabel?: string;
51
+ referenceLineColor?: string;
52
+ mainLineColor?: string;
53
+ }
54
+
55
+ const ChartContainer = styled("div")({
56
+ width: "100%",
57
+ });
58
+
59
+ const ChartWrapper = styled("div")<{ chartHeight?: number }>(
60
+ ({ chartHeight }) => ({
61
+ flex: "auto",
62
+ height: chartHeight || 270,
63
+ position: "relative",
64
+ width: "100%",
65
+ })
66
+ );
67
+
68
+ const buildChartData = (
69
+ title: string,
70
+ lineChartData: LineChartDataset[],
71
+ mainLineColor: string,
72
+ referenceLineValue?: number,
73
+ referenceLineLabel?: string,
74
+ referenceLineColor: string = "#39FD99"
75
+ ) => {
76
+ const datasets: any[] = lineChartData.map((dataset, index) => {
77
+ const color = dataset.customOptions?.borderColor || mainLineColor;
78
+ return {
79
+ type: "line" as const,
80
+ label: dataset.label || title || `Dataset ${index + 1}`,
81
+ fill: false,
82
+ backgroundColor: color,
83
+ borderColor: color,
84
+ borderCapStyle: "butt",
85
+ borderDash: [],
86
+ borderDashOffset: 0.0,
87
+ borderJoinStyle: "miter",
88
+ pointBorderColor: color,
89
+ pointBackgroundColor: color,
90
+ pointBorderWidth: 1,
91
+ pointHoverRadius: 3,
92
+ pointHoverBackgroundColor: color,
93
+ pointHoverBorderColor: color,
94
+ pointHoverBorderWidth: 3,
95
+ pointRadius: 1,
96
+ pointHitRadius: 3,
97
+ borderWidth: 1.5,
98
+ tension: 0.4,
99
+ data: dataset.data,
100
+ ...dataset.customOptions,
101
+ };
102
+ });
103
+
104
+ if (
105
+ typeof referenceLineValue === "number" &&
106
+ lineChartData.length > 0 &&
107
+ lineChartData[0]?.data?.length
108
+ ) {
109
+ const firstDataset = lineChartData[0]!.data;
110
+ const firstX = firstDataset[0]?.x;
111
+ const lastX = firstDataset[firstDataset.length - 1]?.x;
112
+ const refData =
113
+ firstX && lastX
114
+ ? [
115
+ { x: firstX, y: referenceLineValue },
116
+ { x: lastX, y: referenceLineValue },
117
+ ]
118
+ : firstDataset.map((p) => ({ x: p.x, y: referenceLineValue }));
119
+
120
+ datasets.push({
121
+ type: "line" as const,
122
+ label: referenceLineLabel || "Target",
123
+ fill: false,
124
+ backgroundColor: referenceLineColor,
125
+ borderColor: referenceLineColor,
126
+ borderDash: [],
127
+ borderWidth: 1,
128
+ pointRadius: 0,
129
+ tension: 0,
130
+ data: refData,
131
+ legendHidden: true,
132
+ });
133
+ }
134
+
135
+ return { datasets };
136
+ };
137
+
138
+ const buildChartOption = (
139
+ customChartOptions: Record<string, any>,
140
+ invertYAxis: boolean
141
+ ) => {
142
+ const baseOptions: Record<string, any> = {
143
+ scales: {
144
+ x: {
145
+ display: true,
146
+ grid: { display: false, drawOnChartArea: false, drawBorder: true },
147
+ stacked: true,
148
+ ticks: {
149
+ maxTicksLimit: 8,
150
+ autoSkip: true,
151
+ maxRotation: 0,
152
+ minRotation: 0,
153
+ beginAtZero: false,
154
+ source: "auto",
155
+ display: true,
156
+ },
157
+ bounds: "data",
158
+ type: "time",
159
+ time: {
160
+ unit: "month",
161
+ stepSize: 1,
162
+ displayFormats: {
163
+ day: "MMM dd",
164
+ month: "MMM yyyy",
165
+ year: "yyyy",
166
+ },
167
+ },
168
+ distribution: "series",
169
+ },
170
+ y: {
171
+ display: true,
172
+ grid: {
173
+ display: false,
174
+ drawBorder: false,
175
+ drawOnChartArea: false,
176
+ color: "transparent",
177
+ },
178
+ border: { display: false },
179
+ reverse: invertYAxis,
180
+ position: "left",
181
+ ticks: {
182
+ beginAtZero: false,
183
+ display: true,
184
+ callback(value: any) {
185
+ return formatNumberWithText(Number(value), 1);
186
+ },
187
+ },
188
+ },
189
+ },
190
+ maintainAspectRatio: false,
191
+ responsive: true,
192
+ plugins: {
193
+ tooltip: {
194
+ ...tooltipsBaseOption,
195
+ filter: (tooltipItem: any) => {
196
+ if (tooltipItem.dataset.hideFromTooltip) {
197
+ const chartValue = tooltipItem.parsed?.y;
198
+ const referenceValue = tooltipItem.dataset.referenceLineValue;
199
+ return chartValue !== referenceValue;
200
+ }
201
+ return true;
202
+ },
203
+ callbacks: {
204
+ title(tooltipItems: any[]) {
205
+ const tooltipItem = tooltipItems[0];
206
+ if (tooltipItem?.parsed?.x) {
207
+ const date = new Date(tooltipItem.parsed.x);
208
+ return date.toLocaleDateString("en-US", {
209
+ year: "numeric",
210
+ month: "2-digit",
211
+ day: "2-digit",
212
+ });
213
+ }
214
+ return "";
215
+ },
216
+ label(tooltipItem: any) {
217
+ const chartValue = tooltipItem.parsed?.y ?? 0;
218
+ const chartValueWithCommas = formatNumber(Math.abs(chartValue));
219
+ const chartTitle = tooltipItem.dataset.label;
220
+ return `${chartTitle} ${chartValue >= 0 ? `$${chartValueWithCommas}` : `-$${chartValueWithCommas}`}`.trim();
221
+ },
222
+ },
223
+ },
224
+ },
225
+ interaction: { mode: "nearest", intersect: false },
226
+ };
227
+
228
+ return { ...baseOptions, ...customChartOptions };
229
+ };
230
+
231
+ const buildChartLegend = (legendDisplay: boolean) => ({
232
+ display: legendDisplay,
233
+ position: "bottom" as const,
234
+ fullSize: true,
235
+ reverse: false,
236
+ labels: {
237
+ color: "#000",
238
+ filter: (legendItem: any, data: any) => {
239
+ const ds = data?.datasets?.[legendItem.datasetIndex];
240
+ return !ds?.legendHidden;
241
+ },
242
+ },
243
+ });
244
+
245
+ export const FrontendLineChart: React.FC<FrontendLineChartProps> = ({
246
+ lineChartData = [],
247
+ legendDisplay = true,
248
+ title = "",
249
+ customChartOptions = {},
250
+ height,
251
+ invertYAxis = false,
252
+ referenceLineValue,
253
+ referenceLineLabel,
254
+ mainLineColor = "#162029",
255
+ referenceLineColor = "#39FD99",
256
+ }) => {
257
+ const chartRef = useRef(null);
258
+
259
+ const chartData = useMemo(
260
+ () =>
261
+ buildChartData(
262
+ title,
263
+ lineChartData,
264
+ mainLineColor,
265
+ referenceLineValue,
266
+ referenceLineLabel,
267
+ referenceLineColor
268
+ ),
269
+ [lineChartData, title, mainLineColor, referenceLineValue, referenceLineLabel, referenceLineColor]
270
+ );
271
+
272
+ const chartOption = useMemo(
273
+ () => buildChartOption(customChartOptions, invertYAxis),
274
+ [customChartOptions, invertYAxis]
275
+ );
276
+
277
+ const chartLegend = useMemo(() => buildChartLegend(legendDisplay), [legendDisplay]);
278
+
279
+ return (
280
+ <ChartContainer>
281
+ <ChartWrapper chartHeight={height}>
282
+ <Chart
283
+ ref={chartRef}
284
+ type="line"
285
+ data={chartData}
286
+ options={{
287
+ ...chartOption,
288
+ plugins: {
289
+ ...chartOption.plugins,
290
+ legend: chartLegend,
291
+ },
292
+ } as any}
293
+ />
294
+ </ChartWrapper>
295
+ </ChartContainer>
296
+ );
297
+ };
298
+
299
+ FrontendLineChart.displayName = "FrontendLineChart";
@@ -0,0 +1,383 @@
1
+ import React, { useEffect, useMemo, useRef, useState } from "react";
2
+ import { styled } from "@mui/material/styles";
3
+ import {
4
+ CategoryScale,
5
+ Chart as ChartJS,
6
+ Legend,
7
+ LinearScale,
8
+ LineController,
9
+ LineElement,
10
+ PointElement,
11
+ TimeScale,
12
+ Title,
13
+ Tooltip,
14
+ } from "chart.js";
15
+ import "chartjs-adapter-date-fns";
16
+ import { Chart } from "react-chartjs-2";
17
+ import { formatNumberWithDollar } from "./chart-utils";
18
+
19
+ ChartJS.register(
20
+ CategoryScale,
21
+ LinearScale,
22
+ PointElement,
23
+ LineElement,
24
+ LineController,
25
+ Title,
26
+ Tooltip,
27
+ Legend,
28
+ TimeScale
29
+ );
30
+
31
+ export interface MobileLineChartDataItem {
32
+ x: string | Date;
33
+ y: number;
34
+ }
35
+
36
+ export interface MobileLineChartDataset {
37
+ data: MobileLineChartDataItem[];
38
+ label?: string;
39
+ color?: string;
40
+ lineSpacing?: number[];
41
+ borderWidth?: number;
42
+ customOptions?: Record<string, any>;
43
+ }
44
+
45
+ export interface FrontendLineChartMobileProps {
46
+ chartTitle?: string;
47
+ subTitle?: string;
48
+ titleValue?: number;
49
+ chartData?: MobileLineChartDataset[];
50
+ defaultColor?: string;
51
+ customChartOptions?: Record<string, any>;
52
+ }
53
+
54
+ const ChartContainer = styled("div")({
55
+ width: "100%",
56
+ });
57
+
58
+ const ChartSize = styled("div")({
59
+ flex: "auto",
60
+ height: 200,
61
+ position: "relative",
62
+ width: "100%",
63
+ });
64
+
65
+ const MobileChartTitleWrapper = styled("div")({
66
+ padding: "8px 0",
67
+ });
68
+
69
+ const MobileChartTitleText = styled("div")({
70
+ fontSize: 14,
71
+ color: "#656566",
72
+ });
73
+
74
+ const MobileChartTitleBold = styled("span")({
75
+ fontWeight: 600,
76
+ color: "#131c24",
77
+ });
78
+
79
+ const MobileChartValue = styled("div")({
80
+ fontSize: 24,
81
+ fontWeight: 700,
82
+ color: "#131c24",
83
+ marginTop: 4,
84
+ });
85
+
86
+ const LegendContainer = styled("div")({
87
+ display: "flex",
88
+ flexWrap: "wrap",
89
+ gap: 12,
90
+ marginTop: 8,
91
+ paddingLeft: 30,
92
+ });
93
+
94
+ const LegendWrap = styled("div")({
95
+ display: "flex",
96
+ alignItems: "center",
97
+ gap: 6,
98
+ });
99
+
100
+ const LegendBox = styled("div")<{ isDashed?: boolean }>(({ isDashed }) => ({
101
+ width: 12,
102
+ height: isDashed ? 0 : 12,
103
+ borderRadius: 2,
104
+ flexShrink: 0,
105
+ ...(isDashed
106
+ ? {
107
+ borderTop: "2px dashed #A1B9BD",
108
+ width: 12,
109
+ }
110
+ : {}),
111
+ }));
112
+
113
+ const LegendFont = styled("span")({
114
+ fontSize: 12,
115
+ color: "#656566",
116
+ });
117
+
118
+ const BORDER_COLOR = "#A1B9BD";
119
+
120
+ const buildChartData = (
121
+ lineChartData: MobileLineChartDataset[],
122
+ defaultColor: string
123
+ ) => ({
124
+ datasets: lineChartData.map((chartData) => {
125
+ const {
126
+ label = "",
127
+ data = [],
128
+ color = defaultColor,
129
+ lineSpacing = [],
130
+ borderWidth = 2,
131
+ customOptions = {},
132
+ } = chartData;
133
+
134
+ return {
135
+ label,
136
+ fill: false,
137
+ backgroundColor: color,
138
+ borderColor: color,
139
+ borderCapStyle: "butt" as const,
140
+ borderDash: lineSpacing,
141
+ borderDashOffset: 0.0,
142
+ borderJoinStyle: "miter" as const,
143
+ pointBorderColor: color,
144
+ pointBackgroundColor: color,
145
+ pointBorderWidth: 0,
146
+ pointHoverRadius: 6,
147
+ pointHoverBackgroundColor: "#ffffff",
148
+ pointHoverBorderColor: color,
149
+ pointHoverBorderWidth: 2,
150
+ pointRadius: 0,
151
+ borderWidth,
152
+ pointHitRadius: 3,
153
+ data,
154
+ tension: 0.4,
155
+ ...customOptions,
156
+ };
157
+ }),
158
+ });
159
+
160
+ const getMinMaxInArray = (
161
+ mathFn: "min" | "max",
162
+ array: MobileLineChartDataset[],
163
+ property: "x" | "y"
164
+ ): number => {
165
+ return Math[mathFn](
166
+ ...array.map((chartItem) =>
167
+ Math[mathFn](...chartItem.data.map((item) => Number(item[property])))
168
+ )
169
+ );
170
+ };
171
+
172
+ const buildChartOption = (
173
+ minChartData: number,
174
+ maxChartData: number,
175
+ setChartTitleValue: (v: { index: number; value: number }) => void,
176
+ customChartOptions: Record<string, any>
177
+ ) => {
178
+ const baseOptions: Record<string, any> = {
179
+ layout: {
180
+ padding: { left: 30, right: 30, top: 0, bottom: 0 },
181
+ },
182
+ scales: {
183
+ x: {
184
+ display: false,
185
+ grid: { display: false },
186
+ ticks: { padding: 25 },
187
+ stacked: true,
188
+ bounds: "data",
189
+ type: "time",
190
+ distribution: "linear",
191
+ },
192
+ y: {
193
+ type: "linear",
194
+ display: false,
195
+ position: "right",
196
+ ticks: {
197
+ padding: 25,
198
+ min: minChartData,
199
+ max: maxChartData,
200
+ },
201
+ },
202
+ },
203
+ maintainAspectRatio: false,
204
+ responsive: true,
205
+ plugins: {
206
+ tooltip: { enabled: false },
207
+ legend: { display: false },
208
+ },
209
+ interaction: { mode: "nearest", intersect: false },
210
+ onHover: (_event: any, activeElements: any[], chart: any) => {
211
+ if (activeElements.length) {
212
+ const datasetIndex = activeElements[0]?.datasetIndex || 0;
213
+ const elementIndex = activeElements[0]?.index || 0;
214
+ const dataset = chart.data.datasets[datasetIndex];
215
+ if (dataset?.data?.[elementIndex]) {
216
+ setChartTitleValue({
217
+ index: datasetIndex,
218
+ value: (dataset.data[elementIndex] as any).y,
219
+ });
220
+ }
221
+ }
222
+ },
223
+ };
224
+ return { ...baseOptions, ...customChartOptions };
225
+ };
226
+
227
+ const drawVerticalLine = {
228
+ id: "drawVerticalLine",
229
+ afterDraw(chart: any) {
230
+ if (
231
+ chart.tooltip?._active?.length &&
232
+ chart.config.type === "line"
233
+ ) {
234
+ const activePoint = chart.tooltip._active[0];
235
+ if (!activePoint) return;
236
+
237
+ const { ctx } = chart;
238
+ const yAxis = chart.scales.y;
239
+ const { x } = activePoint.element;
240
+ const topY = yAxis.top;
241
+ const bottomY = yAxis.bottom;
242
+
243
+ const datasetIndex = activePoint.datasetIndex;
244
+ const dataIndex = activePoint.index;
245
+ const dataset = chart.data.datasets[datasetIndex];
246
+ const point = dataset?.data?.[dataIndex];
247
+ let dateStr = "";
248
+ if (point?.x) {
249
+ const date = new Date(point.x);
250
+ const mm = String(date.getMonth() + 1).padStart(2, "0");
251
+ const yyyy = date.getFullYear();
252
+ dateStr = `${yyyy}/${mm}`;
253
+ }
254
+
255
+ ctx.save();
256
+ ctx.beginPath();
257
+ ctx.moveTo(x, topY);
258
+ ctx.lineTo(x, bottomY - 20);
259
+ ctx.lineWidth = 2;
260
+ ctx.strokeStyle = BORDER_COLOR;
261
+ ctx.textAlign = "center";
262
+ ctx.textBaseline = "middle";
263
+ ctx.font = "14px sans-serif";
264
+ ctx.fillText(dateStr, x, bottomY - 10);
265
+ ctx.stroke();
266
+ ctx.restore();
267
+ }
268
+ },
269
+ };
270
+
271
+ interface MobileChartTitleProps {
272
+ title: string;
273
+ subTitle?: string;
274
+ value: number;
275
+ }
276
+
277
+ const MobileChartTitle: React.FC<MobileChartTitleProps> = ({
278
+ title = "",
279
+ subTitle = "",
280
+ value = 0,
281
+ }) => (
282
+ <MobileChartTitleWrapper>
283
+ <MobileChartTitleText>
284
+ <MobileChartTitleBold>{title}</MobileChartTitleBold>{" "}
285
+ {subTitle}
286
+ </MobileChartTitleText>
287
+ <MobileChartValue>{formatNumberWithDollar(value)}</MobileChartValue>
288
+ </MobileChartTitleWrapper>
289
+ );
290
+
291
+ export const FrontendLineChartMobile: React.FC<FrontendLineChartMobileProps> = ({
292
+ chartTitle = "",
293
+ subTitle,
294
+ titleValue = 0,
295
+ chartData: lineChartData = [],
296
+ defaultColor = "#162029",
297
+ customChartOptions = {},
298
+ }) => {
299
+ const [lineChartTitleValue, setLineChartTitleValue] = useState({
300
+ index: 0,
301
+ value: 0,
302
+ });
303
+ const lineChart = useRef(null);
304
+
305
+ const minChartData = useMemo(
306
+ () =>
307
+ lineChartData.length > 0
308
+ ? getMinMaxInArray("min", lineChartData, "y")
309
+ : 0,
310
+ [lineChartData]
311
+ );
312
+ const maxChartData = useMemo(
313
+ () =>
314
+ lineChartData.length > 0
315
+ ? getMinMaxInArray("max", lineChartData, "y")
316
+ : 100,
317
+ [lineChartData]
318
+ );
319
+
320
+ const yAxisInnerPadding = Math.max(
321
+ minChartData * 0.2,
322
+ (maxChartData - minChartData) * 0.2
323
+ );
324
+
325
+ const data = useMemo(
326
+ () => buildChartData(lineChartData, defaultColor),
327
+ [lineChartData, defaultColor]
328
+ );
329
+
330
+ const options = useMemo(
331
+ () =>
332
+ buildChartOption(
333
+ minChartData - yAxisInnerPadding * 0.2,
334
+ maxChartData + yAxisInnerPadding * 0.2,
335
+ setLineChartTitleValue,
336
+ customChartOptions
337
+ ),
338
+ [minChartData, maxChartData, yAxisInnerPadding, customChartOptions]
339
+ );
340
+
341
+ const currentTitle =
342
+ lineChartData?.[lineChartTitleValue.index]?.label || chartTitle;
343
+
344
+ return (
345
+ <>
346
+ <MobileChartTitle
347
+ title={currentTitle}
348
+ subTitle={subTitle}
349
+ value={lineChartTitleValue.value || titleValue}
350
+ />
351
+ <ChartContainer>
352
+ <ChartSize>
353
+ <Chart
354
+ type="line"
355
+ ref={lineChart}
356
+ data={data}
357
+ options={options as any}
358
+ plugins={[drawVerticalLine]}
359
+ />
360
+ </ChartSize>
361
+ <LegendContainer>
362
+ {lineChartData.map((ds, index) => (
363
+ <LegendWrap key={ds.label || index}>
364
+ <LegendBox
365
+ isDashed={!!ds.lineSpacing?.length}
366
+ style={
367
+ ds.lineSpacing?.length
368
+ ? {}
369
+ : {
370
+ backgroundColor: ds.color || defaultColor,
371
+ }
372
+ }
373
+ />
374
+ <LegendFont>{ds.label || ""}</LegendFont>
375
+ </LegendWrap>
376
+ ))}
377
+ </LegendContainer>
378
+ </ChartContainer>
379
+ </>
380
+ );
381
+ };
382
+
383
+ FrontendLineChartMobile.displayName = "FrontendLineChartMobile";