@mx-cartographer/experiences 9.7.183 → 9.7.184
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/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +27 -27
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +46 -28
- 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 +13 -16
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +28 -27
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [9.7.184] - 11-18-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Monthly Credit Card Interest Summary V2 card: charges tile, institution micro logo and its Storybook QA page (WEC-2336)
|
|
4
|
+
- **CHANGED** - AccountBlock: `charges_summary` replaces `interest_charges_summary`; its category icon draws the top-level category on a 25% tinted tile, per Figma (WEC-2336)
|
|
5
|
+
|
|
1
6
|
## [9.7.183] - 11-17-2026
|
|
2
7
|
|
|
3
8
|
- **FIXED** - pending transactions in transaction lists match the legacy widget (WELL-133)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { slot as
|
|
1
|
+
import { slot as s } from "../../../../core/types/Insights.es.js";
|
|
2
2
|
import { CURRENCY_FORMAT as T, formatCurrency as k } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
-
import { resolveVariantConfig as
|
|
4
|
-
import { asLogoRef as
|
|
3
|
+
import { resolveVariantConfig as j } from "../../resolveVariantConfig.es.js";
|
|
4
|
+
import { asLogoRef as I, asNumber as N, asText as x } from "../../slotReaders.es.js";
|
|
5
5
|
import { useContainerDimensions as P } from "../../../hooks/useContainerDimensions.es.js";
|
|
6
6
|
import E from "../../../components/LogoFromGuid.es.js";
|
|
7
7
|
import { Confetti as O } from "../../../components/shared/Confetti.es.js";
|
|
@@ -16,17 +16,17 @@ import { IconComponent as q } from "./IconComponent.es.js";
|
|
|
16
16
|
import { useRef as J } from "react";
|
|
17
17
|
import t from "@mui/material/Stack";
|
|
18
18
|
import { Text as l } from "@mxenabled/mxui";
|
|
19
|
-
import { Icon as
|
|
19
|
+
import { Icon as S } from "@mxenabled/mx-icons";
|
|
20
20
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
21
21
|
import { useTheme as Q } from "@mui/material/styles";
|
|
22
|
-
import
|
|
22
|
+
import a from "@mui/material/Box";
|
|
23
23
|
var vo = ({ payload: g }) => {
|
|
24
|
-
const h = Q(), b = J(null), { height: w, width: R } = P(b), { instance_slot: n } = g, { variant: p, institution_guid:
|
|
24
|
+
const h = Q(), b = J(null), { height: w, width: R } = P(b), { instance_slot: n } = g, { variant: p, institution_guid: z, institution_name: D, icon_name: A, merchant_name: L } = n;
|
|
25
25
|
if (K(p)) return /* @__PURE__ */ o(M, { payload: g });
|
|
26
|
-
const { data: i } = n, m = i !== void 0, u = m ? N(
|
|
26
|
+
const { data: i } = n, m = i !== void 0, u = m ? N(s(i, "amount")) : n.amount, v = x(s(i, "sub_text")), y = m ? v : n.sub_text, V = m ? v : n.label, c = m ? x(s(i, "header_text")) : n.header_text, d = I(s(i, "logo")) ?? I(s(i, "icon")), e = j(Y(h), p, "default", "AccountBlock");
|
|
27
27
|
if (e?.isConfetti) {
|
|
28
|
-
const f = H(
|
|
29
|
-
paidOffCard: /* @__PURE__ */ o(
|
|
28
|
+
const f = H(d?.guid), B = {
|
|
29
|
+
paidOffCard: /* @__PURE__ */ o(a, {
|
|
30
30
|
sx: {
|
|
31
31
|
flexShrink: 0,
|
|
32
32
|
height: 32,
|
|
@@ -49,7 +49,7 @@ var vo = ({ payload: g }) => {
|
|
|
49
49
|
role: "presentation",
|
|
50
50
|
width: 55
|
|
51
51
|
}),
|
|
52
|
-
logo: /* @__PURE__ */ o(
|
|
52
|
+
logo: /* @__PURE__ */ o(a, {
|
|
53
53
|
sx: {
|
|
54
54
|
borderRadius: "4px",
|
|
55
55
|
flexShrink: 0,
|
|
@@ -66,28 +66,28 @@ var vo = ({ payload: g }) => {
|
|
|
66
66
|
justifyContent: "center",
|
|
67
67
|
width: "100%"
|
|
68
68
|
},
|
|
69
|
-
children: /* @__PURE__ */ o(
|
|
69
|
+
children: /* @__PURE__ */ o(S, {
|
|
70
70
|
"aria-hidden": !0,
|
|
71
71
|
name: f,
|
|
72
72
|
size: e.logo_icon_size ?? 24,
|
|
73
73
|
sx: { color: "success.contrastText" }
|
|
74
74
|
})
|
|
75
|
-
}) :
|
|
76
|
-
logo:
|
|
75
|
+
}) : d?.guid ? /* @__PURE__ */ o(E, {
|
|
76
|
+
logo: d,
|
|
77
77
|
size: 48
|
|
78
78
|
}) : null
|
|
79
79
|
})
|
|
80
|
-
}[e.graphic ?? "logo"],
|
|
80
|
+
}[e.graphic ?? "logo"], F = x(s(i, "secondary_text")) || (L ?? D), C = e.secondarySource === "merchant" ? F : V, _ = C ? /* @__PURE__ */ o(l, {
|
|
81
81
|
color: e.secondaryColor,
|
|
82
82
|
variant: e.secondaryVariant,
|
|
83
83
|
children: C
|
|
84
|
-
}) : null,
|
|
84
|
+
}) : null, $ = u != null ? /* @__PURE__ */ o(l, {
|
|
85
85
|
bold: !e.amountKeepsVariantWeight,
|
|
86
86
|
color: "success.dark",
|
|
87
87
|
variant: e.amountVariant,
|
|
88
88
|
children: `${e.amountPrefix ?? ""}${k(u, T.cents)}`
|
|
89
89
|
}) : null;
|
|
90
|
-
return /* @__PURE__ */ r(
|
|
90
|
+
return /* @__PURE__ */ r(a, {
|
|
91
91
|
ref: b,
|
|
92
92
|
sx: {
|
|
93
93
|
backgroundImage: e.gradient,
|
|
@@ -97,7 +97,7 @@ var vo = ({ payload: g }) => {
|
|
|
97
97
|
p: 16,
|
|
98
98
|
width: "100%"
|
|
99
99
|
},
|
|
100
|
-
children: [/* @__PURE__ */ o(
|
|
100
|
+
children: [/* @__PURE__ */ o(a, {
|
|
101
101
|
sx: {
|
|
102
102
|
inset: 0,
|
|
103
103
|
pointerEvents: "none",
|
|
@@ -118,7 +118,7 @@ var vo = ({ payload: g }) => {
|
|
|
118
118
|
width: "100%",
|
|
119
119
|
zIndex: 2
|
|
120
120
|
},
|
|
121
|
-
children: [e.categoryStrip &&
|
|
121
|
+
children: [e.categoryStrip && c && /* @__PURE__ */ o(a, {
|
|
122
122
|
sx: {
|
|
123
123
|
bgcolor: "success.main",
|
|
124
124
|
px: 12,
|
|
@@ -127,7 +127,7 @@ var vo = ({ payload: g }) => {
|
|
|
127
127
|
children: /* @__PURE__ */ o(l, {
|
|
128
128
|
color: "success.contrastText",
|
|
129
129
|
variant: "caption",
|
|
130
|
-
children:
|
|
130
|
+
children: c
|
|
131
131
|
})
|
|
132
132
|
}), /* @__PURE__ */ r(t, {
|
|
133
133
|
sx: {
|
|
@@ -144,12 +144,12 @@ var vo = ({ payload: g }) => {
|
|
|
144
144
|
flexDirection: "row",
|
|
145
145
|
...e.rowSx
|
|
146
146
|
},
|
|
147
|
-
children: [/* @__PURE__ */ o(
|
|
147
|
+
children: [/* @__PURE__ */ o(a, {
|
|
148
148
|
sx: {
|
|
149
149
|
display: "flex",
|
|
150
150
|
flexShrink: 0
|
|
151
151
|
},
|
|
152
|
-
children:
|
|
152
|
+
children: B
|
|
153
153
|
}), /* @__PURE__ */ r(t, {
|
|
154
154
|
sx: {
|
|
155
155
|
flex: "1 0 0",
|
|
@@ -157,7 +157,7 @@ var vo = ({ payload: g }) => {
|
|
|
157
157
|
},
|
|
158
158
|
children: [
|
|
159
159
|
e.secondaryPosition === "above" && _,
|
|
160
|
-
|
|
160
|
+
$,
|
|
161
161
|
e.secondaryPosition === "below" && _
|
|
162
162
|
]
|
|
163
163
|
})]
|
|
@@ -176,7 +176,7 @@ var vo = ({ payload: g }) => {
|
|
|
176
176
|
boxShadow: h.shadows[1],
|
|
177
177
|
width: "100%"
|
|
178
178
|
},
|
|
179
|
-
children: [
|
|
179
|
+
children: [c && /* @__PURE__ */ o(U, { headerText: c }), /* @__PURE__ */ r(t, {
|
|
180
180
|
sx: {
|
|
181
181
|
alignItems: "center",
|
|
182
182
|
bgcolor: "background.paper",
|
|
@@ -184,14 +184,14 @@ var vo = ({ payload: g }) => {
|
|
|
184
184
|
gap: 16,
|
|
185
185
|
p: 16,
|
|
186
186
|
width: "100%",
|
|
187
|
-
...
|
|
187
|
+
...c && {
|
|
188
188
|
borderTopLeftRadius: "0",
|
|
189
189
|
borderTopRightRadius: "0"
|
|
190
190
|
},
|
|
191
|
-
...(
|
|
191
|
+
...(z || A || d?.guid) && { flexDirection: "row" }
|
|
192
192
|
},
|
|
193
193
|
children: [/* @__PURE__ */ o(q, {
|
|
194
|
-
logo:
|
|
194
|
+
logo: d,
|
|
195
195
|
slot: n,
|
|
196
196
|
variant: p
|
|
197
197
|
}), /* @__PURE__ */ r(t, { children: [u != null && /* @__PURE__ */ o(l, {
|
|
@@ -203,7 +203,7 @@ var vo = ({ payload: g }) => {
|
|
|
203
203
|
flexDirection: "row",
|
|
204
204
|
alignItems: "center"
|
|
205
205
|
},
|
|
206
|
-
children: [e.sub_logo && /* @__PURE__ */ o(
|
|
206
|
+
children: [e.sub_logo && /* @__PURE__ */ o(S, {
|
|
207
207
|
color: "warning",
|
|
208
208
|
fill: !0,
|
|
209
209
|
name: e.sub_logo,
|
|
@@ -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 { slot, type InsightsPayload } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\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 { statusIconName } from '../../../components/statusIcon'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText } from '../../slotReaders'\nimport { DetailedAccountBlock, isDetailedAccountVariant } from '../DetailedAccountBlock'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\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 { variant, institution_guid, institution_name, icon_name, merchant_name } = instance_slot\n\n if (isDetailedAccountVariant(variant)) return <DetailedAccountBlock payload={payload} />\n\n // V1 beats send no `data`. V2 reads only `data` (no `slotOrFlat`): its stale flat fields must never show.\n const { data } = instance_slot\n const v2 = data !== undefined\n const amount = v2 ? asNumber(slot(data, 'amount')) : instance_slot.amount\n // One V2 slot; V1 named it `sub_text` on the standard tile and `label` on the confetti one.\n const v2SubText = asText(slot(data, 'sub_text'))\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const header_text = v2 ? asText(slot(data, 'header_text')) : instance_slot.header_text\n const logo = asLogoRef(slot(data, 'logo'))\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // The 58x46 SVG's card sits 14px down (its check badge overflows top-right); box it to the\n // 48x32 frame so it lines up with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 48 }}>\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 {/* An ICO- icon keeps the tile's look: an outlined glyph in success.contrastText on\n the success.main square. It is drawn with Icon, as IconComponent does, because\n LogoFromGuid fills every ICO- glyph. Any other guid renders via LogoFromGuid. */}\n {confettiIcon ? (\n <Stack\n data-icon={confettiIcon}\n sx={{\n alignItems: 'center',\n bgcolor: 'success.main',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Icon\n aria-hidden={true}\n name={confettiIcon}\n size={layoutConfig.logo_icon_size ?? 24}\n sx={{ color: 'success.contrastText' }}\n />\n </Stack>\n ) : logo?.guid ? (\n <LogoFromGuid logo={logo} size={48} />\n ) : null}\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // The payer: V2's `secondary_text`, else the merchant, else the institution.\n const payer = asText(slot(data, 'secondary_text')) || (merchant_name ?? institution_name)\n const secondaryText = layoutConfig.secondarySource === 'merchant' ? payer : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text\n bold={!layoutConfig.amountKeepsVariantWeight}\n color=\"success.dark\"\n variant={layoutConfig.amountVariant}\n >\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, CURRENCY_FORMAT.cents)}`}\n </Text>\n ) : null\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 ...(layoutConfig.cardShadow && { boxShadow: theme.shadows[1] }),\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 background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n // Figma's standard tile: 16px on every side, 80px tall in the 112px slot.\n p: 16,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\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 && (\n <Text variant=\"h2\">{formatCurrency(amount, CURRENCY_FORMAT.cents)}</Text>\n )}\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 && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,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,EAAE,SAAA,GAAS,kBAAA,GAAkB,kBAAA,GAAkB,WAAA,GAAW,eAAA,EAAA,IAAkB;AAElF,MAAI,EAAyB,CAAO,EAAG,QAAO,gBAAA,EAAC,GAAD,EAA+B,SAAA,EAAU,CAAA;AAGvF,QAAM,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAS,IAAK,EAAS,EAAK,GAAM,QAAQ,CAAC,IAAI,EAAc,QAE7D,IAAY,EAAO,EAAK,GAAM,UAAU,CAAC,GACzC,IAAW,IAAK,IAAY,EAAc,UAC1C,IAAQ,IAAK,IAAY,EAAc,OACv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AAAA,MALF,UAAA,CAOG,KAAe,gBAAA,EAAC,GAAD,EAAiB,YAAY,EAAc,CAAA,GAC3D,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,cAAc;AAAA,UACd,KAAK;AAAA,UAEL,GAAG;AAAA,UACH,OAAO;AAAA,UACP,GAAI,KAAe;AAAA,YACjB,qBAAqB;AAAA,YACrB,sBAAsB;AAAA,UACxB;AAAA,UACA,IAAK,KAAoB,KAAa,GAAM,SAAS,EACnD,eAAe,MACjB;AAAA,QACF;AAAA,QAhBF,UAAA,CAkBE,gBAAA,EAAC,GAAD;AAAA,UAAqB,MAAA;AAAA,UAAM,MAAM;AAAA,UAAwB,SAAA;AAAA,QAAU,CAAA,GAEnE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,KAAU,QACT,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAM,UAAA,EAAe,GAAQ,EAAgB,KAAK;AAAA,QAAQ,CAAA,GAE1E,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,KAAK;AAAA,YAAG,eAAe;AAAA,YAAO,YAAY;AAAA,UAAS;AAAA,UAAhE,UAAA,CACG,EAAa,YACZ,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAU,MAAM;AAAA,YAAM,MAAM,EAAa;AAAA,YAAU,MAAM;AAAA,UAAK,CAAA,GAE3E,KACC,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,SAAQ;AAAA,YAClC,UAAA;AAAA,UACG,CAAA,CAEH;AAAA,QACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA;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 } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\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 { statusIconName } from '../../../components/statusIcon'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText } from '../../slotReaders'\nimport { DetailedAccountBlock, isDetailedAccountVariant } from '../DetailedAccountBlock'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\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 { variant, institution_guid, institution_name, icon_name, merchant_name } = instance_slot\n\n if (isDetailedAccountVariant(variant)) return <DetailedAccountBlock payload={payload} />\n\n // V1 beats send no `data`. V2 reads only `data` (no `slotOrFlat`): its stale flat fields must never show.\n const { data } = instance_slot\n const v2 = data !== undefined\n const amount = v2 ? asNumber(slot(data, 'amount')) : instance_slot.amount\n // One V2 slot; V1 named it `sub_text` on the standard tile and `label` on the confetti one.\n const v2SubText = asText(slot(data, 'sub_text'))\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const header_text = v2 ? asText(slot(data, 'header_text')) : instance_slot.header_text\n // `icon` carries the tile glyph when the beat's `logo` is kept for its compact card (charges_summary).\n const logo = asLogoRef(slot(data, 'logo')) ?? asLogoRef(slot(data, 'icon'))\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // The 58x46 SVG's card sits 14px down (its check badge overflows top-right); box it to the\n // 48x32 frame so it lines up with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 48 }}>\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 {/* An ICO- icon keeps the tile's look: an outlined glyph in success.contrastText on\n the success.main square. It is drawn with Icon, as IconComponent does, because\n LogoFromGuid fills every ICO- glyph. Any other guid renders via LogoFromGuid. */}\n {confettiIcon ? (\n <Stack\n data-icon={confettiIcon}\n sx={{\n alignItems: 'center',\n bgcolor: 'success.main',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Icon\n aria-hidden={true}\n name={confettiIcon}\n size={layoutConfig.logo_icon_size ?? 24}\n sx={{ color: 'success.contrastText' }}\n />\n </Stack>\n ) : logo?.guid ? (\n <LogoFromGuid logo={logo} size={48} />\n ) : null}\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // The payer: V2's `secondary_text`, else the merchant, else the institution.\n const payer = asText(slot(data, 'secondary_text')) || (merchant_name ?? institution_name)\n const secondaryText = layoutConfig.secondarySource === 'merchant' ? payer : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text\n bold={!layoutConfig.amountKeepsVariantWeight}\n color=\"success.dark\"\n variant={layoutConfig.amountVariant}\n >\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, CURRENCY_FORMAT.cents)}`}\n </Text>\n ) : null\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 ...(layoutConfig.cardShadow && { boxShadow: theme.shadows[1] }),\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 background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n // Figma's standard tile: 16px on every side, 80px tall in the 112px slot.\n p: 16,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\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 && (\n <Text variant=\"h2\">{formatCurrency(amount, CURRENCY_FORMAT.cents)}</Text>\n )}\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 && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,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,EAAE,SAAA,GAAS,kBAAA,GAAkB,kBAAA,GAAkB,WAAA,GAAW,eAAA,EAAA,IAAkB;AAElF,MAAI,EAAyB,CAAO,EAAG,QAAO,gBAAA,EAAC,GAAD,EAA+B,SAAA,EAAU,CAAA;AAGvF,QAAM,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAS,IAAK,EAAS,EAAK,GAAM,QAAQ,CAAC,IAAI,EAAc,QAE7D,IAAY,EAAO,EAAK,GAAM,UAAU,CAAC,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
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useCategoryStore as g } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import l from "../../../../common/components/IconBacking.es.js";
|
|
3
|
+
import { resolveVariantConfig as f } from "../../resolveVariantConfig.es.js";
|
|
4
|
+
import p from "../../../components/CategoryTile.es.js";
|
|
5
|
+
import b from "../../../components/LogoFromGuid.es.js";
|
|
6
|
+
import { statusIconName as m } from "../../../components/statusIcon.es.js";
|
|
7
|
+
import { getLayoutConfig as x } from "./layout.es.js";
|
|
8
|
+
import { useEffect as _ } from "react";
|
|
9
|
+
import { observer as h } from "mobx-react-lite";
|
|
10
|
+
import { InstitutionLogo as C } from "@mxenabled/mxui";
|
|
11
|
+
import { Icon as s } from "@mxenabled/mx-icons";
|
|
12
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
13
|
+
import { useTheme as z } from "@mui/material/styles";
|
|
14
|
+
import { Stack as d } from "@mui/material";
|
|
15
|
+
var I = h(({ categoryGuid: i, tint: n }) => {
|
|
16
|
+
const { categoriesLoaded: e, loadCategories: t } = g();
|
|
17
|
+
return _(() => {
|
|
18
|
+
e || t();
|
|
19
|
+
}, [e, t]), /* @__PURE__ */ r(p, {
|
|
20
|
+
categoryGuid: i,
|
|
21
|
+
size: 48,
|
|
22
|
+
tint: n
|
|
23
|
+
});
|
|
24
|
+
}), D = ({ slot: i, variant: n, logo: e }) => {
|
|
25
|
+
const t = z(), o = f(x(t), n, "default", "AccountBlock");
|
|
26
|
+
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */ u(d, {
|
|
14
27
|
sx: {
|
|
15
28
|
alignItems: "center",
|
|
16
29
|
flexDirection: "row",
|
|
17
30
|
position: "relative"
|
|
18
31
|
},
|
|
19
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ r(b, {
|
|
20
33
|
logo: e,
|
|
21
34
|
size: 48
|
|
22
|
-
}), o.badge && /* @__PURE__ */
|
|
35
|
+
}), o.badge && /* @__PURE__ */ r(l, {
|
|
23
36
|
size: 20,
|
|
24
37
|
sx: {
|
|
25
38
|
position: "absolute",
|
|
26
39
|
right: -8,
|
|
27
40
|
top: -8
|
|
28
41
|
},
|
|
29
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ r(s, {
|
|
30
43
|
"aria-hidden": !0,
|
|
31
44
|
color: "error",
|
|
32
45
|
"data-testid": "account-block-error-badge",
|
|
@@ -41,24 +54,29 @@ var y = ({ slot: r, variant: d, logo: e }) => {
|
|
|
41
54
|
})
|
|
42
55
|
})]
|
|
43
56
|
});
|
|
44
|
-
|
|
57
|
+
const a = e?.guid;
|
|
58
|
+
if (a && /^CAT-[A-Za-z0-9-]+$/.test(a)) return /* @__PURE__ */ r(I, {
|
|
59
|
+
categoryGuid: a,
|
|
60
|
+
tint: o.category_tint
|
|
61
|
+
});
|
|
62
|
+
if (i.institution_guid) return /* @__PURE__ */ u(d, {
|
|
45
63
|
sx: {
|
|
46
64
|
alignItems: "center",
|
|
47
65
|
flexDirection: "row",
|
|
48
66
|
position: "relative"
|
|
49
67
|
},
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
alt: `${
|
|
52
|
-
institutionGuid: `${
|
|
68
|
+
children: [/* @__PURE__ */ r(C, {
|
|
69
|
+
alt: `${i.institution_name}`,
|
|
70
|
+
institutionGuid: `${i.institution_guid}`,
|
|
53
71
|
size: 48
|
|
54
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ r(l, {
|
|
55
73
|
size: 20,
|
|
56
74
|
sx: {
|
|
57
75
|
position: "absolute",
|
|
58
76
|
right: -8,
|
|
59
77
|
top: -8
|
|
60
78
|
},
|
|
61
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(s, {
|
|
62
80
|
color: "error",
|
|
63
81
|
fill: !0,
|
|
64
82
|
name: "error",
|
|
@@ -71,9 +89,9 @@ var y = ({ slot: r, variant: d, logo: e }) => {
|
|
|
71
89
|
})
|
|
72
90
|
})]
|
|
73
91
|
});
|
|
74
|
-
const
|
|
75
|
-
return
|
|
76
|
-
"data-icon":
|
|
92
|
+
const c = m(i.icon_name && `ICO-${i.icon_name}`) ?? (o.logo_bGcolor ? m(e?.guid) : void 0);
|
|
93
|
+
return c ? /* @__PURE__ */ r(d, {
|
|
94
|
+
"data-icon": c,
|
|
77
95
|
"data-testid": "account-block-icon-tile",
|
|
78
96
|
sx: {
|
|
79
97
|
alignItems: "center",
|
|
@@ -89,16 +107,16 @@ var y = ({ slot: r, variant: d, logo: e }) => {
|
|
|
89
107
|
borderWidth: 1.5
|
|
90
108
|
}
|
|
91
109
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ r(s, {
|
|
93
111
|
"aria-hidden": !0,
|
|
94
|
-
name:
|
|
112
|
+
name: c,
|
|
95
113
|
size: o.logo_icon_size ?? 30,
|
|
96
114
|
sx: { color: o.logo_color }
|
|
97
115
|
})
|
|
98
116
|
}) : null;
|
|
99
117
|
};
|
|
100
118
|
export {
|
|
101
|
-
|
|
119
|
+
D as IconComponent
|
|
102
120
|
};
|
|
103
121
|
|
|
104
122
|
//# 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, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n /** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */\n logo?: LogoRef\n}\n\nexport const IconComponent = ({ slot, variant, logo }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // V2 slot logo: an institution guid only; anything else falls through to the legacy fields.\n if (/^INS-[A-Za-z0-9-]+$/.test(logo?.guid ?? '')) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <LogoFromGuid logo={logo} size={48} />\n {layoutConfig.badge && (\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n aria-hidden={true}\n color=\"error\"\n data-testid=\"account-block-error-badge\"\n fill={true}\n name={layoutConfig.badge}\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n )}\n </Stack>\n )\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={layoutConfig.logo_icon_size ?? TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport { useEffect } from 'react'\n\nimport { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking, useCategoryStore } from '../../../../common'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport CategoryTile from '../../../components/CategoryTile'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\n/**\n * The tile for a `CAT-` icon (charges_summary). tupac sends a sub-category (Finance Charge), which only draws\n * as its top-level category once categories are loaded, and an insight card on its own may be the first\n * thing to need them.\n */\nconst AccountCategoryTile = observer(\n ({ categoryGuid, tint }: { categoryGuid: string; tint?: number }) => {\n const { categoriesLoaded, loadCategories } = useCategoryStore()\n\n useEffect(() => {\n if (!categoriesLoaded) void loadCategories()\n }, [categoriesLoaded, loadCategories])\n\n return <CategoryTile categoryGuid={categoryGuid} size={48} tint={tint} />\n },\n)\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 // A category guid draws its top-level category's tile, tinted when the variant names a wash\n // (charges_summary: Figma's 25% category colour with a category-colour border).\n const categoryGuid = logo?.guid\n if (categoryGuid && /^CAT-[A-Za-z0-9-]+$/.test(categoryGuid)) {\n return <AccountCategoryTile categoryGuid={categoryGuid} tint={layoutConfig.category_tint} />\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={layoutConfig.logo_icon_size ?? TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAM,IAAsB,EAAA,CACzB,EAAE,cAAA,GAAc,MAAA,EAAA,MAAoD;AACnE,QAAM,EAAE,kBAAA,GAAkB,gBAAA,EAAA,IAAmB,EAAiB;AAE9D,SAAA,EAAA,MAAgB;AACd,IAAK,KAAkB,EAAoB;AAAA,EAC7C,GAAG,CAAC,GAAkB,CAAc,CAAC,GAE9B,gBAAA,EAAC,GAAD;AAAA,IAA4B,cAAA;AAAA,IAAc,MAAM;AAAA,IAAU,MAAA;AAAA,EAAO,CAAA;AAC1E,CACF,GASa,IAAA,CAAiB,EAAE,MAAA,GAAM,SAAA,GAAS,MAAA,EAAA,MAA+B;AAC5E,QAAM,IAAQ,EAAS,GACjB,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAGA,MAAI,sBAAsB,KAAK,GAAM,QAAQ,EAAE,EAC7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AAD;AAAA,QACE,OAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAK;AAAA,QACL,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CACR;AAAA;AAOX,QAAM,IACJ,EAAe,EAAK,aAAa,OAAO,EAAK,SAAA,EAAW,MACvD,EAAa,eAAe,EAAe,GAAM,IAAI,IAAI;AAC5D,SAAI,IAEA,gBAAA,EAAC,GAAD;AAAA,IACE,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc,EAAa,sBAAsB;AAAA,MACjD,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,GAAI,EAAa,qBAAqB;AAAA,QACpC,aAAa,EAAa;AAAA,QAC1B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAa,kBAAA;AAAA,MACnB,IAAI,EAAE,OAAO,EAAa,WAAW;AAAA,IACtC,CAAA;AAAA,EACI,CAAA,IAIJ;AACT"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
2
|
export interface BlockLayoutConfig {
|
|
3
3
|
background?: string;
|
|
4
|
+
/** Opacity of the category colour behind a `CAT-` tile, with a category-colour border; none = mxui's tile. */
|
|
5
|
+
category_tint?: number;
|
|
4
6
|
logo_color?: string;
|
|
5
7
|
logo_bGcolor?: string;
|
|
6
8
|
logo_border_color?: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { CELEBRATION_GRADIENT as
|
|
2
|
-
|
|
3
|
-
var e = { background: t }, d = (o) => ({
|
|
1
|
+
import { CELEBRATION_GRADIENT as o, ERROR_WASH_GRADIENT as e, FEES_WASH_GRADIENT as n, WARM_LIME_ACCENT_GRADIENT as r } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var a = { background: e }, c = (t) => ({
|
|
4
3
|
overdraft_warning: {
|
|
5
|
-
background:
|
|
4
|
+
background: t.palette.warning.light,
|
|
6
5
|
sub_logo: "error"
|
|
7
6
|
},
|
|
8
|
-
low_balance_alert:
|
|
7
|
+
low_balance_alert: a,
|
|
9
8
|
low_balance: {
|
|
10
|
-
...
|
|
9
|
+
...a,
|
|
11
10
|
badge: "error"
|
|
12
11
|
},
|
|
13
12
|
status_off_track: {
|
|
@@ -15,17 +14,15 @@ var e = { background: t }, d = (o) => ({
|
|
|
15
14
|
logo_bGcolor: "error.main",
|
|
16
15
|
logo_border_radius: "4px",
|
|
17
16
|
logo_icon_size: 24,
|
|
18
|
-
background:
|
|
17
|
+
background: e
|
|
19
18
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
logo_bGcolor: i(o.palette.categories?.feesCharges || "", 0.25),
|
|
23
|
-
logo_border_color: "categories.feesCharges",
|
|
19
|
+
charges_summary: {
|
|
20
|
+
category_tint: 0.25,
|
|
24
21
|
background: n
|
|
25
22
|
},
|
|
26
23
|
deposit_received: {
|
|
27
24
|
isConfetti: !0,
|
|
28
|
-
gradient:
|
|
25
|
+
gradient: r,
|
|
29
26
|
graphic: "logo",
|
|
30
27
|
amountVariant: "h2",
|
|
31
28
|
amountPrefix: "+",
|
|
@@ -42,7 +39,7 @@ var e = { background: t }, d = (o) => ({
|
|
|
42
39
|
},
|
|
43
40
|
status_on_track: {
|
|
44
41
|
isConfetti: !0,
|
|
45
|
-
gradient:
|
|
42
|
+
gradient: r,
|
|
46
43
|
graphic: "logo",
|
|
47
44
|
amountVariant: "h2",
|
|
48
45
|
amountKeepsVariantWeight: !0,
|
|
@@ -57,7 +54,7 @@ var e = { background: t }, d = (o) => ({
|
|
|
57
54
|
},
|
|
58
55
|
payoff_celebration: {
|
|
59
56
|
isConfetti: !0,
|
|
60
|
-
gradient:
|
|
57
|
+
gradient: o,
|
|
61
58
|
graphic: "paidOffCard",
|
|
62
59
|
amountVariant: "h2",
|
|
63
60
|
rowSx: {
|
|
@@ -72,7 +69,7 @@ var e = { background: t }, d = (o) => ({
|
|
|
72
69
|
},
|
|
73
70
|
savings_deposit: {
|
|
74
71
|
isConfetti: !0,
|
|
75
|
-
gradient:
|
|
72
|
+
gradient: o,
|
|
76
73
|
graphic: "savings",
|
|
77
74
|
amountVariant: "h2",
|
|
78
75
|
rowSx: {
|
|
@@ -87,7 +84,7 @@ var e = { background: t }, d = (o) => ({
|
|
|
87
84
|
default: {}
|
|
88
85
|
});
|
|
89
86
|
export {
|
|
90
|
-
|
|
87
|
+
c as getLayoutConfig
|
|
91
88
|
};
|
|
92
89
|
|
|
93
90
|
//# 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 {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n FEES_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n /** Opacity of the category colour behind a `CAT-` tile, with a category-colour border; none = mxui's tile. */\n category_tint?: number\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 /** Keep the variant's own weight (h2 is 700) instead of the confetti tile's semi bold. */\n amountKeepsVariantWeight?: boolean\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 // Monthly Credit Card Interest Summary's fees tile (ditto account_block `charges_summary`); its category\n // glyph rides in `icon`.\n charges_summary: {\n category_tint: 0.25,\n background: FEES_WASH_GRADIENT,\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 amountKeepsVariantWeight: true,\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":";AA0DA,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,EAGA,iBAAiB;AAAA,IACf,eAAe;AAAA,IACf,YAAY;AAAA,EACd;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,0BAA0B;AAAA,IAC1B,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"}
|
|
@@ -9,29 +9,29 @@ import { donutChartVariant as $ } from "../blocks/ChartBlocks/DonutChartBlock/la
|
|
|
9
9
|
import { getDonutSegments as U } from "../blocks/ChartBlocks/DonutChartBlock/utils.es.js";
|
|
10
10
|
import { formatValueByType as Y } from "../CommonUtils.es.js";
|
|
11
11
|
import { ThemedSVGImage as q } from "./chartblocks/ThemedSVGImage.es.js";
|
|
12
|
-
import { asLogoRef as J, asNonEmptyText as L, asNumber as
|
|
12
|
+
import { asLogoRef as J, asNonEmptyText as L, asNumber as D } from "../blocks/slotReaders.es.js";
|
|
13
13
|
import { postCtaMessage as Q } from "../ctaActions/runCtaAction.es.js";
|
|
14
14
|
import u from "./LogoFromGuid.es.js";
|
|
15
15
|
import { createVariantBlock as tt } from "../blocks/createVariantBlock.es.js";
|
|
16
16
|
import { ActionBlockLayer as rt } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
17
|
-
import
|
|
17
|
+
import w from "./BadgedTile.es.js";
|
|
18
18
|
import { InsightOptionsMenu as et } from "./InsightOptionsMenu.es.js";
|
|
19
19
|
import { ReactComponent as it } from "./shared/images/FeeDetected.es.js";
|
|
20
20
|
import V from "./StatusBadge.es.js";
|
|
21
21
|
import C from "@mui/material/Stack";
|
|
22
|
-
import { P as ot, Text as
|
|
22
|
+
import { P as ot, Text as E } from "@mxenabled/mxui";
|
|
23
23
|
import at from "@mui/material/Button";
|
|
24
|
-
import { Icon as
|
|
24
|
+
import { Icon as S } from "@mxenabled/mx-icons";
|
|
25
25
|
import { Fragment as nt, jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
26
26
|
import { useTheme as st } from "@mui/material/styles";
|
|
27
27
|
import n from "@mui/material/Box";
|
|
28
28
|
import lt from "@mui/material/Card";
|
|
29
|
-
var dt = 2, m = 44,
|
|
29
|
+
var dt = 2, m = 44, B = 36, ct = 75, mt = 74, f = {
|
|
30
30
|
left: "50%",
|
|
31
31
|
position: "absolute",
|
|
32
32
|
top: "50%",
|
|
33
33
|
transform: "translate(-50%, -50%)"
|
|
34
|
-
}, pt = 54, gt = 75,
|
|
34
|
+
}, pt = 54, gt = 75, A = ({ logo: r }) => r ? /* @__PURE__ */ t(u, {
|
|
35
35
|
logo: r,
|
|
36
36
|
size: m
|
|
37
37
|
}) : /* @__PURE__ */ t(n, {
|
|
@@ -44,22 +44,22 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
44
44
|
justifyContent: "center",
|
|
45
45
|
width: m
|
|
46
46
|
},
|
|
47
|
-
children: /* @__PURE__ */ t(
|
|
47
|
+
children: /* @__PURE__ */ t(S, {
|
|
48
48
|
color: "primary",
|
|
49
49
|
fill: !0,
|
|
50
50
|
name: "lightbulb",
|
|
51
51
|
size: 24
|
|
52
52
|
})
|
|
53
|
-
}),
|
|
54
|
-
center: /* @__PURE__ */ t(
|
|
53
|
+
}), k = ({ logo: r }) => /* @__PURE__ */ t(w, {
|
|
54
|
+
center: /* @__PURE__ */ t(A, { logo: r }),
|
|
55
55
|
size: m,
|
|
56
56
|
sx: { flexShrink: 0 }
|
|
57
|
-
}), ht = ({ logo: r }) => /* @__PURE__ */ t(
|
|
58
|
-
center: /* @__PURE__ */ t(
|
|
57
|
+
}), ht = ({ logo: r }) => /* @__PURE__ */ t(w, {
|
|
58
|
+
center: /* @__PURE__ */ t(A, { logo: r }),
|
|
59
59
|
size: m,
|
|
60
60
|
sx: { flexShrink: 0 },
|
|
61
61
|
topRight: /* @__PURE__ */ t(V, { tone: "warning" })
|
|
62
|
-
}), ut = 24, ft = ({ logo: r }) => /* @__PURE__ */ t(
|
|
62
|
+
}), ut = 24, ft = ({ logo: r }) => /* @__PURE__ */ t(w, {
|
|
63
63
|
bottomLeft: r ? /* @__PURE__ */ t(n, {
|
|
64
64
|
"aria-hidden": !0,
|
|
65
65
|
sx: {
|
|
@@ -77,7 +77,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
77
77
|
size: ut
|
|
78
78
|
})
|
|
79
79
|
}) : void 0,
|
|
80
|
-
center: /* @__PURE__ */ t(
|
|
80
|
+
center: /* @__PURE__ */ t(A, { logo: r }),
|
|
81
81
|
size: m,
|
|
82
82
|
sx: { flexShrink: 0 },
|
|
83
83
|
topRight: /* @__PURE__ */ t(V, { tone: "error" })
|
|
@@ -88,7 +88,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
88
88
|
width: "max-content"
|
|
89
89
|
} },
|
|
90
90
|
image: it
|
|
91
|
-
}),
|
|
91
|
+
}), I = 24, _t = () => /* @__PURE__ */ t(n, {
|
|
92
92
|
"aria-hidden": !0,
|
|
93
93
|
"data-testid": "linked-logos-badge",
|
|
94
94
|
sx: {
|
|
@@ -103,7 +103,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
103
103
|
p: 2,
|
|
104
104
|
zIndex: 1
|
|
105
105
|
},
|
|
106
|
-
children: /* @__PURE__ */ t(
|
|
106
|
+
children: /* @__PURE__ */ t(S, {
|
|
107
107
|
name: "link",
|
|
108
108
|
size: 16,
|
|
109
109
|
sx: { color: "primary.contrastText" }
|
|
@@ -117,15 +117,15 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
117
117
|
bgcolor: "primary.contrastText",
|
|
118
118
|
borderRadius: "50%",
|
|
119
119
|
display: "flex",
|
|
120
|
-
height:
|
|
120
|
+
height: I,
|
|
121
121
|
justifyContent: "center",
|
|
122
122
|
overflow: "hidden",
|
|
123
|
-
width:
|
|
123
|
+
width: I,
|
|
124
124
|
zIndex: 1
|
|
125
125
|
},
|
|
126
|
-
children: /* @__PURE__ */ t(
|
|
126
|
+
children: /* @__PURE__ */ t(S, {
|
|
127
127
|
name: "swap_vertical_circle",
|
|
128
|
-
size:
|
|
128
|
+
size: I * 1.2,
|
|
129
129
|
sx: {
|
|
130
130
|
color: "primary.main",
|
|
131
131
|
flexShrink: 0,
|
|
@@ -178,7 +178,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
178
178
|
},
|
|
179
179
|
children: /* @__PURE__ */ t(u, {
|
|
180
180
|
logo: e,
|
|
181
|
-
size:
|
|
181
|
+
size: B
|
|
182
182
|
})
|
|
183
183
|
}),
|
|
184
184
|
/* @__PURE__ */ t(n, {
|
|
@@ -191,7 +191,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
191
191
|
},
|
|
192
192
|
children: /* @__PURE__ */ t(u, {
|
|
193
193
|
logo: i,
|
|
194
|
-
size:
|
|
194
|
+
size: B
|
|
195
195
|
})
|
|
196
196
|
}),
|
|
197
197
|
a ? /* @__PURE__ */ t(vt, {}) : /* @__PURE__ */ t(_t, {})
|
|
@@ -212,7 +212,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
212
212
|
})
|
|
213
213
|
});
|
|
214
214
|
}, Ct = ({ data: r }) => {
|
|
215
|
-
const o = st(), e = p(r, "main"), i = p(r, "legends"), a =
|
|
215
|
+
const o = st(), e = p(r, "main"), i = p(r, "legends"), a = D(e?.value), g = (Array.isArray(i) ? i : []).map((s) => D(s?.value));
|
|
216
216
|
if (a === void 0 || g.length !== 2 || g.some((s) => s === void 0)) return null;
|
|
217
217
|
const { colors: x, arcs: _ } = U($.CreditLimit, {}, g.map((s) => ({ value: s })), o), h = typeof e?.value_type == "string" ? e.value_type : "amount";
|
|
218
218
|
return /* @__PURE__ */ t(n, {
|
|
@@ -229,7 +229,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
229
229
|
})
|
|
230
230
|
});
|
|
231
231
|
}, kt = 75, It = 50, Dt = (r) => {
|
|
232
|
-
const o = L(r?.primary_text), e =
|
|
232
|
+
const o = L(r?.primary_text), e = D(r?.amount);
|
|
233
233
|
if (o === void 0 || e === void 0) return;
|
|
234
234
|
const i = M(e, R.cents);
|
|
235
235
|
return {
|
|
@@ -255,13 +255,14 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
255
255
|
category_color: bt,
|
|
256
256
|
compact_comparison: wt,
|
|
257
257
|
linked_logos: yt,
|
|
258
|
-
minimal:
|
|
258
|
+
minimal: k,
|
|
259
|
+
minimal_logo: k,
|
|
259
260
|
stacked_logos: ft,
|
|
260
261
|
with_donut: Ct,
|
|
261
262
|
with_illustration: xt,
|
|
262
263
|
with_warning_badge: ht
|
|
263
264
|
},
|
|
264
|
-
fallback:
|
|
265
|
+
fallback: k,
|
|
265
266
|
name: "InsightVisual"
|
|
266
267
|
}), At = {
|
|
267
268
|
BillAmountNotStandard: {
|
|
@@ -332,7 +333,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
332
333
|
pl: 8,
|
|
333
334
|
pt: 4
|
|
334
335
|
},
|
|
335
|
-
children: [/* @__PURE__ */ t(
|
|
336
|
+
children: [/* @__PURE__ */ t(E, {
|
|
336
337
|
bold: !0,
|
|
337
338
|
variant: "body1",
|
|
338
339
|
children: v ?? ""
|
|
@@ -387,7 +388,7 @@ var dt = 2, m = 44, E = 36, ct = 75, mt = 74, f = {
|
|
|
387
388
|
}
|
|
388
389
|
},
|
|
389
390
|
variant: "text",
|
|
390
|
-
children: /* @__PURE__ */ t(
|
|
391
|
+
children: /* @__PURE__ */ t(E, {
|
|
391
392
|
bold: !0,
|
|
392
393
|
variant: "body2",
|
|
393
394
|
children: y.label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactInsightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/CompactInsightCard.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { useGlobalStore, useInsightsV2Store } from '../../common'\nimport { TinyBarChart } from '../../common/components/TinyBarChart'\nimport { slot } from '../../core'\nimport type {\n Beat,\n DataSeries,\n InsightsPayload,\n InstanceSlotData,\n InstanceSlotRow,\n LogoRef,\n PrimaryCTA,\n} from '../../core'\nimport type { ActionDrawerTrigger } from '../../core/stores'\nimport type { AccountSwitchBlockV2Data } from '../../core/types/InsightsInstanceSlotData'\nimport { getCategoryColor } from '../../core/utils/CategoryUtil'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../core/utils/NumberFormatting'\nimport {\n BAR_ARIA_LABEL,\n buildChartData,\n buildDataSeries,\n} from '../blocks/ChartBlocks/BarchartBlock/utils'\nimport DonutChartV2 from '../blocks/ChartBlocks/DonutChartBlock/DonutChart'\nimport { donutChartVariant } from '../blocks/ChartBlocks/DonutChartBlock/layout'\nimport { getDonutSegments } from '../blocks/ChartBlocks/DonutChartBlock/utils'\nimport { formatValueByType } from '../CommonUtils'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\nimport { postCtaMessage } from '../ctaActions'\nimport { asLogoRef, asNonEmptyText, asNumber } from '../blocks/slotReaders'\nimport BadgedTile from './BadgedTile'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport LogoFromGuid from './LogoFromGuid'\nimport { ReactComponent as FeeDetectedIllustration } from './shared/images/FeeDetected.svg'\nimport { ThemedSVGImage } from './chartblocks/ThemedSVGImage'\nimport StatusBadge from './StatusBadge'\n\nconst DESCRIPTION_MAX_LINES = 2\n\n/** Figma 1941:111897: the tile the logo fills is 44px (rows are 32, the notification row 33). */\nconst ICON_SIZE = 44\n\ninterface InsightVisualProps {\n /** The slot's `logo`, when ditto's variant declares and fills one. */\n logo?: LogoRef | null\n /** The slot's whole `data`, for a visual drawn from more than the logo (`category_color`, `linked_logos`). */\n data?: InstanceSlotData\n /** The envelope's template, for a beat's own badge on `linked_logos`. */\n template?: string\n}\n\n// Figma 1943:219189: 36px logos at opposite corners of a 75×74 box, the badge and rings centred.\nconst LINKED_LOGO_SIZE = 36\nconst LINKED_BOX_WIDTH = 75\nconst LINKED_BOX_HEIGHT = 74\n\nconst CENTRED = {\n left: '50%',\n position: 'absolute',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n} as const\n\n/** Figma 222:33404 (Embedded | Bill Amount Not Standard) shows the latest three bars. */\nconst BAR_CHART_BAR_COUNT = 3\n\nconst EMBEDDED_BAR_CHART_HEIGHT = 54\nconst EMBEDDED_BAR_CHART_WIDTH = 75\n\n/** The slot's logo, or the neutral insight glyph when the slot carries none. */\nconst LogoOrFallback = ({ logo }: InsightVisualProps) =>\n logo ? (\n <LogoFromGuid logo={logo} size={ICON_SIZE} />\n ) : (\n <Box\n data-testid=\"compact-insight-card-fallback-icon\"\n sx={{\n alignItems: 'center',\n bgcolor: 'primary.lighter',\n display: 'flex',\n height: ICON_SIZE,\n justifyContent: 'center',\n width: ICON_SIZE,\n }}\n >\n <Icon color=\"primary\" fill={true} name=\"lightbulb\" size={24} />\n </Box>\n )\n\n/** Micro, and any variant not registered below: the logo alone. */\nconst PlainVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile center={<LogoOrFallback logo={logo} />} size={ICON_SIZE} sx={{ flexShrink: 0 }} />\n)\n\n/** ditto `with_warning_badge`: the logo badged with a status glyph (Figma 1941:111897). */\nconst WarningBadgeVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"warning\" />}\n />\n)\n\nconst STACKED_LOGO_SIZE = 24\n\n/** ditto `stacked_logos`: the row logo twice, plus an error badge. The copy is `aria-hidden`, so the logo is named once. */\nconst StackedLogosVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n bottomLeft={\n logo ? (\n <Box\n aria-hidden={true}\n sx={{\n borderRadius: '6px',\n display: 'flex',\n outline: '2px solid',\n outlineColor: 'background.paper',\n overflow: 'hidden',\n }}\n >\n <LogoFromGuid logo={{ ...logo, alt: undefined }} size={STACKED_LOGO_SIZE} />\n </Box>\n ) : undefined\n }\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"error\" />}\n />\n)\n\n/**\n * ditto `with_illustration`: artwork in place of the logo tile (Fee Detected's search illustration).\n * A single SVG themed at runtime by `ThemedSVGImage`: its `brand300` elements are recolored to the\n * theme's `primary.main` (so it follows dark mode), while `fill=\"white\"` areas stay white. The\n * slot's `logo` is deliberately unused: the illustration replaces the tile.\n */\nconst IllustrationVisual = () => {\n return (\n <ThemedSVGImage\n divProps={{ style: { flexShrink: 0, lineHeight: 0, width: 'max-content' } }}\n image={FeeDetectedIllustration}\n />\n )\n}\n\nconst SWAP_BADGE_SIZE = 24\n\nconst LinkBadge = () => (\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-badge\"\n sx={{\n ...CENTRED,\n alignItems: 'center',\n bgcolor: 'primary.main',\n border: '2px solid',\n borderColor: 'primary.contrastText',\n borderRadius: '12px',\n display: 'flex',\n justifyContent: 'center',\n p: 2,\n zIndex: 1,\n }}\n >\n <Icon name=\"link\" size={16} sx={{ color: 'primary.contrastText' }} />\n </Box>\n)\n\n/**\n * Switch Direct Deposit (Figma 1941:167601): the outlined `swap_vertical_circle`, turned horizontal,\n * over a contrast disc: a primary ring and arrows on white. Drawn 1.2× so its circle fills 24px.\n */\nconst SwapBadge = () => (\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-badge\"\n sx={{\n ...CENTRED,\n alignItems: 'center',\n bgcolor: 'primary.contrastText',\n borderRadius: '50%',\n display: 'flex',\n height: SWAP_BADGE_SIZE,\n justifyContent: 'center',\n overflow: 'hidden',\n width: SWAP_BADGE_SIZE,\n zIndex: 1,\n }}\n >\n <Icon\n name=\"swap_vertical_circle\"\n size={SWAP_BADGE_SIZE * 1.2}\n sx={{ color: 'primary.main', flexShrink: 0, transform: 'rotate(-90deg)' }}\n />\n </Box>\n)\n\n/**\n * ditto `linked_logos` (Figma 1943:219189, Embedded | Discovered Accounts): the two institutions at\n * opposite corners of a 75×74 box — `from_logo` top-left, `to_logo` bottom-right — meeting on the\n * diagonal, with a badge over two rings at the centre (Switch Direct Deposit: the swap badge on an\n * outlined inner ring). The rings and badge are decorative (`aria-hidden`); each logo's accessible\n * name is its `alt`.\n */\nconst LinkedLogosVisual = ({ data, template }: InsightVisualProps) => {\n const { from_logo, to_logo } = (data ?? {}) as AccountSwitchBlockV2Data\n const isSwap = template === 'SwitchDirectDeposit'\n\n return (\n <Box\n sx={{\n flexShrink: 0,\n height: LINKED_BOX_HEIGHT,\n position: 'relative',\n width: LINKED_BOX_WIDTH,\n }}\n >\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-ring\"\n sx={{\n ...CENTRED,\n borderRadius: '50%',\n height: 36,\n width: 36,\n ...(isSwap\n ? { border: '2px solid', borderColor: 'primary.light' }\n : { bgcolor: 'primary.light' }),\n }}\n />\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-ring\"\n sx={{\n ...CENTRED,\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '50%',\n height: 48,\n width: 48,\n }}\n />\n <Box sx={{ borderRadius: '4px', left: 0, overflow: 'hidden', position: 'absolute', top: 0 }}>\n <LogoFromGuid logo={from_logo} size={LINKED_LOGO_SIZE} />\n </Box>\n <Box\n sx={{ borderRadius: '4px', bottom: 0, overflow: 'hidden', position: 'absolute', right: 0 }}\n >\n <LogoFromGuid logo={to_logo} size={LINKED_LOGO_SIZE} />\n </Box>\n {isSwap ? <SwapBadge /> : <LinkBadge />}\n </Box>\n )\n}\n\n/**\n * ditto `category_color`: a tiny bar chart of the latest bars in place of the logo tile, tinted by\n * the slot's category, the newest bar solid (Figma 222:33404). Draws nothing without a series.\n */\nconst BarChartVisual = ({ data }: InsightVisualProps) => {\n const series = buildDataSeries(slot<DataSeries>(data, 'series'))\n if (!series.length) return null\n\n const categoryGuid = slot<string>(data, 'category_guid')\n const bars = buildChartData(series, BAR_ARIA_LABEL).slice(-BAR_CHART_BAR_COUNT)\n\n return (\n <Box data-testid=\"compact-insight-card-bar-chart\" sx={{ flexShrink: 0 }}>\n <TinyBarChart\n color={(theme) =>\n categoryGuid ? getCategoryColor(categoryGuid, theme) : theme.palette.primary.main\n }\n data={bars}\n height={EMBEDDED_BAR_CHART_HEIGHT}\n width={EMBEDDED_BAR_CHART_WIDTH}\n />\n </Box>\n )\n}\n\n/**\n * ditto `with_donut`: the `credit_limit` donut, small, with no legend; another beat needs its own variant.\n * Captioned by `main.compact_label` only (\"Remains\"), never the full donut's `main.label`.\n */\nconst DonutVisual = ({ data }: InsightVisualProps) => {\n const theme = useTheme()\n const main = slot<{ compact_label?: unknown; value?: unknown; value_type?: unknown }>(\n data,\n 'main',\n )\n const legends = slot<{ value?: unknown }[]>(data, 'legends')\n const centre = asNumber(main?.value)\n const values = (Array.isArray(legends) ? legends : []).map((legend) => asNumber(legend?.value))\n if (centre === undefined || values.length !== 2 || values.some((v) => v === undefined))\n return null\n\n const { colors, arcs } = getDonutSegments(\n donutChartVariant.CreditLimit,\n {},\n values.map((value) => ({ value: value as number })),\n theme,\n )\n const valueType = typeof main?.value_type === 'string' ? main.value_type : 'amount'\n\n return (\n <Box data-testid=\"compact-insight-card-donut\" sx={{ flexShrink: 0 }}>\n <DonutChartV2\n centerLabel={asNonEmptyText(main?.compact_label)}\n centerValue={formatValueByType(centre, valueType, CURRENCY_FORMAT.whole)}\n compact={true}\n data={arcs.map((value, index) => ({ color: colors[index], value }))}\n />\n </Box>\n )\n}\n\nconst COMPARISON_WIDTH = 75\nconst COMPARISON_HEIGHT = 50\n\nconst asComparisonBar = (row: InstanceSlotRow | undefined) => {\n const label = asNonEmptyText(row?.primary_text)\n const value = asNumber(row?.amount)\n if (label === undefined || value === undefined) return undefined\n const formattedAmount = formatCurrency(value, CURRENCY_FORMAT.cents)\n return { ariaLabel: `${label}: ${formattedAmount}`, formattedAmount, label, value }\n}\n\n/**\n * ditto `compact_comparison` (Subscription Price Increase, Figma 1286:25608): the previous and new amounts as two labelled bars,\n * the new one solid, in the full card's progress-bar colour. Draws nothing without two distinct labelled rows.\n */\nconst ComparisonVisual = ({ data }: InsightVisualProps) => {\n const series = slot<InstanceSlotRow[]>(data, 'compact_series')\n const [previous, latest] = (Array.isArray(series) ? series.slice(0, 2) : []).map(asComparisonBar)\n // Equal labels share one band on the chart's x axis, so the bars would overlap.\n if (!previous || !latest || previous.label === latest.label) return null\n const bars = [previous, latest]\n\n return (\n <Box data-testid=\"compact-insight-card-comparison\" sx={{ flexShrink: 0 }}>\n <TinyBarChart\n color={(theme) => theme.palette.warning.main}\n data={bars}\n height={COMPARISON_HEIGHT}\n width={COMPARISON_WIDTH}\n />\n </Box>\n )\n}\n\n/**\n * The card's right-hand visual, one component per ditto layout variant.\n *\n * A variant names a rendering *shape*, not an insight or a surface — `with_header` already serves\n * both Large Transaction and Fee Detected — so an insight wanting the badged logo reuses\n * `with_warning_badge`. Only a genuinely different visual registers a new entry, and existing ones\n * are never touched.\n *\n * `minimal` draws the plain logo and is registered explicitly even though it matches the fallback:\n * micro and notification resolve it on every render, and an unregistered variant warns. The\n * fallback is for variants we genuinely do not know.\n */\nconst InsightVisual = createVariantBlock<InsightVisualProps>({\n variants: {\n category_color: BarChartVisual,\n compact_comparison: ComparisonVisual,\n linked_logos: LinkedLogosVisual,\n minimal: PlainVisual,\n stacked_logos: StackedLogosVisual,\n with_donut: DonutVisual,\n with_illustration: IllustrationVisual,\n with_warning_badge: WarningBadgeVisual,\n },\n fallback: PlainVisual,\n name: 'InsightVisual',\n})\n\n/**\n * Beats whose embedded CTA the card reads from its own envelope key and opens in this card's\n * `ActionBlockLayer`, as a bar click does on the full card. The trigger names that key, so the layer\n * resolves the same CTA. Without a trigger the link posts its host message instead (Switch Direct\n * Deposit's op_1: Atomic runs only in pulse). Every other beat keeps `primary_cta` and hands it to\n * the host's `onCtaClick` (e.g. `contact_support_block`). A new beat adds its template here.\n * `boldCopy` bolds the description's `.bold-copy` spans, as Figma draws them; off for every other beat.\n */\nconst BEAT_CTA_CONFIG: Record<\n string,\n { key: 'primary_cta' | 'in_description_cta'; trigger?: ActionDrawerTrigger; boldCopy?: boolean }\n> = {\n BillAmountNotStandard: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n CreditCardCloseToLimit: {\n key: 'in_description_cta',\n trigger: 'inDescriptionCta',\n boldCopy: true,\n },\n ConnectDiscoveredAccountsV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n DuplicatePaymentV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n SwitchDirectDeposit: { key: 'in_description_cta' },\n}\n\nexport interface CompactInsightCardProps {\n /** A `micro` or `embedded` envelope. */\n payload: InsightsPayload\n /** The envelope's beat; when given, the card mounts its `ActionBlockLayer` for CTA drawers. */\n beat?: Beat\n /**\n * Makes the whole card the tap target. What a tap does is the host's decision (post to the\n * host app, open a drawer, …); the card never opens anything itself. Omit for a static card.\n */\n onTap?: () => void\n /** Receives the primary CTA when tapped. The card does not resolve the CTA's block itself. */\n onCtaClick?: (cta: PrimaryCTA) => void\n /**\n * Renders the CTA disabled — label shown, `aria-disabled`, not tappable — for a host that cannot\n * honour it (e.g. `contact_support_block` when the client's `enable_support_requests` is off).\n */\n isCtaDisabled?: boolean\n}\n\nconst stopPropagation = (event: MouseEvent) => event.stopPropagation()\n\n/**\n * The one compact renderer the micro and embedded envelopes share (`insights_v2.2.md` §8.3).\n *\n * Figma 1941:111897 (Embedded | Large Transaction): a title row with the overflow slot, the HTML\n * description with the primary CTA under it, and on the right the slot's `logo` in a\n * `<BadgedTile>`. Under ditto's `with_warning_badge` variant the tile takes a status badge; under\n * `minimal` it draws the logo alone. The card lays out from the envelope alone and never reads\n * `widget_type`.\n *\n * The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot\n * carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.\n */\nconst CompactInsightCard = ({\n beat,\n isCtaDisabled = false,\n onCtaClick,\n onTap,\n payload,\n}: CompactInsightCardProps) => {\n const stores = useGlobalStore()\n const { openActionDrawer } = useInsightsV2Store()\n const { description, instance_slot, primary_cta, title } = payload\n const beatCta = BEAT_CTA_CONFIG[payload.template ?? '']\n const cta = beatCta ? payload[beatCta.key] : primary_cta\n const message = payload.in_description_cta?.post_message_metadata\n // A link that posts needs its beat and message; without them it draws nothing.\n const canAct = !beatCta || !!beatCta.trigger || (!!beat && !!message)\n // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = asLogoRef(slot(instance_slot.data, 'logo'))\n\n const handleCtaClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (isCtaDisabled || !cta) return\n\n if (beatCta) {\n if (beat && beatCta.trigger) openActionDrawer({ guid: beat.guid, trigger: beatCta.trigger })\n else if (beat && message) {\n const { action, ...extras } = message\n postCtaMessage({ beat, stores }, { action, payload: extras })\n }\n return\n }\n if (primary_cta) onCtaClick?.(primary_cta)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n // Only the card itself: Enter on the CTA button is the button's own click.\n if (event.target !== event.currentTarget) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n onTap?.()\n }\n }\n\n const interactiveProps = onTap\n ? { onClick: onTap, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 }\n : {}\n\n return (\n <>\n <Card\n data-testid=\"compact-insight-card\"\n {...interactiveProps}\n sx={{\n minWidth: 288,\n pb: 12,\n pl: 8,\n pr: 16,\n pt: 8,\n ...(onTap && { cursor: 'pointer' }),\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n justifyContent: 'space-between',\n pl: 8,\n pt: 4,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {title ?? ''}\n </Text>\n {/* The menu renders only when the host wired `onMenuAction` (BeatActionsProvider). */}\n <Box onClick={stopPropagation} sx={{ display: 'flex' }}>\n <InsightOptionsMenu />\n </Box>\n </Stack>\n\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, pl: 8 }}>\n <Stack sx={{ alignSelf: 'stretch', flex: 1, gap: 8, minWidth: 0, pt: 2 }}>\n {/* `html_text` is rendered server-side by mrs_content from the ditto copy template (bold\n amount / merchant), not user-authored input; painted the same way `BaseLayout` paints\n the full card's description. */}\n <P\n dangerouslySetInnerHTML={{ __html: description.html_text }}\n data-testid=\"compact-insight-card-description\"\n sx={{\n display: '-webkit-box',\n fontWeight: 'fontWeightRegular',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: DESCRIPTION_MAX_LINES,\n ...(beatCta?.boldCopy && {\n '& .bold-copy': { fontFamily: 'inherit', fontWeight: 'fontWeightBold' },\n }),\n }}\n variant=\"subtitle2\"\n />\n {cta?.label && canAct && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // The label lines up with the description (the column pads 8; the tap target keeps\n // its padding). `my: 0` drops the theme's -12px text-button margin.\n ml: -8,\n my: 0,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n <Text bold={true} variant=\"body2\">\n {cta.label}\n </Text>\n </Button>\n )}\n </Stack>\n\n <InsightVisual\n data={instance_slot.data}\n logo={rowLogo}\n template={payload.template}\n variant={instance_slot.variant}\n />\n </Stack>\n </Card>\n {/* Outside the Card: the drawer is a portal, and its clicks would otherwise bubble to `onTap`. */}\n {beat && <ActionBlockLayer beat={beat} />}\n </>\n )\n}\n\nexport default CompactInsightCard\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAM,KAAwB,GAGxB,IAAY,IAYZ,IAAmB,IACnB,KAAmB,IACnB,KAAoB,IAEpB,IAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,KAAK;AAAA,EACL,WAAW;AACb,GAKM,KAA4B,IAC5B,KAA2B,IAG3B,IAAA,CAAkB,EAAE,MAAA,EAAA,MACxB,IACE,gBAAA,EAAC,GAAD;AAAA,EAAoB,MAAA;AAAA,EAAM,MAAM;AAAY,CAAA,IAE5C,gBAAA,EAAC,GAAD;AAAA,EACE,eAAY;AAAA,EACZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,OAAO;AAAA,EACT;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAU,MAAM;AAAA,IAAM,MAAK;AAAA,IAAY,MAAM;AAAA,EAAK,CAAA;AAC3D,CAAA,GAIH,IAAA,CAAe,EAAE,MAAA,EAAA,MACrB,gBAAA,EAAC,GAAD;AAAA,EAAY,QAAQ,gBAAA,EAAC,GAAD,EAAsB,MAAA,EAAO,CAAA;AAAA,EAAG,MAAM;AAAA,EAAW,IAAI,EAAE,YAAY,EAAE;AAAI,CAAA,GAIzF,KAAA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AAA,YACF,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,iBAAiB;AAAA,YACjB,GAAI,GAAS,YAAY,EACvB,gBAAgB;AAAA,cAAE,YAAY;AAAA,cAAW,YAAY;AAAA,YAAiB,EACxE;AAAA,UACF;AAAA,UACA,SAAQ;AAAA,QACT,CAAA,GACA,GAAK,SAAS,KACb,gBAAA,EAAC,IAAD;AAAA,UACE,iBAAe;AAAA,UACf,SAAS;AAAA,UACT,MAAK;AAAA,UACL,IAAI;AAAA,YACF,WAAW;AAAA,YAGX,IAAI;AAAA,YACJ,IAAI;AAAA,YACJ,IAAI;AAAA,YACJ,GAAI,KAAiB;AAAA,cACnB,OAAO;AAAA,cACP,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,UACA,SAAQ;AAAA,UAER,UAAA,gBAAA,EAAC,GAAD;AAAA,YAAM,MAAM;AAAA,YAAM,SAAQ;AAAA,YACvB,UAAA,EAAI;AAAA,UACD,CAAA;AAAA,QACA,CAAA,CAEL;AAAA,MAEP,CAAA,GAAA,gBAAA,EAAC,IAAD;AAAA,QACE,MAAM,EAAc;AAAA,QACpB,MAAM;AAAA,QACN,UAAU,EAAQ;AAAA,QAClB,SAAS,EAAc;AAAA,MACxB,CAAA,CACI;AAAA,IACH,CAAA,CAAA;AAAA,EAEL,CAAA,GAAA,KAAQ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA,CACxC,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"CompactInsightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/CompactInsightCard.tsx"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\nimport { useGlobalStore, useInsightsV2Store } from '../../common'\nimport { TinyBarChart } from '../../common/components/TinyBarChart'\nimport { slot } from '../../core'\nimport type {\n Beat,\n DataSeries,\n InsightsPayload,\n InstanceSlotData,\n InstanceSlotRow,\n LogoRef,\n PrimaryCTA,\n} from '../../core'\nimport type { ActionDrawerTrigger } from '../../core/stores'\nimport type { AccountSwitchBlockV2Data } from '../../core/types/InsightsInstanceSlotData'\nimport { getCategoryColor } from '../../core/utils/CategoryUtil'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../core/utils/NumberFormatting'\nimport {\n BAR_ARIA_LABEL,\n buildChartData,\n buildDataSeries,\n} from '../blocks/ChartBlocks/BarchartBlock/utils'\nimport DonutChartV2 from '../blocks/ChartBlocks/DonutChartBlock/DonutChart'\nimport { donutChartVariant } from '../blocks/ChartBlocks/DonutChartBlock/layout'\nimport { getDonutSegments } from '../blocks/ChartBlocks/DonutChartBlock/utils'\nimport { formatValueByType } from '../CommonUtils'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\nimport { postCtaMessage } from '../ctaActions'\nimport { asLogoRef, asNonEmptyText, asNumber } from '../blocks/slotReaders'\nimport BadgedTile from './BadgedTile'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport LogoFromGuid from './LogoFromGuid'\nimport { ReactComponent as FeeDetectedIllustration } from './shared/images/FeeDetected.svg'\nimport { ThemedSVGImage } from './chartblocks/ThemedSVGImage'\nimport StatusBadge from './StatusBadge'\n\nconst DESCRIPTION_MAX_LINES = 2\n\n/** Figma 1941:111897: the tile the logo fills is 44px (rows are 32, the notification row 33). */\nconst ICON_SIZE = 44\n\ninterface InsightVisualProps {\n /** The slot's `logo`, when ditto's variant declares and fills one. */\n logo?: LogoRef | null\n /** The slot's whole `data`, for a visual drawn from more than the logo (`category_color`, `linked_logos`). */\n data?: InstanceSlotData\n /** The envelope's template, for a beat's own badge on `linked_logos`. */\n template?: string\n}\n\n// Figma 1943:219189: 36px logos at opposite corners of a 75×74 box, the badge and rings centred.\nconst LINKED_LOGO_SIZE = 36\nconst LINKED_BOX_WIDTH = 75\nconst LINKED_BOX_HEIGHT = 74\n\nconst CENTRED = {\n left: '50%',\n position: 'absolute',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n} as const\n\n/** Figma 222:33404 (Embedded | Bill Amount Not Standard) shows the latest three bars. */\nconst BAR_CHART_BAR_COUNT = 3\n\nconst EMBEDDED_BAR_CHART_HEIGHT = 54\nconst EMBEDDED_BAR_CHART_WIDTH = 75\n\n/** The slot's logo, or the neutral insight glyph when the slot carries none. */\nconst LogoOrFallback = ({ logo }: InsightVisualProps) =>\n logo ? (\n <LogoFromGuid logo={logo} size={ICON_SIZE} />\n ) : (\n <Box\n data-testid=\"compact-insight-card-fallback-icon\"\n sx={{\n alignItems: 'center',\n bgcolor: 'primary.lighter',\n display: 'flex',\n height: ICON_SIZE,\n justifyContent: 'center',\n width: ICON_SIZE,\n }}\n >\n <Icon color=\"primary\" fill={true} name=\"lightbulb\" size={24} />\n </Box>\n )\n\n/** Micro, and any variant not registered below: the logo alone. */\nconst PlainVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile center={<LogoOrFallback logo={logo} />} size={ICON_SIZE} sx={{ flexShrink: 0 }} />\n)\n\n/** ditto `with_warning_badge`: the logo badged with a status glyph (Figma 1941:111897). */\nconst WarningBadgeVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"warning\" />}\n />\n)\n\nconst STACKED_LOGO_SIZE = 24\n\n/** ditto `stacked_logos`: the row logo twice, plus an error badge. The copy is `aria-hidden`, so the logo is named once. */\nconst StackedLogosVisual = ({ logo }: InsightVisualProps) => (\n <BadgedTile\n bottomLeft={\n logo ? (\n <Box\n aria-hidden={true}\n sx={{\n borderRadius: '6px',\n display: 'flex',\n outline: '2px solid',\n outlineColor: 'background.paper',\n overflow: 'hidden',\n }}\n >\n <LogoFromGuid logo={{ ...logo, alt: undefined }} size={STACKED_LOGO_SIZE} />\n </Box>\n ) : undefined\n }\n center={<LogoOrFallback logo={logo} />}\n size={ICON_SIZE}\n sx={{ flexShrink: 0 }}\n topRight={<StatusBadge tone=\"error\" />}\n />\n)\n\n/**\n * ditto `with_illustration`: artwork in place of the logo tile (Fee Detected's search illustration).\n * A single SVG themed at runtime by `ThemedSVGImage`: its `brand300` elements are recolored to the\n * theme's `primary.main` (so it follows dark mode), while `fill=\"white\"` areas stay white. The\n * slot's `logo` is deliberately unused: the illustration replaces the tile.\n */\nconst IllustrationVisual = () => {\n return (\n <ThemedSVGImage\n divProps={{ style: { flexShrink: 0, lineHeight: 0, width: 'max-content' } }}\n image={FeeDetectedIllustration}\n />\n )\n}\n\nconst SWAP_BADGE_SIZE = 24\n\nconst LinkBadge = () => (\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-badge\"\n sx={{\n ...CENTRED,\n alignItems: 'center',\n bgcolor: 'primary.main',\n border: '2px solid',\n borderColor: 'primary.contrastText',\n borderRadius: '12px',\n display: 'flex',\n justifyContent: 'center',\n p: 2,\n zIndex: 1,\n }}\n >\n <Icon name=\"link\" size={16} sx={{ color: 'primary.contrastText' }} />\n </Box>\n)\n\n/**\n * Switch Direct Deposit (Figma 1941:167601): the outlined `swap_vertical_circle`, turned horizontal,\n * over a contrast disc: a primary ring and arrows on white. Drawn 1.2× so its circle fills 24px.\n */\nconst SwapBadge = () => (\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-badge\"\n sx={{\n ...CENTRED,\n alignItems: 'center',\n bgcolor: 'primary.contrastText',\n borderRadius: '50%',\n display: 'flex',\n height: SWAP_BADGE_SIZE,\n justifyContent: 'center',\n overflow: 'hidden',\n width: SWAP_BADGE_SIZE,\n zIndex: 1,\n }}\n >\n <Icon\n name=\"swap_vertical_circle\"\n size={SWAP_BADGE_SIZE * 1.2}\n sx={{ color: 'primary.main', flexShrink: 0, transform: 'rotate(-90deg)' }}\n />\n </Box>\n)\n\n/**\n * ditto `linked_logos` (Figma 1943:219189, Embedded | Discovered Accounts): the two institutions at\n * opposite corners of a 75×74 box — `from_logo` top-left, `to_logo` bottom-right — meeting on the\n * diagonal, with a badge over two rings at the centre (Switch Direct Deposit: the swap badge on an\n * outlined inner ring). The rings and badge are decorative (`aria-hidden`); each logo's accessible\n * name is its `alt`.\n */\nconst LinkedLogosVisual = ({ data, template }: InsightVisualProps) => {\n const { from_logo, to_logo } = (data ?? {}) as AccountSwitchBlockV2Data\n const isSwap = template === 'SwitchDirectDeposit'\n\n return (\n <Box\n sx={{\n flexShrink: 0,\n height: LINKED_BOX_HEIGHT,\n position: 'relative',\n width: LINKED_BOX_WIDTH,\n }}\n >\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-ring\"\n sx={{\n ...CENTRED,\n borderRadius: '50%',\n height: 36,\n width: 36,\n ...(isSwap\n ? { border: '2px solid', borderColor: 'primary.light' }\n : { bgcolor: 'primary.light' }),\n }}\n />\n <Box\n aria-hidden={true}\n data-testid=\"linked-logos-ring\"\n sx={{\n ...CENTRED,\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '50%',\n height: 48,\n width: 48,\n }}\n />\n <Box sx={{ borderRadius: '4px', left: 0, overflow: 'hidden', position: 'absolute', top: 0 }}>\n <LogoFromGuid logo={from_logo} size={LINKED_LOGO_SIZE} />\n </Box>\n <Box\n sx={{ borderRadius: '4px', bottom: 0, overflow: 'hidden', position: 'absolute', right: 0 }}\n >\n <LogoFromGuid logo={to_logo} size={LINKED_LOGO_SIZE} />\n </Box>\n {isSwap ? <SwapBadge /> : <LinkBadge />}\n </Box>\n )\n}\n\n/**\n * ditto `category_color`: a tiny bar chart of the latest bars in place of the logo tile, tinted by\n * the slot's category, the newest bar solid (Figma 222:33404). Draws nothing without a series.\n */\nconst BarChartVisual = ({ data }: InsightVisualProps) => {\n const series = buildDataSeries(slot<DataSeries>(data, 'series'))\n if (!series.length) return null\n\n const categoryGuid = slot<string>(data, 'category_guid')\n const bars = buildChartData(series, BAR_ARIA_LABEL).slice(-BAR_CHART_BAR_COUNT)\n\n return (\n <Box data-testid=\"compact-insight-card-bar-chart\" sx={{ flexShrink: 0 }}>\n <TinyBarChart\n color={(theme) =>\n categoryGuid ? getCategoryColor(categoryGuid, theme) : theme.palette.primary.main\n }\n data={bars}\n height={EMBEDDED_BAR_CHART_HEIGHT}\n width={EMBEDDED_BAR_CHART_WIDTH}\n />\n </Box>\n )\n}\n\n/**\n * ditto `with_donut`: the `credit_limit` donut, small, with no legend; another beat needs its own variant.\n * Captioned by `main.compact_label` only (\"Remains\"), never the full donut's `main.label`.\n */\nconst DonutVisual = ({ data }: InsightVisualProps) => {\n const theme = useTheme()\n const main = slot<{ compact_label?: unknown; value?: unknown; value_type?: unknown }>(\n data,\n 'main',\n )\n const legends = slot<{ value?: unknown }[]>(data, 'legends')\n const centre = asNumber(main?.value)\n const values = (Array.isArray(legends) ? legends : []).map((legend) => asNumber(legend?.value))\n if (centre === undefined || values.length !== 2 || values.some((v) => v === undefined))\n return null\n\n const { colors, arcs } = getDonutSegments(\n donutChartVariant.CreditLimit,\n {},\n values.map((value) => ({ value: value as number })),\n theme,\n )\n const valueType = typeof main?.value_type === 'string' ? main.value_type : 'amount'\n\n return (\n <Box data-testid=\"compact-insight-card-donut\" sx={{ flexShrink: 0 }}>\n <DonutChartV2\n centerLabel={asNonEmptyText(main?.compact_label)}\n centerValue={formatValueByType(centre, valueType, CURRENCY_FORMAT.whole)}\n compact={true}\n data={arcs.map((value, index) => ({ color: colors[index], value }))}\n />\n </Box>\n )\n}\n\nconst COMPARISON_WIDTH = 75\nconst COMPARISON_HEIGHT = 50\n\nconst asComparisonBar = (row: InstanceSlotRow | undefined) => {\n const label = asNonEmptyText(row?.primary_text)\n const value = asNumber(row?.amount)\n if (label === undefined || value === undefined) return undefined\n const formattedAmount = formatCurrency(value, CURRENCY_FORMAT.cents)\n return { ariaLabel: `${label}: ${formattedAmount}`, formattedAmount, label, value }\n}\n\n/**\n * ditto `compact_comparison` (Subscription Price Increase, Figma 1286:25608): the previous and new amounts as two labelled bars,\n * the new one solid, in the full card's progress-bar colour. Draws nothing without two distinct labelled rows.\n */\nconst ComparisonVisual = ({ data }: InsightVisualProps) => {\n const series = slot<InstanceSlotRow[]>(data, 'compact_series')\n const [previous, latest] = (Array.isArray(series) ? series.slice(0, 2) : []).map(asComparisonBar)\n // Equal labels share one band on the chart's x axis, so the bars would overlap.\n if (!previous || !latest || previous.label === latest.label) return null\n const bars = [previous, latest]\n\n return (\n <Box data-testid=\"compact-insight-card-comparison\" sx={{ flexShrink: 0 }}>\n <TinyBarChart\n color={(theme) => theme.palette.warning.main}\n data={bars}\n height={COMPARISON_HEIGHT}\n width={COMPARISON_WIDTH}\n />\n </Box>\n )\n}\n\n/**\n * The card's right-hand visual, one component per ditto layout variant.\n *\n * A variant names a rendering *shape*, not an insight or a surface — `with_header` already serves\n * both Large Transaction and Fee Detected — so an insight wanting the badged logo reuses\n * `with_warning_badge`. Only a genuinely different visual registers a new entry, and existing ones\n * are never touched.\n *\n * `minimal` draws the plain logo and is registered explicitly even though it matches the fallback:\n * micro and notification resolve it on every render, and an unregistered variant warns. The\n * fallback is for variants we genuinely do not know.\n */\nconst InsightVisual = createVariantBlock<InsightVisualProps>({\n variants: {\n category_color: BarChartVisual,\n compact_comparison: ComparisonVisual,\n linked_logos: LinkedLogosVisual,\n minimal: PlainVisual,\n // account_block's logo-only compact card (its `minimal` draws the `icon`).\n minimal_logo: PlainVisual,\n stacked_logos: StackedLogosVisual,\n with_donut: DonutVisual,\n with_illustration: IllustrationVisual,\n with_warning_badge: WarningBadgeVisual,\n },\n fallback: PlainVisual,\n name: 'InsightVisual',\n})\n\n/**\n * Beats whose embedded CTA the card reads from its own envelope key and opens in this card's\n * `ActionBlockLayer`, as a bar click does on the full card. The trigger names that key, so the layer\n * resolves the same CTA. Without a trigger the link posts its host message instead (Switch Direct\n * Deposit's op_1: Atomic runs only in pulse). Every other beat keeps `primary_cta` and hands it to\n * the host's `onCtaClick` (e.g. `contact_support_block`). A new beat adds its template here.\n * `boldCopy` bolds the description's `.bold-copy` spans, as Figma draws them; off for every other beat.\n */\nconst BEAT_CTA_CONFIG: Record<\n string,\n { key: 'primary_cta' | 'in_description_cta'; trigger?: ActionDrawerTrigger; boldCopy?: boolean }\n> = {\n BillAmountNotStandard: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n CreditCardCloseToLimit: {\n key: 'in_description_cta',\n trigger: 'inDescriptionCta',\n boldCopy: true,\n },\n ConnectDiscoveredAccountsV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n DuplicatePaymentV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n SwitchDirectDeposit: { key: 'in_description_cta' },\n}\n\nexport interface CompactInsightCardProps {\n /** A `micro` or `embedded` envelope. */\n payload: InsightsPayload\n /** The envelope's beat; when given, the card mounts its `ActionBlockLayer` for CTA drawers. */\n beat?: Beat\n /**\n * Makes the whole card the tap target. What a tap does is the host's decision (post to the\n * host app, open a drawer, …); the card never opens anything itself. Omit for a static card.\n */\n onTap?: () => void\n /** Receives the primary CTA when tapped. The card does not resolve the CTA's block itself. */\n onCtaClick?: (cta: PrimaryCTA) => void\n /**\n * Renders the CTA disabled — label shown, `aria-disabled`, not tappable — for a host that cannot\n * honour it (e.g. `contact_support_block` when the client's `enable_support_requests` is off).\n */\n isCtaDisabled?: boolean\n}\n\nconst stopPropagation = (event: MouseEvent) => event.stopPropagation()\n\n/**\n * The one compact renderer the micro and embedded envelopes share (`insights_v2.2.md` §8.3).\n *\n * Figma 1941:111897 (Embedded | Large Transaction): a title row with the overflow slot, the HTML\n * description with the primary CTA under it, and on the right the slot's `logo` in a\n * `<BadgedTile>`. Under ditto's `with_warning_badge` variant the tile takes a status badge; under\n * `minimal` it draws the logo alone. The card lays out from the envelope alone and never reads\n * `widget_type`.\n *\n * The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot\n * carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.\n */\nconst CompactInsightCard = ({\n beat,\n isCtaDisabled = false,\n onCtaClick,\n onTap,\n payload,\n}: CompactInsightCardProps) => {\n const stores = useGlobalStore()\n const { openActionDrawer } = useInsightsV2Store()\n const { description, instance_slot, primary_cta, title } = payload\n const beatCta = BEAT_CTA_CONFIG[payload.template ?? '']\n const cta = beatCta ? payload[beatCta.key] : primary_cta\n const message = payload.in_description_cta?.post_message_metadata\n // A link that posts needs its beat and message; without them it draws nothing.\n const canAct = !beatCta || !!beatCta.trigger || (!!beat && !!message)\n // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = asLogoRef(slot(instance_slot.data, 'logo'))\n\n const handleCtaClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (isCtaDisabled || !cta) return\n\n if (beatCta) {\n if (beat && beatCta.trigger) openActionDrawer({ guid: beat.guid, trigger: beatCta.trigger })\n else if (beat && message) {\n const { action, ...extras } = message\n postCtaMessage({ beat, stores }, { action, payload: extras })\n }\n return\n }\n if (primary_cta) onCtaClick?.(primary_cta)\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n // Only the card itself: Enter on the CTA button is the button's own click.\n if (event.target !== event.currentTarget) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n onTap?.()\n }\n }\n\n const interactiveProps = onTap\n ? { onClick: onTap, onKeyDown: handleKeyDown, role: 'button', tabIndex: 0 }\n : {}\n\n return (\n <>\n <Card\n data-testid=\"compact-insight-card\"\n {...interactiveProps}\n sx={{\n minWidth: 288,\n pb: 12,\n pl: 8,\n pr: 16,\n pt: 8,\n ...(onTap && { cursor: 'pointer' }),\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 8,\n justifyContent: 'space-between',\n pl: 8,\n pt: 4,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {title ?? ''}\n </Text>\n {/* The menu renders only when the host wired `onMenuAction` (BeatActionsProvider). */}\n <Box onClick={stopPropagation} sx={{ display: 'flex' }}>\n <InsightOptionsMenu />\n </Box>\n </Stack>\n\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, pl: 8 }}>\n <Stack sx={{ alignSelf: 'stretch', flex: 1, gap: 8, minWidth: 0, pt: 2 }}>\n {/* `html_text` is rendered server-side by mrs_content from the ditto copy template (bold\n amount / merchant), not user-authored input; painted the same way `BaseLayout` paints\n the full card's description. */}\n <P\n dangerouslySetInnerHTML={{ __html: description.html_text }}\n data-testid=\"compact-insight-card-description\"\n sx={{\n display: '-webkit-box',\n fontWeight: 'fontWeightRegular',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: DESCRIPTION_MAX_LINES,\n ...(beatCta?.boldCopy && {\n '& .bold-copy': { fontFamily: 'inherit', fontWeight: 'fontWeightBold' },\n }),\n }}\n variant=\"subtitle2\"\n />\n {cta?.label && canAct && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // The label lines up with the description (the column pads 8; the tap target keeps\n // its padding). `my: 0` drops the theme's -12px text-button margin.\n ml: -8,\n my: 0,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n <Text bold={true} variant=\"body2\">\n {cta.label}\n </Text>\n </Button>\n )}\n </Stack>\n\n <InsightVisual\n data={instance_slot.data}\n logo={rowLogo}\n template={payload.template}\n variant={instance_slot.variant}\n />\n </Stack>\n </Card>\n {/* Outside the Card: the drawer is a portal, and its clicks would otherwise bubble to `onTap`. */}\n {beat && <ActionBlockLayer beat={beat} />}\n </>\n )\n}\n\nexport default CompactInsightCard\n"],"mappings":";;;;;;;;;;;;;;;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