@mx-cartographer/experiences 6.0.20 → 6.0.21

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [6.0.21] - 05-14-2025
2
+
3
+ - **UPDATED** - Hide create button in `BudwgetsMiniWidget`
4
+
1
5
  ## [6.0.20] - 05-14-2025
2
6
 
3
7
  - **ADDED** - `getClientTheme` util from MD into for easier theme testing
@@ -3,6 +3,7 @@ interface BubbleBudgetsProps {
3
3
  createBudgetOnClick?: () => void;
4
4
  height: number;
5
5
  isDraggable?: boolean;
6
+ isMiniWidget?: boolean;
6
7
  shouldShowZeroState: boolean;
7
8
  unavailableWidth?: number;
8
9
  }
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  interface BudgetsEmptyStateProps {
3
+ isMiniWidget?: boolean;
3
4
  onConnectAccountsClick: () => void;
4
5
  createBudgetOnClick: () => void;
5
6
  }
package/dist/index.es.js CHANGED
@@ -20813,26 +20813,27 @@ const A3 = ({
20813
20813
  kR(Wt, A, t), i && WR(Wt);
20814
20814
  }, [Wt, A, t]), /* @__PURE__ */ e("svg", { height: A, style: { overflow: "visible" }, width: Math.abs(t), children: Wt.nodes().map((o) => /* @__PURE__ */ e($R, { bubble: o, isDraggable: i, onClick: n }, o.guid)) });
