@mx-cartographer/experiences 9.7.1 → 9.7.2

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 (44) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/core/types/InsightsInstanceSlotData.d.ts +6 -2
  3. package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
  4. package/dist/finstrong/components/ManageDOB.es.js +16 -16
  5. package/dist/goals/components/GoalList.es.js +1 -1
  6. package/dist/goals/components/actions/BirthdayAction.es.js +11 -11
  7. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +9 -9
  8. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +8 -8
  9. package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +9 -9
  10. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +4 -4
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +58 -58
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +1 -3
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +14 -13
  15. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +8 -2
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +56 -36
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  19. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.d.ts +7 -3
  20. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +30 -32
  21. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
  22. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.d.ts +3 -2
  23. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +16 -15
  24. package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
  25. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +5 -5
  26. package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +6 -6
  27. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +4 -4
  28. package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js +6 -6
  29. package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js +1 -1
  30. package/dist/insights-v2/components/BaseLayout.es.js +24 -24
  31. package/dist/insights-v2/components/CompactInsightCard.d.ts +4 -2
  32. package/dist/insights-v2/components/CompactInsightCard.es.js +91 -59
  33. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  34. package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +4 -4
  35. package/dist/insights-v2/index.es.js +122 -121
  36. package/dist/insights-v2/mappings/blocks.es.js +112 -99
  37. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  38. package/dist/microinsights/cards/InsightCard.es.js +10 -10
  39. package/dist/recurringtransactions/components/PaymentSchedule.es.js +11 -11
  40. package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +16 -16
  41. package/dist/settings/components/profile/ProfileTab.es.js +33 -33
  42. package/dist/transactions/components/shared/TransactionDetails.es.js +5 -4
  43. package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
  44. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { formatCurrency as d } from "../../../../core/utils/NumberFormatting.es.js";
2
- import { createVariantBlock as y } from "../../createVariantBlock.es.js";
3
2
  import l from "../../../components/LogoFromGuid.es.js";
3
+ import { createVariantBlock as y } from "../../createVariantBlock.es.js";
4
4
  import g from "../../../components/SubscriptionHeroCard.es.js";
5
5
  import { upcomingSubscriptionVariant as b } from "./layout.es.js";
6
6
  import x from "@mui/material/Stack";
@@ -1,21 +1,21 @@
1
1
  import { useAppConfig as U, useGlobalCopyStore as j, useGlobalStore as z, useInsightsV2Store as K } from "../../common/context/hooks.es.js";
2
2
  import { BeatActionsProvider as X } from "../beatActions.es.js";
3
3
  import { isContactSupportCtaDisabled as W } from "../actionBlocks/ContactSupportActionBlock.es.js";
4
- import { logoFromRef as Y } from "./shared/EntityLogo.es.js";
5
- import { actionBlocksKey as $ } from "../mappings/actionBlocksKey.es.js";
6
- import { reportCtaClick as q } from "../ctaActions/runCtaAction.es.js";
7
- import { useBeatCtaActions as J } from "../ctaActions/useCtaAction.es.js";
4
+ import { reportCtaClick as Y } from "../ctaActions/runCtaAction.es.js";
5
+ import { useBeatCtaActions as $ } from "../ctaActions/useCtaAction.es.js";
6
+ import { actionBlocksKey as q } from "../mappings/actionBlocksKey.es.js";
7
+ import { logoFromRef as J } from "./shared/EntityLogo.es.js";
8
8
  import Q from "./FeedbackDialog.es.js";
9
9
  import { ErrorCard as Z } from "./ErrorCard.es.js";
10
10
  import { blocks as oo } from "../mappings/blocks.es.js";
11
- import to from "./Footer.es.js";
12
- import io from "./Header.es.js";
13
- import { FeedbackBar as eo } from "./FeedbackBar.es.js";
14
- import { DismissInsightDialog as ro } from "./DismissInsightDialog.es.js";
15
- import { HiddenConfirmationCard as no } from "./HiddenConfirmationCard.es.js";
16
- import { LoadingCard as so } from "./LoadingCard.es.js";
17
- import { ObsolesceBanner as ao } from "./ObsolesceBanner.es.js";
18
- import { ActionBlockLayer as lo } from "../actionBlocks/ActionBlockLayer.es.js";
11
+ import { ActionBlockLayer as to } from "../actionBlocks/ActionBlockLayer.es.js";
12
+ import io from "./Footer.es.js";
13
+ import eo from "./Header.es.js";
14
+ import { FeedbackBar as ro } from "./FeedbackBar.es.js";
15
+ import { DismissInsightDialog as no } from "./DismissInsightDialog.es.js";
16
+ import { HiddenConfirmationCard as so } from "./HiddenConfirmationCard.es.js";
17
+ import { LoadingCard as ao } from "./LoadingCard.es.js";
18
+ import { ObsolesceBanner as lo } from "./ObsolesceBanner.es.js";
19
19
  import { useBeatFeedbackFlow as co } from "../hooks/useBeatFeedbackFlow.es.js";
20
20
  import { useMemo as mo } from "react";
21
21
  import { observer as po } from "mobx-react-lite";
