@mx-cartographer/experiences 9.7.66 → 9.7.68
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 +8 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +32 -31
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.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 +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +11 -11
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.d.ts +4 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +31 -28
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +44 -43
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +133 -104
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +4 -3
- package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
- package/dist/insights-v2/components/TransferLogoCard.d.ts +2 -8
- package/dist/insights-v2/components/TransferLogoCard.es.js +57 -57
- package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.es.js +1 -1
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +38 -37
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,140 +1,168 @@
|
|
|
1
|
-
import { useInsightsV2Store as
|
|
2
|
-
import { slot as
|
|
3
|
-
import { getCategoryColor as
|
|
4
|
-
import { TinyBarChart as
|
|
5
|
-
import { BAR_ARIA_LABEL as
|
|
6
|
-
import { ThemedSVGImage as
|
|
7
|
-
import
|
|
8
|
-
import { createVariantBlock as
|
|
1
|
+
import { useInsightsV2Store as S } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as u } from "../../core/types/Insights.es.js";
|
|
3
|
+
import { getCategoryColor as L } from "../../core/utils/CategoryUtil.es.js";
|
|
4
|
+
import { TinyBarChart as R } from "../../common/components/TinyBarChart.es.js";
|
|
5
|
+
import { BAR_ARIA_LABEL as E, buildChartData as V, buildDataSeries as A } from "../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
6
|
+
import { ThemedSVGImage as T } from "./chartblocks/ThemedSVGImage.es.js";
|
|
7
|
+
import x from "./LogoFromGuid.es.js";
|
|
8
|
+
import { createVariantBlock as z } from "../blocks/createVariantBlock.es.js";
|
|
9
9
|
import { ActionBlockLayer as O } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
10
|
-
import
|
|
11
|
-
import { InsightOptionsMenu as
|
|
12
|
-
import { ReactComponent as
|
|
13
|
-
import
|
|
10
|
+
import _ from "./BadgedTile.es.js";
|
|
11
|
+
import { InsightOptionsMenu as N } from "./InsightOptionsMenu.es.js";
|
|
12
|
+
import { ReactComponent as G } from "./shared/images/FeeDetected.es.js";
|
|
13
|
+
import K from "./StatusBadge.es.js";
|
|
14
14
|
import h from "@mui/material/Stack";
|
|
15
|
-
import { P
|
|
16
|
-
import
|
|
17
|
-
import { Icon as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
var
|
|
15
|
+
import { P, Text as W } from "@mxenabled/mxui";
|
|
16
|
+
import j from "@mui/material/Button";
|
|
17
|
+
import { Icon as k } from "@mxenabled/mx-icons";
|
|
18
|
+
import { Fragment as F, jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
19
|
+
import i from "@mui/material/Box";
|
|
20
|
+
import H from "@mui/material/Card";
|
|
21
|
+
var d = 44, b = 36, M = 75, X = 74, f = {
|
|
22
|
+
left: "50%",
|
|
23
|
+
position: "absolute",
|
|
24
|
+
top: "50%",
|
|
25
|
+
transform: "translate(-50%, -50%)"
|
|
26
|
+
}, C = ({ logo: r }) => r ? /* @__PURE__ */ t(x, {
|
|
22
27
|
logo: r,
|
|
23
|
-
size:
|
|
24
|
-
}) : /* @__PURE__ */ t(
|
|
28
|
+
size: d
|
|
29
|
+
}) : /* @__PURE__ */ t(i, {
|
|
25
30
|
"data-testid": "compact-insight-card-fallback-icon",
|
|
26
31
|
sx: {
|
|
27
32
|
alignItems: "center",
|
|
28
33
|
bgcolor: "primary.lighter",
|
|
29
34
|
display: "flex",
|
|
30
|
-
height:
|
|
35
|
+
height: d,
|
|
31
36
|
justifyContent: "center",
|
|
32
|
-
width:
|
|
37
|
+
width: d
|
|
33
38
|
},
|
|
34
|
-
children: /* @__PURE__ */ t(
|
|
39
|
+
children: /* @__PURE__ */ t(k, {
|
|
35
40
|
color: "primary",
|
|
36
41
|
fill: !0,
|
|
37
42
|
name: "lightbulb",
|
|
38
43
|
size: 24
|
|
39
44
|
})
|
|
40
|
-
}), y = ({ logo: r }) => /* @__PURE__ */ t(
|
|
41
|
-
center: /* @__PURE__ */ t(
|
|
42
|
-
size:
|
|
45
|
+
}), y = ({ logo: r }) => /* @__PURE__ */ t(_, {
|
|
46
|
+
center: /* @__PURE__ */ t(C, { logo: r }),
|
|
47
|
+
size: d,
|
|
43
48
|
sx: { flexShrink: 0 }
|
|
44
|
-
}),
|
|
45
|
-
center: /* @__PURE__ */ t(
|
|
46
|
-
size:
|
|
49
|
+
}), Z = ({ logo: r }) => /* @__PURE__ */ t(_, {
|
|
50
|
+
center: /* @__PURE__ */ t(C, { logo: r }),
|
|
51
|
+
size: d,
|
|
47
52
|
sx: { flexShrink: 0 },
|
|
48
|
-
topRight: /* @__PURE__ */ t(
|
|
49
|
-
}),
|
|
53
|
+
topRight: /* @__PURE__ */ t(K, { tone: "warning" })
|
|
54
|
+
}), $ = () => /* @__PURE__ */ t(T, {
|
|
50
55
|
divProps: { style: {
|
|
51
56
|
flexShrink: 0,
|
|
52
57
|
lineHeight: 0,
|
|
53
58
|
width: "max-content"
|
|
54
59
|
} },
|
|
55
|
-
image:
|
|
56
|
-
}),
|
|
57
|
-
const { from_logo:
|
|
58
|
-
return /* @__PURE__ */ s(
|
|
60
|
+
image: G
|
|
61
|
+
}), q = ({ data: r }) => {
|
|
62
|
+
const { from_logo: o, to_logo: a } = r ?? {};
|
|
63
|
+
return /* @__PURE__ */ s(i, {
|
|
59
64
|
sx: {
|
|
60
65
|
flexShrink: 0,
|
|
61
|
-
height:
|
|
66
|
+
height: X,
|
|
62
67
|
position: "relative",
|
|
63
|
-
width:
|
|
68
|
+
width: M
|
|
64
69
|
},
|
|
65
70
|
children: [
|
|
66
|
-
/* @__PURE__ */ t(
|
|
71
|
+
/* @__PURE__ */ t(i, {
|
|
72
|
+
"aria-hidden": !0,
|
|
73
|
+
"data-testid": "linked-logos-ring",
|
|
74
|
+
sx: {
|
|
75
|
+
...f,
|
|
76
|
+
bgcolor: "primary.light",
|
|
77
|
+
borderRadius: "50%",
|
|
78
|
+
height: 36,
|
|
79
|
+
width: 36
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ t(i, {
|
|
83
|
+
"aria-hidden": !0,
|
|
84
|
+
"data-testid": "linked-logos-ring",
|
|
85
|
+
sx: {
|
|
86
|
+
...f,
|
|
87
|
+
border: "1px solid",
|
|
88
|
+
borderColor: "divider",
|
|
89
|
+
borderRadius: "50%",
|
|
90
|
+
height: 48,
|
|
91
|
+
width: 48
|
|
92
|
+
}
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ t(i, {
|
|
67
95
|
sx: {
|
|
68
|
-
borderRadius: "
|
|
96
|
+
borderRadius: "4px",
|
|
69
97
|
left: 0,
|
|
70
98
|
overflow: "hidden",
|
|
71
99
|
position: "absolute",
|
|
72
100
|
top: 0
|
|
73
101
|
},
|
|
74
|
-
children: /* @__PURE__ */ t(
|
|
75
|
-
logo:
|
|
76
|
-
size:
|
|
102
|
+
children: /* @__PURE__ */ t(x, {
|
|
103
|
+
logo: o,
|
|
104
|
+
size: b
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ t(i, {
|
|
108
|
+
sx: {
|
|
109
|
+
borderRadius: "4px",
|
|
110
|
+
bottom: 0,
|
|
111
|
+
overflow: "hidden",
|
|
112
|
+
position: "absolute",
|
|
113
|
+
right: 0
|
|
114
|
+
},
|
|
115
|
+
children: /* @__PURE__ */ t(x, {
|
|
116
|
+
logo: a,
|
|
117
|
+
size: b
|
|
77
118
|
})
|
|
78
119
|
}),
|
|
79
|
-
/* @__PURE__ */ t(
|
|
120
|
+
/* @__PURE__ */ t(i, {
|
|
80
121
|
"aria-hidden": !0,
|
|
122
|
+
"data-testid": "linked-logos-badge",
|
|
81
123
|
sx: {
|
|
124
|
+
...f,
|
|
82
125
|
alignItems: "center",
|
|
83
|
-
bgcolor: "
|
|
84
|
-
|
|
126
|
+
bgcolor: "primary.main",
|
|
127
|
+
border: "2px solid",
|
|
128
|
+
borderColor: "primary.contrastText",
|
|
129
|
+
borderRadius: "12px",
|
|
85
130
|
display: "flex",
|
|
86
|
-
height: 20,
|
|
87
131
|
justifyContent: "center",
|
|
88
|
-
|
|
89
|
-
position: "absolute",
|
|
90
|
-
top: 22,
|
|
91
|
-
width: 20,
|
|
132
|
+
p: 2,
|
|
92
133
|
zIndex: 1
|
|
93
134
|
},
|
|
94
|
-
children: /* @__PURE__ */ t(
|
|
135
|
+
children: /* @__PURE__ */ t(k, {
|
|
95
136
|
name: "link",
|
|
96
|
-
size:
|
|
137
|
+
size: 16,
|
|
97
138
|
sx: { color: "primary.contrastText" }
|
|
98
139
|
})
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ t(o, {
|
|
101
|
-
sx: {
|
|
102
|
-
borderRadius: "6px",
|
|
103
|
-
bottom: 0,
|
|
104
|
-
overflow: "hidden",
|
|
105
|
-
position: "absolute",
|
|
106
|
-
right: 0
|
|
107
|
-
},
|
|
108
|
-
children: /* @__PURE__ */ t(u, {
|
|
109
|
-
logo: a,
|
|
110
|
-
size: x
|
|
111
|
-
})
|
|
112
140
|
})
|
|
113
141
|
]
|
|
114
142
|
});
|
|
115
|
-
},
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const a =
|
|
119
|
-
return /* @__PURE__ */ t(
|
|
143
|
+
}, J = ({ data: r }) => {
|
|
144
|
+
const o = A(u(r, "series"));
|
|
145
|
+
if (!o.length) return null;
|
|
146
|
+
const a = u(r, "category_guid"), n = V(o, E).slice(-3);
|
|
147
|
+
return /* @__PURE__ */ t(i, {
|
|
120
148
|
"data-testid": "compact-insight-card-bar-chart",
|
|
121
149
|
sx: { flexShrink: 0 },
|
|
122
|
-
children: /* @__PURE__ */ t(
|
|
123
|
-
color: (l) => a ?
|
|
150
|
+
children: /* @__PURE__ */ t(R, {
|
|
151
|
+
color: (l) => a ? L(a, l) : l.palette.primary.main,
|
|
124
152
|
data: n
|
|
125
153
|
})
|
|
126
154
|
});
|
|
127
|
-
},
|
|
155
|
+
}, Q = z({
|
|
128
156
|
variants: {
|
|
129
|
-
category_color:
|
|
130
|
-
linked_logos:
|
|
157
|
+
category_color: J,
|
|
158
|
+
linked_logos: q,
|
|
131
159
|
minimal: y,
|
|
132
|
-
with_illustration:
|
|
133
|
-
with_warning_badge:
|
|
160
|
+
with_illustration: $,
|
|
161
|
+
with_warning_badge: Z
|
|
134
162
|
},
|
|
135
163
|
fallback: y,
|
|
136
164
|
name: "InsightVisual"
|
|
137
|
-
}),
|
|
165
|
+
}), U = {
|
|
138
166
|
BillAmountNotStandard: {
|
|
139
167
|
key: "in_description_cta",
|
|
140
168
|
trigger: "inDescriptionCta"
|
|
@@ -143,20 +171,20 @@ var c = 44, x = 32, k = ({ logo: r }) => r ? /* @__PURE__ */ t(u, {
|
|
|
143
171
|
key: "in_description_cta",
|
|
144
172
|
trigger: "inDescriptionCta"
|
|
145
173
|
}
|
|
146
|
-
},
|
|
147
|
-
const { openActionDrawer:
|
|
148
|
-
if (e.stopPropagation(), !(
|
|
149
|
-
if (
|
|
150
|
-
r &&
|
|
174
|
+
}, Y = (r) => r.stopPropagation(), kt = ({ beat: r, isCtaDisabled: o = !1, onCtaClick: a, onTap: n, payload: l }) => {
|
|
175
|
+
const { openActionDrawer: I } = S(), { description: v, instance_slot: g, primary_cta: m, title: w } = l, c = U[l.template ?? ""], p = c ? l[c.key] : m, B = u(g.data, "logo"), D = (e) => {
|
|
176
|
+
if (e.stopPropagation(), !(o || !p)) {
|
|
177
|
+
if (c) {
|
|
178
|
+
r && I({
|
|
151
179
|
guid: r.guid,
|
|
152
|
-
trigger:
|
|
180
|
+
trigger: c.trigger
|
|
153
181
|
});
|
|
154
182
|
return;
|
|
155
183
|
}
|
|
156
|
-
|
|
184
|
+
m && a?.(m);
|
|
157
185
|
}
|
|
158
186
|
};
|
|
159
|
-
return /* @__PURE__ */ s(
|
|
187
|
+
return /* @__PURE__ */ s(F, { children: [/* @__PURE__ */ s(H, {
|
|
160
188
|
"data-testid": "compact-insight-card",
|
|
161
189
|
...n ? {
|
|
162
190
|
onClick: n,
|
|
@@ -183,14 +211,14 @@ var c = 44, x = 32, k = ({ logo: r }) => r ? /* @__PURE__ */ t(u, {
|
|
|
183
211
|
pl: 8,
|
|
184
212
|
pt: 4
|
|
185
213
|
},
|
|
186
|
-
children: [/* @__PURE__ */ t(
|
|
214
|
+
children: [/* @__PURE__ */ t(W, {
|
|
187
215
|
bold: !0,
|
|
188
216
|
variant: "body1",
|
|
189
|
-
children:
|
|
190
|
-
}), /* @__PURE__ */ t(
|
|
191
|
-
onClick:
|
|
217
|
+
children: w ?? ""
|
|
218
|
+
}), /* @__PURE__ */ t(i, {
|
|
219
|
+
onClick: Y,
|
|
192
220
|
sx: { display: "flex" },
|
|
193
|
-
children: /* @__PURE__ */ t(
|
|
221
|
+
children: /* @__PURE__ */ t(N, {})
|
|
194
222
|
})]
|
|
195
223
|
}), /* @__PURE__ */ s(h, {
|
|
196
224
|
sx: {
|
|
@@ -205,37 +233,38 @@ var c = 44, x = 32, k = ({ logo: r }) => r ? /* @__PURE__ */ t(u, {
|
|
|
205
233
|
gap: 8,
|
|
206
234
|
minWidth: 0
|
|
207
235
|
},
|
|
208
|
-
children: [/* @__PURE__ */ t(
|
|
209
|
-
dangerouslySetInnerHTML: { __html:
|
|
236
|
+
children: [/* @__PURE__ */ t(P, {
|
|
237
|
+
dangerouslySetInnerHTML: { __html: v.html_text },
|
|
210
238
|
"data-testid": "compact-insight-card-description",
|
|
239
|
+
sx: { fontWeight: "fontWeightRegular" },
|
|
211
240
|
variant: "subtitle2"
|
|
212
|
-
}),
|
|
213
|
-
"aria-disabled":
|
|
214
|
-
onClick:
|
|
241
|
+
}), p?.label && /* @__PURE__ */ t(j, {
|
|
242
|
+
"aria-disabled": o,
|
|
243
|
+
onClick: D,
|
|
215
244
|
size: "small",
|
|
216
245
|
sx: {
|
|
217
246
|
alignSelf: "flex-start",
|
|
218
247
|
mt: 5,
|
|
219
248
|
ml: -8,
|
|
220
249
|
px: 8,
|
|
221
|
-
...
|
|
250
|
+
...o && {
|
|
222
251
|
color: "text.disabled",
|
|
223
252
|
cursor: "default"
|
|
224
253
|
}
|
|
225
254
|
},
|
|
226
255
|
variant: "text",
|
|
227
|
-
children:
|
|
256
|
+
children: p.label
|
|
228
257
|
})]
|
|
229
|
-
}), /* @__PURE__ */ t(
|
|
230
|
-
data:
|
|
231
|
-
logo:
|
|
232
|
-
variant:
|
|
258
|
+
}), /* @__PURE__ */ t(Q, {
|
|
259
|
+
data: g.data,
|
|
260
|
+
logo: B,
|
|
261
|
+
variant: g.variant
|
|
233
262
|
})]
|
|
234
263
|
})]
|
|
235
264
|
}), r && /* @__PURE__ */ t(O, { beat: r })] });
|
|
236
265
|
};
|
|
237
266
|
export {
|
|
238
|
-
|
|
267
|
+
kt as default
|
|
239
268
|
};
|
|
240
269
|
|
|
241
270
|
//# sourceMappingURL=CompactInsightCard.es.js.map
|
|
@@ -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 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 { useInsightsV2Store } from '../../common'\nimport { TinyBarChart } from '../../common/components/TinyBarChart'\nimport { slot } from '../../core'\nimport type {\n Beat,\n DataSeries,\n InsightsPayload,\n InstanceSlotData,\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 {\n BAR_ARIA_LABEL,\n buildChartData,\n buildDataSeries,\n} from '../blocks/ChartBlocks/BarchartBlock/utils'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\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\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}\n\nconst LINKED_LOGO_SIZE = 32\n\n/** Figma 222:33404 (Embedded | Bill Amount Not Standard) shows the latest three bars. */\nconst BAR_CHART_BAR_COUNT = 3\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\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\n/**\n * ditto `linked_logos` (Figma 1943:219166, Embedded | Discovered Accounts): the two institutions\n * overlapping on a diagonal — `from_logo` top-left, `to_logo` bottom-right — with a link badge where\n * they meet. The badge is decorative (`aria-hidden`); each logo's accessible name is its `alt`.\n */\nconst LinkedLogosVisual = ({ data }: InsightVisualProps) => {\n const { from_logo, to_logo } = (data ?? {}) as AccountSwitchBlockV2Data\n\n return (\n <Box sx={{ flexShrink: 0, height: 64, position: 'relative', width: 64 }}>\n <Box sx={{ borderRadius: '6px', left: 0, overflow: 'hidden', position: 'absolute', top: 0 }}>\n <LogoFromGuid logo={from_logo} size={LINKED_LOGO_SIZE} />\n </Box>\n <Box\n aria-hidden={true}\n sx={{\n alignItems: 'center',\n bgcolor: 'text.secondary',\n borderRadius: '50%',\n display: 'flex',\n height: 20,\n justifyContent: 'center',\n left: 22,\n position: 'absolute',\n top: 22,\n width: 20,\n zIndex: 1,\n }}\n >\n <Icon name=\"link\" size={14} sx={{ color: 'primary.contrastText' }} />\n </Box>\n <Box\n sx={{ borderRadius: '6px', bottom: 0, overflow: 'hidden', position: 'absolute', right: 0 }}\n >\n <LogoFromGuid logo={to_logo} size={LINKED_LOGO_SIZE} />\n </Box>\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 />\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 linked_logos: LinkedLogosVisual,\n minimal: PlainVisual,\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. Every other beat keeps `primary_cta` and hands it to the host's `onCtaClick`\n * (e.g. `contact_support_block`). A new beat adds its template here.\n */\nconst BEAT_CTA_CONFIG: Record<\n string,\n { key: 'primary_cta' | 'in_description_cta'; trigger: ActionDrawerTrigger }\n> = {\n BillAmountNotStandard: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n ConnectDiscoveredAccountsV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\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 { 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 // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = slot<LogoRef>(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) openActionDrawer({ guid: beat.guid, trigger: beatCta.trigger })\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={{ flexDirection: 'row', gap: 16, pl: 8, pt: 4 }}>\n <Stack sx={{ flex: 1, gap: 8, minWidth: 0 }}>\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 variant=\"subtitle2\"\n />\n {cta?.label && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // Figma 1941:111897 lines the CTA label up with the description's left edge. The\n // column already pads 8, so the button's own 8 is pulled back out — padding kept so\n // the tap target does not shrink.\n mt: 5,\n ml: -8,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n {cta.label}\n </Button>\n )}\n </Stack>\n\n <InsightVisual data={instance_slot.data} logo={rowLogo} variant={instance_slot.variant} />\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":";;;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAY,IASZ,IAAmB,IAMnB,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,SA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BAAe;AAAA,UACf,SAAS;AAAA,UACT,MAAK;AAAA,UACL,IAAI;AAAA,YACF,WAAW;AAAA,YAIX,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,UAEP,UAAA,EAAI;AAAA,QACC,CAAA,CAEL;AAAA,MAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAe,MAAM,EAAc;AAAA,QAAM,MAAM;AAAA,QAAS,SAAS,EAAc;AAAA,MAAU,CAAA,CACpF;AAAA,IACH,CAAA,CAAA;AAAA,EAEL,CAAA,GAAA,KAAQ,gBAAA,EAAC,GAAD,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 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 { useInsightsV2Store } from '../../common'\nimport { TinyBarChart } from '../../common/components/TinyBarChart'\nimport { slot } from '../../core'\nimport type {\n Beat,\n DataSeries,\n InsightsPayload,\n InstanceSlotData,\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 {\n BAR_ARIA_LABEL,\n buildChartData,\n buildDataSeries,\n} from '../blocks/ChartBlocks/BarchartBlock/utils'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { createVariantBlock } from '../blocks/createVariantBlock'\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\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}\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\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\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\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 link badge over two rings at the centre. The rings and badge are decorative (`aria-hidden`); each\n * logo's accessible name is its `alt`.\n */\nconst LinkedLogosVisual = ({ data }: InsightVisualProps) => {\n const { from_logo, to_logo } = (data ?? {}) as AccountSwitchBlockV2Data\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={{ ...CENTRED, bgcolor: 'primary.light', borderRadius: '50%', height: 36, width: 36 }}\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 <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 </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 />\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 linked_logos: LinkedLogosVisual,\n minimal: PlainVisual,\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. Every other beat keeps `primary_cta` and hands it to the host's `onCtaClick`\n * (e.g. `contact_support_block`). A new beat adds its template here.\n */\nconst BEAT_CTA_CONFIG: Record<\n string,\n { key: 'primary_cta' | 'in_description_cta'; trigger: ActionDrawerTrigger }\n> = {\n BillAmountNotStandard: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\n ConnectDiscoveredAccountsV2: { key: 'in_description_cta', trigger: 'inDescriptionCta' },\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 { 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 // Reduced variants (`minimal`, `with_warning_badge`) declare a bare `logo` slot.\n const rowLogo = slot<LogoRef>(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) openActionDrawer({ guid: beat.guid, trigger: beatCta.trigger })\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={{ flexDirection: 'row', gap: 16, pl: 8, pt: 4 }}>\n <Stack sx={{ flex: 1, gap: 8, minWidth: 0 }}>\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={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {cta?.label && (\n <Button\n aria-disabled={isCtaDisabled}\n onClick={handleCtaClick}\n size=\"small\"\n sx={{\n alignSelf: 'flex-start',\n // Figma 1941:111897 lines the CTA label up with the description's left edge. The\n // column already pads 8, so the button's own 8 is pulled back out — padding kept so\n // the tap target does not shrink.\n mt: 5,\n ml: -8,\n px: 8,\n ...(isCtaDisabled && {\n color: 'text.disabled',\n cursor: 'default',\n }),\n }}\n variant=\"text\"\n >\n {cta.label}\n </Button>\n )}\n </Stack>\n\n <InsightVisual data={instance_slot.data} logo={rowLogo} variant={instance_slot.variant} />\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":";;;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAY,IAUZ,IAAmB,IACnB,IAAmB,IACnB,IAAoB,IAEpB,IAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,KAAK;AAAA,EACL,WAAW;AACb,GAMM,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,E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AAyB,EAAE,QAAQ,EAAY,UAAU;AAAA,UACzD,eAAY;AAAA,UACZ,IAAI,EAAE,YAAY,oBAAoB;AAAA,UACtC,SAAQ;AAAA,QACT,CAAA,GACA,GAAK,SACJ,gBAAA,EAAC,GAAD;AAAA,UACE,iBAAe;AAAA,UACf,SAAS;AAAA,UACT,MAAK;AAAA,UACL,IAAI;AAAA,YACF,WAAW;AAAA,YAIX,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,UAEP,UAAA,EAAI;AAAA,QACC,CAAA,CAEL;AAAA,MAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAe,MAAM,EAAc;AAAA,QAAM,MAAM;AAAA,QAAS,SAAS,EAAc;AAAA,MAAU,CAAA,CACpF;AAAA,IACH,CAAA,CAAA;AAAA,EAEL,CAAA,GAAA,KAAQ,gBAAA,EAAC,GAAD,EAAwB,MAAA,EAAO,CAAA,CACxC,EAAA,CAAA;AAEN"}
|
|
@@ -7,10 +7,10 @@ var f = {
|
|
|
7
7
|
bgcolor: "grey.200",
|
|
8
8
|
borderColor: "grey.200",
|
|
9
9
|
labelColor: "text.primary"
|
|
10
|
-
}, u = ({ backgroundImage:
|
|
10
|
+
}, u = ({ backgroundImage: a, bgcolor: t = "primary.lighter", logo: i, name: l, nameVariant: d = "body2", pill: o = f, showConfetti: b = !1, statusLabel: e, subtitle: c }) => /* @__PURE__ */ r(n, {
|
|
11
11
|
backdrop: b ? /* @__PURE__ */ r(C, {}) : void 0,
|
|
12
|
-
backgroundImage:
|
|
13
|
-
bgcolor:
|
|
12
|
+
backgroundImage: a,
|
|
13
|
+
bgcolor: t,
|
|
14
14
|
logo: i,
|
|
15
15
|
name: l,
|
|
16
16
|
nameVariant: d,
|
|
@@ -28,6 +28,7 @@ var f = {
|
|
|
28
28
|
labelColor: o.labelColor,
|
|
29
29
|
sx: {
|
|
30
30
|
border: "none",
|
|
31
|
+
gap: 4,
|
|
31
32
|
px: 12
|
|
32
33
|
}
|
|
33
34
|
}) : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectDepositCard.es.js","names":[],"sources":["../../../src/insights-v2/components/DirectDepositCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport AccountHeroCard from './AccountHeroCard'\nimport StatusPill from './StatusPill'\n\nimport { ConfettiOverlay } from './shared/ConfettiOverlay'\n\nexport interface DirectDepositPillConfig {\n /** Pill background color token. */\n bgcolor: string\n /** Pill border color token. */\n borderColor: string\n /** Pill label color token. */\n labelColor: string\n /** Optional mx-icons glyph rendered before the label (e.g. `check_circle`). */\n icon?: string\n}\n\n/**\n * Style props for the card. Variant-specific values live in the Direct Deposit\n * block's `layout.ts` (`getLayoutConfig`) — the card itself is variant-agnostic.\n */\nexport interface DirectDepositCardStyleProps {\n /** Slot surface token behind the white hero card. Default `primary.lighter`. */\n bgcolor?: string\n /** Decorative wash layered over `bgcolor` (celebration/gradient slots). */\n backgroundImage?: string\n /** Confetti burst behind the hero card (complete states). */\n showConfetti?: boolean\n /** Hero name typography. Default `body2` (13/16); rate variants use `body1` (15/20). */\n nameVariant?: 'body1' | 'body2'\n /** Status pill color tokens + optional leading glyph. */\n pill?: DirectDepositPillConfig\n}\n\nconst NEUTRAL_PILL: DirectDepositPillConfig = {\n bgcolor: 'grey.200',\n borderColor: 'grey.200',\n labelColor: 'text.primary',\n}\n\ninterface DirectDepositCardProps extends DirectDepositCardStyleProps {\n /** Institution/account logo, rendered overhanging the hero card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line, e.g. \"Checking Account\" / \"Credit Card\". */\n subtitle?: ReactNode\n /** Optional status pill label, e.g. \"Direct Deposit Not Set Up\". */\n statusLabel?: ReactNode\n}\n\n/**\n * The basic Direct Deposit hero card: an overhanging logo above a white card\n * with a name, optional subtitle, and a status pill, over a tinted/gradient\n * slot with an optional confetti backdrop.\n *\n * Purely presentational — it knows nothing about beats or variants. The Direct\n * Deposit block resolves `instance_slot.variant` to these style props via its\n * `layout.ts` (`getLayoutConfig`).\n */\nconst DirectDepositCard = ({\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n pill = NEUTRAL_PILL,\n showConfetti = false,\n statusLabel,\n subtitle,\n}: DirectDepositCardProps) => {\n return (\n <AccountHeroCard\n backdrop={showConfetti ? <ConfettiOverlay /> : undefined}\n backgroundImage={backgroundImage}\n bgcolor={bgcolor}\n logo={logo}\n name={name}\n nameVariant={nameVariant}\n status={\n statusLabel ? (\n <StatusPill\n bgcolor={pill.bgcolor}\n borderColor={pill.borderColor}\n icon={\n pill.icon ? (\n <Icon\n aria-hidden={true}\n data-testid=\"pill-icon\"\n name={pill.icon}\n size={16}\n sx={{ color: pill.labelColor }}\n />\n ) : undefined\n }\n label={statusLabel}\n labelColor={pill.labelColor}\n // Figma pill geometry: 24px tall, 12px side padding, no stroke\n // (StatusPill defaults draw a 1px border and
|
|
1
|
+
{"version":3,"file":"DirectDepositCard.es.js","names":[],"sources":["../../../src/insights-v2/components/DirectDepositCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport AccountHeroCard from './AccountHeroCard'\nimport StatusPill from './StatusPill'\n\nimport { ConfettiOverlay } from './shared/ConfettiOverlay'\n\nexport interface DirectDepositPillConfig {\n /** Pill background color token. */\n bgcolor: string\n /** Pill border color token. */\n borderColor: string\n /** Pill label color token. */\n labelColor: string\n /** Optional mx-icons glyph rendered before the label (e.g. `check_circle`). */\n icon?: string\n}\n\n/**\n * Style props for the card. Variant-specific values live in the Direct Deposit\n * block's `layout.ts` (`getLayoutConfig`) — the card itself is variant-agnostic.\n */\nexport interface DirectDepositCardStyleProps {\n /** Slot surface token behind the white hero card. Default `primary.lighter`. */\n bgcolor?: string\n /** Decorative wash layered over `bgcolor` (celebration/gradient slots). */\n backgroundImage?: string\n /** Confetti burst behind the hero card (complete states). */\n showConfetti?: boolean\n /** Hero name typography. Default `body2` (13/16); rate variants use `body1` (15/20). */\n nameVariant?: 'body1' | 'body2'\n /** Status pill color tokens + optional leading glyph. */\n pill?: DirectDepositPillConfig\n}\n\nconst NEUTRAL_PILL: DirectDepositPillConfig = {\n bgcolor: 'grey.200',\n borderColor: 'grey.200',\n labelColor: 'text.primary',\n}\n\ninterface DirectDepositCardProps extends DirectDepositCardStyleProps {\n /** Institution/account logo, rendered overhanging the hero card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line, e.g. \"Checking Account\" / \"Credit Card\". */\n subtitle?: ReactNode\n /** Optional status pill label, e.g. \"Direct Deposit Not Set Up\". */\n statusLabel?: ReactNode\n}\n\n/**\n * The basic Direct Deposit hero card: an overhanging logo above a white card\n * with a name, optional subtitle, and a status pill, over a tinted/gradient\n * slot with an optional confetti backdrop.\n *\n * Purely presentational — it knows nothing about beats or variants. The Direct\n * Deposit block resolves `instance_slot.variant` to these style props via its\n * `layout.ts` (`getLayoutConfig`).\n */\nconst DirectDepositCard = ({\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n pill = NEUTRAL_PILL,\n showConfetti = false,\n statusLabel,\n subtitle,\n}: DirectDepositCardProps) => {\n return (\n <AccountHeroCard\n backdrop={showConfetti ? <ConfettiOverlay /> : undefined}\n backgroundImage={backgroundImage}\n bgcolor={bgcolor}\n logo={logo}\n name={name}\n nameVariant={nameVariant}\n status={\n statusLabel ? (\n <StatusPill\n bgcolor={pill.bgcolor}\n borderColor={pill.borderColor}\n icon={\n pill.icon ? (\n <Icon\n aria-hidden={true}\n data-testid=\"pill-icon\"\n name={pill.icon}\n size={16}\n sx={{ color: pill.labelColor }}\n />\n ) : undefined\n }\n label={statusLabel}\n labelColor={pill.labelColor}\n // Figma pill geometry: 24px tall, 12px side padding, 4px glyph gap, no stroke\n // (StatusPill defaults draw a 1px border, 16px padding and a 6px gap).\n sx={{ border: 'none', gap: 4, px: 12 }}\n />\n ) : undefined\n }\n subtitle={subtitle}\n />\n )\n}\n\nexport default DirectDepositCard\n"],"mappings":";;;;;AAqCA,IAAM,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAsBM,IAAA,CAAqB,EACzB,iBAAA,GACA,SAAA,IAAU,mBACV,MAAA,GACA,MAAA,GACA,aAAA,IAAc,SACd,MAAA,IAAO,GACP,cAAA,IAAe,IACf,aAAA,GACA,UAAA,EAAA,MAGE,gBAAA,EAAC,GAAD;AAAA,EACE,UAAU,IAAe,gBAAA,EAAC,GAAD,CAAkB,CAAA,IAAI;AAAA,EAC9B,iBAAA;AAAA,EACR,SAAA;AAAA,EACH,MAAA;AAAA,EACA,MAAA;AAAA,EACO,aAAA;AAAA,EACb,QACE,IACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAS,EAAK;AAAA,IACd,aAAa,EAAK;AAAA,IAClB,MACE,EAAK,OACH,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,eAAY;AAAA,MACZ,MAAM,EAAK;AAAA,MACX,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,IAC9B,CAAA,IACC;AAAA,IAEN,OAAO;AAAA,IACP,YAAY,EAAK;AAAA,IAGjB,IAAI;AAAA,MAAE,QAAQ;AAAA,MAAQ,KAAK;AAAA,MAAG,IAAI;AAAA,IAAG;AAAA,EACtC,CAAA,IACC;AAAA,EAEI,UAAA;AACX,CAAA"}
|
|
@@ -34,18 +34,12 @@ interface TransferLogoCardProps {
|
|
|
34
34
|
showConfetti?: boolean;
|
|
35
35
|
sx?: SxProps;
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Confetti overlay for the success state. Measures the container and fires the
|
|
39
|
-
* burst once dimensions arrive. Scoped to this component so the resize listener
|
|
40
|
-
* only mounts when confetti is shown.
|
|
41
|
-
*/
|
|
42
37
|
/**
|
|
43
38
|
* A from → to account transfer visual: two institution logos on a rounded track
|
|
44
39
|
* with a central arrow badge and connector dots between them.
|
|
45
40
|
*
|
|
46
|
-
* Figma: Switch Direct Deposit (default) Content.
|
|
47
|
-
*
|
|
48
|
-
* Scope is the Content section only.
|
|
41
|
+
* Figma: Switch Direct Deposit (default) and Discovered Accounts Content. Scope is the Content
|
|
42
|
+
* section only.
|
|
49
43
|
*/
|
|
50
44
|
declare const TransferLogoCard: ({ badgeBgColor, bgcolor, backgroundImage, dotColor, from, hasBigDots, icon, showConfetti, size, to, sx, }: TransferLogoCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
45
|
export default TransferLogoCard;
|