@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.bb4

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 (219) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
  3. package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
  4. package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
  6. package/dist/AccountListItem-wgmlex-_.mjs +90 -0
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Jv8h9H9l.mjs} +33 -33
  12. package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
  13. package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
  14. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
  15. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
  16. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
  17. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
  18. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
  19. package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
  20. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  21. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
  22. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
  23. package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
  24. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  25. package/dist/Drawer-BF40nbsH.mjs +163 -0
  26. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  27. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
  28. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  29. package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
  30. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
  31. package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
  32. package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
  33. package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
  34. package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
  35. package/dist/LineChart-C1PxNf7P.mjs +581 -0
  36. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
  37. package/dist/Loader-Ckqi9Rx6.mjs +21 -0
  38. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
  39. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  40. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
  41. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
  42. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
  43. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
  44. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  45. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  46. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
  47. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
  48. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
  49. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
  50. package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
  51. package/dist/SearchBox-B7km148n.mjs +39 -0
  52. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
  53. package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
  54. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  55. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
  56. package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
  57. package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
  58. package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
  59. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  60. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  61. package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
  62. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
  63. package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
  64. package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
  65. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
  66. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
  67. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  68. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  69. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  70. package/dist/accounts/index.es.js +228 -221
  71. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  72. package/dist/analytics/index.es.js +27 -27
  73. package/dist/budgets/index.es.js +459 -462
  74. package/dist/cashflow/index.es.js +419 -428
  75. package/dist/categories/index.es.js +2 -2
  76. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  77. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  78. package/dist/common/components/Loader.d.ts +1 -2
  79. package/dist/common/components/Select.d.ts +4 -2
  80. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  81. package/dist/common/components/charts/LineChart.d.ts +12 -2
  82. package/dist/common/components/charts/index.d.ts +0 -3
  83. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  84. package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
  85. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  86. package/dist/common/components/drawer/Footer.d.ts +17 -0
  87. package/dist/common/components/index.d.ts +0 -1
  88. package/dist/common/hooks/index.d.ts +0 -1
  89. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  90. package/dist/common/index.es.js +402 -668
  91. package/dist/common/stores/GlobalStore.d.ts +7 -1
  92. package/dist/common/types/Finstrong.d.ts +54 -0
  93. package/dist/common/types/Global.d.ts +1 -0
  94. package/dist/common/types/Widgets.d.ts +1 -0
  95. package/dist/common/types/index.d.ts +1 -1
  96. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  97. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  98. package/dist/common/utils/Theme.d.ts +1 -3
  99. package/dist/dashboard/index.es.js +21 -21
  100. package/dist/debts/components/DebtsChart.d.ts +1 -2
  101. package/dist/debts/index.es.js +673 -665
  102. package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
  103. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  104. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  105. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  106. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  107. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  108. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  109. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  110. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  111. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  112. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  113. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  114. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  115. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  116. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  117. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  118. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  119. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  120. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  121. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  122. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  123. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  124. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  125. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  126. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  127. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  128. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  129. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  130. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  131. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  132. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  133. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  134. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  135. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  136. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  137. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  138. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  139. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  140. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  141. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  142. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  143. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  144. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  145. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  146. package/dist/finstrong/constants/index.d.ts +9 -0
  147. package/dist/finstrong/index.es.js +3175 -1067
  148. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  149. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  150. package/dist/goals/index.es.js +580 -570
  151. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  152. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  153. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  154. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  155. package/dist/help/index.es.js +6 -6
  156. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  157. package/dist/insights/index.es.js +1 -1
  158. package/dist/investments/index.es.js +537 -536
  159. package/dist/merchants/index.es.js +9 -9
  160. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  161. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  162. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  163. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  164. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  165. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  166. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  167. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  168. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  169. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  170. package/dist/microinsights/constants/App.d.ts +0 -1
  171. package/dist/microinsights/index.d.ts +3 -3
  172. package/dist/microinsights/index.es.js +7 -7
  173. package/dist/microinsights/interfaces.d.ts +0 -6
  174. package/dist/networth/components/NetWorthChange.d.ts +3 -1
  175. package/dist/networth/index.es.js +262 -254
  176. package/dist/notifications/index.es.js +90 -91
  177. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  178. package/dist/recurringtransactions/index.es.js +586 -562
  179. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  180. package/dist/settings/index.es.js +371 -365
  181. package/dist/spending/index.es.js +267 -419
  182. package/dist/spending/utils/SpendingData.d.ts +2 -1
  183. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  184. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  185. package/dist/transactions/index.es.js +231 -226
  186. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  187. package/dist/transactions/stores/UiStore.d.ts +0 -2
  188. package/dist/trends/index.es.js +988 -612
  189. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
  190. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
  191. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  192. package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
  193. package/package.json +51 -56
  194. package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
  195. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  196. package/dist/AccountListItem-JFMZROh7.mjs +0 -90
  197. package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
  198. package/dist/Drawer-kEE73B87.mjs +0 -113
  199. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  200. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  201. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  202. package/dist/Loader-DUaFpDGv.mjs +0 -24
  203. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  204. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  205. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  206. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  207. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  208. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  209. package/dist/common/components/barchart/Bar.d.ts +0 -25
  210. package/dist/common/components/barchart/BarChart.d.ts +0 -34
  211. package/dist/common/components/barchart/BarColumn.d.ts +0 -37
  212. package/dist/common/components/barchart/Legend.d.ts +0 -8
  213. package/dist/common/components/barchart/Util.d.ts +0 -42
  214. package/dist/common/components/barchart/index.d.ts +0 -1
  215. package/dist/common/hooks/usePrevious.d.ts +0 -2
  216. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  217. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  218. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
  219. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,559 +0,0 @@