20815
20815
  }, e3 = g(A3), t3 = ({
20816
- onConnectAccountsClick: A,
20817
- createBudgetOnClick: t
20816
+ isMiniWidget: A = !1,
20817
+ onConnectAccountsClick: t,
20818
+ createBudgetOnClick: i
20818
20819
  }) => {
20819
- const { recalculateBudgets: i } = te(), { spendCategories: n } = QA(), { budgets: r } = p(), [o, a] = h.useState(!1), [s, c] = h.useState(!1), [E, d] = h.useState(!1), f = h.useMemo(() => [...n.filter((v) => v.totalAverageAmount > 0)], [n]), l = async () => {
20820
- d(!0);
20821
- const { data: v, isSuccess: u } = await i(f);
20822
- d(!1), u ? (v.length === 0 && a(!0), c(!1)) : c(!0);
20820
+ const { recalculateBudgets: n } = te(), { spendCategories: r } = QA(), { budgets: o } = p(), [a, s] = h.useState(!1), [c, E] = h.useState(!1), [d, f] = h.useState(!1), l = h.useMemo(() => [...r.filter((u) => u.totalAverageAmount > 0)], [r]), v = async () => {
20821
+ f(!0);
20822
+ const { data: u, isSuccess: H } = await n(l);
20823
+ f(!1), H ? (u.length === 0 && s(!0), E(!1)) : E(!0);
20823
20824
  };
20824
- return E ? /* @__PURE__ */ e(IA, {}) : s ? /* @__PURE__ */ e(
20825
+ return d ? /* @__PURE__ */ e(IA, {}) : c ? /* @__PURE__ */ e(
20825
20826
  Ai,
20826
20827
  {
20827
- header: r.autogenerate_budgets_error_header,
20828
+ header: o.autogenerate_budgets_error_header,
20828
20829
  icon: "error",
20829
20830
  iconColor: "#4D4D4D",
20830
- onClick: (v) => {
20831
- v === "primary" ? l() : t();
20831
+ onClick: (u) => {
20832
+ u === "primary" ? v() : i();
20832
20833
  },
20833
- primaryButton: r.autogenerate_budgets_error_primary_button,
20834
+ primaryButton: o.autogenerate_budgets_error_primary_button,
20834
20835
  secondaryButton: "Create My Own Budgets",
20835
- subText: r.autogenerate_budgets_error_subheader,
20836
+ subText: o.autogenerate_budgets_error_subheader,
20836
20837
  sx: {
20837
20838
  width: { sm: 468 },
20838
20839
  ".buttons-footer": {
@@ -20840,18 +20841,18 @@ const A3 = ({
20840
20841
  }
20841
20842
  }
20842
20843
  }
20843
- ) : /* @__PURE__ */ e(AA, { children: o ? /* @__PURE__ */ e(
20844
+ ) : /* @__PURE__ */ e(AA, { children: a ? /* @__PURE__ */ e(
20844
20845
  Ai,
20845
20846
  {
20846
- header: r.zero_state_generate_budgets_header,
20847
+ header: o.zero_state_generate_budgets_header,
20847
20848
  icon: "error",
20848
20849
  iconColor: "#4D4D4D",
20849
- onClick: (v) => {
20850
- v === "primary" ? A() : t();
20850
+ onClick: (u) => {
20851
+ u === "primary" ? t() : i();
20851
20852
  },
20852
- primaryButton: r.zero_state_generate_budgets_primary_button,
20853
- secondaryButton: r.zero_state_generate_budgets_secondary_button,
20854
- subText: r.zero_state_generate_budgets_subheader,
20853
+ primaryButton: o.zero_state_generate_budgets_primary_button,
20854
+ secondaryButton: o.zero_state_generate_budgets_secondary_button,
20855
+ subText: o.zero_state_generate_budgets_subheader,
20855
20856
  sx: {
20856
20857
  width: { sm: 500 },
20857
20858
  height: { sm: 468 },
@@ -20865,15 +20866,15 @@ const A3 = ({
20865
20866
  ) : /* @__PURE__ */ e(
20866
20867
  Ai,
20867
20868
  {
20868
- header: r.create_budgets_title,
20869
+ header: o.create_budgets_title,
20869
20870
  icon: "bubble_chart",
20870
20871
  iconColor: "#1A1A1A",
20871
- onClick: (v) => {
20872
- v === "primary" ? l() : t();
20872
+ onClick: (u) => {
20873
+ u === "primary" ? v() : i();
20873
20874
  },
20874
- primaryButton: r.empty_state_primary_button,
20875
- secondaryButton: r.empty_state_secondary_button,
20876
- subText: r.empty_state_subheader,
20875
+ primaryButton: o.empty_state_primary_button,
20876
+ secondaryButton: A ? void 0 : o.empty_state_secondary_button,
20877
+ subText: o.empty_state_subheader,
20877
20878
  sx: {
20878
20879
  width: { sm: 432 },
20879
20880
  height: { sm: 468 },
@@ -20891,39 +20892,41 @@ const A3 = ({
20891
20892
  },
20892
20893
  height: t,
20893
20894
  isDraggable: i = !1,
20894
- shouldShowZeroState: n,
20895
- unavailableWidth: r = 24
20895
+ isMiniWidget: n = !1,
20896
+ shouldShowZeroState: r,
20897
+ unavailableWidth: o = 24
20896
20898
  }) => {
20897
- const { onEvent: o } = J(), { setSelectedBudget: a } = te(), { isLoadingCategoryTotals: s } = QA(), { isInitialized: c } = cA(), { accounts: E } = p(), { availableWidth: d } = wt(), { isMobile: f } = HA(), [l, v] = h.useState(!1), u = h.useMemo(() => d - r, [d]), H = (C) => {
20898
- a(C), o(Y.BUDGETS_CLICK_BUDGET_CATEGORY, {
20899
- budget_category: C.category.name,
20899
+ const { onEvent: a } = J(), { setSelectedBudget: s } = te(), { isLoadingCategoryTotals: c } = QA(), { isInitialized: E } = cA(), { accounts: d } = p(), { availableWidth: f } = wt(), { isMobile: l } = HA(), [v, u] = h.useState(!1), H = h.useMemo(() => f - o, [f]), P = (y) => {
20900
+ s(y), a(Y.BUDGETS_CLICK_BUDGET_CATEGORY, {
20901
+ budget_category: y.category.name,
20900
20902
  click_type: "bubble"
20901
20903
  });
20902
- }, P = () => {
20903
- v(!0), o(Y.ACCOUNTS_CLICK_CONNECT);
20904
+ }, C = () => {
20905
+ u(!0), a(Y.ACCOUNTS_CLICK_CONNECT);
20904
20906
  };
20905
- return s ? /* @__PURE__ */ e(b, { alignItems: "center", height: t, justifyContent: "center", width: Math.abs(u), children: /* @__PURE__ */ e(IA, {}) }) : /* @__PURE__ */ I(L, { ml: n || f ? 0 : 24, sx: { alignSelf: "center" }, children: [
20906
- n || !c ? /* @__PURE__ */ e(
20907
+ return c ? /* @__PURE__ */ e(b, { alignItems: "center", height: t, justifyContent: "center", width: Math.abs(H), children: /* @__PURE__ */ e(IA, {}) }) : /* @__PURE__ */ I(L, { ml: r || l ? 0 : 24, sx: { alignSelf: "center" }, children: [
20908
+ r || !E ? /* @__PURE__ */ e(
20907
20909
  t3,
20908
20910
  {
20909
20911
  createBudgetOnClick: A,
20910
- onConnectAccountsClick: P
20912
+ isMiniWidget: n,
20913
+ onConnectAccountsClick: C
20911
20914
  }
20912
20915
  ) : /* @__PURE__ */ e(
20913
20916
  e3,
20914
20917
  {
20915
20918
  height: t,
20916
20919
  isDraggable: i,
20917
- onClick: H,
20918
- width: u
20920
+ onClick: P,
20921
+ width: H
20919
20922
  }
20920
20923
  ),
20921
20924
  /* @__PURE__ */ e(
20922
20925
  or,
20923
20926
  {
20924
- onClose: () => v(!1),
20925
- showConnectionsWidget: l,
20926
- title: E.manage_connections
20927
+ onClose: () => u(!1),
20928
+ showConnectionsWidget: v,
20929
+ title: d.manage_connections
20927
20930
  }
20928
20931
  )
20929
20932
  ] });
@@ -20943,7 +20946,14 @@ const A3 = ({
20943
20946
  title: s.budgets_title,
20944
20947
  ...A,
20945
20948
  children: r ? /* @__PURE__ */ I(b, { height: 450, mt: 32, children: [
20946
- /* @__PURE__ */ e($a, { height: 370, shouldShowZeroState: l }),
20949
+ /* @__PURE__ */ e(
20950
+ $a,
20951
+ {
20952
+ height: 370,
20953
+ isMiniWidget: !0,
20954
+ shouldShowZeroState: l
20955
+ }
20956
+ ),
20947
20957
  !l && /* @__PURE__ */ I(L, { ml: 16, children: [
20948
20958
  /* @__PURE__ */ e(R, { bold: !0, color: f < 0 ? "error.main" : "success.main", children: N(Math.abs(f), "0,0") }),
20949
20959
  /* @__PURE__ */ e(R, { children: f < 0 ? s.overspent_in_budgets : s.left_in_budgets })