@mx-cartographer/experiences 9.7.149 → 9.7.151
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 +13 -0
- package/dist/core/types/Insights.d.ts +0 -6
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +10 -7
- package/dist/core/utils/NumberFormatting.d.ts +2 -0
- package/dist/core/utils/NumberFormatting.es.js +18 -17
- package/dist/core/utils/NumberFormatting.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +57 -57
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.d.ts +4 -23
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +95 -72
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +24 -25
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +4 -4
- package/dist/insights-v2/index.d.ts +0 -1
- package/dist/insights-v2/index.es.js +104 -106
- package/dist/insights-v2/mappings/blocks.es.js +1 -0
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.d.ts +0 -17
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.es.js +0 -24
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.es.js.map +0 -1
- package/dist/insights-v2/components/ComponentBlocks/DepositLogo.es.js +0 -30
- package/dist/insights-v2/components/ComponentBlocks/DepositLogo.es.js.map +0 -1
- package/dist/insights-v2/components/DebtPayoffCard.d.ts +0 -48
- package/dist/insights-v2/components/DebtPayoffCard.es.js +0 -132
- package/dist/insights-v2/components/DebtPayoffCard.es.js.map +0 -1
|
@@ -1,77 +1,100 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
2
|
-
import { useGlobalCopyStore as
|
|
3
|
-
import { slot as
|
|
4
|
-
import { CURRENCY_FORMAT as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import j from "
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { jsx as
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
import { DATE_FORMATS_INTL as R, formatDate as k } from "../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { useGlobalCopyStore as w } from "../../../../common/context/hooks.es.js";
|
|
3
|
+
import { slot as s } from "../../../../core/types/Insights.es.js";
|
|
4
|
+
import { CURRENCY_FORMAT as b, formatCurrency as f } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import { asLogoRef as A, asNonEmptyText as C, asNumber as _, asText as L } from "../../slotReaders.es.js";
|
|
6
|
+
import F from "../../../components/LogoFromGuid.es.js";
|
|
7
|
+
import O from "../../../components/InsightTransactionRow.es.js";
|
|
8
|
+
import { parseDueDate as j } from "../RepeatingTransactionBlock/weekStrip.es.js";
|
|
9
|
+
import { useEffect as E } from "react";
|
|
10
|
+
import { observer as I } from "mobx-react-lite";
|
|
11
|
+
import y from "@mui/material/Stack";
|
|
12
|
+
import { Text as D } from "@mxenabled/mxui";
|
|
13
|
+
import { Fragment as N, jsx as a, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import S from "@mui/material/Divider";
|
|
15
|
+
var B = 32, G = (r) => {
|
|
16
|
+
if (Array.isArray(r))
|
|
17
|
+
for (const o of r) {
|
|
18
|
+
if (typeof o != "object" || o === null) continue;
|
|
19
|
+
const { amount: t, logo: l, primary_text: i, secondary_text: n } = o, e = C(i);
|
|
20
|
+
if (e) return {
|
|
21
|
+
name: e,
|
|
22
|
+
account: L(n),
|
|
23
|
+
amount: _(t),
|
|
24
|
+
logo: A(l)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}, M = ({ grey: r, label: o, value: t }) => /* @__PURE__ */ v(N, { children: [/* @__PURE__ */ a(S, {}), /* @__PURE__ */ v(y, {
|
|
28
|
+
sx: {
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
bgcolor: r ? "background.default" : "background.paper",
|
|
31
|
+
flexDirection: "row",
|
|
32
|
+
justifyContent: "space-between",
|
|
33
|
+
minHeight: 40,
|
|
34
|
+
px: 16,
|
|
35
|
+
py: 2
|
|
36
|
+
},
|
|
37
|
+
children: [/* @__PURE__ */ a(D, {
|
|
38
|
+
color: "text.primary",
|
|
39
|
+
variant: "subtitle2",
|
|
40
|
+
children: o
|
|
41
|
+
}), /* @__PURE__ */ a(D, {
|
|
42
|
+
bold: !0,
|
|
43
|
+
color: "text.primary",
|
|
44
|
+
variant: "caption",
|
|
45
|
+
children: t
|
|
46
|
+
})]
|
|
47
|
+
})] }), H = ({ payload: r }) => {
|
|
48
|
+
const o = w().insights_feed?.debts_block, t = o?.payment_due_label, l = o?.minimum_payment_label, i = o?.balance_label, n = r.instance_slot?.data, e = G(s(n, "series")), g = L(s(n, "due_date")), c = g ? j(g) : null, u = _(s(n, "minimum_payment")), d = _(s(n, "amount")), x = e !== void 0, p = [
|
|
49
|
+
c && !t && "payment_due_label",
|
|
50
|
+
u !== void 0 && !l && "minimum_payment_label",
|
|
51
|
+
d !== void 0 && !i && "balance_label"
|
|
52
|
+
].filter(Boolean).join(", ");
|
|
53
|
+
if (E(() => {
|
|
54
|
+
x && p && console.warn(`debts_block: copy missing ${p}; hiding those lines`);
|
|
55
|
+
}, [x, p]), !e) return null;
|
|
56
|
+
const h = [
|
|
57
|
+
t && c ? {
|
|
58
|
+
label: t,
|
|
59
|
+
value: k(c, R.FULL_MONTH_DAY)
|
|
60
|
+
} : null,
|
|
61
|
+
l && u !== void 0 ? {
|
|
62
|
+
label: l,
|
|
63
|
+
value: f(u, b.cents)
|
|
64
|
+
} : null,
|
|
65
|
+
i && d !== void 0 ? {
|
|
66
|
+
label: i,
|
|
67
|
+
value: f(d, b.cents)
|
|
68
|
+
} : null
|
|
69
|
+
].filter((m) => m !== null);
|
|
70
|
+
return /* @__PURE__ */ a(y, {
|
|
71
|
+
sx: { px: 16 },
|
|
72
|
+
children: /* @__PURE__ */ v(y, {
|
|
73
|
+
sx: {
|
|
74
|
+
border: "1px solid",
|
|
75
|
+
borderColor: "divider",
|
|
76
|
+
borderRadius: "8px",
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
width: "100%"
|
|
79
|
+
},
|
|
80
|
+
children: [/* @__PURE__ */ a(O, {
|
|
81
|
+
amount: e.amount === void 0 ? "" : f(e.amount, b.cents),
|
|
82
|
+
leading: /* @__PURE__ */ a(F, {
|
|
83
|
+
logo: e.logo,
|
|
84
|
+
size: B
|
|
85
|
+
}),
|
|
86
|
+
subtitle: e.account ?? "",
|
|
87
|
+
title: e.name
|
|
88
|
+
}), h.map((m, T) => /* @__PURE__ */ a(M, {
|
|
89
|
+
grey: T === h.length - 1,
|
|
90
|
+
label: m.label,
|
|
91
|
+
value: m.value
|
|
92
|
+
}, m.label))]
|
|
93
|
+
})
|
|
71
94
|
});
|
|
72
|
-
};
|
|
95
|
+
}, oe = I(H);
|
|
73
96
|
export {
|
|
74
|
-
|
|
97
|
+
oe as default
|
|
75
98
|
};
|
|
76
99
|
|
|
77
100
|
//# sourceMappingURL=DebtsBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport InsightTransactionRow from '../../../components/InsightTransactionRow'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { asLogoRef, asNonEmptyText, asNumber, asText } from '../../slotReaders'\nimport { parseDueDate } from '../RepeatingTransactionBlock/weekStrip'\n\ninterface DebtsBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n\ninterface PaymentRow {\n name: string\n account?: string\n amount?: number\n logo?: LogoRef\n}\n\n/** The first `series` row with a name, read through the shared slot readers; else undefined. */\nconst readPayment = (series: unknown): PaymentRow | undefined => {\n if (!Array.isArray(series)) return undefined\n for (const row of series) {\n if (typeof row !== 'object' || row === null) continue\n const { amount, logo, primary_text, secondary_text } = row as Record<string, unknown>\n const name = asNonEmptyText(primary_text)\n if (name) {\n return {\n name,\n account: asText(secondary_text),\n amount: asNumber(amount),\n logo: asLogoRef(logo),\n }\n }\n }\n return undefined\n}\n\n/** A label / value line under the payment row; the card's last line sits on the grey surface. */\nconst SummaryLine = ({ grey, label, value }: { grey?: boolean; label: string; value: string }) => (\n <>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: grey ? 'background.default' : 'background.paper',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n <Text color=\"text.primary\" variant=\"subtitle2\">\n {label}\n </Text>\n <Text bold={true} color=\"text.primary\" variant=\"caption\">\n {value}\n </Text>\n </Stack>\n </>\n)\n\n/**\n * Debts component block: the Debt Payment Reminder card (Figma 1943:219556). One bordered card:\n *\n * - the upcoming payment, from `data.series[0]`: `logo`, `primary_text` (payment name),\n * `secondary_text` (account name) and `amount` (the payment);\n * - \"Payment due on\" with `data.due_date` (ISO day, shown as \"September 15\");\n * - \"Minimum payment\" with `data.minimum_payment`, only when ditto sends one (Figma \"Has Minimum\n * Payment\"; \"No Minimum Payment\" omits the line);\n * - the account balance, `data.amount`.\n *\n * The last line drawn sits on the grey surface: the balance on full, the due date on mini (whose\n * Figma draws the due date alone).\n *\n * The captions come from `insights_feed.debts_block` (`payment_due_label`, `minimum_payment_label`,\n * `balance_label`). A line whose caption has not shipped, or whose value is missing or invalid, is\n * left out rather than drawn unlabelled or blank; a missing caption for a line that has a value\n * also warns once, naming the key. With no payment row there is no card.\n */\nconst DebtsBlock = ({ payload }: DebtsBlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.debts_block\n const dueLabel = copy?.payment_due_label\n const minimumLabel = copy?.minimum_payment_label\n const balanceLabel = copy?.balance_label\n\n // Backend data is untrusted: every value goes through the shared slot readers before use.\n const data = payload.instance_slot?.data\n const payment = readPayment(slot(data, 'series'))\n const dueDateIso = asText(slot(data, 'due_date'))\n const dueDate = dueDateIso ? parseDueDate(dueDateIso) : null\n const minimum = asNumber(slot(data, 'minimum_payment'))\n const balance = asNumber(slot(data, 'amount'))\n const hasPayment = payment !== undefined\n\n // Only the captions for lines this card has a value to draw (mini sends no balance).\n const missingKeys = [\n dueDate && !dueLabel && 'payment_due_label',\n minimum !== undefined && !minimumLabel && 'minimum_payment_label',\n balance !== undefined && !balanceLabel && 'balance_label',\n ]\n .filter(Boolean)\n .join(', ')\n\n useEffect(() => {\n if (hasPayment && missingKeys) {\n console.warn(`debts_block: copy missing ${missingKeys}; hiding those lines`)\n }\n }, [hasPayment, missingKeys])\n\n if (!payment) return null\n\n // Figma's order; the last line drawn sits on the grey surface.\n const lines = [\n dueLabel && dueDate\n ? { label: dueLabel, value: formatDate(dueDate, DATE_FORMATS_INTL.FULL_MONTH_DAY) }\n : null,\n minimumLabel && minimum !== undefined\n ? { label: minimumLabel, value: formatCurrency(minimum, CURRENCY_FORMAT.cents) }\n : null,\n balanceLabel && balance !== undefined\n ? { label: balanceLabel, value: formatCurrency(balance, CURRENCY_FORMAT.cents) }\n : null,\n ].filter((line): line is { label: string; value: string } => line !== null)\n\n return (\n <Stack sx={{ px: 16 }}>\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n width: '100%',\n }}\n >\n <InsightTransactionRow\n amount={\n payment.amount === undefined\n ? ''\n : formatCurrency(payment.amount, CURRENCY_FORMAT.cents)\n }\n leading={<LogoFromGuid logo={payment.logo} size={ROW_LOGO_SIZE} />}\n subtitle={payment.account ?? ''}\n title={payment.name}\n />\n {lines.map((line, index) => (\n <SummaryLine\n grey={index === lines.length - 1}\n key={line.label}\n label={line.label}\n value={line.value}\n />\n ))}\n </Stack>\n </Stack>\n )\n}\n\n// observer: the captions come from the copy store, which can load or change after the first render.\nexport default observer(DebtsBlock)\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAM,IAAgB,IAUhB,IAAA,CAAe,MAA4C;AAC/D,MAAK,MAAM,QAAQ,CAAM;AACzB,eAAW,KAAO,GAAQ;AACxB,UAAI,OAAO,KAAQ,YAAY,MAAQ,KAAM;AAC7C,YAAM,EAAE,QAAA,GAAQ,MAAA,GAAM,cAAA,GAAc,gBAAA,EAAA,IAAmB,GACjD,IAAO,EAAe,CAAY;AACxC,UAAI,EACF,QAAO;AAAA,QACL,MAAA;AAAA,QACA,SAAS,EAAO,CAAc;AAAA,QAC9B,QAAQ,EAAS,CAAM;AAAA,QACvB,MAAM,EAAU,CAAI;AAAA,MACtB;AAAA,IAEJ;AAEF,GAGM,IAAA,CAAe,EAAE,MAAA,GAAM,OAAA,GAAO,OAAA,EAAA,MAClC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD,CAAU,CAAA,GACV,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS,IAAO,uBAAuB;AAAA,IACvC,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AAAA,EATF,UAAA,CAWE,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAe,SAAQ;AAAA,IAChC,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,OAAM;AAAA,IAAe,SAAQ;AAAA,IAC5C,UAAA;AAAA,EACG,CAAA,CACD;AACP,CAAA,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;AAAA,MACE,IAAI;AAAA,QACF,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,cAAc;AAAA,QACd,UAAU;AAAA,QACV,OAAO;AAAA,MACT;AAAA,MAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,QACE,QACE,EAAQ,WAAW,SACf,KACA,EAAe,EAAQ,QAAQ,EAAgB,KAAK;AAAA,QAE1D,SAAS,gBAAA,EAAC,GAAD;AAAA,UAAc,MAAM,EAAQ;AAAA,UAAM,MAAM;AAAA,QAAgB,CAAA;AAAA,QACjE,UAAU,EAAQ,WAAW;AAAA,QAC7B,OAAO,EAAQ;AAAA,MAChB,CAAA,GACA,EAAM,IAAA,CAAK,GAAM,MAChB,gBAAA,EAAC,GAAD;AAAA,QACE,MAAM,MAAU,EAAM,SAAS;AAAA,QAE/B,OAAO,EAAK;AAAA,QACZ,OAAO,EAAK;AAAA,MACb,GAHM,EAAK,KAGX,CACF,CACI;AAAA;EACF,CAAA;AAEX,GAGA,KAAe,EAAS,CAAU"}
|
|
@@ -4,9 +4,9 @@ import { QUIZ_CONTEXT as c, QUIZ_VARIANTS as O, isTopMerchant as K, merchantKey
|
|
|
4
4
|
import { actionBlocksKey as F } from "../../../mappings/actionBlocksKey.es.js";
|
|
5
5
|
import Z from "../../../components/LogoFromGuid.es.js";
|
|
6
6
|
import { ConfettiOverlay as N } from "../../../components/shared/ConfettiOverlay.es.js";
|
|
7
|
-
import
|
|
8
|
-
import V from "
|
|
9
|
-
import {
|
|
7
|
+
import U from "../../../components/LogoTile.es.js";
|
|
8
|
+
import { LinedCardZeroState as V } from "../../../../insights/components/shared/ZeroState/LinedCardZeroState.es.js";
|
|
9
|
+
import { SMALL_CARD_SHADOW as j } from "../../../components/shared/elevation.es.js";
|
|
10
10
|
import { useEffect as E, useState as H } from "react";
|
|
11
11
|
import { observer as A } from "mobx-react-lite";
|
|
12
12
|
import a from "@mui/material/Stack";
|
|
@@ -33,7 +33,7 @@ var X = 3e3, z = 32, T = {
|
|
|
33
33
|
...q(o, e),
|
|
34
34
|
alt: ""
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */ r(
|
|
36
|
+
return /* @__PURE__ */ r(U, {
|
|
37
37
|
borderColor: null,
|
|
38
38
|
borderRadius: 4,
|
|
39
39
|
size: z,
|
|
@@ -53,7 +53,7 @@ var X = 3e3, z = 32, T = {
|
|
|
53
53
|
backdropFilter: o ? void 0 : "blur(6px)",
|
|
54
54
|
bgcolor: (t) => o ? "success.main" : _(t.palette.common.black, 0.5),
|
|
55
55
|
borderRadius: "8px",
|
|
56
|
-
boxShadow: o ?
|
|
56
|
+
boxShadow: o ? j : void 0,
|
|
57
57
|
color: o ? "success.contrastText" : "common.white",
|
|
58
58
|
gap: 18,
|
|
59
59
|
inset: 16,
|
|
@@ -130,7 +130,7 @@ var X = 3e3, z = 32, T = {
|
|
|
130
130
|
s
|
|
131
131
|
]), E(() => {
|
|
132
132
|
t || console.warn("quiz_block: copy namespace missing; rendering without its labels");
|
|
133
|
-
}, [t]), !m.length) return /* @__PURE__ */ r(
|
|
133
|
+
}, [t]), !m.length) return /* @__PURE__ */ r(V, {});
|
|
134
134
|
if (k) {
|
|
135
135
|
const n = (i) => f({
|
|
136
136
|
guid: o,
|
package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import {
|
|
1
|
+
import { useGlobalCopyStore as u } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { formatWholeCurrency as y } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
3
|
import { ThemedSVGImage as h } from "../../../components/chartblocks/ThemedSVGImage.es.js";
|
|
4
4
|
import { resolveVariantConfig as _ } from "../../resolveVariantConfig.es.js";
|
|
5
|
-
import { asNumber as f, asText as
|
|
6
|
-
import { ReactComponent as
|
|
7
|
-
import { ReactComponent as
|
|
8
|
-
import { SAVINGS_SUMMARY_LAYOUT as
|
|
5
|
+
import { asNumber as f, asText as S, slotOrFlat as m } from "../../slotReaders.es.js";
|
|
6
|
+
import { ReactComponent as w } from "../../../components/shared/images/SaveEnoughToLiveOnBottom.es.js";
|
|
7
|
+
import { ReactComponent as C } from "../../../components/shared/images/SaveEnoughToLiveOnTop.es.js";
|
|
8
|
+
import { SAVINGS_SUMMARY_LAYOUT as I, savingsSummaryBlockVariant as R } from "./layout.es.js";
|
|
9
9
|
import n from "@mui/material/Stack";
|
|
10
|
-
import { H2 as
|
|
11
|
-
import { jsx as e, jsxs as
|
|
12
|
-
import
|
|
13
|
-
var v = ({ label: i, amount: o }) => /* @__PURE__ */
|
|
10
|
+
import { H2 as T, Text as g } from "@mxenabled/mxui";
|
|
11
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
12
|
+
import A from "@mui/material/Box";
|
|
13
|
+
var v = ({ label: i, amount: o }) => /* @__PURE__ */ t(n, {
|
|
14
14
|
direction: "row",
|
|
15
15
|
sx: {
|
|
16
16
|
alignItems: "center",
|
|
@@ -30,29 +30,29 @@ var v = ({ label: i, amount: o }) => /* @__PURE__ */ r(n, {
|
|
|
30
30
|
component: "dd",
|
|
31
31
|
sx: { m: 0 },
|
|
32
32
|
variant: "body2",
|
|
33
|
-
children: y(o
|
|
33
|
+
children: y(o)
|
|
34
34
|
})]
|
|
35
|
-
}),
|
|
36
|
-
const o =
|
|
37
|
-
return !s || !l || d === void 0 || c === void 0 ? null : /* @__PURE__ */
|
|
35
|
+
}), O = ({ payload: i }) => {
|
|
36
|
+
const o = u().insights_feed?.make_transfer, s = o?.available_balance_text, l = o?.avg_monthly_spend_text, { instance_slot: r = {} } = i, { showCalendar: a } = _(I, r.variant, R.NoIllustration, "SavingsSummaryBlock"), d = f(m(r, "available_balance")), c = f(m(r, "avg_monthly_spend")), p = S(m(r, "time_period")), x = !!p;
|
|
37
|
+
return !s || !l || d === void 0 || c === void 0 ? null : /* @__PURE__ */ t(n, {
|
|
38
38
|
sx: {
|
|
39
39
|
alignItems: "center",
|
|
40
|
-
gap: a ?
|
|
40
|
+
gap: a ? 20 : 12,
|
|
41
41
|
px: 16,
|
|
42
42
|
width: "100%"
|
|
43
43
|
},
|
|
44
|
-
children: [(a || x) && /* @__PURE__ */
|
|
44
|
+
children: [(a || x) && /* @__PURE__ */ t(n, {
|
|
45
45
|
sx: { alignItems: "center" },
|
|
46
46
|
children: [a && /* @__PURE__ */ e(h, {
|
|
47
47
|
divProps: { style: {
|
|
48
48
|
maxWidth: "100%",
|
|
49
49
|
width: 264
|
|
50
50
|
} },
|
|
51
|
-
image:
|
|
52
|
-
}), x && /* @__PURE__ */
|
|
51
|
+
image: C
|
|
52
|
+
}), x && /* @__PURE__ */ t(A, {
|
|
53
53
|
sx: {
|
|
54
54
|
display: "grid",
|
|
55
|
-
mt: a ? -
|
|
55
|
+
mt: a ? -58 : 0,
|
|
56
56
|
placeItems: "center"
|
|
57
57
|
},
|
|
58
58
|
children: [/* @__PURE__ */ e(h, {
|
|
@@ -62,8 +62,8 @@ var v = ({ label: i, amount: o }) => /* @__PURE__ */ r(n, {
|
|
|
62
62
|
maxWidth: "none",
|
|
63
63
|
width: 262
|
|
64
64
|
} },
|
|
65
|
-
image:
|
|
66
|
-
}), /* @__PURE__ */ e(
|
|
65
|
+
image: w
|
|
66
|
+
}), /* @__PURE__ */ e(T, {
|
|
67
67
|
sx: {
|
|
68
68
|
color: "neutral.contrastText",
|
|
69
69
|
gridArea: "1 / 1",
|
|
@@ -72,15 +72,14 @@ var v = ({ label: i, amount: o }) => /* @__PURE__ */ r(n, {
|
|
|
72
72
|
children: p
|
|
73
73
|
})]
|
|
74
74
|
})]
|
|
75
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ t(n, {
|
|
76
76
|
component: "dl",
|
|
77
77
|
sx: {
|
|
78
78
|
"& > div + div": {
|
|
79
79
|
borderTop: 1,
|
|
80
80
|
borderColor: "divider"
|
|
81
81
|
},
|
|
82
|
-
|
|
83
|
-
borderColor: "divider",
|
|
82
|
+
boxShadow: (b) => `inset 0 0 0 1px ${b.palette.divider}`,
|
|
84
83
|
borderRadius: "4px",
|
|
85
84
|
m: 0,
|
|
86
85
|
width: "100%"
|
|
@@ -96,7 +95,7 @@ var v = ({ label: i, amount: o }) => /* @__PURE__ */ r(n, {
|
|
|
96
95
|
});
|
|
97
96
|
};
|
|
98
97
|
export {
|
|
99
|
-
|
|
98
|
+
O as default
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
//# sourceMappingURL=SavingsSummaryBlock.es.js.map
|
package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavingsSummaryBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport {
|
|
1
|
+
{"version":3,"file":"SavingsSummaryBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { formatWholeCurrency } from '../../../../core/utils/NumberFormatting'\nimport { ThemedSVGImage } from '../../../components/chartblocks/ThemedSVGImage'\nimport { ReactComponent as BrushStroke } from '../../../components/shared/images/SaveEnoughToLiveOnBottom.svg'\nimport { ReactComponent as CalendarGraphic } from '../../../components/shared/images/SaveEnoughToLiveOnTop.svg'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asNumber, asText, slotOrFlat } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\nimport { SAVINGS_SUMMARY_LAYOUT, savingsSummaryBlockVariant } from './layout'\n\nconst Row = ({ label, amount }: { label: string; amount: number }) => (\n <Stack\n direction=\"row\"\n sx={{ alignItems: 'center', gap: 16, justifyContent: 'space-between', minHeight: 40, px: 16 }}\n >\n <Text color=\"text.secondary\" component=\"dt\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} color=\"text.primary\" component=\"dd\" sx={{ m: 0 }} variant=\"body2\">\n {formatWholeCurrency(amount)}\n </Text>\n </Stack>\n)\n\nconst SavingsSummaryBlock = ({ payload }: BlockProps) => {\n const copy = useGlobalCopyStore().insights_feed?.make_transfer\n const balanceLabel = copy?.available_balance_text\n const spendLabel = copy?.avg_monthly_spend_text\n\n const { instance_slot = {} } = payload\n const { showCalendar } = resolveVariantConfig(\n SAVINGS_SUMMARY_LAYOUT,\n instance_slot.variant,\n savingsSummaryBlockVariant.NoIllustration,\n 'SavingsSummaryBlock',\n )\n const balance = asNumber(slotOrFlat(instance_slot, 'available_balance'))\n const spend = asNumber(slotOrFlat(instance_slot, 'avg_monthly_spend'))\n const timePeriod = asText(slotOrFlat(instance_slot, 'time_period'))\n const hasTimePeriod = !!timePeriod\n\n // Both figures need a label and a real number; never show a made-up $0.\n if (!balanceLabel || !spendLabel || balance === undefined || spend === undefined) {\n return null\n }\n\n return (\n <Stack sx={{ alignItems: 'center', gap: showCalendar ? 20 : 12, px: 16, width: '100%' }}>\n {(showCalendar || hasTimePeriod) && (\n <Stack sx={{ alignItems: 'center' }}>\n {showCalendar && (\n <ThemedSVGImage\n divProps={{ style: { maxWidth: '100%', width: 264 } }}\n image={CalendarGraphic}\n />\n )}\n {hasTimePeriod && (\n <Box sx={{ display: 'grid', mt: showCalendar ? -58 : 0, placeItems: 'center' }}>\n <ThemedSVGImage\n divProps={{\n style: { gridArea: '1 / 1', lineHeight: 0, maxWidth: 'none', width: 262 },\n }}\n image={BrushStroke}\n />\n <H2 sx={{ color: 'neutral.contrastText', gridArea: '1 / 1', textAlign: 'center' }}>\n {timePeriod}\n </H2>\n </Box>\n )}\n </Stack>\n )}\n <Stack\n component=\"dl\"\n sx={{\n '& > div + div': { borderTop: 1, borderColor: 'divider' },\n // Drawn inside, so the two 40px rows make Figma's 80px table.\n boxShadow: (theme) => `inset 0 0 0 1px ${theme.palette.divider}`,\n borderRadius: '4px',\n m: 0,\n width: '100%',\n }}\n >\n <Row amount={balance} label={balanceLabel} />\n <Row amount={spend} label={spendLabel} />\n </Stack>\n </Stack>\n )\n}\n\nexport default SavingsSummaryBlock\n"],"mappings":";;;;;;;;;;;;AAeA,IAAM,IAAA,CAAO,EAAE,OAAA,GAAO,QAAA,EAAA,MACpB,gBAAA,EAAC,GAAD;AAAA,EACE,WAAU;AAAA,EACV,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,KAAK;AAAA,IAAI,gBAAgB;AAAA,IAAiB,WAAW;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAF9F,UAAA,CAIE,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,WAAU;AAAA,IAAK,SAAQ;AAAA,IACjD,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,OAAM;AAAA,IAAe,WAAU;AAAA,IAAK,IAAI,EAAE,GAAG,EAAE;AAAA,IAAG,SAAQ;AAAA,IACzE,UAAA,EAAoB,CAAM;AAAA,EACvB,CAAA,CACD;IAGH,IAAA,CAAuB,EAAE,SAAA,EAAA,MAA0B;AACvD,QAAM,IAAO,EAAmB,EAAE,eAAe,eAC3C,IAAe,GAAM,wBACrB,IAAa,GAAM,wBAEnB,EAAE,eAAA,IAAgB,CAAC,EAAA,IAAM,GACzB,EAAE,cAAA,EAAA,IAAiB,EACvB,GACA,EAAc,SACd,EAA2B,gBAC3B,qBACF,GACM,IAAU,EAAS,EAAW,GAAe,mBAAmB,CAAC,GACjE,IAAQ,EAAS,EAAW,GAAe,m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,QAAQ,OAAA;AAAA,QACvD,cAAc;AAAA,QACd,GAAG;AAAA,QACH,OAAO;AAAA,MACT;AAAA,MATF,UAAA,CAWE,gBAAA,EAAC,GAAD;AAAA,QAAK,QAAQ;AAAA,QAAS,OAAO;AAAA,MAAe,CAAA,GAC5C,gBAAA,EAAC,GAAD;AAAA,QAAK,QAAQ;AAAA,QAAO,OAAO;AAAA,MAAa,CAAA,CACnC;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -10,8 +10,8 @@ import K, { isKnownIcon as J } from "../../../components/LogoMark.es.js";
|
|
|
10
10
|
import { logoFromRef as Q } from "../../../components/shared/EntityLogo.es.js";
|
|
11
11
|
import X from "../../../components/LogoFromGuid.es.js";
|
|
12
12
|
import { statusIconName as oo, statusIconPalette as S } from "../../../components/statusIcon.es.js";
|
|
13
|
-
import ro from "../../../components/
|
|
14
|
-
import to from "../../../components/
|
|
13
|
+
import ro from "../../../components/StatusMessageCard.es.js";
|
|
14
|
+
import to from "../../../components/TransactionListCard.es.js";
|
|
15
15
|
import { subscriptionFrequency as eo } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
16
16
|
import { getLayoutConfig as no, transactionBlockVariant as io } from "./layout.es.js";
|
|
17
17
|
import { observer as ao } from "mobx-react-lite";
|
|
@@ -83,7 +83,7 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
|
|
|
83
83
|
}) : void 0, y = !!l && _?.user_response === V.CONFIRMED;
|
|
84
84
|
if (M) {
|
|
85
85
|
const r = a(n, "message");
|
|
86
|
-
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(
|
|
86
|
+
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(ro, {
|
|
87
87
|
icon: /* @__PURE__ */ t(g, {
|
|
88
88
|
"aria-hidden": "true",
|
|
89
89
|
sx: { display: "flex" },
|
|
@@ -105,7 +105,7 @@ var c = 32, mo = Math.round(c * 0.625), uo = 24, T = 32, lo = 20, go = ({ icon:
|
|
|
105
105
|
label: b,
|
|
106
106
|
amount: C(Z, x.cents)
|
|
107
107
|
} : void 0, j = p ? eo(o, _) : void 0, q = l ? /* @__PURE__ */ t(go, { icon: I(a(n, y ? "reviewed_icon" : "icon")) }) : void 0, v = (r) => !!O && typeof r == "number" && r > 0;
|
|
108
|
-
return /* @__PURE__ */ t(
|
|
108
|
+
return /* @__PURE__ */ t(to, {
|
|
109
109
|
background: y && f ? f : u,
|
|
110
110
|
badge: q,
|
|
111
111
|
elevated: A,
|
|
@@ -2,7 +2,6 @@ export * from './blocks';
|
|
|
2
2
|
export { default as AccountHeroCard } from './components/AccountHeroCard';
|
|
3
3
|
export { default as ConnectionDetailDrillDown, type ConnectionDetailContent, } from './components/ConnectionDetailDrillDown';
|
|
4
4
|
export { default as DirectDepositCard, type DirectDepositCardStyleProps, type DirectDepositPillConfig, } from './components/DirectDepositCard';
|
|
5
|
-
export { default as DebtPayoffCard, type DebtPayoffCardStyleProps, type DebtPayoffPillConfig, type DebtPayoffStat, } from './components/DebtPayoffCard';
|
|
6
5
|
export { default as GoalProgressCard, type GoalProgressCardStyleProps, type GoalProgressPillConfig, type GoalProgressRow, } from './components/GoalProgressCard';
|
|
7
6
|
export { default as AmountPill } from './components/AmountPill';
|
|
8
7
|
export { default as AmountBreakdownCard, type AmountBreakdownCardProps, type AmountBreakdownRow, type AmountBreakdownTotal, } from './components/AmountBreakdownCard';
|