@mx-cartographer/experiences 9.7.196 → 9.7.198
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 +10 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +4 -0
- package/dist/insights/components/shared/Charts/BarChart/CustomBarPlotV2.d.ts +3 -1
- package/dist/insights/components/shared/Charts/BarChart/CustomBarPlotV2.es.js +29 -21
- package/dist/insights/components/shared/Charts/BarChart/CustomBarPlotV2.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +68 -63
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +94 -91
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +218 -185
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +59 -56
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +22 -11
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/LogoClusterCard.es.js +9 -8
- package/dist/insights-v2/components/LogoClusterCard.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/BarchartV2.d.ts +9 -1
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js +109 -85
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Theme } from '@mui/material/styles'\nimport { endOfMonth, fromUnixTime, isValid, parseISO, startOfMonth } from 'date-fns'\nimport { getCategoryColor } from '../../../core/utils/CategoryUtil'\nimport {\n type Beat,\n type DataSeries,\n type DrilldownData,\n type GlobalCopy,\n type InsightsFeedCopy,\n type Subtitle,\n type Transaction,\n TransactionStatus,\n buildDynamicCopy,\n} from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport type {\n BarChartBlockData,\n DataSet,\n InsightsInstanceSlotData,\n} from '../../../core/types/InsightsInstanceSlotData'\nimport LogoMark from '../../components/LogoMark'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { CURRENCY_FORMAT, type CurrencyFormat } from '../../../core/utils/NumberFormatting'\nimport { Icon } from '@mxenabled/mx-icons'\nimport {\n buildDataSeries,\n type ChartDataSeriesItem,\n} from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport { getLayoutConfig as getDoubleBarLayoutConfig } from '../../blocks/ChartBlocks/DoubleBarChartBlock/layout'\nimport { asGuidList, asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport type { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport {\n calendarDateOf,\n type DrillDownSlotData,\n type SlotDataResolver,\n toDrillDownSlotData,\n} from './utils'\n\nexport interface DrillDownHeader {\n heading?: string\n subHeadingText?: string\n icon?: ReactNode\n // A logo left of the heading and sub-heading (Top Merchant's merchant).\n logo?: ReactNode\n}\n\nexport interface DrillDownHeaderContext {\n title?: string\n subHeader?: Subtitle\n categoryName: string\n selectedDate?: string | Date\n slotData?: DrillDownSlotData\n copy?: InsightsFeedCopy\n}\n\nexport const DRILLDOWN_VARIANTS = {\n TRANSACTION: 'not_standard_amount',\n CATEGORY_SPEND: 'category_spend',\n MONTHLY_SPEND: 'monthly_spend_comparison',\n ACCOUNT_BALANCE: 'account_balance',\n UPCOMING_BILL: 'upcoming_bill',\n SPEND_TO_INCOME: 'monthly_spend_to_income',\n SAVINGS_TO_INCOME: 'savings_to_income',\n DEBT_TO_INCOME: 'debt_to_income',\n COST_OF_LIVING: 'cost_living_to_income',\n NON_ESSENTIAL_CATEGORY: 'non_essential_category_summary',\n DEPOSIT_SUMMARY: 'monthly_deposit_summary',\n LOW_BALANCE: 'low_balance',\n SUBSCRIPTION_AGGREGATE: 'monthly_subscription_aggregate',\n MERCHANT_BUDGET: 'merchant_budget',\n TOP_MERCHANT: 'top_merchant',\n} as const\n\nexport type DrillDownVariant = (typeof DRILLDOWN_VARIANTS)[keyof typeof DRILLDOWN_VARIANTS]\n\n/** One flattened data_series row a filterStrategy indexes; fields are optional because the backend keys rows dynamically. */\n\n// Resolves the top-chart palette from the theme (and the beat's category, when relevant).\nexport type ColorKind = (theme: Theme, categoryGuid?: string) => string[]\n\n// Resolves the dynamic drawer header (heading/sub-heading/icon JSX) from the selection context.\nexport type HeaderKind = (ctx: DrillDownHeaderContext) => DrillDownHeader\n\n/**\n * Everything a filterStrategy needs to turn the currently-selected bar/sub-tab into a\n * TransactionFilter. Data-only so strategies stay pure and testable.\n */\nexport interface FilterContext {\n beat: Beat\n beatTransactions: Transaction[]\n dataSeries: ChartDataSeriesItem[]\n // The double-bar drawer's month columns (main / comparison per month, with their guids); empty\n // for every other top kind.\n comparisonBars: DataSet[]\n selectedIndex: number\n subIndex: number\n isLastTab: boolean\n instanceSlotData: DrillDownSlotData\n spendCategoryGuids: string[]\n displayedDateRange: { start: Date; end: Date }\n}\n\n// Resolves the current selection into a TransactionFilter. Carried on each config row so behavior\n// lives next to the variant it belongs to (no separate strategy registry to chase).\nexport type FilterStrategy = (ctx: FilterContext) => TransactionFilter\n\n/** Sub-tabs under the chart (Income / Other Deposits); `subIndex` in `FilterContext` picks one. */\nexport type SubTabsKind = (ctx: {\n instanceSlotData: DrillDownSlotData\n copy: InsightsFeedCopy\n}) => string[]\n\nexport interface DrillDownVariantConfig {\n // `list`: no chart or tabs above the transaction list (an account's transactions for a window).\n // `monthTabs`: one tab per data_series month and no chart (a month's aggregated transactions).\n top: 'singleBar' | 'upcomingBill' | 'doubleBar' | 'tabsOnly' | 'monthTabs' | 'list'\n filterStrategy: FilterStrategy\n colors: ColorKind\n header?: HeaderKind\n // A second tab row under the chart that `subIndex` picks from (Income / Other Deposits).\n subTabs?: SubTabsKind\n // Where the drawer reads its facts. Absent: the bar chart's `instance_slot.data`.\n slotData?: SlotDataResolver\n // On open, returns the guids of the drawer's transactions to fetch by guid when the store lacks\n // them (older than its 90-day window), as pulse's BeatShell loads a legacy beat's: each drawer\n // reads them from wherever its beat keeps them (the beat, or the CTA that opened the drawer).\n // Absent: nothing is fetched.\n fetchMissingTransactions?: (beat: Beat, ctaDrilldownData?: DrilldownData) => unknown\n // undefined when the facts the tip needs are missing: the drawer shows no tip.\n tipSection?: (\n setCloseTipSection: (flag: boolean) => void,\n copy: InsightsFeedCopy,\n merchantName?: string,\n slotData?: DrillDownSlotData,\n ) => TipSectionProps | undefined\n scope: 'store' | 'beat'\n filterMode: 'store' | 'local'\n // Double bar: accessible names for the series tabs ([0] main, [1] comparison), as legacy pulse.\n subTabAriaLabels?: (copy: InsightsFeedCopy) => (string | undefined)[]\n // The average (Trend) legend's number format. Absent: `CURRENCY_FORMAT.cents`.\n averageFormat?: CurrencyFormat\n // Double bar: bold the legend label (\"Spend:\"). Absent: a regular legend.\n boldLabel?: boolean\n // Single bar: the bar legend's label. Absent: the slot's legend, else the \"Monthly Amount\" copy.\n barLegendLabel?: (copy: InsightsFeedCopy) => string | undefined\n // Single bar: show the selected month's amount after the bar legend. Absent: shown.\n showMonthlyAmount?: boolean\n // The drawer title. Absent, or undefined: the `<variant>_drawer_title` copy.\n title?: (copy: GlobalCopy, beat?: Beat) => string | undefined\n}\nconst generalTitle = (copy: GlobalCopy) =>\n copy.insights_feed?.general?.transaction_history_title ?? ''\n\nconst categoryColor = (theme: Theme, categoryGuid?: string): string =>\n (categoryGuid && getCategoryColor(categoryGuid, theme)) || theme.palette.primary.main\n\nconst toLocalDate = (date: string | number | Date | undefined) =>\n typeof date === 'string' ? parseISO(date) : new Date(date ?? NaN)\n\nconst monthRange = (date: string | number | Date | undefined) => ({\n start: startOfMonth(toLocalDate(date)),\n end: endOfMonth(toLocalDate(date)),\n})\n\n// Scopes a filter to the beat's accounts when the beat carries account_guids; otherwise leaves\n// accounts unset so the store default (all accounts) applies.\nconst accountScope = (accountGuids?: string[]): Pick<TransactionFilter, 'accounts'> =>\n accountGuids?.length ? { accounts: accountGuids } : {}\n\n// Low Account Balance — `drilldown_data` names one account and a window (epoch seconds at UTC\n// midnight, to_date exclusive); only settled, visible rows, a split purchase as its parts, as the\n// pulse drawer listed them. Fails closed: a drawer that cannot name its rows shows none.\nconst accountWindowStrategy: FilterStrategy = ({ beat }) => {\n const { account_guid, from_date, to_date } = beat.insights_payload?.drilldown_data ?? {}\n if (\n typeof account_guid !== 'string' ||\n typeof from_date !== 'number' ||\n typeof to_date !== 'number' ||\n !Number.isFinite(from_date) ||\n !Number.isFinite(to_date) ||\n to_date <= from_date\n ) {\n return { accounts: [], custom: () => false }\n }\n\n return {\n accounts: [account_guid],\n custom: (trn) => !trn.is_hidden && trn.feed_status !== TransactionStatus.PENDING,\n showSplits: true,\n dateRange: { start: fromUnixUTC(from_date), end: fromUnixUTC(to_date - 1) },\n }\n}\n\n// Upcoming Bill: a missing or mistyped `drilldown_data` fact is dropped, so a bad guid list draws no\n// chart and lists no rows, and a bad due date or merchant shows no tip.\n\nexport const resolveUpcomingBillSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n\n return {\n transaction_guids: asGuidList(data.transaction_guids),\n date: calendarDateOf(data.due_date),\n category_guid: asNonEmptyText(data.category_guid),\n average_amount: asNumber(data.average_amount),\n merchant_name: asNonEmptyText(data.merchant_name),\n }\n}\n\n// Savings Account Balances Summary: the drawer's bars, trend and accounts come from the beat's\n// drilldown_data alone (tupac SavingsAccountBalancesSummary::Factory.drilldown_data), each narrowed:\n// a missing or malformed fact is dropped, so the drawer draws no bars and lists no rows.\nconst dataSeriesOf = (value: unknown): DataSeries | undefined => {\n const series = value as DataSeries | undefined\n return Array.isArray(series?.names) && Array.isArray(series?.data) ? series : undefined\n}\n\nexport const resolveSavingsContributionsSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n\n return {\n account_guids: asGuidList(data.account_guids),\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n }\n}\n\n// Merchant Budget: the six months of the merchant's spend and their trend come from the beat's\n// drilldown_data (tupac's MerchantBudget factory sends no data_series), the merchant and its name\n// from instance_slot.data, else the V1 instance_slot_data. A malformed series is dropped, so the\n// drawer draws no bars and lists no rows.\nexport const resolveMerchantBudgetSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n const v2 = payload?.instance_slot?.data as Record<string, unknown> | undefined\n const v1 = payload?.instance_slot_data as Record<string, unknown> | undefined\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n merchant_guid: asNonEmptyText(v2?.merchant_guid) ?? asNonEmptyText(v1?.merchant_guid),\n merchant_name: asNonEmptyText(v2?.merchant_name) ?? asNonEmptyText(v1?.merchant_name),\n }\n}\n\n// Monthly Top Merchant Spending's Merchant History: everything comes from the drilldown_data the Top\n// Merchants drawer hands its row's CTA (one ranked merchant: its six months, average and category).\nexport const resolveTopMerchantSlotData: SlotDataResolver = (_payload, ctaDrilldownData) => {\n const data = (ctaDrilldownData ?? {}) as Record<string, unknown>\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n category_guid: asNonEmptyText(data.category_guid),\n described_month: asNonEmptyText(data.described_month),\n merchant_guid: asNonEmptyText(data.merchant_guid),\n merchant_name: asNonEmptyText(data.merchant_name),\n rank: asNumber(data.rank),\n }\n}\n\n// Monthly Deposit Summary's sub-tabs, in the donut legend's order.\nconst DEPOSIT_SUB_TABS = ['income', 'other'] as const\n\n// Monthly Deposit Summary: tupac's drilldown_data carries the six months (data_series rows with\n// aggregated_guids), the income guids and the trend. The donut's legend rows are the card's, so they\n// only name the sub-tabs; with no `legends`, the chart legend falls back to Monthly Amount / Trend.\nexport const resolveDepositSummarySlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n const donutLegends = (payload?.instance_slot?.data as InsightsInstanceSlotData | undefined)\n ?.legends\n const subTabLabels = donutLegends?.map(({ label }) => label)\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n income_transaction_guids: asGuidList(data.income_transaction_guids),\n sub_tab_labels: subTabLabels?.length === DEPOSIT_SUB_TABS.length ? subTabLabels : undefined,\n }\n}\n\n// Monthly Debt to Income Comparison: the 6 months and the Debt / Income legend labels come from the\n// drilldown_data of the CTA that opened the drawer (ditto primary_cta_drilldown_data), never the card's\n// slot or the beat. A malformed series, or labels that are not two non-blank strings, yield nothing,\n// so the drawer draws no bars and lists no rows.\nconst DEBT_TO_INCOME_SERIES_COUNT = 2\n\nexport const resolveDebtToIncomeSlotData: SlotDataResolver = (_payload, ctaDrilldownData) => {\n const data = ctaDrilldownData ?? {}\n const dataSeries = dataSeriesOf(data.series)\n const labels = Array.isArray(data.labels) ? data.labels.map(asNonEmptyText) : []\n if (\n !dataSeries ||\n labels.length !== DEBT_TO_INCOME_SERIES_COUNT ||\n !labels.every((label): label is string => !!label)\n ) {\n return {}\n }\n\n // The legend's amounts are the selected month's, which the drawer fills from the bars.\n return { data_series: dataSeries, legends: labels.map((label) => ({ label, value: 0 })) }\n}\n\n// Every month's debt and income guids from the opening CTA, so the drawer fetches the ones older\n// than the store's window.\nconst debtToIncomeGuidsOf = (_beat: Beat, ctaDrilldownData?: DrilldownData): string[] =>\n buildDataSeries(dataSeriesOf(ctaDrilldownData?.series)).flatMap(\n (row) => row.aggregated_guids ?? [],\n )\n\n// The drawer's tip, as Figma words it: the bold tip title and the bold limit (\"less than 30%\") from\n// the copy service. No hard-coded English: no tip until the copy service carries both strings.\nconst debtToIncomeTipSection: DrillDownVariantConfig['tipSection'] = (setCloseTipSection, copy) => {\n const message = copy.transaction_history_block?.monthly_debt_to_income_tip_message\n const limit = copy.transaction_history_block?.monthly_debt_to_income_tip_limit\n if (!message || !limit) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{limit}</strong>,\n ) as ReactNode,\n onDismiss: () => setCloseTipSection(true),\n }\n}\n\n// Monthly Savings to Income: the 6 months from the opening CTA's drilldown_data (tupac\n// payload.drilldown_series, as Debt to Income's); until a beat carries them, the card's own 4 months.\nconst resolveSavingsToIncomeSlotData: SlotDataResolver = (payload, ctaDrilldownData) => {\n const fromCta = resolveDebtToIncomeSlotData(payload, ctaDrilldownData)\n if (fromCta.data_series) return fromCta\n\n return toDrillDownSlotData((payload?.instance_slot?.data ?? {}) as BarChartBlockData)\n}\n\n// The Savings vs. Income tip, as Figma 1243:73833 words it: the bold tip title and the bold\n// percentage (\"20%\") from the copy service; no tip until the copy service carries both strings.\n// Figma 1247:19430: the tip is icon and text only, with no close button.\nconst savingsToIncomeTipSection: DrillDownVariantConfig['tipSection'] = (\n _setCloseTipSection,\n copy,\n) => {\n const message = copy.transaction_history_block?.savings_to_income_tip_message\n const percentage = copy.transaction_history_block?.savings_to_income_tip_percentage\n if (!message || !percentage) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{percentage}</strong>,\n ) as ReactNode,\n }\n}\n\n// Every month's deposit guids, so the drawer fetches the ones older than the store's window.\nconst depositGuidsOf = (beat: Beat): string[] =>\n buildDataSeries(dataSeriesOf(beat.insights_payload?.drilldown_data?.data_series)).flatMap(\n (row) => row.aggregated_guids ?? [],\n )\n\n// Figma 1941:212734: no close control on this tip, so no `onDismiss`.\nconst upcomingBillTipSection: DrillDownVariantConfig['tipSection'] = (\n _setCloseTipSection,\n copy,\n _merchantName,\n slotData,\n) => {\n const merchantName = slotData?.merchant_name\n const dueDate = slotData?.date\n if (!merchantName || !dueDate) return undefined\n\n // No hard-coded English: no tip until the copy service carries the message.\n const message = copy.transaction_history_block?.upcoming_bill_tip_message\n if (!message) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n merchantName,\n formatDate(parseISO(dueDate), DATE_FORMATS_INTL.FULL_MONTH_DAY),\n ) as ReactNode,\n }\n}\n\n// ── Single-bar filter strategies (this MR) ────────────────────────────────────────────────────\n\n// BillAmountNotStandard / UpcomingBill — the series carries a transaction (TRN) guid; match a single\n// transaction by guid within its month.\nconst transactionGuidStrategy: FilterStrategy = ({\n beatTransactions,\n dataSeries,\n selectedIndex,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n const seriesGuid = seriesItem?.guid\n const hasBeenSplit = beatTransactions.find((trn) => trn.guid === seriesGuid)?.has_been_split\n\n return {\n custom: (trn) => trn.guid === seriesGuid,\n dateRange: monthRange(seriesItem?.date),\n showSplits: !hasBeenSplit,\n }\n}\n\n// CategorySpendingV2 — match transactions in the beat's category (or whose top-level category is that\n// guid) within the month.\nconst categoryStrategy: FilterStrategy = ({ dataSeries, selectedIndex, instanceSlotData }) => {\n const seriesItem = dataSeries[selectedIndex]\n const categoryGuid = instanceSlotData.category_guid ?? seriesItem?.guid\n\n return {\n custom: (trn) =>\n trn.category_guid === categoryGuid || trn.top_level_category_guid === categoryGuid,\n dateRange: monthRange(seriesItem?.date),\n }\n}\n\n// MonthlySpendComparisonV2 — no per-bar guid; show all spending-category transactions\n// (income/transfers/investments excluded via spendCategoryGuids) within the month.\nconst spendCategoriesStrategy: FilterStrategy = ({\n dataSeries,\n selectedIndex,\n spendCategoryGuids,\n instanceSlotData,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n\n return {\n custom: (trn) =>\n !!trn.top_level_category_guid && spendCategoryGuids.includes(trn.top_level_category_guid),\n dateRange: monthRange(seriesItem?.date),\n ...accountScope(instanceSlotData.account_guids),\n }\n}\n\n// Merchant Budget — the merchant's transactions within the selected month, hidden rows and split\n// parts left out (the store's default `showSplits: false` keeps the split order's own row). Fails\n// closed: no merchant or no readable month, no rows.\nconst merchantMonthStrategy: FilterStrategy = ({ dataSeries, selectedIndex, instanceSlotData }) => {\n const merchantGuid = instanceSlotData.merchant_guid\n const month = parseISO(dataSeries[selectedIndex]?.date ?? '')\n if (!merchantGuid || !isValid(month)) return { accounts: [], custom: () => false }\n\n return {\n custom: (trn) => trn.merchant_guid === merchantGuid && !trn.is_hidden,\n dateRange: { start: startOfMonth(month), end: endOfMonth(month) },\n }\n}\n\n// The beat's creation: tupac sends epoch seconds on the envelope and an ISO string on the wrapper.\nconst toCreatedAt = (createdAt: Beat['created_at']) =>\n typeof createdAt === 'number' ? fromUnixTime(createdAt) : parseISO(createdAt ?? '')\n\n// Savings Account Balances Summary: the beat's savings accounts within the month (the latest month\n// ends at the beat's creation). Fails closed: no drilldown_data accounts, no rows.\nconst accountDateStrategy: FilterStrategy = ({\n beat,\n dataSeries,\n selectedIndex,\n isLastTab,\n instanceSlotData,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n const { start, end } = monthRange(seriesItem?.date)\n const createdAt = toCreatedAt(beat.created_at)\n const accountGuids = instanceSlotData.account_guids\n const dateRange = {\n start,\n end: isLastTab && isValid(createdAt) && createdAt < end ? createdAt : end,\n }\n\n if (!accountGuids?.length) return { dateRange, accounts: [], custom: () => false }\n\n return { dateRange, accounts: accountGuids }\n}\n\n// A row's stored guids within the row's month, scoped to the beat's accounts. parseISO reads the\n// 'yyyy-MM-dd' date as a local calendar day, so the month never shifts with the viewer's time zone.\n// Fails closed: a missing row, guid list or date matches nothing, never the store's displayed range.\nconst guidsWithinMonth = (\n guids: string[] | undefined,\n date: string | undefined,\n accountGuids?: string[],\n): TransactionFilter => {\n const guidSet = new Set(guids)\n const month = parseISO(date ?? '')\n if (!guidSet.size || !isValid(month)) return { accounts: [], custom: () => false }\n\n return {\n custom: (trn) => guidSet.has(trn.guid),\n dateRange: { start: startOfMonth(month), end: endOfMonth(month) },\n ...accountScope(accountGuids),\n }\n}\n\n// Monthly Subscription Aggregate — one data_series row per month, each naming its own\n// aggregated_guids; the selected month tab lists exactly those.\nconst monthlyAggregatedGuidsStrategy: FilterStrategy = ({ beat, dataSeries, selectedIndex }) =>\n guidsWithinMonth(\n dataSeries[selectedIndex]?.aggregated_guids,\n dataSeries[selectedIndex]?.date,\n beat.account_guids,\n )\n\n// ── Double-bar strategies ──────────────────────────────────────────────────────────────────────\n\n// Every double-bar comparison (Spend, Savings, Debt or Cost of Living vs Income) — the selected month's\n// main (series 0) or comparison (Income, series 1) bar guids, whatever order the tabs show them in.\n// The V2 payload carries no account_guids on instance_slot.data.\nconst comparisonGuidsStrategy: FilterStrategy = ({\n beat,\n comparisonBars,\n selectedIndex,\n subIndex,\n}) => {\n const bar = comparisonBars[selectedIndex]\n\n return guidsWithinMonth(\n subIndex === 1 ? bar?.comparisonGuids : bar?.mainGuids,\n bar?.date,\n beat.account_guids,\n )\n}\n\n// ── Tabs-only strategies ───────────────────────────────────────────────────────────────────────\n\n// Monthly Non-Essential Category Summary — the series is the two sides of one month (non-essential /\n// essential), not a time series; the selected sub-tab picks the row.\nconst aggregatedGuidsStrategy: FilterStrategy = ({ beat, dataSeries, subIndex }) =>\n guidsWithinMonth(\n dataSeries[subIndex]?.aggregated_guids,\n dataSeries[subIndex]?.date,\n beat.account_guids,\n )\n\n// Monthly Deposit Summary: the selected month's guids, split into the Income / Other Deposits sub-tab.\n// Not scoped to beat.account_guids: those are the beat month's accounts only, and an older month's\n// deposits can sit in other accounts; the row's aggregated_guids are already exact.\nconst depositSummaryStrategy: FilterStrategy = (ctx) => {\n const { dataSeries, selectedIndex, subIndex, instanceSlotData } = ctx\n const month = dataSeries[selectedIndex]\n const income = new Set(instanceSlotData.income_transaction_guids)\n const isIncome = DEPOSIT_SUB_TABS[subIndex] === 'income'\n const guids = instanceSlotData.sub_tab_labels\n ? month?.aggregated_guids?.filter((guid) => income.has(guid) === isIncome)\n : month?.aggregated_guids\n\n return guidsWithinMonth(guids, month?.date)\n}\n\nexport const layout: Partial<Record<DrillDownVariant, DrillDownVariantConfig>> = {\n [DRILLDOWN_VARIANTS.TRANSACTION]: {\n title: generalTitle,\n top: 'singleBar',\n scope: 'store',\n filterMode: 'store',\n filterStrategy: transactionGuidStrategy,\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n header: (ctx: DrillDownHeaderContext) => {\n const { title, subHeader } = ctx\n return {\n heading: title,\n subHeadingText: subHeader?.text || undefined,\n icon: (\n <LogoMark\n logo={{\n ...subHeader?.logo,\n merchant_name: subHeader?.text ?? subHeader?.logo?.merchant_name,\n }}\n size={16}\n />\n ),\n }\n },\n tipSection: (setCloseTipSection, copy, merchantName = '') => {\n return {\n message: buildDynamicCopy(\n copy.general.tip_section_message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{merchantName}</strong>,\n ),\n onDismiss: () => setCloseTipSection(true),\n } as TipSectionProps\n },\n },\n [DRILLDOWN_VARIANTS.CATEGORY_SPEND]: {\n top: 'singleBar',\n // As the card's Trend (Figma \"$x\"): whole dollars.\n averageFormat: CURRENCY_FORMAT.whole,\n filterStrategy: categoryStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n header: (ctx: DrillDownHeaderContext) => {\n return {\n heading: ctx.categoryName,\n subHeadingText: ctx.selectedDate\n ? formatDate(toLocalDate(ctx.selectedDate), DATE_FORMATS_INTL.MONTH_LONG) || ''\n : '',\n // Figma: the month's calendar icon in primary.main.\n icon: <Icon color=\"primary\" name=\"calendar_month\" size={16} />,\n }\n },\n },\n [DRILLDOWN_VARIANTS.MONTHLY_SPEND]: {\n top: 'singleBar',\n filterStrategy: spendCategoriesStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.chart.chart2 ?? theme.palette.primary.main],\n },\n [DRILLDOWN_VARIANTS.ACCOUNT_BALANCE]: {\n // The drawer reads as the card it opens from (\"Savings Contributions\", Figma 1135:50175).\n title: (_copy, beat) => beat?.insights_payload?.title || undefined,\n top: 'singleBar',\n filterStrategy: accountDateStrategy,\n slotData: resolveSavingsContributionsSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.success.main],\n },\n // Upcoming Bill: one bar per paid bill from `drilldown_data`, opening on the latest; a bar's tab\n // lists that bill alone (filtered locally, as legacy pulse does).\n [DRILLDOWN_VARIANTS.UPCOMING_BILL]: {\n top: 'upcomingBill',\n filterStrategy: transactionGuidStrategy,\n scope: 'beat',\n filterMode: 'local',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n slotData: resolveUpcomingBillSlotData,\n fetchMissingTransactions: (beat) => beat.insights_payload?.drilldown_data?.transaction_guids,\n tipSection: upcomingBillTipSection,\n },\n\n // Monthly Deposit Summary: six months of deposits from drilldown_data, then Income / Other Deposits\n // tabs named by the donut's legend rows; without both rows, no sub-tabs.\n [DRILLDOWN_VARIANTS.DEPOSIT_SUMMARY]: {\n top: 'singleBar',\n filterStrategy: depositSummaryStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.success.main],\n slotData: resolveDepositSummarySlotData,\n fetchMissingTransactions: depositGuidsOf,\n subTabs: ({ instanceSlotData }) => instanceSlotData.sub_tab_labels ?? [],\n // Figma 1124:87202: the bar legend reads \"Deposit\", with no amount.\n barLegendLabel: (copy) => copy.general.deposit,\n showMonthlyAmount: false,\n },\n\n // Low Account Balance's \"Transactions\" link: the account's transactions for the alert's window.\n [DRILLDOWN_VARIANTS.LOW_BALANCE]: {\n top: 'list',\n filterStrategy: accountWindowStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n\n // Monthly Subscription Aggregate's \"View Transactions\": one tab per month, no chart, each month\n // listing its own aggregated_guids.\n [DRILLDOWN_VARIANTS.SUBSCRIPTION_AGGREGATE]: {\n top: 'monthTabs',\n filterStrategy: monthlyAggregatedGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n\n // Merchant Budget's \"View Spending History\": six months of the merchant's spend, the merchant as\n // the heading over the selected month (Figma 1401:311145).\n [DRILLDOWN_VARIANTS.MERCHANT_BUDGET]: {\n top: 'singleBar',\n filterStrategy: merchantMonthStrategy,\n slotData: resolveMerchantBudgetSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.chart.chart1 ?? theme.palette.primary.main],\n header: (ctx: DrillDownHeaderContext) => ({\n heading: ctx.slotData?.merchant_name ?? ctx.title,\n subHeadingText: ctx.selectedDate\n ? formatDate(toLocalDate(ctx.selectedDate), DATE_FORMATS_INTL.MONTH_LONG) || ''\n : '',\n icon: <Icon color=\"primary\" name=\"calendar_month\" size={16} />,\n }),\n },\n\n // Monthly Top Merchant Spending's Merchant History (Figma 1273:34556): the ranked merchant's six\n // months in its category colour, \"{Merchant} Spending\" over \"#{rank} top merchant\n // ({month})\" beside its logo, and its transactions in the selected month. Opened only from the\n // Top Merchants drawer's rows, which hand it the merchant's drilldown_data (TopMerchantsBlock).\n [DRILLDOWN_VARIANTS.TOP_MERCHANT]: {\n top: 'singleBar',\n filterStrategy: merchantMonthStrategy,\n slotData: resolveTopMerchantSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n header: ({ copy, slotData, title }: DrillDownHeaderContext) => {\n const merchantName = slotData?.merchant_name\n const topMerchantsCopy = copy?.top_merchants\n const month = slotData?.described_month\n ? formatDate(toLocalDate(slotData.described_month), DATE_FORMATS_INTL.MONTH_SHORT_YEAR) ||\n ''\n : ''\n\n return {\n heading:\n merchantName && topMerchantsCopy?.merchant_spending\n ? (buildDynamicCopy(topMerchantsCopy.merchant_spending, merchantName) as string)\n : (merchantName ?? title),\n subHeadingText:\n slotData?.rank && topMerchantsCopy?.most_visited_merchant\n ? (buildDynamicCopy(\n topMerchantsCopy.most_visited_merchant,\n String(slotData.rank),\n month,\n ) as string)\n : month,\n logo: slotData?.merchant_guid ? (\n <LogoMark\n logo={{\n category_guid: slotData.category_guid,\n merchant_guid: slotData.merchant_guid,\n merchant_name: merchantName,\n }}\n size={40}\n />\n ) : undefined,\n }\n },\n },\n\n // ── Double-bar comparison beats (month tabs + main / comparison sub-tabs) ────────────────────\n // Monthly Spend to Income Comparison: Spend vs Income per month, in the card block's palette.\n [DRILLDOWN_VARIANTS.SPEND_TO_INCOME]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'spend_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [copy.general.spend_transactions, copy.general.income_transactions],\n },\n // Cost of Living to Income: one living-cost category (Housing, Groceries, ...) vs Income per month.\n // The cost bar takes the beat category's colour and Income the legacy chart4, as the pulse drawer.\n [DRILLDOWN_VARIANTS.COST_OF_LIVING]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [\n categoryColor(theme, categoryGuid),\n theme.palette.chart.chart4 ?? theme.palette.primary.main,\n ],\n subTabAriaLabels: (copy) => [undefined, copy.general.income_transactions],\n },\n // Monthly Debt to Income Comparison: 6 months of Debt vs Income from the opening CTA's\n // drilldown_data, in the card block's palette so both series keep their card colours, plus the tip.\n [DRILLDOWN_VARIANTS.DEBT_TO_INCOME]: {\n // The host copy's existing key keeps its monthly_ prefix.\n title: (copy) =>\n copy.insights_feed?.transaction_history_block?.monthly_debt_to_income_drawer_title ??\n generalTitle(copy),\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'debt_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [undefined, copy.general.income_transactions],\n slotData: resolveDebtToIncomeSlotData,\n fetchMissingTransactions: debtToIncomeGuidsOf,\n tipSection: debtToIncomeTipSection,\n },\n // Monthly Savings to Income Comparison: 6 months of Savings vs Income from the opening CTA's\n // drilldown_data (the card's 4 until a beat carries them), in the card block's palette.\n [DRILLDOWN_VARIANTS.SAVINGS_TO_INCOME]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'savings_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [\n copy.general.savings_transactions,\n copy.general.income_transactions,\n ],\n slotData: resolveSavingsToIncomeSlotData,\n fetchMissingTransactions: debtToIncomeGuidsOf,\n tipSection: savingsToIncomeTipSection,\n },\n\n // Monthly Non-Essential Category Summary (tabs only): one side tab per series row, labelled by the\n // row's pre-localized label; a row without one gets no tab.\n [DRILLDOWN_VARIANTS.NON_ESSENTIAL_CATEGORY]: {\n top: 'tabsOnly',\n filterStrategy: aggregatedGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n}\n\n// Fallback for a missing/typo'd backend variant: a single-bar, store-scoped drawer filtered by the\n// beat's transaction guid and colored by category, so the drawer still renders instead of crashing.\nexport const FALLBACK: DrillDownVariantConfig = {\n top: 'singleBar',\n filterStrategy: transactionGuidStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,IAAa,IAAqB;AAAA,EAChC,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,wBAAwB;AAAA,EACxB,iBAAiB;AAAA,EACjB,cAAc;AAChB,GA+EM,IAAA,CAAgB,MACpB,EAAK,eAAe,SAAS,6BAA6B,IAEtD,IAAA,CAAiB,GAAc,MAClC,KAAgB,EAAiB,GAAc,CAAK,KAAM,EAAM,QAAQ,QAAQ,MAE7E,IAAA,CAAe,MACnB,OAAO,KAAS,WAAW,EAAS,CAAI,IAAI,IAAI,KAAK,KAAQ,GAAG,GAE5D,IAAA,CAAc,OAA8C;AAAA,EAChE,OAAO,EAAa,EAAY,CAAI,CAAC;AAAA,EACrC,KAAK,EAAW,EAAY,CAAI,CAAC;AACnC,IAIM,IAAA,CAAgB,MACpB,GAAc,SAAS,EAAE,UAAU,EAAa,IAAI,CAAC,GAKjD,IAAA,CAAyC,EAAE,MAAA,EAAA,MAAW;AAC1D,QAAM,EAAE,cAAA,GAAc,WAAA,GAAW,SAAA,EAAA,IAAY,EAAK,kBAAkB,kBAAkB,CAAC;AACvF,SACE,OAAO,KAAiB,YACxB,OAAO,KAAc,YACrB,OAAO,KAAY,YACnB,CAAC,OAAO,SAAS,CAAS,KAC1B,CAAC,OAAO,SAAS,CAAO,KACxB,KAAW,IAEJ;AAAA,IAAE,UAAU,CAAC;AAAA,IAAG,QAAA,MAAc;AAAA,EAAM,IAGtC;AAAA,IACL,UAAU,CAAC,CAAY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AAA,IACZ,QAAA,CAAS,MAAiB,CAAC,EAAM,QAAQ,QAAQ,IAAI;AAAA,EACvD;AACF,GAIa,KAAmC;AAAA,EAC9C,KAAK;AAAA,EACL,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAA,CAAS,GAAc,MAA0B,CAAC,EAAc,GAAO,CAAY,CAAC;AACtF"}
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Theme } from '@mui/material/styles'\nimport { endOfMonth, fromUnixTime, isValid, parseISO, startOfMonth } from 'date-fns'\nimport { getCategoryColor } from '../../../core/utils/CategoryUtil'\nimport {\n type Beat,\n type DataSeries,\n type DrilldownData,\n type GlobalCopy,\n type InsightsFeedCopy,\n type Subtitle,\n type Transaction,\n TransactionStatus,\n buildDynamicCopy,\n} from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport type {\n BarChartBlockData,\n DataSet,\n InsightsInstanceSlotData,\n} from '../../../core/types/InsightsInstanceSlotData'\nimport LogoMark from '../../components/LogoMark'\nimport { CategoryGuids } from '../../../core/constants/Category'\nimport type { TransactionHistoryBlock as TransactionHistoryCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { CURRENCY_FORMAT, type CurrencyFormat } from '../../../core/utils/NumberFormatting'\nimport { Icon } from '@mxenabled/mx-icons'\nimport {\n buildDataSeries,\n type ChartDataSeriesItem,\n} from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport { getLayoutConfig as getDoubleBarLayoutConfig } from '../../blocks/ChartBlocks/DoubleBarChartBlock/layout'\nimport { asGuidList, asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport type { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport {\n calendarDateOf,\n type DrillDownSlotData,\n type SlotDataResolver,\n toDrillDownSlotData,\n} from './utils'\n\nexport interface DrillDownHeader {\n heading?: string\n subHeadingText?: string\n icon?: ReactNode\n // A logo left of the heading and sub-heading (Top Merchant's merchant).\n logo?: ReactNode\n}\n\nexport interface DrillDownHeaderContext {\n title?: string\n subHeader?: Subtitle\n categoryName: string\n selectedDate?: string | Date\n slotData?: DrillDownSlotData\n copy?: InsightsFeedCopy\n}\n\nexport const DRILLDOWN_VARIANTS = {\n TRANSACTION: 'not_standard_amount',\n CATEGORY_SPEND: 'category_spend',\n MONTHLY_SPEND: 'monthly_spend_comparison',\n ACCOUNT_BALANCE: 'account_balance',\n UPCOMING_BILL: 'upcoming_bill',\n SPEND_TO_INCOME: 'monthly_spend_to_income',\n SAVINGS_TO_INCOME: 'savings_to_income',\n DEBT_TO_INCOME: 'debt_to_income',\n COST_OF_LIVING: 'cost_living_to_income',\n NON_ESSENTIAL_CATEGORY: 'non_essential_category_summary',\n DEPOSIT_SUMMARY: 'monthly_deposit_summary',\n LOW_BALANCE: 'low_balance',\n SUBSCRIPTION_AGGREGATE: 'monthly_subscription_aggregate',\n MERCHANT_BUDGET: 'merchant_budget',\n TOP_MERCHANT: 'top_merchant',\n} as const\n\nexport type DrillDownVariant = (typeof DRILLDOWN_VARIANTS)[keyof typeof DRILLDOWN_VARIANTS]\n\n/** One flattened data_series row a filterStrategy indexes; fields are optional because the backend keys rows dynamically. */\n\n// Resolves the top-chart palette from the theme (and the beat's category, when relevant).\nexport type ColorKind = (theme: Theme, categoryGuid?: string) => string[]\n\n// Resolves the dynamic drawer header (heading/sub-heading/icon JSX) from the selection context.\nexport type HeaderKind = (ctx: DrillDownHeaderContext) => DrillDownHeader\n\n/**\n * Everything a filterStrategy needs to turn the currently-selected bar/sub-tab into a\n * TransactionFilter. Data-only so strategies stay pure and testable.\n */\nexport interface FilterContext {\n beat: Beat\n beatTransactions: Transaction[]\n dataSeries: ChartDataSeriesItem[]\n // The double-bar drawer's month columns (main / comparison per month, with their guids); empty\n // for every other top kind.\n comparisonBars: DataSet[]\n selectedIndex: number\n subIndex: number\n isLastTab: boolean\n instanceSlotData: DrillDownSlotData\n spendCategoryGuids: string[]\n displayedDateRange: { start: Date; end: Date }\n}\n\n// Resolves the current selection into a TransactionFilter. Carried on each config row so behavior\n// lives next to the variant it belongs to (no separate strategy registry to chase).\nexport type FilterStrategy = (ctx: FilterContext) => TransactionFilter\n\n/** Sub-tabs under the chart (Income / Other Deposits); `subIndex` in `FilterContext` picks one. */\nexport type SubTabsKind = (ctx: {\n instanceSlotData: DrillDownSlotData\n copy: InsightsFeedCopy\n}) => string[]\n\nexport interface DrillDownVariantConfig {\n // `list`: no chart or tabs above the transaction list (an account's transactions for a window).\n // `monthTabs`: one tab per data_series month and no chart (a month's aggregated transactions).\n top: 'singleBar' | 'upcomingBill' | 'doubleBar' | 'tabsOnly' | 'monthTabs' | 'list'\n filterStrategy: FilterStrategy\n colors: ColorKind\n header?: HeaderKind\n // A second tab row under the chart that `subIndex` picks from (Income / Other Deposits).\n subTabs?: SubTabsKind\n // Where the drawer reads its facts. Absent: the bar chart's `instance_slot.data`.\n slotData?: SlotDataResolver\n // On open, returns the guids of the drawer's transactions to fetch by guid when the store lacks\n // them (older than its 90-day window), as pulse's BeatShell loads a legacy beat's: each drawer\n // reads them from wherever its beat keeps them (the beat, or the CTA that opened the drawer).\n // Absent: nothing is fetched.\n fetchMissingTransactions?: (beat: Beat, ctaDrilldownData?: DrilldownData) => unknown\n // undefined when the facts the tip needs are missing: the drawer shows no tip.\n tipSection?: (\n setCloseTipSection: (flag: boolean) => void,\n copy: InsightsFeedCopy,\n merchantName?: string,\n slotData?: DrillDownSlotData,\n ) => TipSectionProps | undefined\n scope: 'store' | 'beat'\n filterMode: 'store' | 'local'\n // Double bar: accessible names for the series tabs ([0] main, [1] comparison), as legacy pulse.\n subTabAriaLabels?: (copy: InsightsFeedCopy) => (string | undefined)[]\n // The average (Trend) legend's number format. Absent: `CURRENCY_FORMAT.cents`.\n averageFormat?: CurrencyFormat\n // Double bar: bold the legend label (\"Spend:\"). Absent: a regular legend.\n boldLabel?: boolean\n // Single bar: the bar legend's label. Absent: the slot's legend, else the \"Monthly Amount\" copy.\n barLegendLabel?: (copy: InsightsFeedCopy) => string | undefined\n // Single bar: show the selected month's amount after the bar legend. Absent: shown.\n showMonthlyAmount?: boolean\n // Single bar only: false hides the month tabs, and the chart's bars become the keyboard-selectable\n // month picker. Ignored for other tops, which have no such fallback. Absent: shown.\n showMonthTabs?: boolean\n // false hides the \"Transactions\" heading and its Export CSV button above the list. Absent: shown.\n showTransactionsHeader?: boolean\n // The drawer title. Absent, or undefined: the `<variant>_drawer_title` copy.\n title?: (copy: GlobalCopy, beat?: Beat) => string | undefined\n}\nconst generalTitle = (copy: GlobalCopy) =>\n copy.insights_feed?.general?.transaction_history_title ?? ''\n\ntype TipMessageKey = Extract<keyof TransactionHistoryCopy, `${string}_tip_message`>\ntype MonthHeadingKey = Extract<keyof TransactionHistoryCopy, `${string}_month_heading`>\n\n// Spending History's sub-categories (Figma 433:75792): the parent's colour (mxui colours top-level only), the\n// \"{Month} Gas Purchases\" heading and the tip, both copy.\nconst SUB_CATEGORIES: Partial<\n Record<string, { parent: string; headingKey: MonthHeadingKey; tipKey: TipMessageKey }>\n> = {\n [CategoryGuids.GAS]: {\n parent: CategoryGuids.AUTO_AND_TRANSPORT,\n headingKey: 'gas_month_heading',\n tipKey: 'gas_tip_message',\n },\n}\n\nconst categoryColor = (theme: Theme, categoryGuid?: string): string =>\n (categoryGuid && getCategoryColor(categoryGuid, theme)) || theme.palette.primary.main\n\n// Only Spending History opens on a sub-category; the other drawers keep categoryColor's fallback.\nconst categorySpendColor = (theme: Theme, categoryGuid?: string): string =>\n categoryColor(theme, (categoryGuid && SUB_CATEGORIES[categoryGuid]?.parent) || categoryGuid)\n\nconst toLocalDate = (date: string | number | Date | undefined) =>\n typeof date === 'string' ? parseISO(date) : new Date(date ?? NaN)\n\nconst monthRange = (date: string | number | Date | undefined) => ({\n start: startOfMonth(toLocalDate(date)),\n end: endOfMonth(toLocalDate(date)),\n})\n\n// Scopes a filter to the beat's accounts when the beat carries account_guids; otherwise leaves\n// accounts unset so the store default (all accounts) applies.\nconst accountScope = (accountGuids?: string[]): Pick<TransactionFilter, 'accounts'> =>\n accountGuids?.length ? { accounts: accountGuids } : {}\n\n// Low Account Balance — `drilldown_data` names one account and a window (epoch seconds at UTC\n// midnight, to_date exclusive); only settled, visible rows, a split purchase as its parts, as the\n// pulse drawer listed them. Fails closed: a drawer that cannot name its rows shows none.\nconst accountWindowStrategy: FilterStrategy = ({ beat }) => {\n const { account_guid, from_date, to_date } = beat.insights_payload?.drilldown_data ?? {}\n if (\n typeof account_guid !== 'string' ||\n typeof from_date !== 'number' ||\n typeof to_date !== 'number' ||\n !Number.isFinite(from_date) ||\n !Number.isFinite(to_date) ||\n to_date <= from_date\n ) {\n return { accounts: [], custom: () => false }\n }\n\n return {\n accounts: [account_guid],\n custom: (trn) => !trn.is_hidden && trn.feed_status !== TransactionStatus.PENDING,\n showSplits: true,\n dateRange: { start: fromUnixUTC(from_date), end: fromUnixUTC(to_date - 1) },\n }\n}\n\n// Upcoming Bill: a missing or mistyped `drilldown_data` fact is dropped, so a bad guid list draws no\n// chart and lists no rows, and a bad due date or merchant shows no tip.\n\nexport const resolveUpcomingBillSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n\n return {\n transaction_guids: asGuidList(data.transaction_guids),\n date: calendarDateOf(data.due_date),\n category_guid: asNonEmptyText(data.category_guid),\n average_amount: asNumber(data.average_amount),\n merchant_name: asNonEmptyText(data.merchant_name),\n }\n}\n\n// Savings Account Balances Summary: the drawer's bars, trend and accounts come from the beat's\n// drilldown_data alone (tupac SavingsAccountBalancesSummary::Factory.drilldown_data), each narrowed:\n// a missing or malformed fact is dropped, so the drawer draws no bars and lists no rows.\nconst dataSeriesOf = (value: unknown): DataSeries | undefined => {\n const series = value as DataSeries | undefined\n return Array.isArray(series?.names) && Array.isArray(series?.data) ? series : undefined\n}\n\nexport const resolveSavingsContributionsSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n\n return {\n account_guids: asGuidList(data.account_guids),\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n }\n}\n\n// Merchant Budget: the six months of the merchant's spend and their trend come from the beat's\n// drilldown_data (tupac's MerchantBudget factory sends no data_series), the merchant and its name\n// from instance_slot.data, else the V1 instance_slot_data. A malformed series is dropped, so the\n// drawer draws no bars and lists no rows.\nexport const resolveMerchantBudgetSlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n const v2 = payload?.instance_slot?.data as Record<string, unknown> | undefined\n const v1 = payload?.instance_slot_data as Record<string, unknown> | undefined\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n merchant_guid: asNonEmptyText(v2?.merchant_guid) ?? asNonEmptyText(v1?.merchant_guid),\n merchant_name: asNonEmptyText(v2?.merchant_name) ?? asNonEmptyText(v1?.merchant_name),\n }\n}\n\n// Monthly Top Merchant Spending's Merchant History: everything comes from the drilldown_data the Top\n// Merchants drawer hands its row's CTA (one ranked merchant: its six months, average and category).\nexport const resolveTopMerchantSlotData: SlotDataResolver = (_payload, ctaDrilldownData) => {\n const data = (ctaDrilldownData ?? {}) as Record<string, unknown>\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n category_guid: asNonEmptyText(data.category_guid),\n described_month: asNonEmptyText(data.described_month),\n merchant_guid: asNonEmptyText(data.merchant_guid),\n merchant_name: asNonEmptyText(data.merchant_name),\n rank: asNumber(data.rank),\n }\n}\n\n// Monthly Deposit Summary's sub-tabs, in the donut legend's order.\nconst DEPOSIT_SUB_TABS = ['income', 'other'] as const\n\n// Monthly Deposit Summary: tupac's drilldown_data carries the six months (data_series rows with\n// aggregated_guids), the income guids and the trend. The donut's legend rows are the card's, so they\n// only name the sub-tabs; with no `legends`, the chart legend falls back to Monthly Amount / Trend.\nexport const resolveDepositSummarySlotData: SlotDataResolver = (payload) => {\n const data = payload?.drilldown_data ?? {}\n const donutLegends = (payload?.instance_slot?.data as InsightsInstanceSlotData | undefined)\n ?.legends\n const subTabLabels = donutLegends?.map(({ label }) => label)\n\n return {\n data_series: dataSeriesOf(data.data_series),\n average_amount: asNumber(data.average_amount),\n income_transaction_guids: asGuidList(data.income_transaction_guids),\n sub_tab_labels: subTabLabels?.length === DEPOSIT_SUB_TABS.length ? subTabLabels : undefined,\n }\n}\n\n// Spending History's facts: Category Spending's bar chart slot when the card has one; a card without a chart (Green\n// Gas Purchases Summary's gas card) hands the category and the six months over on the CTA that opened the drawer.\nexport const resolveCategorySpendSlotData: SlotDataResolver = (payload, ctaDrilldownData) => {\n const data = (ctaDrilldownData ?? {}) as Record<string, unknown>\n const series = dataSeriesOf(data.series)\n // Category Spending's CTA carries no months, so its card's chart is the drawer's.\n if (!series) return toDrillDownSlotData((payload?.instance_slot?.data ?? {}) as BarChartBlockData)\n\n // No average on the CTA: the trend is the mean of the months with an amount, as the dashed line Figma draws.\n const amounts = buildDataSeries(series)\n .map((row) => asNumber(row.amount))\n .filter((amount): amount is number => amount !== undefined)\n const mean = amounts.length\n ? amounts.reduce((sum, amount) => sum + amount, 0) / amounts.length\n : undefined\n\n return toDrillDownSlotData({\n category_guid: asNonEmptyText(data.category_guid),\n series,\n average_amount: asNumber(data.average_amount) ?? mean,\n } as BarChartBlockData)\n}\n\nconst categoryTipSection: DrillDownVariantConfig['tipSection'] = (\n setCloseTipSection,\n copy,\n _merchantName,\n slotData,\n) => {\n const key = slotData?.category_guid ? SUB_CATEGORIES[slotData.category_guid]?.tipKey : undefined\n const message = key ? copy.transaction_history_block?.[key] : undefined\n if (!message) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n ) as ReactNode,\n onDismiss: () => setCloseTipSection(true),\n }\n}\n\n// Monthly Debt to Income Comparison: the 6 months and the Debt / Income legend labels come from the\n// drilldown_data of the CTA that opened the drawer (ditto primary_cta_drilldown_data), never the card's\n// slot or the beat. A malformed series, or labels that are not two non-blank strings, yield nothing,\n// so the drawer draws no bars and lists no rows.\nconst DEBT_TO_INCOME_SERIES_COUNT = 2\n\nexport const resolveDebtToIncomeSlotData: SlotDataResolver = (_payload, ctaDrilldownData) => {\n const data = ctaDrilldownData ?? {}\n const dataSeries = dataSeriesOf(data.series)\n const labels = Array.isArray(data.labels) ? data.labels.map(asNonEmptyText) : []\n if (\n !dataSeries ||\n labels.length !== DEBT_TO_INCOME_SERIES_COUNT ||\n !labels.every((label): label is string => !!label)\n ) {\n return {}\n }\n\n // The legend's amounts are the selected month's, which the drawer fills from the bars.\n return { data_series: dataSeries, legends: labels.map((label) => ({ label, value: 0 })) }\n}\n\n// Every month's guids from the opening CTA's series (aggregated_guids), so the drawer fetches the ones\n// older than the store's window. CTA only: a card's own chart rows (Category Spending V2) name categories.\nconst ctaAggregatedGuidsOf = (_beat: Beat, ctaDrilldownData?: DrilldownData): string[] =>\n buildDataSeries(dataSeriesOf(ctaDrilldownData?.series)).flatMap(\n (row) => row.aggregated_guids ?? [],\n )\n\n// The drawer's tip, as Figma words it: the bold tip title and the bold limit (\"less than 30%\") from\n// the copy service. No hard-coded English: no tip until the copy service carries both strings.\nconst debtToIncomeTipSection: DrillDownVariantConfig['tipSection'] = (setCloseTipSection, copy) => {\n const message = copy.transaction_history_block?.monthly_debt_to_income_tip_message\n const limit = copy.transaction_history_block?.monthly_debt_to_income_tip_limit\n if (!message || !limit) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{limit}</strong>,\n ) as ReactNode,\n onDismiss: () => setCloseTipSection(true),\n }\n}\n\n// Monthly Savings to Income: the 6 months from the opening CTA's drilldown_data (tupac\n// payload.drilldown_series, as Debt to Income's); until a beat carries them, the card's own 4 months.\nconst resolveSavingsToIncomeSlotData: SlotDataResolver = (payload, ctaDrilldownData) => {\n const fromCta = resolveDebtToIncomeSlotData(payload, ctaDrilldownData)\n if (fromCta.data_series) return fromCta\n\n return toDrillDownSlotData((payload?.instance_slot?.data ?? {}) as BarChartBlockData)\n}\n\n// The Savings vs. Income tip, as Figma 1243:73833 words it: the bold tip title and the bold\n// percentage (\"20%\") from the copy service; no tip until the copy service carries both strings.\n// Figma 1247:19430: the tip is icon and text only, with no close button.\nconst savingsToIncomeTipSection: DrillDownVariantConfig['tipSection'] = (\n _setCloseTipSection,\n copy,\n) => {\n const message = copy.transaction_history_block?.savings_to_income_tip_message\n const percentage = copy.transaction_history_block?.savings_to_income_tip_percentage\n if (!message || !percentage) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{percentage}</strong>,\n ) as ReactNode,\n }\n}\n\n// Every month's deposit guids, so the drawer fetches the ones older than the store's window.\nconst depositGuidsOf = (beat: Beat): string[] =>\n buildDataSeries(dataSeriesOf(beat.insights_payload?.drilldown_data?.data_series)).flatMap(\n (row) => row.aggregated_guids ?? [],\n )\n\n// Figma 1941:212734: no close control on this tip, so no `onDismiss`.\nconst upcomingBillTipSection: DrillDownVariantConfig['tipSection'] = (\n _setCloseTipSection,\n copy,\n _merchantName,\n slotData,\n) => {\n const merchantName = slotData?.merchant_name\n const dueDate = slotData?.date\n if (!merchantName || !dueDate) return undefined\n\n // No hard-coded English: no tip until the copy service carries the message.\n const message = copy.transaction_history_block?.upcoming_bill_tip_message\n if (!message) return undefined\n\n return {\n message: buildDynamicCopy(\n message,\n <strong>{copy.general.tip_section_title}</strong>,\n merchantName,\n formatDate(parseISO(dueDate), DATE_FORMATS_INTL.FULL_MONTH_DAY),\n ) as ReactNode,\n }\n}\n\n// ── Single-bar filter strategies (this MR) ────────────────────────────────────────────────────\n\n// BillAmountNotStandard / UpcomingBill — the series carries a transaction (TRN) guid; match a single\n// transaction by guid within its month.\nconst transactionGuidStrategy: FilterStrategy = ({\n beatTransactions,\n dataSeries,\n selectedIndex,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n const seriesGuid = seriesItem?.guid\n const hasBeenSplit = beatTransactions.find((trn) => trn.guid === seriesGuid)?.has_been_split\n\n return {\n custom: (trn) => trn.guid === seriesGuid,\n dateRange: monthRange(seriesItem?.date),\n showSplits: !hasBeenSplit,\n }\n}\n\n// CategorySpendingV2 — match transactions in the beat's category (or whose top-level category is that\n// guid) within the month.\nconst categoryStrategy: FilterStrategy = ({ dataSeries, selectedIndex, instanceSlotData }) => {\n const seriesItem = dataSeries[selectedIndex]\n const categoryGuid = instanceSlotData.category_guid ?? seriesItem?.guid\n\n return {\n custom: (trn) =>\n trn.category_guid === categoryGuid || trn.top_level_category_guid === categoryGuid,\n dateRange: monthRange(seriesItem?.date),\n }\n}\n\n// MonthlySpendComparisonV2 — no per-bar guid; show all spending-category transactions\n// (income/transfers/investments excluded via spendCategoryGuids) within the month.\nconst spendCategoriesStrategy: FilterStrategy = ({\n dataSeries,\n selectedIndex,\n spendCategoryGuids,\n instanceSlotData,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n\n return {\n custom: (trn) =>\n !!trn.top_level_category_guid && spendCategoryGuids.includes(trn.top_level_category_guid),\n dateRange: monthRange(seriesItem?.date),\n ...accountScope(instanceSlotData.account_guids),\n }\n}\n\n// Merchant Budget — the merchant's transactions within the selected month, hidden rows and split\n// parts left out (the store's default `showSplits: false` keeps the split order's own row). Fails\n// closed: no merchant or no readable month, no rows.\nconst merchantMonthStrategy: FilterStrategy = ({ dataSeries, selectedIndex, instanceSlotData }) => {\n const merchantGuid = instanceSlotData.merchant_guid\n const month = parseISO(dataSeries[selectedIndex]?.date ?? '')\n if (!merchantGuid || !isValid(month)) return { accounts: [], custom: () => false }\n\n return {\n custom: (trn) => trn.merchant_guid === merchantGuid && !trn.is_hidden,\n dateRange: { start: startOfMonth(month), end: endOfMonth(month) },\n }\n}\n\n// The beat's creation: tupac sends epoch seconds on the envelope and an ISO string on the wrapper.\nconst toCreatedAt = (createdAt: Beat['created_at']) =>\n typeof createdAt === 'number' ? fromUnixTime(createdAt) : parseISO(createdAt ?? '')\n\n// Savings Account Balances Summary: the beat's savings accounts within the month (the latest month\n// ends at the beat's creation). Fails closed: no drilldown_data accounts, no rows.\nconst accountDateStrategy: FilterStrategy = ({\n beat,\n dataSeries,\n selectedIndex,\n isLastTab,\n instanceSlotData,\n}) => {\n const seriesItem = dataSeries[selectedIndex]\n const { start, end } = monthRange(seriesItem?.date)\n const createdAt = toCreatedAt(beat.created_at)\n const accountGuids = instanceSlotData.account_guids\n const dateRange = {\n start,\n end: isLastTab && isValid(createdAt) && createdAt < end ? createdAt : end,\n }\n\n if (!accountGuids?.length) return { dateRange, accounts: [], custom: () => false }\n\n return { dateRange, accounts: accountGuids }\n}\n\n// A row's stored guids within the row's month, scoped to the beat's accounts. parseISO reads the\n// 'yyyy-MM-dd' date as a local calendar day, so the month never shifts with the viewer's time zone.\n// Fails closed: a missing row, guid list or date matches nothing, never the store's displayed range.\nconst guidsWithinMonth = (\n guids: string[] | undefined,\n date: string | undefined,\n accountGuids?: string[],\n): TransactionFilter => {\n const guidSet = new Set(guids)\n const month = parseISO(date ?? '')\n if (!guidSet.size || !isValid(month)) return { accounts: [], custom: () => false }\n\n return {\n custom: (trn) => guidSet.has(trn.guid),\n dateRange: { start: startOfMonth(month), end: endOfMonth(month) },\n ...accountScope(accountGuids),\n }\n}\n\n// Monthly Subscription Aggregate — one data_series row per month, each naming its own\n// aggregated_guids; the selected month tab lists exactly those.\nconst monthlyAggregatedGuidsStrategy: FilterStrategy = ({ beat, dataSeries, selectedIndex }) =>\n guidsWithinMonth(\n dataSeries[selectedIndex]?.aggregated_guids,\n dataSeries[selectedIndex]?.date,\n beat.account_guids,\n )\n\n// ── Double-bar strategies ──────────────────────────────────────────────────────────────────────\n\n// Every double-bar comparison (Spend, Savings, Debt or Cost of Living vs Income) — the selected month's\n// main (series 0) or comparison (Income, series 1) bar guids, whatever order the tabs show them in.\n// The V2 payload carries no account_guids on instance_slot.data.\nconst comparisonGuidsStrategy: FilterStrategy = ({\n beat,\n comparisonBars,\n selectedIndex,\n subIndex,\n}) => {\n const bar = comparisonBars[selectedIndex]\n\n return guidsWithinMonth(\n subIndex === 1 ? bar?.comparisonGuids : bar?.mainGuids,\n bar?.date,\n beat.account_guids,\n )\n}\n\n// ── Tabs-only strategies ───────────────────────────────────────────────────────────────────────\n\n// Monthly Non-Essential Category Summary — the series is the two sides of one month (non-essential /\n// essential), not a time series; the selected sub-tab picks the row.\nconst aggregatedGuidsStrategy: FilterStrategy = ({ beat, dataSeries, subIndex }) =>\n guidsWithinMonth(\n dataSeries[subIndex]?.aggregated_guids,\n dataSeries[subIndex]?.date,\n beat.account_guids,\n )\n\n// Monthly Deposit Summary: the selected month's guids, split into the Income / Other Deposits sub-tab.\n// Not scoped to beat.account_guids: those are the beat month's accounts only, and an older month's\n// deposits can sit in other accounts; the row's aggregated_guids are already exact.\nconst depositSummaryStrategy: FilterStrategy = (ctx) => {\n const { dataSeries, selectedIndex, subIndex, instanceSlotData } = ctx\n const month = dataSeries[selectedIndex]\n const income = new Set(instanceSlotData.income_transaction_guids)\n const isIncome = DEPOSIT_SUB_TABS[subIndex] === 'income'\n const guids = instanceSlotData.sub_tab_labels\n ? month?.aggregated_guids?.filter((guid) => income.has(guid) === isIncome)\n : month?.aggregated_guids\n\n return guidsWithinMonth(guids, month?.date)\n}\n\nexport const layout: Partial<Record<DrillDownVariant, DrillDownVariantConfig>> = {\n [DRILLDOWN_VARIANTS.TRANSACTION]: {\n title: generalTitle,\n top: 'singleBar',\n scope: 'store',\n filterMode: 'store',\n filterStrategy: transactionGuidStrategy,\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n header: (ctx: DrillDownHeaderContext) => {\n const { title, subHeader } = ctx\n return {\n heading: title,\n subHeadingText: subHeader?.text || undefined,\n icon: (\n <LogoMark\n logo={{\n ...subHeader?.logo,\n merchant_name: subHeader?.text ?? subHeader?.logo?.merchant_name,\n }}\n size={16}\n />\n ),\n }\n },\n tipSection: (setCloseTipSection, copy, merchantName = '') => {\n return {\n message: buildDynamicCopy(\n copy.general.tip_section_message,\n <strong>{copy.general.tip_section_title}</strong>,\n <strong>{merchantName}</strong>,\n ),\n onDismiss: () => setCloseTipSection(true),\n } as TipSectionProps\n },\n },\n [DRILLDOWN_VARIANTS.CATEGORY_SPEND]: {\n top: 'singleBar',\n // As the card's Trend (Figma \"$x\"): whole dollars.\n averageFormat: CURRENCY_FORMAT.whole,\n slotData: resolveCategorySpendSlotData,\n fetchMissingTransactions: ctaAggregatedGuidsOf,\n tipSection: categoryTipSection,\n filterStrategy: categoryStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categorySpendColor(theme, categoryGuid)],\n header: (ctx: DrillDownHeaderContext) => {\n const month = ctx.selectedDate\n ? formatDate(toLocalDate(ctx.selectedDate), DATE_FORMATS_INTL.MONTH_LONG) || ''\n : ''\n const categoryGuid = ctx.slotData?.category_guid\n const headingKey = categoryGuid ? SUB_CATEGORIES[categoryGuid]?.headingKey : undefined\n const monthHeading = headingKey && ctx.copy?.transaction_history_block?.[headingKey]\n // A sub-category's heading names the month itself (Figma \"{Month} Gas Purchases\"), so no month line.\n if (monthHeading && month) {\n return { heading: buildDynamicCopy(monthHeading, month) as string, subHeadingText: '' }\n }\n\n return {\n heading: ctx.categoryName,\n subHeadingText: month,\n // Figma: the month's calendar icon in primary.main.\n icon: <Icon color=\"primary\" name=\"calendar_month\" size={16} />,\n }\n },\n },\n [DRILLDOWN_VARIANTS.MONTHLY_SPEND]: {\n top: 'singleBar',\n filterStrategy: spendCategoriesStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.chart.chart2 ?? theme.palette.primary.main],\n },\n [DRILLDOWN_VARIANTS.ACCOUNT_BALANCE]: {\n // The drawer reads as the card it opens from (\"Savings Contributions\", Figma 1135:50175).\n title: (_copy, beat) => beat?.insights_payload?.title || undefined,\n top: 'singleBar',\n filterStrategy: accountDateStrategy,\n slotData: resolveSavingsContributionsSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.success.main],\n },\n // Upcoming Bill: one bar per paid bill from `drilldown_data`, opening on the latest; a bar's tab\n // lists that bill alone (filtered locally, as legacy pulse does).\n [DRILLDOWN_VARIANTS.UPCOMING_BILL]: {\n top: 'upcomingBill',\n filterStrategy: transactionGuidStrategy,\n scope: 'beat',\n filterMode: 'local',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n slotData: resolveUpcomingBillSlotData,\n fetchMissingTransactions: (beat) => beat.insights_payload?.drilldown_data?.transaction_guids,\n tipSection: upcomingBillTipSection,\n },\n\n // Monthly Deposit Summary: six months of deposits from drilldown_data, then Income / Other Deposits\n // tabs named by the donut's legend rows; without both rows, no sub-tabs.\n [DRILLDOWN_VARIANTS.DEPOSIT_SUMMARY]: {\n top: 'singleBar',\n filterStrategy: depositSummaryStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.success.main],\n slotData: resolveDepositSummarySlotData,\n fetchMissingTransactions: depositGuidsOf,\n subTabs: ({ instanceSlotData }) => instanceSlotData.sub_tab_labels ?? [],\n // Figma 1124:87202: the bar legend reads \"Deposit\", with no amount.\n barLegendLabel: (copy) => copy.general.deposit,\n showMonthlyAmount: false,\n },\n\n // Low Account Balance's \"Transactions\" link: the account's transactions for the alert's window.\n [DRILLDOWN_VARIANTS.LOW_BALANCE]: {\n top: 'list',\n filterStrategy: accountWindowStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n\n // Monthly Subscription Aggregate's \"View Transactions\": one tab per month, no chart, each month\n // listing its own aggregated_guids.\n [DRILLDOWN_VARIANTS.SUBSCRIPTION_AGGREGATE]: {\n top: 'monthTabs',\n filterStrategy: monthlyAggregatedGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n\n // Merchant Budget's \"View Spending History\": six months of the merchant's spend, the merchant as\n // the heading over the selected month (Figma 1401:311145).\n [DRILLDOWN_VARIANTS.MERCHANT_BUDGET]: {\n top: 'singleBar',\n filterStrategy: merchantMonthStrategy,\n slotData: resolveMerchantBudgetSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.chart.chart1 ?? theme.palette.primary.main],\n header: (ctx: DrillDownHeaderContext) => ({\n heading: ctx.slotData?.merchant_name ?? ctx.title,\n subHeadingText: ctx.selectedDate\n ? formatDate(toLocalDate(ctx.selectedDate), DATE_FORMATS_INTL.MONTH_LONG) || ''\n : '',\n icon: <Icon color=\"primary\" name=\"calendar_month\" size={16} />,\n }),\n },\n\n // Monthly Top Merchant Spending's Merchant History (Figma 2152:135281): the ranked merchant's six\n // months in its category colour, \"{Merchant} Spending\" over \"#{rank} most visited merchant\n // {month}\" beside its logo, and its transactions in the selected month. No month tabs (a bar picks\n // the month) and no Transactions / Export row, as Figma. Opened only from the Top Merchants drawer's\n // rows, which hand it the merchant's drilldown_data (TopMerchantsBlock).\n [DRILLDOWN_VARIANTS.TOP_MERCHANT]: {\n top: 'singleBar',\n showMonthTabs: false,\n showTransactionsHeader: false,\n filterStrategy: merchantMonthStrategy,\n slotData: resolveTopMerchantSlotData,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n header: ({ copy, slotData, title }: DrillDownHeaderContext) => {\n const merchantName = slotData?.merchant_name\n const topMerchantsCopy = copy?.top_merchants\n const month = slotData?.described_month\n ? formatDate(toLocalDate(slotData.described_month), DATE_FORMATS_INTL.MONTH_SHORT_YEAR) ||\n ''\n : ''\n\n return {\n heading:\n merchantName && topMerchantsCopy?.merchant_spending\n ? (buildDynamicCopy(topMerchantsCopy.merchant_spending, merchantName) as string)\n : (merchantName ?? title),\n subHeadingText:\n slotData?.rank && topMerchantsCopy?.most_visited_merchant\n ? (buildDynamicCopy(\n topMerchantsCopy.most_visited_merchant,\n String(slotData.rank),\n month,\n ) as string)\n : month,\n logo: slotData?.merchant_guid ? (\n <LogoMark\n logo={{\n category_guid: slotData.category_guid,\n merchant_guid: slotData.merchant_guid,\n merchant_name: merchantName,\n }}\n size={40}\n />\n ) : undefined,\n }\n },\n },\n\n // ── Double-bar comparison beats (month tabs + main / comparison sub-tabs) ────────────────────\n // Monthly Spend to Income Comparison: Spend vs Income per month, in the card block's palette.\n [DRILLDOWN_VARIANTS.SPEND_TO_INCOME]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'spend_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [copy.general.spend_transactions, copy.general.income_transactions],\n },\n // Cost of Living to Income: one living-cost category (Housing, Groceries, ...) vs Income per month.\n // The cost bar takes the beat category's colour and Income the legacy chart4, as the pulse drawer.\n [DRILLDOWN_VARIANTS.COST_OF_LIVING]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [\n categoryColor(theme, categoryGuid),\n theme.palette.chart.chart4 ?? theme.palette.primary.main,\n ],\n subTabAriaLabels: (copy) => [undefined, copy.general.income_transactions],\n },\n // Monthly Debt to Income Comparison: 6 months of Debt vs Income from the opening CTA's\n // drilldown_data, in the card block's palette so both series keep their card colours, plus the tip.\n [DRILLDOWN_VARIANTS.DEBT_TO_INCOME]: {\n // The host copy's existing key keeps its monthly_ prefix.\n title: (copy) =>\n copy.insights_feed?.transaction_history_block?.monthly_debt_to_income_drawer_title ??\n generalTitle(copy),\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'debt_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [undefined, copy.general.income_transactions],\n slotData: resolveDebtToIncomeSlotData,\n fetchMissingTransactions: ctaAggregatedGuidsOf,\n tipSection: debtToIncomeTipSection,\n },\n // Monthly Savings to Income Comparison: 6 months of Savings vs Income from the opening CTA's\n // drilldown_data (the card's 4 until a beat carries them), in the card block's palette.\n [DRILLDOWN_VARIANTS.SAVINGS_TO_INCOME]: {\n top: 'doubleBar',\n filterStrategy: comparisonGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => getDoubleBarLayoutConfig(theme, 'savings_to_income')?.color ?? [],\n boldLabel: true,\n subTabAriaLabels: (copy) => [\n copy.general.savings_transactions,\n copy.general.income_transactions,\n ],\n slotData: resolveSavingsToIncomeSlotData,\n fetchMissingTransactions: ctaAggregatedGuidsOf,\n tipSection: savingsToIncomeTipSection,\n },\n\n // Monthly Non-Essential Category Summary (tabs only): one side tab per series row, labelled by the\n // row's pre-localized label; a row without one gets no tab.\n [DRILLDOWN_VARIANTS.NON_ESSENTIAL_CATEGORY]: {\n top: 'tabsOnly',\n filterStrategy: aggregatedGuidsStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme) => [theme.palette.primary.main],\n },\n}\n\n// Fallback for a missing/typo'd backend variant: a single-bar, store-scoped drawer filtered by the\n// beat's transaction guid and colored by category, so the drawer still renders instead of crashing.\nexport const FALLBACK: DrillDownVariantConfig = {\n top: 'singleBar',\n filterStrategy: transactionGuidStrategy,\n scope: 'store',\n filterMode: 'store',\n colors: (theme: Theme, categoryGuid?: string) => [categoryColor(theme, categoryGuid)],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2DA,IAAa,IAAqB;AAAA,EAChC,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,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AAAA,EAC9C,KAAK;AAAA,EACL,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAA,CAAS,GAAc,MAA0B,CAAC,EAAc,GAAO,CAAY,CAAC;AACtF"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { slot as n } from "../../../../core/types/Insights.es.js";
|
|
2
|
-
import { CURRENCY_FORMAT as
|
|
3
|
-
import
|
|
4
|
-
import { resolveVariantConfig as
|
|
5
|
-
import { asLogoRef as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { MERCHANT_LAYOUT as
|
|
11
|
-
import
|
|
12
|
-
import { Icon as
|
|
2
|
+
import { CURRENCY_FORMAT as R, formatCurrency as E } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import y from "../../../components/StatusPill.es.js";
|
|
4
|
+
import { resolveVariantConfig as N } from "../../resolveVariantConfig.es.js";
|
|
5
|
+
import { asLogoRef as P, asNumber as z, asText as i, slotOrFlat as g } from "../../slotReaders.es.js";
|
|
6
|
+
import C, { isLogoGuid as B } from "../../../components/LogoFromGuid.es.js";
|
|
7
|
+
import M from "../../../components/LogoClusterCard.es.js";
|
|
8
|
+
import T from "../../../components/MerchantHighlightCard.es.js";
|
|
9
|
+
import V from "../../../components/P2PLogoStack.es.js";
|
|
10
|
+
import { MERCHANT_LAYOUT as w, merchantBlockVariant as D } from "./layout.es.js";
|
|
11
|
+
import G from "@mui/material/Stack";
|
|
12
|
+
import { Icon as O } from "@mxenabled/mx-icons";
|
|
13
13
|
import { jsx as e } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
14
|
+
var k = 64, b = 6, I = 72, K = 3, F = 10, Z = [
|
|
15
|
+
0,
|
|
15
16
|
10,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, D = (a) => {
|
|
17
|
+
25
|
|
18
|
+
], j = (a) => a === 2 || a === 3 || a === 4, H = 32, u = (a) => {
|
|
19
|
+
const r = P(a);
|
|
20
|
+
return r?.guid && B(r.guid) ? r : void 0;
|
|
21
|
+
}, U = (a) => {
|
|
22
22
|
if (!Array.isArray(a)) return [];
|
|
23
23
|
const r = /* @__PURE__ */ new Map();
|
|
24
|
-
for (const t of a.map(
|
|
24
|
+
for (const t of a.map(u)) t?.guid && !r.has(t.guid) && r.set(t.guid, t);
|
|
25
25
|
return [...r.values()];
|
|
26
|
-
}, L = /* @__PURE__ */ e(
|
|
26
|
+
}, L = /* @__PURE__ */ e(O, {
|
|
27
27
|
"aria-hidden": !0,
|
|
28
28
|
"data-icon": "storefront",
|
|
29
29
|
name: "storefront",
|
|
30
|
-
size:
|
|
30
|
+
size: H,
|
|
31
31
|
sx: { color: "text.secondary" }
|
|
32
|
-
}),
|
|
32
|
+
}), _ = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(C, {
|
|
33
33
|
logo: t,
|
|
34
34
|
size: r
|
|
35
|
-
}, t.guid)) : [L],
|
|
36
|
-
const { instance_slot: r } = a, { data: t } = r, o =
|
|
37
|
-
icon: /* @__PURE__ */ e(
|
|
35
|
+
}, t.guid)) : [L], io = ({ payload: a }) => {
|
|
36
|
+
const { instance_slot: r } = a, { data: t } = r, o = N(w, r.variant, D.SingleStandard, "MerchantBlock"), m = i(g(r, "status_text")), f = o.status && m ? /* @__PURE__ */ e(y, {
|
|
37
|
+
icon: /* @__PURE__ */ e(O, {
|
|
38
38
|
"aria-hidden": !0,
|
|
39
39
|
"data-icon": "check_circle",
|
|
40
40
|
fill: !0,
|
|
@@ -42,73 +42,76 @@ var p = 64, b = 6, w = 72, F = 3, G = [
|
|
|
42
42
|
size: 16,
|
|
43
43
|
sx: { color: "success.700" }
|
|
44
44
|
}),
|
|
45
|
-
label:
|
|
45
|
+
label: m,
|
|
46
46
|
sx: o.kind === "single" ? void 0 : {
|
|
47
47
|
alignSelf: "stretch",
|
|
48
48
|
justifyContent: "center"
|
|
49
49
|
}
|
|
50
50
|
}) : void 0;
|
|
51
51
|
if (o.kind !== "single") {
|
|
52
|
-
const c =
|
|
53
|
-
if (o.kind === "ranked" && c.length)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
const c = U(n(t, "logos"));
|
|
53
|
+
if (o.kind === "ranked" && c.length) {
|
|
54
|
+
const d = c.slice(0, K), S = j(d.length) && o.cascade?.offsets?.[d.length] || Z;
|
|
55
|
+
return /* @__PURE__ */ e(M, {
|
|
56
|
+
background: o.background,
|
|
57
|
+
fullBleed: !0,
|
|
58
|
+
logos: _(d, I),
|
|
59
|
+
overlap: o.cascade?.overlap ?? b,
|
|
60
|
+
rankOffsets: S.map((x) => F + x),
|
|
61
|
+
ranked: !0
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const p = o.logo?.size ?? k;
|
|
65
|
+
return /* @__PURE__ */ e(G, {
|
|
63
66
|
sx: {
|
|
64
67
|
background: o.background,
|
|
65
68
|
bgcolor: o.background ? void 0 : o.bgcolor,
|
|
66
69
|
p: 16,
|
|
67
70
|
width: "100%"
|
|
68
71
|
},
|
|
69
|
-
children: /* @__PURE__ */ e(
|
|
72
|
+
children: /* @__PURE__ */ e(V, {
|
|
70
73
|
borderColor: o.logo?.borderColor ?? null,
|
|
71
|
-
logos:
|
|
74
|
+
logos: _(c, p),
|
|
72
75
|
offsets: o.cascade?.offsets,
|
|
73
76
|
overlap: o.cascade?.overlap ?? b,
|
|
74
77
|
shadow: "elevation",
|
|
75
|
-
size:
|
|
76
|
-
status:
|
|
78
|
+
size: p,
|
|
79
|
+
status: f
|
|
77
80
|
})
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
82
|
-
const
|
|
83
|
-
alt:
|
|
83
|
+
const s = i(n(t, "primary_text")) || i(g(r, "merchant_name"));
|
|
84
|
+
if (!s) return null;
|
|
85
|
+
const l = z(g(r, "amount")), A = i(n(t, "header_text")) || i(n(t, "date")), h = u(n(t, "logo")) ?? u({
|
|
86
|
+
alt: s,
|
|
84
87
|
fallback_guid: r.category_guid,
|
|
85
88
|
guid: r.merchant_guid
|
|
86
|
-
}),
|
|
87
|
-
return /* @__PURE__ */ e(
|
|
88
|
-
amount:
|
|
89
|
+
}), v = o.logo?.size ?? k;
|
|
90
|
+
return /* @__PURE__ */ e(T, {
|
|
91
|
+
amount: l !== void 0 && l !== 0 ? E(l, R.cents) : void 0,
|
|
89
92
|
amountPill: o.amountPill,
|
|
90
93
|
amountVariant: o.amountVariant,
|
|
91
94
|
background: o.background,
|
|
92
95
|
bgcolor: o.bgcolor,
|
|
93
96
|
borderColor: o.borderColor,
|
|
94
|
-
eyebrow: o.hideDate ? void 0 :
|
|
97
|
+
eyebrow: o.hideDate ? void 0 : A,
|
|
95
98
|
fullBleed: o.fullBleed,
|
|
96
99
|
gap: o.gap,
|
|
97
|
-
logo:
|
|
98
|
-
logo:
|
|
99
|
-
size:
|
|
100
|
+
logo: h ? /* @__PURE__ */ e(C, {
|
|
101
|
+
logo: h,
|
|
102
|
+
size: v
|
|
100
103
|
}) : L,
|
|
101
104
|
logoBorderColor: o.logo?.borderColor,
|
|
102
105
|
logoRadius: o.logo?.radius,
|
|
103
106
|
logoShadow: o.logo?.shadow,
|
|
104
|
-
logoSize:
|
|
105
|
-
name:
|
|
107
|
+
logoSize: v,
|
|
108
|
+
name: s,
|
|
106
109
|
nameVariant: o.nameVariant,
|
|
107
|
-
trailing:
|
|
110
|
+
trailing: f
|
|
108
111
|
});
|
|
109
112
|
};
|
|
110
113
|
export {
|
|
111
|
-
|
|
114
|
+
io as default
|
|
112
115
|
};
|
|
113
116
|
|
|
114
117
|
//# sourceMappingURL=MerchantBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 64\nconst LOGO_OVERLAP = 6\nconst RANKED_LOGO_SIZE = 72\nconst RANKED_MAX = 3\nconst
|
|
1
|
+
{"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack, { type CascadeOffsets } from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 64\nconst LOGO_OVERLAP = 6\nconst RANKED_LOGO_SIZE = 72\nconst RANKED_MAX = 3\n// The ranked row's room above the first tile for its badge overhang; the variant's drops start below it.\nconst RANKED_TOP = 10\n// Drops for a ranked variant that sets no `cascade.offsets` for its tile count.\nconst RANKED_DROPS = [0, 10, 25] as const\n// The tile counts `cascade.offsets` can name.\nconst hasCascadeOffsets = (count: number): count is keyof CascadeOffsets =>\n count === 2 || count === 3 || count === 4\nconst FALLBACK_ICON_SIZE = 32\n\n/** A logo ref naming a known logo guid, else undefined, so an unusable one falls through. */\nconst asMerchantLogo = (value: unknown): LogoRef | undefined => {\n const ref = asLogoRef(value)\n return ref?.guid && isLogoGuid(ref.guid) ? ref : undefined\n}\n\nconst uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const byGuid = new Map<string, LogoRef>()\n for (const ref of refs.map(asMerchantLogo)) {\n if (ref?.guid && !byGuid.has(ref.guid)) byGuid.set(ref.guid, ref)\n }\n return [...byGuid.values()]\n}\n\nconst storefront = (\n <Icon\n aria-hidden={true}\n data-icon=\"storefront\"\n name=\"storefront\"\n size={FALLBACK_ICON_SIZE}\n sx={{ color: 'text.secondary' }}\n />\n)\n\nconst logoTiles = (refs: LogoRef[], size: number) =>\n refs.length\n ? refs.map((ref) => <LogoFromGuid key={ref.guid} logo={ref} size={size} />)\n : [storefront]\n\nconst MerchantBlock = ({ payload }: MerchantBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const config = resolveVariantConfig(\n MERCHANT_LAYOUT,\n instance_slot.variant,\n merchantBlockVariant.SingleStandard,\n 'MerchantBlock',\n )\n const statusText = asText(slotOrFlat(instance_slot, 'status_text'))\n const statusPill =\n config.status && statusText ? (\n <StatusPill\n icon={\n <Icon\n aria-hidden={true}\n data-icon=\"check_circle\"\n fill={true}\n name=\"check_circle\"\n size={16}\n sx={{ color: 'success.700' }}\n />\n }\n label={statusText}\n sx={\n config.kind === 'single' ? undefined : { alignSelf: 'stretch', justifyContent: 'center' }\n }\n />\n ) : undefined\n\n if (config.kind !== 'single') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n if (config.kind === 'ranked' && logos.length) {\n const ranked = logos.slice(0, RANKED_MAX)\n const drops =\n (hasCascadeOffsets(ranked.length) && config.cascade?.offsets?.[ranked.length]) ||\n RANKED_DROPS\n\n return (\n <LogoClusterCard\n background={config.background}\n fullBleed={true}\n logos={logoTiles(ranked, RANKED_LOGO_SIZE)}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n rankOffsets={drops.map((drop) => RANKED_TOP + drop)}\n ranked={true}\n />\n )\n }\n\n const cascadeSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <Stack\n sx={{\n background: config.background,\n bgcolor: config.background ? undefined : config.bgcolor,\n p: 16,\n width: '100%',\n }}\n >\n <P2PLogoStack\n borderColor={config.logo?.borderColor ?? null}\n logos={logoTiles(logos, cascadeSize)}\n offsets={config.cascade?.offsets}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n shadow=\"elevation\"\n size={cascadeSize}\n status={statusPill}\n />\n </Stack>\n )\n }\n\n // ditto's slot names first.\n const merchantName =\n asText(slot(data, 'primary_text')) || asText(slotOrFlat(instance_slot, 'merchant_name'))\n if (!merchantName) return null\n\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n const date = asText(slot(data, 'header_text')) || asText(slot(data, 'date'))\n const logo =\n asMerchantLogo(slot<unknown>(data, 'logo')) ??\n asMerchantLogo({\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n })\n const logoSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <MerchantHighlightCard\n amount={\n amount !== undefined && amount !== 0\n ? formatCurrency(amount, CURRENCY_FORMAT.cents)\n : undefined\n }\n amountPill={config.amountPill}\n amountVariant={config.amountVariant}\n background={config.background}\n bgcolor={config.bgcolor}\n borderColor={config.borderColor}\n eyebrow={config.hideDate ? undefined : date}\n fullBleed={config.fullBleed}\n gap={config.gap}\n logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n nameVariant={config.nameVariant}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAM,IAAY,IACZ,IAAe,GACf,IAAmB,IACnB,IAAa,GAEb,IAAa,IAEb,IAAe;AAAA,EAAC;AAAA,EAAG;AAAA,EAAI;AAAE,GAEzB,IAAA,CAAqB,MACzB,MAAU,KAAK,MAAU,KAAK,MAAU,GACpC,IAAqB,IAGrB,IAAA,CAAkB,MAAwC;AAC9D,QAAM,IAAM,EAAU,CAAK;AAC3B,SAAO,GAAK,QAAQ,EAAW,EAAI,IAAI,IAAI,IAAM;AACnD,GAEM,IAAA,CAAe,MAA6B;AAChD,MAAI,CAAC,MAAM,QAAQ,CAAI,EAAG,QAAO,CAAC;AAClC,QAAM,IAAS,oBAAI,IAAqB;AACxC,aAAW,KAAO,EAAK,IAAI,CAAc,EACvC,CAAI,GAAK,QAAQ,CAAC,EAAO,IAAI,EAAI,IAAI,KAAG,EAAO,IAAI,EAAI,MAAM,CAAG;AAElE,SAAO,CAAC,GAAG,EAAO,OAAO,CAAC;AAC5B,GAEM,IACJ,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,aAAU;AAAA,EACV,MAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI,EAAE,OAAO,iBAAiB;AAC/B,CAAA,GAGG,IAAA,CAAa,GAAiB,MAClC,EAAK,SACD,EAAK,IAAA,CAAK,MAAQ,gB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AiB,EAAO,MAAM;AAAA,IAC9B,YAAY,EAAO,MAAM;AAAA,IACzB,YAAY,EAAO,MAAM;AAAA,IACf,UAAA;AAAA,IACV,MAAM;AAAA,IACN,aAAa,EAAO;AAAA,IACpB,UAAU;AAAA,EACX,CAAA;AAEL"}
|
|
@@ -34,7 +34,7 @@ export interface MerchantBlockLayoutConfig {
|
|
|
34
34
|
borderColor?: string;
|
|
35
35
|
radius?: number;
|
|
36
36
|
};
|
|
37
|
-
/** Cascade
|
|
37
|
+
/** Cascade and ranked: px the tiles overlap, and each tile's drop from the top of the row per tile count. */
|
|
38
38
|
cascade?: {
|
|
39
39
|
overlap?: number;
|
|
40
40
|
offsets?: CascadeOffsets;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WARM_LIME_ACCENT_GRADIENT as r, celebrateGradient as
|
|
2
|
-
var
|
|
1
|
+
import { WARM_LIME_ACCENT_GRADIENT as r, celebrateGradient as i } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var t = {
|
|
3
3
|
Highlight: "highlight",
|
|
4
4
|
SingleStandard: "single_standard",
|
|
5
5
|
SingleSuccess: "single_success",
|
|
@@ -11,7 +11,7 @@ var s = {
|
|
|
11
11
|
}, l = { bgcolor: "secondary.lighter" }, a = {
|
|
12
12
|
background: r,
|
|
13
13
|
status: !0
|
|
14
|
-
},
|
|
14
|
+
}, e = {
|
|
15
15
|
kind: "single",
|
|
16
16
|
amountVariant: "pill",
|
|
17
17
|
fullBleed: !0,
|
|
@@ -30,23 +30,23 @@ var s = {
|
|
|
30
30
|
borderColor: "warning.light"
|
|
31
31
|
},
|
|
32
32
|
single_standard: {
|
|
33
|
-
...
|
|
33
|
+
...e,
|
|
34
34
|
...l
|
|
35
35
|
},
|
|
36
36
|
single_success: {
|
|
37
|
-
...
|
|
37
|
+
...e,
|
|
38
38
|
...a
|
|
39
39
|
},
|
|
40
40
|
single_subscription: {
|
|
41
|
-
...
|
|
41
|
+
...e,
|
|
42
42
|
amountPill: {
|
|
43
43
|
px: 10,
|
|
44
44
|
fontWeight: 400
|
|
45
45
|
},
|
|
46
|
-
background:
|
|
46
|
+
background: i(232.03),
|
|
47
47
|
gap: 12,
|
|
48
48
|
logo: {
|
|
49
|
-
...
|
|
49
|
+
...e.logo,
|
|
50
50
|
size: 64
|
|
51
51
|
},
|
|
52
52
|
nameVariant: "h3"
|
|
@@ -61,7 +61,7 @@ var s = {
|
|
|
61
61
|
},
|
|
62
62
|
multiple_subscription: {
|
|
63
63
|
kind: "cascade",
|
|
64
|
-
background:
|
|
64
|
+
background: i(200.73),
|
|
65
65
|
cascade: {
|
|
66
66
|
overlap: 8,
|
|
67
67
|
offsets: {
|
|
@@ -86,12 +86,23 @@ var s = {
|
|
|
86
86
|
},
|
|
87
87
|
multiple_badged: {
|
|
88
88
|
kind: "ranked",
|
|
89
|
-
background:
|
|
89
|
+
background: i(242.46),
|
|
90
|
+
cascade: {
|
|
91
|
+
overlap: 8,
|
|
92
|
+
offsets: {
|
|
93
|
+
2: [0, 34],
|
|
94
|
+
3: [
|
|
95
|
+
0,
|
|
96
|
+
17,
|
|
97
|
+
34
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
90
101
|
}
|
|
91
102
|
};
|
|
92
103
|
export {
|
|
93
104
|
n as MERCHANT_LAYOUT,
|
|
94
|
-
|
|
105
|
+
t as merchantBlockVariant
|
|
95
106
|
};
|
|
96
107
|
|
|
97
108
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import type { CascadeOffsets } from '../../../components/P2PLogoStack'\nimport {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Cascade
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import type { CascadeOffsets } from '../../../components/P2PLogoStack'\nimport {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Cascade and ranked: px the tiles overlap, and each tile's drop from the top of the row per tile count. */\n cascade?: { overlap?: number; offsets?: CascadeOffsets }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // Figma 1268:54330 (Single): 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n // Figma 1268:54330 `Logos`: 72px tiles with a divider border, 64px apart, top/centre/bottom of 106px.\n // The 2- and 4-tile staircases (not drawn in Figma) keep the shared shape over the same 34px drop.\n multiple_subscription: {\n kind: 'cascade',\n background: celebrateGradient(200.73),\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34], 4: [0, 11, 23, 34] } },\n logo: { size: 72, borderColor: 'divider' },\n },\n // Figma 587:129812 `Logos` (Monthly Top Merchant Spending): 72px badged tiles overlapping 8px, top/centre/bottom\n // of 106px. Two tiles (not drawn in Figma) keep the same 34px drop, as multiple_subscription does.\n multiple_badged: {\n kind: 'ranked',\n background: celebrateGradient(242.46),\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34] } },\n },\n}\n"],"mappings":";AAQA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GA2BM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAGhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA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