@mx-cartographer/experiences 9.7.173 → 9.7.175

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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +20 -0
  3. package/dist/core/types/localization/index.d.ts +1 -1
  4. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +11 -0
  5. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +164 -0
  6. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -0
  7. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/index.d.ts +1 -0
  8. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.d.ts +46 -0
  9. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.es.js +58 -0
  10. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.es.js.map +1 -0
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +2 -1
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +72 -56
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.d.ts +7 -1
  15. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +84 -82
  16. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +4 -0
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +169 -133
  19. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
  21. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  22. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +20 -14
  23. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js.map +1 -1
  24. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/QuizStars.es.js +238 -0
  25. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/QuizStars.es.js.map +1 -0
  26. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +3 -1
  27. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +7 -2
  28. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  29. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  30. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  31. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  32. package/dist/insights-v2/mappings/blocks.es.js +148 -140
  33. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.7.175] - 11-17-2026
2
+
3
+ - Monthly Top Merchant Spending Top Merchants drawer (WEC-2331)
4
+
5
+ ## [9.7.174] - 11-17-2026
6
+
7
+ - **ADDED** - Monthly Top Transacted Merchant V2: the mini card draws the stars illustration (`svg_image_block` variant `quiz`) above the quiz description, the micro card the "?" tile with "Learn More"; Storybook gains quiz, results and zero state fixtures for full, mini and micro (WEC-2284)
8
+
1
9
  ## [9.7.173] - 11-17-2026
2
10
 
3
11
  - **FIXED** - Discovered Accounts' pending card wash is at Figma's 127° (WEC-2342)
@@ -436,6 +436,24 @@ export interface CreditUtilizationCopy {
436
436
  tip?: string;
437
437
  your_cards?: string;
438
438
  }
439
+ /**
440
+ * Monthly Top Merchant Spending's Top Merchants drawer (`top_merchants_block`) and the Merchant
441
+ * History drawer a row opens (`transaction_history_block`, `top_merchant` variant).
442
+ */
443
+ export interface TopMerchantsCopy {
444
+ /** Drawer title, e.g. "Top Merchants". */
445
+ title: string;
446
+ /** Under the summary amount, e.g. "Total Top Merchant Spending". */
447
+ total_spending: string;
448
+ /** A row's title: `_1{rank}` and `_2{merchant}`, e.g. "_1{rank} - _2{merchant}". */
449
+ rank_merchant: string;
450
+ /** The nested drawer's title, e.g. "Merchant History". */
451
+ merchant_history_title: string;
452
+ /** Merchant History heading: `_1{merchant}`, e.g. "_1{merchant} Spending". */
453
+ merchant_spending: string;
454
+ /** Merchant History sub-heading: `_1{rank}` and `_2{month}`, e.g. "#_1{rank} top merchant (_2{month})". */
455
+ most_visited_merchant: string;
456
+ }
439
457
  /** The credit card payoff calculator drawer (`payoff_calculator_block`). */