1
- import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import M, { useRef as Ct, useState as bt, useEffect as vt } from "react";
3
- import L from "@mui/material/Box";
4
- import T from "@mui/material/Stack";
5
- import { useTheme as J } from "@mui/material/styles";
6
- import { LineChart as St } from "@mui/x-charts";
7
- import { u as K } from "./useScreenSize-B6JyS_Lj.mjs";
8
- import { u as _t } from "./useDimensions-27p2evRx.mjs";
9
- import { observer as Mt } from "mobx-react-lite";
10
- import Tt from "@mui/material/Card";
11
- import Dt from "@mui/material/CardContent";
12
- import P from "@mui/material/Divider";
13
- import X from "@mui/material/Grid";
14
- import { CategoryIcon as At, Text as S } from "@mxenabled/mxui";
15
- import { u as Lt, m as Q } from "./hooks-D6XlXHf4.mjs";
16
- import { b as Rt } from "./Localization-2MODESHW.mjs";
17
- import { C as O } from "./CurrencyText-kyC1aseI.mjs";
18
- import { useTheme as wt, Card as Ht, CardContent as It, Box as kt } from "@mui/material";
19
- import { f as R, D as w } from "./Dialog-CWW597AF.mjs";
20
- import Et from "@mui/material/Button";
21
- import { C as A, b as Gt, c as Nt } from "./Category-CevNQ03n.mjs";
22
- import { f as V } from "./NumberFormatting-Buh7u8Oi.mjs";
23
- import Bt from "@mui/material/ListItem";
24
- import Ot from "@mui/material/ListItemButton";
25
- import z from "@mui/material/ListItemIcon";
26
- import $t from "@mui/material/ListItemText";
27
- import { makeAutoObservable as Wt } from "mobx";
28
- import { addSeconds as jt } from "date-fns/addSeconds";
29
- import { differenceInCalendarMonths as Ft } from "date-fns/differenceInCalendarMonths";
30
- import { endOfMonth as q } from "date-fns/endOfMonth";
31
- import { subMonths as Yt } from "date-fns/subMonths";
32
- const U = ({ categoryGuid: r, topLevelCategoryGuid: e }) => {
33
- const { categories: o } = Lt(), { getCategoryName: a } = Q(), n = a(r);
34
- return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
35
- /* @__PURE__ */ s(
36
- L,
37
- {
38
- "aria-label": Rt(o.category_icon_label_aria, n),
39
- mb: 4,
40
- role: "img",
41
- children: /* @__PURE__ */ s(At, { categoryGuid: e })
42
- }
43
- ),
44
- /* @__PURE__ */ s(S, { variant: "Body", children: n })
45
- ] });
46
- }, Pt = ({
47
- categoryGuids: { guid: r, topLevelGuid: e },
48
- hoveredAreaData: o,
49
- cursorPosition: a,
50
- chartContainerRef: n
51
- }) => {
52
- const i = J(), l = Ct(null), [h, g] = bt({ x: a.x, y: a.y });
53
- if (vt(() => {
54
- (() => {
55
- const u = l.current, x = n.current;
56
- if (!u || !x) return;
57
- const y = u.getBoundingClientRect(), b = x.getBoundingClientRect();
58
- let p = a.x, v = a.y;
59
- p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), g({ x: p, y: v });
60
- })();
61
- }, [a, n]), !o) return null;
62
- const C = o.reduce((d, u) => d + u.y, 0);
63
- return /* @__PURE__ */ s(
64
- Tt,
65
- {
66
- ref: l,
67
- sx: {
68
- position: "absolute",
69
- top: h.y,
70
- left: h.x,
71
- width: 250,
72
- pointerEvents: "none"
73
- },
74
- children: /* @__PURE__ */ f(Dt, { children: [
75
- /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
76
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
77
- /* @__PURE__ */ s(S, { variant: "Small", children: `${o.length}-month total` }),
78
- /* @__PURE__ */ s(O, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
79
- ] }),
80
- /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
81
- /* @__PURE__ */ s(X, { container: !0, children: o.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
82
- u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
83
- /* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
84
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
85
- /* @__PURE__ */ s(
86
- O,
87
- {
88
- amount: d.y,
89
- bold: !0,
90
- formatString: "0,0",
91
- variant: "Body"
92
- }
93
- )
94
- ] }) })
95
- ] }, u)) })
96
- ] })
97
- }
98
- );
99
- }, Xt = Mt(Pt), Vt = ({
100
- categoryGuids: { guid: r, topLevelGuid: e },
101
- itemData: { dataIndex: o },
102
- series: a,
103
- xData: n
104
- }) => {
105
- const i = wt(), l = a.data[o], h = n[o];
106
- return l === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(It, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
107
- /* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
108
- /* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, w.MONTH_SHORT_YEAR) }),
109
- /* @__PURE__ */ s(O, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
110
- ] }) }) });
111
- }, zt = ({
112
- sx: r,
113
- categoryGuids: e,
114
- hoveredLegend: o,
115
- legendRef: a,
116
- onHoverLegend: n,
117
- onClickLegend: i
118
- }) => {
119
- const { isMobile: l } = K(), { getCategoryName: h } = Q();
120
- return /* @__PURE__ */ s(
121
- T,
122
- {
123
- direction: "row",
124
- flexWrap: "wrap",
125
- gap: l ? 2 : 6,
126
- justifyContent: "start",
127
- ref: a,
128
- sx: r,
129
- children: e.map(({ guid: g, top_level_guid: C }) => {
130
- const d = o === g, u = A[g], x = A[C], y = u ?? x ?? A.default, b = y + "33";
131
- return /* @__PURE__ */ f(
132
- Et,
133
- {
134
- onClick: () => i(g),
135
- onMouseEnter: () => n(g),
136
- onMouseLeave: () => n(null),
137
- sx: {
138
- color: "text.primary",
139
- fontWeight: "normal",
140
- display: "flex",
141
- justifyContent: "center",
142
- alignItems: "center",
143
- paddingX: 8,
144
- paddingY: 4,
145
- borderRadius: 1,
146
- opacity: d ? 1 : 0.7
147
- },
148
- children: [
149
- /* @__PURE__ */ s(
150
- L,
151
- {
152
- sx: {
153
- width: 16,
154
- height: 16,
155
- marginRight: l ? 5 : 10,
156
- borderRadius: "2px",
157
- backgroundColor: o ? d ? y : b : y
158
- }
159
- }
160
- ),
161
- /* @__PURE__ */ s(S, { variant: "Body", children: h(g) })
162
- ]
163
- },
164
- g
165
- );
166
- })
167
- }
168
- );
169
- }, Ie = ({
170
- onHoverArea: r,
171
- onHoverPoint: e,
172
- onHoverLegend: o,
173
- onClickLegend: a,
174
- stackedDatasets: n,
175
- unstackedDatasets: i = [],
176
- availableHeight: l = 0,
177
- minimumHeight: h = 350
178
- }) => {
179
- const g = J(), { isMobile: C } = K(), [d, { height: u }] = _t(), x = M.useRef(null), [y, b] = M.useState(0);
180
- M.useEffect(() => {
181
- const t = Math.max(l - u, h);
182
- b(t);
183
- }, [l, u]);
184
- const [p, v] = M.useState(null), [Z, H] = M.useState({
185
- hoveredSeriesId: null,
186
- hoveredAreaData: null,
187
- isAreaHovered: !1,
188
- cursorPos: { x: 0, y: 0 }
189
- }), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: tt, cursorPos: I } = Z, W = tt && D && $, j = !W, G = [...n, ...i], et = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((c) => c.x)), ot = G.flatMap((t) => t.dataset.map((c) => c.y)), rt = n[0]?.dataset?.map(
190
- (t, c) => n.reduce((m, _) => m + _.dataset[c]?.y || 0, 0)
191
- ) ?? [0], at = Math.max(...rt), nt = Math.max(
192
- ...i.flatMap((t) => t.dataset.map((c) => c.y))
193
- ), st = Math.floor(Math.min(...ot) / 100) * 100, it = Math.ceil(Math.max(at, nt) / 100) * 100, k = n.map((t, c) => ({
194
- id: `stacked-${c}`,
195
- guid: t.category_guid,
196
- top_level_guid: t.top_level_category_guid,
197
- area: !0,
198
- color: n[c].category_color ?? g.palette.primary.main,
199
- data: t.dataset.map((m) => m.y),
200
- label: n[c].category_name,
201
- stack: "total",
202
- type: "line",
203
- highlightScope: { highlight: "item" },
204
- valueFormatter: (m) => V(m, "0,0")
205
- })), F = i.map((t, c) => ({
206
- id: `unstacked-${c}`,
207
- guid: t.category_guid,
208
- top_level_guid: t.top_level_category_guid,
209
- area: !1,
210
- color: t.category_color,
211
- data: t.dataset.map((m) => m.y),
212
- label: t.category_name,
213
- type: "line",
214
- valueFormatter: (m) => V(m, "0,0")
215
- })), Y = [...k, ...F], ct = [
216
- ...k.map(({ guid: t, top_level_guid: c }) => ({
217
- guid: t,
218
- top_level_guid: c
219
- })),
220
- ...F.map(({ guid: t, top_level_guid: c }) => ({
221
- guid: t,
222
- top_level_guid: c
223
- }))
224
- ], E = (t) => {
225
- const m = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
226
- return {
227
- guid: m?.category_guid,
228
- topLevelGuid: m?.top_level_category_guid
229
- };
230
- }, lt = (t) => {
231
- v(t), o?.(t ?? "");
232
- }, dt = (t) => {
233
- a?.(t ?? "");
234
- }, ut = () => {
235
- const t = E(String(D)).guid;
236
- t && a?.(t);
237
- }, mt = (t) => {
238
- const c = String(t?.seriesId), m = E(c).guid, _ = Y.find((B) => B.id === c), pt = _ && t?.dataIndex !== void 0, yt = _ && t?.dataIndex === void 0;
239
- if (pt)
240
- H({
241
- hoveredSeriesId: c,
242
- hoveredAreaData: null,
243
- isAreaHovered: !1,
244
- cursorPos: I
245
- }), e?.(m);
246
- else if (yt) {
247
- const B = _?.data.map((ft, xt) => ({
248
- x: N[xt],
249
- y: ft
250
- })) ?? [];
251
- H({
252
- hoveredSeriesId: c,
253
- hoveredAreaData: B,
254
- isAreaHovered: !0,
255
- cursorPos: I
256
- }), r?.(m);
257
- } else
258
- H({
259
- hoveredSeriesId: null,
260
- hoveredAreaData: null,
261
- isAreaHovered: !1,
262
- cursorPos: I
263
- });
264
- }, gt = (t) => {
265
- const c = t.currentTarget.getBoundingClientRect();
266
- H((m) => ({
267
- ...m,
268
- cursorPos: {
269
- x: t.clientX - c.left,
270
- y: t.clientY - c.top
271
- }
272
- }));
273
- }, ht = {
274
- p: 4,
275
- "& .MuiBarLabel-root": {
276
- fontSize: 10,
277
- fontWeight: 600
278
- },
279
- "& .MuiAreaElement-root": {
280
- opacity: 0.4,
281
- transition: "opacity 0.3s ease"
282
- },
283
- "& .MuiAreaElement-root:hover": {
284
- opacity: 1
285
- },
286
- '& [class*="MuiLineElement-series-unstacked-"]': {
287
- strokeWidth: 3
288
- },
289
- ...p && k.reduce((t, c, m) => {
290
- const _ = `.MuiAreaElement-series-stacked-${m}`;
291
- return t[_] = {
292
- opacity: k[m].guid === p ? 0.9 : 0.2
293
- }, t;
294
- }, {})
295
- };
296
- return /* @__PURE__ */ s(
297
- L,
298
- {
299
- onMouseMove: gt,
300
- ref: x,
301
- sx: {
302
- position: "relative",
303
- touchAction: "pan-y",
304
- "& svg": {
305
- touchAction: "pan-y",
306
- userSelect: "none"
307
- },
308
- "& .recharts-wrapper": {
309
- touchAction: "pan-y"
310
- }
311
- },
312
- children: /* @__PURE__ */ f(
313
- T,
314
- {
315
- direction: { xs: "column", md: "column" },
316
- spacing: { xs: 0, md: 4 },
317
- sx: { width: "100%", position: "relative" },
318
- children: [
319
- /* @__PURE__ */ s(
320
- St,
321
- {
322
- height: y,
323
- margin: { bottom: 50 },
324
- onAreaClick: ut,
325
- onHighlightChange: mt,
326
- series: Y,
327
- skipAnimation: !0,
328
- slotProps: {
329
- legend: {
330
- hidden: !0
331
- }
332
- },
333
- slots: {
334
- itemContent: (t) => j && D ? /* @__PURE__ */ s(
335
- Vt,
336
- {
337
- categoryGuids: E(D),
338
- xData: N,
339
- ...t
340
- }
341
- ) : null
342
- },
343
- sx: ht,
344
- tooltip: {
345
- trigger: j ? "item" : "none"
346
- },
347
- xAxis: [
348
- {
349
- data: N,
350
- scaleType: "time",
351
- valueFormatter: (t) => R(t, w.MONTH_SHORT_YEAR),
352
- tickNumber: et
353
- // How many ticks to show on the x-axis
354
- }
355
- ],
356
- yAxis: [
357
- {
358
- min: st,
359
- max: it || 100
360
- }
361
- ]
362
- }
363
- ),
364
- /* @__PURE__ */ s(
365
- zt,
366
- {
367
- categoryGuids: ct,
368
- hoveredLegend: p,
369
- legendRef: d,
370
- onClickLegend: dt,
371
- onHoverLegend: lt,
372
- sx: { px: C ? 0 : 24 }
373
- }
374
- ),
375
- W && /* @__PURE__ */ s(
376
- Xt,
377
- {
378
- categoryGuids: E(D),
379
- chartContainerRef: x,
380
- cursorPosition: I,
381
- hoveredAreaData: $.map((t) => ({
382
- ...t,
383
- x: R(t.x, w.MONTH_SHORT_YEAR)
384
- }))
385
- }
386
- )
387
- ]
388
- }
389
- )
390
- }
391
- );
392
- }, ke = ({
393
- onClick: r,
394
- leftIcon: e,
395
- rightIcon: o,
396
- title: a,
397
- subtitle: n,
398
- rightContent: i,
399
- titleBold: l = !0,
400
- rightContentBold: h = !0
401
- }) => {
402
- const g = /* @__PURE__ */ f(M.Fragment, { children: [
403
- e && /* @__PURE__ */ s(z, { sx: { ml: 0 }, children: e }),
404
- /* @__PURE__ */ s($t, { children: /* @__PURE__ */ f(
405
- T,
406
- {
407
- sx: {
408
- alignItems: "center",
409
- flexDirection: "row",
410
- marginLeft: 12
411
- },
412
- children: [
413
- /* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
414
- /* @__PURE__ */ s(S, { bold: l, variant: "body1", children: a }),
415
- n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
416
- ] }),
417
- /* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
418
- i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
419
- o && /* @__PURE__ */ s(z, { children: o })
420
- ] })
421
- ]
422
- }
423
- ) })
424
- ] });
425
- return /* @__PURE__ */ s(Bt, { sx: { bgcolor: "background.paper" }, children: r ? /* @__PURE__ */ s(
426
- Ot,
427
- {
428
- onClick: r,
429
- sx: {
430
- py: 14
431
- },
432
- children: g
433
- }
434
- ) : /* @__PURE__ */ s(
435
- T,
436
- {
437
- sx: {
438
- py: 14,
439
- px: 24,
440
- width: "100%",
441
- flexDirection: "row",
442
- alignItems: "center"
443
- },
444
- children: g
445
- }
446
- ) });
447
- }, qt = (r) => A[r] ?? A.default, Jt = (r) => Nt[r];
448
- function Kt(r, e) {
449
- const o = [], a = new Date(r);
450
- for (; a <= e; ) {
451
- const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
452
- o.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
453
- }
454
- return o;
455
- }
456
- const Qt = (r) => r.reduce((o, a) => {
457
- const n = {
458
- top_level_category_guid: a.top_level_category_guid,
459
- category_guid: a.category_guid,
460
- amount: a.total,
461
- year_month: a.year_month
462
- }, { top_level_category_guid: i, category_guid: l } = n;
463
- return o[l] || (o[l] = []), o[l].push(n), i !== l && (o[i] || (o[i] = []), o[i].push(n)), o;
464
- }, {}), Ee = (r, e, o) => {
465
- const a = Qt(r), n = Kt(e, o);
466
- return Object.entries(a).map(([l, h]) => {
467
- const g = h[0].top_level_category_guid, C = n.map((d) => {
468
- const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
469
- return { x: new Date(x, y - 1), y: u };
470
- }).sort((d, u) => d.x.getTime() - u.x.getTime());
471
- return {
472
- top_level_category_guid: g,
473
- category_guid: l,
474
- category_name: Jt(l),
475
- category_color: qt(g),
476
- dataset: C
477
- };
478
- });
479
- }, Ge = (r, e) => {
480
- const o = typeof r == "string" ? parseFloat(r.replace(/[^0-9.-]+/g, "")) : r, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
481
- return (o || 0) - (a || 0);
482
- }, Ut = (r, e) => {
483
- const o = r.subCategories.filter((i) => i.currentAmount !== 0), a = r.totalMonthlyAmounts.slice(-e), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
484
- return a.map((i) => {
485
- const l = n(i.label), h = o.map((d) => {
486
- const u = d.monthlyAmounts.slice(-e).find((x) => n(x.label) === l);
487
- return {
488
- label: d.name,
489
- amount: Math.abs(u?.amount || 0),
490
- header: l
491
- };
492
- }), g = r.monthlyAmounts.slice(-e).find((d) => n(d.label) === l);
493
- return [{
494
- label: r.name,
495
- amount: Math.abs(g?.amount || 0),
496
- header: l
497
- }, ...h].sort((d, u) => u.amount - d.amount);
498
- });
499
- }, Zt = (r, e) => {
500
- const o = r ? r.totalMonthlyAmounts.slice(-e).map((n) => ({
501
- x: n.label.substring(0, 3),
502
- y: Math.abs(n.amount)
503
- })) : [], a = r ? Ut(r, e) : [];
504
- return { monthlyAmounts: o, tooltipLabels: a };
505
- }, te = (r) => r.slice().filter(
506
- (e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Gt.INVESTMENTS
507
- ).sort((e, o) => Math.abs(o.totalAmount) - Math.abs(e.totalAmount));
508
- class Ne {
509
- globalStore;
510
- selectedCategoryData = null;
511
- selectedDateRange;
512
- visibleListLength = 5;
513
- constructor(e) {
514
- this.globalStore = e, this.selectedDateRange = {
515
- start: jt(q(Yt(/* @__PURE__ */ new Date(), 6)), 1),
516
- end: q(/* @__PURE__ */ new Date())
517
- }, Wt(this);
518
- }
519
- setSelectedCategoryData = (e) => {
520
- this.selectedCategoryData = e;
521
- };
522
- setSelectedDateRange = (e) => {
523
- this.selectedDateRange = e;
524
- };
525
- setVisibleListLength = (e) => {
526
- this.visibleListLength = e;
527
- };
528
- get sortedDetailedCategoriesWithTransactions() {
529
- return te(
530
- this.globalStore.categoryStore.detailedCategoriesWithTransactions
531
- );
532
- }
533
- get selectedDateRangeMonthCount() {
534
- return Ft(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
535
- }
536
- get selectedDateRangeMonthRange() {
537
- const e = R(this.selectedDateRange.start, w.MONTH_LONG), o = R(this.selectedDateRange.end, w.MONTH_LONG);
538
- return `${e} - ${o}`;
539
- }
540
- get visibleCategories() {
541
- return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
542
- }
543
- get collapsedCategories() {
544
- return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
545
- }
546
- get categoryDetailsChartData() {
547
- return Zt(
548
- this.selectedCategoryData,
549
- this.selectedDateRangeMonthCount
550
- );
551
- }
552
- }
553
- export {
554
- ke as L,
555
- Ie as S,
556
- Ne as T,
557
- Ge as a,
558
- Ee as g
559
- };
@@ -1,25 +0,0 @@
1
- import { default as React } from 'react';
2
- interface BarProps {
3
- ariaLabel?: string;
4
- color: string;
5
- height: number;
6
- index: number;
7
- label: string;
8
- onClick?: (index: number) => void;
9
- selectedIndex?: number;
10
- value: number;
11
- }
12
- /**
13
- * The Bar component is what displays the colored (optionally clickable) bar
14
- *
15
- * @param ariaLabel OPTIONAL aria label used on the bar
16
- * @param color The color of the bar
17
- * @param height The pixel height of the bar
18
- * @param index The index of the bar
19
- * @param label The label to use above (on positive bars) or below (on negative bars)
20
- * @param onClick OPTIONAL function to call if the bar is clicked
21
- * @param selectedIndex OPTIONAL indicates the selected bar
22
- * @param value Value representing the bar
23
- */
24
- declare const Bar: React.FC<BarProps>;
25
- export default Bar;
@@ -1,34 +0,0 @@
1
- import { default as React } from 'react';
2
- export type BarChartData = {
3
- ariaLabel: string;
4
- label: string;
5
- value: number;
6
- };
7
- export interface BarChartProps {
8
- average?: number;
9
- barWidth?: number | string;
10
- color: string;
11
- data: BarChartData[];
12
- height: number;
13
- legendLabelAverage: string;
14
- legendLabelMain: string;
15
- onBarClick?: (index: number) => void;
16
- selectedIndex?: number;
17
- valueFormatter?: (value: number) => string;
18
- }
19
- /**
20
- * BarChart component to display a vertical bar chart given an array of data
21
- *
22
- * @param average OPTIONAL custom average not based on average or all value
23
- * @param barWidth OPTIONAL pixel or percentage width of bars
24
- * @param color Color of the bars
25
- * @param data An array of chart data. Chart data must contain and aria label, label and value.
26
- * @param height Height in pixels of the chart
27
- * @param legendLabelAverage Label to use on legend for the average value
28
- * @param legendLabelMain Label to use on the legend for the data
29
- * @param onBarClick OPTIONAL function to call if bar is clicked
30
- * @param selectedIndex OPTIONAL indicates the selected bar
31
- * @param valueFormatter OPTIONAL function to call to format the value displayed with the bars
32
- */
33
- declare const BarChart: React.FC<BarChartProps>;
34
- export default BarChart;
@@ -1,37 +0,0 @@
1
- import { default as React } from 'react';
2
- interface BarColumnProps {
3
- ariaLabel?: string;
4
- averageLineHeight: number;
5
- bottomHeight: number;
6
- color: string;
7
- index?: number;
8
- onClick?: (index: number) => void;
9
- range: number;
10
- selectedIndex?: number;
11
- topHeight: number;
12
- value: number;
13
- valueLabel?: string;
14
- width?: number | string;
15
- xAxisLabel?: string;
16
- }
17
- /**
18
- * The BarColumn component represents a single vertical slice of the bar chart. It contains from top to bottom
19
- * the positive section, which will only display a bar if value > 0, the zero line, the average line, negative
20
- * section, which will only display a bar if value < 0 and the X-Axis label.
21
- *
22
- * @param ariaLabel OPTIONAL aria label used to label the bar
23
- * @param averageLineHeight the pixel height above/below the zero line for the dashed average line
24
- * @param bottomHeight the height of the bottom (negative) section
25
- * @param color the color of the bar
26
- * @param index OPTIONAL index of the bar (Only used when bar is clickable)
27
- * @param onClick OPTIONAL function to call if the bar is clicked
28
- * @param range
29
- * @param selectedIndex OPTIONAL indicates the selected bar
30
- * @param topHeight the pixel height of the top (positvie section)
31
- * @param value the value for the bar
32
- * @param valueLabel OPTIONAL string value to use for the bar
33
- * @param width OPTIONAL pixel or percentage width of the bar
34
- * @param xAxisLabel label for the X-Axis
35
- */
36
- declare const BarColumn: React.FC<BarColumnProps>;
37
- export default BarColumn;
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- interface BarChartLegendProps {
3
- color: string;
4
- labelAverage: string;
5
- labelMain: string;
6
- }
7
- declare const Legend: React.FC<BarChartLegendProps>;
8
- export default Legend;