@wealthx/ui 1.0.0 → 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.
- package/.turbo/turbo-build.log +359 -14
- package/CHANGELOG.md +3 -7
- package/dist/accordion-details.d.mts +7 -0
- package/dist/accordion-details.d.ts +7 -0
- package/dist/accordion-details.js +62 -0
- package/dist/accordion-details.mjs +17 -0
- package/dist/accordion-summary.d.mts +7 -0
- package/dist/accordion-summary.d.ts +7 -0
- package/dist/accordion-summary.js +62 -0
- package/dist/accordion-summary.mjs +17 -0
- package/dist/accordion.d.mts +7 -0
- package/dist/accordion.d.ts +7 -0
- package/dist/accordion.js +62 -0
- package/dist/accordion.mjs +17 -0
- package/dist/alert.d.mts +7 -0
- package/dist/alert.d.ts +7 -0
- package/dist/alert.js +62 -0
- package/dist/alert.mjs +17 -0
- package/dist/app-bar.d.mts +7 -0
- package/dist/app-bar.d.ts +7 -0
- package/dist/app-bar.js +62 -0
- package/dist/app-bar.mjs +17 -0
- package/dist/autocomplete.d.mts +7 -0
- package/dist/autocomplete.d.ts +7 -0
- package/dist/autocomplete.js +62 -0
- package/dist/autocomplete.mjs +17 -0
- package/dist/avatar.d.mts +7 -0
- package/dist/avatar.d.ts +7 -0
- package/dist/avatar.js +62 -0
- package/dist/avatar.mjs +17 -0
- package/dist/backdrop.d.mts +7 -0
- package/dist/backdrop.d.ts +7 -0
- package/dist/backdrop.js +62 -0
- package/dist/backdrop.mjs +17 -0
- package/dist/badge.d.mts +7 -0
- package/dist/badge.d.ts +7 -0
- package/dist/badge.js +62 -0
- package/dist/badge.mjs +17 -0
- package/dist/bottom-navigation-action.d.mts +7 -0
- package/dist/bottom-navigation-action.d.ts +7 -0
- package/dist/bottom-navigation-action.js +62 -0
- package/dist/bottom-navigation-action.mjs +17 -0
- package/dist/bottom-navigation.d.mts +7 -0
- package/dist/bottom-navigation.d.ts +7 -0
- package/dist/bottom-navigation.js +62 -0
- package/dist/bottom-navigation.mjs +17 -0
- package/dist/box.d.mts +7 -0
- package/dist/box.d.ts +7 -0
- package/dist/box.js +62 -0
- package/dist/box.mjs +17 -0
- package/dist/breadcrumbs.d.mts +7 -0
- package/dist/breadcrumbs.d.ts +7 -0
- package/dist/breadcrumbs.js +62 -0
- package/dist/breadcrumbs.mjs +17 -0
- package/dist/button-group.d.mts +7 -0
- package/dist/button-group.d.ts +7 -0
- package/dist/button-group.js +62 -0
- package/dist/button-group.mjs +17 -0
- package/dist/button.d.mts +2 -4
- package/dist/button.d.ts +2 -4
- package/dist/button.js +6 -3
- package/dist/button.mjs +7 -4
- package/dist/card-actions.d.mts +7 -0
- package/dist/card-actions.d.ts +7 -0
- package/dist/card-actions.js +62 -0
- package/dist/card-actions.mjs +17 -0
- package/dist/card-content.d.mts +7 -0
- package/dist/card-content.d.ts +7 -0
- package/dist/card-content.js +62 -0
- package/dist/card-content.mjs +17 -0
- package/dist/card-header.d.mts +7 -0
- package/dist/card-header.d.ts +7 -0
- package/dist/card-header.js +62 -0
- package/dist/card-header.mjs +17 -0
- package/dist/card-media.d.mts +7 -0
- package/dist/card-media.d.ts +7 -0
- package/dist/card-media.js +62 -0
- package/dist/card-media.mjs +17 -0
- package/dist/card.d.mts +7 -0
- package/dist/card.d.ts +7 -0
- package/dist/card.js +62 -0
- package/dist/card.mjs +17 -0
- package/dist/charts/index.d.mts +260 -0
- package/dist/charts/index.d.ts +260 -0
- package/dist/charts/index.js +2514 -0
- package/dist/charts/index.mjs +2442 -0
- package/dist/checkbox.d.mts +9 -0
- package/dist/checkbox.d.ts +9 -0
- package/dist/checkbox.js +62 -0
- package/dist/checkbox.mjs +17 -0
- package/dist/chip.d.mts +7 -0
- package/dist/chip.d.ts +7 -0
- package/dist/chip.js +62 -0
- package/dist/chip.mjs +17 -0
- package/dist/chunk-2VVJGTUG.mjs +18 -0
- package/dist/chunk-3INC3CHA.mjs +702 -0
- package/dist/chunk-3LGY4LPH.mjs +671 -0
- package/dist/chunk-3ZAK7JKB.mjs +17 -0
- package/dist/chunk-4PT5CSRI.mjs +635 -0
- package/dist/chunk-4RSXKKJ3.mjs +677 -0
- package/dist/chunk-4YL3IDTL.mjs +712 -0
- package/dist/chunk-5PTI2A2O.mjs +635 -0
- package/dist/chunk-5QGN2CVX.mjs +738 -0
- package/dist/chunk-5WVSR7VI.mjs +30 -0
- package/dist/chunk-6XKA7TMO.mjs +654 -0
- package/dist/chunk-75AEPNQV.mjs +663 -0
- package/dist/chunk-7VN5YMMV.mjs +666 -0
- package/dist/chunk-7Y4J73GF.mjs +22 -0
- package/dist/chunk-A4GTTYXS.mjs +725 -0
- package/dist/chunk-A6UVH2MS.mjs +638 -0
- package/dist/chunk-AFUVAGQ7.mjs +717 -0
- package/dist/chunk-AU6MS36I.mjs +687 -0
- package/dist/chunk-AZ4T75GP.mjs +716 -0
- package/dist/chunk-B26DAG54.mjs +729 -0
- package/dist/chunk-B6MLUNDY.mjs +641 -0
- package/dist/chunk-BEP42F7C.mjs +704 -0
- package/dist/chunk-CDQYIC4L.mjs +638 -0
- package/dist/chunk-CJ5XEQAB.mjs +707 -0
- package/dist/chunk-CLRGEEBS.mjs +695 -0
- package/dist/chunk-EDDP4RXX.mjs +731 -0
- package/dist/chunk-EYFZ6Q2I.mjs +30 -0
- package/dist/chunk-EZEFJ62V.mjs +723 -0
- package/dist/chunk-F3Y22UH3.mjs +704 -0
- package/dist/chunk-FCUQVOXM.mjs +707 -0
- package/dist/chunk-FMFAYI6F.mjs +727 -0
- package/dist/chunk-FYHAFWVF.mjs +719 -0
- package/dist/chunk-G5LVCGAZ.mjs +715 -0
- package/dist/chunk-GC7M6Q7Q.mjs +712 -0
- package/dist/chunk-GJP3ZHQZ.mjs +712 -0
- package/dist/chunk-GTCMGRVH.mjs +576 -0
- package/dist/chunk-GXYSMEFL.mjs +704 -0
- package/dist/chunk-GYEEDPWP.mjs +646 -0
- package/dist/chunk-H5JOUGZ7.mjs +7 -0
- package/dist/chunk-HAXRNHML.mjs +17 -0
- package/dist/chunk-HGDOFGU4.mjs +717 -0
- package/dist/chunk-HR7CZZZU.mjs +34 -0
- package/dist/chunk-I5H76ESF.mjs +671 -0
- package/dist/chunk-IIBNCIGO.mjs +713 -0
- package/dist/chunk-INHKGMOA.mjs +705 -0
- package/dist/chunk-ISFJIOTZ.mjs +668 -0
- package/dist/chunk-IU4IZB74.mjs +729 -0
- package/dist/chunk-IXJXFW7K.mjs +712 -0
- package/dist/chunk-JUNAYNXW.mjs +667 -0
- package/dist/chunk-K2Z5MFPN.mjs +717 -0
- package/dist/chunk-KJDBWFV4.mjs +15 -0
- package/dist/chunk-KOR3RFXT.mjs +616 -0
- package/dist/chunk-KRCDJE37.mjs +616 -0
- package/dist/chunk-KX3KGQM5.mjs +704 -0
- package/dist/chunk-MJF7PMCN.mjs +713 -0
- package/dist/chunk-MSMSEKLJ.mjs +727 -0
- package/dist/chunk-MWVIJSXF.mjs +723 -0
- package/dist/chunk-MZ6NCHFH.mjs +712 -0
- package/dist/chunk-NHR5EVP5.mjs +34 -0
- package/dist/chunk-NLOG75HP.mjs +712 -0
- package/dist/chunk-NPIFU7NP.mjs +717 -0
- package/dist/chunk-NUTTLEFB.mjs +675 -0
- package/dist/chunk-P3F3JWWN.mjs +707 -0
- package/dist/chunk-PPGJLNI5.mjs +704 -0
- package/dist/chunk-PUPP26OX.mjs +707 -0
- package/dist/chunk-Q43USMAB.mjs +638 -0
- package/dist/chunk-QUYESF5V.mjs +706 -0
- package/dist/chunk-R4NJDEQL.mjs +686 -0
- package/dist/chunk-RE7K3H64.mjs +707 -0
- package/dist/chunk-RIDPXVXH.mjs +706 -0
- package/dist/chunk-RQIAE3MB.mjs +721 -0
- package/dist/chunk-RRYH5A6K.mjs +727 -0
- package/dist/chunk-RTUIKVKP.mjs +705 -0
- package/dist/chunk-RYZ2UYKN.mjs +707 -0
- package/dist/chunk-S37HUFPH.mjs +719 -0
- package/dist/chunk-S4TZORUT.mjs +708 -0
- package/dist/chunk-SOMFG24T.mjs +675 -0
- package/dist/chunk-SP3LL4DC.mjs +704 -0
- package/dist/chunk-TJZXXGH3.mjs +641 -0
- package/dist/chunk-TWFYWUDV.mjs +707 -0
- package/dist/chunk-U2JQUQ2B.mjs +712 -0
- package/dist/chunk-UCFJXIGR.mjs +671 -0
- package/dist/chunk-UFKECQBD.mjs +736 -0
- package/dist/chunk-UNZHSAWG.mjs +704 -0
- package/dist/chunk-UORPGX7S.mjs +637 -0
- package/dist/chunk-VA7BMOMQ.mjs +712 -0
- package/dist/chunk-VKJEODYN.mjs +705 -0
- package/dist/chunk-VST6TRHA.mjs +15 -0
- package/dist/chunk-VSTSMCNW.mjs +169 -0
- package/dist/chunk-W35RLK2G.mjs +714 -0
- package/dist/chunk-WLX3YEFG.mjs +713 -0
- package/dist/chunk-WUKYLWAZ.mjs +0 -0
- package/dist/chunk-XJFQ6VLH.mjs +676 -0
- package/dist/chunk-XUAVHHPE.mjs +715 -0
- package/dist/chunk-YHEJWFKH.mjs +711 -0
- package/dist/chunk-YJ5Q4Z6X.mjs +37 -0
- package/dist/chunk-YMWHUJU5.mjs +15 -0
- package/dist/chunk-YNFJJWV4.mjs +712 -0
- package/dist/chunk-YOEKQLSM.mjs +715 -0
- package/dist/chunk-ZIIKFFIL.mjs +21 -0
- package/dist/chunk-ZLBX4R5M.mjs +711 -0
- package/dist/container.d.mts +7 -0
- package/dist/container.d.ts +7 -0
- package/dist/container.js +62 -0
- package/dist/container.mjs +17 -0
- package/dist/dialog-actions.d.mts +7 -0
- package/dist/dialog-actions.d.ts +7 -0
- package/dist/dialog-actions.js +62 -0
- package/dist/dialog-actions.mjs +17 -0
- package/dist/dialog-content.d.mts +7 -0
- package/dist/dialog-content.d.ts +7 -0
- package/dist/dialog-content.js +62 -0
- package/dist/dialog-content.mjs +17 -0
- package/dist/dialog-title.d.mts +7 -0
- package/dist/dialog-title.d.ts +7 -0
- package/dist/dialog-title.js +62 -0
- package/dist/dialog-title.mjs +17 -0
- package/dist/dialog.d.mts +7 -0
- package/dist/dialog.d.ts +7 -0
- package/dist/dialog.js +62 -0
- package/dist/dialog.mjs +17 -0
- package/dist/divider.d.mts +7 -0
- package/dist/divider.d.ts +7 -0
- package/dist/divider.js +62 -0
- package/dist/divider.mjs +17 -0
- package/dist/drawer.d.mts +7 -0
- package/dist/drawer.d.ts +7 -0
- package/dist/drawer.js +62 -0
- package/dist/drawer.mjs +17 -0
- package/dist/fab.d.mts +7 -0
- package/dist/fab.d.ts +7 -0
- package/dist/fab.js +62 -0
- package/dist/fab.mjs +17 -0
- package/dist/form-control.d.mts +7 -0
- package/dist/form-control.d.ts +7 -0
- package/dist/form-control.js +62 -0
- package/dist/form-control.mjs +17 -0
- package/dist/grid.d.mts +7 -0
- package/dist/grid.d.ts +7 -0
- package/dist/grid.js +62 -0
- package/dist/grid.mjs +17 -0
- package/dist/icon-button.d.mts +7 -0
- package/dist/icon-button.d.ts +7 -0
- package/dist/icon-button.js +62 -0
- package/dist/icon-button.mjs +17 -0
- package/dist/image-list-item.d.mts +7 -0
- package/dist/image-list-item.d.ts +7 -0
- package/dist/image-list-item.js +62 -0
- package/dist/image-list-item.mjs +17 -0
- package/dist/image-list.d.mts +7 -0
- package/dist/image-list.d.ts +7 -0
- package/dist/image-list.js +62 -0
- package/dist/image-list.mjs +17 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +697 -0
- package/dist/index.mjs +61 -0
- package/dist/input-label.d.mts +7 -0
- package/dist/input-label.d.ts +7 -0
- package/dist/input-label.js +62 -0
- package/dist/input-label.mjs +17 -0
- package/dist/link.d.mts +7 -0
- package/dist/link.d.ts +7 -0
- package/dist/link.js +62 -0
- package/dist/link.mjs +17 -0
- package/dist/list-item-icon.d.mts +7 -0
- package/dist/list-item-icon.d.ts +7 -0
- package/dist/list-item-icon.js +62 -0
- package/dist/list-item-icon.mjs +17 -0
- package/dist/list-item-text.d.mts +7 -0
- package/dist/list-item-text.d.ts +7 -0
- package/dist/list-item-text.js +62 -0
- package/dist/list-item-text.mjs +17 -0
- package/dist/list-item.d.mts +7 -0
- package/dist/list-item.d.ts +7 -0
- package/dist/list-item.js +62 -0
- package/dist/list-item.mjs +17 -0
- package/dist/list.d.mts +7 -0
- package/dist/list.d.ts +7 -0
- package/dist/list.js +62 -0
- package/dist/list.mjs +17 -0
- package/dist/masonry.d.mts +7 -0
- package/dist/masonry.d.ts +7 -0
- package/dist/masonry.js +62 -0
- package/dist/masonry.mjs +17 -0
- package/dist/menu-item.d.mts +7 -0
- package/dist/menu-item.d.ts +7 -0
- package/dist/menu-item.js +62 -0
- package/dist/menu-item.mjs +17 -0
- package/dist/menu.d.mts +7 -0
- package/dist/menu.d.ts +7 -0
- package/dist/menu.js +62 -0
- package/dist/menu.mjs +17 -0
- package/dist/mui-augmentation-DKlyQ0kQ.d.mts +19 -0
- package/dist/mui-augmentation-DKlyQ0kQ.d.ts +19 -0
- package/dist/pagination.d.mts +7 -0
- package/dist/pagination.d.ts +7 -0
- package/dist/pagination.js +62 -0
- package/dist/pagination.mjs +17 -0
- package/dist/paper.d.mts +7 -0
- package/dist/paper.d.ts +7 -0
- package/dist/paper.js +62 -0
- package/dist/paper.mjs +17 -0
- package/dist/progress.d.mts +10 -0
- package/dist/progress.d.ts +10 -0
- package/dist/progress.js +71 -0
- package/dist/progress.mjs +25 -0
- package/dist/radio-group.d.mts +7 -0
- package/dist/radio-group.d.ts +7 -0
- package/dist/radio-group.js +62 -0
- package/dist/radio-group.mjs +17 -0
- package/dist/radio.d.mts +10 -0
- package/dist/radio.d.ts +10 -0
- package/dist/radio.js +62 -0
- package/dist/radio.mjs +18 -0
- package/dist/rating.d.mts +7 -0
- package/dist/rating.d.ts +7 -0
- package/dist/rating.js +62 -0
- package/dist/rating.mjs +17 -0
- package/dist/select.d.mts +7 -0
- package/dist/select.d.ts +7 -0
- package/dist/select.js +62 -0
- package/dist/select.mjs +17 -0
- package/dist/selection-button-group.d.mts +16 -0
- package/dist/selection-button-group.d.ts +16 -0
- package/dist/selection-button-group.js +109 -0
- package/dist/selection-button-group.mjs +42 -0
- package/dist/skeleton.d.mts +7 -0
- package/dist/skeleton.d.ts +7 -0
- package/dist/skeleton.js +62 -0
- package/dist/skeleton.mjs +17 -0
- package/dist/slider.d.mts +7 -0
- package/dist/slider.d.ts +7 -0
- package/dist/slider.js +62 -0
- package/dist/slider.mjs +17 -0
- package/dist/snackbar.d.mts +7 -0
- package/dist/snackbar.d.ts +7 -0
- package/dist/snackbar.js +62 -0
- package/dist/snackbar.mjs +17 -0
- package/dist/speed-dial-action.d.mts +7 -0
- package/dist/speed-dial-action.d.ts +7 -0
- package/dist/speed-dial-action.js +62 -0
- package/dist/speed-dial-action.mjs +17 -0
- package/dist/speed-dial.d.mts +7 -0
- package/dist/speed-dial.d.ts +7 -0
- package/dist/speed-dial.js +62 -0
- package/dist/speed-dial.mjs +17 -0
- package/dist/stack.d.mts +7 -0
- package/dist/stack.d.ts +7 -0
- package/dist/stack.js +62 -0
- package/dist/stack.mjs +17 -0
- package/dist/step-content.d.mts +7 -0
- package/dist/step-content.d.ts +7 -0
- package/dist/step-content.js +62 -0
- package/dist/step-content.mjs +17 -0
- package/dist/step-label.d.mts +7 -0
- package/dist/step-label.d.ts +7 -0
- package/dist/step-label.js +62 -0
- package/dist/step-label.mjs +17 -0
- package/dist/step.d.mts +7 -0
- package/dist/step.d.ts +7 -0
- package/dist/step.js +62 -0
- package/dist/step.mjs +17 -0
- package/dist/stepper.d.mts +7 -0
- package/dist/stepper.d.ts +7 -0
- package/dist/stepper.js +62 -0
- package/dist/stepper.mjs +17 -0
- package/dist/switch.d.mts +10 -0
- package/dist/switch.d.ts +10 -0
- package/dist/switch.js +62 -0
- package/dist/switch.mjs +18 -0
- package/dist/tab-context.d.mts +9 -0
- package/dist/tab-context.d.ts +9 -0
- package/dist/tab-context.js +59 -0
- package/dist/tab-context.mjs +14 -0
- package/dist/tab-list.d.mts +7 -0
- package/dist/tab-list.d.ts +7 -0
- package/dist/tab-list.js +62 -0
- package/dist/tab-list.mjs +17 -0
- package/dist/tab-panel.d.mts +7 -0
- package/dist/tab-panel.d.ts +7 -0
- package/dist/tab-panel.js +62 -0
- package/dist/tab-panel.mjs +17 -0
- package/dist/tab.d.mts +7 -0
- package/dist/tab.d.ts +7 -0
- package/dist/tab.js +62 -0
- package/dist/tab.mjs +17 -0
- package/dist/table-body.d.mts +7 -0
- package/dist/table-body.d.ts +7 -0
- package/dist/table-body.js +62 -0
- package/dist/table-body.mjs +17 -0
- package/dist/table-cell.d.mts +7 -0
- package/dist/table-cell.d.ts +7 -0
- package/dist/table-cell.js +62 -0
- package/dist/table-cell.mjs +17 -0
- package/dist/table-container.d.mts +7 -0
- package/dist/table-container.d.ts +7 -0
- package/dist/table-container.js +62 -0
- package/dist/table-container.mjs +17 -0
- package/dist/table-head.d.mts +7 -0
- package/dist/table-head.d.ts +7 -0
- package/dist/table-head.js +62 -0
- package/dist/table-head.mjs +17 -0
- package/dist/table-row.d.mts +7 -0
- package/dist/table-row.d.ts +7 -0
- package/dist/table-row.js +62 -0
- package/dist/table-row.mjs +17 -0
- package/dist/table.d.mts +7 -0
- package/dist/table.d.ts +7 -0
- package/dist/table.js +62 -0
- package/dist/table.mjs +17 -0
- package/dist/tabs.d.mts +7 -0
- package/dist/tabs.d.ts +7 -0
- package/dist/tabs.js +62 -0
- package/dist/tabs.mjs +17 -0
- package/dist/text-field.d.mts +8 -0
- package/dist/text-field.d.ts +8 -0
- package/dist/text-field.js +62 -0
- package/dist/text-field.mjs +17 -0
- package/dist/theme/index.d.mts +14 -5
- package/dist/theme/index.d.ts +14 -5
- package/dist/theme/index.js +128 -4
- package/dist/theme/index.mjs +33 -586
- package/dist/timeline-connector.d.mts +7 -0
- package/dist/timeline-connector.d.ts +7 -0
- package/dist/timeline-connector.js +62 -0
- package/dist/timeline-connector.mjs +17 -0
- package/dist/timeline-content.d.mts +7 -0
- package/dist/timeline-content.d.ts +7 -0
- package/dist/timeline-content.js +62 -0
- package/dist/timeline-content.mjs +17 -0
- package/dist/timeline-dot.d.mts +7 -0
- package/dist/timeline-dot.d.ts +7 -0
- package/dist/timeline-dot.js +62 -0
- package/dist/timeline-dot.mjs +17 -0
- package/dist/timeline-item.d.mts +7 -0
- package/dist/timeline-item.d.ts +7 -0
- package/dist/timeline-item.js +62 -0
- package/dist/timeline-item.mjs +17 -0
- package/dist/timeline-separator.d.mts +7 -0
- package/dist/timeline-separator.d.ts +7 -0
- package/dist/timeline-separator.js +62 -0
- package/dist/timeline-separator.mjs +17 -0
- package/dist/timeline.d.mts +7 -0
- package/dist/timeline.d.ts +7 -0
- package/dist/timeline.js +62 -0
- package/dist/timeline.mjs +17 -0
- package/dist/toggle-button-group.d.mts +14 -0
- package/dist/toggle-button-group.d.ts +14 -0
- package/dist/toggle-button-group.js +90 -0
- package/dist/toggle-button-group.mjs +32 -0
- package/dist/toggle-button.d.mts +8 -0
- package/dist/toggle-button.d.ts +8 -0
- package/dist/toggle-button.js +62 -0
- package/dist/toggle-button.mjs +8 -0
- package/dist/tooltip.d.mts +7 -0
- package/dist/tooltip.d.ts +7 -0
- package/dist/tooltip.js +62 -0
- package/dist/tooltip.mjs +17 -0
- package/dist/typography.d.mts +7 -0
- package/dist/typography.d.ts +7 -0
- package/dist/typography.js +62 -0
- package/dist/typography.mjs +17 -0
- package/package.json +439 -7
- package/src/accordion-details.tsx +14 -0
- package/src/accordion-summary.tsx +14 -0
- package/src/accordion.tsx +14 -0
- package/src/alert.tsx +12 -0
- package/src/app-bar.tsx +12 -0
- package/src/autocomplete.tsx +26 -0
- package/src/avatar.tsx +12 -0
- package/src/backdrop.tsx +14 -0
- package/src/badge.tsx +12 -0
- package/src/bottom-navigation-action.tsx +14 -0
- package/src/bottom-navigation.tsx +14 -0
- package/src/box.tsx +12 -0
- package/src/breadcrumbs.tsx +14 -0
- package/src/button-group.tsx +14 -0
- package/src/button.tsx +9 -4
- package/src/card-actions.tsx +14 -0
- package/src/card-content.tsx +14 -0
- package/src/card-header.tsx +14 -0
- package/src/card-media.tsx +14 -0
- package/src/card.tsx +12 -0
- package/src/charts/BackofficeSwitchableChart.tsx +325 -0
- package/src/charts/FrontendBarChart.tsx +134 -0
- package/src/charts/FrontendDoughnutChart.tsx +372 -0
- package/src/charts/FrontendIncomeExpenseHorizontalBarChart.tsx +138 -0
- package/src/charts/FrontendLiabilitiesChart.tsx +97 -0
- package/src/charts/FrontendLineChart.tsx +299 -0
- package/src/charts/FrontendLineChartMobile.tsx +383 -0
- package/src/charts/FrontendMixedChart.tsx +264 -0
- package/src/charts/FrontendPercentageBar.tsx +247 -0
- package/src/charts/FrontendScenarioLineChart.tsx +308 -0
- package/src/charts/FrontendStackedChart.tsx +184 -0
- package/src/charts/LoadingChartBackdrop.tsx +32 -0
- package/src/charts/chart-utils.ts +58 -0
- package/src/charts/index.ts +59 -0
- package/src/charts/mock-data.ts +153 -0
- package/src/checkbox.tsx +16 -0
- package/src/chip.tsx +12 -0
- package/src/container.tsx +14 -0
- package/src/dialog-actions.tsx +14 -0
- package/src/dialog-content.tsx +14 -0
- package/src/dialog-title.tsx +14 -0
- package/src/dialog.tsx +12 -0
- package/src/divider.tsx +12 -0
- package/src/drawer.tsx +12 -0
- package/src/fab.tsx +12 -0
- package/src/form-control.tsx +14 -0
- package/src/grid.tsx +12 -0
- package/src/icon-button.tsx +14 -0
- package/src/image-list-item.tsx +14 -0
- package/src/image-list.tsx +14 -0
- package/src/input-label.tsx +14 -0
- package/src/link.tsx +12 -0
- package/src/list-item-icon.tsx +14 -0
- package/src/list-item-text.tsx +14 -0
- package/src/list-item.tsx +14 -0
- package/src/list.tsx +12 -0
- package/src/masonry.tsx +14 -0
- package/src/menu-item.tsx +14 -0
- package/src/menu.tsx +12 -0
- package/src/mui-augmentation.ts +23 -0
- package/src/pagination.tsx +14 -0
- package/src/paper.tsx +12 -0
- package/src/progress.tsx +25 -0
- package/src/radio-group.tsx +14 -0
- package/src/radio.tsx +15 -0
- package/src/rating.tsx +12 -0
- package/src/select.tsx +12 -0
- package/src/selection-button-group.tsx +58 -0
- package/src/skeleton.tsx +14 -0
- package/src/slider.tsx +12 -0
- package/src/snackbar.tsx +14 -0
- package/src/speed-dial-action.tsx +14 -0
- package/src/speed-dial.tsx +14 -0
- package/src/stack.tsx +12 -0
- package/src/step-content.tsx +14 -0
- package/src/step-label.tsx +14 -0
- package/src/step.tsx +12 -0
- package/src/stepper.tsx +12 -0
- package/src/switch.tsx +15 -0
- package/src/tab-context.tsx +11 -0
- package/src/tab-list.tsx +14 -0
- package/src/tab-panel.tsx +14 -0
- package/src/tab.tsx +12 -0
- package/src/table-body.tsx +14 -0
- package/src/table-cell.tsx +14 -0
- package/src/table-container.tsx +14 -0
- package/src/table-head.tsx +14 -0
- package/src/table-row.tsx +14 -0
- package/src/table.tsx +12 -0
- package/src/tabs.tsx +12 -0
- package/src/text-field.tsx +14 -0
- package/src/theme/buildCssVariables.ts +6 -0
- package/src/theme/createDesignTheme.ts +118 -2
- package/src/theme/index.ts +1 -0
- package/src/theme/spacing.ts +23 -0
- package/src/timeline-connector.tsx +14 -0
- package/src/timeline-content.tsx +14 -0
- package/src/timeline-dot.tsx +14 -0
- package/src/timeline-item.tsx +14 -0
- package/src/timeline-separator.tsx +14 -0
- package/src/timeline.tsx +14 -0
- package/src/toggle-button-group.tsx +35 -0
- package/src/toggle-button.tsx +15 -0
- package/src/tooltip.tsx +14 -0
- package/src/typography.tsx +14 -0
- package/tsup.config.ts +89 -1
- package/README.md +0 -124
|
@@ -0,0 +1,308 @@
|
|
|
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 { formatNumber, formatNumberWithText } from "./chart-utils";
|
|
18
|
+
import { LoadingChartBackdrop } from "./LoadingChartBackdrop";
|
|
19
|
+
|
|
20
|
+
ChartJS.register(
|
|
21
|
+
CategoryScale,
|
|
22
|
+
LinearScale,
|
|
23
|
+
PointElement,
|
|
24
|
+
LineElement,
|
|
25
|
+
LineController,
|
|
26
|
+
Title,
|
|
27
|
+
Tooltip,
|
|
28
|
+
Legend,
|
|
29
|
+
TimeScale
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export interface ScenarioDataPoint {
|
|
33
|
+
x: string | Date;
|
|
34
|
+
y: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface FrontendScenarioLineChartProps {
|
|
38
|
+
data?: ScenarioDataPoint[];
|
|
39
|
+
secondaryData?: ScenarioDataPoint[];
|
|
40
|
+
isLoading?: boolean;
|
|
41
|
+
isError?: boolean;
|
|
42
|
+
height?: number;
|
|
43
|
+
desiredLoanAmount?: number;
|
|
44
|
+
primaryColor?: string;
|
|
45
|
+
textColor?: string;
|
|
46
|
+
customChartOptions?: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ChartContainer = styled("div")({
|
|
50
|
+
position: "relative",
|
|
51
|
+
width: "100%",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const LineChartSize = styled("div")<{ chartHeight?: number }>(
|
|
55
|
+
({ chartHeight }) => ({
|
|
56
|
+
flex: "auto",
|
|
57
|
+
height: chartHeight || 270,
|
|
58
|
+
position: "relative",
|
|
59
|
+
width: "100%",
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const LoadingOverlay = styled("div")({
|
|
64
|
+
position: "absolute",
|
|
65
|
+
inset: 0,
|
|
66
|
+
display: "flex",
|
|
67
|
+
flexDirection: "column",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
backgroundColor: "rgba(255,255,255,0.8)",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const SECONDARY_COLOR_40 = "rgba(22, 32, 41, 0.4)";
|
|
74
|
+
const BORDER_COLOR = "#A1B9BD";
|
|
75
|
+
|
|
76
|
+
const buildChartOption = (customOptions: Record<string, any> = {}) => {
|
|
77
|
+
const defaultOptions: Record<string, any> = {
|
|
78
|
+
scales: {
|
|
79
|
+
x: {
|
|
80
|
+
grid: { display: false },
|
|
81
|
+
stacked: true,
|
|
82
|
+
ticks: {
|
|
83
|
+
maxTicksLimit: 15,
|
|
84
|
+
autoSkip: false,
|
|
85
|
+
maxRotation: 0,
|
|
86
|
+
minRotation: 0,
|
|
87
|
+
beginAtZero: false,
|
|
88
|
+
source: "auto",
|
|
89
|
+
},
|
|
90
|
+
bounds: "data",
|
|
91
|
+
type: "time",
|
|
92
|
+
time: { unit: "month" },
|
|
93
|
+
distribution: "linear",
|
|
94
|
+
},
|
|
95
|
+
y: {
|
|
96
|
+
grid: { drawOnChartArea: false },
|
|
97
|
+
display: true,
|
|
98
|
+
stacked: false,
|
|
99
|
+
position: "left",
|
|
100
|
+
ticks: {
|
|
101
|
+
beginAtZero: true,
|
|
102
|
+
display: true,
|
|
103
|
+
callback(value: any) {
|
|
104
|
+
return formatNumberWithText(Number(value), 1);
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
maintainAspectRatio: false,
|
|
110
|
+
responsive: true,
|
|
111
|
+
plugins: {
|
|
112
|
+
legend: {
|
|
113
|
+
display: true,
|
|
114
|
+
position: "top",
|
|
115
|
+
align: "end",
|
|
116
|
+
fullSize: true,
|
|
117
|
+
reverse: false,
|
|
118
|
+
labels: {
|
|
119
|
+
usePointStyle: true,
|
|
120
|
+
boxWidth: 200,
|
|
121
|
+
padding: 10,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
tooltip: {
|
|
125
|
+
enabled: true,
|
|
126
|
+
mode: "nearest",
|
|
127
|
+
intersect: false,
|
|
128
|
+
backgroundColor: "#fff",
|
|
129
|
+
titleColor: "#000",
|
|
130
|
+
bodyColor: "#000",
|
|
131
|
+
displayColors: false,
|
|
132
|
+
borderColor: "#000",
|
|
133
|
+
borderWidth: 1,
|
|
134
|
+
padding: 8,
|
|
135
|
+
cornerRadius: 4,
|
|
136
|
+
titleSpacing: 4,
|
|
137
|
+
bodySpacing: 4,
|
|
138
|
+
callbacks: {
|
|
139
|
+
title(tooltipItems: any[]) {
|
|
140
|
+
const tooltipItem = tooltipItems[0];
|
|
141
|
+
if (tooltipItem?.parsed?.x) {
|
|
142
|
+
const date = new Date(tooltipItem.parsed.x);
|
|
143
|
+
return date.toLocaleDateString("en-US", {
|
|
144
|
+
month: "short",
|
|
145
|
+
year: "numeric",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return "";
|
|
149
|
+
},
|
|
150
|
+
label(tooltipItem: any) {
|
|
151
|
+
const xLabel = tooltipItem.dataset.label;
|
|
152
|
+
const { parsed = { y: 0 } } = tooltipItem;
|
|
153
|
+
const yLabel = parsed.y;
|
|
154
|
+
const chartValueWithCommas = formatNumber(Math.abs(yLabel));
|
|
155
|
+
return `${xLabel}: ${
|
|
156
|
+
yLabel >= 0
|
|
157
|
+
? `$${chartValueWithCommas}`
|
|
158
|
+
: `-$${chartValueWithCommas}`
|
|
159
|
+
}`.trim();
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
interaction: { mode: "nearest", intersect: false },
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
return { ...defaultOptions, ...customOptions };
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const buildChartData = (
|
|
171
|
+
data: ScenarioDataPoint[],
|
|
172
|
+
secondaryData: ScenarioDataPoint[],
|
|
173
|
+
primaryColor: string,
|
|
174
|
+
borderWidth: number,
|
|
175
|
+
desiredLoanAmount: number
|
|
176
|
+
) => {
|
|
177
|
+
const desiredLoanLine = data.map((item) => ({
|
|
178
|
+
...item,
|
|
179
|
+
y: desiredLoanAmount,
|
|
180
|
+
}));
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
datasets: [
|
|
184
|
+
{
|
|
185
|
+
label: "Based on Current Expenses",
|
|
186
|
+
fill: false,
|
|
187
|
+
backgroundColor: BORDER_COLOR,
|
|
188
|
+
borderColor: "#5E6266",
|
|
189
|
+
borderCapStyle: "butt" as const,
|
|
190
|
+
borderDash: [] as number[],
|
|
191
|
+
borderDashOffset: 0.0,
|
|
192
|
+
borderJoinStyle: "miter" as const,
|
|
193
|
+
pointBackgroundColor: "#5E6266",
|
|
194
|
+
pointBorderWidth: 2,
|
|
195
|
+
pointHoverRadius: 5,
|
|
196
|
+
pointHoverBackgroundColor: "#5E6266",
|
|
197
|
+
pointHoverBorderColor: SECONDARY_COLOR_40,
|
|
198
|
+
pointHoverBorderWidth: 8,
|
|
199
|
+
borderWidth,
|
|
200
|
+
pointRadius: 0,
|
|
201
|
+
pointBorderColor: "#5E6266",
|
|
202
|
+
pointHitRadius: 3,
|
|
203
|
+
pointStyle: "line" as const,
|
|
204
|
+
tension: 0.4,
|
|
205
|
+
data,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: "Optimised Estimate",
|
|
209
|
+
fill: false,
|
|
210
|
+
backgroundColor: BORDER_COLOR,
|
|
211
|
+
borderColor: "#A1B9BD",
|
|
212
|
+
borderDash: [2, 2],
|
|
213
|
+
borderDashOffset: 0.0,
|
|
214
|
+
borderJoinStyle: "miter" as const,
|
|
215
|
+
pointBorderColor: "#A1B9BD",
|
|
216
|
+
pointBackgroundColor: "#A1B9BD",
|
|
217
|
+
pointBorderWidth: 2,
|
|
218
|
+
pointHoverRadius: 5,
|
|
219
|
+
pointHoverBackgroundColor: "#A1B9BD",
|
|
220
|
+
pointHoverBorderColor: SECONDARY_COLOR_40,
|
|
221
|
+
pointHoverBorderWidth: 8,
|
|
222
|
+
pointRadius: 0,
|
|
223
|
+
borderWidth,
|
|
224
|
+
pointHitRadius: 3,
|
|
225
|
+
data: secondaryData,
|
|
226
|
+
tension: 0.4,
|
|
227
|
+
pointStyle: "line" as const,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: "Desired Loan Amount",
|
|
231
|
+
fill: false,
|
|
232
|
+
backgroundColor: "transparent",
|
|
233
|
+
borderColor: primaryColor,
|
|
234
|
+
borderCapStyle: "butt" as const,
|
|
235
|
+
borderDash: [5, 5],
|
|
236
|
+
borderDashOffset: 0.0,
|
|
237
|
+
borderJoinStyle: "miter" as const,
|
|
238
|
+
pointBorderColor: primaryColor,
|
|
239
|
+
pointBackgroundColor: primaryColor,
|
|
240
|
+
pointBorderWidth: 2,
|
|
241
|
+
pointHoverRadius: 5,
|
|
242
|
+
pointHoverBackgroundColor: primaryColor,
|
|
243
|
+
pointHoverBorderColor: primaryColor,
|
|
244
|
+
pointHoverBorderWidth: 8,
|
|
245
|
+
borderWidth,
|
|
246
|
+
pointRadius: 0,
|
|
247
|
+
pointHitRadius: 3,
|
|
248
|
+
data: desiredLoanLine,
|
|
249
|
+
tension: 0,
|
|
250
|
+
pointStyle: "line" as const,
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const DEFAULT_DESIRED_LOAN_AMOUNT = 500000;
|
|
257
|
+
|
|
258
|
+
export const FrontendScenarioLineChart: React.FC<
|
|
259
|
+
FrontendScenarioLineChartProps
|
|
260
|
+
> = ({
|
|
261
|
+
data = [],
|
|
262
|
+
secondaryData = [],
|
|
263
|
+
isLoading = false,
|
|
264
|
+
isError = false,
|
|
265
|
+
height = 300,
|
|
266
|
+
desiredLoanAmount,
|
|
267
|
+
primaryColor = "#04f73d",
|
|
268
|
+
customChartOptions = {},
|
|
269
|
+
}) => {
|
|
270
|
+
const chartRef = useRef(null);
|
|
271
|
+
|
|
272
|
+
const chartData = useMemo(
|
|
273
|
+
() =>
|
|
274
|
+
buildChartData(
|
|
275
|
+
data,
|
|
276
|
+
secondaryData,
|
|
277
|
+
primaryColor,
|
|
278
|
+
1,
|
|
279
|
+
desiredLoanAmount ?? DEFAULT_DESIRED_LOAN_AMOUNT
|
|
280
|
+
),
|
|
281
|
+
[data, secondaryData, primaryColor, desiredLoanAmount]
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const options = useMemo(
|
|
285
|
+
() => buildChartOption(customChartOptions),
|
|
286
|
+
[customChartOptions]
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
<ChartContainer>
|
|
291
|
+
<LineChartSize chartHeight={height}>
|
|
292
|
+
<Chart
|
|
293
|
+
ref={chartRef}
|
|
294
|
+
type="line"
|
|
295
|
+
data={chartData as any}
|
|
296
|
+
options={options as any}
|
|
297
|
+
/>
|
|
298
|
+
{(isLoading || isError) && (
|
|
299
|
+
<LoadingOverlay>
|
|
300
|
+
<LoadingChartBackdrop isLoading={isLoading} isError={isError} />
|
|
301
|
+
</LoadingOverlay>
|
|
302
|
+
)}
|
|
303
|
+
</LineChartSize>
|
|
304
|
+
</ChartContainer>
|
|
305
|
+
);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
FrontendScenarioLineChart.displayName = "FrontendScenarioLineChart";
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CircularProgress } from "@mui/material";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import {
|
|
5
|
+
BarController,
|
|
6
|
+
BarElement,
|
|
7
|
+
CategoryScale,
|
|
8
|
+
Chart as ChartJS,
|
|
9
|
+
Legend,
|
|
10
|
+
LinearScale,
|
|
11
|
+
Title,
|
|
12
|
+
Tooltip,
|
|
13
|
+
} from "chart.js";
|
|
14
|
+
import { Chart } from "react-chartjs-2";
|
|
15
|
+
|
|
16
|
+
ChartJS.register(
|
|
17
|
+
CategoryScale,
|
|
18
|
+
LinearScale,
|
|
19
|
+
BarElement,
|
|
20
|
+
BarController,
|
|
21
|
+
Title,
|
|
22
|
+
Tooltip,
|
|
23
|
+
Legend
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export interface FrontendStackedChartProps {
|
|
27
|
+
datasets?: number[][];
|
|
28
|
+
labels?: string[];
|
|
29
|
+
chartTitle?: string;
|
|
30
|
+
xAxisLabels?: string[];
|
|
31
|
+
showLegend?: boolean;
|
|
32
|
+
currency?: string;
|
|
33
|
+
dataColors?: string | string[];
|
|
34
|
+
isLoading?: boolean;
|
|
35
|
+
noDataText?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const StyledContainer = styled("div")({
|
|
39
|
+
width: "100%",
|
|
40
|
+
height: "100%",
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const LoadingContainer = styled("div")({
|
|
44
|
+
width: "100%",
|
|
45
|
+
height: "100%",
|
|
46
|
+
display: "flex",
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
minHeight: 200,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const EmptyContainer = styled("div")({
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "100%",
|
|
55
|
+
display: "flex",
|
|
56
|
+
justifyContent: "center",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
color: "#A1A1A1",
|
|
59
|
+
borderBottom: "1px solid #00001A4D",
|
|
60
|
+
minHeight: 200,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const DEFAULT_COLORS = [
|
|
64
|
+
"#1976D2",
|
|
65
|
+
"#001CB0",
|
|
66
|
+
"#8979FF",
|
|
67
|
+
"#004080",
|
|
68
|
+
"#39FD99",
|
|
69
|
+
"#FFC55A",
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
export const FRONTEND_STACKED_CHART_MOCK_X_AXIS_LABELS = [
|
|
73
|
+
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
|
74
|
+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export const FRONTEND_STACKED_CHART_MOCK_LABELS = [
|
|
78
|
+
"Recreation & Entertainment",
|
|
79
|
+
"Transport",
|
|
80
|
+
"Primary Residence Costs",
|
|
81
|
+
"Telephone, Internet, Pay TV & Media Streaming Subscriptions",
|
|
82
|
+
"Groceries",
|
|
83
|
+
"Other Regular and Recurring Expenses",
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
export const FRONTEND_STACKED_CHART_MOCK_DATA = FRONTEND_STACKED_CHART_MOCK_LABELS.map(
|
|
87
|
+
() => FRONTEND_STACKED_CHART_MOCK_X_AXIS_LABELS.map(() => Math.floor(Math.random() * 10000))
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export const FRONTEND_STACKED_CHART_MOCK_COLORS = DEFAULT_COLORS;
|
|
91
|
+
|
|
92
|
+
export const FrontendStackedChart: React.FC<FrontendStackedChartProps> = ({
|
|
93
|
+
datasets = FRONTEND_STACKED_CHART_MOCK_DATA,
|
|
94
|
+
labels = FRONTEND_STACKED_CHART_MOCK_LABELS,
|
|
95
|
+
chartTitle,
|
|
96
|
+
xAxisLabels = FRONTEND_STACKED_CHART_MOCK_X_AXIS_LABELS,
|
|
97
|
+
showLegend = false,
|
|
98
|
+
currency = "$",
|
|
99
|
+
dataColors = FRONTEND_STACKED_CHART_MOCK_COLORS,
|
|
100
|
+
isLoading = false,
|
|
101
|
+
noDataText = "No data",
|
|
102
|
+
}) => {
|
|
103
|
+
if (isLoading) {
|
|
104
|
+
return (
|
|
105
|
+
<StyledContainer>
|
|
106
|
+
<LoadingContainer>
|
|
107
|
+
<CircularProgress />
|
|
108
|
+
</LoadingContainer>
|
|
109
|
+
</StyledContainer>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
!datasets?.length ||
|
|
115
|
+
!labels?.length ||
|
|
116
|
+
!xAxisLabels?.length
|
|
117
|
+
) {
|
|
118
|
+
return (
|
|
119
|
+
<StyledContainer>
|
|
120
|
+
<EmptyContainer>{noDataText}</EmptyContainer>
|
|
121
|
+
</StyledContainer>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const resolvedColors =
|
|
126
|
+
!dataColors || (typeof dataColors !== "string" && dataColors.length === 0)
|
|
127
|
+
? DEFAULT_COLORS.slice(0, 2)
|
|
128
|
+
: dataColors;
|
|
129
|
+
|
|
130
|
+
const options = {
|
|
131
|
+
plugins: {
|
|
132
|
+
title: { display: !!chartTitle, text: chartTitle },
|
|
133
|
+
legend: { display: showLegend },
|
|
134
|
+
tooltip: {
|
|
135
|
+
callbacks: {
|
|
136
|
+
label(tooltipItem: any) {
|
|
137
|
+
let label = tooltipItem.dataset.label || "";
|
|
138
|
+
if (label) label += ": ";
|
|
139
|
+
label += currency
|
|
140
|
+
? currency + tooltipItem.parsed.y
|
|
141
|
+
: tooltipItem.parsed.y;
|
|
142
|
+
return label;
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
maintainAspectRatio: false,
|
|
148
|
+
responsive: true,
|
|
149
|
+
scales: {
|
|
150
|
+
x: {
|
|
151
|
+
stacked: true,
|
|
152
|
+
display: true,
|
|
153
|
+
grid: { display: true, drawOnChartArea: false, drawTicks: false },
|
|
154
|
+
ticks: { display: true, padding: 8, font: { size: 11 } },
|
|
155
|
+
},
|
|
156
|
+
y: {
|
|
157
|
+
stacked: true,
|
|
158
|
+
display: true,
|
|
159
|
+
grid: { display: false },
|
|
160
|
+
ticks: { display: true, maxTicksLimit: 4 },
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const chartData = {
|
|
166
|
+
labels: xAxisLabels,
|
|
167
|
+
datasets: labels.map((label, index) => {
|
|
168
|
+
const color =
|
|
169
|
+
typeof resolvedColors === "string" ? resolvedColors : resolvedColors[index];
|
|
170
|
+
return {
|
|
171
|
+
label,
|
|
172
|
+
data: datasets[index],
|
|
173
|
+
backgroundColor: color,
|
|
174
|
+
borderColor: "#fff",
|
|
175
|
+
borderWidth: typeof resolvedColors === "string" ? 0 : 1,
|
|
176
|
+
barPercentage: 0.5,
|
|
177
|
+
};
|
|
178
|
+
}),
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
return <Chart type="bar" options={options} data={chartData} />;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
FrontendStackedChart.displayName = "FrontendStackedChart";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CircularProgress } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
export interface LoadingChartBackdropProps {
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const LoadingChartBackdrop: React.FC<LoadingChartBackdropProps> = ({
|
|
10
|
+
isLoading,
|
|
11
|
+
isError,
|
|
12
|
+
}) => {
|
|
13
|
+
if (isError) {
|
|
14
|
+
return (
|
|
15
|
+
<span>
|
|
16
|
+
Oops! Something went wrong. Chart data has been lost. Please try again
|
|
17
|
+
after a few minutes.
|
|
18
|
+
</span>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
if (isLoading) {
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<CircularProgress color="inherit" size={24} />
|
|
25
|
+
<span>Loading chart data...</span>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
LoadingChartBackdrop.displayName = "LoadingChartBackdrop";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FOUNDATION_COLORS, FONT_FAMILY_SANS } from "../theme";
|
|
2
|
+
|
|
3
|
+
export const tooltipsBaseOption = {
|
|
4
|
+
enabled: true,
|
|
5
|
+
mode: "nearest" as const,
|
|
6
|
+
intersect: false,
|
|
7
|
+
backgroundColor: FOUNDATION_COLORS.background.primary,
|
|
8
|
+
titleColor: FOUNDATION_COLORS.text.primary,
|
|
9
|
+
bodyColor: FOUNDATION_COLORS.text.primary,
|
|
10
|
+
displayColors: false,
|
|
11
|
+
borderColor: FOUNDATION_COLORS.text.primary,
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
titleFont: {
|
|
14
|
+
family: FONT_FAMILY_SANS,
|
|
15
|
+
style: "normal" as const,
|
|
16
|
+
size: 14,
|
|
17
|
+
},
|
|
18
|
+
bodyFont: {
|
|
19
|
+
family: FONT_FAMILY_SANS,
|
|
20
|
+
style: "normal" as const,
|
|
21
|
+
weight: "bold" as const,
|
|
22
|
+
size: 13,
|
|
23
|
+
},
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
export const buildChartDataFromObject = (
|
|
27
|
+
chartDataObject: Record<string, number> = {},
|
|
28
|
+
) => {
|
|
29
|
+
return Object.keys(chartDataObject).map((key) => ({
|
|
30
|
+
x: key,
|
|
31
|
+
y: chartDataObject[key],
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const formatNumber = (value: number): string => {
|
|
36
|
+
return value.toLocaleString("en-US");
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const formatNumberWithText = (
|
|
40
|
+
value: number,
|
|
41
|
+
precision: number = 1,
|
|
42
|
+
): string => {
|
|
43
|
+
if (Math.abs(value) >= 1_000_000) {
|
|
44
|
+
return `$${(value / 1_000_000).toFixed(precision)}M`;
|
|
45
|
+
}
|
|
46
|
+
if (Math.abs(value) >= 1_000) {
|
|
47
|
+
return `$${(value / 1_000).toFixed(precision)}K`;
|
|
48
|
+
}
|
|
49
|
+
return `$${value.toFixed(0)}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const formatNumberWithDollar = (value: number): string => {
|
|
53
|
+
return `$${formatNumber(value)}`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const convertToFloat = (value: number, precision: number): string => {
|
|
57
|
+
return parseFloat(value.toFixed(precision)).toString();
|
|
58
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export { tooltipsBaseOption, buildChartDataFromObject, formatNumber, formatNumberWithText, formatNumberWithDollar, convertToFloat } from "./chart-utils";
|
|
2
|
+
|
|
3
|
+
export { LoadingChartBackdrop } from "./LoadingChartBackdrop";
|
|
4
|
+
export type { LoadingChartBackdropProps } from "./LoadingChartBackdrop";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
BackofficeSwitchableChart,
|
|
8
|
+
getChartOptions,
|
|
9
|
+
} from "./BackofficeSwitchableChart";
|
|
10
|
+
export type { BackofficeSwitchableChartProps, ChartType } from "./BackofficeSwitchableChart";
|
|
11
|
+
|
|
12
|
+
export { FrontendLineChart } from "./FrontendLineChart";
|
|
13
|
+
export type { FrontendLineChartProps, LineChartDataset, LineChartDataItem } from "./FrontendLineChart";
|
|
14
|
+
|
|
15
|
+
export { FrontendLineChartMobile } from "./FrontendLineChartMobile";
|
|
16
|
+
export type { FrontendLineChartMobileProps, MobileLineChartDataset, MobileLineChartDataItem } from "./FrontendLineChartMobile";
|
|
17
|
+
|
|
18
|
+
export { FrontendBarChart } from "./FrontendBarChart";
|
|
19
|
+
export type { FrontendBarChartProps, FrontendBarChartData, BarChartDataset } from "./FrontendBarChart";
|
|
20
|
+
|
|
21
|
+
export { FrontendDoughnutChart } from "./FrontendDoughnutChart";
|
|
22
|
+
export type { FrontendDoughnutChartProps, DoughnutChartDataItem } from "./FrontendDoughnutChart";
|
|
23
|
+
|
|
24
|
+
export { FrontendMixedChart } from "./FrontendMixedChart";
|
|
25
|
+
export type { FrontendMixedChartProps, MixedChartDataset } from "./FrontendMixedChart";
|
|
26
|
+
|
|
27
|
+
export { FrontendStackedChart } from "./FrontendStackedChart";
|
|
28
|
+
export type { FrontendStackedChartProps } from "./FrontendStackedChart";
|
|
29
|
+
export {
|
|
30
|
+
FRONTEND_STACKED_CHART_MOCK_X_AXIS_LABELS,
|
|
31
|
+
FRONTEND_STACKED_CHART_MOCK_LABELS,
|
|
32
|
+
FRONTEND_STACKED_CHART_MOCK_DATA,
|
|
33
|
+
FRONTEND_STACKED_CHART_MOCK_COLORS,
|
|
34
|
+
} from "./FrontendStackedChart";
|
|
35
|
+
|
|
36
|
+
export { FrontendIncomeExpenseHorizontalBarChart } from "./FrontendIncomeExpenseHorizontalBarChart";
|
|
37
|
+
export type { FrontendIncomeExpenseHorizontalBarChartProps } from "./FrontendIncomeExpenseHorizontalBarChart";
|
|
38
|
+
|
|
39
|
+
export { FrontendPercentageBar } from "./FrontendPercentageBar";
|
|
40
|
+
export type { FrontendPercentageBarProps, PercentageBarPart } from "./FrontendPercentageBar";
|
|
41
|
+
|
|
42
|
+
export { FrontendLiabilitiesChart } from "./FrontendLiabilitiesChart";
|
|
43
|
+
export type { FrontendLiabilitiesChartProps, LiabilitiesPart } from "./FrontendLiabilitiesChart";
|
|
44
|
+
|
|
45
|
+
export { FrontendScenarioLineChart } from "./FrontendScenarioLineChart";
|
|
46
|
+
export type { FrontendScenarioLineChartProps, ScenarioDataPoint } from "./FrontendScenarioLineChart";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
mockLineChartData,
|
|
50
|
+
mockBarChartData,
|
|
51
|
+
mockDoughnutData,
|
|
52
|
+
mockMixedChartDatasets,
|
|
53
|
+
mockPercentageBarParts,
|
|
54
|
+
mockPercentageBarColors,
|
|
55
|
+
mockLiabilitiesParts,
|
|
56
|
+
mockScenarioData,
|
|
57
|
+
mockScenarioSecondaryData,
|
|
58
|
+
mockMobileLineChartData,
|
|
59
|
+
} from "./mock-data";
|