@mx-cartographer/experiences 9.7.76 → 9.7.78
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 -0
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +20 -20
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +29 -25
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +7 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +5 -4
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/StatusMessageCard.d.ts +8 -3
- package/dist/insights-v2/components/StatusMessageCard.es.js +16 -15
- package/dist/insights-v2/components/StatusMessageCard.es.js.map +1 -1
- package/dist/networth/NetWorthWidget.d.ts +2 -0
- package/dist/networth/NetWorthWidget.es.js +62 -58
- package/dist/networth/NetWorthWidget.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [9.7.78] - 11-02-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Save an Extra $100 amount spacing and the Uncategorized Transactions V2 "All Categorized!" banner now match Figma (WEC-2153, WEC-2155)
|
|
4
|
+
- **CHANGED** - `StatusMessageCard` now always draws the elevation/1 shadow, as in Figma (WEC-2155)
|
|
5
|
+
- **FIXED** - `StatusMessageCard` message is readable in dark mode: the banner uses `success.lighter` and `text.primary`, as in Figma (WEC-2155)
|
|
6
|
+
- **FIXED** - Payday Cash Left Over Status money icon is 24px on both the on-track and off-track tiles and the Remaining Cash drawer rows are 64px tall, matching Figma; the tiles and drawer are shared, so Monthly Obligations Status changes too (WEC-2156)
|
|
7
|
+
|
|
8
|
+
## [9.7.77] - 11-02-2026
|
|
9
|
+
|
|
10
|
+
- **FIXED** - The Net Worth monthly table now shows the full number of months for the 6M and 9M timeframe selections; it previously dropped one month in certain calendar months (MEW-4195)
|
|
11
|
+
|
|
1
12
|
## [9.7.76] - 11-02-2026
|
|
2
13
|
|
|
3
14
|
- **ADDED** - Subscription Detected beat on Insights 2.0 (WEC-2147): `confirm_subscription_detected` registers the shared subscription status CTA. "Does this look right?" opens the survey, which saves the answer to the repeating transaction (Yes → `CONFIRMED`; a reason → `NEVER_SUBSCRIBED` / `CANCELLED` / `ONE_TIME_PURCHASE` / `WRONG_FREQUENCY`); the card then shows ✓ Confirmed or ✗ Incorrect with Undo. A CTA step can now bring its own survey reasons and submit (`surveyAnswer`); otherwise `survey_modal_block` sends beat feedback, and the last reason can drop its free-text field (`showDetailField`). The `info_wash` row captions the amount with the subscription's live frequency (e.g. YEARLY, from the shared `RECURRENCE_COPY` words; none while unknown) via `InsightTransactionRow` `amountCaption` and TransactionBlock `showFrequency`. Mini shows the "Does this look right?" link (its tap is the host's, as micro); a card whose action travels as `in_description_cta` now runs that step's `prepare`, so mini still loads the frequency. Fixtures, the `InsightsV2/Insights/SubscriptionDetectedV2` story and a contract test
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n/** One 64px row. The last row's divider runs full width; the rest are inset 24px (Figma). */\nconst RowItem = ({\n amount,\n isLast,\n leading,\n name,\n}: Omit<RemainingCashRow, 'key'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, px: 24, py:
|
|
1
|
+
{"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n/** One 64px row. The last row's divider runs full width; the rest are inset 24px (Figma). */\nconst RowItem = ({\n amount,\n isLast,\n leading,\n name,\n}: Omit<RemainingCashRow, 'key'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n {/* 64px as in Figma: 16px above and below the 32px logo, the row's tallest item. */}\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, px: 24, py: 16 }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n <Box sx={{ display: 'flex', flexShrink: 0, height: 32, width: 32 }}>{leading}</Box>\n <Text truncate={true} variant=\"body1\">\n {name}\n </Text>\n </Stack>\n <Text bold={true} sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {formatSignedCurrency(amount)}\n </Text>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 24, position: 'absolute', right: 0 }} />\n </Box>\n)\n\n// The drawer title is the h2, so section headers are h3 and each section is a real list.\nconst Section = ({ header, rows }: RemainingCashSectionProps) => (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {rows.map(({ key, ...row }, index) => (\n <RowItem {...row} isLast={index === rows.length - 1} key={key} />\n ))}\n </Stack>\n </Stack>\n)\n\n/** Presentational body of the Remaining Cash drawer (Figma 9936:39163, minus the drawer header). */\nconst RemainingCashContent = ({ accounts, expenses, summary }: RemainingCashContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n <Summary {...summary} />\n {accounts.rows.length > 0 && <Section {...accounts} />}\n {expenses.rows.length > 0 && <Section {...expenses} />}\n </Stack>\n)\n\nexport default RemainingCashCont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AA,GAAU,UAAA,GAAU,SAAA,EAAA,MAClD,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,SAAS;AAAA,IAAsB,IAAI;AAAA,EAAG;AAAA,EAAnD,UAAA;AAAA,IACE,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAU,CAAA;AAAA,IACtB,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,IACpD,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,EAChD"}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "../../../../common/components/IconBacking.es.js";
|
|
2
2
|
import u from "../../../components/LogoFromGuid.es.js";
|
|
3
|
-
import { statusIconName as
|
|
3
|
+
import { statusIconName as l } from "../../../components/statusIcon.es.js";
|
|
4
4
|
import { resolveVariantConfig as g } from "../../resolveVariantConfig.es.js";
|
|
5
5
|
import { getLayoutConfig as f } from "./layout.es.js";
|
|
6
6
|
import { InstitutionLogo as p } from "@mxenabled/mxui";
|
|
7
7
|
import { Icon as n } from "@mxenabled/mx-icons";
|
|
8
|
-
import { jsx as
|
|
8
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
import { useTheme as b } from "@mui/material/styles";
|
|
10
|
-
import { Stack as
|
|
11
|
-
var y = ({ slot:
|
|
12
|
-
const m = b(), o = g(f(m),
|
|
13
|
-
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */
|
|
10
|
+
import { Stack as c } from "@mui/material";
|
|
11
|
+
var y = ({ slot: r, variant: d, logo: e }) => {
|
|
12
|
+
const m = b(), o = g(f(m), d, "default", "AccountBlock");
|
|
13
|
+
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */ s(c, {
|
|
14
14
|
sx: {
|
|
15
15
|
alignItems: "center",
|
|
16
16
|
flexDirection: "row",
|
|
17
17
|
position: "relative"
|
|
18
18
|
},
|
|
19
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ i(u, {
|
|
20
20
|
logo: e,
|
|
21
21
|
size: 48
|
|
22
|
-
}), o.badge && /* @__PURE__ */
|
|
22
|
+
}), o.badge && /* @__PURE__ */ i(a, {
|
|
23
23
|
size: 20,
|
|
24
24
|
sx: {
|
|
25
25
|
position: "absolute",
|
|
26
26
|
right: -8,
|
|
27
27
|
top: -8
|
|
28
28
|
},
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ i(n, {
|
|
30
30
|
"aria-hidden": !0,
|
|
31
31
|
color: "error",
|
|
32
32
|
"data-testid": "account-block-error-badge",
|
|
@@ -41,24 +41,24 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
41
41
|
})
|
|
42
42
|
})]
|
|
43
43
|
});
|
|
44
|
-
if (
|
|
44
|
+
if (r.institution_guid) return /* @__PURE__ */ s(c, {
|
|
45
45
|
sx: {
|
|
46
46
|
alignItems: "center",
|
|
47
47
|
flexDirection: "row",
|
|
48
48
|
position: "relative"
|
|
49
49
|
},
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
alt: `${
|
|
52
|
-
institutionGuid: `${
|
|
50
|
+
children: [/* @__PURE__ */ i(p, {
|
|
51
|
+
alt: `${r.institution_name}`,
|
|
52
|
+
institutionGuid: `${r.institution_guid}`,
|
|
53
53
|
size: 48
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ i(a, {
|
|
55
55
|
size: 20,
|
|
56
56
|
sx: {
|
|
57
57
|
position: "absolute",
|
|
58
58
|
right: -8,
|
|
59
59
|
top: -8
|
|
60
60
|
},
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ i(n, {
|
|
62
62
|
color: "error",
|
|
63
63
|
fill: !0,
|
|
64
64
|
name: "error",
|
|
@@ -71,8 +71,8 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
71
71
|
})
|
|
72
72
|
})]
|
|
73
73
|
});
|
|
74
|
-
const t =
|
|
75
|
-
return t ? /* @__PURE__ */
|
|
74
|
+
const t = l(r.icon_name && `ICO-${r.icon_name}`) ?? (o.logo_bGcolor ? l(e?.guid) : void 0);
|
|
75
|
+
return t ? /* @__PURE__ */ i(c, {
|
|
76
76
|
"data-icon": t,
|
|
77
77
|
"data-testid": "account-block-icon-tile",
|
|
78
78
|
sx: {
|
|
@@ -89,10 +89,10 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
89
89
|
borderWidth: 1.5
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ i(n, {
|
|
93
93
|
"aria-hidden": !0,
|
|
94
94
|
name: t,
|
|
95
|
-
size: 30,
|
|
95
|
+
size: o.logo_icon_size ?? 30,
|
|
96
96
|
sx: { color: o.logo_color }
|
|
97
97
|
})
|
|
98
98
|
}) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n /** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */\n logo?: LogoRef\n}\n\nexport const IconComponent = ({ slot, variant, logo }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // V2 slot logo: an institution guid only; anything else falls through to the legacy fields.\n if (/^INS-[A-Za-z0-9-]+$/.test(logo?.guid ?? '')) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <LogoFromGuid logo={logo} size={48} />\n {layoutConfig.badge && (\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n aria-hidden={true}\n color=\"error\"\n data-testid=\"account-block-error-badge\"\n fill={true}\n name={layoutConfig.badge}\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n )}\n </Stack>\n )\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAAA,CAAiB,EAAE,MAAA,GAAM,SAAA,GAAS,MAAA,EAAA,MAA+B;AAC5E,QAAM,IAAQ,EAAS,GACjB,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAGA,MAAI,sBAAsB,KAAK,GAAM,QAAQ,EAAE,EAC7C,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,GACpC,EAAa,SACZ,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,OAAM;AAAA,QACN,eAAY;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,EAAa;AAAA,QACnB,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CAEV;AAAA;AAIX,MAAI,EAAK,iBACP,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,GAAG,EAAK,gBAAA;AAAA,MACb,iBAAiB,GAAG,EAAK,gBAAA;AAAA,MACzB,MAAM;AAAA,IACP,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,OAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAK;AAAA,QACL,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CACR;AAAA;AAOX,QAAM,IACJ,EAAe,EAAK,aAAa,OAAO,EAAK,SAAA,EAAW,MACvD,EAAa,eAAe,EAAe,GAAM,IAAI,IAAI;AAC5D,SAAI,IAEA,gBAAA,EAAC,GAAD;AAAA,IACE,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc,EAAa,sBAAsB;AAAA,MACjD,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,GAAI,EAAa,qBAAqB;AAAA,QACpC,aAAa,EAAa;AAAA,QAC1B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,MAAM;AAAA,MACN,
|
|
1
|
+
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n /** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */\n logo?: LogoRef\n}\n\nexport const IconComponent = ({ slot, variant, logo }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // V2 slot logo: an institution guid only; anything else falls through to the legacy fields.\n if (/^INS-[A-Za-z0-9-]+$/.test(logo?.guid ?? '')) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <LogoFromGuid logo={logo} size={48} />\n {layoutConfig.badge && (\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n aria-hidden={true}\n color=\"error\"\n data-testid=\"account-block-error-badge\"\n fill={true}\n name={layoutConfig.badge}\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n )}\n </Stack>\n )\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={layoutConfig.logo_icon_size ?? TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAAA,CAAiB,EAAE,MAAA,GAAM,SAAA,GAAS,MAAA,EAAA,MAA+B;AAC5E,QAAM,IAAQ,EAAS,GACjB,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAGA,MAAI,sBAAsB,KAAK,GAAM,QAAQ,EAAE,EAC7C,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,GACpC,EAAa,SACZ,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,OAAM;AAAA,QACN,eAAY;AAAA,QACZ,M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B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAa,kBAAA;AAAA,MACnB,IAAI,EAAE,OAAO,EAAa,WAAW;AAAA,IACtC,CAAA;AAAA,EACI,CAAA,IAIJ;AACT"}
|
|
@@ -6,8 +6,8 @@ export interface BlockLayoutConfig {
|
|
|
6
6
|
logo_border_color?: string;
|
|
7
7
|
/** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */
|
|
8
8
|
logo_border_radius?: string;
|
|
9
|
-
/** Glyph size in px for an `ICO-` logo on
|
|
10
|
-
*
|
|
9
|
+
/** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard
|
|
10
|
+
* icon tile (default `TILE_ICON_SIZE`). */
|
|
11
11
|
logo_icon_size?: number;
|
|
12
12
|
/** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */
|
|
13
13
|
sub_logo?: string;
|
|
@@ -14,6 +14,7 @@ var e = { background: t }, s = (o) => ({
|
|
|
14
14
|
logo_color: "background.paper",
|
|
15
15
|
logo_bGcolor: "error.main",
|
|
16
16
|
logo_border_radius: "4px",
|
|
17
|
+
logo_icon_size: 24,
|
|
17
18
|
background: t
|
|
18
19
|
},
|
|
19
20
|
interest_charges_summary: {
|
|
@@ -43,7 +44,6 @@ var e = { background: t }, s = (o) => ({
|
|
|
43
44
|
isConfetti: !0,
|
|
44
45
|
gradient: a,
|
|
45
46
|
graphic: "logo",
|
|
46
|
-
logo_icon_size: 30,
|
|
47
47
|
amountVariant: "h2",
|
|
48
48
|
rowSx: {
|
|
49
49
|
gap: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo on
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant — `h2` for milestones, `h3` for deposits. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n interest_charges_summary: {\n logo_color: 'text.primary',\n logo_bGcolor: alpha(theme.palette.categories?.feesCharges || '', 0.25),\n logo_border_color: 'categories.feesCharges',\n background:\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)',\n },\n // Shared deposit-celebration card — used by both the standard deposit and the emergency-fund\n // deposit beats (identical design, different copy), so one design-named variant serves both.\n deposit_received: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h3',\n amountPrefix: '+',\n categoryStrip: true,\n cardShadow: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 24, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'savings',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'above',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n // Neutral fallback for an unknown/unmatched variant: renders the plain standard card (no\n // confetti, no special background). `resolveVariantConfig` warns before falling back here.\n default: {},\n }\n}\n"],"mappings":";;AAqDA,IAAM,IAAsC,EAC1C,YAAY,EACd,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IAEd,oBAAoB;AAAA,IAEpB,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EACA,0BAA0B;AAAA,IACxB,YAAY;AAAA,IACZ,cAAc,EAAM,EAAM,QAAQ,YAAY,eAAe,I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import { useCategoryStore as L, useGlobalCopyStore as k, useGlobalStore as O } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { slot as n } from "../../../../core/types/Insights.es.js";
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { useBeatActions as
|
|
3
|
+
import { formatCurrency as l } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { useBeatActions as B } from "../../../beatActions.es.js";
|
|
5
5
|
import { repeatingTransactionOf as z } from "../../../ctaActions/subscriptionAnswer.es.js";
|
|
6
6
|
import { logoFromRef as A } from "../../../components/shared/EntityLogo.es.js";
|
|
7
7
|
import F from "../../../components/LogoFromGuid.es.js";
|
|
@@ -15,11 +15,11 @@ import { CategoryIcon as j, InstitutionLogo as w, MerchantLogo as H } from "@mxe
|
|
|
15
15
|
import { Icon as W } from "@mxenabled/mx-icons";
|
|
16
16
|
import { jsx as t } from "react/jsx-runtime";
|
|
17
17
|
import { useTheme as $ } from "@mui/material/styles";
|
|
18
|
-
import
|
|
19
|
-
var i = 32, U = Math.round(i * 0.625), D =
|
|
18
|
+
import g from "@mui/material/Box";
|
|
19
|
+
var i = 32, U = Math.round(i * 0.625), D = 24, J = (a, s) => {
|
|
20
20
|
const o = A(a.logo, a.primary_text);
|
|
21
21
|
if (o) {
|
|
22
|
-
if (o.logo_name) return /* @__PURE__ */ t(
|
|
22
|
+
if (o.logo_name) return /* @__PURE__ */ t(g, {
|
|
23
23
|
sx: {
|
|
24
24
|
alignItems: "center",
|
|
25
25
|
display: "flex",
|
|
@@ -45,23 +45,23 @@ var i = 32, U = Math.round(i * 0.625), D = 20, J = (a, s) => {
|
|
|
45
45
|
size: i
|
|
46
46
|
});
|
|
47
47
|
if (o.category_guid) {
|
|
48
|
-
const
|
|
49
|
-
return /* @__PURE__ */ t(
|
|
50
|
-
"data-testid": `category-icon-${
|
|
48
|
+
const c = s(o.category_guid);
|
|
49
|
+
return /* @__PURE__ */ t(g, {
|
|
50
|
+
"data-testid": `category-icon-${c}`,
|
|
51
51
|
sx: { display: "flex" },
|
|
52
52
|
children: /* @__PURE__ */ t(j, {
|
|
53
|
-
categoryGuid:
|
|
53
|
+
categoryGuid: c,
|
|
54
54
|
size: i
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}, lo = Z(({ payload: a }) => {
|
|
60
|
-
const s = $(), { getTopLevelCategoryGuid: o } = L(),
|
|
60
|
+
const s = $(), { getTopLevelCategoryGuid: o } = L(), c = O(), { recurring: p } = k(), { beat: d } = B(), { data: e, variant: y } = a.instance_slot, { background: m, cardVariant: _, showFooter: h, showFrequency: x, showHeader: v, statusMessage: C } = M(N(s), y, V.NoHeader, "TransactionBlock");
|
|
61
61
|
if (C) {
|
|
62
62
|
const r = n(e, "message");
|
|
63
63
|
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(q, {
|
|
64
|
-
icon: /* @__PURE__ */ t(
|
|
64
|
+
icon: /* @__PURE__ */ t(g, {
|
|
65
65
|
"aria-hidden": "true",
|
|
66
66
|
sx: { display: "flex" },
|
|
67
67
|
children: /* @__PURE__ */ t(F, {
|
|
@@ -69,25 +69,29 @@ var i = 32, U = Math.round(i * 0.625), D = 20, J = (a, s) => {
|
|
|
69
69
|
size: D
|
|
70
70
|
})
|
|
71
71
|
}),
|
|
72
|
-
message: r
|
|
72
|
+
message: r,
|
|
73
|
+
sx: m ? {
|
|
74
|
+
backgroundImage: m,
|
|
75
|
+
bgcolor: "background.paper"
|
|
76
|
+
} : void 0
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
|
-
const
|
|
76
|
-
if (!Array.isArray(
|
|
77
|
-
const
|
|
79
|
+
const u = n(e, "series"), f = n(e, "header_text");
|
|
80
|
+
if (!Array.isArray(u) || !u.length) return null;
|
|
81
|
+
const b = v && typeof f == "string" ? f : void 0, I = n(e, "footer_text"), G = n(e, "footer_amount"), T = h ? {
|
|
78
82
|
label: I,
|
|
79
|
-
amount:
|
|
80
|
-
} : void 0, S = x &&
|
|
81
|
-
beat:
|
|
82
|
-
stores:
|
|
83
|
+
amount: l(G, "0,0.00")
|
|
84
|
+
} : void 0, S = x && d ? E(p, z({
|
|
85
|
+
beat: d,
|
|
86
|
+
stores: c
|
|
83
87
|
})) : void 0;
|
|
84
88
|
return /* @__PURE__ */ t(R, {
|
|
85
|
-
background:
|
|
86
|
-
footer:
|
|
87
|
-
header:
|
|
89
|
+
background: m,
|
|
90
|
+
footer: T,
|
|
91
|
+
header: b,
|
|
88
92
|
variant: _,
|
|
89
|
-
rows:
|
|
90
|
-
amount: typeof r.amount == "number" ?
|
|
93
|
+
rows: u.map((r) => ({
|
|
94
|
+
amount: typeof r.amount == "number" ? l(r.amount, "0,0.00") : "",
|
|
91
95
|
amountCaption: S,
|
|
92
96
|
leading: J(r, o),
|
|
93
97
|
subtitle: r.secondary_text ?? "",
|
|
@@ -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 { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\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 = 20\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\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 }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\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\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\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 { background, cardVariant, showFooter, showFrequency, showHeader, statusMessage } =\n resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\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={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\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 = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency =\n showFrequency && beat\n ? subscriptionFrequency(recurringCopy, repeatingTransactionOf({ beat, stores }))\n : undefined\n\n return (\n <TransactionListCard\n background={background}\n footer={footer}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,IAAmB,IAanB,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAA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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 { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\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)\n// Figma's status banner draws a 24px check_circle, so its row is 64px tall.\nconst STATUS_ICON_SIZE = 24\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\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 }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\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\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\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 { background, cardVariant, showFooter, showFrequency, showHeader, statusMessage } =\n resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\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={slot<LogoRef>(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 = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency =\n showFrequency && beat\n ? subscriptionFrequency(recurringCopy, repeatingTransactionOf({ beat, stores }))\n : undefined\n\n return (\n <TransactionListCard\n background={background}\n footer={footer}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAEhD,IAAmB,IAanB,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAK;AAAA,QAAW,MAAM;AAAA,QAAe,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,MAAI,CAAA;AAAA,IAC/E,CAAA;AAIT,QAAI,EAAK,cACP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,EAAK,iBAAiB;AAAA,MAC3B,cAAc,EAAK,gBAAgB,EAAwB,EAAK,aAAa,IAAI;AAAA,MACjF,cAAc,EAAK;AAAA,MACnB,MAAM;AAAA,IACP,CAAA;AAIL,QAAI,EAAK,iBACP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,EAAK,oBAAoB;AAAA,MAC9B,iBAAiB,EAAK;AAAA,MACtB,MAAM;AAAA,IACP,CAAA;AAIL,QAAI,EAAK,eAAe;AACtB,YAAM,IAAe,EAAwB,EAAK,aA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MAAI,CAAC,MAAM,QAAQ,CAAM,KAAK,CAAC,EAAO,OAAQ,QAAO;AAErD,QAAM,IAAS,KAAc,OAAO,KAAe,WAAW,IAAa,QAErE,IAAa,EAAa,GAAM,aAAa,GAC7C,IAAe,EAAa,GAAM,eAAe,GACjD,IAAS,IACX;AAAA,IACE,OAAO;AAAA,IACP,QAAQ,EAAe,GAAc,QAAQ;AAAA,EAC/C,IACA,QAGE,IACJ,KAAiB,IACb,EAAsB,GAAe,EAAuB;AAAA,IAAE,MAAA;AAAA,IAAM,QAAA;AAAA,EAAO,CAAC,CAAC,IAC7E;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IACc,YAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACR,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,EAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WARM_LIME_ACCENT_GRADIENT as r, WARNING_WASH_GRADIENT as t, getPrimaryWashGradient as o } from "../../../components/celebrationGradients.es.js";
|
|
2
2
|
var e = {
|
|
3
3
|
WithHeader: "with_header",
|
|
4
4
|
WithHeaderFooter: "with_header_footer",
|
|
@@ -7,7 +7,7 @@ var e = {
|
|
|
7
7
|
InfoWash: "info_wash",
|
|
8
8
|
WarningWash: "warning_wash",
|
|
9
9
|
StatusMessage: "status_message"
|
|
10
|
-
},
|
|
10
|
+
}, n = (a) => ({
|
|
11
11
|
[e.WithHeader]: { showHeader: !0 },
|
|
12
12
|
[e.WithHeaderFooter]: {
|
|
13
13
|
showHeader: !0,
|
|
@@ -20,20 +20,21 @@ var e = {
|
|
|
20
20
|
},
|
|
21
21
|
[e.InfoWash]: {
|
|
22
22
|
showHeader: !1,
|
|
23
|
-
background:
|
|
23
|
+
background: o(a),
|
|
24
24
|
showFrequency: !0
|
|
25
25
|
},
|
|
26
26
|
[e.WarningWash]: {
|
|
27
27
|
showHeader: !1,
|
|
28
|
-
background:
|
|
28
|
+
background: t
|
|
29
29
|
},
|
|
30
30
|
[e.StatusMessage]: {
|
|
31
31
|
showHeader: !1,
|
|
32
|
-
statusMessage: !0
|
|
32
|
+
statusMessage: !0,
|
|
33
|
+
background: r
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
n as getLayoutConfig,
|
|
37
38
|
e as transactionBlockVariant
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\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` — borderless row on the blue slot wash, with the subscription's live\n * 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 */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\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 /** CSS background for the slot behind the card; the card then renders borderless on paper. */\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}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n [transactionBlockVariant.StatusMessage]: {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { 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` — borderless row on the blue slot wash, with the subscription's live\n * 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 */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\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 /** CSS background for the slot behind the card; the card then renders borderless on paper. */\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}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\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})\n"],"mappings":";AAwBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GAqBa,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EAEC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AACF"}
|
|
@@ -2,8 +2,8 @@ import { formatCurrency as h } from "../../core/utils/NumberFormatting.es.js";
|
|
|
2
2
|
import { P as m, Text as o } from "@mxenabled/mxui";
|
|
3
3
|
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
4
4
|
import t from "@mui/material/Box";
|
|
5
|
-
var g = ({ primaryText:
|
|
6
|
-
const [l,
|
|
5
|
+
var g = ({ primaryText: i = [], secondaryText: n = [], bgcolor: c = "success.main", sx: a }) => {
|
|
6
|
+
const [l, s, d] = i, [p, x] = n;
|
|
7
7
|
return /* @__PURE__ */ e(t, {
|
|
8
8
|
sx: {
|
|
9
9
|
border: "1px solid",
|
|
@@ -30,12 +30,13 @@ var g = ({ primaryText: n = [], secondaryText: i = [], bgcolor: c = "success.mai
|
|
|
30
30
|
bold: !0,
|
|
31
31
|
color: "inherit",
|
|
32
32
|
variant: "h1",
|
|
33
|
-
children: h(Number(
|
|
33
|
+
children: h(Number(s ?? "0"), "0,0.00")
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ r(o, {
|
|
36
36
|
color: "inherit",
|
|
37
|
+
sx: { display: "block" },
|
|
37
38
|
variant: "caption",
|
|
38
|
-
children:
|
|
39
|
+
children: d
|
|
39
40
|
})
|
|
40
41
|
]
|
|
41
42
|
}), /* @__PURE__ */ e(t, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveAnExtraCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SaveAnExtraCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\ninterface SaveAnExtraCardProps {\n primaryText?: string[]\n secondaryText?: string[]\n bgcolor?: string\n sx?: SxProps<Theme>\n}\n\nconst SaveAnExtraCard = ({\n primaryText = [],\n secondaryText = [],\n bgcolor = 'success.main',\n sx,\n}: SaveAnExtraCardProps) => {\n const [leadIn, amount, trailingCopy] = primaryText\n const [projected, projectedCaption] = secondaryText\n\n return (\n <Box\n sx={{\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: 2,\n\n overflow: 'hidden',\n ...sx,\n }}\n >\n {/* Green header */}\n <Box\n sx={{\n bgcolor,\n color: 'success.contrastText',\n p: 16,\n pt: 12,\n textAlign: 'center',\n }}\n >\n <P color=\"inherit\" variant=\"subtitle1\">\n {leadIn}\n </P>\n <Text bold={true} color=\"inherit\" variant=\"h1\">\n {formatCurrency(Number(amount ?? '0'), '0,0.00')}\n </Text>\n <Text color=\"inherit\" variant=\"caption\">\n {trailingCopy}\n </Text>\n </Box>\n\n {/* White footer with projected amount. The projected balance arrives\n pre-formatted from the backend (e.g. \"$3,320\"), so render it as-is. */}\n <Box\n sx={{\n bgcolor: 'background.paper',\n px: 16,\n py: 12,\n textAlign: 'center',\n }}\n >\n <Text variant=\"h3\">{projected}</Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {projectedCaption}\n </Text>\n </Box>\n </Box>\n )\n}\n\nexport default SaveAnExtraCard\n"],"mappings":";;;;AAcA,IAAM,IAAA,CAAmB,EACvB,aAAA,IAAc,CAAC,GACf,eAAA,IAAgB,CAAC,GACjB,SAAA,IAAU,gBACV,IAAA,EAAA,MAC0B;AAC1B,QAAM,CAAC,GAAQ,GAAQ,CAAA,IAAgB,GACjC,CAAC,GAAW,CAAA,IAAoB;AAEtC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MAEd,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IARF,UAAA,CAWE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAA;AAAA,QACA,OAAO;AAAA,QACP,GAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MAPF,UAAA;AAAA,QASE,gBAAA,EAAC,GAAD;AAAA,UAAG,OAAM;AAAA,UAAU,SAAQ;AAAA,UACxB,UAAA;AAAA,QACA,CAAA;AAAA,QACH,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,OAAM;AAAA,UAAU,SAAQ;AAAA,UACvC,UAAA,EAAe,OAAO,KAAU,GAAG,GAAG,QAAQ;AAAA,QAC3C,CAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"SaveAnExtraCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SaveAnExtraCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\ninterface SaveAnExtraCardProps {\n primaryText?: string[]\n secondaryText?: string[]\n bgcolor?: string\n sx?: SxProps<Theme>\n}\n\nconst SaveAnExtraCard = ({\n primaryText = [],\n secondaryText = [],\n bgcolor = 'success.main',\n sx,\n}: SaveAnExtraCardProps) => {\n const [leadIn, amount, trailingCopy] = primaryText\n const [projected, projectedCaption] = secondaryText\n\n return (\n <Box\n sx={{\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: 2,\n\n overflow: 'hidden',\n ...sx,\n }}\n >\n {/* Green header */}\n <Box\n sx={{\n bgcolor,\n color: 'success.contrastText',\n p: 16,\n pt: 12,\n textAlign: 'center',\n }}\n >\n <P color=\"inherit\" variant=\"subtitle1\">\n {leadIn}\n </P>\n <Text bold={true} color=\"inherit\" variant=\"h1\">\n {formatCurrency(Number(amount ?? '0'), '0,0.00')}\n </Text>\n {/* A block, as in Figma: inline, the caption sat on a text line 5px below the amount. */}\n <Text color=\"inherit\" sx={{ display: 'block' }} variant=\"caption\">\n {trailingCopy}\n </Text>\n </Box>\n\n {/* White footer with projected amount. The projected balance arrives\n pre-formatted from the backend (e.g. \"$3,320\"), so render it as-is. */}\n <Box\n sx={{\n bgcolor: 'background.paper',\n px: 16,\n py: 12,\n textAlign: 'center',\n }}\n >\n <Text variant=\"h3\">{projected}</Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {projectedCaption}\n </Text>\n </Box>\n </Box>\n )\n}\n\nexport default SaveAnExtraCard\n"],"mappings":";;;;AAcA,IAAM,IAAA,CAAmB,EACvB,aAAA,IAAc,CAAC,GACf,eAAA,IAAgB,CAAC,GACjB,SAAA,IAAU,gBACV,IAAA,EAAA,MAC0B;AAC1B,QAAM,CAAC,GAAQ,GAAQ,CAAA,IAAgB,GACjC,CAAC,GAAW,CAAA,IAAoB;AAEtC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MAEd,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IARF,UAAA,CAWE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAA;AAAA,QACA,OAAO;AAAA,QACP,GAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MAPF,UAAA;AAAA,QASE,gBAAA,EAAC,GAAD;AAAA,UAAG,OAAM;AAAA,UAAU,SAAQ;AAAA,UACxB,UAAA;AAAA,QACA,CAAA;AAAA,QACH,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,OAAM;AAAA,UAAU,SAAQ;AAAA,UACvC,UAAA,EAAe,OAAO,KAAU,GAAG,GAAG,QAAQ;AAAA,QAC3C,CAAA;AAAA,QAEN,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,IAAI,EAAE,SAAS,QAAQ;AAAA,UAAG,SAAQ;AAAA,UACrD,UAAA;AAAA,QACG,CAAA;AAAA,MACH;AAAA,IAIL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MANF,UAAA,CAQE,gBAAA,EAAC,GAAD;AAAA,QAAM,SAAQ;AAAA,QAAM,UAAA;AAAA,MAAgB,CAAA,GACpC,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,SAAQ;AAAA,QAClC,UAAA;AAAA,MACG,CAAA,CACH;AAAA,IACF,CAAA,CAAA;AAAA;AAET"}
|
|
@@ -11,6 +11,7 @@ interface StatusMessageCardProps {
|
|
|
11
11
|
borderColor?: string;
|
|
12
12
|
/** Message text color token. */
|
|
13
13
|
messageColor?: string;
|
|
14
|
+
/** Styles for the slot around the banner (e.g. a gradient wash). */
|
|
14
15
|
sx?: SxProps;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -18,9 +19,13 @@ interface StatusMessageCardProps {
|
|
|
18
19
|
* a colored, bordered surface.
|
|
19
20
|
*
|
|
20
21
|
* Figma: the `All Categorized!` success state of Uncategorized Transactions V2
|
|
21
|
-
* (`Card / Content / Slot`) — green card (`success.
|
|
22
|
-
* border, radius 8), check-circle icon + bold message. Reusable
|
|
23
|
-
* icon + message status/empty state.
|
|
22
|
+
* (`Card / Content / Slot`) — green card (`success.lighter` bg, `success.main`
|
|
23
|
+
* border, radius 8), check-circle icon + bold `text.primary` message. Reusable
|
|
24
|
+
* for any icon + message status/empty state.
|
|
25
|
+
*
|
|
26
|
+
* Its own fill and message colours, not `STATUS_SUCCESS_TOKENS`: Figma's banner
|
|
27
|
+
* uses Success Lighter and text/primary, which flip to dark green and white in
|
|
28
|
+
* dark mode, where `success.100` stays mint and `success.darker` turns mint.
|
|
24
29
|
*
|
|
25
30
|
* Scope is the Content section only; Header/Description are out of scope.
|
|
26
31
|
*/
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { STATUS_SUCCESS_TOKENS as
|
|
2
|
-
import
|
|
3
|
-
import { Text as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var f = ({ bgcolor:
|
|
1
|
+
import { STATUS_SUCCESS_TOKENS as p } from "./statusTokens.es.js";
|
|
2
|
+
import r from "@mui/material/Stack";
|
|
3
|
+
import { Text as l } from "@mxenabled/mxui";
|
|
4
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
var f = ({ bgcolor: e = "success.lighter", borderColor: t = p.borderColor, icon: s, message: i, messageColor: d = "text.primary", sx: a }) => /* @__PURE__ */ o(r, {
|
|
6
6
|
sx: {
|
|
7
7
|
px: 16,
|
|
8
8
|
py: 16,
|
|
9
9
|
width: "100%",
|
|
10
|
-
...
|
|
10
|
+
...a
|
|
11
11
|
},
|
|
12
|
-
children: /* @__PURE__ */
|
|
12
|
+
children: /* @__PURE__ */ c(r, {
|
|
13
13
|
role: "status",
|
|
14
14
|
sx: {
|
|
15
15
|
alignItems: "center",
|
|
16
|
-
bgcolor:
|
|
16
|
+
bgcolor: e,
|
|
17
17
|
border: "1px solid",
|
|
18
|
-
borderColor:
|
|
18
|
+
borderColor: t,
|
|
19
19
|
borderRadius: "8px",
|
|
20
|
+
boxShadow: (x) => x.shadows[1],
|
|
20
21
|
flexDirection: "row",
|
|
21
22
|
gap: 4,
|
|
22
23
|
px: 16,
|
|
23
|
-
py:
|
|
24
|
+
py: 13,
|
|
24
25
|
width: "100%"
|
|
25
26
|
},
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ o(r, {
|
|
27
28
|
sx: {
|
|
28
29
|
flexShrink: 0,
|
|
29
30
|
px: 4,
|
|
30
31
|
py: 6
|
|
31
32
|
},
|
|
32
|
-
children:
|
|
33
|
-
}), /* @__PURE__ */
|
|
33
|
+
children: s
|
|
34
|
+
}), /* @__PURE__ */ o(l, {
|
|
34
35
|
bold: !0,
|
|
35
|
-
color:
|
|
36
|
+
color: d,
|
|
36
37
|
variant: "body1",
|
|
37
|
-
children:
|
|
38
|
+
children: i
|
|
38
39
|
})]
|
|
39
40
|
})
|
|
40
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusMessageCard.es.js","names":[],"sources":["../../../src/insights-v2/components/StatusMessageCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { STATUS_SUCCESS_TOKENS } from './statusTokens'\n\ninterface StatusMessageCardProps {\n /** Leading status icon (e.g. a check-circle). */\n icon: ReactNode\n /** Status message. */\n message: ReactNode\n /** Card surface color token. */\n bgcolor?: string\n /** Card border color token. */\n borderColor?: string\n /** Message text color token. */\n messageColor?: string\n sx?: SxProps\n}\n\n/**\n * Single-line status/success message card: a leading icon and a bold message on\n * a colored, bordered surface.\n *\n * Figma: the `All Categorized!` success state of Uncategorized Transactions V2\n * (`Card / Content / Slot`) — green card (`success.
|
|
1
|
+
{"version":3,"file":"StatusMessageCard.es.js","names":[],"sources":["../../../src/insights-v2/components/StatusMessageCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { STATUS_SUCCESS_TOKENS } from './statusTokens'\n\ninterface StatusMessageCardProps {\n /** Leading status icon (e.g. a check-circle). */\n icon: ReactNode\n /** Status message. */\n message: ReactNode\n /** Card surface color token. */\n bgcolor?: string\n /** Card border color token. */\n borderColor?: string\n /** Message text color token. */\n messageColor?: string\n /** Styles for the slot around the banner (e.g. a gradient wash). */\n sx?: SxProps\n}\n\n/**\n * Single-line status/success message card: a leading icon and a bold message on\n * a colored, bordered surface.\n *\n * Figma: the `All Categorized!` success state of Uncategorized Transactions V2\n * (`Card / Content / Slot`) — green card (`success.lighter` bg, `success.main`\n * border, radius 8), check-circle icon + bold `text.primary` message. Reusable\n * for any icon + message status/empty state.\n *\n * Its own fill and message colours, not `STATUS_SUCCESS_TOKENS`: Figma's banner\n * uses Success Lighter and text/primary, which flip to dark green and white in\n * dark mode, where `success.100` stays mint and `success.darker` turns mint.\n *\n * Scope is the Content section only; Header/Description are out of scope.\n */\nconst StatusMessageCard = ({\n bgcolor = 'success.lighter',\n borderColor = STATUS_SUCCESS_TOKENS.borderColor,\n icon,\n message,\n messageColor = 'text.primary',\n sx,\n}: StatusMessageCardProps) => (\n <Stack sx={{ px: 16, py: 16, width: '100%', ...sx }}>\n <Stack\n role=\"status\"\n sx={{\n alignItems: 'center',\n bgcolor,\n border: '1px solid',\n borderColor,\n borderRadius: '8px',\n // Raised with elevation/1, as in Figma's only status banner (Uncategorized Transactions V2).\n boxShadow: (theme: Theme) => theme.shadows[1],\n flexDirection: 'row',\n gap: 4,\n px: 16,\n // Figma draws the 1px border inside its 14px padding; here it adds to the box, so 13px keeps\n // the banner 64px tall.\n py: 13,\n width: '100%',\n }}\n >\n <Stack sx={{ flexShrink: 0, px: 4, py: 6 }}>{icon}</Stack>\n <Text bold={true} color={messageColor} variant=\"body1\">\n {message}\n </Text>\n </Stack>\n </Stack>\n)\n\nexport default StatusMessageCard\n"],"mappings":";;;;AAuCA,IAAM,IAAA,CAAqB,EACzB,SAAA,IAAU,mBACV,aAAA,IAAc,EAAsB,aACpC,MAAA,GACA,SAAA,GACA,cAAA,IAAe,gBACf,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,IAAI,OAAO;AAAA,IAAQ,GAAG;AAAA,EAAG;AAAA,EAChD,UAAA,gBAAA,EAAC,GAAD;AAAA,IACE,MAAK;AAAA,IACL,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAA;AAAA,MACA,QAAQ;AAAA,MACR,aAAA;AAAA,MACA,cAAc;AAAA,MAEd,WAAA,CAAY,MAAiB,EAAM,QAAQ,CAAA;AAAA,MAC3C,eAAe;AAAA,MACf,KAAK;AAAA,MACL,IAAI;AAAA,MAGJ,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,IAjBF,UAAA,CAmBE,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,YAAY;AAAA,QAAG,IAAI;AAAA,QAAG,IAAI;AAAA,MAAE;AAAA,MAAI,UAAA;AAAA,IAAY,CAAA,GACzD,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM;AAAA,MAAM,OAAO;AAAA,MAAc,SAAQ;AAAA,MAC5C,UAAA;AAAA,IACG,CAAA,CACD;AAAA;AACF,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { DateRange } from '@mui/x-date-pickers-pro';
|
|
2
3
|
import { WidgetProps } from '../core';
|
|
4
|
+
export declare const monthsInRange: (range: DateRange<Date>) => number | null;
|
|
3
5
|
export declare const NetWorthWidget: React.FC<WidgetProps>;
|
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
import { useEvent as
|
|
1
|
+
import { useEvent as w, useGlobalCopyStore as y, useGlobalUiStore as D, useNetWorthStore as L } from "../common/context/hooks.es.js";
|
|
2
2
|
import { useScreenSize as R } from "../common/hooks/useScreenSize.es.js";
|
|
3
|
-
import { useWidgetLoadTimer as
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import
|
|
6
|
-
import { WidgetContainer as
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { observer as
|
|
14
|
-
import
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
|
|
3
|
+
import { useWidgetLoadTimer as b } from "../common/hooks/useWidgetLoadTimer.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as a } from "../common/constants/Analytics.es.js";
|
|
5
|
+
import x from "../common/components/Loader.es.js";
|
|
6
|
+
import { WidgetContainer as v } from "../common/components/WidgetContainer.es.js";
|
|
7
|
+
import { EmptyState as A } from "../common/components/EmptyState.es.js";
|
|
8
|
+
import M from "../accounts/components/ConnectionsDrawer.es.js";
|
|
9
|
+
import k from "./components/NetWorthChart.es.js";
|
|
10
|
+
import F from "./components/NetWorthList.es.js";
|
|
11
|
+
import O from "./components/NetWorthSummary.es.js";
|
|
12
|
+
import p from "react";
|
|
13
|
+
import { observer as G } from "mobx-react-lite";
|
|
14
|
+
import j from "@mui/material/Stack";
|
|
15
|
+
import { Fragment as H, jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
16
|
+
import K from "@mui/material/Box";
|
|
17
|
+
import { differenceInCalendarMonths as V } from "date-fns";
|
|
18
|
+
var z = (s) => {
|
|
19
|
+
const [e, o] = s;
|
|
20
|
+
return !e || !o ? null : V(o, e);
|
|
21
|
+
}, st = G(({ onBackClick: s, onMenuClick: e }) => {
|
|
22
|
+
const { isInitialized: o } = D(), { accounts: u, net_worth: r } = y(), { hoveredData: C, isNetWorthDataLoaded: m, loadNetWorthData: _, netWorthChartData: g, selectedData: l, setTimeframe: W } = L(), { isMobile: n } = R(), { onEvent: i } = w(), [T, f] = p.useState(!1);
|
|
23
|
+
b({
|
|
21
24
|
widgetName: "NetWorthWidget",
|
|
22
|
-
isLoaded:
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
+
isLoaded: m
|
|
26
|
+
}), p.useEffect(() => {
|
|
27
|
+
m || _().finally(), i(a.NET_WORTH_VIEW);
|
|
25
28
|
}, []);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
29
|
+
const E = async (c) => {
|
|
30
|
+
const h = z(c);
|
|
31
|
+
h !== null && W(h);
|
|
32
|
+
}, N = (c) => {
|
|
33
|
+
i(a.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: c + "M" });
|
|
34
|
+
}, I = () => {
|
|
35
|
+
f(!0), i(a.ACCOUNTS_CLICK_CONNECT);
|
|
33
36
|
};
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
if (!o || !m) return /* @__PURE__ */ t(x, {});
|
|
38
|
+
const S = g.length === 0;
|
|
39
|
+
return /* @__PURE__ */ d(v, {
|
|
37
40
|
calendarActions: {
|
|
38
|
-
onRangeChanged:
|
|
39
|
-
onTimeframeClick:
|
|
41
|
+
onRangeChanged: E,
|
|
42
|
+
onTimeframeClick: N
|
|
40
43
|
},
|
|
41
|
-
dateRangeVariant:
|
|
42
|
-
onAccountsFilterClick: () =>
|
|
43
|
-
onBackClick:
|
|
44
|
-
onMenuClick:
|
|
45
|
-
title:
|
|
46
|
-
children: [
|
|
44
|
+
dateRangeVariant: n ? "timeframetabs" : "timeframebuttons",
|
|
45
|
+
onAccountsFilterClick: () => i(a.NET_WORTH_WIDGET_CLICK_FILTER),
|
|
46
|
+
onBackClick: s,
|
|
47
|
+
onMenuClick: e,
|
|
48
|
+
title: r.net_worth,
|
|
49
|
+
children: [S ? /* @__PURE__ */ t(K, {
|
|
47
50
|
sx: { justifyItems: "center" },
|
|
48
|
-
children: /* @__PURE__ */ t(
|
|
49
|
-
header:
|
|
51
|
+
children: /* @__PURE__ */ t(A, {
|
|
52
|
+
header: r.empty_widget_header,
|
|
50
53
|
icon: "elevation",
|
|
51
|
-
onClick:
|
|
52
|
-
primaryButton:
|
|
53
|
-
subText:
|
|
54
|
+
onClick: I,
|
|
55
|
+
primaryButton: r.empty_widget_button,
|
|
56
|
+
subText: r.empty_widget_description,
|
|
54
57
|
sx: {
|
|
55
58
|
width: { sm: 432 },
|
|
56
59
|
".buttons-footer": { width: 167 }
|
|
57
60
|
}
|
|
58
61
|
})
|
|
59
|
-
}) : /* @__PURE__ */
|
|
60
|
-
hoveredData:
|
|
61
|
-
selectedData:
|
|
62
|
-
}), /* @__PURE__ */
|
|
63
|
-
alignItems:
|
|
64
|
-
direction:
|
|
65
|
-
spacing:
|
|
66
|
-
children: [/* @__PURE__ */ t(
|
|
67
|
-
})] }), /* @__PURE__ */ t(
|
|
68
|
-
onClose: () =>
|
|
69
|
-
showConnectionsWidget:
|
|
70
|
-
title:
|
|
62
|
+
}) : /* @__PURE__ */ d(H, { children: [l && /* @__PURE__ */ t(O, {
|
|
63
|
+
hoveredData: C,
|
|
64
|
+
selectedData: l
|
|
65
|
+
}), /* @__PURE__ */ d(j, {
|
|
66
|
+
alignItems: n ? "center" : "flex-start",
|
|
67
|
+
direction: n ? "column" : "row",
|
|
68
|
+
spacing: n ? 0 : 48,
|
|
69
|
+
children: [/* @__PURE__ */ t(k, {}), /* @__PURE__ */ t(F, {})]
|
|
70
|
+
})] }), /* @__PURE__ */ t(M, {
|
|
71
|
+
onClose: () => f(!1),
|
|
72
|
+
showConnectionsWidget: T,
|
|
73
|
+
title: u.manage_connections
|
|
71
74
|
})]
|
|
72
75
|
});
|
|
73
76
|
});
|
|
74
77
|
export {
|
|
75
|
-
st as NetWorthWidget
|
|
78
|
+
st as NetWorthWidget,
|
|
79
|
+
z as monthsInRange
|
|
76
80
|
};
|
|
77
81
|
|
|
78
82
|
//# sourceMappingURL=NetWorthWidget.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetWorthWidget.es.js","names":[],"sources":["../../src/networth/NetWorthWidget.tsx"],"sourcesContent":["import React from 'react'\nimport {
|
|
1
|
+
{"version":3,"file":"NetWorthWidget.es.js","names":[],"sources":["../../src/networth/NetWorthWidget.tsx"],"sourcesContent":["import React from 'react'\nimport { differenceInCalendarMonths } from 'date-fns'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport type { DateRange } from '@mui/x-date-pickers-pro'\n\nimport ConnectionsDrawer from '../accounts/components/ConnectionsDrawer'\nimport {\n ANALYTICS_EVENTS,\n EmptyState,\n Loader,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useNetWorthStore,\n useScreenSize,\n useWidgetLoadTimer,\n WidgetContainer,\n} from '../common'\nimport { WidgetProps } from '../core'\n\nimport NetWorthChart from './components/NetWorthChart'\nimport NetWorthList from './components/NetWorthList'\nimport NetWorthSummary from './components/NetWorthSummary'\n\n// The timeframe selector bounds ranges with end-of-month dates, so differenceInMonths\n// would undercount by one when the start month is longer than the end month (e.g.\n// Mar 31 -> Sep 30 = 5). differenceInCalendarMonths compares only year+month and\n// returns the true month count.\nexport const monthsInRange = (range: DateRange<Date>): number | null => {\n const [startDate, endDate] = range\n if (!startDate || !endDate) return null\n return differenceInCalendarMonths(endDate, startDate)\n}\n\nexport const NetWorthWidget: React.FC<WidgetProps> = observer(({ onBackClick, onMenuClick }) => {\n const { isInitialized } = useGlobalUiStore()\n const { accounts: accountsCopy, net_worth: copy } = useGlobalCopyStore()\n const {\n hoveredData,\n isNetWorthDataLoaded,\n loadNetWorthData,\n netWorthChartData,\n selectedData,\n setTimeframe,\n } = useNetWorthStore()\n const { isMobile } = useScreenSize()\n const { onEvent } = useEvent()\n\n const [showConnectionsWidget, setShowConnectionsWidget] = React.useState(false)\n\n useWidgetLoadTimer({\n widgetName: 'NetWorthWidget',\n isLoaded: isNetWorthDataLoaded,\n })\n\n React.useEffect(() => {\n if (!isNetWorthDataLoaded) {\n loadNetWorthData().finally()\n }\n onEvent(ANALYTICS_EVENTS.NET_WORTH_VIEW)\n }, [])\n\n const handleRangeChanged = async (range: DateRange<Date>) => {\n const months = monthsInRange(range)\n if (months !== null) {\n setTimeframe(months)\n }\n }\n\n const handleTimeframeClick = (months: number) => {\n onEvent(ANALYTICS_EVENTS.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: months + 'M' })\n }\n\n const handleManageConnections = () => {\n setShowConnectionsWidget(true)\n onEvent(ANALYTICS_EVENTS.ACCOUNTS_CLICK_CONNECT)\n }\n\n if (!isInitialized || !isNetWorthDataLoaded) return <Loader />\n\n const showEmptyState = netWorthChartData.length === 0\n\n return (\n <WidgetContainer\n calendarActions={{\n onRangeChanged: handleRangeChanged,\n onTimeframeClick: handleTimeframeClick,\n }}\n dateRangeVariant={isMobile ? 'timeframetabs' : 'timeframebuttons'}\n onAccountsFilterClick={() => onEvent(ANALYTICS_EVENTS.NET_WORTH_WIDGET_CLICK_FILTER)}\n onBackClick={onBackClick}\n onMenuClick={onMenuClick}\n title={copy.net_worth}\n >\n {!showEmptyState ? (\n <>\n {selectedData && (\n <NetWorthSummary hoveredData={hoveredData} selectedData={selectedData} />\n )}\n <Stack\n alignItems={isMobile ? 'center' : 'flex-start'}\n direction={isMobile ? 'column' : 'row'}\n spacing={isMobile ? 0 : 48}\n >\n <NetWorthChart />\n <NetWorthList />\n </Stack>\n </>\n ) : (\n <Box sx={{ justifyItems: 'center' }}>\n <EmptyState\n header={copy.empty_widget_header}\n icon={'elevation'}\n onClick={handleManageConnections}\n primaryButton={copy.empty_widget_button}\n subText={copy.empty_widget_description}\n sx={{\n width: { sm: 432 },\n '.buttons-footer': {\n width: 167,\n },\n }}\n />\n </Box>\n )}\n\n <ConnectionsDrawer\n onClose={() => setShowConnectionsWidget(false)}\n showConnectionsWidget={showConnectionsWidget}\n title={accountsCopy.manage_connections}\n />\n </WidgetContainer>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,IAAa,IAAA,CAAiB,MAA0C;AACtE,QAAM,CAAC,GAAW,CAAA,IAAW;AAC7B,SAAI,CAAC,KAAa,CAAC,IAAgB,OAC5B,EAA2B,GAAS,CAAS;AACtD,GAEa,KAAwC,EAAA,CAAU,EAAE,aAAA,GAAa,aAAA,EAAA,MAAkB;AAC9F,QAAM,EAAE,eAAA,EAAA,IAAkB,EAAiB,GACrC,EAAE,UAAU,GAAc,WAAW,EAAA,IAAS,EAAmB,GACjE,EACJ,aAAA,GACA,sBAAA,GACA,kBAAA,GACA,mBAAA,GACA,cAAA,GACA,cAAA,EAAA,IACE,EAAiB,GACf,EAAE,UAAA,EAAA,IAAa,EAAc,GAC7B,EAAE,SAAA,EAAA,IAAY,EAAS,GAEvB,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