@mx-cartographer/experiences 9.7.111 → 9.7.112
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 +5 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +3 -3
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +1 -6
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +25 -24
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.d.ts +2 -2
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js +49 -69
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.d.ts +23 -15
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js +33 -18
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js.map +1 -1
- 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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [9.7.112] - 11-05-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - The Monthly Obligations Status drawer shows Available Funds, Planned Expenses and Total Remaining from the button that opened it, matching Figma. Ships after the ditto drilldown recipe and the new account list copy are live (WEC-2115)
|
|
4
|
+
- **FIXED** - The AccountBlock confetti status/celebration tile amount uses typography `h2` (23px) to match Figma, per design sign-off (WEC-2115)
|
|
5
|
+
|
|
1
6
|
## [9.7.111] - 11-05-2026
|
|
2
7
|
|
|
3
8
|
- **ADDED** - Insights 2.0 analytics events are flagged `is_insights_v2: true` in their Firefly `metadata` and PostHog properties (MEW2-3444)
|
|
@@ -431,9 +431,9 @@ export interface AccountListCopy {
|
|
|
431
431
|
/** Drawer title. */
|
|
432
432
|
title: string;
|
|
433
433
|
how_is_this_calculated: string;
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
available_funds: string;
|
|
435
|
+
planned_expenses: string;
|
|
436
|
+
/** The emphasised "Total Remaining" row. */
|
|
437
437
|
remaining: string;
|
|
438
438
|
accounts_header: string;
|
|
439
439
|
total_balance: string;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { ActionBlockProps } from '../../mappings/blocks';
|
|
2
|
-
/**
|
|
3
|
-
* Account List drawer (MEW2-3363): the beat's calculation from `drilldown_data`, then the accounts
|
|
4
|
-
* behind it from the account store, largest balance first, with their total. Opened by Monthly
|
|
5
|
-
* Obligations Status's "View accounts" (on track) and "View details" (off track). `observer`: reads
|
|
6
|
-
* copy and accounts from MobX stores.
|
|
7
|
-
*/
|
|
2
|
+
/** Account List drawer: the opening CTA's calculation, then the beat's cash accounts largest first with their total. */
|
|
8
3
|
export declare const AccountListBlock: (({ beat }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
9
4
|
displayName: string;
|
|
10
5
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccountStore as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import _ from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
|
+
import { useAccountStore as h, useGlobalCopyStore as A, useGlobalStore as S, useInsightsV2Store as b } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import s from "../../../common/components/Loader.es.js";
|
|
4
|
+
import { getDynamicCtaBasedOnTriggers as B } from "../util.es.js";
|
|
5
|
+
import v from "./AccountListContent.es.js";
|
|
6
|
+
import { buildSummary as C, lastFour as L, resolveBeatAccounts as w, sumBalances as x } from "./layout.es.js";
|
|
7
|
+
import { observer as k } from "mobx-react-lite";
|
|
8
|
+
import D from "@mui/material/Stack";
|
|
9
|
+
import { Text as F } from "@mxenabled/mxui";
|
|
9
10
|
import { jsx as t } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
11
|
+
var G = (o) => ({
|
|
11
12
|
balance: o.balance ?? 0,
|
|
12
13
|
guid: o.guid,
|
|
13
14
|
institutionGuid: o.institution_guid ?? "",
|
|
14
|
-
lastFour:
|
|
15
|
-
name:
|
|
16
|
-
}),
|
|
17
|
-
const { copyStore:
|
|
18
|
-
if (!
|
|
19
|
-
if (!
|
|
15
|
+
lastFour: L(o.account_number),
|
|
16
|
+
name: _(o)
|
|
17
|
+
}), H = k(function({ beat: i }) {
|
|
18
|
+
const { copyStore: e } = S(), { common: c, insights_feed: a } = A(), { accountsLoaded: m, cashAccounts: u, visibleAccounts: l } = h(), { actionDrawer: p } = b(), r = a?.account_list;
|
|
19
|
+
if (!e.isInitialized) return /* @__PURE__ */ t(s, {});
|
|
20
|
+
if (!r) return /* @__PURE__ */ t(D, {
|
|
20
21
|
sx: { p: 24 },
|
|
21
|
-
children: /* @__PURE__ */ t(
|
|
22
|
+
children: /* @__PURE__ */ t(F, { children: c?.error_message ?? "Something went wrong." })
|
|
22
23
|
});
|
|
23
|
-
if (!
|
|
24
|
-
const i =
|
|
25
|
-
return /* @__PURE__ */ t(
|
|
26
|
-
accounts:
|
|
27
|
-
copy:
|
|
28
|
-
summary:
|
|
29
|
-
totalBalance:
|
|
24
|
+
if (!m) return /* @__PURE__ */ t(s, {});
|
|
25
|
+
const { primary_cta: d, secondary_cta: f, in_description_cta: g } = i.insights_payload ?? {}, y = B(p, d, f, g), n = w(i, l, u);
|
|
26
|
+
return /* @__PURE__ */ t(v, {
|
|
27
|
+
accounts: n.map(G),
|
|
28
|
+
copy: r,
|
|
29
|
+
summary: C(y, r),
|
|
30
|
+
totalBalance: x(n)
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
H as AccountListBlock
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
//# sourceMappingURL=AccountListBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {
|
|
1
|
+
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useAccountStore,\n useGlobalCopyStore,\n useGlobalStore,\n useInsightsV2Store,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account } from '../../../core'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\nimport AccountListContent, { type AccountListRow } from './AccountListContent'\nimport { buildSummary, lastFour, resolveBeatAccounts, sumBalances } from './layout'\n\nconst toRow = (account: Account): AccountListRow => ({\n balance: account.balance ?? 0,\n guid: account.guid,\n institutionGuid: account.institution_guid ?? '',\n lastFour: lastFour(account.account_number),\n name: getAccountDisplayName(account),\n})\n\n/** Account List drawer: the opening CTA's calculation, then the beat's cash accounts largest first with their total. */\nexport const AccountListBlock = observer(function AccountListBlock({ beat }: ActionBlockProps) {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const { actionDrawer } = useInsightsV2Store()\n const copy = insightsFeedCopy?.account_list\n\n if (!copyStore.isInitialized) return <Loader />\n\n // Copy loads once at app start, so a retry cannot clear a missing namespace: a plain message.\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message ?? 'Something went wrong.'}</Text>\n </Stack>\n )\n }\n\n if (!accountsLoaded) return <Loader />\n\n const { primary_cta, secondary_cta, in_description_cta } = beat.insights_payload ?? {}\n const cta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\n const listed = resolveBeatAccounts(beat, visibleAccounts, cashAccounts)\n\n return (\n <AccountListContent\n accounts={listed.map(toRow)}\n copy={copy}\n summary={buildSummary(cta, copy)}\n totalBalance={sumBalances(listed)}\n />\n )\n})\n"],"mappings":";;;;;;;;;;AAoBA,IAAM,IAAA,CAAS,OAAsC;AAAA,EACnD,SAAS,EAAQ,WAAW;AAAA,EAC5B,MAAM,EAAQ;AAAA,EACd,iBAAiB,EAAQ,oBAAoB;AAAA,EAC7C,UAAU,EAAS,EAAQ,cAAc;AAAA,EACzC,MAAM,EAAsB,CAAO;AACrC,IAGa,IAAmB,EAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAqB,EAAmB,GAC7E,EAAE,gBAAA,GAAgB,cAAA,GAAc,iBAAA,EAAA,IAAoB,EAAgB,GACpE,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,IAAO,GAAkB;AAE/B,MAAI,CAAC,EAAU,cAAe,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAG9C,MAAI,CAAC,EACH,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,GAAY,iBAAiB,wBAA8B,CAAA;AAAA,EAC7D,CAAA;AAIX,MAAI,CAAC,EAAgB,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAErC,QAAM,EAAE,aAAA,GAAa,eAAA,GAAe,oBAAA,EAAA,IAAuB,EAAK,oBAAoB,CAAC,GAC/E,IAAM,EACV,GACA,GACA,GACA,CACF,GACM,IAAS,EAAoB,GAAM,GAAiB,CAAY;AAEtE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU,EAAO,IAAI,CAAK;AAAA,IACpB,MAAA;AAAA,IACN,SAAS,EAAa,GAAK,CAAI;AAAA,IAC/B,cAAc,EAAY,CAAM;AAAA,EACjC,CAAA;AAEL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy';
|
|
2
|
-
import {
|
|
2
|
+
import { AccountListSummary } from './layout';
|
|
3
3
|
export interface AccountListRow {
|
|
4
4
|
guid: string;
|
|
5
5
|
name: string;
|
|
@@ -12,7 +12,7 @@ export interface AccountListRow {
|
|
|
12
12
|
export interface AccountListContentProps {
|
|
13
13
|
copy: AccountListCopy;
|
|
14
14
|
/** Omitted when the beat carries no calculation: the drawer is just the list. */
|
|
15
|
-
summary?:
|
|
15
|
+
summary?: AccountListSummary;
|
|
16
16
|
/** Already ordered. */
|
|
17
17
|
accounts: AccountListRow[];
|
|
18
18
|
totalBalance: number;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { DEFAULT_INSTITUTION_LOGO_URL as
|
|
2
|
-
import { formatSignedCurrency as
|
|
3
|
-
import { createElement as
|
|
1
|
+
import { DEFAULT_INSTITUTION_LOGO_URL as b } from "../../../core/constants/InstitutionLogo.es.js";
|
|
2
|
+
import { formatSignedCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import { createElement as g } from "react";
|
|
4
4
|
import n from "@mui/material/Stack";
|
|
5
|
-
import { InstitutionLogo as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
var
|
|
5
|
+
import { InstitutionLogo as f, Text as l } from "@mxenabled/mxui";
|
|
6
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
7
|
+
import c from "@mui/material/Box";
|
|
8
|
+
import m from "@mui/material/Divider";
|
|
9
|
+
var p = ({ children: o }) => /* @__PURE__ */ r(l, {
|
|
10
10
|
bold: !0,
|
|
11
11
|
sx: {
|
|
12
12
|
flexShrink: 0,
|
|
13
13
|
fontVariantNumeric: "tabular-nums"
|
|
14
14
|
},
|
|
15
15
|
variant: "body1",
|
|
16
|
-
children:
|
|
17
|
-
}),
|
|
16
|
+
children: o
|
|
17
|
+
}), u = ({ bold: o = !1, label: e, value: i }) => /* @__PURE__ */ t(n, {
|
|
18
18
|
sx: {
|
|
19
19
|
alignItems: "center",
|
|
20
20
|
flexDirection: "row",
|
|
@@ -22,24 +22,24 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
22
22
|
minHeight: 44,
|
|
23
23
|
px: 16
|
|
24
24
|
},
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
bold:
|
|
25
|
+
children: [/* @__PURE__ */ r(l, {
|
|
26
|
+
bold: o,
|
|
27
27
|
sx: { flexGrow: 1 },
|
|
28
28
|
variant: "body1",
|
|
29
|
-
children:
|
|
30
|
-
}), /* @__PURE__ */
|
|
31
|
-
}),
|
|
29
|
+
children: e
|
|
30
|
+
}), /* @__PURE__ */ r(p, { children: i })]
|
|
31
|
+
}), v = ({ summary: o }) => /* @__PURE__ */ t(n, {
|
|
32
32
|
sx: {
|
|
33
33
|
gap: 12,
|
|
34
34
|
pt: 24,
|
|
35
35
|
px: 24
|
|
36
36
|
},
|
|
37
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ r(l, {
|
|
38
38
|
bold: !0,
|
|
39
39
|
component: "h3",
|
|
40
40
|
variant: "body1",
|
|
41
|
-
children:
|
|
42
|
-
}), /* @__PURE__ */
|
|
41
|
+
children: o.heading
|
|
42
|
+
}), /* @__PURE__ */ r(n, {
|
|
43
43
|
sx: {
|
|
44
44
|
bgcolor: "background.paper",
|
|
45
45
|
border: "1px solid",
|
|
@@ -47,30 +47,13 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
47
47
|
borderRadius: "8px",
|
|
48
48
|
overflow: "hidden"
|
|
49
49
|
},
|
|
50
|
-
children: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */ e(p, {}),
|
|
56
|
-
/* @__PURE__ */ e(c, {
|
|
57
|
-
label: r.estimated_income,
|
|
58
|
-
value: v(o.estimatedIncome)
|
|
59
|
-
}),
|
|
60
|
-
/* @__PURE__ */ e(p, {}),
|
|
61
|
-
/* @__PURE__ */ e(c, {
|
|
62
|
-
label: r.recurring_expenses,
|
|
63
|
-
value: l(-o.upcomingExpenses)
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ e(p, {}),
|
|
66
|
-
/* @__PURE__ */ e(c, {
|
|
67
|
-
bold: !0,
|
|
68
|
-
label: r.remaining,
|
|
69
|
-
value: l(o.totalRemaining)
|
|
70
|
-
})
|
|
71
|
-
]
|
|
50
|
+
children: o.rows.map((e, i) => /* @__PURE__ */ t(c, { children: [i > 0 && /* @__PURE__ */ r(m, {}), /* @__PURE__ */ r(u, {
|
|
51
|
+
bold: e.bold,
|
|
52
|
+
label: e.label,
|
|
53
|
+
value: e.value
|
|
54
|
+
})] }, e.key))
|
|
72
55
|
})]
|
|
73
|
-
}),
|
|
56
|
+
}), y = ({ balance: o, institutionGuid: e, isLast: i, lastFour: a, name: d }) => /* @__PURE__ */ t(c, {
|
|
74
57
|
component: "li",
|
|
75
58
|
sx: { position: "relative" },
|
|
76
59
|
children: [/* @__PURE__ */ t(n, {
|
|
@@ -82,10 +65,10 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
82
65
|
py: 12
|
|
83
66
|
},
|
|
84
67
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ r(f, {
|
|
86
69
|
alt: "",
|
|
87
|
-
institutionGuid:
|
|
88
|
-
logoUrl:
|
|
70
|
+
institutionGuid: e,
|
|
71
|
+
logoUrl: e ? void 0 : b,
|
|
89
72
|
size: 32
|
|
90
73
|
}),
|
|
91
74
|
/* @__PURE__ */ t(n, {
|
|
@@ -93,51 +76,48 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
93
76
|
flexGrow: 1,
|
|
94
77
|
minWidth: 0
|
|
95
78
|
},
|
|
96
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ r(l, {
|
|
97
80
|
truncate: !0,
|
|
98
81
|
variant: "body1",
|
|
99
|
-
children:
|
|
100
|
-
}),
|
|
82
|
+
children: d
|
|
83
|
+
}), a && /* @__PURE__ */ r(l, {
|
|
101
84
|
color: "text.secondary",
|
|
102
85
|
variant: "caption",
|
|
103
|
-
children: `•••• ${
|
|
86
|
+
children: `•••• ${a}`
|
|
104
87
|
})]
|
|
105
88
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r(p, { children: x(o) })
|
|
107
90
|
]
|
|
108
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ r(m, { sx: {
|
|
109
92
|
bottom: 0,
|
|
110
|
-
left:
|
|
93
|
+
left: i ? 0 : 24,
|
|
111
94
|
position: "absolute",
|
|
112
95
|
right: 0
|
|
113
96
|
} })]
|
|
114
|
-
}),
|
|
97
|
+
}), R = ({ accounts: o, copy: e, summary: i, totalBalance: a }) => /* @__PURE__ */ t(n, {
|
|
115
98
|
sx: {
|
|
116
99
|
bgcolor: "background.default",
|
|
117
100
|
pb: 24
|
|
118
101
|
},
|
|
119
|
-
children: [
|
|
120
|
-
copy: o,
|
|
121
|
-
summary: a
|
|
122
|
-
}), r.length === 0 ? /* @__PURE__ */ e(i, {
|
|
102
|
+
children: [i && /* @__PURE__ */ r(v, { summary: i }), o.length === 0 ? /* @__PURE__ */ r(l, {
|
|
123
103
|
component: "p",
|
|
124
104
|
sx: { p: 24 },
|
|
125
|
-
children:
|
|
105
|
+
children: e.no_accounts
|
|
126
106
|
}) : /* @__PURE__ */ t(n, { children: [
|
|
127
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ r(c, {
|
|
128
108
|
sx: {
|
|
129
109
|
pb: 4,
|
|
130
110
|
pt: 16,
|
|
131
111
|
px: 24
|
|
132
112
|
},
|
|
133
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ r(l, {
|
|
134
114
|
bold: !0,
|
|
135
115
|
component: "h3",
|
|
136
116
|
variant: "body1",
|
|
137
|
-
children:
|
|
117
|
+
children: e.accounts_header
|
|
138
118
|
})
|
|
139
119
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ r(n, {
|
|
141
121
|
component: "ul",
|
|
142
122
|
sx: {
|
|
143
123
|
bgcolor: "background.paper",
|
|
@@ -145,10 +125,10 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
145
125
|
m: 0,
|
|
146
126
|
p: 0
|
|
147
127
|
},
|
|
148
|
-
children:
|
|
149
|
-
...
|
|
150
|
-
isLast:
|
|
151
|
-
key:
|
|
128
|
+
children: o.map(({ guid: d, ...h }, s) => /* @__PURE__ */ g(y, {
|
|
129
|
+
...h,
|
|
130
|
+
isLast: s === o.length - 1,
|
|
131
|
+
key: d
|
|
152
132
|
}))
|
|
153
133
|
}),
|
|
154
134
|
/* @__PURE__ */ t(n, {
|
|
@@ -160,17 +140,17 @@ var v = (r) => r > 0 ? `+${l(r)}` : l(r), x = ({ children: r }) => /* @__PURE__
|
|
|
160
140
|
px: 24,
|
|
161
141
|
py: 14
|
|
162
142
|
},
|
|
163
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ r(l, {
|
|
164
144
|
bold: !0,
|
|
165
145
|
sx: { flexGrow: 1 },
|
|
166
146
|
variant: "body1",
|
|
167
|
-
children:
|
|
168
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: e.total_balance
|
|
148
|
+
}), /* @__PURE__ */ r(p, { children: x(a) })]
|
|
169
149
|
})
|
|
170
150
|
] })]
|
|
171
151
|
});
|
|
172
152
|
export {
|
|
173
|
-
|
|
153
|
+
R as default
|
|
174
154
|
};
|
|
175
155
|
|
|
176
156
|
//# sourceMappingURL=AccountListContent.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountListContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListContent.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\n\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport type { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\n\nimport type {
|
|
1
|
+
{"version":3,"file":"AccountListContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListContent.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\n\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport type { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\n\nimport type { AccountListSummary } from './layout'\n\nexport interface AccountListRow {\n guid: string\n name: string\n /** The last digits of the account number, shown masked; empty when unknown. */\n lastFour: string\n /** Empty when no institution is known: the default logo is shown. */\n institutionGuid: string\n balance: number\n}\n\nexport interface AccountListContentProps {\n copy: AccountListCopy\n /** Omitted when the beat carries no calculation: the drawer is just the list. */\n summary?: AccountListSummary\n /** Already ordered. */\n accounts: AccountListRow[]\n totalBalance: number\n}\n\nconst Amount = ({ children }: { children: string }) => (\n <Text bold={true} sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {children}\n </Text>\n)\n\nconst BreakdownRow = ({\n bold = false,\n label,\n value,\n}: {\n bold?: boolean\n label: string\n value: string\n}) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 16 }}>\n <Text bold={bold} sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Amount>{value}</Amount>\n </Stack>\n)\n\n/** The calculation box: a heading and the block-built rows, the last one emphasised. */\nconst Summary = ({ summary }: { summary: AccountListSummary }) => (\n <Stack sx={{ gap: 12, pt: 24, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {summary.heading}\n </Text>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n {summary.rows.map((row, index) => (\n <Box key={row.key}>\n {index > 0 && <Divider />}\n <BreakdownRow bold={row.bold} label={row.label} value={row.value} />\n </Box>\n ))}\n </Stack>\n </Stack>\n)\n\n/** One row. The last row's divider runs full width; the rest are inset to the text. */\nconst RowItem = ({\n balance,\n institutionGuid,\n isLast,\n lastFour,\n name,\n}: Omit<AccountListRow, 'guid'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12, px: 24, py: 12 }}>\n <InstitutionLogo\n alt=\"\"\n institutionGuid={institutionGuid}\n logoUrl={institutionGuid ? undefined : DEFAULT_INSTITUTION_LOGO_URL}\n size={32}\n />\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text truncate={true} variant=\"body1\">\n {name}\n </Text>\n {lastFour && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {`•••• ${lastFour}`}\n </Text>\n )}\n </Stack>\n <Amount>{formatSignedCurrency(balance)}</Amount>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 24, position: 'absolute', right: 0 }} />\n </Box>\n)\n\n/** Presentational body of the Account List drawer, minus the drawer header. */\nconst AccountListContent = ({ accounts, copy, summary, totalBalance }: AccountListContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n {summary && <Summary summary={summary} />}\n {accounts.length === 0 ? (\n <Text component=\"p\" sx={{ p: 24 }}>\n {copy.no_accounts}\n </Text>\n ) : (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {copy.accounts_header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {accounts.map(({ guid, ...row }, index) => (\n <RowItem {...row} isLast={index === accounts.length - 1} key={guid} />\n ))}\n </Stack>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n flexDirection: 'row',\n gap: 16,\n px: 24,\n py: 14,\n }}\n >\n <Text bold={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {copy.total_balance}\n </Text>\n <Amount>{formatSignedCurrency(totalBalance)}</Amount>\n </Stack>\n </Stack>\n )}\n </Stack>\n)\n\nexport default AccountListContent\n"],"mappings":";;;;;;;;AA+BA,IAAM,IAAA,CAAU,EAAE,UAAA,EAAA,MAChB,gBAAA,EAAC,GAAD;AAAA,EAAM,MAAM;AAAA,EAAM,IAAI;AAAA,IAAE,YAAY;AAAA,IAAG,oBAAoB;AAAA,EAAe;AAAA,EAAG,SAAQ;AAAA,EAClF,UAAA;AACG,CAAA,GAGF,IAAA,CAAgB,EACpB,MAAA,IAAO,IACP,OAAA,GACA,OAAA,EAAA,MAMA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,eAAe;AAAA,IAAO,KAAK;AAAA,IAAI,WAAW;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAY,MAAA;AAAA,IAAM,IAAI,EAAE,UAAU,EAAE;AAAA,IAAG,SAAQ;AAAA,IAC5C,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD,EAAA,UAAS,EAAc,CAAA,CAClB;IAIH,IAAA,CAAW,EAAE,SAAA,EAAA,MACjB,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,KAAK;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAArC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,WAAU;AAAA,IAAK,SAAQ;AAAA,IACtC,UAAA,EAAQ;AAAA,EACL,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,UAAU;AAAA,IACZ;AAAA,IAEC,UAAA,EAAQ,KAAK,IAAA,CAAK,GAAK,MACtB,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,IAAQ,KAAK,gBAAA,EAAC,GAAD,CAAU,CAAA,GACxB,gBAAA,EAAC,GAAD;AAAA,MAAc,MAAM,EAAI;AAAA,MAAM,OAAO,EAAI;AAAA,MAAO,OAAO,EAAI;AAAA,IAAQ,CAAA,CAChE,EAAA,GAHK,EAAI,GAGT,CACN;AAAA,EACI,CAAA,CACF;IAIH,IAAA,CAAW,EACf,SAAA,GACA,iBAAA,GACA,QAAA,GACA,UAAA,GACA,MAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EAAK,WAAU;AAAA,EAAK,IAAI,EAAE,UAAU,WAAW;AAAA,EAA/C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAAjF,UAAA;AAAA,MACE,gBAAA,EAAC,GAAD;AAAA,QACE,KAAI;AAAA,QACa,iBAAA;AAAA,QACjB,SAAS,IAAkB,SAAY;AAAA,QACvC,MAAM;AAAA,MACP,CAAA;AAAA,MACD,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,UAAU;AAAA,UAAG,UAAU;AAAA,QAAE;AAAA,QAAtC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UAAM,UAAU;AAAA,UAAM,SAAQ;AAAA,UAC3B,UAAA;AAAA,QACG,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA,QAAQ,CAAA;AAAA,QACL,CAAA,CAEH;AAAA;MACP,gBAAA,EAAC,GAAD,EAAA,UAAS,EAAqB,CAAO,EAAU,CAAA;AAAA,IAC1C;AAAA,EACP,CAAA,GAAA,gBAAA,EAAC,GAAD,EAAS,IAAI;AAAA,IAAE,QAAQ;AAAA,IAAG,MAAM,IAAS,IAAI;AAAA,IAAI,UAAU;AAAA,IAAY,OAAO;AAAA,EAAE,EAAI,CAAA,CACjF;IAID,IAAA,CAAsB,EAAE,UAAA,GAAU,MAAA,GAAM,SAAA,GAAS,cAAA,EAAA,MACrD,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,SAAS;AAAA,IAAsB,IAAI;AAAA,EAAG;AAAA,EAAnD,UAAA,CACG,KAAW,gBAAA,EAAC,GAAD,EAAkB,SAAA,EAAU,CAAA,GACvC,EAAS,WAAW,IACnB,gBAAA,EAAC,GAAD;AAAA,IAAM,WAAU;AAAA,IAAI,IAAI,EAAE,GAAG,GAAG;AAAA,IAC7B,UAAA,EAAK;AAAA,EACF,CAAA,IAEN,gBAAA,EAAC,GAAD,EAAA,UAAA;AAAA,IACE,gBAAA,EAAC,GAAD;AAAA,MAAK,IAAI;AAAA,QAAE,IAAI;AAAA,QAAG,IAAI;AAAA,QAAI,IAAI;AAAA,MAAG;AAAA,MAC/B,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,WAAU;AAAA,QAAK,SAAQ;AAAA,QACtC,UAAA,EAAK;AAAA,MACF,CAAA;AAAA,IACH,CAAA;AAAA,IACL,gBAAA,EAAC,GAAD;AAAA,MAAO,WAAU;AAAA,MAAK,IAAI;AAAA,QAAE,SAAS;AAAA,QAAoB,WAAW;AAAA,QAAQ,GAAG;AAAA,QAAG,GAAG;AAAA,MAAE;AAAA,MACpF,UAAA,EAAS,IAAA,CAAK,EAAE,MAAA,GAAM,GAAG,EAAA,GAAO,MAC/B,gBAAA,EAAC,GAAD;AAAA,QAAS,GAAI;AAAA,QAAK,QAAQ,MAAU,EAAS,SAAS;AAAA,QAAG,KAAK;AAAA,MAAO,CAAA,CACtE;AAAA,IACI,CAAA;AAAA,IACP,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,eAAe;AAAA,QACf,KAAK;AAAA,QACL,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MARF,UAAA,CAUE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,UAAU,EAAE;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA,EAAK;AAAA,MACF,CAAA,GACN,gBAAA,EAAC,GAAD,EAAA,UAAS,EAAqB,CAAY,EAAU,CAAA,CAC/C;AAAA;EACF,EAAA,CAAA,CAEJ"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import { Account, Beat } from '../../../core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* visible accounts, or every visible account the store counts as cash when the beat names none
|
|
5
|
-
* (tupac's Monthly Obligations factory sums the cash accounts without recording their guids). Both
|
|
6
|
-
* rules are the store's: `visibleAccounts` applies the widget's hidden, closed and external/held
|
|
7
|
-
* settings, `cashAccounts` says which types are cash.
|
|
8
|
-
*/
|
|
1
|
+
import { Account, Beat, DrilldownData } from '../../../core';
|
|
2
|
+
import { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy';
|
|
3
|
+
/** The beat's `account_guids` among visible accounts (or every cash account when it names none), largest first. */
|
|
9
4
|
export declare const resolveBeatAccounts: (beat: Beat, visibleAccounts: Account[], cashAccounts: Account[]) => Account[];
|
|
10
5
|
export declare const sumBalances: (accounts: Account[]) => number;
|
|
11
6
|
/** The last four digits of an account number; empty when the account has none. */
|
|
12
7
|
export declare const lastFour: (accountNumber?: string) => string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
/** A generic breakdown row: a label and its already-formatted display value. */
|
|
9
|
+
export interface SummaryRow {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
/** The emphasised total row. */
|
|
14
|
+
bold?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** The "How is this calculated?" breakdown, built per insight so AccountListContent stays generic. */
|
|
17
|
+
export interface AccountListSummary {
|
|
18
|
+
heading: string;
|
|
19
|
+
rows: SummaryRow[];
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Builds the drawer breakdown from whichever CTA opened it, keyed by the CTA's `variant` (ditto's
|
|
23
|
+
* `*_cta_variant`). Unknown/absent variants fall back to Monthly Obligations and warn.
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildSummary: (cta: {
|
|
26
|
+
variant?: string | null;
|
|
27
|
+
drilldown_data?: DrilldownData;
|
|
28
|
+
} | undefined, copy: AccountListCopy) => AccountListSummary | undefined;
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!(
|
|
1
|
+
import { formatSignedCurrency as r } from "../../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import { resolveVariantConfig as u } from "../../blocks/resolveVariantConfig.es.js";
|
|
3
|
+
import { finiteNumberOf as t } from "../TransactionHistoryBlock/utils.es.js";
|
|
4
|
+
var s = (a) => a.balance ?? 0, _ = (a, e, l) => {
|
|
5
|
+
const i = new Set(a.account_guids?.length ? a.account_guids : l.map(({ guid: n }) => n));
|
|
6
|
+
return e.filter((n) => i.has(n.guid)).sort((n, o) => s(o) - s(n));
|
|
7
|
+
}, b = (a) => a.reduce((e, l) => e + s(l), 0), f = (a) => a?.replace(/\D/g, "").slice(-4) ?? "", d = (a, e) => {
|
|
8
|
+
const l = t(a?.available_funds), i = t(a?.planned_expenses), n = t(a?.total_remaining);
|
|
9
|
+
if (!(l === void 0 || i === void 0 || n === void 0))
|
|
10
10
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
heading: e.how_is_this_calculated,
|
|
12
|
+
rows: [
|
|
13
|
+
{
|
|
14
|
+
key: "available_funds",
|
|
15
|
+
label: e.available_funds,
|
|
16
|
+
value: r(l)
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: "planned_expenses",
|
|
20
|
+
label: e.planned_expenses,
|
|
21
|
+
value: r(-i)
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
bold: !0,
|
|
25
|
+
key: "remaining",
|
|
26
|
+
label: e.remaining,
|
|
27
|
+
value: r(n)
|
|
28
|
+
}
|
|
29
|
+
]
|
|
15
30
|
};
|
|
16
|
-
};
|
|
31
|
+
}, m = { monthly_obligations: d }, p = (a, e) => u(m, a?.variant, "monthly_obligations", "AccountListBlock")(a?.drilldown_data, e);
|
|
17
32
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
p as buildSummary,
|
|
34
|
+
f as lastFour,
|
|
35
|
+
_ as resolveBeatAccounts,
|
|
36
|
+
b as sumBalances
|
|
22
37
|
};
|
|
23
38
|
|
|
24
39
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/layout.ts"],"sourcesContent":["import type { Account, Beat } from '../../../core'\n\nconst balanceOf = (account: Account) => account.balance ?? 0\n\n
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/layout.ts"],"sourcesContent":["import type { Account, Beat, DrilldownData } from '../../../core'\nimport type { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { resolveVariantConfig } from '../../blocks/resolveVariantConfig'\nimport { finiteNumberOf } from '../TransactionHistoryBlock/utils'\n\nconst balanceOf = (account: Account) => account.balance ?? 0\n\n/** The beat's `account_guids` among visible accounts (or every cash account when it names none), largest first. */\nexport const resolveBeatAccounts = (\n beat: Beat,\n visibleAccounts: Account[],\n cashAccounts: Account[],\n): Account[] => {\n const guids = new Set<string>(\n beat.account_guids?.length ? beat.account_guids : cashAccounts.map(({ guid }) => guid),\n )\n\n return visibleAccounts\n .filter((account) => guids.has(account.guid))\n .sort((a, b) => balanceOf(b) - balanceOf(a))\n}\n\nexport const sumBalances = (accounts: Account[]): number =>\n accounts.reduce((total, account) => total + balanceOf(account), 0)\n\n/** The last four digits of an account number; empty when the account has none. */\nexport const lastFour = (accountNumber?: string): string =>\n accountNumber?.replace(/\\D/g, '').slice(-4) ?? ''\n\n/** A generic breakdown row: a label and its already-formatted display value. */\nexport interface SummaryRow {\n key: string\n label: string\n value: string\n /** The emphasised total row. */\n bold?: boolean\n}\n\n/** The \"How is this calculated?\" breakdown, built per insight so AccountListContent stays generic. */\nexport interface AccountListSummary {\n heading: string\n rows: SummaryRow[]\n}\n\ntype SummaryBuilder = (\n drilldown: DrilldownData | undefined,\n copy: AccountListCopy,\n) => AccountListSummary | undefined\n\n/** Monthly Obligations breakdown; undefined unless all three figures are finite, so the drawer falls back to the list. */\nconst buildMonthlyObligationsSummary: SummaryBuilder = (drilldown, copy) => {\n const availableFunds = finiteNumberOf(drilldown?.available_funds)\n const plannedExpenses = finiteNumberOf(drilldown?.planned_expenses)\n const totalRemaining = finiteNumberOf(drilldown?.total_remaining)\n\n if (\n availableFunds === undefined ||\n plannedExpenses === undefined ||\n totalRemaining === undefined\n ) {\n return undefined\n }\n\n return {\n heading: copy.how_is_this_calculated,\n rows: [\n {\n key: 'available_funds',\n label: copy.available_funds,\n value: formatSignedCurrency(availableFunds),\n },\n // Shown as a deduction (-$1,200.00), per Figma; the figure is stored positive.\n {\n key: 'planned_expenses',\n label: copy.planned_expenses,\n value: formatSignedCurrency(-plannedExpenses),\n },\n {\n bold: true,\n key: 'remaining',\n label: copy.remaining,\n value: formatSignedCurrency(totalRemaining),\n },\n ],\n }\n}\n\nconst SUMMARY_BUILDERS = {\n monthly_obligations: buildMonthlyObligationsSummary,\n} satisfies Record<string, SummaryBuilder>\n\n/**\n * Builds the drawer breakdown from whichever CTA opened it, keyed by the CTA's `variant` (ditto's\n * `*_cta_variant`). Unknown/absent variants fall back to Monthly Obligations and warn.\n */\nexport const buildSummary = (\n cta: { variant?: string | null; drilldown_data?: DrilldownData } | undefined,\n copy: AccountListCopy,\n): AccountListSummary | undefined =>\n resolveVariantConfig(\n SUMMARY_BUILDERS,\n cta?.variant,\n 'monthly_obligations',\n 'AccountListBlock',\n )(cta?.drilldown_data, copy)\n"],"mappings":";;;AAMA,IAAM,IAAA,CAAa,MAAqB,EAAQ,WAAW,GAG9C,IAAA,CACX,GACA,GACA,MACc;AACd,QAAM,IAAQ,IAAI,IAChB,EAAK,eAAe,SAAS,EAAK,gBAAgB,EAAa,IAAA,CAAK,EAAE,MAAA,EAAA,MAAW,CAAI,CACvF;AAEA,SAAO,EACJ,OAAA,CAAQ,MAAY,EAAM,IAAI,EAAQ,IAAI,CAAC,EAC3C,KAAA,CAAM,GAAG,MAAM,EAAU,CAAC,IAAI,EAAU,CAAC,CAAC;AAC/C,GAEa,IAAA,CAAe,MAC1B,EAAS,OAAA,CAAQ,GAAO,MAAY,IAAQ,EAAU,CAAO,GAAG,CAAC,GAGtD,IAAA,CAAY,MACvB,GAAe,QAAQ,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,IAuB3C,IAAA,CAAkD,GAAW,MAAS;AAC1E,QAAM,IAAiB,EAAe,GAAW,eAAe,GAC1D,IAAkB,EAAe,GAAW,gBAAgB,GAC5D,IAAiB,EAAe,GAAW,eAAe;AAEhE,MACE,EAAA,MAAmB,UACnB,MAAoB,UACpB,MAAmB;AAKrB,WAAO;AAAA,MACL,SAAS,EAAK;AAAA,MACd,MAAM;AAAA,QACJ;AAAA,UACE,KAAK;AAAA,UACL,OAAO,EAAK;AAAA,UACZ,OAAO,EAAqB,CAAc;AAAA,QAC5C;AAAA,QAEA;AAAA,UACE,KAAK;AAAA,UACL,OAAO,EAAK;AAAA,UACZ,OAAO,EAAqB,CAAC,CAAe;AAAA,QAC9C;AAAA,QACA;AAAA,UACE,MAAM;AAAA,UACN,KAAK;AAAA,UACL,OAAO,EAAK;AAAA,UACZ,OAAO,EAAqB,CAAc;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AACF,GAEM,IAAmB,EACvB,qBAAqB,EACvB,GAMa,IAAA,CACX,GACA,MAEA,EACE,GACA,GAAK,SACL,uBACA,kBACF,EAAE,GAAK,gBAAgB,CAAI"}
|
|
@@ -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 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: '
|
|
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 // Figma: the hero amount is h2 (23px), consistent with the other confetti tiles. Design sign-off:\n // https://mxenabled.slack.com/archives/C0C0F6V8TAQ/p1793864013010539\n amountVariant: 'h2',\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: 16, 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,IAAI,IAAI;AAAA,IACrE,mBAAmB;AAAA,IACnB,YACE;AAAA,EACJ;AAAA,EAGA,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IAGT,eAAe;AAAA,IACf,cAAc;AAAA,IACd,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,iBAAiB;AAAA,IACf,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,oBAAoB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IACjC,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,iBAAiB;AAAA,IACf,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EAGA,SAAS,CAAC;AACZ"}
|