@mx-cartographer/experiences 9.7.13 → 9.7.15
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 +12 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +60 -67
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +0 -8
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +82 -94
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.d.ts +6 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +28 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/index.d.ts +4 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +18 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +73 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +17 -14
- package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
- package/dist/insights-v2/components/WithdrawalCard.d.ts +4 -4
- package/dist/insights-v2/components/WithdrawalCard.es.js +26 -16
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaPostMessages.es.js +8 -7
- package/dist/insights-v2/ctaActions/ctaPostMessages.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +116 -111
- package/dist/insights-v2/mappings/blocks.es.js +6 -6
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.d.ts +0 -16
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js +0 -24
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/index.d.ts +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/layout.d.ts +0 -28
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/layout.es.js +0 -63
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/layout.es.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [9.7.15] - 10-20-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - The `detailed_primary` / `detailed_success` account hero moves out of `AccountBlock` into its own `DetailedAccountBlock` block, which `account_block` still routes those variants to. Its stories move with it and gain a `detailed_celebration` confetti variant (MEW2-3344)
|
|
4
|
+
- **CHANGED** - `direct_deposit_block` is now a registry alias of `DetailedAccountBlock`, which takes over the `DirectDepositBlock` looks (`set_up_direct_deposit` as `detailed_neutral`), its flat `institution_guid` logo fallback, fixtures and stories; the `DirectDepositBlock` component is removed and its name stays exported as a `@deprecated` alias (MEW2-3344)
|
|
5
|
+
|
|
6
|
+
## [9.7.14] - 10-20-2026
|
|
7
|
+
|
|
8
|
+
- **ADDED** - `EmergencyFundWithdrawal` entry in `ctaActions/ctaPostMessages` so its primary CTA ("Make a Transfer" / "View Emergency Savings") posts the base `beat/cta` op_1, matching V1 (WEC-1941)
|
|
9
|
+
- **NOTE** - EFW is bucket 1: it reuses the existing `EmergencyFundWithdrawal` template, the existing `withdrawal_block` (separate `amount_label` + `withdrawal_date`) and `transaction_details_block`; no new block or action block was needed (WEC-1941)
|
|
10
|
+
- **FIXED** - `WithdrawalCard` formats a `YYYY-MM-DD` `withdrawal_date` (the stored beat date the bucket 1 `withdrawal_block` slot sends) as a calendar day in the viewer's locale ("October 5, 2026"), parsed as a local date so it never shifts to the day before; an already-worded date renders as sent. The mock sends the ISO date (WEC-1941)
|
|
11
|
+
- **FIXED** - `WithdrawalCard` shows an ISO-shaped date that names no real day (e.g. `2026-02-30`) as sent instead of throwing `RangeError` while rendering (WEC-1941)
|
|
12
|
+
|
|
1
13
|
## [9.7.13] - 10-20-2026
|
|
2
14
|
|
|
3
15
|
- **CHANGED** - `double_progress_bar_block` now renders from the V2 envelope: it reads the two bars from `instance_slot.data.series` as `[previous, latest]` (`primary_text` label, `amount`), formats the amount, clamps the previous bar to 0–100 (previous / latest) and draws the latest at 100%, and renders nothing unless both rows carry finite numeric amounts. The legacy `instance_slot_data.doubleProgressBar` shape is **removed** (the dead `DoubleProgressBarBlockData` type with it) — a V1 emitter of that shape now renders a blank block. The Subscription Price Increase mock fixture moves to the envelope shape (WEC-1934)
|
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
import { slot as d } from "../../../../core/types/Insights.es.js";
|
|
2
|
-
import { formatCurrency as
|
|
3
|
-
import { useContainerDimensions as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ReactComponent as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
import { formatCurrency as S } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import { useContainerDimensions as P } from "../../../hooks/useContainerDimensions.es.js";
|
|
4
|
+
import H from "../../../components/LogoFromGuid.es.js";
|
|
5
|
+
import { Confetti as N } from "../../../components/shared/Confetti.es.js";
|
|
6
|
+
import { ReactComponent as E } from "../../../components/shared/images/PaidOffCard.es.js";
|
|
7
|
+
import { ReactComponent as G } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
|
|
8
|
+
import { statusIconName as O } from "../../../components/statusIcon.es.js";
|
|
9
|
+
import { resolveVariantConfig as W } from "../../resolveVariantConfig.es.js";
|
|
10
|
+
import { isDetailedAccountVariant as q } from "../DetailedAccountBlock/layout.es.js";
|
|
11
|
+
import J from "../DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
12
|
+
import { HeaderComponent as K } from "./HeaderComponent.es.js";
|
|
13
|
+
import { getLayoutConfig as M } from "./layout.es.js";
|
|
14
|
+
import { IconComponent as Q } from "./IconComponent.es.js";
|
|
15
|
+
import { useRef as U } from "react";
|
|
15
16
|
import e from "@mui/material/Stack";
|
|
16
17
|
import { Text as l } from "@mxenabled/mxui";
|
|
17
18
|
import { Icon as D } from "@mxenabled/mx-icons";
|
|
18
19
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
19
|
-
import { useTheme as
|
|
20
|
-
import
|
|
21
|
-
var
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
logo: i?.guid ? /* @__PURE__ */ o(S, {
|
|
26
|
-
logo: i,
|
|
27
|
-
size: 48
|
|
28
|
-
}) : null,
|
|
29
|
-
name: L,
|
|
30
|
-
statusLabel: $,
|
|
31
|
-
subtitle: F
|
|
32
|
-
});
|
|
20
|
+
import { useTheme as X } from "@mui/material/styles";
|
|
21
|
+
import a from "@mui/material/Box";
|
|
22
|
+
var vo = ({ payload: x }) => {
|
|
23
|
+
const g = X(), b = U(null), { height: y, width: v } = P(b), { instance_slot: n } = x, { variant: p, institution_guid: z, institution_name: A, icon_name: B, merchant_name: F } = n;
|
|
24
|
+
if (q(p)) return /* @__PURE__ */ o(J, { payload: x });
|
|
25
|
+
const { data: i } = n, m = i !== void 0, h = d(i, "amount"), u = m ? typeof h == "number" && Number.isFinite(h) ? h : void 0 : n.amount, w = d(i, "sub_text"), R = typeof w == "string" ? w : void 0, T = m ? R : n.sub_text, L = m ? R : n.label, C = d(i, "header_text"), s = m ? typeof C == "string" ? C : void 0 : n.header_text, c = d(i, "logo"), t = W(M(g), p, "default", "AccountBlock");
|
|
33
26
|
if (t?.isConfetti) {
|
|
34
|
-
const
|
|
35
|
-
paidOffCard: /* @__PURE__ */ o(
|
|
27
|
+
const f = O(c?.guid), V = {
|
|
28
|
+
paidOffCard: /* @__PURE__ */ o(a, {
|
|
36
29
|
sx: {
|
|
37
30
|
flexShrink: 0,
|
|
38
31
|
height: 32,
|
|
39
32
|
position: "relative",
|
|
40
33
|
width: 44
|
|
41
34
|
},
|
|
42
|
-
children: /* @__PURE__ */ o(
|
|
35
|
+
children: /* @__PURE__ */ o(E, {
|
|
43
36
|
"aria-hidden": !0,
|
|
44
37
|
role: "presentation",
|
|
45
38
|
style: {
|
|
@@ -49,13 +42,13 @@ var wo = ({ payload: z }) => {
|
|
|
49
42
|
}
|
|
50
43
|
})
|
|
51
44
|
}),
|
|
52
|
-
savings: /* @__PURE__ */ o(
|
|
45
|
+
savings: /* @__PURE__ */ o(G, {
|
|
53
46
|
"aria-hidden": !0,
|
|
54
47
|
height: 55,
|
|
55
48
|
role: "presentation",
|
|
56
49
|
width: 55
|
|
57
50
|
}),
|
|
58
|
-
logo: /* @__PURE__ */ o(
|
|
51
|
+
logo: /* @__PURE__ */ o(a, {
|
|
59
52
|
sx: {
|
|
60
53
|
borderRadius: "4px",
|
|
61
54
|
flexShrink: 0,
|
|
@@ -63,8 +56,8 @@ var wo = ({ payload: z }) => {
|
|
|
63
56
|
overflow: "hidden",
|
|
64
57
|
width: 48
|
|
65
58
|
},
|
|
66
|
-
children:
|
|
67
|
-
"data-icon":
|
|
59
|
+
children: f ? /* @__PURE__ */ o(e, {
|
|
60
|
+
"data-icon": f,
|
|
68
61
|
sx: {
|
|
69
62
|
alignItems: "center",
|
|
70
63
|
bgcolor: "success.main",
|
|
@@ -74,27 +67,27 @@ var wo = ({ payload: z }) => {
|
|
|
74
67
|
},
|
|
75
68
|
children: /* @__PURE__ */ o(D, {
|
|
76
69
|
"aria-hidden": !0,
|
|
77
|
-
name:
|
|
70
|
+
name: f,
|
|
78
71
|
size: 24,
|
|
79
72
|
sx: { color: "success.contrastText" }
|
|
80
73
|
})
|
|
81
|
-
}) :
|
|
82
|
-
logo:
|
|
74
|
+
}) : c?.guid ? /* @__PURE__ */ o(H, {
|
|
75
|
+
logo: c,
|
|
83
76
|
size: 48
|
|
84
77
|
}) : null
|
|
85
78
|
})
|
|
86
|
-
}[t.graphic ?? "logo"],
|
|
79
|
+
}[t.graphic ?? "logo"], _ = d(i, "secondary_text"), $ = typeof _ == "string" && _ || (F ?? A), k = t.secondarySource === "merchant" ? $ : L, I = k ? /* @__PURE__ */ o(l, {
|
|
87
80
|
color: t.secondaryColor,
|
|
88
81
|
variant: t.secondaryVariant,
|
|
89
|
-
children:
|
|
90
|
-
}) : null,
|
|
82
|
+
children: k
|
|
83
|
+
}) : null, j = u != null ? /* @__PURE__ */ o(l, {
|
|
91
84
|
bold: !0,
|
|
92
85
|
color: "success.dark",
|
|
93
86
|
variant: t.amountVariant,
|
|
94
|
-
children: `${t.amountPrefix ?? ""}${
|
|
87
|
+
children: `${t.amountPrefix ?? ""}${S(u, "0,0.00")}`
|
|
95
88
|
}) : null;
|
|
96
|
-
return /* @__PURE__ */ r(
|
|
97
|
-
ref:
|
|
89
|
+
return /* @__PURE__ */ r(a, {
|
|
90
|
+
ref: b,
|
|
98
91
|
sx: {
|
|
99
92
|
backgroundImage: t.gradient,
|
|
100
93
|
bgcolor: "background.paper",
|
|
@@ -103,17 +96,17 @@ var wo = ({ payload: z }) => {
|
|
|
103
96
|
p: 16,
|
|
104
97
|
width: "100%"
|
|
105
98
|
},
|
|
106
|
-
children: [/* @__PURE__ */ o(
|
|
99
|
+
children: [/* @__PURE__ */ o(a, {
|
|
107
100
|
sx: {
|
|
108
101
|
inset: 0,
|
|
109
102
|
pointerEvents: "none",
|
|
110
103
|
position: "absolute",
|
|
111
104
|
zIndex: 1
|
|
112
105
|
},
|
|
113
|
-
children: /* @__PURE__ */ o(
|
|
114
|
-
height:
|
|
115
|
-
shouldRun:
|
|
116
|
-
width:
|
|
106
|
+
children: /* @__PURE__ */ o(N, {
|
|
107
|
+
height: y,
|
|
108
|
+
shouldRun: y > 0 && v > 0,
|
|
109
|
+
width: v
|
|
117
110
|
})
|
|
118
111
|
}), /* @__PURE__ */ r(e, {
|
|
119
112
|
sx: {
|
|
@@ -123,7 +116,7 @@ var wo = ({ payload: z }) => {
|
|
|
123
116
|
width: "100%",
|
|
124
117
|
zIndex: 2
|
|
125
118
|
},
|
|
126
|
-
children: [t.categoryStrip &&
|
|
119
|
+
children: [t.categoryStrip && s && /* @__PURE__ */ o(a, {
|
|
127
120
|
sx: {
|
|
128
121
|
bgcolor: "success.main",
|
|
129
122
|
px: 12,
|
|
@@ -132,7 +125,7 @@ var wo = ({ payload: z }) => {
|
|
|
132
125
|
children: /* @__PURE__ */ o(l, {
|
|
133
126
|
color: "success.contrastText",
|
|
134
127
|
variant: "caption",
|
|
135
|
-
children:
|
|
128
|
+
children: s
|
|
136
129
|
})
|
|
137
130
|
}), /* @__PURE__ */ r(e, {
|
|
138
131
|
sx: {
|
|
@@ -149,21 +142,21 @@ var wo = ({ payload: z }) => {
|
|
|
149
142
|
flexDirection: "row",
|
|
150
143
|
...t.rowSx
|
|
151
144
|
},
|
|
152
|
-
children: [/* @__PURE__ */ o(
|
|
145
|
+
children: [/* @__PURE__ */ o(a, {
|
|
153
146
|
sx: {
|
|
154
147
|
display: "flex",
|
|
155
148
|
flexShrink: 0
|
|
156
149
|
},
|
|
157
|
-
children:
|
|
150
|
+
children: V
|
|
158
151
|
}), /* @__PURE__ */ r(e, {
|
|
159
152
|
sx: {
|
|
160
153
|
flex: "1 0 0",
|
|
161
154
|
minWidth: 0
|
|
162
155
|
},
|
|
163
156
|
children: [
|
|
164
|
-
t.secondaryPosition === "above" &&
|
|
165
|
-
|
|
166
|
-
t.secondaryPosition === "below" &&
|
|
157
|
+
t.secondaryPosition === "above" && I,
|
|
158
|
+
j,
|
|
159
|
+
t.secondaryPosition === "below" && I
|
|
167
160
|
]
|
|
168
161
|
})]
|
|
169
162
|
})]
|
|
@@ -178,10 +171,10 @@ var wo = ({ payload: z }) => {
|
|
|
178
171
|
children: /* @__PURE__ */ r(e, {
|
|
179
172
|
sx: {
|
|
180
173
|
borderRadius: "8px",
|
|
181
|
-
boxShadow:
|
|
174
|
+
boxShadow: g.shadows[1],
|
|
182
175
|
width: "100%"
|
|
183
176
|
},
|
|
184
|
-
children: [
|
|
177
|
+
children: [s && /* @__PURE__ */ o(K, { headerText: s }), /* @__PURE__ */ r(e, {
|
|
185
178
|
sx: {
|
|
186
179
|
alignItems: "center",
|
|
187
180
|
bgcolor: "background.paper",
|
|
@@ -190,19 +183,19 @@ var wo = ({ payload: z }) => {
|
|
|
190
183
|
px: 16,
|
|
191
184
|
py: 12,
|
|
192
185
|
width: "100%",
|
|
193
|
-
...
|
|
186
|
+
...s && {
|
|
194
187
|
borderTopLeftRadius: "0",
|
|
195
188
|
borderTopRightRadius: "0"
|
|
196
189
|
},
|
|
197
|
-
...(
|
|
190
|
+
...(z || B || c?.guid) && { flexDirection: "row" }
|
|
198
191
|
},
|
|
199
|
-
children: [/* @__PURE__ */ o(
|
|
200
|
-
logo:
|
|
192
|
+
children: [/* @__PURE__ */ o(Q, {
|
|
193
|
+
logo: c,
|
|
201
194
|
slot: n,
|
|
202
|
-
variant:
|
|
203
|
-
}), /* @__PURE__ */ r(e, { children: [
|
|
195
|
+
variant: p
|
|
196
|
+
}), /* @__PURE__ */ r(e, { children: [u != null && /* @__PURE__ */ o(l, {
|
|
204
197
|
variant: "h2",
|
|
205
|
-
children:
|
|
198
|
+
children: S(u, "0,0.00")
|
|
206
199
|
}), /* @__PURE__ */ r(e, {
|
|
207
200
|
sx: {
|
|
208
201
|
gap: 8,
|
|
@@ -214,10 +207,10 @@ var wo = ({ payload: z }) => {
|
|
|
214
207
|
fill: !0,
|
|
215
208
|
name: t.sub_logo,
|
|
216
209
|
size: 20
|
|
217
|
-
}),
|
|
210
|
+
}), T && /* @__PURE__ */ o(l, {
|
|
218
211
|
color: "text.secondary",
|
|
219
212
|
variant: "caption",
|
|
220
|
-
children:
|
|
213
|
+
children: T
|
|
221
214
|
})]
|
|
222
215
|
})] })]
|
|
223
216
|
})]
|
|
@@ -225,7 +218,7 @@ var wo = ({ payload: z }) => {
|
|
|
225
218
|
});
|
|
226
219
|
};
|
|
227
220
|
export {
|
|
228
|
-
|
|
221
|
+
vo as default
|
|
229
222
|
};
|
|
230
223
|
|
|
231
224
|
//# sourceMappingURL=AccountBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\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'\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 {\n variant,\n account_name,\n account_type,\n status_text,\n institution_guid,\n institution_name,\n icon_name,\n merchant_name,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const dataHeaderText = slot<unknown>(data, 'header_text')\n const header_text = v2\n ? typeof dataHeaderText === 'string'\n ? dataHeaderText\n : undefined\n : instance_slot.header_text\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // \"Detailed\" hero variants — the logo-over-card account hero the Direct Deposit block also\n // renders, addressed through `account_block` per the architecture doc's Account block variants.\n // The account facts arrive flat on the slot (`account_name`, `account_type`, `status_text`).\n // The logo's accessible name is the institution name; a slot that sends only the guid falls\n // back to it rather than leaving the hero logo unnamed.\n if (layoutConfig?.isDetailed) {\n return (\n <DirectDepositCard\n {...layoutConfig.detailed}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={account_name}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n }\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n {/* An ICO- icon keeps the tile's look: an outlined 24px 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={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 // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n // V2 sends it resolved as `data.secondary_text`; the flat fields remain the fallback.\n const dataSecondaryText = slot<unknown>(data, 'secondary_text')\n const payer =\n (typeof dataSecondaryText === 'string' && dataSecondaryText) ||\n (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 bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\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 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 px: 16,\n py: 12,\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 && <Text variant=\"h2\">{formatCurrency(amount, '0,0.00')}</Text>}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\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":";;;;;;;;;;;;;;;;;;;;AAwBA,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,EACJ,SAAA,GACA,cAAA,GACA,cAAA,GACA,aAAA,GACA,kBAAA,GACA,kBAAA,GACA,WAAA,GACA,eAAA,EAAA,IACE,GAKE,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAa,EAAc,GAAM,QAAQ,GACzC,IAAS,IACX,OAAO,KAAe,YAAY,OAAO,SAAS,CAAU,IAC1D,IACA,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AA,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, type LogoRef } from '../../../../core'\nimport { 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 { 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 // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const dataHeaderText = slot<unknown>(data, 'header_text')\n const header_text = v2\n ? typeof dataHeaderText === 'string'\n ? dataHeaderText\n : undefined\n : instance_slot.header_text\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n {/* An ICO- icon keeps the tile's look: an outlined 24px 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={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 // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n // V2 sends it resolved as `data.secondary_text`; the flat fields remain the fallback.\n const dataSecondaryText = slot<unknown>(data, 'secondary_text')\n const payer =\n (typeof dataSecondaryText === 'string' && dataSecondaryText) ||\n (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 bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\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 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 px: 16,\n py: 12,\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 && <Text variant=\"h2\">{formatCurrency(amount, '0,0.00')}</Text>}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\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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A,UAAM,UAAA,EAAe,GAAQ,QAAQ;AAAA,QAAQ,CAAA,GAC9E,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,5 +1,4 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
-
import { DirectDepositCardStyleProps } from '../../../components/DirectDepositCard';
|
|
3
2
|
export interface BlockLayoutConfig {
|
|
4
3
|
background?: string;
|
|
5
4
|
logo_color?: string;
|
|
@@ -33,12 +32,5 @@ export interface BlockLayoutConfig {
|
|
|
33
32
|
secondaryVariant?: 'body2' | 'caption';
|
|
34
33
|
/** Theme color path for the secondary line. */
|
|
35
34
|
secondaryColor?: string;
|
|
36
|
-
/**
|
|
37
|
-
* When true, AccountBlock renders the "Detailed" account hero (overhanging institution logo,
|
|
38
|
-
* account name + type, status pill) through `DirectDepositCard`, styled by `detailed`.
|
|
39
|
-
*/
|
|
40
|
-
isDetailed?: boolean;
|
|
41
|
-
/** Hero card style props for the detailed variants. */
|
|
42
|
-
detailed?: DirectDepositCardStyleProps;
|
|
43
35
|
}
|
|
44
36
|
export declare const getLayoutConfig: (theme: Theme) => Record<string, BlockLayoutConfig>;
|
|
@@ -1,102 +1,90 @@
|
|
|
1
|
-
import { CELEBRATION_GRADIENT as o, WARM_LIME_ACCENT_GRADIENT as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { CELEBRATION_GRADIENT as o, WARM_LIME_ACCENT_GRADIENT as a } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
import { alpha as t } from "@mui/material/styles";
|
|
3
|
+
var e = { background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)" }, g = (r) => ({
|
|
4
|
+
overdraft_warning: {
|
|
5
|
+
background: r.palette.warning.light,
|
|
6
|
+
sub_logo: "error"
|
|
7
|
+
},
|
|
8
|
+
low_balance_alert: e,
|
|
9
|
+
low_balance: {
|
|
10
|
+
...e,
|
|
11
|
+
badge: "error"
|
|
12
|
+
},
|
|
13
|
+
status_off_track: {
|
|
14
|
+
logo_color: "background.paper",
|
|
15
|
+
logo_bGcolor: "error.main",
|
|
16
|
+
logo_border_radius: "4px",
|
|
17
|
+
background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)"
|
|
18
|
+
},
|
|
19
|
+
interest_charges_summary: {
|
|
20
|
+
logo_color: "text.primary",
|
|
21
|
+
logo_bGcolor: t(r.palette.categories?.feesCharges || "", 0.25),
|
|
22
|
+
logo_border_color: "categories.feesCharges",
|
|
23
|
+
background: "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)"
|
|
24
|
+
},
|
|
25
|
+
deposit_received: {
|
|
26
|
+
isConfetti: !0,
|
|
27
|
+
gradient: a,
|
|
28
|
+
graphic: "logo",
|
|
29
|
+
amountVariant: "h3",
|
|
30
|
+
amountPrefix: "+",
|
|
31
|
+
categoryStrip: !0,
|
|
32
|
+
rowSx: {
|
|
33
|
+
gap: 12,
|
|
34
|
+
p: 12
|
|
10
35
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
36
|
+
secondarySource: "merchant",
|
|
37
|
+
secondaryPosition: "below",
|
|
38
|
+
secondaryVariant: "body2",
|
|
39
|
+
secondaryColor: "text.primary"
|
|
40
|
+
},
|
|
41
|
+
status_on_track: {
|
|
42
|
+
isConfetti: !0,
|
|
43
|
+
gradient: a,
|
|
44
|
+
graphic: "logo",
|
|
45
|
+
amountVariant: "h2",
|
|
46
|
+
rowSx: {
|
|
47
|
+
gap: 16,
|
|
48
|
+
p: 16
|
|
15
49
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
secondarySource: "label",
|
|
51
|
+
secondaryPosition: "below",
|
|
52
|
+
secondaryVariant: "caption",
|
|
53
|
+
secondaryColor: "text.secondary"
|
|
54
|
+
},
|
|
55
|
+
payoff_celebration: {
|
|
56
|
+
isConfetti: !0,
|
|
57
|
+
gradient: o,
|
|
58
|
+
graphic: "paidOffCard",
|
|
59
|
+
amountVariant: "h2",
|
|
60
|
+
rowSx: {
|
|
61
|
+
gap: 24,
|
|
62
|
+
px: 24,
|
|
63
|
+
py: 16
|
|
21
64
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
65
|
+
secondarySource: "label",
|
|
66
|
+
secondaryPosition: "below",
|
|
67
|
+
secondaryVariant: "caption",
|
|
68
|
+
secondaryColor: "text.secondary"
|
|
69
|
+
},
|
|
70
|
+
savings_deposit: {
|
|
71
|
+
isConfetti: !0,
|
|
72
|
+
gradient: o,
|
|
73
|
+
graphic: "savings",
|
|
74
|
+
amountVariant: "h2",
|
|
75
|
+
rowSx: {
|
|
76
|
+
gap: 16,
|
|
77
|
+
p: 16
|
|
27
78
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
rowSx: {
|
|
36
|
-
gap: 12,
|
|
37
|
-
p: 12
|
|
38
|
-
},
|
|
39
|
-
secondarySource: "merchant",
|
|
40
|
-
secondaryPosition: "below",
|
|
41
|
-
secondaryVariant: "body2",
|
|
42
|
-
secondaryColor: "text.primary"
|
|
43
|
-
},
|
|
44
|
-
status_on_track: {
|
|
45
|
-
isConfetti: !0,
|
|
46
|
-
gradient: e,
|
|
47
|
-
graphic: "logo",
|
|
48
|
-
amountVariant: "h2",
|
|
49
|
-
rowSx: {
|
|
50
|
-
gap: 16,
|
|
51
|
-
p: 16
|
|
52
|
-
},
|
|
53
|
-
secondarySource: "label",
|
|
54
|
-
secondaryPosition: "below",
|
|
55
|
-
secondaryVariant: "caption",
|
|
56
|
-
secondaryColor: "text.secondary"
|
|
57
|
-
},
|
|
58
|
-
payoff_celebration: {
|
|
59
|
-
isConfetti: !0,
|
|
60
|
-
gradient: o,
|
|
61
|
-
graphic: "paidOffCard",
|
|
62
|
-
amountVariant: "h2",
|
|
63
|
-
rowSx: {
|
|
64
|
-
gap: 24,
|
|
65
|
-
px: 24,
|
|
66
|
-
py: 16
|
|
67
|
-
},
|
|
68
|
-
secondarySource: "label",
|
|
69
|
-
secondaryPosition: "below",
|
|
70
|
-
secondaryVariant: "caption",
|
|
71
|
-
secondaryColor: "text.secondary"
|
|
72
|
-
},
|
|
73
|
-
savings_deposit: {
|
|
74
|
-
isConfetti: !0,
|
|
75
|
-
gradient: o,
|
|
76
|
-
graphic: "savings",
|
|
77
|
-
amountVariant: "h2",
|
|
78
|
-
rowSx: {
|
|
79
|
-
gap: 16,
|
|
80
|
-
p: 16
|
|
81
|
-
},
|
|
82
|
-
secondarySource: "label",
|
|
83
|
-
secondaryPosition: "above",
|
|
84
|
-
secondaryVariant: "body2",
|
|
85
|
-
secondaryColor: "text.primary"
|
|
86
|
-
},
|
|
87
|
-
detailed_primary: {
|
|
88
|
-
isDetailed: !0,
|
|
89
|
-
detailed: a[t.MissingInterestRate]
|
|
90
|
-
},
|
|
91
|
-
detailed_success: {
|
|
92
|
-
isDetailed: !0,
|
|
93
|
-
detailed: a[t.InterestRateAdded]
|
|
94
|
-
},
|
|
95
|
-
default: {}
|
|
96
|
-
};
|
|
97
|
-
};
|
|
79
|
+
secondarySource: "label",
|
|
80
|
+
secondaryPosition: "above",
|
|
81
|
+
secondaryVariant: "body2",
|
|
82
|
+
secondaryColor: "text.primary"
|
|
83
|
+
},
|
|
84
|
+
default: {}
|
|
85
|
+
});
|
|
98
86
|
export {
|
|
99
|
-
|
|
87
|
+
g as getLayoutConfig
|
|
100
88
|
};
|
|
101
89
|
|
|
102
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 { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant — `h2` for milestones, `h3` for deposits. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n}\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n background:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\n },\n interest_charges_summary: {\n logo_color: 'text.primary',\n logo_bGcolor: alpha(theme.palette.categories?.feesCharges || '', 0.25),\n logo_border_color: 'categories.feesCharges',\n background:\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)',\n },\n // Shared deposit-celebration card — used by both the standard deposit and the emergency-fund\n // deposit beats (identical design, different copy), so one design-named variant serves both.\n deposit_received: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h3',\n amountPrefix: '+',\n categoryStrip: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 24, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'savings',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'above',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n // Neutral fallback for an unknown/unmatched variant: renders the plain standard card (no\n // confetti, no special background). `resolveVariantConfig` warns before falling back here.\n default: {},\n }\n}\n"],"mappings":";;AA4CA,IAAM,IAAsC,EAC1C,YACE,0FACJ,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;A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,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EAGA,SAAS,CAAC;AACZ"}
|
|
@@ -32,5 +32,5 @@ export interface AccountSwitchLayoutConfig {
|
|
|
32
32
|
/** Confetti burst filling the slot (success states). */
|
|
33
33
|
showConfetti?: boolean;
|
|
34
34
|
}
|
|
35
|
-
/** Per-variant `TransferLogoCard` props (mirrors
|
|
35
|
+
/** Per-variant `TransferLogoCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */
|
|
36
36
|
export declare const getLayoutConfig: (theme: Theme) => Record<AccountSwitchVariant, AccountSwitchLayoutConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n ACCOUNT_CONNECTED_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Account Switch block variants, keyed by the backend `instance_slot.variant`. All share\n * `TransferLogoCard`; only the slot surface, center badge and connector dots differ.\n *\n * - `AccountConnect` — Discovered Accounts pending: blue gradient, link badge.\n * - `AccountConnected` — Discovered Accounts success: pink wash, confetti, check badge.\n * - `SwitchDirectDeposit` — Switch Direct Deposit pending: flat tinted slot, arrow badge.\n * Its complete state is a different layout, served by `direct_deposit_block`.\n */\nexport const accountSwitchVariant = {\n AccountConnect: 'account_connect',\n AccountConnected: 'account_connected',\n SwitchDirectDeposit: 'switch_direct_deposit',\n} as const\n\nexport type AccountSwitchVariant = (typeof accountSwitchVariant)[keyof typeof accountSwitchVariant]\n\nexport interface AccountSwitchLayoutConfig {\n /** Slot surface color token. */\n bgcolor: string\n /** Optional gradient layered over `bgcolor`. */\n backgroundImage?: string\n /** Center badge background color token. */\n badgeBgColor: string\n /** mx-icons glyph rendered in the center badge. */\n badgeIcon: string\n /** Color token for the badge glyph. */\n badgeIconColor: string\n /** Connector-dot color token. */\n dotColor: string\n /** Enlarge the inner connector dots (6px vs 4px). */\n hasBigDots: boolean\n /** Confetti burst filling the slot (success states). */\n showConfetti?: boolean\n}\n\n/** Per-variant `TransferLogoCard` props (mirrors
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n ACCOUNT_CONNECTED_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Account Switch block variants, keyed by the backend `instance_slot.variant`. All share\n * `TransferLogoCard`; only the slot surface, center badge and connector dots differ.\n *\n * - `AccountConnect` — Discovered Accounts pending: blue gradient, link badge.\n * - `AccountConnected` — Discovered Accounts success: pink wash, confetti, check badge.\n * - `SwitchDirectDeposit` — Switch Direct Deposit pending: flat tinted slot, arrow badge.\n * Its complete state is a different layout, served by `direct_deposit_block`.\n */\nexport const accountSwitchVariant = {\n AccountConnect: 'account_connect',\n AccountConnected: 'account_connected',\n SwitchDirectDeposit: 'switch_direct_deposit',\n} as const\n\nexport type AccountSwitchVariant = (typeof accountSwitchVariant)[keyof typeof accountSwitchVariant]\n\nexport interface AccountSwitchLayoutConfig {\n /** Slot surface color token. */\n bgcolor: string\n /** Optional gradient layered over `bgcolor`. */\n backgroundImage?: string\n /** Center badge background color token. */\n badgeBgColor: string\n /** mx-icons glyph rendered in the center badge. */\n badgeIcon: string\n /** Color token for the badge glyph. */\n badgeIconColor: string\n /** Connector-dot color token. */\n dotColor: string\n /** Enlarge the inner connector dots (6px vs 4px). */\n hasBigDots: boolean\n /** Confetti burst filling the slot (success states). */\n showConfetti?: boolean\n}\n\n/** Per-variant `TransferLogoCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<AccountSwitchVariant, AccountSwitchLayoutConfig> => {\n return {\n [accountSwitchVariant.AccountConnect]: {\n backgroundImage: getPrimaryWashGradient(theme),\n bgcolor: 'background.paper',\n badgeBgColor: 'text.secondary',\n badgeIcon: 'link',\n badgeIconColor: 'primary.contrastText',\n dotColor: 'text.secondary',\n hasBigDots: true,\n },\n [accountSwitchVariant.AccountConnected]: {\n backgroundImage: ACCOUNT_CONNECTED_GRADIENT,\n bgcolor: 'background.paper',\n badgeBgColor: 'success.main',\n // Figma \"Common/Check\": a bare check on the solid success badge (not `check_circle`).\n badgeIcon: 'check',\n badgeIconColor: 'common.white',\n dotColor: 'text.secondary',\n hasBigDots: true,\n showConfetti: true,\n },\n [accountSwitchVariant.SwitchDirectDeposit]: {\n bgcolor: 'primary.lighter',\n badgeBgColor: 'neutral.darker',\n badgeIcon: 'arrow_forward',\n badgeIconColor: 'neutral.lighter',\n dotColor: 'neutral.darker',\n hasBigDots: false,\n },\n }\n}\n"],"mappings":";AAgBA,IAAa,IAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,qBAAqB;AACvB,GAwBa,IAAA,CACX,OAEO;AAAA,EACJ,CAAA,EAAqB,cAAA,GAAiB;AAAA,IACrC,iBAAiB,EAAuB,CAAK;AAAA,IAC7C,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACC,CAAA,EAAqB,gBAAA,GAAmB;AAAA,IACvC,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,cAAc;AAAA,IAEd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACC,CAAA,EAAqB,mBAAA,GAAsB;AAAA,IAC1C,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF"}
|