@mx-cartographer/experiences 7.0.52-alpha.mega7 → 7.0.52-alpha.mega8

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.
@@ -8,9 +8,9 @@ import C from "@mui/material/Stack";
8
8
  import Q from "@mui/material/styles/useTheme";
9
9
  import { Text as y, CategoryIcon as H, Icon as N, H1 as ze, H3 as xe } from "@mxenabled/mxui";
10
10
  import W from "@mui/material/List";
11
- import { u as w, i as D, j as ee, m as j, p as te, g as X, b as ne, h as oe, a as Ue, d as Ae } from "../hooks-CE2TKk4a.mjs";
11
+ import { u as w, i as D, j as ee, m as j, p as te, g as X, b as ne, h as oe, a as Ue, d as ve } from "../hooks-CE2TKk4a.mjs";
12
12
  import { f as T } from "../NumberFormatting-CtWHhyBX.mjs";
13
- import ve from "@mui/material/Button";
13
+ import Ae from "@mui/material/Button";
14
14
  import ae from "@mui/material/Divider";
15
15
  import K from "@mui/material/ListItem";
16
16
  import re from "@mui/material/ListItemAvatar";
@@ -84,7 +84,7 @@ const it = I(() => {
84
84
  await n(m), c(!1), o(a.alert_recalculated_budgets), t?.();
85
85
  };
86
86
  return /* @__PURE__ */ u(l.Fragment, { children: [
87
- /* @__PURE__ */ e(ve, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: a.recalculate_button }),
87
+ /* @__PURE__ */ e(Ae, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: a.recalculate_button }),
88
88
  /* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: a.recalculate_help }),
89
89
  /* @__PURE__ */ e(
90
90
  k,
@@ -278,11 +278,11 @@ function Bt({ bubble: t, isDraggable: a, onClick: i = () => {
278
278
  radius: p,
279
279
  x: b,
280
280
  y: S
281
- } = t, h = o < 320 ? -8 : -12;
282
- let x = h, A = h;
283
- p > P ? (x = -14, A = -45) : p > de && (A = -32);
284
- let v = 32;
285
- p <= P && (v = o < 320 ? 16 : 24);
281
+ } = t, h = o < 400 ? -8 : -12;
282
+ let x = h, v = h;
283
+ p > P ? (x = -14, v = -45) : p > de && (v = -32);
284
+ let A = 32;
285
+ p <= P && (A = o < 400 ? 16 : 24);
286
286
  const B = `${t.category.name}: ${_}`, E = {
287
287
  modifiers: [
288
288
  {
@@ -314,7 +314,7 @@ function Bt({ bubble: t, isDraggable: a, onClick: i = () => {
314
314
  children: /* @__PURE__ */ e("circle", { fill: c, id: `circle-${f}`, r: p })
315
315
  }
316
316
  ),
317
- /* @__PURE__ */ e("svg", { x, y: A, children: /* @__PURE__ */ e(N, { name: g, size: v, sx: { fill: m } }) }),
317
+ /* @__PURE__ */ e("svg", { x, y: v, children: /* @__PURE__ */ e(N, { name: g, size: A, sx: { fill: m } }) }),
318
318
  p > P && /* @__PURE__ */ e(
319
319
  y,
320
320
  {
@@ -392,7 +392,7 @@ const xt = ({
392
392
  const d = r.current;
393
393
  d && (i && !c.current ? (gt(d), c.current = !0) : !i && c.current && (c.current = !1));
394
394
  }, [i, n.length]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(a), children: n.map((d) => /* @__PURE__ */ e(Bt, { bubble: d, isDraggable: i, onClick: s }, d.guid)) });
395
- }, At = I(xt), vt = ({
395
+ }, vt = I(xt), At = ({
396
396
  isMiniWidget: t = !1,
397
397
  onConnectAccountsClick: a,
398
398
  createBudgetOnClick: i
@@ -420,7 +420,7 @@ const xt = ({
420
420
  width: 208,
421
421
  ...n && { mt: 16, button: { height: "max-content" } }
422
422
  },
423
- ...n && { mt: 0 }
423
+ ...n && { mt: 0, svg: { height: 32, width: 32 } }
424
424
  }
425
425
  }
426
426
  ) : /* @__PURE__ */ e(je, { children: m ? /* @__PURE__ */ e(
@@ -444,7 +444,8 @@ const xt = ({
444
444
  height: 100,
445
445
  ...n && { mt: 16, button: { height: "max-content" } }
446
446
  },
447
- padding: t ? 5 : 0
447
+ padding: t ? 5 : 0,
448
+ ...n && { svg: { height: 32, width: 32 } }
448
449
  }
449
450
  }
450
451
  ) : /* @__PURE__ */ e(
@@ -483,9 +484,9 @@ const xt = ({
483
484
  shouldShowZeroState: n,
484
485
  unavailableWidth: o = 24
485
486
  }) => {
486
- const { onEvent: r } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: m } = j(), { isInitialized: g } = ne(), { accounts: d } = w(), { availableWidth: f } = te(), { isMobile: _ } = ge(), [p, b] = l.useState(!1), S = l.useMemo(() => f - o, [f]), h = (A) => {
487
- c(A), r(L.BUDGETS_CLICK_BUDGET_CATEGORY, {
488
- budget_category: A.category.name,
487
+ const { onEvent: r } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: m } = j(), { isInitialized: g } = ne(), { accounts: d } = w(), { availableWidth: f } = te(), { isMobile: _ } = ge(), [p, b] = l.useState(!1), S = l.useMemo(() => f - o, [f]), h = (v) => {
488
+ c(v), r(L.BUDGETS_CLICK_BUDGET_CATEGORY, {
489
+ budget_category: v.category.name,
489
490
  click_type: "bubble"
490
491
  });
491
492
  }, x = () => {
@@ -493,14 +494,14 @@ const xt = ({
493
494
  };
494
495
  return m ? /* @__PURE__ */ e(C, { alignItems: "center", height: a, justifyContent: "center", width: Math.abs(S), children: /* @__PURE__ */ e(G, {}) }) : /* @__PURE__ */ u(F, { ml: n || _ ? 0 : 24, sx: { alignSelf: "center" }, children: [
495
496
  n || !g ? /* @__PURE__ */ e(
496
- vt,
497
+ At,
497
498
  {
498
499
  createBudgetOnClick: t,
499
500
  isMiniWidget: s,
500
501
  onConnectAccountsClick: x
501
502
  }
502
503
  ) : /* @__PURE__ */ e(
503
- At,
504
+ vt,
504
505
  {
505
506
  height: a,
506
507
  isDraggable: i,
@@ -530,7 +531,7 @@ const xt = ({
530
531
  }, [n]);
531
532
  const r = l.useMemo(() => {
532
533
  const c = o.current ?? n;
533
- return c > 0 ? Math.round(Math.max(140, Math.min(450, c * 0.8))) - 40 : 450;
534
+ return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
534
535
  }, [n]);
535
536
  return /* @__PURE__ */ u(C, { sx: { height: "100%", justifyContent: "space-between" }, children: [
536
537
  /* @__PURE__ */ e(
@@ -550,7 +551,7 @@ const xt = ({
550
551
  }, wt = (t) => {
551
552
  const a = Q(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: n, loadBudgetData: o, setTheme: r } = D(), { budgets: c, common: m } = w(), { isCopyLoaded: g, isInitialized: d, selectedAccounts: f } = ne(), { reloadCategoryTotals: _ } = j(), p = Ve(), b = s.length === 0, [S, h] = l.useState(!1), x = () => {
552
553
  h(!0), i(L.BUDGETS_CLICK_ADD);
553
- }, A = () => h(!1);
554
+ }, v = () => h(!1);
554
555
  return l.useEffect(() => {
555
556
  r(a);
556
557
  }, [a]), l.useEffect(() => {
@@ -562,7 +563,7 @@ const xt = ({
562
563
  }, [d, f]), g ? /* @__PURE__ */ u(
563
564
  Ye,
564
565
  {
565
- contentStyles: { height: "calc(100% - 52px)" },
566
+ contentStyles: { height: "calc(100% - 52px)", ":last-child": { pb: 16 } },
566
567
  primaryCtaLabel: b ? c.get_started_cta : c.details_cta,
567
568
  sx: { height: "100%" },
568
569
  title: c.budgets_title,
@@ -584,7 +585,7 @@ const xt = ({
584
585
  isOpen: S,
585
586
  onClose: () => h(!1),
586
587
  title: c.add_new_title,
587
- children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: A })
588
+ children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: v })
588
589
  }
589
590
  )
590
591
  ]
@@ -642,8 +643,8 @@ const xt = ({
642
643
  const { budgets: i, common: s } = w(), { setExpandedGuid: n, setOnSelect: o } = nt(), { addBudget: r } = D(), [c, m] = l.useState(!1), [g, d] = l.useState(!1), [f, _] = l.useState(""), [p, b] = l.useState(void 0);
643
644
  l.useEffect(() => {
644
645
  o((x) => {
645
- const A = t.subCategories.find((v) => v.guid === x);
646
- A && (b(A), _(`${A.currentAmount === 0 ? "" : A.currentAmount}`), d(!0));
646
+ const v = t.subCategories.find((A) => A.guid === x);
647
+ v && (b(v), _(`${v.currentAmount === 0 ? "" : v.currentAmount}`), d(!0));
647
648
  });
648
649
  }, []);
649
650
  const S = () => {
@@ -703,9 +704,9 @@ const xt = ({
703
704
  ...r,
704
705
  amount: Number(S)
705
706
  });
706
- }, A = async () => {
707
- r && await o(r.guid), b(!1), v();
708
- }, v = () => {
707
+ }, v = async () => {
708
+ r && await o(r.guid), b(!1), A();
709
+ }, A = () => {
709
710
  d({
710
711
  ...g,
711
712
  custom: (B) => B.category_guid === t.category_guid || B.top_level_category_guid === t.category_guid
@@ -724,7 +725,7 @@ const xt = ({
724
725
  {
725
726
  ariaLabelClose: n.close_aria,
726
727
  isOpen: !!r,
727
- onClose: v,
728
+ onClose: A,
728
729
  onPrimaryAction: () => _(!0),
729
730
  onSecondaryAction: () => b(!0),
730
731
  primaryText: s.details_edit_button,
@@ -762,7 +763,7 @@ const xt = ({
762
763
  copy: { close_aria: n.close_aria, title: s.delete_title },
763
764
  isOpen: p,
764
765
  onClose: () => b(!1),
765
- onPrimaryAction: A,
766
+ onPrimaryAction: v,
766
767
  primaryColor: "error",
767
768
  primaryText: "Delete",
768
769
  secondaryColor: "secondary",
@@ -781,9 +782,9 @@ const xt = ({
781
782
  [b, g]
782
783
  ), x = (B, E) => {
783
784
  p(E);
784
- }, A = () => {
785
+ }, v = () => {
785
786
  et(d, f), i(s.alert_csv_downloaded);
786
- }, v = g.length > 0 && !a && (r || m && !c);
787
+ }, A = g.length > 0 && !a && (r || m && !c);
787
788
  return /* @__PURE__ */ u(C, { gap: 24, children: [
788
789
  /* @__PURE__ */ e(Re, { budget: t }),
789
790
  /* @__PURE__ */ u(C, { children: [
@@ -802,10 +803,10 @@ const xt = ({
802
803
  }
803
804
  ),
804
805
  _ === 0 && /* @__PURE__ */ u(C, { children: [
805
- v && /* @__PURE__ */ e(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
806
- ve,
806
+ A && /* @__PURE__ */ e(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
807
+ Ae,
807
808
  {
808
- onClick: A,
809
+ onClick: v,
809
810
  startIcon: /* @__PURE__ */ e(N, { name: "ios_share" }),
810
811
  variant: "text",
811
812
  children: o.export_csv_btn
@@ -835,16 +836,16 @@ const xt = ({
835
836
  setAlert: c,
836
837
  setSelectedBudget: m,
837
838
  updateBudget: g
838
- } = D(), { setFilter: d } = oe(), [f, _] = l.useState(!1), [p, b] = l.useState(!1), [S, h] = l.useState(!1), [x, A] = l.useState("");
839
+ } = D(), { setFilter: d } = oe(), [f, _] = l.useState(!1), [p, b] = l.useState(!1), [S, h] = l.useState(!1), [x, v] = l.useState("");
839
840
  l.useEffect(() => {
840
- o && !r && (A(`${o.amount}`), _(!0), d({
841
+ o && !r && (v(`${o.amount}`), _(!0), d({
841
842
  accounts: t,
842
843
  dateRange: s,
843
844
  custom: (R) => R.category_guid === o.category_guid || R.top_level_category_guid === o.category_guid,
844
845
  showSplits: !0
845
846
  }));
846
847
  }, [o]);
847
- const v = async () => {
848
+ const A = async () => {
848
849
  o && (await g({
849
850
  ...o,
850
851
  amount: Number(x),
@@ -881,14 +882,14 @@ const xt = ({
881
882
  disablePrimaryButton: Number(x) <= 0,
882
883
  isOpen: p,
883
884
  onClose: () => b(!1),
884
- onPrimaryAction: v,
885
+ onPrimaryAction: A,
885
886
  primaryText: a.edit_save_button,
886
887
  children: /* @__PURE__ */ e(
887
888
  se,
888
889
  {
889
890
  amount: x,
890
891
  categoryName: o.category.name,
891
- onAmountChanged: A
892
+ onAmountChanged: v
892
893
  }
893
894
  )
894
895
  }
@@ -951,9 +952,9 @@ const xt = ({
951
952
  ] }, o.guid)) }) })
952
953
  ] });
953
954
  }), Nt = I(() => {
954
- const t = Q(), { onEvent: a } = X(), { visibleAccounts: i } = Ae(), { budgets: s, common: n, recurring: o } = w(), { incomeCategories: r, spendCategories: c } = j(), { detailedBudgets: m, totalBudgeted: g } = D(), { incomeTotal: d } = ee(), { setFilter: f } = oe(), [_, p] = l.useState(!1), [b, S] = l.useMemo(() => {
955
- const v = c.reduce((z, ie) => z + ie.totalAmount, 0);
956
- let B = v / g;
955
+ const t = Q(), { onEvent: a } = X(), { visibleAccounts: i } = ve(), { budgets: s, common: n, recurring: o } = w(), { incomeCategories: r, spendCategories: c } = j(), { detailedBudgets: m, totalBudgeted: g } = D(), { incomeTotal: d } = ee(), { setFilter: f } = oe(), [_, p] = l.useState(!1), [b, S] = l.useMemo(() => {
956
+ const A = c.reduce((z, ie) => z + ie.totalAmount, 0);
957
+ let B = A / g;
957
958
  B > 1 && (B = 1);
958
959
  let E = t.palette.success.main;
959
960
  B > 0.8 && B < 1 ? E = t.palette.warning.main : B >= 1 && (E = t.palette.error.main);
@@ -963,12 +964,12 @@ const xt = ({
963
964
  percentage: `${B}`
964
965
  }
965
966
  ];
966
- return [v, R];
967
+ return [A, R];
967
968
  }, [m, c]), [h, x] = l.useMemo(() => {
968
- const v = Math.abs(
969
+ const A = Math.abs(
969
970
  r.reduce((R, z) => R + z.totalAmount, 0)
970
971
  );
971
- let B = v / d;
972
+ let B = A / d;
972
973
  B > 1 && (B = 1);
973
974
  const E = [
974
975
  {
@@ -976,10 +977,10 @@ const xt = ({
976
977
  percentage: `${B}`
977
978
  }
978
979
  ];
979
- return [v, E];
980
- }, [r, d]), A = () => {
980
+ return [A, E];
981
+ }, [r, d]), v = () => {
981
982
  f({
982
- accounts: i.map((v) => v.guid),
983
+ accounts: i.map((A) => A.guid),
983
984
  dateRange: {
984
985
  start: at(/* @__PURE__ */ new Date(), 90),
985
986
  end: /* @__PURE__ */ new Date()
@@ -1005,7 +1006,7 @@ const xt = ({
1005
1006
  rt,
1006
1007
  {
1007
1008
  "aria-label": o.manage_income,
1008
- onClick: A,
1009
+ onClick: v,
1009
1010
  sx: { p: 0 },
1010
1011
  children: /* @__PURE__ */ e(N, { color: "primary", name: "edit" })
1011
1012
  }
@@ -1031,17 +1032,17 @@ const xt = ({
1031
1032
  )
1032
1033
  ] });
1033
1034
  }), Be = 480, Rn = I(({ onBackClick: t, sx: a }) => {
1034
- const i = Q(), { onEvent: s } = X(), { visibleAccounts: n } = Ae(), { budgets: o, common: r } = w(), { isCopyLoaded: c, isInitialized: m, selectedAccounts: g, setDisplayedDate: d, setSelectedAccounts: f } = ne(), {
1035
+ const i = Q(), { onEvent: s } = X(), { visibleAccounts: n } = ve(), { budgets: o, common: r } = w(), { isCopyLoaded: c, isInitialized: m, selectedAccounts: g, setDisplayedDate: d, setSelectedAccounts: f } = ne(), {
1035
1036
  alert: _,
1036
1037
  dateRange: p,
1037
1038
  isDataLoaded: b,
1038
1039
  loadBudgetData: S,
1039
1040
  setDateRange: h,
1040
1041
  setAlert: x,
1041
- setTheme: A,
1042
- detailedBudgets: v
1042
+ setTheme: v,
1043
+ detailedBudgets: A
1043
1044
  } = D(), { loadRepeatingTransactions: B, setDateRange: E } = ee(), { reloadCategoryTotals: R } = j(), { isSmallTablet: z, isMobile: ie, isSmallMobile: Le } = ge(), U = z || ie || Le, [ke, ce] = l.useState(!1);
1044
- l.useEffect(() => (A(i), f(n), h({ start: q(Z()), end: ue(Z()) }), s(L.BUDGETS_VIEW), () => {
1045
+ l.useEffect(() => (v(i), f(n), h({ start: q(Z()), end: ue(Z()) }), s(L.BUDGETS_VIEW), () => {
1045
1046
  h({ start: q(Z()), end: ue(Z()) });
1046
1047
  }), []), l.useEffect(() => {
1047
1048
  f(n);
@@ -1093,11 +1094,11 @@ const xt = ({
1093
1094
  createBudgetOnClick: fe,
1094
1095
  height: U ? 450 : 800,
1095
1096
  isDraggable: !0,
1096
- shouldShowZeroState: v.length === 0,
1097
+ shouldShowZeroState: A.length === 0,
1097
1098
  unavailableWidth: U ? 0 : Be
1098
1099
  }
1099
1100
  ) }),
1100
- v.length !== 0 && /* @__PURE__ */ u(
1101
+ A.length !== 0 && /* @__PURE__ */ u(
1101
1102
  C,
1102
1103
  {
1103
1104
  gap: 24,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.52-alpha.mega7",
3
+ "version": "7.0.52-alpha.mega8",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",