@mx-cartographer/experiences 9.7.197 → 9.7.199-alpha-moratorium
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 +11 -1
- package/dist/core/types/Insights.d.ts +1 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +6 -0
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +4 -4
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +4 -4
- package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +4 -4
- package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js +8 -8
- package/dist/insights/components/shared/Charts/EmptyBarChart.es.js +4 -4
- package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js +4 -4
- package/dist/insights/index.es.js +84 -84
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +216 -185
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +12 -11
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +2 -2
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +13 -13
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +10 -4
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +78 -71
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +30 -24
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +10 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +17 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +25 -25
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +5 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -9
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +28 -27
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +26 -0
- package/dist/insights-v2/components/CompactDirectDepositCard.es.js +73 -0
- package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
- package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +22 -20
- package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
- package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
- package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +25 -25
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
- package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +120 -116
- package/dist/insights-v2/mappings/blocks.es.js +118 -116
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +53 -53
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
1
|
+
import { useGlobalCopyStore as H, useGlobalStore as P } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { slot as a } from "../../../../core/types/Insights.es.js";
|
|
3
3
|
import { CURRENCY_FORMAT as x, formatCurrency as C } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
-
import { useBeatActions as
|
|
5
|
-
import { resolveVariantConfig as
|
|
4
|
+
import { useBeatActions as U } from "../../../beatActions.es.js";
|
|
5
|
+
import { resolveVariantConfig as V } from "../../resolveVariantConfig.es.js";
|
|
6
6
|
import { asLogoRef as I } from "../../slotReaders.es.js";
|
|
7
|
-
import { USER_RESPONSE as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { logoFromRef as
|
|
11
|
-
import
|
|
12
|
-
import { statusIconName as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { subscriptionFrequency as
|
|
16
|
-
import { getLayoutConfig as
|
|
17
|
-
import { observer as
|
|
18
|
-
import { Icon as
|
|
7
|
+
import { USER_RESPONSE as W, repeatingTransactionOf as Y } from "../../../ctaActions/subscriptionAnswer.es.js";
|
|
8
|
+
import K from "../../../components/CategoryTile.es.js";
|
|
9
|
+
import J, { isKnownIcon as Q } from "../../../components/LogoMark.es.js";
|
|
10
|
+
import { logoFromRef as X } from "../../../components/shared/EntityLogo.es.js";
|
|
11
|
+
import oo from "../../../components/LogoFromGuid.es.js";
|
|
12
|
+
import { statusIconName as ro, statusIconPalette as R } from "../../../components/statusIcon.es.js";
|
|
13
|
+
import to from "../../../components/StatusMessageCard.es.js";
|
|
14
|
+
import eo from "../../../components/TransactionListCard.es.js";
|
|
15
|
+
import { subscriptionFrequency as no } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
16
|
+
import { getLayoutConfig as io, transactionBlockVariant as ao } from "./layout.es.js";
|
|
17
|
+
import { observer as so } from "mobx-react-lite";
|
|
18
|
+
import { Icon as T } from "@mxenabled/mx-icons";
|
|
19
19
|
import { jsx as t } from "react/jsx-runtime";
|
|
20
|
-
import { alpha as
|
|
20
|
+
import { alpha as co, useTheme as mo } from "@mui/material/styles";
|
|
21
21
|
import g from "@mui/material/Box";
|
|
22
|
-
var c = 32,
|
|
23
|
-
const e =
|
|
22
|
+
var c = 32, uo = Math.round(c * 0.625), lo = 24, S = 32, go = 20, fo = ({ icon: i }) => {
|
|
23
|
+
const e = ro(i?.guid);
|
|
24
24
|
return e ? /* @__PURE__ */ t(g, {
|
|
25
25
|
"aria-hidden": !0,
|
|
26
26
|
"data-icon": e,
|
|
27
27
|
"data-testid": "subscription-badge",
|
|
28
28
|
sx: {
|
|
29
29
|
alignItems: "center",
|
|
30
|
-
bgcolor: `${
|
|
30
|
+
bgcolor: `${R(i?.color)}.main`,
|
|
31
31
|
borderRadius: "50%",
|
|
32
32
|
display: "flex",
|
|
33
|
-
height:
|
|
33
|
+
height: S,
|
|
34
34
|
justifyContent: "center",
|
|
35
|
-
width:
|
|
35
|
+
width: S
|
|
36
36
|
},
|
|
37
|
-
children: /* @__PURE__ */ t(
|
|
37
|
+
children: /* @__PURE__ */ t(T, {
|
|
38
38
|
fill: !0,
|
|
39
39
|
name: e,
|
|
40
|
-
size:
|
|
41
|
-
sx: { color: `${
|
|
40
|
+
size: go,
|
|
41
|
+
sx: { color: `${R(i?.color)}.contrastText` }
|
|
42
42
|
})
|
|
43
43
|
}) : null;
|
|
44
|
-
},
|
|
45
|
-
const o =
|
|
44
|
+
}, po = (i, e, m) => {
|
|
45
|
+
const o = X(i.logo, i.primary_text);
|
|
46
46
|
if (o) {
|
|
47
47
|
if (o.logo_name) {
|
|
48
|
-
if (!
|
|
48
|
+
if (!Q(o.logo_name)) return;
|
|
49
49
|
const s = !!o.logo_fill, n = o.logo_color ?? e.palette.chart.chart2 ?? e.palette.primary.main;
|
|
50
50
|
return /* @__PURE__ */ t(g, {
|
|
51
51
|
sx: {
|
|
@@ -55,41 +55,41 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
|
|
|
55
55
|
justifyContent: "center",
|
|
56
56
|
width: c,
|
|
57
57
|
...s && {
|
|
58
|
-
bgcolor:
|
|
58
|
+
bgcolor: co(n, 0.15),
|
|
59
59
|
borderRadius: `${e.shape.borderRadius}px`
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
children: /* @__PURE__ */ t(
|
|
62
|
+
children: /* @__PURE__ */ t(T, {
|
|
63
63
|
name: o.logo_name,
|
|
64
|
-
size:
|
|
64
|
+
size: uo,
|
|
65
65
|
sx: { color: s ? n : o.logo_color }
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
if (o.merchant_guid || o.institution_guid) return /* @__PURE__ */ t(
|
|
69
|
+
if (o.merchant_guid || o.institution_guid) return /* @__PURE__ */ t(J, {
|
|
70
70
|
logo: o,
|
|
71
71
|
size: c
|
|
72
72
|
});
|
|
73
|
-
if (o.category_guid) return /* @__PURE__ */ t(
|
|
73
|
+
if (o.category_guid) return /* @__PURE__ */ t(K, {
|
|
74
74
|
categoryGuid: o.category_guid,
|
|
75
75
|
size: c,
|
|
76
76
|
tint: m
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
},
|
|
80
|
-
const e =
|
|
79
|
+
}, wo = so(({ payload: i }) => {
|
|
80
|
+
const e = mo(), m = P(), { recurring: o } = H(), { beat: s } = U(), { data: n, variant: E } = i.instance_slot, { answeredBackground: f, background: u, cardVariant: k, categoryTint: B, creditAmounts: O, elevated: A, followsSubscription: l, headerColor: G, headerRegular: L, raised: F, showFooter: N, showFrequency: p, showHeader: M, statusMessage: w, sx: z } = V(io(e), E, ao.NoHeader, "TransactionBlock"), _ = (p || l) && s ? Y({
|
|
81
81
|
beat: s,
|
|
82
82
|
stores: m
|
|
83
|
-
}) : void 0,
|
|
84
|
-
if (
|
|
83
|
+
}) : void 0, h = !!l && _?.user_response === W.CONFIRMED;
|
|
84
|
+
if (w) {
|
|
85
85
|
const r = a(n, "message");
|
|
86
|
-
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(
|
|
86
|
+
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(to, {
|
|
87
87
|
icon: /* @__PURE__ */ t(g, {
|
|
88
88
|
"aria-hidden": "true",
|
|
89
89
|
sx: { display: "flex" },
|
|
90
|
-
children: /* @__PURE__ */ t(
|
|
90
|
+
children: /* @__PURE__ */ t(oo, {
|
|
91
91
|
logo: I(a(n, "icon")),
|
|
92
|
-
size:
|
|
92
|
+
size: lo
|
|
93
93
|
})
|
|
94
94
|
}),
|
|
95
95
|
message: r,
|
|
@@ -99,34 +99,35 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
|
|
|
99
99
|
} : void 0
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
const d = a(n, "series"),
|
|
102
|
+
const d = a(n, "series"), y = a(n, "header_text");
|
|
103
103
|
if (!Array.isArray(d) || !d.length) return null;
|
|
104
|
-
const
|
|
104
|
+
const Z = M && typeof y == "string" ? y : void 0, b = a(n, "footer_text"), $ = a(n, "footer_amount"), j = N && typeof b == "string" ? {
|
|
105
105
|
label: b,
|
|
106
|
-
amount: C(
|
|
107
|
-
} : void 0,
|
|
108
|
-
return /* @__PURE__ */ t(
|
|
109
|
-
background:
|
|
110
|
-
badge:
|
|
106
|
+
amount: C($, x.cents)
|
|
107
|
+
} : void 0, q = p ? no(o, _) : void 0, D = l ? /* @__PURE__ */ t(fo, { icon: I(a(n, h ? "reviewed_icon" : "icon")) }) : void 0, v = (r) => !!O && typeof r == "number" && r > 0;
|
|
108
|
+
return /* @__PURE__ */ t(eo, {
|
|
109
|
+
background: h && f ? f : u,
|
|
110
|
+
badge: D,
|
|
111
111
|
elevated: A,
|
|
112
|
-
footer:
|
|
113
|
-
header:
|
|
112
|
+
footer: j,
|
|
113
|
+
header: Z,
|
|
114
114
|
headerColor: G,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
headerRegular: L,
|
|
116
|
+
raised: F,
|
|
117
|
+
sx: z,
|
|
117
118
|
variant: k,
|
|
118
119
|
rows: d.map((r) => ({
|
|
119
120
|
amount: typeof r.amount == "number" ? `${v(r.amount) ? "+" : ""}${C(r.amount, x.cents)}` : "",
|
|
120
121
|
amountColor: v(r.amount) ? "success.main" : void 0,
|
|
121
|
-
amountCaption:
|
|
122
|
-
leading:
|
|
122
|
+
amountCaption: q,
|
|
123
|
+
leading: po(r, e, B),
|
|
123
124
|
subtitle: r.secondary_text ?? "",
|
|
124
125
|
title: r.primary_text ?? ""
|
|
125
126
|
}))
|
|
126
127
|
});
|
|
127
128
|
});
|
|
128
129
|
export {
|
|
129
|
-
|
|
130
|
+
wo as TransactionBlock
|
|
130
131
|
};
|
|
131
132
|
|
|
132
133
|
//# sourceMappingURL=TransactionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport CategoryTile from '../../../components/CategoryTile'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoMark, { isKnownIcon } from '../../../components/LogoMark'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef } from '../../slotReaders'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * The row's leading logo from its `LogoRef`; an unrecognized guid prefix draws none rather than\n * guessing. The variant's `categoryTint` styles only a `CAT-` row; a merchant's `fallback_guid`\n * keeps `MerchantLogo`'s untinted fallback.\n */\nconst renderRowLogo = (row: InstanceSlotRow, theme: Theme, categoryTint?: number) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return undefined\n\n // A status `{ icon, color }` logo is a bare coloured glyph. An `ICO-` fill logo (Weekly New\n // Merchants' \"Others\" row) is Figma's accent tile: its colour, else chart-2, at 15% behind the glyph.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n // Figma: match the row's other logo tiles.\n borderRadius: `${theme.shape.borderRadius}px`,\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\n </Box>\n )\n }\n\n if (logo.merchant_guid || logo.institution_guid) {\n return <LogoMark logo={logo} size={ROW_LOGO_SIZE} />\n }\n\n if (logo.category_guid) {\n return (\n <CategoryTile categoryGuid={logo.category_guid} size={ROW_LOGO_SIZE} tint={categoryTint} />\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n categoryTint,\n creditAmounts,\n elevated,\n followsSubscription,\n headerColor,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={asLogoRef(slot(data, 'icon'))} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer =\n showFooter && typeof footerText === 'string'\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, CURRENCY_FORMAT.cents),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={asLogoRef(slot(data, subscribed ? 'reviewed_icon' : 'icon'))} />\n ) : undefined\n\n // Only a positive amount reads as a credit.\n const isCredit = (amount: unknown) => !!creditAmounts && typeof amount === 'number' && amount > 0\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n elevated={elevated}\n footer={footer}\n header={header}\n headerColor={headerColor}\n raised={raised}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount:\n typeof row.amount === 'number'\n ? `${isCredit(row.amount) ? '+' : ''}${formatCurrency(row.amount, CURRENCY_FORMAT.cents)}`\n : '',\n amountColor: isCredit(row.amount) ? 'success.main' : undefined,\n amountCaption: frequency,\n leading: renderRowLogo(row, theme, categoryTint),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,GAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AAAA,MACd,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACA,MAAA;AAAA,MACN,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,GAAG,EAAkB,GAAM,KAAK,CAAA,gBAAiB;AAAA,IAC/D,CAAA;AAAA,EACE,CAAA,IAvBW;AAyBpB,GAOM,KAAA,CAAiB,GAAsB,GAAc,MAA0B;AACnF,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL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AK,GAAM,IAAa,kBAAkB,MAAM,CAAC,EAAI,CAAA,IACtF,QAGE,IAAA,CAAY,MAAoB,CAAC,CAAC,KAAiB,OAAO,KAAW,YAAY,IAAS;AAEhG,SACE,gBAAA,EAAC,IAAD;AAAA,IACE,YAAY,KAAc,IAAqB,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACG,UAAA;AAAA,IACF,QAAA;AAAA,IACA,QAAA;AAAA,IACK,aAAA;AAAA,IACL,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QACE,OAAO,EAAI,UAAW,WAClB,GAAG,EAAS,EAAI,MAAM,IAAI,MAAM,EAAA,GAAK,EAAe,EAAI,QAAQ,EAAgB,KAAK,CAAA,KACrF;AAAA,MACN,aAAa,EAAS,EAAI,MAAM,IAAI,iBAAiB;AAAA,MACrD,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,GAAO,CAAY;AAAA,MAC/C,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\nimport type { Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport CategoryTile from '../../../components/CategoryTile'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport LogoMark, { isKnownIcon } from '../../../components/LogoMark'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef } from '../../slotReaders'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * The row's leading logo from its `LogoRef`; an unrecognized guid prefix draws none rather than\n * guessing. The variant's `categoryTint` styles only a `CAT-` row; a merchant's `fallback_guid`\n * keeps `MerchantLogo`'s untinted fallback.\n */\nconst renderRowLogo = (row: InstanceSlotRow, theme: Theme, categoryTint?: number) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return undefined\n\n // A status `{ icon, color }` logo is a bare coloured glyph. An `ICO-` fill logo (Weekly New\n // Merchants' \"Others\" row) is Figma's accent tile: its colour, else chart-2, at 15% behind the glyph.\n const accentTile = !!logo.logo_fill\n const tileColor = logo.logo_color ?? theme.palette.chart.chart2 ?? theme.palette.primary.main\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n ...(accentTile && {\n bgcolor: alpha(tileColor, 0.15),\n // Figma: match the row's other logo tiles.\n borderRadius: `${theme.shape.borderRadius}px`,\n }),\n }}\n >\n <Icon\n name={logo.logo_name}\n size={ROW_ICON_SIZE}\n sx={{ color: accentTile ? tileColor : logo.logo_color }}\n />\n </Box>\n )\n }\n\n if (logo.merchant_guid || logo.institution_guid) {\n return <LogoMark logo={logo} size={ROW_LOGO_SIZE} />\n }\n\n if (logo.category_guid) {\n return (\n <CategoryTile categoryGuid={logo.category_guid} size={ROW_LOGO_SIZE} tint={categoryTint} />\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\", Weekly New Merchants' \"Total\")\n * renders when the variant's `showFooter` config is set (`with_header_footer`, `with_footer`), from\n * `data.footer_text` with `data.footer_amount` beside it, formatted like the row amounts (the\n * contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n categoryTint,\n creditAmounts,\n elevated,\n followsSubscription,\n headerColor,\n headerRegular,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={asLogoRef(slot(data, 'icon'))} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer =\n showFooter && typeof footerText === 'string'\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, CURRENCY_FORMAT.cents),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={asLogoRef(slot(data, subscribed ? 'reviewed_icon' : 'icon'))} />\n ) : undefined\n\n // Only a positive amount reads as a credit.\n const isCredit = (amount: unknown) => !!creditAmounts && typeof amount === 'number' && amount > 0\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n elevated={elevated}\n footer={footer}\n header={header}\n headerColor={headerColor}\n headerRegular={headerRegular}\n raised={raised}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount:\n typeof row.amount === 'number'\n ? `${isCredit(row.amount) ? '+' : ''}${formatCurrency(row.amount, CURRENCY_FORMAT.cents)}`\n : '',\n amountColor: isCredit(row.amount) ? 'success.main' : undefined,\n amountCaption: frequency,\n leading: renderRowLogo(row, theme, categoryTint),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,GAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AA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no rows: an icon + message banner from `data.icon` / `data.message`
|
|
16
16
|
* (Uncategorized Transactions V2 `complete`, "All Categorized!").
|
|
17
17
|
* - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).
|
|
18
|
-
* - `
|
|
19
|
-
* (Weekend Spending Summary:
|
|
18
|
+
* - `WithPrimaryHeaderFooter` — a regular `primary.main` header over the rows (each category on its
|
|
19
|
+
* tinted tile) and a total row (Weekend Spending Summary: "Showing x of y categories", "Total Spend").
|
|
20
20
|
* - `CreditListWithHeader` — the date above the rows, each amount a green "+" credit (Micro Deposits' full).
|
|
21
21
|
* - `CreditSummary` — credit rows, header never shown (Micro Deposits' mini sends one summed row).
|
|
22
22
|
*/
|
|
@@ -31,7 +31,7 @@ export declare const transactionBlockVariant: {
|
|
|
31
31
|
readonly InfoWash: "info_wash";
|
|
32
32
|
readonly WarningWash: "warning_wash";
|
|
33
33
|
readonly StatusMessage: "status_message";
|
|
34
|
-
readonly
|
|
34
|
+
readonly WithPrimaryHeaderFooter: "with_primary_header_footer";
|
|
35
35
|
readonly CreditListWithHeader: "credit_list_with_header";
|
|
36
36
|
readonly CreditSummary: "credit_summary";
|
|
37
37
|
};
|
|
@@ -45,6 +45,8 @@ export interface TransactionLayoutConfig {
|
|
|
45
45
|
cardVariant?: 'default' | 'primary';
|
|
46
46
|
/** Theme colour for the header text, over the card style's own. */
|
|
47
47
|
headerColor?: string;
|
|
48
|
+
/** Header text in the regular weight, not the grey utility header's bold (Figma "Showing x of y categories"). */
|
|
49
|
+
headerRegular?: boolean;
|
|
48
50
|
/** CSS background for the slot behind the card; the card renders borderless unless `raised`. */
|
|
49
51
|
background?: string;
|
|
50
52
|
/** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WARM_LIME_ACCENT_GRADIENT as
|
|
1
|
+
import { WARM_LIME_ACCENT_GRADIENT as t, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as s } from "../../../components/celebrationGradients.es.js";
|
|
2
2
|
var e = {
|
|
3
3
|
WithHeader: "with_header",
|
|
4
4
|
WithHeaderFooter: "with_header_footer",
|
|
@@ -10,10 +10,10 @@ var e = {
|
|
|
10
10
|
InfoWash: "info_wash",
|
|
11
11
|
WarningWash: "warning_wash",
|
|
12
12
|
StatusMessage: "status_message",
|
|
13
|
-
|
|
13
|
+
WithPrimaryHeaderFooter: "with_primary_header_footer",
|
|
14
14
|
CreditListWithHeader: "credit_list_with_header",
|
|
15
15
|
CreditSummary: "credit_summary"
|
|
16
|
-
},
|
|
16
|
+
}, r = 0.25, d = (a) => ({
|
|
17
17
|
[e.WithHeader]: {
|
|
18
18
|
showHeader: !0,
|
|
19
19
|
categoryTint: 0.15
|
|
@@ -47,28 +47,30 @@ var e = {
|
|
|
47
47
|
background: o,
|
|
48
48
|
showFrequency: !0,
|
|
49
49
|
followsSubscription: !0,
|
|
50
|
-
answeredBackground:
|
|
50
|
+
answeredBackground: t,
|
|
51
51
|
elevated: !0,
|
|
52
52
|
sx: { p: "28px 24px 24px 32px" }
|
|
53
53
|
},
|
|
54
54
|
[e.StatusMessage]: {
|
|
55
55
|
showHeader: !1,
|
|
56
56
|
statusMessage: !0,
|
|
57
|
-
background:
|
|
57
|
+
background: t
|
|
58
58
|
},
|
|
59
|
-
[e.
|
|
59
|
+
[e.WithPrimaryHeaderFooter]: {
|
|
60
60
|
showHeader: !0,
|
|
61
61
|
showFooter: !0,
|
|
62
|
-
headerColor: "primary.main"
|
|
62
|
+
headerColor: "primary.main",
|
|
63
|
+
headerRegular: !0,
|
|
64
|
+
categoryTint: r
|
|
63
65
|
},
|
|
64
66
|
[e.CreditListWithHeader]: {
|
|
65
67
|
showHeader: !0,
|
|
66
|
-
categoryTint:
|
|
68
|
+
categoryTint: r,
|
|
67
69
|
creditAmounts: !0
|
|
68
70
|
},
|
|
69
71
|
[e.CreditSummary]: {
|
|
70
72
|
showHeader: !1,
|
|
71
|
-
categoryTint:
|
|
73
|
+
categoryTint: r,
|
|
72
74
|
creditAmounts: !0
|
|
73
75
|
}
|
|
74
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n * - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).\n * - `
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n * - `ListWithHeaderFooter` — every row under a date header plus a total row (Duplicate Payment).\n * - `WithPrimaryHeaderFooter` — a regular `primary.main` header over the rows (each category on its\n * tinted tile) and a total row (Weekend Spending Summary: \"Showing x of y categories\", \"Total Spend\").\n * - `CreditListWithHeader` — the date above the rows, each amount a green \"+\" credit (Micro Deposits' full).\n * - `CreditSummary` — credit rows, header never shown (Micro Deposits' mini sends one summed row).\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n // A multi-row list with no in-card header plus a \"Total\" summary row (Weekly New Merchants; the\n // date range is the card subtitle). The plain no-footer list reuses `NoHeader`.\n WithFooter: 'with_footer',\n ListWithHeaderFooter: 'list_with_header_footer',\n List: 'list',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n WithPrimaryHeaderFooter: 'with_primary_header_footer',\n CreditListWithHeader: 'credit_list_with_header',\n CreditSummary: 'credit_summary',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** Theme colour for the header text, over the card style's own. */\n headerColor?: string\n /** Header text in the regular weight, not the grey utility header's bold (Figma \"Showing x of y categories\"). */\n headerRegular?: boolean\n /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** Row card at `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n /** A `CAT-` row logo's accent tile: the category colour at this opacity (0–1), bordered in it. */\n categoryTint?: number\n /** Draw each amount as a credit: a \"+\" prefix in `success.main`. */\n creditAmounts?: boolean\n}\n\n/** Figma's category background token: the category colour at 25%. */\nconst CATEGORY_BACKGROUND_TINT = 0.25\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n // `with_header` is Replenish Savings' multi-account card: its one summary row is a `CAT-` Transfer\n // logo, which we tint at its own 15% accent. (Other `with_header` beats, e.g. Large Transaction, use\n // a merchant logo, so the `CAT-` tint path never runs for them.)\n [transactionBlockVariant.WithHeader]: { showHeader: true, categoryTint: 0.15 },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.WithFooter]: { showHeader: false, showFooter: true },\n [transactionBlockVariant.ListWithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.List]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n elevated: true,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n // Figma 1283:89587: \"Showing x of y categories\" in 11px regular primary, each category tile at its 25% background.\n [transactionBlockVariant.WithPrimaryHeaderFooter]: {\n showHeader: true,\n showFooter: true,\n headerColor: 'primary.main',\n headerRegular: true,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n },\n [transactionBlockVariant.CreditListWithHeader]: {\n showHeader: true,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n [transactionBlockVariant.CreditSummary]: {\n showHeader: false,\n categoryTint: CATEGORY_BACKGROUND_TINT,\n creditAmounts: true,\n },\n})\n"],"mappings":";AA6BA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EAGV,YAAY;AAAA,EACZ,sBAAsB;AAAA,EACtB,MAAM;AAAA,EACN,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,eAAe;AACjB,GAuCM,IAA2B,MAGpB,IAAA,CACX,OAC8D;AAAA,EAI7D,CAAA,EAAwB,UAAA,GAAa;AAAA,IAAE,YAAY;AAAA,IAAM,cAAc;AAAA,EAAK;AAAA,EAC5E,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAA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Copy as x } from "../../../../core/utils/Localization.es.js";
|
|
2
2
|
import { useGlobalCopyStore as y } from "../../../../common/context/hooks.es.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import w,
|
|
3
|
+
import { slot as C } from "../../../../core/types/Insights.es.js";
|
|
4
|
+
import { CURRENCY_FORMAT as _, formatCurrency as R } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import { asNonEmptyText as w, asNumber as L, slotOrFlat as h } from "../../slotReaders.es.js";
|
|
6
|
+
import O, { isLogoGuid as S } from "../../../components/LogoFromGuid.es.js";
|
|
6
7
|
import f from "../../../components/LogoTile.es.js";
|
|
7
8
|
import i from "@mui/material/Stack";
|
|
8
9
|
import { Text as n } from "@mxenabled/mxui";
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { jsx as o, jsxs as
|
|
11
|
-
var g = 6,
|
|
12
|
-
if (
|
|
10
|
+
import { Icon as G } from "@mxenabled/mx-icons";
|
|
11
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
12
|
+
var g = 6, c = 32, j = (r) => typeof r == "object" && r !== null, z = ({ row: r }) => {
|
|
13
|
+
if (S(r.logo?.guid)) return /* @__PURE__ */ o(O, {
|
|
13
14
|
logo: r.logo,
|
|
14
|
-
size:
|
|
15
|
+
size: c
|
|
15
16
|
});
|
|
16
17
|
const e = r.logo?.alt;
|
|
17
|
-
return /* @__PURE__ */ o(
|
|
18
|
+
return /* @__PURE__ */ o(G, {
|
|
18
19
|
"aria-hidden": e ? void 0 : !0,
|
|
19
20
|
"aria-label": e,
|
|
20
21
|
"data-icon": "storefront",
|
|
@@ -23,16 +24,16 @@ var g = 6, d = 32, S = (r) => typeof r == "object" && r !== null, G = ({ row: r
|
|
|
23
24
|
size: 20,
|
|
24
25
|
sx: { color: "text.secondary" }
|
|
25
26
|
});
|
|
26
|
-
},
|
|
27
|
-
const e = y().insights_feed?.general, { instance_slot:
|
|
27
|
+
}, D = ({ payload: r }) => {
|
|
28
|
+
const e = y().insights_feed?.general, { instance_slot: l = {} } = r, m = L(h(l, "amount"));
|
|
28
29
|
if (m === void 0) return null;
|
|
29
|
-
const p = h(
|
|
30
|
+
const p = h(l, "data_series"), t = (Array.isArray(p) ? p : []).filter(j), u = t.length > g ? t.slice(0, 5) : t, s = t.length - u.length, d = x(e?.more_merchants ?? "", `${s}`) || void 0;
|
|
30
31
|
return /* @__PURE__ */ o(i, {
|
|
31
32
|
sx: {
|
|
32
33
|
px: 16,
|
|
33
34
|
width: "100%"
|
|
34
35
|
},
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ a(i, {
|
|
36
37
|
sx: {
|
|
37
38
|
border: 1,
|
|
38
39
|
borderColor: "divider",
|
|
@@ -42,7 +43,7 @@ var g = 6, d = 32, S = (r) => typeof r == "object" && r !== null, G = ({ row: r
|
|
|
42
43
|
pt: 12,
|
|
43
44
|
px: 16
|
|
44
45
|
},
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ a(i, {
|
|
46
47
|
direction: "row",
|
|
47
48
|
sx: {
|
|
48
49
|
alignItems: "baseline",
|
|
@@ -51,13 +52,13 @@ var g = 6, d = 32, S = (r) => typeof r == "object" && r !== null, G = ({ row: r
|
|
|
51
52
|
children: [/* @__PURE__ */ o(n, {
|
|
52
53
|
component: "p",
|
|
53
54
|
variant: "h2",
|
|
54
|
-
children: R(m,
|
|
55
|
+
children: R(m, _.cents)
|
|
55
56
|
}), /* @__PURE__ */ o(n, {
|
|
56
57
|
color: "text.secondary",
|
|
57
58
|
variant: "caption",
|
|
58
|
-
children: e?.total
|
|
59
|
+
children: w(C(l.data, "amount_label")) ?? e?.total
|
|
59
60
|
})]
|
|
60
|
-
}), t.length ? /* @__PURE__ */
|
|
61
|
+
}), t.length ? /* @__PURE__ */ a(i, {
|
|
61
62
|
component: "ul",
|
|
62
63
|
direction: "row",
|
|
63
64
|
sx: {
|
|
@@ -71,22 +72,22 @@ var g = 6, d = 32, S = (r) => typeof r == "object" && r !== null, G = ({ row: r
|
|
|
71
72
|
children: [u.map((b, v) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(f, {
|
|
72
73
|
borderColor: "divider",
|
|
73
74
|
borderRadius: 4,
|
|
74
|
-
size:
|
|
75
|
-
children: /* @__PURE__ */ o(
|
|
76
|
-
}) }, v)),
|
|
75
|
+
size: c,
|
|
76
|
+
children: /* @__PURE__ */ o(z, { row: b })
|
|
77
|
+
}) }, v)), s > 0 && /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(f, {
|
|
77
78
|
bgcolor: "action.hover",
|
|
78
79
|
borderColor: null,
|
|
79
80
|
borderRadius: 4,
|
|
80
|
-
size:
|
|
81
|
+
size: c,
|
|
81
82
|
children: /* @__PURE__ */ o(n, {
|
|
82
|
-
"aria-label":
|
|
83
|
+
"aria-label": d,
|
|
83
84
|
bold: !0,
|
|
84
85
|
color: "text.secondary",
|
|
85
|
-
role:
|
|
86
|
+
role: d ? "img" : void 0,
|
|
86
87
|
variant: "body2",
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
"aria-hidden":
|
|
89
|
-
children: ["+",
|
|
88
|
+
children: /* @__PURE__ */ a("span", {
|
|
89
|
+
"aria-hidden": d ? !0 : void 0,
|
|
90
|
+
children: ["+", s]
|
|
90
91
|
})
|
|
91
92
|
})
|
|
92
93
|
}) })]
|
|
@@ -99,7 +100,7 @@ var g = 6, d = 32, S = (r) => typeof r == "object" && r !== null, G = ({ row: r
|
|
|
99
100
|
});
|
|
100
101
|
};
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
+
D as default
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
//# sourceMappingURL=WeeklySmallPurchasesBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeeklySmallPurchasesBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport type
|
|
1
|
+
{"version":3,"file":"WeeklySmallPurchasesBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InstanceSlotRow } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport LogoTile from '../../../components/LogoTile'\nimport { asNonEmptyText, asNumber, slotOrFlat } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\nconst MAX_LOGOS = 6\nconst LOGO_SIZE = 32\n\nconst isRow = (row: unknown): row is InstanceSlotRow => typeof row === 'object' && row !== null\n\nconst RowLogo = ({ row }: { row: InstanceSlotRow }) => {\n if (isLogoGuid(row.logo?.guid)) return <LogoFromGuid logo={row.logo} size={LOGO_SIZE} />\n\n const alt = row.logo?.alt\n return (\n <Icon\n aria-hidden={alt ? undefined : true}\n aria-label={alt}\n data-icon=\"storefront\"\n name=\"storefront\"\n role={alt ? 'img' : undefined}\n size={20}\n sx={{ color: 'text.secondary' }}\n />\n )\n}\n\nconst WeeklySmallPurchasesBlock = ({ payload }: BlockProps) => {\n const generalCopy = useGlobalCopyStore().insights_feed?.general\n\n const { instance_slot = {} } = payload\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n if (amount === undefined) return null\n\n const rawRows = slotOrFlat(instance_slot, 'data_series')\n const rows = (Array.isArray(rawRows) ? rawRows : []).filter(isRow)\n // Past 6, the last tile becomes \"+N\" so the row stays at 6 tiles like Figma.\n const visibleRows = rows.length > MAX_LOGOS ? rows.slice(0, MAX_LOGOS - 1) : rows\n const overflowCount = rows.length - visibleRows.length\n const moreLabel =\n (buildDynamicCopy(generalCopy?.more_merchants ?? '', `${overflowCount}`) as string) || undefined\n\n return (\n <Stack sx={{ px: 16, width: '100%' }}>\n <Stack\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n gap: 12,\n pb: 16,\n pt: 12,\n px: 16,\n }}\n >\n <Stack direction=\"row\" sx={{ alignItems: 'baseline', gap: 6 }}>\n <Text component=\"p\" variant=\"h2\">\n {formatCurrency(amount, CURRENCY_FORMAT.cents)}\n </Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {/* V2 only: V1 payloads never carried the label, so there is no flat fallback. */}\n {asNonEmptyText(slot(instance_slot.data, 'amount_label')) ?? generalCopy?.total}\n </Text>\n </Stack>\n {rows.length ? (\n <Stack\n component=\"ul\"\n direction=\"row\"\n sx={{\n flexWrap: 'wrap',\n gap: 8,\n justifyContent: rows.length >= MAX_LOGOS ? 'space-between' : 'flex-start',\n listStyle: 'none',\n m: 0,\n p: 0,\n }}\n >\n {visibleRows.map((row, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <li key={index}>\n <LogoTile borderColor=\"divider\" borderRadius={4} size={LOGO_SIZE}>\n <RowLogo row={row} />\n </LogoTile>\n </li>\n ))}\n {overflowCount > 0 && (\n <li>\n <LogoTile\n bgcolor=\"action.hover\"\n borderColor={null}\n borderRadius={4}\n size={LOGO_SIZE}\n >\n <Text\n aria-label={moreLabel}\n bold={true}\n color=\"text.secondary\"\n role={moreLabel ? 'img' : undefined}\n variant=\"body2\"\n >\n <span aria-hidden={moreLabel ? true : undefined}>+{overflowCount}</span>\n </Text>\n </LogoTile>\n </li>\n )}\n </Stack>\n ) : (\n <Text color=\"text.secondary\" variant=\"body2\">\n {generalCopy?.no_small_purchases_found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AA,YACZ,MAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAM,IAAY,QAAQ;AAAA,YAC1B,SAAQ;AAAA,YAER,UAAA,gBAAA,EAAC,QAAD;AAAA,cAAM,eAAa,IAAY,KAAO;AAAA,cAAtC,UAAA,CAAiD,KAAE,CAAoB;AAAA;UACnE,CAAA;AAAA,QACE,CAAA,EACR,CAAA,CAED;AAAA,MAEP,CAAA,IAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,SAAQ;AAAA,QAClC,UAAA,GAAa;AAAA,MACV,CAAA,CAEH;AAAA;EACF,CAAA;AAEX"}
|
|
@@ -35,7 +35,9 @@ interface AccountHeroCardProps {
|
|
|
35
35
|
* gradient + confetti) slot.
|
|
36
36
|
*
|
|
37
37
|
* Figma: Set Up Direct Deposit (default + complete) and Switch Direct Deposit
|
|
38
|
-
* (complete) Content. Scope is the Content section only.
|
|
38
|
+
* (complete) Content. Scope is the Content section only. The mini (compact)
|
|
39
|
+
* layout is a separate component, `CompactDirectDepositCard` — not a mode of
|
|
40
|
+
* this one.
|
|
39
41
|
*/
|
|
40
42
|
declare const AccountHeroCard: ({ backdrop, backgroundImage, bgcolor, logo, name, nameVariant, status, subtitle, sx, }: AccountHeroCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
43
|
export default AccountHeroCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountHeroCard.es.js","names":[],"sources":["../../../src/insights-v2/components/AccountHeroCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { getLogoElevation } from './logoShadow'\n\n// Figma: the logo overhangs the white card's top edge by 25px and the slot pads\n// 16px above that overhang (so `pt = overhang + 16`).\nconst LOGO_OVERHANG = 25\n\ninterface AccountHeroCardProps {\n /** Central account/institution logo, rendered overhanging the card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line beneath the name, e.g. \"Checking Account\". */\n subtitle?: ReactNode\n /**\n * Name typography. Figma: Set Up/Switch Direct Deposit use body2 metrics\n * (13px / lh 16, default); Missing Interest Rate uses body1 (15px / lh 20).\n * Both render at weight 600.\n */\n nameVariant?: 'body1' | 'body2'\n /** Status element beneath the text (e.g. a `<StatusPill>`). */\n status?: ReactNode\n /** Decorative backdrop behind the card (e.g. a `<Confetti>` burst). */\n backdrop?: ReactNode\n /** Slot surface color token. Default `primary.lighter` (Figma's tinted slot,\n * theme-aware: light-blue in light mode, navy in dark). */\n bgcolor?: string\n /**\n * Optional decorative wash layered over `bgcolor` (e.g. a celebration\n * gradient). Figma's gradient is ~20% opacity over a white base, so this is a\n * `backgroundImage` on top of `bgcolor`, not a replacement — pass\n * `bgcolor=\"background.paper\"` with it for the complete state.\n */\n backgroundImage?: string\n sx?: SxProps\n}\n\n/**\n * A centered account hero: an overhanging institution logo above a white card\n * with a name, optional subtitle, and a status slot, over a tinted (or\n * gradient + confetti) slot.\n *\n * Figma: Set Up Direct Deposit (default + complete) and Switch Direct Deposit\n * (complete) Content. Scope is the Content section only.\n */\nconst AccountHeroCard = ({\n backdrop,\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n status,\n subtitle,\n sx,\n}: AccountHeroCardProps) => (\n <Box\n sx={{\n alignItems: 'center',\n bgcolor,\n ...(backgroundImage && { backgroundImage }),\n display: 'flex',\n flexDirection: 'column',\n pb: 16,\n position: 'relative',\n pt: LOGO_OVERHANG + 16,\n px: 16,\n width: '100%',\n ...sx,\n }}\n >\n {backdrop && (\n <Box aria-hidden={true} sx={{ inset: 0, position: 'absolute', zIndex: 0 }}>\n {backdrop}\n </Box>\n )}\n <Stack\n sx={{\n alignItems: 'center',\n // Theme-aware card surface (white in light, dark surface in dark) — not\n // `common.white`, which stays white and breaks dark mode.\n bgcolor: 'background.paper',\n borderRadius: '8px',\n // Figma: soft card drop-shadow (0 2px 8px rgba(0,0,0,0.12)).\n boxShadow: getLogoElevation,\n gap: 16,\n pb: 16,\n position: 'relative',\n pt: 36,\n px: 16,\n width: '100%',\n zIndex: 1,\n }}\n >\n <Box\n sx={{\n display: 'flex',\n left: '50%',\n position: 'absolute',\n top: -LOGO_OVERHANG,\n transform: 'translateX(-50%)',\n }}\n >\n {logo}\n </Box>\n <Stack sx={{ alignItems: 'center', gap: 12, minWidth: 0, width: '100%' }}>\n <Stack sx={{ alignItems: 'center', minWidth: 0, width: '100%' }}>\n {/* Figma name style: body2 (13/16) or body1 (15/20) metrics at weight\n 600. MXUI `bold` renders 700, so set fontWeight explicitly. A long name\n wraps, centred, across the card's width. */}\n <Text sx={{ fontWeight: 600, textAlign: 'center' }} variant={nameVariant}>\n {name}\n </Text>\n {subtitle && (\n <Text color=\"text.secondary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n )}\n </Stack>\n {/* Center the status regardless of its own alignment (StatusPill\n defaults to `alignSelf: flex-start` for left-aligned contexts). */}\n {status && (\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>{status}</Box>\n )}\n </Stack>\n </Stack>\n </Box>\n)\n\nexport default AccountHeroCard\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"AccountHeroCard.es.js","names":[],"sources":["../../../src/insights-v2/components/AccountHeroCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { getLogoElevation } from './logoShadow'\n\n// Figma: the logo overhangs the white card's top edge by 25px and the slot pads\n// 16px above that overhang (so `pt = overhang + 16`).\nconst LOGO_OVERHANG = 25\n\ninterface AccountHeroCardProps {\n /** Central account/institution logo, rendered overhanging the card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line beneath the name, e.g. \"Checking Account\". */\n subtitle?: ReactNode\n /**\n * Name typography. Figma: Set Up/Switch Direct Deposit use body2 metrics\n * (13px / lh 16, default); Missing Interest Rate uses body1 (15px / lh 20).\n * Both render at weight 600.\n */\n nameVariant?: 'body1' | 'body2'\n /** Status element beneath the text (e.g. a `<StatusPill>`). */\n status?: ReactNode\n /** Decorative backdrop behind the card (e.g. a `<Confetti>` burst). */\n backdrop?: ReactNode\n /** Slot surface color token. Default `primary.lighter` (Figma's tinted slot,\n * theme-aware: light-blue in light mode, navy in dark). */\n bgcolor?: string\n /**\n * Optional decorative wash layered over `bgcolor` (e.g. a celebration\n * gradient). Figma's gradient is ~20% opacity over a white base, so this is a\n * `backgroundImage` on top of `bgcolor`, not a replacement — pass\n * `bgcolor=\"background.paper\"` with it for the complete state.\n */\n backgroundImage?: string\n sx?: SxProps\n}\n\n/**\n * A centered account hero: an overhanging institution logo above a white card\n * with a name, optional subtitle, and a status slot, over a tinted (or\n * gradient + confetti) slot.\n *\n * Figma: Set Up Direct Deposit (default + complete) and Switch Direct Deposit\n * (complete) Content. Scope is the Content section only. The mini (compact)\n * layout is a separate component, `CompactDirectDepositCard` — not a mode of\n * this one.\n */\nconst AccountHeroCard = ({\n backdrop,\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n status,\n subtitle,\n sx,\n}: AccountHeroCardProps) => (\n <Box\n sx={{\n alignItems: 'center',\n bgcolor,\n ...(backgroundImage && { backgroundImage }),\n display: 'flex',\n flexDirection: 'column',\n pb: 16,\n position: 'relative',\n pt: LOGO_OVERHANG + 16,\n px: 16,\n width: '100%',\n ...sx,\n }}\n >\n {backdrop && (\n <Box aria-hidden={true} sx={{ inset: 0, position: 'absolute', zIndex: 0 }}>\n {backdrop}\n </Box>\n )}\n <Stack\n sx={{\n alignItems: 'center',\n // Theme-aware card surface (white in light, dark surface in dark) — not\n // `common.white`, which stays white and breaks dark mode.\n bgcolor: 'background.paper',\n borderRadius: '8px',\n // Figma: soft card drop-shadow (0 2px 8px rgba(0,0,0,0.12)).\n boxShadow: getLogoElevation,\n gap: 16,\n pb: 16,\n position: 'relative',\n pt: 36,\n px: 16,\n width: '100%',\n zIndex: 1,\n }}\n >\n <Box\n sx={{\n display: 'flex',\n left: '50%',\n position: 'absolute',\n top: -LOGO_OVERHANG,\n transform: 'translateX(-50%)',\n }}\n >\n {logo}\n </Box>\n <Stack sx={{ alignItems: 'center', gap: 12, minWidth: 0, width: '100%' }}>\n <Stack sx={{ alignItems: 'center', minWidth: 0, width: '100%' }}>\n {/* Figma name style: body2 (13/16) or body1 (15/20) metrics at weight\n 600. MXUI `bold` renders 700, so set fontWeight explicitly. A long name\n wraps, centred, across the card's width. */}\n <Text sx={{ fontWeight: 600, textAlign: 'center' }} variant={nameVariant}>\n {name}\n </Text>\n {subtitle && (\n <Text color=\"text.secondary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n )}\n </Stack>\n {/* Center the status regardless of its own alignment (StatusPill\n defaults to `alignSelf: flex-start` for left-aligned contexts). */}\n {status && (\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>{status}</Box>\n )}\n </Stack>\n </Stack>\n </Box>\n)\n\nexport default AccountHeroCard\n"],"mappings":";;;;;AAsDA,IAAM,IAAA,CAAmB,EACvB,UAAA,GACA,iBAAA,GACA,SAAA,IAAU,mBACV,MAAA,GACA,MAAA,GACA,aAAA,IAAc,SACd,QAAA,GACA,UAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAA;AAAA,IACA,GAAI,KAAmB,EAAE,iBAAA,EAAgB;AAAA,IACzC,SAAS;AAAA,IACT,eAAe;AAAA,IACf,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA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