@mx-cartographer/experiences 9.7.198 → 9.7.199-alpha-moratorium

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/core/types/Insights.d.ts +1 -1
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
  5. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +4 -4
  6. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +4 -4
  7. package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +4 -4
  8. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js +8 -8
  9. package/dist/insights/components/shared/Charts/EmptyBarChart.es.js +4 -4
  10. package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js +4 -4
  11. package/dist/insights/index.es.js +84 -84
  12. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
  13. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
  15. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
  16. package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
  18. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
  19. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +3 -1
  21. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +12 -11
  22. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
  23. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +2 -2
  24. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +13 -13
  25. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
  26. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +10 -4
  27. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +78 -71
  28. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  29. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
  30. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
  31. package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
  32. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +30 -24
  33. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
  34. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
  35. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
  36. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
  37. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
  38. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +10 -0
  39. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +17 -0
  40. package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
  41. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +25 -25
  42. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
  43. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
  44. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
  45. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
  46. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
  47. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  48. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
  49. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
  50. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  51. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
  52. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
  53. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
  54. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
  55. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  56. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +5 -3
  57. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -9
  58. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  59. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +28 -27
  60. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
  61. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  62. package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
  63. package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
  64. package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +26 -0
  65. package/dist/insights-v2/components/CompactDirectDepositCard.es.js +73 -0
  66. package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
  67. package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
  68. package/dist/insights-v2/components/DirectDepositCard.es.js +22 -20
  69. package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
  70. package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
  71. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  72. package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
  73. package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
  74. package/dist/insights-v2/components/TransactionListCard.es.js +25 -25
  75. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  76. package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
  77. package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
  78. package/dist/insights-v2/index.es.js +120 -116
  79. package/dist/insights-v2/mappings/blocks.es.js +118 -116
  80. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  81. package/dist/microinsights/cards/InsightCard.es.js +53 -53
  82. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  83. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- import { slot as s } from "../../../../../core/types/Insights.es.js";