440
458
  export interface PayoffCalculatorCopy {
441
459
  /** Drawer title, e.g. "Interest Charges". */
@@ -556,6 +574,8 @@ export interface InsightsFeedCopy {
556
574
  credit_utilization?: CreditUtilizationCopy;
557
575
  account_list?: AccountListCopy;
558
576
  payoff_calculator?: PayoffCalculatorCopy;
577
+ /** Optional until the localized-content service ships the namespace. */
578
+ top_merchants?: TopMerchantsCopy;
559
579
  budget_details?: BudgetDetailsCopy;
560
580
  upcoming_subscription_block?: UpcomingSubscriptionBlockCopy;
561
581
  /** Optional until the localized-content service ships the namespace. */
@@ -13,7 +13,7 @@ export type { DebtsCopy } from './DebtsCopy';
13
13
  export type { FinstrongCopy } from './FinstrongCopy';
14
14
  export type { GoalsCopy } from './GoalsCopy';
15
15
  export type { HelpCopy, HelpByCategoryList } from './HelpCopy';
16
- export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
16
+ export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, TopMerchantsCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
17
17
  export type { InvestmentsCopy } from './InvestmentsCopy';
18
18
  export type { MicroInsightsCopy } from './MicroInsightsCopy';
19
19
  export type { NetWorthCopy } from './NetWorthCopy';
@@ -0,0 +1,11 @@
1
+ import { GlobalCopy, TopMerchantsCopy } from '../../../core';
2
+ import { ActionBlockProps } from '../../mappings/blocks';
3
+ export declare const selectTopMerchantsCopy: (copy: GlobalCopy) => TopMerchantsCopy | undefined;
4
+ /**
5
+ * Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over
6
+ * up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,
7
+ * `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.
8
+ */
9
+ export declare const TopMerchantsBlock: (({ beat }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
10
+ displayName: string;
11
+ };
@@ -0,0 +1,164 @@
1
+ import { buildDynamicCopy as w, buildPluralCopy as B } from "../../../core/utils/Localization.es.js";
2
+ import { useGlobalCopyStore as R, useTransactionStore as A } from "../../../common/context/hooks.es.js";
3
+ import { CURRENCY_FORMAT as _, formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
4
+ import E from "../../../common/components/drawer/Drawer.es.js";
5
+ import F from "../../components/LogoMark.es.js";
6
+ import { ELEVATION_SHADOW as N } from "../../components/shared/elevation.es.js";
7
+ import { useOpenedCta as G } from "../useOpenedCta.es.js";
8
+ import { useRequiredCopy as H } from "../useRequiredCopy.es.js";
9
+ import { TransactionHistoryBlock as L } from "../TransactionHistoryBlock/TransactionHistoryBlock.es.js";
10
+ import { TransactionListHeaderIconTile as D } from "../TransactionListBlock/TransactionListHeaderIconTile.es.js";
11
+ import { merchantHistoryCta as I, readTopMerchants as U } from "./layout.es.js";
12
+ import d from "react";
13
+ import { observer as j } from "mobx-react-lite";
14
+ import m from "@mui/material/Stack";
15
+ import { Text as i } from "@mxenabled/mxui";
16
+ import { Icon as P } from "@mxenabled/mx-icons";
17
+ import { Fragment as W, jsx as o, jsxs as a } from "react/jsx-runtime";
18
+ import f from "@mui/material/Box";
19
+ import Y from "@mui/material/ButtonBase";
20
+ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V = "_1{count} transaction", q = ({ copy: c, countCopy: n, merchant: t, onClick: p }) => {
21
+ const s = w(c.rank_merchant, String(t.rank), t.merchantName), u = B(n.one, n.many, t.transactionCount, String(t.transactionCount));
22
+ return /* @__PURE__ */ a(Y, {
23
+ onClick: () => p(t),
24
+ sx: {
25
+ borderBottom: 1,
26
+ borderColor: "divider",
27
+ gap: 12,
28
+ justifyContent: "flex-start",
29
+ minHeight: 64,
30
+ px: 16,
31
+ py: 12,
32
+ textAlign: "left",
33
+ width: "100%",
34
+ "&.Mui-focusVisible": { bgcolor: "action.focus" }
35
+ },
36
+ children: [
37
+ /* @__PURE__ */ o(f, {
38
+ "aria-hidden": !0,
39
+ sx: {
40
+ display: "flex",
41
+ flexShrink: 0
42
+ },
43
+ children: /* @__PURE__ */ o(F, {
44
+ logo: {
45
+ category_guid: t.categoryGuid,
46
+ merchant_guid: t.merchantGuid,
47
+ merchant_name: t.merchantName
48
+ },
49
+ size: 32
50
+ })
51
+ }),
52
+ /* @__PURE__ */ a(m, {
53
+ sx: {
54
+ flexGrow: 1,
55
+ minWidth: 0
56
+ },
57
+ children: [/* @__PURE__ */ o(i, {
58
+ bold: !0,
59
+ component: "span",
60
+ truncate: !0,
61
+ variant: "body1",
62
+ children: s
63
+ }), /* @__PURE__ */ o(i, {
64
+ component: "span",
65
+ variant: "caption",
66
+ children: u
67
+ })]
68
+ }),
69
+ /* @__PURE__ */ o(i, {
70
+ component: "span",
71
+ sx: { flexShrink: 0 },
72
+ variant: "body1",
73
+ children: x(t.total, _.cents)
74
+ }),
75
+ /* @__PURE__ */ o(P, {
76
+ "aria-hidden": !0,
77
+ name: "chevron_right",
78
+ size: 20,
79
+ sx: { flexShrink: 0 }
80
+ })
81
+ ]
82
+ });
83
+ }, fo = j(function({ beat: n }) {
84
+ const t = H($), { common: p, insights_feed: s } = R(), u = G(n), l = A(), r = d.useRef(null), [h, g] = d.useState(), [C, y] = d.useState(), { describedMonth: b, merchants: k, merchantHistory: S, totalAmount: v } = U(u?.drilldown_data ?? n.insights_payload?.drilldown_data), T = {
85
+ many: s?.general?.transaction_count ?? z,
86
+ one: s?.general?.transaction_count_one ?? V
87
+ }, O = (e) => {
88
+ r.current = { ...l.filter }, g(e), y(I(e, S, b));
89
+ }, M = () => {
90
+ g(void 0), y(void 0), r.current !== null && (l.setFilter(r.current), r.current = null);
91
+ };
92
+ return d.useEffect(() => () => {
93
+ r.current !== null && (l.setFilter(r.current), r.current = null);
94
+ }, [l]), /* @__PURE__ */ a(W, { children: [
95
+ /* @__PURE__ */ o(f, {
96
+ sx: {
97
+ bgcolor: "background.default",
98
+ p: 24
99
+ },
100
+ children: /* @__PURE__ */ a(m, {
101
+ direction: "row",
102
+ sx: {
103
+ alignItems: "center",
104
+ bgcolor: "background.paper",
105
+ borderRadius: "8px",
106
+ boxShadow: N[1],
107
+ gap: 12,
108
+ p: 16
109
+ },
110
+ children: [/* @__PURE__ */ o(D, { name: "payments" }), /* @__PURE__ */ a(m, {
111
+ sx: {
112
+ gap: 4,
113
+ minWidth: 0
114
+ },
115
+ children: [/* @__PURE__ */ o(i, {
116
+ bold: !0,
117
+ component: "p",
118
+ variant: "h2",
119
+ children: x(v, _.cents)
120
+ }), /* @__PURE__ */ o(i, {
121
+ color: "text.secondary",
122
+ component: "p",
123
+ variant: "body2",
124
+ children: t.total_spending
125
+ })]
126
+ })]
127
+ })
128
+ }),
129
+ /* @__PURE__ */ o(m, {
130
+ component: "ul",
131
+ sx: {
132
+ bgcolor: "background.paper",
133
+ listStyle: "none",
134
+ m: 0,
135
+ p: 0
136
+ },
137
+ children: k.map((e) => /* @__PURE__ */ o(f, {
138
+ component: "li",
139
+ children: /* @__PURE__ */ o(q, {
140
+ copy: t,
141
+ countCopy: T,
142
+ merchant: e,
143
+ onClick: O
144
+ })
145
+ }, e.merchantGuid))
146
+ }),
147
+ /* @__PURE__ */ o(E, {
148
+ ariaLabelClose: p.close_aria,
149
+ isOpen: !!h,
150
+ onClose: M,
151
+ title: t.merchant_history_title,
152
+ children: h && C && /* @__PURE__ */ o(L, {
153
+ beat: n,
154
+ cta: C
155
+ }, h.merchantGuid)
156
+ })
157
+ ] });
158
+ });
159
+ export {
160
+ fo as TopMerchantsBlock,
161
+ $ as selectTopMerchantsCopy
162
+ };
163
+
164
+ //# sourceMappingURL=TopMerchantsBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TopMerchantsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Drawer, useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { GlobalCopy, PrimaryCTA, TopMerchantsCopy } from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport LogoMark from '../../components/LogoMark'\nimport { ELEVATION_SHADOW } from '../../components/shared/elevation'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { TransactionHistoryBlock } from '../TransactionHistoryBlock/TransactionHistoryBlock'\nimport { TransactionListHeaderIconTile } from '../TransactionListBlock/TransactionListHeaderIconTile'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport { merchantHistoryCta, readTopMerchants, type TopMerchant } from './layout'\n\nexport const selectTopMerchantsCopy = (copy: GlobalCopy) => copy.insights_feed?.top_merchants\n\n// English defaults until the localized-content service ships the pill copy in every locale, as the\n// Transaction List summary card does.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\ninterface MerchantRowProps {\n copy: TopMerchantsCopy\n countCopy: { many: string; one: string }\n merchant: TopMerchant\n onClick: (merchant: TopMerchant) => void\n}\n\n/** Figma `<ListItem> | Utility Row`: logo, \"{rank} - {merchant}\" over its count, total, chevron. */\nconst MerchantRow = ({ copy, countCopy, merchant, onClick }: MerchantRowProps) => {\n const title = buildDynamicCopy(\n copy.rank_merchant,\n String(merchant.rank),\n merchant.merchantName,\n ) as string\n const count = buildPluralCopy(\n countCopy.one,\n countCopy.many,\n merchant.transactionCount,\n String(merchant.transactionCount),\n ) as string\n\n return (\n <ButtonBase\n onClick={() => onClick(merchant)}\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n gap: 12,\n justifyContent: 'flex-start',\n minHeight: 64,\n px: 16,\n py: 12,\n textAlign: 'left',\n width: '100%',\n '&.Mui-focusVisible': { bgcolor: 'action.focus' },\n }}\n >\n <Box aria-hidden={true} sx={{ display: 'flex', flexShrink: 0 }}>\n <LogoMark\n logo={{\n category_guid: merchant.categoryGuid,\n merchant_guid: merchant.merchantGuid,\n merchant_name: merchant.merchantName,\n }}\n size={32}\n />\n </Box>\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text bold={true} component=\"span\" truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text component=\"span\" variant=\"caption\">\n {count}\n </Text>\n </Stack>\n <Text component=\"span\" sx={{ flexShrink: 0 }} variant=\"body1\">\n {formatCurrency(merchant.total, CURRENCY_FORMAT.cents)}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={20} sx={{ flexShrink: 0 }} />\n </ButtonBase>\n )\n}\n\n/**\n * Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over\n * up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,\n * `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.\n */\nexport const TopMerchantsBlock = observer(function TopMerchantsBlock({ beat }: ActionBlockProps) {\n const copy = useRequiredCopy(selectTopMerchantsCopy)\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const openedCta = useOpenedCta(beat)\n const transactionStore = useTransactionStore()\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n const [selected, setSelected] = React.useState<TopMerchant>()\n const [selectedCta, setSelectedCta] = React.useState<PrimaryCTA>()\n\n const { describedMonth, merchants, merchantHistory, totalAmount } = readTopMerchants(\n openedCta?.drilldown_data ?? beat.insights_payload?.drilldown_data,\n )\n const countCopy = {\n many: insightsCopy?.general?.transaction_count ?? DEFAULT_COUNT_COPY,\n one: insightsCopy?.general?.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n }\n\n const handleMerchantClick = (merchant: TopMerchant) => {\n filterBeforeOpen.current = { ...transactionStore.filter }\n setSelected(merchant)\n setSelectedCta(merchantHistoryCta(merchant, merchantHistory, describedMonth))\n }\n\n const handleClose = () => {\n setSelected(undefined)\n setSelectedCta(undefined)\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n }\n\n React.useEffect(\n () => () => {\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n },\n [transactionStore],\n )\n\n return (\n <>\n <Box sx={{ bgcolor: 'background.default', p: 24 }}>\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"payments\" />\n <Stack sx={{ gap: 4, minWidth: 0 }}>\n <Text bold={true} component=\"p\" variant=\"h2\">\n {formatCurrency(totalAmount, CURRENCY_FORMAT.cents)}\n </Text>\n <Text color=\"text.secondary\" component=\"p\" variant=\"body2\">\n {copy.total_spending}\n </Text>\n </Stack>\n </Stack>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {merchants.map((merchant) => (\n <Box component=\"li\" key={merchant.merchantGuid}>\n <MerchantRow\n copy={copy}\n countCopy={countCopy}\n merchant={merchant}\n onClick={handleMerchantClick}\n />\n </Box>\n ))}\n </Stack>\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={!!selected}\n onClose={handleClose}\n title={copy.merchant_history_title}\n >\n {selected && selectedCta && (\n <TransactionHistoryBlock beat={beat} cta={selectedCta} key={selected.merchantGuid} />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAa,IAAA,CAA0B,MAAqB,EAAK,eAAe,eAI1E,IAAqB,0BACrB,IAAyB,yBAUzB,IAAA,CAAe,EAAE,MAAA,GAAM,WAAA,GAAW,UAAA,GAAU,SAAA,EAAA,MAAgC;AAChF,QAAM,IAAQ,EACZ,EAAK,eACL,OAAO,EAAS,IAAI,GACpB,EAAS,YACX,GACM,IAAQ,EACZ,EAAU,KACV,EAAU,MACV,EAAS,kBACT,OAAO,EAAS,gBAAgB,CAClC;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAA,MAAe,EAAQ,CAAQ;AAAA,IAC/B,IAAI;AAAA,MACF,cAAc;AAAA,MACd,aAAa;AAAA,MACb,KAAK;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MerchantsBlock, selectTopMerchantsCopy } from './TopMerchantsBlock';
@@ -0,0 +1,46 @@
1
+ import { DataSeries, DrilldownData, PrimaryCTA } from '../../../core';
2
+ /** The drawer lists at most this many merchants (Figma: "Top 10 list"). */
3
+ export declare const TOP_MERCHANTS_MAX = 10;
4
+ /** One ranked merchant in the Top Merchants drawer. */
5
+ export interface TopMerchant {
6
+ /** 1-based place in the month's ranking. */
7
+ rank: number;
8
+ merchantGuid: string;
9
+ merchantName: string;
10
+ categoryGuid?: string;
11
+ total: number;
12
+ transactionCount: number;
13
+ averageAmount?: number;
14
+ }
15
+ export interface TopMerchantsData {
16
+ /** The month the ranking covers, `YYYY-MM-DD`. */
17
+ describedMonth?: string;
18
+ /** The headline amount: the payload's total, else the sum of the listed merchants. */
19
+ totalAmount: number;
20
+ merchants: TopMerchant[];
21
+ /** Six months of spend, one column per merchant guid (`names: ['date', ...guids]`). */
22
+ merchantHistory?: DataSeries;
23
+ }
24
+ /**
25
+ * The Top Merchants drawer's facts, from the drilldown_data of the CTA that opened it (proposed
26
+ * contract, pending tupac/ditto):
27
+ *
28
+ * ```
29
+ * {
30
+ * total_amount: 2350,
31
+ * described_month: '2026-06-01',
32
+ * merchants: [{ merchant_guid, merchant_name, category_guid, total, transaction_count, average_amount }],
33
+ * merchant_history: { names: ['date', 'MCH-…', …], types: ['date', 'currency', …], data: [['2026-01-01', 12.5, …], …] },
34
+ * }
35
+ * ```
36
+ *
37
+ * Merchants are ranked by total, highest first, and capped at ten.
38
+ */
39
+ export declare const readTopMerchants: (data?: DrilldownData) => TopMerchantsData;
40
+ /** One merchant's column of the shared history, as the two-column series a bar chart reads. */
41
+ export declare const merchantSeries: (history: DataSeries | undefined, merchantGuid: string) => DataSeries | undefined;
42
+ /**
43
+ * The CTA a row hands the nested Merchant History drawer: Transaction History's `top_merchant`
44
+ * variant, fed the merchant's own six months, average, category, rank, and the described month.
45
+ */
46
+ export declare const merchantHistoryCta: (merchant: TopMerchant, history: DataSeries | undefined, describedMonth?: string) => PrimaryCTA;
@@ -0,0 +1,58 @@
1
+ import { asNonEmptyText as n, asNumber as o } from "../../blocks/slotReaders.es.js";
2
+ import { actionBlocksKey as d } from "../../mappings/actionBlocksKey.es.js";
3
+ import { DRILLDOWN_VARIANTS as u } from "../TransactionHistoryBlock/layout.es.js";
4
+ var m = (r) => typeof r == "object" && r !== null && !Array.isArray(r), y = (r) => m(r) && Array.isArray(r.names) && Array.isArray(r.data) && r.data.every(Array.isArray), _ = (r) => {
5
+ if (!m(r)) return;
6
+ const e = n(r.merchant_guid), a = n(r.merchant_name), t = o(r.total);
7
+ if (!(!e || !a || t === void 0))
8
+ return {
9
+ merchantGuid: e,
10
+ merchantName: a,
11
+ categoryGuid: n(r.category_guid),
12
+ total: t,
13
+ transactionCount: o(r.transaction_count) ?? 0,
14
+ averageAmount: o(r.average_amount)
15
+ };
16
+ }, l = (r) => {
17
+ const e = (Array.isArray(r?.merchants) ? r.merchants : []).map(_).filter((a) => a !== void 0).sort((a, t) => t.total - a.total).slice(0, 10).map((a, t) => ({
18
+ ...a,
19
+ rank: t + 1
20
+ }));
21
+ return {
22
+ describedMonth: n(r?.described_month),
23
+ totalAmount: o(r?.total_amount) ?? e.reduce((a, { total: t }) => a + t, 0),
24
+ merchants: e,
25
+ merchantHistory: y(r?.merchant_history) ? r.merchant_history : void 0
26
+ };
27
+ }, A = (r, e) => {
28
+ const a = r?.names ?? [], t = r?.data ?? [], i = a.indexOf("date"), s = a.indexOf(e);
29
+ if (!(i < 0 || s < 0))
30
+ return {
31
+ names: ["date", "amount"],
32
+ types: ["date", "currency"],
33
+ data: t.map((c) => [c[i], c[s]])
34
+ };
35
+ }, p = (r, e, a) => {
36
+ const t = A(e, r.merchantGuid);
37
+ return {
38
+ label: "",
39
+ block: d.TRANSCATION_HISTORY_ACTION_BLOCK,
40
+ variant: u.TOP_MERCHANT,
41
+ drilldown_data: {
42
+ merchant_guid: r.merchantGuid,
43
+ merchant_name: r.merchantName,
44
+ rank: r.rank,
45
+ ...a && { described_month: a },
46
+ ...r.categoryGuid && { category_guid: r.categoryGuid },
47
+ ...r.averageAmount !== void 0 && { average_amount: r.averageAmount },
48
+ ...t && { data_series: t }
49
+ }
50
+ };
51
+ };
52
+ export {
53
+ p as merchantHistoryCta,
54
+ A as merchantSeries,
55
+ l as readTopMerchants
56
+ };
57
+
58
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TopMerchantsBlock/layout.ts"],"sourcesContent":["import type { DataSeries, DrilldownData, PrimaryCTA } from '../../../core'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport { actionBlocksKey } from '../../mappings/actionBlocksKey'\nimport { DRILLDOWN_VARIANTS } from '../TransactionHistoryBlock/layout'\n\n/** The drawer lists at most this many merchants (Figma: \"Top 10 list\"). */\nexport const TOP_MERCHANTS_MAX = 10\n\n/** One ranked merchant in the Top Merchants drawer. */\nexport interface TopMerchant {\n /** 1-based place in the month's ranking. */\n rank: number\n merchantGuid: string\n merchantName: string\n categoryGuid?: string\n total: number\n transactionCount: number\n averageAmount?: number\n}\n\nexport interface TopMerchantsData {\n /** The month the ranking covers, `YYYY-MM-DD`. */\n describedMonth?: string\n /** The headline amount: the payload's total, else the sum of the listed merchants. */\n totalAmount: number\n merchants: TopMerchant[]\n /** Six months of spend, one column per merchant guid (`names: ['date', ...guids]`). */\n merchantHistory?: DataSeries\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst isDataSeries = (value: unknown): value is DataSeries =>\n isRecord(value) &&\n Array.isArray(value.names) &&\n Array.isArray(value.data) &&\n value.data.every(Array.isArray)\n\nconst readMerchant = (row: unknown): Omit<TopMerchant, 'rank'> | undefined => {\n if (!isRecord(row)) return undefined\n\n const merchantGuid = asNonEmptyText(row.merchant_guid)\n const merchantName = asNonEmptyText(row.merchant_name)\n const total = asNumber(row.total)\n\n // A row the drawer cannot name or price is dropped rather than drawn half-empty.\n if (!merchantGuid || !merchantName || total === undefined) return undefined\n\n return {\n merchantGuid,\n merchantName,\n categoryGuid: asNonEmptyText(row.category_guid),\n total,\n transactionCount: asNumber(row.transaction_count) ?? 0,\n averageAmount: asNumber(row.average_amount),\n }\n}\n\n/**\n * The Top Merchants drawer's facts, from the drilldown_data of the CTA that opened it (proposed\n * contract, pending tupac/ditto):\n *\n * ```\n * {\n * total_amount: 2350,\n * described_month: '2026-06-01',\n * merchants: [{ merchant_guid, merchant_name, category_guid, total, transaction_count, average_amount }],\n * merchant_history: { names: ['date', 'MCH-…', …], types: ['date', 'currency', …], data: [['2026-01-01', 12.5, …], …] },\n * }\n * ```\n *\n * Merchants are ranked by total, highest first, and capped at ten.\n */\nexport const readTopMerchants = (data?: DrilldownData): TopMerchantsData => {\n const rows = Array.isArray(data?.merchants) ? data.merchants : []\n const merchants = rows\n .map(readMerchant)\n .filter((merchant): merchant is Omit<TopMerchant, 'rank'> => merchant !== undefined)\n .sort((a, b) => b.total - a.total)\n .slice(0, TOP_MERCHANTS_MAX)\n .map((merchant, index) => ({ ...merchant, rank: index + 1 }))\n\n return {\n describedMonth: asNonEmptyText(data?.described_month),\n totalAmount:\n asNumber(data?.total_amount) ?? merchants.reduce((sum, { total }) => sum + total, 0),\n merchants,\n merchantHistory: isDataSeries(data?.merchant_history) ? data.merchant_history : undefined,\n }\n}\n\n/** One merchant's column of the shared history, as the two-column series a bar chart reads. */\nexport const merchantSeries = (\n history: DataSeries | undefined,\n merchantGuid: string,\n): DataSeries | undefined => {\n const names = history?.names ?? []\n const rows = history?.data ?? []\n const dateIndex = names.indexOf('date')\n const amountIndex = names.indexOf(merchantGuid)\n\n if (dateIndex < 0 || amountIndex < 0) return undefined\n\n return {\n names: ['date', 'amount'],\n types: ['date', 'currency'],\n data: rows.map((row) => [row[dateIndex], row[amountIndex]]),\n } as DataSeries\n}\n\n/**\n * The CTA a row hands the nested Merchant History drawer: Transaction History's `top_merchant`\n * variant, fed the merchant's own six months, average, category, rank, and the described month.\n */\nexport const merchantHistoryCta = (\n merchant: TopMerchant,\n history: DataSeries | undefined,\n describedMonth?: string,\n): PrimaryCTA => {\n const dataSeries = merchantSeries(history, merchant.merchantGuid)\n\n return {\n label: '',\n block: actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK,\n variant: DRILLDOWN_VARIANTS.TOP_MERCHANT,\n drilldown_data: {\n merchant_guid: merchant.merchantGuid,\n merchant_name: merchant.merchantName,\n rank: merchant.rank,\n ...(describedMonth && { described_month: describedMonth }),\n ...(merchant.categoryGuid && { category_guid: merchant.categoryGuid }),\n ...(merchant.averageAmount !== undefined && { average_amount: merchant.averageAmount }),\n ...(dataSeries && { data_series: dataSeries }),\n },\n }\n}\n"],"mappings":";;;AA8BA,IAAM,IAAA,CAAY,MAChB,OAAO,KAAU,YAAY,MAAU,QAAQ,CAAC,MAAM,QAAQ,CAAK,GAE/D,IAAA,CAAgB,MACpB,EAAS,CAAK,KACd,MAAM,QAAQ,EAAM,KAAK,KACzB,MAAM,QAAQ,EAAM,IAAI,KACxB,EAAM,KAAK,MAAM,MAAM,OAAO,GAE1B,IAAA,CAAgB,MAAwD;AAC5E,MAAI,CAAC,EAAS,CAAG,EAAG;AAEpB,QAAM,IAAe,EAAe,EAAI,aAAa,GAC/C,IAAe,EAAe,EAAI,aAAa,GAC/C,IAAQ,EAAS,EAAI,KAAK;AAGhC,MAAI,GAAC,KAAgB,CAAC,KAAgB,MAAU;AAEhD,WAAO;AAAA,MACL,cAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAc,EAAe,EAAI,aAAa;AAAA,MAC9C,OAAA;AAAA,MACA,kBAAkB,EAAS,EAAI,iBAAiB,KAAK;AAAA,MACrD,eAAe,EAAS,EAAI,cAAc;AAAA,IAC5C;AACF,GAiBa,IAAA,CAAoB,MAA2C;AAE1E,QAAM,KADO,MAAM,QAAQ,GAAM,SAAS,I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,eAAe,EAAS,aAAa;AAAA,MACpE,GAAI,EAAS,kBAAkB,UAAa,EAAE,gBAAgB,EAAS,cAAc;AAAA,MACrF,GAAI,KAAc,EAAE,aAAa,EAAW;AAAA,IAC9C;AAAA,EACF;AACF"}
@@ -11,6 +11,7 @@ interface TransactionDrillDownProps {
11
11
  heading?: string;
12
12
  subHeadingText?: string;
13
13
  icon?: React.ReactNode;
14
+ logo?: React.ReactNode;
14
15
  tabs?: TabItem[];
15
16
  selectedIndex: number;
16
17
  top: React.ReactNode;
@@ -21,7 +22,7 @@ interface TransactionDrillDownProps {
21
22
  baseTransactions?: Transaction[];
22
23
  subTabs?: Omit<SubTabsProps, 'id'>;
23
24
  }
24
- export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
25
+ export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, logo, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
25
26
  displayName: string;
26
27
  };
27
28
  export default TransactionDrillDown;
@@ -1,38 +1,38 @@
1
- import { useGlobalCopyStore as j, useTransactionStore as A } from "../../../common/context/hooks.es.js";
2
- import { exportTransactionsToCSV as R } from "../../../core/utils/TransactionUtils.es.js";
3
- import E from "../../../transactions/components/shared/TransactionList.es.js";
1
+ import { useGlobalCopyStore as A, useTransactionStore as R } from "../../../common/context/hooks.es.js";
2
+ import { exportTransactionsToCSV as E } from "../../../core/utils/TransactionUtils.es.js";
3
+ import G from "../../../transactions/components/shared/TransactionList.es.js";
4
4
  import { TipSection as N } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
5
- import { DRAWER_TIP_ICON as G } from "../../components/drawerTip.es.js";
6
- import { SubTabs as O, subTabPanelProps as U } from "../../components/SubTabs.es.js";
5
+ import { DRAWER_TIP_ICON as O } from "../../components/drawerTip.es.js";
6
+ import { SubTabs as U, subTabPanelProps as V } from "../../components/SubTabs.es.js";
7
7
  import "react";
8
- import { observer as V } from "mobx-react-lite";
9
- import m from "@mui/material/Stack";
10
- import { H3 as q, Text as p } from "@mxenabled/mxui";
11
- import z from "@mui/material/Button";
12
- import { Icon as J } from "@mxenabled/mx-icons";
8
+ import { observer as q } from "mobx-react-lite";
9
+ import e from "@mui/material/Stack";
10
+ import { H3 as z, Text as p } from "@mxenabled/mxui";
11
+ import J from "@mui/material/Button";
12
+ import { Icon as K } from "@mxenabled/mx-icons";
13
13
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
14
14
  import t from "@mui/material/Box";
15
- import K from "@mui/material/Tab";
16
- import M from "@mui/material/Tabs";
17
- var _ = "transaction-drill-down-panel", y = (b) => `transaction-details-tab-${b}`, C = "transaction-drill-down-series", mr = V(function({ ariaLabel: S, heading: e, subHeadingText: s, icon: D, tabs: f, selectedIndex: l, top: h, onSelectionChange: I, transactionFilter: x, tipSection: T, onEachRowClick: w, baseTransactions: B, subTabs: v }) {
18
- const { transactions: c } = j(), { sortedTransactionsWithSplits: k, tags: P, detailedTransactions: W } = A(), d = !!f?.length, a = v?.tabs.length ? v : void 0, L = S ?? c.transactions_title, $ = (i, n) => {
15
+ import M from "@mui/material/Tab";
16
+ import Q from "@mui/material/Tabs";
17
+ var y = "transaction-drill-down-panel", S = (b) => `transaction-details-tab-${b}`, w = "transaction-drill-down-series", pr = q(function({ ariaLabel: C, heading: l, subHeadingText: s, icon: D, logo: h, tabs: f, selectedIndex: c, top: x, onSelectionChange: I, transactionFilter: T, tipSection: u, onEachRowClick: B, baseTransactions: k, subTabs: v }) {
18
+ const { transactions: d } = A(), { sortedTransactionsWithSplits: W, tags: P, detailedTransactions: L } = R(), m = !!f?.length, a = v?.tabs.length ? v : void 0, $ = C ?? d.transactions_title, j = (i, n) => {
19
19
  I?.(n);
20
- }, u = x ? (B ?? W).filter(x(l)) : void 0, g = u ?? k;
20
+ }, g = T ? (k ?? L).filter(T(c)) : void 0, _ = g ?? W;
21
21
  return /* @__PURE__ */ o(t, {
22
22
  sx: {
23
23
  bgcolor: "background.paper",
24
24
  width: "100%"
25
25
  },
26
- children: [d && /* @__PURE__ */ r(M, {
27
- "aria-label": L,
28
- onChange: $,
26
+ children: [m && /* @__PURE__ */ r(Q, {
27
+ "aria-label": $,
28
+ onChange: j,
29
29
  sx: { mb: 0 },
30
- value: l,
30
+ value: c,
31
31
  variant: "fullWidth",
32
- children: f.map((i, n) => /* @__PURE__ */ r(K, {
33
- "aria-controls": _,
32
+ children: f.map((i, n) => /* @__PURE__ */ r(M, {
33
+ "aria-controls": y,
34
34
  "aria-label": i.ariaLabel,
35
- id: y(n),
35
+ id: S(n),
36
36
  label: i.label,
37
37
  sx: {
38
38
  minWidth: "auto",
@@ -40,49 +40,65 @@ var _ = "transaction-drill-down-panel", y = (b) => `transaction-details-tab-${b}
40
40
  }
41
41
  }, `${i.label}-${n}`))
42
42
  }), /* @__PURE__ */ o(t, {
43
- "aria-labelledby": d ? y(l) : void 0,
44
- id: _,
45
- role: d ? "tabpanel" : void 0,
43
+ "aria-labelledby": m ? S(c) : void 0,
44
+ id: y,
45
+ role: m ? "tabpanel" : void 0,
46
46
  children: [
47
- (e || s) && /* @__PURE__ */ o(m, {
47
+ (l || s) && /* @__PURE__ */ o(e, {
48
48
  sx: {
49
- gap: 4,
49
+ alignItems: "center",
50
+ flexDirection: "row",
51
+ gap: 12,
50
52
  pt: 16,
51
53
  px: 24
52
54
  },
53
- children: [e && /* @__PURE__ */ r(q, { children: e }), s && /* @__PURE__ */ o(m, {
55
+ children: [h && /* @__PURE__ */ r(t, {
56
+ "aria-hidden": !0,
54
57
  sx: {
55
- alignItems: "center",
56
- flexDirection: "row",
57
- gap: 8
58
+ display: "flex",
59
+ flexShrink: 0
60
+ },
61
+ children: h
62
+ }), /* @__PURE__ */ o(e, {
63
+ sx: {
64
+ flexGrow: 1,
65
+ gap: 4,
66
+ minWidth: 0
58
67
  },
59
- children: [D, /* @__PURE__ */ r(p, {
60
- color: "text.secondary",
61
- sx: { letterSpacing: "0.52px" },
62
- textTransform: "uppercase",
63
- variant: "body2",
64
- children: s
68
+ children: [l && /* @__PURE__ */ r(z, { children: l }), s && /* @__PURE__ */ o(e, {
69
+ sx: {
70
+ alignItems: "center",
71
+ flexDirection: "row",
72
+ gap: 8
73
+ },
74
+ children: [D, /* @__PURE__ */ r(p, {
75
+ color: "text.secondary",
76
+ sx: { letterSpacing: "0.52px" },
77
+ textTransform: "uppercase",
78
+ variant: "body2",
79
+ children: s
80
+ })]
65
81
  })]
66
82
  })]
67
83
  }),
68
- h && /* @__PURE__ */ r(t, {
84
+ x && /* @__PURE__ */ r(t, {
69
85
  sx: {
70
86
  pb: 16,
71
87
  pt: 16
72
88
  },
73
- children: h
89
+ children: x
74
90
  }),
75
- T && /* @__PURE__ */ r(N, {
76
- icon: G,
77
- ...T
91
+ u && /* @__PURE__ */ r(N, {
92
+ icon: O,
93
+ ...u
78
94
  }),
79
- a && /* @__PURE__ */ r(O, {
95
+ a && /* @__PURE__ */ r(U, {
80
96
  ...a,
81
- id: C
97
+ id: w
82
98
  }),
83
99
  /* @__PURE__ */ o(t, {
84
- ...a && U(C, a.selectedIndex),
85
- children: [/* @__PURE__ */ o(m, {
100
+ ...a && V(w, a.selectedIndex),
101
+ children: [/* @__PURE__ */ o(e, {
86
102
  sx: {
87
103
  alignItems: "center",
88
104
  borderBottomColor: "divider",
@@ -97,24 +113,24 @@ var _ = "transaction-drill-down-panel", y = (b) => `transaction-details-tab-${b}
97
113
  children: [/* @__PURE__ */ r(p, {
98
114
  bold: !0,
99
115
  variant: "body1",
100
- children: c.transactions_title
101
- }), g.length > 0 && /* @__PURE__ */ r(z, {
116
+ children: d.transactions_title
117
+ }), _.length > 0 && /* @__PURE__ */ r(J, {
102
118
  onClick: () => {
103
- R(g, P);
119
+ E(_, P);
104
120
  },
105
- startIcon: /* @__PURE__ */ r(J, { name: "ios_share" }),
121
+ startIcon: /* @__PURE__ */ r(K, { name: "ios_share" }),
106
122
  sx: { height: 28 },
107
123
  children: /* @__PURE__ */ r(p, {
108
124
  bold: !0,
109
125
  variant: "body2",
110
- children: c.export_csv_btn
126
+ children: d.export_csv_btn
111
127
  })
112
128
  })]
113
129
  }), /* @__PURE__ */ r(t, {
114
130
  sx: { bgcolor: "background.default" },
115
- children: /* @__PURE__ */ r(E, {
116
- transaction: u,
117
- onClick: w
131
+ children: /* @__PURE__ */ r(G, {
132
+ transaction: g,
133
+ onClick: B
118
134
  })
119
135
  })]
120
136
  })
@@ -123,8 +139,8 @@ var _ = "transaction-drill-down-panel", y = (b) => `transaction-details-tab-${b}
123
139
  });
124
140
  });
125
141
  export {
126
- mr as TransactionDrillDown,
127
- mr as default
142
+ pr as TransactionDrillDown,
143
+ pr as default
128
144
  };
129
145
 
130
146
  //# sourceMappingURL=TransactionDrillDown.es.js.map