@mx-cartographer/experiences 9.6.11 → 9.6.13
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 +16 -0
- package/dist/core/stores/InsightsV2Store.d.ts +1 -1
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +24 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +21 -21
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +38 -38
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +27 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +14 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +5 -5
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.d.ts +6 -2
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js +7 -4
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +63 -61
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +59 -38
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/util.d.ts +6 -5
- package/dist/insights-v2/actionBlocks/util.es.js +3 -3
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +57 -55
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.d.ts +4 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +54 -23
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +14 -10
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +119 -99
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +34 -24
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +2 -2
- package/dist/insights-v2/components/LogoFromGuid.es.js +44 -32
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
- package/dist/insights-v2/components/SubHeader.es.js +3 -2
- package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +4 -4
- package/dist/insights-v2/components/shared/EntityLogo.es.js +31 -21
- package/dist/insights-v2/components/shared/EntityLogo.es.js.map +1 -1
- package/dist/insights-v2/components/shared/images/FeeDetected.es.js +243 -0
- package/dist/insights-v2/components/shared/images/FeeDetected.es.js.map +1 -0
- package/dist/insights-v2/components/statusIcon.d.ts +7 -0
- package/dist/insights-v2/components/statusIcon.es.js +10 -0
- package/dist/insights-v2/components/statusIcon.es.js.map +1 -0
- package/dist/microinsights/cards/InsightCard.es.js +78 -73
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ReactComponent as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { slot as m } from "../../../../core/types/Insights.es.js";
|
|
2
|
+
import { formatCurrency as R } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import { useContainerDimensions as L } from "../../../hooks/useContainerDimensions.es.js";
|
|
4
|
+
import { DepositLogo as $ } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
5
|
+
import { Confetti as B } from "../../../components/shared/Confetti.es.js";
|
|
6
|
+
import { ReactComponent as G } from "../../../components/shared/images/PaidOffCard.es.js";
|
|
7
|
+
import { ReactComponent as N } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
|
|
8
|
+
import { resolveVariantConfig as P } from "../../resolveVariantConfig.es.js";
|
|
9
|
+
import { HeaderComponent as V } from "./HeaderComponent.es.js";
|
|
10
|
+
import { getLayoutConfig as j } from "./layout.es.js";
|
|
11
|
+
import { IconComponent as A } from "./IconComponent.es.js";
|
|
12
|
+
import { useRef as F } from "react";
|
|
12
13
|
import t from "@mui/material/Stack";
|
|
13
|
-
import { Text as
|
|
14
|
-
import { Icon as
|
|
14
|
+
import { Text as s } from "@mxenabled/mxui";
|
|
15
|
+
import { Icon as E } from "@mxenabled/mx-icons";
|
|
15
16
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
16
|
-
import { useTheme as
|
|
17
|
+
import { useTheme as H } from "@mui/material/styles";
|
|
17
18
|
import i from "@mui/material/Box";
|
|
18
|
-
var
|
|
19
|
+
var O = {
|
|
19
20
|
deposit_received: "payments",
|
|
20
21
|
status_on_track: "monetization_on"
|
|
21
|
-
},
|
|
22
|
-
const
|
|
22
|
+
}, co = ({ payload: _ }) => {
|
|
23
|
+
const C = H(), p = F(null), { height: u, width: h } = L(p), { instance_slot: n } = _, { variant: c, header_text: a, institution_guid: f, institution_name: g, icon_name: k, label: T, merchant_guid: I, merchant_name: x, category_guid: S } = n, { data: d } = n, l = m(d, "amount") ?? n.amount, b = m(d, "sub_text") ?? n.sub_text, y = m(d, "logo"), e = P(j(C), c, "default", "AccountBlock");
|
|
23
24
|
if (e?.isConfetti) {
|
|
24
|
-
const
|
|
25
|
+
const D = {
|
|
25
26
|
paidOffCard: /* @__PURE__ */ o(i, {
|
|
26
27
|
sx: {
|
|
27
28
|
flexShrink: 0,
|
|
@@ -29,7 +30,7 @@ var F = {
|
|
|
29
30
|
position: "relative",
|
|
30
31
|
width: 44
|
|
31
32
|
},
|
|
32
|
-
children: /* @__PURE__ */ o(
|
|
33
|
+
children: /* @__PURE__ */ o(G, {
|
|
33
34
|
"aria-hidden": !0,
|
|
34
35
|
role: "presentation",
|
|
35
36
|
style: {
|
|
@@ -39,7 +40,7 @@ var F = {
|
|
|
39
40
|
}
|
|
40
41
|
})
|
|
41
42
|
}),
|
|
42
|
-
savings: /* @__PURE__ */ o(
|
|
43
|
+
savings: /* @__PURE__ */ o(N, {
|
|
43
44
|
"aria-hidden": !0,
|
|
44
45
|
height: 55,
|
|
45
46
|
role: "presentation",
|
|
@@ -53,27 +54,27 @@ var F = {
|
|
|
53
54
|
overflow: "hidden",
|
|
54
55
|
width: 48
|
|
55
56
|
},
|
|
56
|
-
children: /* @__PURE__ */ o(
|
|
57
|
-
categoryGuid:
|
|
58
|
-
iconName:
|
|
59
|
-
institutionGuid:
|
|
60
|
-
institutionName:
|
|
61
|
-
merchantGuid:
|
|
62
|
-
merchantName:
|
|
57
|
+
children: /* @__PURE__ */ o($, {
|
|
58
|
+
categoryGuid: S,
|
|
59
|
+
iconName: O[c] ?? "payments",
|
|
60
|
+
institutionGuid: f,
|
|
61
|
+
institutionName: g,
|
|
62
|
+
merchantGuid: I,
|
|
63
|
+
merchantName: x
|
|
63
64
|
})
|
|
64
65
|
})
|
|
65
|
-
}[e.graphic ?? "logo"],
|
|
66
|
+
}[e.graphic ?? "logo"], v = e.secondarySource === "merchant" ? x ?? g : T, w = v ? /* @__PURE__ */ o(s, {
|
|
66
67
|
color: e.secondaryColor,
|
|
67
68
|
variant: e.secondaryVariant,
|
|
68
|
-
children:
|
|
69
|
-
}) : null,
|
|
69
|
+
children: v
|
|
70
|
+
}) : null, z = /* @__PURE__ */ o(s, {
|
|
70
71
|
bold: !0,
|
|
71
72
|
color: "success.dark",
|
|
72
73
|
variant: e.amountVariant,
|
|
73
|
-
children: `${e.amountPrefix ?? ""}${
|
|
74
|
+
children: `${e.amountPrefix ?? ""}${R(l, "0,0.00")}`
|
|
74
75
|
});
|
|
75
76
|
return /* @__PURE__ */ r(i, {
|
|
76
|
-
ref:
|
|
77
|
+
ref: p,
|
|
77
78
|
sx: {
|
|
78
79
|
backgroundImage: e.gradient,
|
|
79
80
|
bgcolor: "background.paper",
|
|
@@ -89,10 +90,10 @@ var F = {
|
|
|
89
90
|
position: "absolute",
|
|
90
91
|
zIndex: 1
|
|
91
92
|
},
|
|
92
|
-
children: /* @__PURE__ */ o(
|
|
93
|
-
height:
|
|
94
|
-
shouldRun:
|
|
95
|
-
width:
|
|
93
|
+
children: /* @__PURE__ */ o(B, {
|
|
94
|
+
height: u,
|
|
95
|
+
shouldRun: u > 0 && h > 0,
|
|
96
|
+
width: h
|
|
96
97
|
})
|
|
97
98
|
}), /* @__PURE__ */ r(t, {
|
|
98
99
|
sx: {
|
|
@@ -102,16 +103,16 @@ var F = {
|
|
|
102
103
|
width: "100%",
|
|
103
104
|
zIndex: 2
|
|
104
105
|
},
|
|
105
|
-
children: [e.categoryStrip &&
|
|
106
|
+
children: [e.categoryStrip && a && /* @__PURE__ */ o(i, {
|
|
106
107
|
sx: {
|
|
107
108
|
bgcolor: "success.main",
|
|
108
109
|
px: 12,
|
|
109
110
|
py: 4
|
|
110
111
|
},
|
|
111
|
-
children: /* @__PURE__ */ o(
|
|
112
|
+
children: /* @__PURE__ */ o(s, {
|
|
112
113
|
color: "success.contrastText",
|
|
113
114
|
variant: "caption",
|
|
114
|
-
children:
|
|
115
|
+
children: a
|
|
115
116
|
})
|
|
116
117
|
}), /* @__PURE__ */ r(t, {
|
|
117
118
|
sx: {
|
|
@@ -133,16 +134,16 @@ var F = {
|
|
|
133
134
|
display: "flex",
|
|
134
135
|
flexShrink: 0
|
|
135
136
|
},
|
|
136
|
-
children:
|
|
137
|
+
children: D
|
|
137
138
|
}), /* @__PURE__ */ r(t, {
|
|
138
139
|
sx: {
|
|
139
140
|
flex: "1 0 0",
|
|
140
141
|
minWidth: 0
|
|
141
142
|
},
|
|
142
143
|
children: [
|
|
143
|
-
e.secondaryPosition === "above" &&
|
|
144
|
-
|
|
145
|
-
e.secondaryPosition === "below" &&
|
|
144
|
+
e.secondaryPosition === "above" && w,
|
|
145
|
+
z,
|
|
146
|
+
e.secondaryPosition === "below" && w
|
|
146
147
|
]
|
|
147
148
|
})]
|
|
148
149
|
})]
|
|
@@ -154,47 +155,48 @@ var F = {
|
|
|
154
155
|
p: 16,
|
|
155
156
|
...e
|
|
156
157
|
},
|
|
157
|
-
children: [
|
|
158
|
+
children: [a && /* @__PURE__ */ o(V, { headerText: a }), /* @__PURE__ */ r(t, {
|
|
158
159
|
sx: {
|
|
159
160
|
alignItems: "center",
|
|
160
161
|
bgcolor: "background.paper",
|
|
161
162
|
borderRadius: "8px",
|
|
162
|
-
...
|
|
163
|
+
...a && {
|
|
163
164
|
borderTopLeftRadius: "0",
|
|
164
165
|
borderTopRightRadius: "0"
|
|
165
166
|
},
|
|
166
167
|
gap: 16,
|
|
167
168
|
p: 16,
|
|
168
169
|
width: "100%",
|
|
169
|
-
...(
|
|
170
|
+
...(f || k || y?.guid) && { flexDirection: "row" }
|
|
170
171
|
},
|
|
171
|
-
children: [/* @__PURE__ */ o(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
children: [/* @__PURE__ */ o(A, {
|
|
173
|
+
logo: y,
|
|
174
|
+
slot: n,
|
|
175
|
+
variant: c
|
|
176
|
+
}), /* @__PURE__ */ r(t, { children: [l != null && /* @__PURE__ */ o(s, {
|
|
175
177
|
variant: "h1",
|
|
176
|
-
children:
|
|
178
|
+
children: R(l, "0,0.00")
|
|
177
179
|
}), /* @__PURE__ */ r(t, {
|
|
178
180
|
sx: {
|
|
179
181
|
gap: 8,
|
|
180
182
|
flexDirection: "row",
|
|
181
183
|
alignItems: "center"
|
|
182
184
|
},
|
|
183
|
-
children: [e?.sub_logo && /* @__PURE__ */ o(
|
|
185
|
+
children: [e?.sub_logo && /* @__PURE__ */ o(E, {
|
|
184
186
|
color: "warning",
|
|
185
187
|
fill: !0,
|
|
186
188
|
name: e.sub_logo,
|
|
187
189
|
size: 20
|
|
188
|
-
}), /* @__PURE__ */ o(
|
|
190
|
+
}), b && /* @__PURE__ */ o(s, {
|
|
189
191
|
variant: "body2",
|
|
190
|
-
children:
|
|
192
|
+
children: b
|
|
191
193
|
})]
|
|
192
194
|
})] })]
|
|
193
195
|
})]
|
|
194
196
|
});
|
|
195
197
|
};
|
|
196
198
|
export {
|
|
197
|
-
|
|
199
|
+
co as default
|
|
198
200
|
};
|
|
199
201
|
|
|
200
202
|
//# sourceMappingURL=AccountBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport type { InsightsPayload } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { DepositLogo } from '../../../components/ComponentBlocks/DepositLogo'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\n/** Default generic-tile icon per deposit variant, used when no merchant/institution logo. */\nconst depositIcons: Record<string, string> = {\n deposit_received: 'payments',\n status_on_track: 'monetization_on',\n}\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const {\n variant,\n amount,\n sub_text,\n header_text,\n institution_guid,\n institution_name,\n icon_name,\n label,\n merchant_guid,\n merchant_name,\n category_guid,\n } = instance_slot\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n <DepositLogo\n categoryGuid={category_guid}\n iconName={depositIcons[variant as keyof typeof depositIcons] ?? 'payments'}\n institutionGuid={institution_guid}\n institutionName={institution_name}\n merchantGuid={merchant_guid}\n merchantName={merchant_name}\n />\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n const secondaryText =\n layoutConfig.secondarySource === 'merchant' ? (merchant_name ?? institution_name) : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n const amountText = (\n <Text bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\n </Text>\n )\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n p: 16,\n ...layoutConfig,\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n gap: 16,\n p: 16,\n width: '100%',\n ...((institution_guid || icon_name) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent slot={instance_slot} variant={variant} />\n\n <Stack>\n <Text variant=\"h1\">{formatCurrency(amount, '0,0.00')}</Text>\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig?.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n <Text variant=\"body2\">{sub_text}</Text>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,IAAM,IAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,GAEM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACvD,EAAE,eAAA,EAAA,IAAkB,GACpB,EACJ,SAAA,GACA,QAAA,GACA,UAAA,GACA,aAAA,GACA,kBAAA,GACA,kBAAA,GACA,WAAA,GACA,OAAA,GACA,eAAA,GACA,eAAA,GACA,eAAA,EAAA,IACE,GACE,IAAe,EACnB,EAAgB,C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AA,CACG,GAAc,YACb,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,MAAM;AAAA,UAAM,MAAM,EAAa;AAAA,UAAU,MAAM;AAAA,QAAK,CAAA,GAE5E,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAS,UAAA;AAAA,QAAe,CAAA,CACjC;AAAA,MACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
1
|
+
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { DepositLogo } from '../../../components/ComponentBlocks/DepositLogo'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\n/** Default generic-tile icon per deposit variant, used when no merchant/institution logo. */\nconst depositIcons: Record<string, string> = {\n deposit_received: 'payments',\n status_on_track: 'monetization_on',\n}\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const {\n variant,\n header_text,\n institution_guid,\n institution_name,\n icon_name,\n label,\n merchant_guid,\n merchant_name,\n category_guid,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots); the rest still send the\n // flat legacy fields, so each value falls back to its flat field.\n const { data } = instance_slot\n const amount = slot<number>(data, 'amount') ?? instance_slot.amount\n const sub_text = slot<string>(data, 'sub_text') ?? instance_slot.sub_text\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n <DepositLogo\n categoryGuid={category_guid}\n iconName={depositIcons[variant as keyof typeof depositIcons] ?? 'payments'}\n institutionGuid={institution_guid}\n institutionName={institution_name}\n merchantGuid={merchant_guid}\n merchantName={merchant_name}\n />\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n const secondaryText =\n layoutConfig.secondarySource === 'merchant' ? (merchant_name ?? institution_name) : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n const amountText = (\n <Text bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\n </Text>\n )\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n p: 16,\n ...layoutConfig,\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n gap: 16,\n p: 16,\n width: '100%',\n ...((institution_guid || icon_name || logo?.guid) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent logo={logo} slot={instance_slot} variant={variant} />\n\n <Stack>\n {amount != null && <Text variant=\"h1\">{formatCurrency(amount, '0,0.00')}</Text>}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig?.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && <Text variant=\"body2\">{sub_text}</Text>}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAM,IAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,GAEM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACvD,EAAE,eAAA,EAAA,IAAkB,GACpB,EACJ,SAAA,GACA,aAAA,GACA,kBAAA,GACA,kBAAA,GACA,WAAA,GACA,OAAA,GACA,eAAA,GACA,eAAA,GACA,eAAA,EAAA,IACE,GAGE,EAAE,MAAA,EAAA,IAAS,GACX,IAAS,EAAa,GAAM,QAAQ,KAAK,EAAc,QACvD,IAAW,EAAa,GAAM,UAAU,KAAK,EAAc,UAC3D,IAAO,EAAc,GAAM,MAAM,GACjC,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAIA,MAAI,GAAc,YAAY;AAmC5B,UAAM,IAAU;AAAA,MAjCd,aAGE,gBAAA,EAAC,GAAD;AAAA,QAAK,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,QAAQ;AAAA,UAAI,UAAU;AAAA,UAAY,OAAO;AAAA,QAAG;AAAA,QACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,eAAa;AAAA,UACb,MAAK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ACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { InstanceSlot } from '../../../../core';
|
|
1
|
+
import { InstanceSlot, LogoRef } from '../../../../core';
|
|
2
2
|
interface IconComponentProps {
|
|
3
3
|
slot: InstanceSlot;
|
|
4
4
|
variant?: string | null;
|
|
5
|
+
/** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */
|
|
6
|
+
logo?: LogoRef;
|
|
5
7
|
}
|
|
6
|
-
export declare const IconComponent: ({ slot, variant }: IconComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare const IconComponent: ({ slot, variant, logo }: IconComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
9
|
export {};
|
|
@@ -1,31 +1,62 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "../../../../common/components/IconBacking.es.js";
|
|
2
|
+
import a from "../../../components/LogoFromGuid.es.js";
|
|
2
3
|
import { resolveVariantConfig as m } from "../../resolveVariantConfig.es.js";
|
|
3
|
-
import { getLayoutConfig as
|
|
4
|
-
import { InstitutionLogo as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import { Stack as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
return
|
|
4
|
+
import { getLayoutConfig as u } from "./layout.es.js";
|
|
5
|
+
import { InstitutionLogo as g } from "@mxenabled/mxui";
|
|
6
|
+
import { Icon as e } from "@mxenabled/mx-icons";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { useTheme as f } from "@mui/material/styles";
|
|
9
|
+
import { Stack as t } from "@mui/material";
|
|
10
|
+
var k = ({ slot: i, variant: c, logo: n }) => {
|
|
11
|
+
const d = f(), r = m(u(d), c, "default", "AccountBlock");
|
|
12
|
+
return /^INS-[A-Za-z0-9-]+$/.test(n?.guid ?? "") ? /* @__PURE__ */ s(t, {
|
|
12
13
|
sx: {
|
|
13
14
|
alignItems: "center",
|
|
14
15
|
flexDirection: "row",
|
|
15
16
|
position: "relative"
|
|
16
17
|
},
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
institutionGuid: `${o.institution_guid}`,
|
|
18
|
+
children: [/* @__PURE__ */ o(a, {
|
|
19
|
+
logo: n,
|
|
20
20
|
size: 48
|
|
21
|
-
}), /* @__PURE__ */
|
|
21
|
+
}), r.badge && /* @__PURE__ */ o(l, {
|
|
22
22
|
size: 20,
|
|
23
23
|
sx: {
|
|
24
24
|
position: "absolute",
|
|
25
25
|
right: -8,
|
|
26
26
|
top: -8
|
|
27
27
|
},
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ o(e, {
|
|
29
|
+
"aria-hidden": !0,
|
|
30
|
+
color: "error",
|
|
31
|
+
"data-testid": "account-block-error-badge",
|
|
32
|
+
fill: !0,
|
|
33
|
+
name: r.badge,
|
|
34
|
+
size: 20,
|
|
35
|
+
sx: {
|
|
36
|
+
gridColumn: 1,
|
|
37
|
+
gridRow: 1,
|
|
38
|
+
zIndex: 2
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
})]
|
|
42
|
+
}) : i.institution_guid ? /* @__PURE__ */ s(t, {
|
|
43
|
+
sx: {
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
flexDirection: "row",
|
|
46
|
+
position: "relative"
|
|
47
|
+
},
|
|
48
|
+
children: [/* @__PURE__ */ o(g, {
|
|
49
|
+
alt: `${i.institution_name}`,
|
|
50
|
+
institutionGuid: `${i.institution_guid}`,
|
|
51
|
+
size: 48
|
|
52
|
+
}), /* @__PURE__ */ o(l, {
|
|
53
|
+
size: 20,
|
|
54
|
+
sx: {
|
|
55
|
+
position: "absolute",
|
|
56
|
+
right: -8,
|
|
57
|
+
top: -8
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ o(e, {
|
|
29
60
|
color: "error",
|
|
30
61
|
fill: !0,
|
|
31
62
|
name: "error",
|
|
@@ -37,29 +68,29 @@ var C = ({ slot: o, variant: n }) => {
|
|
|
37
68
|
}
|
|
38
69
|
})
|
|
39
70
|
})]
|
|
40
|
-
}) :
|
|
71
|
+
}) : i.icon_name ? /* @__PURE__ */ o(t, {
|
|
41
72
|
sx: {
|
|
42
73
|
alignItems: "center",
|
|
43
|
-
bgcolor:
|
|
74
|
+
bgcolor: r.logo_bGcolor,
|
|
44
75
|
borderRadius: "6px",
|
|
45
76
|
height: 48,
|
|
46
77
|
justifyContent: "center",
|
|
47
78
|
width: 48,
|
|
48
|
-
...
|
|
49
|
-
borderColor:
|
|
79
|
+
...r.logo_border_color && {
|
|
80
|
+
borderColor: r.logo_border_color,
|
|
50
81
|
borderStyle: "solid",
|
|
51
82
|
borderWidth: 1.5
|
|
52
83
|
}
|
|
53
84
|
},
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
name:
|
|
85
|
+
children: /* @__PURE__ */ o(e, {
|
|
86
|
+
name: i.icon_name,
|
|
56
87
|
size: 24,
|
|
57
|
-
sx: { color:
|
|
88
|
+
sx: { color: r.logo_color }
|
|
58
89
|
})
|
|
59
90
|
}) : null;
|
|
60
91
|
};
|
|
61
92
|
export {
|
|
62
|
-
|
|
93
|
+
k as IconComponent
|
|
63
94
|
};
|
|
64
95
|
|
|
65
96
|
//# sourceMappingURL=IconComponent.es.js.map
|
|
@@ -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 } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot } from '../../../../core'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n}\n\nexport const IconComponent = ({ slot, variant }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\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 if (slot.icon_name) {\n return (\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: '6px',\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 name={slot.icon_name}\n size={24}\n sx={{\n color: layoutConfig.logo_color,\n }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":"
|
|
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 } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\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 if (slot.icon_name) {\n return (\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: '6px',\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 name={slot.icon_name}\n size={24}\n sx={{\n color: layoutConfig.logo_color,\n }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;AAiBA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pE,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,OAIP,EAAK,YAEL,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc;AAAA,MACd,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,MAAM,EAAK;AAAA,MACX,MAAM;AAAA,MACN,IAAI,EACF,OAAO,EAAa,WACtB;AAAA,IACD,CAAA;AAAA,EACI,CAAA,IAIJ;AACT"}
|
|
@@ -6,6 +6,8 @@ export interface BlockLayoutConfig {
|
|
|
6
6
|
logo_border_color?: string;
|
|
7
7
|
/** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */
|
|
8
8
|
sub_logo?: string;
|
|
9
|
+
/** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */
|
|
10
|
+
badge?: string;
|
|
9
11
|
/** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */
|
|
10
12
|
isConfetti?: boolean;
|
|
11
13
|
/** Gradient wash layered over `background.paper` for the confetti card. */
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { CELEBRATION_GRADIENT as
|
|
2
|
-
import { alpha as
|
|
3
|
-
var
|
|
1
|
+
import { CELEBRATION_GRADIENT as a, WARM_LIME_ACCENT_GRADIENT as o } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
import { alpha as t } from "@mui/material/styles";
|
|
3
|
+
var e = { background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)" }, g = (r) => ({
|
|
4
4
|
overdraft_warning: {
|
|
5
5
|
background: r.palette.warning.light,
|
|
6
6
|
sub_logo: "error"
|
|
7
7
|
},
|
|
8
|
-
low_balance_alert:
|
|
8
|
+
low_balance_alert: e,
|
|
9
|
+
low_balance: {
|
|
10
|
+
...e,
|
|
11
|
+
badge: "error"
|
|
12
|
+
},
|
|
9
13
|
status_off_track: {
|
|
10
14
|
logo_color: "background.paper",
|
|
11
15
|
logo_bGcolor: "error.main",
|
|
@@ -13,13 +17,13 @@ var i = (r) => ({
|
|
|
13
17
|
},
|
|
14
18
|
interest_charges_summary: {
|
|
15
19
|
logo_color: "text.primary",
|
|
16
|
-
logo_bGcolor:
|
|
20
|
+
logo_bGcolor: t(r.palette.categories?.feesCharges || "", 0.25),
|
|
17
21
|
logo_border_color: "categories.feesCharges",
|
|
18
22
|
background: "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)"
|
|
19
23
|
},
|
|
20
24
|
deposit_received: {
|
|
21
25
|
isConfetti: !0,
|
|
22
|
-
gradient:
|
|
26
|
+
gradient: o,
|
|
23
27
|
graphic: "logo",
|
|
24
28
|
amountVariant: "h3",
|
|
25
29
|
amountPrefix: "+",
|
|
@@ -35,7 +39,7 @@ var i = (r) => ({
|
|
|
35
39
|
},
|
|
36
40
|
status_on_track: {
|
|
37
41
|
isConfetti: !0,
|
|
38
|
-
gradient:
|
|
42
|
+
gradient: o,
|
|
39
43
|
graphic: "logo",
|
|
40
44
|
amountVariant: "h2",
|
|
41
45
|
rowSx: {
|
|
@@ -49,7 +53,7 @@ var i = (r) => ({
|
|
|
49
53
|
},
|
|
50
54
|
payoff_celebration: {
|
|
51
55
|
isConfetti: !0,
|
|
52
|
-
gradient:
|
|
56
|
+
gradient: a,
|
|
53
57
|
graphic: "paidOffCard",
|
|
54
58
|
amountVariant: "h2",
|
|
55
59
|
rowSx: {
|
|
@@ -64,7 +68,7 @@ var i = (r) => ({
|
|
|
64
68
|
},
|
|
65
69
|
savings_deposit: {
|
|
66
70
|
isConfetti: !0,
|
|
67
|
-
gradient:
|
|
71
|
+
gradient: a,
|
|
68
72
|
graphic: "savings",
|
|
69
73
|
amountVariant: "h2",
|
|
70
74
|
rowSx: {
|
|
@@ -79,7 +83,7 @@ var i = (r) => ({
|
|
|
79
83
|
default: {}
|
|
80
84
|
});
|
|
81
85
|
export {
|
|
82
|
-
|
|
86
|
+
g as getLayoutConfig
|
|
83
87
|
};
|
|
84
88
|
|
|
85
89
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -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 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 /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: 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 /** 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\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:
|
|
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 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 /** 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 /** 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// 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:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\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 background:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\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 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":";;AA0CA,IAAM,IAAsC,EAC1C,YACE,0FACJ,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,IACd,YACE;AAAA,EACJ;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,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IAC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