2
- import { CURRENCY_FORMAT as C, formatCurrency as v } from "../../../../../core/utils/NumberFormatting.es.js";
3
- import { asNonEmptyText as d } from "../../../slotReaders.es.js";
4
- import { ELEVATION_SHADOW as S } from "../../../../components/shared/elevation.es.js";
5
- import _ from "react";
6
- import l from "@mui/material/Stack";
7
- import { Text as h } from "@mxenabled/mxui";
8
- import { CheckCircle as R } from "@mxenabled/mx-icons";
1
+ import { slot as m } from "../../../../../core/types/Insights.es.js";
2
+ import { CURRENCY_FORMAT as b, formatCurrency as w } from "../../../../../core/utils/NumberFormatting.es.js";
3
+ import { asNonEmptyText as h } from "../../../slotReaders.es.js";
4
+ import { ELEVATION_SHADOW as C } from "../../../../components/shared/elevation.es.js";
5
+ import v from "react";
6
+ import s from "@mui/material/Stack";
7
+ import { Text as c } from "@mxenabled/mxui";
8
+ import { CheckCircle as S } from "@mxenabled/mx-icons";
9
9
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
10
- import { alpha as f } from "@mui/material/styles";
11
- import m from "@mui/material/Box";
12
- var u = [
10
+ import { alpha as g } from "@mui/material/styles";
11
+ import l from "@mui/material/Box";
12
+ var f = [
13
13
  100,
14
14
  500,
15
15
  1e3
16
- ], y = 0.25, k = (r) => Number.isInteger(r) && r >= 1 && r <= u.length, g = ({ solid: r }) => /* @__PURE__ */ e(m, {
16
+ ], u = 0.25, M = (r) => Number.isInteger(r) && r >= 1 && r <= f.length, x = ({ solid: r }) => /* @__PURE__ */ e(l, {
17
17
  "aria-hidden": !0,
18
18
  sx: (t) => ({
19
- bgcolor: r ? "primary.main" : f(t.palette.primary.main, y),
19
+ bgcolor: r ? "primary.main" : g(t.palette.primary.main, u),
20
20
  flex: 1,
21
21
  height: 2,
22
22
  mt: 11
23
23
  })
24
- }), I = ({ state: r }) => r === "reached" ? /* @__PURE__ */ e(R, {
24
+ }), R = ({ state: r }) => r === "reached" ? /* @__PURE__ */ e(S, {
25
25
  "aria-hidden": !0,
26
26
  filled: !0,
27
27
  size: 24,
28
28
  sx: { color: "primary.main" }
29
- }) : /* @__PURE__ */ e(m, {
29
+ }) : /* @__PURE__ */ e(l, {
30
30
  "aria-hidden": !0,
31
31
  sx: {
32
32
  alignItems: "center",
@@ -35,92 +35,88 @@ var u = [
35
35
  justifyContent: "center",
36
36
  width: 24
37
37
  },
38
- children: /* @__PURE__ */ e(m, { sx: (t) => r === "current" ? {
38
+ children: /* @__PURE__ */ e(l, { sx: (t) => r === "current" ? {
39
39
  border: "2px solid",
40
40
  borderColor: "primary.main",
41
41
  borderRadius: "50%",
42
42
  height: 20,
43
43
  width: 20
44
44
  } : {
45
- bgcolor: f(t.palette.primary.main, y),
45
+ bgcolor: g(t.palette.primary.main, u),
46
46
  borderRadius: "50%",
47
47
  height: 20,
48
48
  width: 20
49
49
  } })
50
- }), M = ({ currentStep: r, headline: t, isMini: i, label: o, miniHeadline: b }) => {
51
- const p = i ? b ?? t : t;
52
- return /* @__PURE__ */ e(m, {
50
+ }), _ = ({ currentStep: r, headline: t, isMini: o, label: i }) => /* @__PURE__ */ e(l, {
51
+ sx: {
52
+ px: 16,
53
+ py: 4
54
+ },
55
+ children: /* @__PURE__ */ n(s, {
53
56
  sx: {
54
- px: 16,
55
- py: 4
57
+ bgcolor: "primary.lighter",
58
+ border: "1px solid",
59
+ borderColor: "primary.main",
60
+ borderRadius: "8px",
61
+ boxShadow: C[1],
62
+ gap: 16,
63
+ py: 16
56
64
  },
57
- children: /* @__PURE__ */ n(l, {
58
- sx: {
59
- bgcolor: "primary.lighter",
60
- border: "1px solid",
61
- borderColor: "primary.main",
62
- borderRadius: "8px",
63
- boxShadow: S[1],
64
- gap: 16,
65
- py: 16
66
- },
67
- children: [/* @__PURE__ */ n(l, {
68
- sx: { px: 16 },
69
- children: [!i && o && /* @__PURE__ */ e(h, {
70
- color: "text.secondary",
65
+ children: [/* @__PURE__ */ n(s, {
66
+ sx: { px: 16 },
67
+ children: [!o && i && /* @__PURE__ */ e(c, {
68
+ color: "text.secondary",
69
+ sx: {
70
+ letterSpacing: "0.27px",
71
+ textTransform: "uppercase"
72
+ },
73
+ variant: "tiny",
74
+ children: i
75
+ }), t && /* @__PURE__ */ e(c, {
76
+ component: "p",
77
+ sx: { color: "primary.dark" },
78
+ variant: "h3",
79
+ children: t
80
+ })]
81
+ }), /* @__PURE__ */ n(s, {
82
+ "aria-label": i ?? t,
83
+ role: "list",
84
+ sx: { flexDirection: "row" },
85
+ children: [f.map((d, y) => {
86
+ const p = y + 1, a = p < r ? "reached" : p === r ? "current" : "upcoming";
87
+ return /* @__PURE__ */ n(v.Fragment, { children: [/* @__PURE__ */ e(x, { solid: p <= r }), /* @__PURE__ */ n(s, {
88
+ "aria-current": a === "current" ? "step" : void 0,
89
+ role: "listitem",
71
90
  sx: {
72
- letterSpacing: "0.27px",
73
- textTransform: "uppercase"
91
+ alignItems: "center",
92
+ width: 24
74
93
  },
75
- variant: "tiny",
76
- children: o
77
- }), p && /* @__PURE__ */ e(h, {
78
- component: "p",
79
- sx: { color: "primary.dark" },
80
- variant: "h3",
81
- children: p
82
- })]
83
- }), /* @__PURE__ */ n(l, {
84
- "aria-label": o ?? p,
85
- role: "list",
86
- sx: { flexDirection: "row" },
87
- children: [u.map((x, w) => {
88
- const c = w + 1, a = c < r ? "reached" : c === r ? "current" : "upcoming";
89
- return /* @__PURE__ */ n(_.Fragment, { children: [/* @__PURE__ */ e(g, { solid: c <= r }), /* @__PURE__ */ n(l, {
90
- "aria-current": a === "current" ? "step" : void 0,
91
- role: "listitem",
94
+ children: [/* @__PURE__ */ e(R, { state: a }), /* @__PURE__ */ e(c, {
95
+ color: a === "upcoming" ? "text.secondary" : "text.primary",
92
96
  sx: {
93
- alignItems: "center",
94
- width: 24
97
+ fontWeight: a === "upcoming" ? "fontWeightRegular" : "fontWeightBold",
98
+ whiteSpace: "nowrap"
95
99
  },
96
- children: [/* @__PURE__ */ e(I, { state: a }), /* @__PURE__ */ e(h, {
97
- color: a === "upcoming" ? "text.secondary" : "text.primary",
98
- sx: {
99
- fontWeight: a === "upcoming" ? "fontWeightRegular" : "fontWeightBold",
100
- whiteSpace: "nowrap"
101
- },
102
- variant: "caption",
103
- children: v(x, C.whole)
104
- })]
105
- })] }, x);
106
- }), /* @__PURE__ */ e(g, { solid: !1 })]
107
- })]
108
- })
109
- });
110
- }, H = ({ beatGuid: r, payload: t }) => {
111
- const { data: i } = t.instance_slot, o = s(i, "current_step");
112
- return k(o) ? /* @__PURE__ */ e(M, {
113
- currentStep: o,
114
- headline: d(s(i, "headline")),
100
+ variant: "caption",
101
+ children: w(d, b.whole)
102
+ })]
103
+ })] }, d);
104
+ }), /* @__PURE__ */ e(x, { solid: !1 })]
105
+ })]
106
+ })
107
+ }), D = ({ beatGuid: r, payload: t }) => {
108
+ const { data: o } = t.instance_slot, i = m(o, "current_step");
109
+ return M(i) ? /* @__PURE__ */ e(_, {
110
+ currentStep: i,
111
+ headline: h(m(o, "headline")),
115
112
  isMini: t.widget_type === "mini",
116
- label: d(s(i, "label")),
117
- miniHeadline: d(s(i, "mini_headline"))
118
- }) : (console.warn(`[StepChartBlock] ${r ?? "unknown beat"}: milestone_progress current_step invalid (${typeof o}), rendering nothing`), null);
113
+ label: h(m(o, "label"))
114
+ }) : (console.warn(`[StepChartBlock] ${r ?? "unknown beat"}: milestone_progress current_step invalid (${typeof i}), rendering nothing`), null);
119
115
  };
120
116
  export {
121
- H as MilestoneProgressBlock,
122
- M as default,
123
- k as isMilestoneProgressStep
117
+ D as MilestoneProgressBlock,
118
+ _ as default,
119
+ M as isMilestoneProgressStep
124
120
  };
125
121
 
126
122
  //# sourceMappingURL=MilestoneProgress.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MilestoneProgress.es.js","names":[],"sources":["../../../../../../src/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { CheckCircle } from '@mxenabled/mx-icons'\n\nimport { slot } from '../../../../../core/types/Insights'\nimport type { StepChartBlockData } from '../../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { ELEVATION_SHADOW } from '../../../../components/shared/elevation'\nimport { asNonEmptyText } from '../../../slotReaders'\nimport type { BlockProps } from '../../../types'\n\nconst MILESTONES = [100, 500, 1000] as const\nconst UPCOMING_OPACITY = 0.25\n\nexport type MilestoneProgressStep = 1 | 2 | 3\n\nexport const isMilestoneProgressStep = (value: unknown): value is MilestoneProgressStep =>\n Number.isInteger(value) && (value as number) >= 1 && (value as number) <= MILESTONES.length\n\ntype StepState = 'reached' | 'current' | 'upcoming'\n\n/** A track segment: solid primary up to the current goal, 25% primary after it. */\nconst Segment = ({ solid }: { solid: boolean }) => (\n <Box\n aria-hidden={true}\n sx={(theme) => ({\n bgcolor: solid ? 'primary.main' : alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n flex: 1,\n height: 2,\n mt: 11,\n })}\n />\n)\n\n/** Reached: the filled check. Current: a 20px primary ring. Upcoming: a 25% primary disc. */\nconst StepMark = ({ state }: { state: StepState }) => {\n if (state === 'reached') {\n return <CheckCircle aria-hidden={true} filled={true} size={24} sx={{ color: 'primary.main' }} />\n }\n\n return (\n <Box\n aria-hidden={true}\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: 24,\n justifyContent: 'center',\n width: 24,\n }}\n >\n <Box\n sx={(theme) =>\n state === 'current'\n ? {\n border: '2px solid',\n borderColor: 'primary.main',\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n : {\n bgcolor: alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n }\n />\n </Box>\n )\n}\n\ninterface MilestoneProgressProps {\n currentStep: MilestoneProgressStep\n /** Full's eyebrow (\"Step two\"). */\n label?: string\n /** Full's headline (\"$500 in Savings\"). */\n headline?: string\n /** Mini's one-line headline (\"Nice Work!\"), shown instead of the eyebrow and headline. */\n miniHeadline?: string\n isMini: boolean\n}\n\n/** The $100 / $500 / $1,000 goal stepper (Figma 1132:26517): checks before the current goal, a ring on it. */\nconst MilestoneProgress = ({\n currentStep,\n headline,\n isMini,\n label,\n miniHeadline,\n}: MilestoneProgressProps) => {\n // Mini shows the short headline, falling back to full's.\n const title = isMini ? (miniHeadline ?? headline) : headline\n\n return (\n <Box sx={{ px: 16, py: 4 }}>\n <Stack\n sx={{\n bgcolor: 'primary.lighter',\n border: '1px solid',\n borderColor: 'primary.main',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 16,\n py: 16,\n }}\n >\n <Stack sx={{ px: 16 }}>\n {!isMini && label && (\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.27px', textTransform: 'uppercase' }}\n variant=\"tiny\"\n >\n {label}\n </Text>\n )}\n {title && (\n <Text component=\"p\" sx={{ color: 'primary.dark' }} variant=\"h3\">\n {title}\n </Text>\n )}\n </Stack>\n {/* The aria-hidden track segments stay out of the accessibility tree; only the goals are items. */}\n <Stack aria-label={label ?? title} role=\"list\" sx={{ flexDirection: 'row' }}>\n {MILESTONES.map((amount, index) => {\n const step = index + 1\n const state: StepState =\n step < currentStep ? 'reached' : step === currentStep ? 'current' : 'upcoming'\n\n return (\n <React.Fragment key={amount}>\n <Segment solid={step <= currentStep} />\n <Stack\n aria-current={state === 'current' ? 'step' : undefined}\n role=\"listitem\"\n sx={{ alignItems: 'center', width: 24 }}\n >\n <StepMark state={state} />\n <Text\n color={state === 'upcoming' ? 'text.secondary' : 'text.primary'}\n sx={{\n fontWeight: state === 'upcoming' ? 'fontWeightRegular' : 'fontWeightBold',\n whiteSpace: 'nowrap',\n }}\n variant=\"caption\"\n >\n {formatCurrency(amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </React.Fragment>\n )\n })}\n <Segment solid={false} />\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default MilestoneProgress\n\n/** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the short headline. */\nexport const MilestoneProgressBlock = ({ beatGuid, payload }: BlockProps<StepChartBlockData>) => {\n const { data } = payload.instance_slot\n const currentStep = slot(data, 'current_step')\n if (!isMilestoneProgressStep(currentStep)) {\n console.warn(\n `[StepChartBlock] ${beatGuid ?? 'unknown beat'}: milestone_progress current_step invalid (${typeof currentStep}), rendering nothing`,\n )\n return null\n }\n\n return (\n <MilestoneProgress\n currentStep={currentStep}\n headline={asNonEmptyText(slot(data, 'headline'))}\n isMini={payload.widget_type === 'mini'}\n label={asNonEmptyText(slot(data, 'label'))}\n miniHeadline={asNonEmptyText(slot(data, 'mini_headline'))}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAa;AAAA,EAAC;AAAA,EAAK;AAAA,EAAK;AAAI,GAC5B,IAAmB,MAIZ,IAAA,CAA2B,MACtC,OAAO,UAAU,CAAK,KAAM,KAAoB,KAAM,KAAoB,EAAW,QAKjF,IAAA,CAAW,EAAE,OAAA,EAAA,MACjB,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAA,CAAK,OAAW;AAAA,IACd,SAAS,IAAQ,iBAAiB,EAAM,EAAM,QAAQ,QAAQ,MAAM,CAAgB;AAAA,IACpF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AACD,CAAA,GAIG,IAAA,CAAY,EAAE,OAAA,EAAA,MACd,MAAU,YACL,gBAAA,EAAC,GAAD;AAAA,EAAa,eAAa;AAAA,EAAM,QAAQ;AAAA,EAAM,MAAM;AAAA,EAAI,IAAI,EAAE,OAAO,eAAe;AAAI,CAAA,IAI/F,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,OAAO;AAAA,EACT;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD,EACE,IAAA,CAAK,MACH,MAAU,YACN;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT,IACA;AAAA,IACE,SAAS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["../../../../../../src/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { CheckCircle } from '@mxenabled/mx-icons'\n\nimport { slot } from '../../../../../core/types/Insights'\nimport type { StepChartBlockData } from '../../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport { ELEVATION_SHADOW } from '../../../../components/shared/elevation'\nimport { asNonEmptyText } from '../../../slotReaders'\nimport type { BlockProps } from '../../../types'\n\nconst MILESTONES = [100, 500, 1000] as const\nconst UPCOMING_OPACITY = 0.25\n\nexport type MilestoneProgressStep = 1 | 2 | 3\n\nexport const isMilestoneProgressStep = (value: unknown): value is MilestoneProgressStep =>\n Number.isInteger(value) && (value as number) >= 1 && (value as number) <= MILESTONES.length\n\ntype StepState = 'reached' | 'current' | 'upcoming'\n\n/** A track segment: solid primary up to the current goal, 25% primary after it. */\nconst Segment = ({ solid }: { solid: boolean }) => (\n <Box\n aria-hidden={true}\n sx={(theme) => ({\n bgcolor: solid ? 'primary.main' : alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n flex: 1,\n height: 2,\n mt: 11,\n })}\n />\n)\n\n/** Reached: the filled check. Current: a 20px primary ring. Upcoming: a 25% primary disc. */\nconst StepMark = ({ state }: { state: StepState }) => {\n if (state === 'reached') {\n return <CheckCircle aria-hidden={true} filled={true} size={24} sx={{ color: 'primary.main' }} />\n }\n\n return (\n <Box\n aria-hidden={true}\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: 24,\n justifyContent: 'center',\n width: 24,\n }}\n >\n <Box\n sx={(theme) =>\n state === 'current'\n ? {\n border: '2px solid',\n borderColor: 'primary.main',\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n : {\n bgcolor: alpha(theme.palette.primary.main, UPCOMING_OPACITY),\n borderRadius: '50%',\n height: 20,\n width: 20,\n }\n }\n />\n </Box>\n )\n}\n\ninterface MilestoneProgressProps {\n currentStep: MilestoneProgressStep\n /** Full's eyebrow (\"Step two\"). */\n label?: string\n /** Full's headline (\"$500 in Savings\"). */\n headline?: string\n isMini: boolean\n}\n\n/** The $100 / $500 / $1,000 goal stepper (Figma 1132:26517): checks before the current goal, a ring on it. */\nconst MilestoneProgress = ({ currentStep, headline, isMini, label }: MilestoneProgressProps) => {\n return (\n <Box sx={{ px: 16, py: 4 }}>\n <Stack\n sx={{\n bgcolor: 'primary.lighter',\n border: '1px solid',\n borderColor: 'primary.main',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 16,\n py: 16,\n }}\n >\n <Stack sx={{ px: 16 }}>\n {/* Mini shows full's headline (design QA), without the eyebrow. */}\n {!isMini && label && (\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.27px', textTransform: 'uppercase' }}\n variant=\"tiny\"\n >\n {label}\n </Text>\n )}\n {headline && (\n <Text component=\"p\" sx={{ color: 'primary.dark' }} variant=\"h3\">\n {headline}\n </Text>\n )}\n </Stack>\n {/* The aria-hidden track segments stay out of the accessibility tree; only the goals are items. */}\n <Stack aria-label={label ?? headline} role=\"list\" sx={{ flexDirection: 'row' }}>\n {MILESTONES.map((amount, index) => {\n const step = index + 1\n const state: StepState =\n step < currentStep ? 'reached' : step === currentStep ? 'current' : 'upcoming'\n\n return (\n <React.Fragment key={amount}>\n <Segment solid={step <= currentStep} />\n <Stack\n aria-current={state === 'current' ? 'step' : undefined}\n role=\"listitem\"\n sx={{ alignItems: 'center', width: 24 }}\n >\n <StepMark state={state} />\n <Text\n color={state === 'upcoming' ? 'text.secondary' : 'text.primary'}\n sx={{\n fontWeight: state === 'upcoming' ? 'fontWeightRegular' : 'fontWeightBold',\n whiteSpace: 'nowrap',\n }}\n variant=\"caption\"\n >\n {formatCurrency(amount, CURRENCY_FORMAT.whole)}\n </Text>\n </Stack>\n </React.Fragment>\n )\n })}\n <Segment solid={false} />\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default MilestoneProgress\n\n/** step_chart_block / milestone_progress: full shows the eyebrow and headline, mini the headline only. */\nexport const MilestoneProgressBlock = ({ beatGuid, payload }: BlockProps<StepChartBlockData>) => {\n const { data } = payload.instance_slot\n const currentStep = slot(data, 'current_step')\n if (!isMilestoneProgressStep(currentStep)) {\n console.warn(\n `[StepChartBlock] ${beatGuid ?? 'unknown beat'}: milestone_progress current_step invalid (${typeof currentStep}), rendering nothing`,\n )\n return null\n }\n\n return (\n <MilestoneProgress\n currentStep={currentStep}\n headline={asNonEmptyText(slot(data, 'headline'))}\n isMini={payload.widget_type === 'mini'}\n label={asNonEmptyText(slot(data, 'label'))}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAa;AAAA,EAAC;AAAA,EAAK;AAAA,EAAK;AAAI,GAC5B,IAAmB,MAIZ,IAAA,CAA2B,MACtC,OAAO,UAAU,CAAK,KAAM,KAAoB,KAAM,KAAoB,EAAW,QAKjF,IAAA,CAAW,EAAE,OAAA,EAAA,MACjB,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAA,CAAK,OAAW;AAAA,IACd,SAAS,IAAQ,iBAAiB,EAAM,EAAM,QAAQ,QAAQ,MAAM,CAAgB;AAAA,IACpF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AACD,CAAA,GAIG,IAAA,CAAY,EAAE,OAAA,EAAA,MACd,MAAU,YACL,gBAAA,EAAC,GAAD;AAAA,EAAa,eAAa;AAAA,EAAM,QAAQ;AAAA,EAAM,MAAM;AAAA,EAAI,IAAI,EAAE,OAAO,eAAe;AAAI,CAAA,IAI/F,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,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AAQ,KACN,oBAAoB,KAAY,cAAA,8CAA4D,OAAO,CAAA,sBACrG,GACO;AAWX"}
@@ -1,12 +1,25 @@
1
- import { CELEBRATION_GRADIENT as o, DIRECT_DEPOSIT_COMPLETE_GRADIENT as t, ERROR_WASH_GRADIENT as a, FEES_WASH_GRADIENT as n, WARM_LIME_ACCENT_GRADIENT as i } from "../../../components/celebrationGradients.es.js";
2
- var r = { background: a }, s = (e) => ({
1
+ import { CELEBRATION_GRADIENT as r, DIRECT_DEPOSIT_COMPLETE_GRADIENT as n, ERROR_WASH_GRADIENT as e, FEES_WASH_GRADIENT as i, WARM_LIME_ACCENT_GRADIENT as c } from "../../../components/celebrationGradients.es.js";
2
+ var o = { background: e }, a = {
3
+ isConfetti: !0,
4
+ gradient: r,
5
+ graphic: "savings",
6
+ amountVariant: "h2",
7
+ rowSx: {
8
+ gap: 16,
9
+ p: 16
10
+ },
11
+ secondarySource: "label",
12
+ secondaryPosition: "above",
13
+ secondaryVariant: "body2",
14
+ secondaryColor: "text.primary"
15
+ }, d = (t) => ({
3
16
  overdraft_warning: {
4
- background: e.palette.warning.light,
17
+ background: t.palette.warning.light,
5
18
  sub_logo: "error"
6
19
  },
7
- low_balance_alert: r,
20
+ low_balance_alert: o,
8
21
  low_balance: {
9
- ...r,
22
+ ...o,
10
23
  badge: "error"
11
24
  },
12
25
  status_off_track: {
@@ -14,16 +27,16 @@ var r = { background: a }, s = (e) => ({
14
27
  logo_bGcolor: "error.main",
15
28
  logo_border_radius: "4px",
16
29
  logo_icon_size: 24,
17
- background: a
30
+ background: e
18
31
  },
19
32
  charges_summary: {
20
33
  category_tint: 0.25,
21
34
  category_border_width: 1.5,
22
- background: n
35
+ background: i
23
36
  },
24
37
  deposit_received: {
25
38
  isConfetti: !0,
26
- gradient: t,
39
+ gradient: n,
27
40
  graphic: "logo",
28
41
  amountVariant: "h2",
29
42
  amountKeepsVariantWeight: !0,
@@ -42,7 +55,7 @@ var r = { background: a }, s = (e) => ({
42
55
  },
43
56
  status_on_track: {
44
57
  isConfetti: !0,
45
- gradient: i,
58
+ gradient: c,
46
59
  graphic: "logo",
47
60
  amountVariant: "h2",
48
61
  amountKeepsVariantWeight: !0,
@@ -57,7 +70,7 @@ var r = { background: a }, s = (e) => ({
57
70
  },
58
71
  payoff_celebration: {
59
72
  isConfetti: !0,
60
- gradient: o,
73
+ gradient: r,
61
74
  graphic: "paidOffCard",
62
75
  amountVariant: "h2",
63
76
  rowSx: {
@@ -70,24 +83,17 @@ var r = { background: a }, s = (e) => ({
70
83
  secondaryVariant: "caption",
71
84
  secondaryColor: "text.secondary"
72
85
  },
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
+ savings_deposit: a,
87
+ savings_deposit_compact: {
88
+ ...a,
89
+ secondaryPosition: "below",
90
+ secondaryVariant: "caption",
91
+ secondaryColor: "text.secondary"
86
92
  },
87
93
  default: {}
88
94
  });
89
95
  export {
90
- s as getLayoutConfig
96
+ d as getLayoutConfig
91
97
  };
92
98
 
93
99
  //# 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 { type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n ERROR_WASH_GRADIENT,\n FEES_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n /** Opacity of the category colour behind a `CAT-` tile, with a category-colour border; none = mxui's tile. */\n category_tint?: number\n /** Width in px of that tinted tile's category-colour border. Defaults to 1. */\n category_border_width?: number\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Keep the variant's own weight (h2 is 700) instead of the confetti tile's semi bold. */\n amountKeepsVariantWeight?: boolean\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n /** Truncate the secondary line to one line with an ellipsis. */\n secondaryOneLine?: boolean\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n // Monthly Credit Card Interest Summary's fees tile (ditto account_block `charges_summary`); its category\n // glyph rides in `icon`.\n charges_summary: {\n category_tint: 0.25,\n // Figma 1365:301242 <Categories>: a 1.5px category-colour border.\n category_border_width: 1.5,\n background: FEES_WASH_GRADIENT,\n },\n // Unified Deposit and its standalone deposit templates; Figma draws every state alike.\n deposit_received: {\n isConfetti: true,\n gradient: DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n amountKeepsVariantWeight: true,\n amountPrefix: '+',\n categoryStrip: true,\n cardShadow: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n secondaryOneLine: true,\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n amountKeepsVariantWeight: true,\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 16, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'savings',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'above',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n // Neutral fallback for an unknown/unmatched variant: renders the plain standard card (no\n // confetti, no special background). `resolveVariantConfig` warns before falling back here.\n default: {},\n }\n}\n"],"mappings":";AA+DA,IAAM,IAAsC,EAC1C,YAAY,EACd,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IAEd,oBAAoB;AAAA,IAEpB,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EAGA,iBAAiB;AAAA,IACf,eAAe;AAAA,IAEf,uBAAuB;AAAA,IACvB,YAAY;AAAA,EACd;AAAA,EAEA,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,0BAA0B;AAAA,IAC1B,cAAc;AAAA,IACd,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA,iBAAiB;AAAA,IACf,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,0BAA0B;AAAA,IAC1B,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,oBAAoB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IACjC,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,iBAAiB;AAAA,IACf,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EAGA,SAAS,CAAC;AACZ"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n ERROR_WASH_GRADIENT,\n FEES_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n /** Opacity of the category colour behind a `CAT-` tile, with a category-colour border; none = mxui's tile. */\n category_tint?: number\n /** Width in px of that tinted tile's category-colour border. Defaults to 1. */\n category_border_width?: number\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Keep the variant's own weight (h2 is 700) instead of the confetti tile's semi bold. */\n amountKeepsVariantWeight?: boolean\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n /** Truncate the secondary line to one line with an ellipsis. */\n secondaryOneLine?: boolean\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nconst SAVINGS_DEPOSIT_TILE: BlockLayoutConfig = {\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\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n // Monthly Credit Card Interest Summary's fees tile (ditto account_block `charges_summary`); its category\n // glyph rides in `icon`.\n charges_summary: {\n category_tint: 0.25,\n // Figma 1365:301242 <Categories>: a 1.5px category-colour border.\n category_border_width: 1.5,\n background: FEES_WASH_GRADIENT,\n },\n // Unified Deposit and its standalone deposit templates; Figma draws every state alike.\n deposit_received: {\n isConfetti: true,\n gradient: DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n amountKeepsVariantWeight: true,\n amountPrefix: '+',\n categoryStrip: true,\n cardShadow: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n secondaryOneLine: true,\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n amountKeepsVariantWeight: true,\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 16, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: SAVINGS_DEPOSIT_TILE,\n // Mini, Figma 1243:58653.\n savings_deposit_compact: {\n ...SAVINGS_DEPOSIT_TILE,\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\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":";AA+DA,IAAM,IAAsC,EAC1C,YAAY,EACd,GAEM,IAA0C;AAAA,EAC9C,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,eAAe;AAAA,EACf,OAAO;AAAA,IAAE,KAAK;AAAA,IAAI,GAAG;AAAA,EAAG;AAAA,EACxB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IAEd,oBAAoB;AAAA,IAEpB,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EAGA,iBAAiB;AAAA,IACf,eAAe;AAAA,IAEf,uBAAuB;AAAA,IACvB,YAAY;AAAA,EACd;AAAA,EAEA,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,0BAA0B;AAAA,IAC1B,cAAc;AAAA,IACd,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA,iBAAiB;AAAA,IACf,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,0BAA0B;AAAA,IAC1B,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,oBAAoB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IACjC,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,iBAAiB;AAAA,EAEjB,yBAAyB;AAAA,IACvB,GAAG;AAAA,IACH,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EAGA,SAAS,CAAC;AACZ"}
@@ -0,0 +1,7 @@
1
+ import { InsightsPayload } from '../../../../core';
2
+ interface CompactDirectDepositBlockProps {
3
+ payload: InsightsPayload;
4
+ }
5
+ /** `compact_direct_deposit_block`: the mini-widget account tile; the variant picks its colors. */
6
+ declare const CompactDirectDepositBlock: ({ payload }: CompactDirectDepositBlockProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default CompactDirectDepositBlock;
@@ -0,0 +1,46 @@
1
+ import { buildDynamicCopy as c } from "../../../../core/utils/Localization.es.js";
2
+ import { GlobalDataContext as l } from "../../../../common/context/GlobalDataProvider.es.js";
3
+ import { slot as p } from "../../../../core/types/Insights.es.js";
4
+ import { resolveVariantConfig as u } from "../../resolveVariantConfig.es.js";
5
+ import { asLogoRef as f, asText as g, slotOrFlat as d } from "../../slotReaders.es.js";
6
+ import y from "../../../components/LogoFromGuid.es.js";
7
+ import D from "../../../components/CompactDirectDepositCard.es.js";
8
+ import { compactDirectDepositVariant as _, getLayoutConfig as x } from "./layout.es.js";
9
+ import { useContext as C } from "react";
10
+ import { jsx as m } from "react/jsx-runtime";
11
+ import { useTheme as v } from "@mui/material/styles";
12
+ import L from "@mui/material/Box";
13
+ var n = (t, i) => g(d(t, i)), h = (t, i) => {
14
+ const o = f(p(t.data, "logo")), a = n(t, "institution_guid"), r = o?.alt ?? n(t, "institution_name"), e = o ?? (a ? {
15
+ guid: a,
16
+ alt: r ?? a
17
+ } : void 0);
18
+ return !e || !r ? e : {
19
+ ...e,
20
+ alt: i ? c(i, r) : r
21
+ };
22
+ }, M = ({ payload: t }) => {
23
+ const i = v(), { instance_slot: o } = t, a = C(l)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, r = h(o, a), e = n(o, "status_text"), s = u(x(i), o.variant, _.Primary, "CompactDirectDepositBlock");
24
+ return /* @__PURE__ */ m(D, {
25
+ ...s,
26
+ logo: r?.guid ? /* @__PURE__ */ m(y, {
27
+ logo: r,
28
+ size: 32
29
+ }) : null,
30
+ name: n(o, "account_name"),
31
+ statusLabel: e ? /* @__PURE__ */ m(L, {
32
+ component: "span",
33
+ dangerouslySetInnerHTML: { __html: e },
34
+ sx: { "& .bold-copy": {
35
+ fontFamily: "inherit",
36
+ fontWeight: "fontWeightBold"
37
+ } }
38
+ }) : void 0,
39
+ subtitle: n(o, "account_type")
40
+ });
41
+ };
42
+ export {
43
+ M as default
44
+ };
45
+
46
+ //# sourceMappingURL=CompactDirectDepositBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompactDirectDepositBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport CompactDirectDepositCard from '../../../components/CompactDirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asText, slotOrFlat, type FlatSlotKey } from '../../slotReaders'\n\nimport { compactDirectDepositVariant, getLayoutConfig } from './layout'\n\ninterface CompactDirectDepositBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\nconst readFact = (instanceSlot: InstanceSlot, name: FlatSlotKey): string | undefined =>\n asText(slotOrFlat(instanceSlot, name))\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = asLogoRef(slot(instanceSlot.data, 'logo'))\n const guid = readFact(instanceSlot, 'institution_guid')\n const name = dataLogo?.alt ?? readFact(instanceSlot, 'institution_name')\n\n const logo = dataLogo ?? (guid ? { guid, alt: name ?? guid } : undefined)\n if (!logo || !name) return logo\n\n return { ...logo, alt: altCopy ? (buildDynamicCopy(altCopy, name) as string) : name }\n}\n\n/** `compact_direct_deposit_block`: the mini-widget account tile; the variant picks its colors. */\nconst CompactDirectDepositBlock = ({ payload }: CompactDirectDepositBlockProps) => {\n const theme = useTheme()\n const { instance_slot } = payload\n // Optional: the micro widget renders this block without a GlobalDataProvider.\n const altCopy =\n useContext(GlobalDataContext)?.globalStore.copyStore.copy.insights_feed?.general\n ?.institution_Logo\n const logo = resolveLogo(instance_slot, altCopy)\n const statusText = readFact(instance_slot, 'status_text')\n const layout = resolveVariantConfig(\n getLayoutConfig(theme),\n instance_slot.variant,\n compactDirectDepositVariant.Primary,\n 'CompactDirectDepositBlock',\n )\n\n return (\n <CompactDirectDepositCard\n {...layout}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={32} /> : null}\n name={readFact(instance_slot, 'account_name')}\n statusLabel={\n statusText ? (\n // Server-rendered mrs_content copy (bold-copy span around a formatted rate), not user\n // input; painted as BudgetBlock paints sub_text.\n <Box\n component=\"span\"\n dangerouslySetInnerHTML={{ __html: statusText }}\n sx={{ '& .bold-copy': { fontFamily: 'inherit', fontWeight: 'fontWeightBold' } }}\n />\n ) : undefined\n }\n subtitle={readFact(instance_slot, 'account_type')}\n />\n )\n}\n\nexport default CompactDirectDepositBlock\n"],"mappings":";;;;;;;;;;;;AAsBA,IAAM,IAAA,CAAY,GAA4B,MAC5C,EAAO,EAAW,GAAc,CAAI,CAAC,GAGjC,IAAA,CAAe,GAA4B,MAA0C;AACzF,QAAM,IAAW,EAAU,EAAK,EAAa,MAAM,MAAM,CAAC,GACpD,IAAO,EAAS,GAAc,kBAAkB,GAChD,IAAO,GAAU,OAAO,EAAS,GAAc,kBAAkB,GAEjE,IAAO,MAAa,IAAO;AAAA,IAAE,MAAA;AAAA,IAAM,KAAK,KAAQ;AAAA,EAAK,IAAI;AAC/D,SAAI,CAAC,KAAQ,CAAC,IAAa,IAEpB;AAAA,IAAE,GAAG;AAAA,IAAM,KAAK,IAAW,EAAiB,GAAS,CAAI,IAAe;AAAA,EAAK;AACtF,GAGM,IAAA,CAA6B,EAAE,SAAA,EAAA,MAA8C;AACjF,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,EAAA,IAAkB,GAEpB,IACJ,EAAW,CAAiB,GAAG,YAAY,UAAU,KAAK,eAAe,SACrE,kBACA,IAAO,EAAY,GAAe,CAAO,GACzC,IAAa,EAAS,GAAe,aAAa,GAClD,IAAS,EACb,EAAgB,CAAK,GACrB,EAAc,SACd,EAA4B,SAC5B,2BACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,IAAI;AAAA,IAC5D,MAAM,EAAS,GAAe,cAAc;AAAA,IAC5C,aACE,IAGE,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,EAAW;AAAA,MAC9C,IAAI,EAAE,gBAAgB;AAAA,QAAE,YAAY;AAAA,QAAW,YAAY;AAAA,MAAiB,EAAE;AAAA,IAC/E,CAAA,IACC;AAAA,IAEN,UAAU,EAAS,GAAe,cAAc;AAAA,EACjD,CAAA;AAEL"}
@@ -0,0 +1,3 @@
1
+ export { default as CompactDirectDepositBlock } from './CompactDirectDepositBlock';
2
+ export { compactDirectDepositVariant } from './layout';
3
+ export type { CompactDirectDepositVariant, CompactLayoutStyleProps } from './layout';
@@ -0,0 +1,10 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ import { DirectDepositCardStyleProps } from '../../../components/DirectDepositCard';
3
+ export declare const compactDirectDepositVariant: {
4
+ readonly Primary: "compact_primary";
5
+ readonly Success: "compact_success";
6
+ };
7
+ export type CompactDirectDepositVariant = (typeof compactDirectDepositVariant)[keyof typeof compactDirectDepositVariant];
8
+ export type CompactLayoutStyleProps = Omit<DirectDepositCardStyleProps, 'showConfetti'>;
9
+ /** The mini tile's blue (primary) and green (success) looks, the same as the full tile's. */
10
+ export declare const getLayoutConfig: (theme: Theme) => Record<CompactDirectDepositVariant, CompactLayoutStyleProps>;
@@ -0,0 +1,17 @@
1
+ import { detailedAccountVariant as a, getLayoutConfig as o } from "../DetailedAccountBlock/layout.es.js";
2
+ var c = {
3
+ Primary: "compact_primary",
4
+ Success: "compact_success"
5
+ }, i = (r) => {
6
+ const t = o(r);
7
+ return {
8
+ [c.Primary]: t[a.Primary],
9
+ [c.Success]: t[a.Success]
10
+ };
11
+ };
12
+ export {
13
+ c as compactDirectDepositVariant,
14
+ i as getLayoutConfig
15
+ };
16
+
17
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport type { DirectDepositCardStyleProps } from '../../../components/DirectDepositCard'\nimport {\n detailedAccountVariant,\n getLayoutConfig as getFullTileLayoutConfig,\n} from '../DetailedAccountBlock/layout'\n\nexport const compactDirectDepositVariant = {\n Primary: 'compact_primary',\n Success: 'compact_success',\n} as const\n\nexport type CompactDirectDepositVariant =\n (typeof compactDirectDepositVariant)[keyof typeof compactDirectDepositVariant]\n\nexport type CompactLayoutStyleProps = Omit<DirectDepositCardStyleProps, 'showConfetti'>\n\n/** The mini tile's blue (primary) and green (success) looks, the same as the full tile's. */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<CompactDirectDepositVariant, CompactLayoutStyleProps> => {\n const fullTile = getFullTileLayoutConfig(theme)\n\n return {\n [compactDirectDepositVariant.Primary]: fullTile[detailedAccountVariant.Primary],\n [compactDirectDepositVariant.Success]: fullTile[detailedAccountVariant.Success],\n }\n}\n"],"mappings":";AAQA,IAAa,IAA8B;AAAA,EACzC,SAAS;AAAA,EACT,SAAS;AACX,GAQa,IAAA,CACX,MACiE;AACjE,QAAM,IAAW,EAAwB,CAAK;AAE9C,SAAO;AAAA,IACJ,CAAA,EAA4B,OAAA,GAAU,EAAS,EAAuB,OAAA;AAAA,IACtE,CAAA,EAA4B,OAAA,GAAU,EAAS,EAAuB,OAAA;AAAA,EACzE;AACF"}
@@ -1,38 +1,38 @@
1
1
  import { buildDynamicCopy as m } from "../../../../core/utils/Localization.es.js";
2
- import { GlobalDataContext as l } from "../../../../common/context/GlobalDataProvider.es.js";
3
- import { slot as u } from "../../../../core/types/Insights.es.js";
4
- import { resolveVariantConfig as c } from "../../resolveVariantConfig.es.js";
2
+ import { GlobalDataContext as u } from "../../../../common/context/GlobalDataProvider.es.js";
3
+ import { slot as c } from "../../../../core/types/Insights.es.js";
4
+ import { resolveVariantConfig as d } from "../../resolveVariantConfig.es.js";
5
5
  import { asLogoRef as g, asText as f, slotOrFlat as p } from "../../slotReaders.es.js";
6
- import d from "../../../components/LogoFromGuid.es.js";
7
- import _ from "../../../components/DirectDepositCard.es.js";
8
- import { detailedAccountVariant as v, getLayoutConfig as y } from "./layout.es.js";
9
- import { useContext as L } from "react";
6
+ import _ from "../../../components/LogoFromGuid.es.js";
7
+ import v from "../../../components/DirectDepositCard.es.js";
8
+ import { detailedAccountVariant as y, getLayoutConfig as L } from "./layout.es.js";
9
+ import { useContext as x } from "react";
10
10
  import { jsx as s } from "react/jsx-runtime";
11
- import { useTheme as x } from "@mui/material/styles";
12
- var n = (t, a) => f(p(t, a)), C = (t, a) => {
13
- const o = g(u(t.data, "logo")), e = n(t, "institution_guid"), r = o?.alt ?? n(t, "institution_name"), i = o ?? (e ? {
14
- guid: e,
15
- alt: r ?? e
11
+ import { useTheme as C } from "@mui/material/styles";
12
+ var n = (o, r) => f(p(o, r)), D = (o, r) => {
13
+ const t = g(c(o.data, "logo")), i = n(o, "institution_guid"), e = t?.alt ?? n(o, "institution_name"), a = t ?? (i ? {
14
+ guid: i,
15
+ alt: e ?? i
16
16
  } : void 0);
17
- return !i || !r ? i : {
18
- ...i,
19
- alt: a ? m(a, r) : r
17
+ return !a || !e ? a : {
18
+ ...a,
19
+ alt: r ? m(r, e) : e
20
20
  };
21
- }, z = ({ payload: t }) => {
22
- const a = x(), { instance_slot: o } = t, e = L(l)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, r = C(o, e), i = c(y(a), o.variant, v.Neutral, "DetailedAccountBlock");
23
- return /* @__PURE__ */ s(_, {
24
- ...i,
25
- logo: r?.guid ? /* @__PURE__ */ s(d, {
26
- logo: r,
21
+ }, H = ({ payload: o }) => {
22
+ const r = C(), { instance_slot: t } = o, i = x(u)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, e = D(t, i), a = n(t, "status_text"), l = d(L(r), t.variant, y.Neutral, "DetailedAccountBlock");
23
+ return /* @__PURE__ */ s(v, {
24
+ ...l,
25
+ logo: e?.guid ? /* @__PURE__ */ s(_, {
26
+ logo: e,
27
27
  size: 48
28
28
  }) : null,
29
- name: n(o, "account_name"),
30
- statusLabel: n(o, "status_text"),
31
- subtitle: n(o, "account_type")
29
+ name: n(t, "account_name"),
30
+ statusLabel: a ? /* @__PURE__ */ s("div", { dangerouslySetInnerHTML: { __html: a } }) : void 0,
31
+ subtitle: n(t, "account_type")
32
32
  });
33
33
  };
34
34
  export {
35
- z as default
35
+ H as default
36
36
  };
37
37
 
38
38
  //# sourceMappingURL=DetailedAccountBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asText, slotOrFlat, type FlatSlotKey } from '../../slotReaders'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\nconst readFact = (instanceSlot: InstanceSlot, name: FlatSlotKey): string | undefined =>\n asText(slotOrFlat(instanceSlot, name))\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = asLogoRef(slot(instanceSlot.data, 'logo'))\n const guid = readFact(instanceSlot, 'institution_guid')\n const name = dataLogo?.alt ?? readFact(instanceSlot, 'institution_name')\n\n const logo = dataLogo ?? (guid ? { guid, alt: name ?? guid } : undefined)\n if (!logo || !name) return logo\n\n return { ...logo, alt: altCopy ? (buildDynamicCopy(altCopy, name) as string) : name }\n}\n\nconst DetailedAccountBlock = ({ payload }: DetailedAccountBlockProps) => {\n const theme = useTheme()\n const { instance_slot } = payload\n // Optional: the micro widget renders this block without a GlobalDataProvider.\n const altCopy =\n useContext(GlobalDataContext)?.globalStore.copyStore.copy.insights_feed?.general\n ?.institution_Logo\n const logo = resolveLogo(instance_slot, altCopy)\n const layout = resolveVariantConfig(\n getLayoutConfig(theme),\n instance_slot.variant,\n detailedAccountVariant.Neutral,\n 'DetailedAccountBlock',\n )\n\n return (\n <DirectDepositCard\n {...layout}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={readFact(instance_slot, 'account_name')}\n statusLabel={readFact(instance_slot, 'status_text')}\n subtitle={readFact(instance_slot, 'account_type')}\n />\n )\n}\n\nexport default DetailedAccountBlock\n"],"mappings":";;;;;;;;;;;AAqBA,IAAM,IAAA,CAAY,GAA4B,MAC5C,EAAO,EAAW,GAAc,CAAI,CAAC,GAGjC,IAAA,CAAe,GAA4B,MAA0C;AACzF,QAAM,IAAW,EAAU,EAAK,EAAa,MAAM,MAAM,CAAC,GACpD,IAAO,EAAS,GAAc,kBAAkB,GAChD,IAAO,GAAU,OAAO,EAAS,GAAc,kBAAkB,GAEjE,IAAO,MAAa,IAAO;AAAA,IAAE,MAAA;AAAA,IAAM,KAAK,KAAQ;AAAA,EAAK,IAAI;AAC/D,SAAI,CAAC,KAAQ,CAAC,IAAa,IAEpB;AAAA,IAAE,GAAG;AAAA,IAAM,KAAK,IAAW,EAAiB,GAAS,CAAI,IAAe;AAAA,EAAK;AACtF,GAEM,IAAA,CAAwB,EAAE,SAAA,EAAA,MAAyC;AACvE,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,EAAA,IAAkB,GAEpB,IACJ,EAAW,CAAiB,GAAG,YAAY,UAAU,KAAK,eAAe,SACrE,kBACA,IAAO,EAAY,GAAe,CAAO,GACzC,IAAS,EACb,EAAgB,CAAK,GACrB,EAAc,SACd,EAAuB,SACvB,sBACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,IAAI;AAAA,IAC5D,MAAM,EAAS,GAAe,cAAc;AAAA,IAC5C,aAAa,EAAS,GAAe,aAAa;AAAA,IAClD,UAAU,EAAS,GAAe,cAAc;AAAA,EACjD,CAAA;AAEL"}
1
+ {"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\n// import Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asText, slotOrFlat, type FlatSlotKey } from '../../slotReaders'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\nconst readFact = (instanceSlot: InstanceSlot, name: FlatSlotKey): string | undefined =>\n asText(slotOrFlat(instanceSlot, name))\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = asLogoRef(slot(instanceSlot.data, 'logo'))\n const guid = readFact(instanceSlot, 'institution_guid')\n const name = dataLogo?.alt ?? readFact(instanceSlot, 'institution_name')\n\n const logo = dataLogo ?? (guid ? { guid, alt: name ?? guid } : undefined)\n if (!logo || !name) return logo\n\n return { ...logo, alt: altCopy ? (buildDynamicCopy(altCopy, name) as string) : name }\n}\n\nconst DetailedAccountBlock = ({ payload }: DetailedAccountBlockProps) => {\n const theme = useTheme()\n const { instance_slot } = payload\n // Optional: the micro widget renders this block without a GlobalDataProvider.\n const altCopy =\n useContext(GlobalDataContext)?.globalStore.copyStore.copy.insights_feed?.general\n ?.institution_Logo\n const logo = resolveLogo(instance_slot, altCopy)\n const statusText = readFact(instance_slot, 'status_text')\n const layout = resolveVariantConfig(\n getLayoutConfig(theme),\n instance_slot.variant,\n detailedAccountVariant.Neutral,\n 'DetailedAccountBlock',\n )\n\n return (\n <DirectDepositCard\n {...layout}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={readFact(instance_slot, 'account_name')}\n statusLabel={\n statusText ? (\n // Server-rendered mrs_content copy (bold-copy span around a formatted rate), not user\n // input; painted as BudgetBlock paints sub_text.\n // <Box\n // component=\"span\"\n // dangerouslySetInnerHTML={{ __html: statusText }}\n // sx={{ '& .bold-copy': { fontFamily: 'inherit', fontWeight: 'fontWeightBold' } }}\n // />\n <div dangerouslySetInnerHTML={{ __html: statusText }} />\n ) : undefined\n }\n subtitle={readFact(instance_slot, 'account_type')}\n />\n )\n}\n\nexport default DetailedAccountBlock\n"],"mappings":";;;;;;;;;;;AAsBA,IAAM,IAAA,CAAY,GAA4B,MAC5C,EAAO,EAAW,GAAc,CAAI,CAAC,GAGjC,IAAA,CAAe,GAA4B,MAA0C;AACzF,QAAM,IAAW,EAAU,EAAK,EAAa,MAAM,MAAM,CAAC,GACpD,IAAO,EAAS,GAAc,kBAAkB,GAChD,IAAO,GAAU,OAAO,EAAS,GAAc,kBAAkB,GAEjE,IAAO,MAAa,IAAO;AAAA,IAAE,MAAA;AAAA,IAAM,KAAK,KAAQ;AAAA,EAAK,IAAI;AAC/D,SAAI,CAAC,KAAQ,CAAC,IAAa,IAEpB;AAAA,IAAE,GAAG;AAAA,IAAM,KAAK,IAAW,EAAiB,GAAS,CAAI,IAAe;AAAA,EAAK;AACtF,GAEM,IAAA,CAAwB,EAAE,SAAA,EAAA,MAAyC;AACvE,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,EAAA,IAAkB,GAEpB,IACJ,EAAW,CAAiB,GAAG,YAAY,UAAU,KAAK,eAAe,SACrE,kBACA,IAAO,EAAY,GAAe,CAAO,GACzC,IAAa,EAAS,GAAe,aAAa,GAClD,IAAS,EACb,EAAgB,CAAK,GACrB,EAAc,SACd,EAAuB,SACvB,sBACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,IAAI;AAAA,IAC5D,MAAM,EAAS,GAAe,cAAc;AAAA,IAC5C,aACE,IAQE,gBAAA,EAAC,OAAD,EAAK,yBAAyB,EAAE,QAAQ,EAAW,EAAI,CAAA,IACrD;AAAA,IAEN,UAAU,EAAS,GAAe,cAAc;AAAA,EACjD,CAAA;AAEL"}
@@ -10,8 +10,6 @@ export type DetailedAccountVariant = (typeof detailedAccountVariant)[keyof typeo
10
10
  export declare const directDepositVariant: {
11
11
  readonly SetUpDirectDeposit: "set_up_direct_deposit";
12
12
  readonly DirectDepositComplete: "direct_deposit_complete";
13
- readonly MissingInterestRate: "missing_interest_rate";
14
- readonly InterestRateAdded: "interest_rate_added";
15
13
  };
16
14
  export type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant];
17
15
  export declare const isDetailedAccountVariant: (variant?: string | null) => variant is DetailedAccountVariant | DirectDepositVariant;