@@ -44,7 +44,7 @@ var yo = {}, go = {
44
44
  px: 2,
45
45
  textTransform: "none"
46
46
  }, $o = po(({ beat: i, beatActions: n = yo, obsolete: u, isLoading: L = !1, isError: O = !1 }) => {
47
- const I = j(), w = K(), { config: A } = U(), o = co(i, n), F = z(), { runCta: E, primary: k, secondary: x } = J(i, n, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), c = i.insights_payload?.widget_type === "mini", M = mo(() => ({
47
+ const I = j(), w = K(), { config: A } = U(), o = co(i, n), F = z(), { runCta: E, primary: k, secondary: x } = $(i, n, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), c = i.insights_payload?.widget_type === "mini", M = mo(() => ({
48
48
  ...o.wrappedActions,
49
49
  beat: i
50
50
  }), [o.wrappedActions, i]);
@@ -52,12 +52,12 @@ var yo = {}, go = {
52
52
  const e = i.insights_payload;
53
53
  if (!e || o.cardState === "dismissed") return null;
54
54
  const { instance_slot: N, primary_cta: r, secondary_cta: s, sub_title: R, title: H, guid: _, dismissed_at: P } = e, { block: V } = N, G = R ?? (e.subtitle ? {
55
- logo: Y(e.logo),
55
+ logo: J(e.logo),
56
56
  text: e.subtitle
57
57
  } : void 0), d = (m) => W(m, A, n.onContactSupport), v = async (m, y) => {
58
58
  if (!d(y.block)) {
59
- if (y.block === $.CONTACT_SUPPORT_ACTION_BLOCK) {
60
- q({
59
+ if (y.block === q.CONTACT_SUPPORT_ACTION_BLOCK) {
60
+ Y({
61
61
  beat: i,
62
62
  stores: F,
63
63
  hostActions: n,
@@ -73,11 +73,11 @@ var yo = {}, go = {
73
73
  children: /* @__PURE__ */ l(g, {
74
74
  sx: { mb: 16 },
75
75
  children: [
76
- o.cardState === "confirming" ? /* @__PURE__ */ t(no, {
76
+ o.cardState === "confirming" ? /* @__PURE__ */ t(so, {
77
77
  onClose: o.collapseConfirmation,
78
78
  onLeaveFeedback: o.openHideSurvey,
79
79
  onUndo: o.undoDismiss
80
- }) : /* @__PURE__ */ l(bo, { children: [u && C && /* @__PURE__ */ t(ao, {
80
+ }) : /* @__PURE__ */ l(bo, { children: [u && C && /* @__PURE__ */ t(lo, {
81
81
  ...u,
82
82
  copy: C
83
83
  }), /* @__PURE__ */ l(ho, {
@@ -89,12 +89,12 @@ var yo = {}, go = {
89
89
  } },
90
90
  children: [
91
91
  h && /* @__PURE__ */ t(Co, { sx: go }),
92
- /* @__PURE__ */ t(io, {
92
+ /* @__PURE__ */ t(eo, {
93
93
  isMini: c,
94
94
  subtitle: G,
95
95
  title: H ?? ""
96
96
  }),
97
- L ? /* @__PURE__ */ t(so, {}) : S && /* @__PURE__ */ t(S, {
97
+ L ? /* @__PURE__ */ t(ao, {}) : S && /* @__PURE__ */ t(S, {
98
98
  beatGuid: _,
99
99
  payload: e
100
100
  }),
@@ -166,14 +166,14 @@ var yo = {}, go = {
166
166
  })
167
167
  ]
168
168
  }),
169
- /* @__PURE__ */ t(eo, {
169
+ /* @__PURE__ */ t(ro, {
170
170
  onTellUsMore: o.openRatingSurvey,
171
171
  show: o.isFeedbackBarShown
172
172
  })
173
173
  ]
174
174
  })] }),
175
- /* @__PURE__ */ t(lo, { beat: i }),
176
- /* @__PURE__ */ t(ro, {
175
+ /* @__PURE__ */ t(to, { beat: i }),
176
+ /* @__PURE__ */ t(no, {
177
177
  isOpen: o.isDismissOpen,
178
178
  onClose: o.closeDismissDialog,
179
179
  onDismiss: o.confirmDismiss
@@ -191,7 +191,7 @@ var yo = {}, go = {
191
191
  secondaryText: o.survey.backText,
192
192
  title: o.survey.title
193
193
  }),
194
- o.cardState === "visible" && e.footer && /* @__PURE__ */ t(to, { footer: e.footer })
194
+ o.cardState === "visible" && e.footer && /* @__PURE__ */ t(io, { footer: e.footer })
195
195
  ]
196
196
  })
197
197
  });
@@ -1,7 +1,9 @@
1
- import { InsightsPayload, PrimaryCTA } from '../../core';
1
+ import { Beat, InsightsPayload, PrimaryCTA } from '../../core';
2
2
  export interface CompactInsightCardProps {
3
3
  /** A `micro` or `embedded` envelope. */
4
4
  payload: InsightsPayload;
5
+ /** The envelope's beat; when given, the card mounts its `ActionBlockLayer` for CTA drawers. */
6
+ beat?: Beat;
5
7
  /**
6
8
  * Makes the whole card the tap target. What a tap does is the host's decision (post to the
7
9
  * host app, open a drawer, …); the card never opens anything itself. Omit for a static card.
@@ -27,5 +29,5 @@ export interface CompactInsightCardProps {
27
29
  * The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot
28
30
  * carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.
29
31
  */
30
- declare const CompactInsightCard: ({ isCtaDisabled, onCtaClick, onTap, payload, }: CompactInsightCardProps) => import("react/jsx-runtime").JSX.Element;
32
+ declare const CompactInsightCard: ({ beat, isCtaDisabled, onCtaClick, onTap, payload, }: CompactInsightCardProps) => import("react/jsx-runtime").JSX.Element;
31
33
  export default CompactInsightCard;
@@ -1,66 +1,96 @@
1
- import { slot as y } from "../../core/types/Insights.es.js";
2
- import { createVariantBlock as k } from "../blocks/createVariantBlock.es.js";
3
- import m from "./BadgedTile.es.js";
4
- import { InsightOptionsMenu as w } from "./InsightOptionsMenu.es.js";
5
- import I from "./LogoFromGuid.es.js";
6
- import { ReactComponent as v } from "./shared/images/FeeDetected.es.js";
7
- import { ThemedSVGImage as C } from "./chartblocks/ThemedSVGImage.es.js";
8
- import S from "./StatusBadge.es.js";
9
- import l from "@mui/material/Stack";
10
- import { P as _, Text as V } from "@mxenabled/mxui";
11
- import B from "@mui/material/Button";
12
- import { Icon as P } from "@mxenabled/mx-icons";
13
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
14
- import p from "@mui/material/Box";
15
- import z from "@mui/material/Card";
16
- var a = 44, d = ({ logo: r }) => r ? /* @__PURE__ */ t(I, {
1
+ import { useInsightsV2Store as w } from "../../common/context/hooks.es.js";
2
+ import { slot as f } from "../../core/types/Insights.es.js";
3
+ import { getCategoryColor as v } from "../../core/utils/CategoryUtil.es.js";
4
+ import { TinyBarChart as B } from "../../common/components/TinyBarChart.es.js";
5
+ import { BAR_ARIA_LABEL as S, buildChartData as A, buildDataSeries as V } from "../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
+ import { ThemedSVGImage as D } from "./chartblocks/ThemedSVGImage.es.js";
7
+ import L from "./LogoFromGuid.es.js";
8
+ import { createVariantBlock as P } from "../blocks/createVariantBlock.es.js";
9
+ import { ActionBlockLayer as z } from "../actionBlocks/ActionBlockLayer.es.js";
10
+ import x from "./BadgedTile.es.js";
11
+ import { InsightOptionsMenu as F } from "./InsightOptionsMenu.es.js";
12
+ import { ReactComponent as R } from "./shared/images/FeeDetected.es.js";
13
+ import T from "./StatusBadge.es.js";
14
+ import g from "@mui/material/Stack";
15
+ import { P as j, Text as E } from "@mxenabled/mxui";
16
+ import G from "@mui/material/Button";
17
+ import { Icon as O } from "@mxenabled/mx-icons";
18
+ import { Fragment as K, jsx as t, jsxs as n } from "react/jsx-runtime";
19
+ import h from "@mui/material/Box";
20
+ import N from "@mui/material/Card";
21
+ var l = 44, y = ({ logo: r }) => r ? /* @__PURE__ */ t(L, {
17
22
  logo: r,
18
- size: a
19
- }) : /* @__PURE__ */ t(p, {
23
+ size: l
24
+ }) : /* @__PURE__ */ t(h, {
20
25
  "data-testid": "compact-insight-card-fallback-icon",
21
26
  sx: {
22
27
  alignItems: "center",
23
28
  bgcolor: "primary.lighter",
24
29
  display: "flex",
25
- height: a,
30
+ height: l,
26
31
  justifyContent: "center",
27
- width: a
32
+ width: l
28
33
  },
29
- children: /* @__PURE__ */ t(P, {
34
+ children: /* @__PURE__ */ t(O, {
30
35
  color: "primary",
31
36
  fill: !0,
32
37
  name: "lightbulb",
33
38
  size: 24
34
39
  })
35
- }), c = ({ logo: r }) => /* @__PURE__ */ t(m, {
36
- center: /* @__PURE__ */ t(d, { logo: r }),
37
- size: a,
40
+ }), u = ({ logo: r }) => /* @__PURE__ */ t(x, {
41
+ center: /* @__PURE__ */ t(y, { logo: r }),
42
+ size: l,
38
43
  sx: { flexShrink: 0 }
39
- }), j = ({ logo: r }) => /* @__PURE__ */ t(m, {
40
- center: /* @__PURE__ */ t(d, { logo: r }),
41
- size: a,
44
+ }), W = ({ logo: r }) => /* @__PURE__ */ t(x, {
45
+ center: /* @__PURE__ */ t(y, { logo: r }),
46
+ size: l,
42
47
  sx: { flexShrink: 0 },
43
- topRight: /* @__PURE__ */ t(S, { tone: "warning" })
44
- }), D = () => /* @__PURE__ */ t(C, {
48
+ topRight: /* @__PURE__ */ t(T, { tone: "warning" })
49
+ }), H = () => /* @__PURE__ */ t(D, {
45
50
  divProps: { style: {
46
51
  flexShrink: 0,
47
52
  lineHeight: 0,
48
53
  width: "max-content"
49
54
  } },
50
- image: v
51
- }), L = k({
55
+ image: R
56
+ }), M = ({ data: r }) => {
57
+ const a = V(f(r, "series"));
58
+ if (!a.length) return null;
59
+ const s = f(r, "category_guid"), e = A(a, S).slice(-3);
60
+ return /* @__PURE__ */ t(h, {
61
+ "data-testid": "compact-insight-card-bar-chart",
62
+ sx: { flexShrink: 0 },
63
+ children: /* @__PURE__ */ t(B, {
64
+ color: (o) => s ? v(s, o) : o.palette.primary.main,
65
+ data: e
66
+ })
67
+ });
68
+ }, Z = P({
52
69
  variants: {
53
- minimal: c,
54
- with_illustration: D,
55
- with_warning_badge: j
70
+ category_color: M,
71
+ minimal: u,
72
+ with_illustration: H,
73
+ with_warning_badge: W
56
74
  },
57
- fallback: c,
75
+ fallback: u,
58
76
  name: "InsightVisual"
59
- }), F = (r) => r.stopPropagation(), U = ({ isCtaDisabled: r = !1, onCtaClick: f, onTap: e, payload: g }) => {
60
- const { description: h, instance_slot: s, primary_cta: o, title: u } = g, x = y(s.data, "logo"), b = (i) => {
61
- i.stopPropagation(), !(r || !o) && f?.(o);
77
+ }), $ = { BillAmountNotStandard: {
78
+ key: "in_description_cta",
79
+ trigger: "inDescriptionCta"
80
+ } }, q = (r) => r.stopPropagation(), ut = ({ beat: r, isCtaDisabled: a = !1, onCtaClick: s, onTap: e, payload: o }) => {
81
+ const { openActionDrawer: C } = w(), { description: b, instance_slot: m, primary_cta: d, title: k } = o, c = $[o.template ?? ""], p = c ? o[c.key] : d, I = f(m.data, "logo"), _ = (i) => {
82
+ if (i.stopPropagation(), !(a || !p)) {
83
+ if (c) {
84
+ r && C({
85
+ guid: r.guid,
86
+ trigger: c.trigger
87
+ });
88
+ return;
89
+ }
90
+ d && s?.(d);
91
+ }
62
92
  };
63
- return /* @__PURE__ */ n(z, {
93
+ return /* @__PURE__ */ n(K, { children: [/* @__PURE__ */ n(N, {
64
94
  "data-testid": "compact-insight-card",
65
95
  ...e ? {
66
96
  onClick: e,
@@ -78,7 +108,7 @@ var a = 44, d = ({ logo: r }) => r ? /* @__PURE__ */ t(I, {
78
108
  pt: 8,
79
109
  ...e && { cursor: "pointer" }
80
110
  },
81
- children: [/* @__PURE__ */ n(l, {
111
+ children: [/* @__PURE__ */ n(g, {
82
112
  sx: {
83
113
  alignItems: "center",
84
114
  flexDirection: "row",
@@ -87,57 +117,59 @@ var a = 44, d = ({ logo: r }) => r ? /* @__PURE__ */ t(I, {
87
117
  pl: 8,
88
118
  pt: 4
89
119
  },
90
- children: [/* @__PURE__ */ t(V, {
120
+ children: [/* @__PURE__ */ t(E, {
91
121
  bold: !0,
92
122
  variant: "body1",
93
- children: u ?? ""
94
- }), /* @__PURE__ */ t(p, {
95
- onClick: F,
123
+ children: k ?? ""
124
+ }), /* @__PURE__ */ t(h, {
125
+ onClick: q,
96
126
  sx: { display: "flex" },
97
- children: /* @__PURE__ */ t(w, {})
127
+ children: /* @__PURE__ */ t(F, {})
98
128
  })]
99
- }), /* @__PURE__ */ n(l, {
129
+ }), /* @__PURE__ */ n(g, {
100
130
  sx: {
101
131
  flexDirection: "row",
102
132
  gap: 16,
103
133
  pl: 8,
104
134
  pt: 4
105
135
  },
106
- children: [/* @__PURE__ */ n(l, {
136
+ children: [/* @__PURE__ */ n(g, {
107
137
  sx: {
108
138
  flex: 1,
109
139
  gap: 8,
110
140
  minWidth: 0
111
141
  },
112
- children: [/* @__PURE__ */ t(_, {
113
- dangerouslySetInnerHTML: { __html: h.html_text },
142
+ children: [/* @__PURE__ */ t(j, {
143
+ dangerouslySetInnerHTML: { __html: b.html_text },
114
144
  "data-testid": "compact-insight-card-description",
115
145
  variant: "subtitle2"
116
- }), o?.label && /* @__PURE__ */ t(B, {
117
- "aria-disabled": r,
118
- onClick: b,
146
+ }), p?.label && /* @__PURE__ */ t(G, {
147
+ "aria-disabled": a,
148
+ onClick: _,
119
149
  size: "small",
120
150
  sx: {
121
151
  alignSelf: "flex-start",
152
+ mt: 5,
122
153
  ml: -8,
123
154
  px: 8,
124
- ...r && {
155
+ ...a && {
125
156
  color: "text.disabled",
126
157
  cursor: "default"
127
158
  }
128
159
  },
129
160
  variant: "text",
130
- children: o.label
161
+ children: p.label
131
162
  })]
132
- }), /* @__PURE__ */ t(L, {
133
- logo: x,
134
- variant: s.variant
163
+ }), /* @__PURE__ */ t(Z, {
164
+ data: m.data,
165
+ logo: I,
166
+ variant: m.variant
135
167
  })]
136
168
  })]
137
- });
169
+ }), r && /* @__PURE__ */ t(z, { beat: r })] });
138
170
  };
139
171
  export {
140
- U as default
172
+ ut as default
141
173
  };
142
174
 
143
175
  //# sourceMappingURL=CompactInsightCard.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompactInsightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/CompactInsightCard.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { slot } from '../../core'\nimport type { InsightsPayload, LogoRef, PrimaryCTA } from '../../core'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\nimport BadgedTile from './BadgedTile'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport LogoFromGuid from './LogoFromGuid'\nimport { ReactComponent as FeeDetectedIllustration } from './shared/images/FeeDetected.svg'\nimport { ThemedSVGImage } from './chartblocks/ThemedSVGImage'\nimport StatusBadge from './StatusBadge'\n\n/** Figma 1941:111897: the tile the logo fills is 44px (rows are 32, the notification row 33). */\nconst ICON_SIZE = 44\n\ninterface InsightVisualProps {\n /** The slot's `logo`, when ditto's variant declares and fills one. */\n logo?: LogoRef | null\n}\n\n/** The slot's logo, or the neutral insight glyph when the slot carries none. */\nconst LogoOrFallback = ({ logo }: InsightVisualProps) =>\n logo ? (\n <LogoFromGuid logo={logo} size={ICON_SIZE} />\n ) : (\n <Box\n data-testid=\"compact-insight-card-fallback-icon\"\n sx={{\n alignItems: 'center',\n bgcolor: 'primary.lighter',\n display: 'flex',\n height: ICON_SIZE,\n justifyContent: 'center',\n width: ICON_SIZE,\n }}\n >\n <Icon color=\"primary\" fill={true} name=\"lightbulb\" size={24} />\n </Box>\n )\n\n/** Micro, and any variant not registered below: the logo alone. */\nconst PlainVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile center={<LogoOrFallback logo={logo} />} size={ICON_SIZE} sx={{ flexShrink: 0 }} />\n)\n\n/** ditto `with_warning_badge`: the logo badged with a status glyph (Figma 1941:111897). */\nconst WarningBadgeVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"warning\" />}\n />\n)\n\n/**\n * ditto `with_illustration`: artwork in place of the logo tile (Fee Detected's search illustration).\n * A single SVG themed at runtime by `ThemedSVGImage`: its `brand300` elements are recolored to the\n * theme's `primary.main` (so it follows dark mode), while `fill=\"white\"` areas stay white. The\n * slot's `logo` is deliberately unused: the illustration replaces the tile.\n */\nconst IllustrationVisual = () => {\n return (\n <ThemedSVGImage\n divProps={{ style: { flexShrink: 0, lineHeight: 0, width: 'max-content' } }}\n image={FeeDetectedIllustration}\n />\n )\n}\n\n/**\n * The card's right-hand visual, one component per ditto layout variant.\n *\n * A variant names a rendering *shape*, not an insight or a surface — `with_header` already serves\n * both Large Transaction and Fee Detected — so an insight wanting the badged logo reuses\n * `with_warning_badge`. Only a genuinely different visual registers a new entry, and existing ones\n * are never touched.\n *\n * `minimal` draws the plain logo and is registered explicitly even though it matches the fallback:\n * micro and notification resolve it on every render, and an unregistered variant warns. The\n * fallback is for variants we genuinely do not know.\n */\nconst InsightVisual = createVariantBlock<InsightVisualProps>({\n variants: {\n minimal: PlainVisual,\n with_illustration: IllustrationVisual,\n with_warning_badge: WarningBadgeVisual,\n },\n fallback: PlainVisual,\n name: 'InsightVisual',\n})\n\nexport interface CompactInsightCardProps {\n /** A `micro` or `embedded` envelope. */\n payload: InsightsPayload\n /**\n * Makes the whole card the tap target. What a tap does is the host's decision (post to the\n * host app, open a drawer, …); the card never opens anything itself. Omit for a static card.\n */\n onTap?: () => void\n /** Receives the primary CTA when tapped. The card does not resolve the CTA's block itself. */\n onCtaClick?: (cta: PrimaryCTA) => void\n /**\n * Renders the CTA disabled — label shown, `aria-disabled`, not tappable — for a host that cannot\n * honour it (e.g. `contact_support_block` when the client's `enable_support_requests` is off).\n */\n isCtaDisabled?: boolean\n}\n\nconst stopPropagation = (event: MouseEvent) => event.stopPropagation()\n\n/**\n * The one compact renderer the micro and embedded envelopes share (`insights_v2.2.md` §8.3).\n *\n * Figma 1941:111897 (Embedded | Large Transaction): a title row with the overflow slot, the HTML\n * description with the primary CTA under it, and on the right the slot's `logo` in a\n * `<BadgedTile>`. Under ditto's `with_warning_badge` variant the tile takes a status badge; under\n * `minimal` it draws the logo alone. The card lays out from the envelope alone and never reads\n * `widget_type`.\n *\n * The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot\n * carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.\n */\nconst CompactInsightCard = ({\n isCtaDisabled = false,\n onCtaClick,\n onTap,\n payload,\n}: CompactInsightCardProps) => {\n const { description, instance_slot, primary_cta, title } = payload\n // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = slot<LogoRef>(instance_slot.data, 'logo')\n\n const handleCtaClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (isCtaDisabled || !primary_cta) return\n onCtaClick?.(primary_cta)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n // Only the card itself: Enter on the CTA button is the button's own click.\n if (event.target !== event.currentTarget) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n onTap?.()\n }\n }\n\n const interactiveProps = onTap\n ? { onClick: onTap, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 }\n : {}\n\n return (\n <Card\n data-testid=\"compact-insight-card\"\n {...interactiveProps}\n sx={{\n minWidth: 288,\n pb: 12,\n pl: 8,\n pr: 16,\n pt: 8,\n ...(onTap && { cursor: 'pointer' }),\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n justifyContent: 'space-between',\n pl: 8,\n pt: 4,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {title ?? ''}\n </Text>\n {/* The menu renders only when the host wired `onMenuAction` (BeatActionsProvider). */}\n <Box onClick={stopPropagation} sx={{ display: 'flex' }}>\n <InsightOptionsMenu />\n </Box>\n </Stack>\n\n <Stack sx={{ flexDirection: 'row', gap: 16, pl: 8, pt: 4 }}>\n <Stack sx={{ flex: 1, gap: 8, minWidth: 0 }}>\n {/* `html_text` is rendered server-side by mrs_content from the ditto copy template (bold\n amount / merchant), not user-authored input; painted the same way `BaseLayout` paints\n the full card's description. */}\n <P\n dangerouslySetInnerHTML={{ __html: description.html_text }}\n data-testid=\"compact-insight-card-description\"\n variant=\"subtitle2\"\n />\n {primary_cta?.label && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // Figma 1941:111897 lines the CTA label up with the description's left edge. The\n // column already pads 8, so the button's own 8 is pulled back out — padding kept so\n // the tap target does not shrink.\n ml: -8,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n {primary_cta.label}\n </Button>\n )}\n </Stack>\n\n <InsightVisual logo={rowLogo} variant={instance_slot.variant} />\n </Stack>\n </Card>\n )\n}\n\nexport default CompactInsightCard\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,IAAM,IAAY,IAQZ,IAAA,CAAkB,EAAE,MAAA,EAAA,MACxB,IACE,gBAAA,EAAC,GAAD;AAAA,EAAoB,MAAA;AAAA,EAAM,MAAM;AAAY,CAAA,IAE5C,gBAAA,EAAC,GAAD;AAAA,EACE,eAAY;AAAA,EACZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,OAAO;AAAA,EACT;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAU,MAAM;AAAA,IAAM,MAAK;AAAA,IAAY,MAAM;AAAA,EAAK,CAAA;AAC3D,CAAA,GAIH,IAAA,CAAe,EAAE,MAAA,EAAA,MACrB,gBAAA,EAAC,GAAD;AAAA,EAAY,QAAQ,gBAAA,EAAC,GAAD,EAAsB,MAAA,EAAO,CAAA;AAAA,EAAG,MAAM;AAAA,EAAW,IAAI,EAAE,YAAY,EAAE;AAAI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AAA,cACP,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,UACA,SAAQ;AAAA,UAEP,UAAA,EAAY;AAAA,QACP,CAAA,CAEL;AAAA,MAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAe,MAAM;AAAA,QAAS,SAAS,EAAc;AAAA,MAAU,CAAA,CAC1D;AAAA,IACH,CAAA,CAAA;AAAA;AAEV"}
1
+ {"version":3,"file":"CompactInsightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/CompactInsightCard.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { useInsightsV2Store } from '../../common'\nimport { TinyBarChart } from '../../common/components/TinyBarChart'\nimport { slot } from '../../core'\nimport type {\n Beat,\n DataSeries,\n InsightsPayload,\n InstanceSlotData,\n LogoRef,\n PrimaryCTA,\n} from '../../core'\nimport type { ActionDrawerTrigger } from '../../core/stores'\nimport { getCategoryColor } from '../../core/utils/CategoryUtil'\nimport {\n BAR_ARIA_LABEL,\n buildChartData,\n buildDataSeries,\n} from '../blocks/ChartBlocks/BarchartBlock/utils'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\nimport BadgedTile from './BadgedTile'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport LogoFromGuid from './LogoFromGuid'\nimport { ReactComponent as FeeDetectedIllustration } from './shared/images/FeeDetected.svg'\nimport { ThemedSVGImage } from './chartblocks/ThemedSVGImage'\nimport StatusBadge from './StatusBadge'\n\n/** Figma 1941:111897: the tile the logo fills is 44px (rows are 32, the notification row 33). */\nconst ICON_SIZE = 44\n\ninterface InsightVisualProps {\n /** The slot's `logo`, when ditto's variant declares and fills one. */\n logo?: LogoRef | null\n /** The slot's `data`, for a visual drawn from more than the logo (`category_color`'s bars). */\n data?: InstanceSlotData\n}\n\n/** Figma 222:33404 (Embedded | Bill Amount Not Standard) shows the latest three bars. */\nconst BAR_CHART_BAR_COUNT = 3\n\n/** The slot's logo, or the neutral insight glyph when the slot carries none. */\nconst LogoOrFallback = ({ logo }: InsightVisualProps) =>\n logo ? (\n <LogoFromGuid logo={logo} size={ICON_SIZE} />\n ) : (\n <Box\n data-testid=\"compact-insight-card-fallback-icon\"\n sx={{\n alignItems: 'center',\n bgcolor: 'primary.lighter',\n display: 'flex',\n height: ICON_SIZE,\n justifyContent: 'center',\n width: ICON_SIZE,\n }}\n >\n <Icon color=\"primary\" fill={true} name=\"lightbulb\" size={24} />\n </Box>\n )\n\n/** Micro, and any variant not registered below: the logo alone. */\nconst PlainVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile center={<LogoOrFallback logo={logo} />} size={ICON_SIZE} sx={{ flexShrink: 0 }} />\n)\n\n/** ditto `with_warning_badge`: the logo badged with a status glyph (Figma 1941:111897). */\nconst WarningBadgeVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"warning\" />}\n />\n)\n\n/**\n * ditto `with_illustration`: artwork in place of the logo tile (Fee Detected's search illustration).\n * A single SVG themed at runtime by `ThemedSVGImage`: its `brand300` elements are recolored to the\n * theme's `primary.main` (so it follows dark mode), while `fill=\"white\"` areas stay white. The\n * slot's `logo` is deliberately unused: the illustration replaces the tile.\n */\nconst IllustrationVisual = () => {\n return (\n <ThemedSVGImage\n divProps={{ style: { flexShrink: 0, lineHeight: 0, width: 'max-content' } }}\n image={FeeDetectedIllustration}\n />\n )\n}\n\n/**\n * ditto `category_color`: a tiny bar chart of the latest bars in place of the logo tile, tinted by\n * the slot's category, the newest bar solid (Figma 222:33404). Draws nothing without a series.\n */\nconst BarChartVisual = ({ data }: InsightVisualProps) => {\n const series = buildDataSeries(slot<DataSeries>(data, 'series'))\n if (!series.length) return null\n\n const categoryGuid = slot<string>(data, 'category_guid')\n const bars = buildChartData(series, BAR_ARIA_LABEL).slice(-BAR_CHART_BAR_COUNT)\n\n return (\n <Box data-testid=\"compact-insight-card-bar-chart\" sx={{ flexShrink: 0 }}>\n <TinyBarChart\n color={(theme) =>\n categoryGuid ? getCategoryColor(categoryGuid, theme) : theme.palette.primary.main\n }\n data={bars}\n />\n </Box>\n )\n}\n\n/**\n * The card's right-hand visual, one component per ditto layout variant.\n *\n * A variant names a rendering *shape*, not an insight or a surface — `with_header` already serves\n * both Large Transaction and Fee Detected — so an insight wanting the badged logo reuses\n * `with_warning_badge`. Only a genuinely different visual registers a new entry, and existing ones\n * are never touched.\n *\n * `minimal` draws the plain logo and is registered explicitly even though it matches the fallback:\n * micro and notification resolve it on every render, and an unregistered variant warns. The\n * fallback is for variants we genuinely do not know.\n */\nconst InsightVisual = createVariantBlock<InsightVisualProps>({\n variants: {\n category_color: BarChartVisual,\n minimal: PlainVisual,\n with_illustration: IllustrationVisual,\n with_warning_badge: WarningBadgeVisual,\n },\n fallback: PlainVisual,\n name: 'InsightVisual',\n})\n\n/**\n * Beats whose embedded CTA the card reads from its own envelope key and opens in this card's\n * `ActionBlockLayer`, as a bar click does on the full card. The trigger names that key, so the layer\n * resolves the same CTA. Every other beat keeps `primary_cta` and hands it to the host's `onCtaClick`\n * (e.g. `contact_support_block`). A new beat adds its template here.\n */\nconst BEAT_CTA_CONFIG: Record<\n string,\n { key: 'primary_cta' | 'in_description_cta'; trigger: ActionDrawerTrigger }\n> = {\n BillAmountNotStandard: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n}\n\nexport interface CompactInsightCardProps {\n /** A `micro` or `embedded` envelope. */\n payload: InsightsPayload\n /** The envelope's beat; when given, the card mounts its `ActionBlockLayer` for CTA drawers. */\n beat?: Beat\n /**\n * Makes the whole card the tap target. What a tap does is the host's decision (post to the\n * host app, open a drawer, …); the card never opens anything itself. Omit for a static card.\n */\n onTap?: () => void\n /** Receives the primary CTA when tapped. The card does not resolve the CTA's block itself. */\n onCtaClick?: (cta: PrimaryCTA) => void\n /**\n * Renders the CTA disabled — label shown, `aria-disabled`, not tappable — for a host that cannot\n * honour it (e.g. `contact_support_block` when the client's `enable_support_requests` is off).\n */\n isCtaDisabled?: boolean\n}\n\nconst stopPropagation = (event: MouseEvent) => event.stopPropagation()\n\n/**\n * The one compact renderer the micro and embedded envelopes share (`insights_v2.2.md` §8.3).\n *\n * Figma 1941:111897 (Embedded | Large Transaction): a title row with the overflow slot, the HTML\n * description with the primary CTA under it, and on the right the slot's `logo` in a\n * `<BadgedTile>`. Under ditto's `with_warning_badge` variant the tile takes a status badge; under\n * `minimal` it draws the logo alone. The card lays out from the envelope alone and never reads\n * `widget_type`.\n *\n * The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot\n * carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.\n */\nconst CompactInsightCard = ({\n beat,\n isCtaDisabled = false,\n onCtaClick,\n onTap,\n payload,\n}: CompactInsightCardProps) => {\n const { openActionDrawer } = useInsightsV2Store()\n const { description, instance_slot, primary_cta, title } = payload\n const beatCta = BEAT_CTA_CONFIG[payload.template ?? '']\n const cta = beatCta ? payload[beatCta.key] : primary_cta\n // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = slot<LogoRef>(instance_slot.data, 'logo')\n\n const handleCtaClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (isCtaDisabled || !cta) return\n\n if (beatCta) {\n if (beat) openActionDrawer({ guid: beat.guid, trigger: beatCta.trigger })\n return\n }\n if (primary_cta) onCtaClick?.(primary_cta)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n // Only the card itself: Enter on the CTA button is the button's own click.\n if (event.target !== event.currentTarget) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n onTap?.()\n }\n }\n\n const interactiveProps = onTap\n ? { onClick: onTap, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 }\n : {}\n\n return (\n <>\n <Card\n data-testid=\"compact-insight-card\"\n {...interactiveProps}\n sx={{\n minWidth: 288,\n pb: 12,\n pl: 8,\n pr: 16,\n pt: 8,\n ...(onTap && { cursor: 'pointer' }),\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n justifyContent: 'space-between',\n pl: 8,\n pt: 4,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {title ?? ''}\n </Text>\n {/* The menu renders only when the host wired `onMenuAction` (BeatActionsProvider). */}\n <Box onClick={stopPropagation} sx={{ display: 'flex' }}>\n <InsightOptionsMenu />\n </Box>\n </Stack>\n\n <Stack sx={{ flexDirection: 'row', gap: 16, pl: 8, pt: 4 }}>\n <Stack sx={{ flex: 1, gap: 8, minWidth: 0 }}>\n {/* `html_text` is rendered server-side by mrs_content from the ditto copy template (bold\n amount / merchant), not user-authored input; painted the same way `BaseLayout` paints\n the full card's description. */}\n <P\n dangerouslySetInnerHTML={{ __html: description.html_text }}\n data-testid=\"compact-insight-card-description\"\n variant=\"subtitle2\"\n />\n {cta?.label && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // Figma 1941:111897 lines the CTA label up with the description's left edge. The\n // column already pads 8, so the button's own 8 is pulled back out — padding kept so\n // the tap target does not shrink.\n mt: 5,\n ml: -8,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n {cta.label}\n </Button>\n )}\n </Stack>\n\n <InsightVisual data={instance_slot.data} logo={rowLogo} variant={instance_slot.variant} />\n </Stack>\n </Card>\n {/* Outside the Card: the drawer is a portal, and its clicks would otherwise bubble to `onTap`. */}\n {beat && <ActionBlockLayer beat={beat} />}\n </>\n )\n}\n\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AAU;AAAA,QAAE;AAAA,QAA1C,UAAA,CAIE,gBAAA,EAAC,GAAD;AAAA,UACE,yBAAyB,EAAE,QAAQ,EAAY,UAAU;AAAA,UACzD,eAAY;AAAA,UACZ,SAAQ;AAAA,QACT,CAAA,GACA,GAAK,SACJ,gBAAA,EAAC,GAAD;AAAA,UACE,iBAAe;AAAA,UACf,SAAS;AAAA,UACT,MAAK;AAAA,UACL,IAAI;AAAA,YACF,WAAW;AAAA,YAIX,IAAI;AAAA,YACJ,IAAI;AAAA,YACJ,IAAI;AAAA,YACJ,GAAI,KAAiB;AAAA,cACnB,OAAO;AAAA,cACP,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,UACA,SAAQ;AAAA,UAEP,UAAA,EAAI;AAAA,QACC,CAAA,CAEL;AAAA,MAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAe,MAAM,EAAc;AAAA,QAAM,MAAM;AAAA,QAAS,SAAS,EAAc;AAAA,MAAU,CAAA,CACpF;AAAA,IACH,CAAA,CAAA;AAAA,EAEL,CAAA,GAAA,KAAQ,gBAAA,EAAC,GAAD,EAAwB,MAAA,EAAO,CAAA,CACxC,EAAA,CAAA;AAEN"}
@@ -1,10 +1,10 @@
1
- import { ThemedSVGImage as r } from "./ThemedSVGImage.es.js";
2
- import { ReactComponent as o } from "../../../insights/components/shared/images/EmptyBarChart.es.js";
1
+ import { ReactComponent as r } from "../../../insights/components/shared/images/EmptyBarChart.es.js";
2
+ import { ThemedSVGImage as o } from "./ThemedSVGImage.es.js";
3
3
  import { jsx as m } from "react/jsx-runtime";
4
4
  function p() {
5
- return /* @__PURE__ */ m(r, {
5
+ return /* @__PURE__ */ m(o, {
6
6
  divProps: { style: {} },
7
- image: o
7
+ image: r
8
8
  });
9
9
  }
10
10
  export {