@mx-cartographer/experiences 9.7.66 → 9.7.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +32 -31
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +11 -11
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.d.ts +4 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +31 -28
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +44 -43
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +133 -104
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +4 -3
- package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
- package/dist/insights-v2/components/TransferLogoCard.d.ts +2 -8
- package/dist/insights-v2/components/TransferLogoCard.es.js +57 -57
- package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.es.js +1 -1
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +38 -37
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
import { ConfettiOverlay as w } from "./shared/ConfettiOverlay.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import c from "@mui/material/Stack";
|
|
3
|
+
import { Icon as I } from "@mxenabled/mx-icons";
|
|
4
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import e from "@mui/material/Box";
|
|
6
|
-
import
|
|
7
|
-
var
|
|
6
|
+
import b from "@mui/material/Card";
|
|
7
|
+
var R = 40, x = 16, y = 324, S = 32, T = /* @__PURE__ */ r(I, {
|
|
8
8
|
"aria-hidden": !0,
|
|
9
9
|
name: "arrow_forward",
|
|
10
10
|
size: 20,
|
|
11
11
|
sx: { color: "neutral.lighter" }
|
|
12
|
-
}),
|
|
12
|
+
}), o = ({ color: n = "neutral.darker", size: t = 4 }) => /* @__PURE__ */ r(e, { sx: {
|
|
13
13
|
bgcolor: n,
|
|
14
14
|
borderRadius: "4px",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
flexShrink: 0,
|
|
16
|
+
height: t,
|
|
17
|
+
width: t
|
|
18
|
+
} }), W = ({ badgeBgColor: n = "neutral.darker", bgcolor: t = "primary.lighter", backgroundImage: s, dotColor: i = "neutral.darker", from: f, hasBigDots: p = !0, icon: m = T, showConfetti: u = !1, size: a = 64, to: g, sx: v }) => {
|
|
19
|
+
const d = p ? 6 : 4, h = {
|
|
19
20
|
borderRadius: "4px",
|
|
20
21
|
flexShrink: 0,
|
|
21
|
-
height:
|
|
22
|
+
height: a,
|
|
22
23
|
overflow: "hidden",
|
|
23
|
-
width:
|
|
24
|
+
width: a
|
|
24
25
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ l(e, {
|
|
26
27
|
sx: {
|
|
27
|
-
bgcolor:
|
|
28
|
+
bgcolor: t,
|
|
28
29
|
...s && { backgroundImage: s },
|
|
29
30
|
p: 16,
|
|
30
31
|
position: "relative",
|
|
31
32
|
width: "100%",
|
|
32
|
-
...
|
|
33
|
+
...v
|
|
33
34
|
},
|
|
34
|
-
children: [
|
|
35
|
+
children: [u && /* @__PURE__ */ r(w, {}), /* @__PURE__ */ r(b, {
|
|
35
36
|
sx: {
|
|
36
37
|
position: "relative",
|
|
37
38
|
py: 16,
|
|
38
39
|
zIndex: 1
|
|
39
40
|
},
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ l(e, {
|
|
41
42
|
sx: {
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
display: "flex",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
position: "relative"
|
|
44
47
|
},
|
|
45
48
|
children: [/* @__PURE__ */ r(e, { sx: {
|
|
46
|
-
bgcolor: "
|
|
49
|
+
bgcolor: "divider",
|
|
47
50
|
borderRadius: "24px",
|
|
48
|
-
gridArea: "1 / 1",
|
|
49
51
|
height: R,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
left: x,
|
|
53
|
+
position: "absolute",
|
|
54
|
+
right: x,
|
|
55
|
+
top: "50%",
|
|
56
|
+
transform: "translateY(-50%)"
|
|
57
|
+
} }), /* @__PURE__ */ l(c, {
|
|
52
58
|
sx: {
|
|
53
59
|
alignItems: "center",
|
|
54
60
|
flexDirection: "row",
|
|
55
|
-
|
|
56
|
-
height: l,
|
|
61
|
+
height: a,
|
|
57
62
|
justifyContent: "space-between",
|
|
58
|
-
|
|
63
|
+
maxWidth: y,
|
|
64
|
+
position: "relative",
|
|
65
|
+
px: S,
|
|
66
|
+
width: "100%"
|
|
59
67
|
},
|
|
60
68
|
children: [
|
|
61
69
|
/* @__PURE__ */ r(e, {
|
|
62
|
-
sx:
|
|
63
|
-
children:
|
|
70
|
+
sx: h,
|
|
71
|
+
children: f
|
|
64
72
|
}),
|
|
65
|
-
/* @__PURE__ */ o
|
|
73
|
+
/* @__PURE__ */ r(o, { color: i }),
|
|
74
|
+
/* @__PURE__ */ r(o, {
|
|
75
|
+
color: i,
|
|
76
|
+
size: d
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ r(c, {
|
|
66
79
|
sx: {
|
|
67
80
|
alignItems: "center",
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
bgcolor: n,
|
|
82
|
+
borderRadius: "50%",
|
|
83
|
+
flexShrink: 0,
|
|
84
|
+
height: 28,
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
width: 28
|
|
70
87
|
},
|
|
71
|
-
children:
|
|
72
|
-
/* @__PURE__ */ r(a, { color: t }),
|
|
73
|
-
/* @__PURE__ */ r(a, {
|
|
74
|
-
color: t,
|
|
75
|
-
size: h
|
|
76
|
-
}),
|
|
77
|
-
/* @__PURE__ */ r(d, {
|
|
78
|
-
sx: {
|
|
79
|
-
alignItems: "center",
|
|
80
|
-
bgcolor: n,
|
|
81
|
-
borderRadius: "50%",
|
|
82
|
-
height: 28,
|
|
83
|
-
justifyContent: "center",
|
|
84
|
-
width: 28
|
|
85
|
-
},
|
|
86
|
-
children: p
|
|
87
|
-
}),
|
|
88
|
-
/* @__PURE__ */ r(a, {
|
|
89
|
-
color: t,
|
|
90
|
-
size: h
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */ r(a, { color: t })
|
|
93
|
-
]
|
|
88
|
+
children: m
|
|
94
89
|
}),
|
|
90
|
+
/* @__PURE__ */ r(o, {
|
|
91
|
+
color: i,
|
|
92
|
+
size: d
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ r(o, { color: i }),
|
|
95
95
|
/* @__PURE__ */ r(e, {
|
|
96
|
-
sx:
|
|
97
|
-
children:
|
|
96
|
+
sx: h,
|
|
97
|
+
children: g
|
|
98
98
|
})
|
|
99
99
|
]
|
|
100
100
|
})]
|
|
@@ -103,7 +103,7 @@ var b = 240, R = 40, T = 204, y = /* @__PURE__ */ r(v, {
|
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
W as default
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
//# sourceMappingURL=TransferLogoCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferLogoCard.es.js","names":[],"sources":["../../../src/insights-v2/components/TransferLogoCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { ConfettiOverlay } from './shared/ConfettiOverlay'\n\n// Figma
|
|
1
|
+
{"version":3,"file":"TransferLogoCard.es.js","names":[],"sources":["../../../src/insights-v2/components/TransferLogoCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { ConfettiOverlay } from './shared/ConfettiOverlay'\n\n// Figma (Discovered Accounts, Switch Direct Deposit): a 40px track inset 16 from the inner card's\n// edges, behind a row of logos, dots and badge that spans the card with 32 padding up to 324 wide.\nconst TRACK_HEIGHT = 40\nconst TRACK_INSET = 16\nconst ROW_MAX_WIDTH = 324\nconst ROW_PADDING_X = 32\n\ninterface TransferLogoCardProps {\n /** Source institution logo (left). */\n from: ReactNode\n /** Destination institution logo (right). */\n to: ReactNode\n /** Logo tile size in px (Figma: 64). */\n size?: number\n /** Arrow icon rendered in the center badge. Defaults to a right arrow. */\n icon?: ReactNode\n /**\n * Enlarge the inner connector dots (6px vs 4px), matching the Discovered\n * Accounts insight for cross-insight consistency. Default true.\n */\n hasBigDots?: boolean\n /** Connector-dot color token. Default `neutral.darker` (theme-aware). */\n dotColor?: string\n /** Center badge background color token. Default `neutral.darker` (dark circle\n * for Switch DD default; set to `success.main` for Discovered Accounts success). */\n badgeBgColor?: string\n /** Slot surface color token. Default `primary.lighter` (Figma's tinted slot,\n * theme-aware: light-blue in light mode, navy in dark). */\n bgcolor?: string\n /**\n * Optional background image (e.g., celebration gradient) for success states.\n * Layered over the `bgcolor` via `backgroundImage` (not `background` shorthand).\n */\n backgroundImage?: string\n /**\n * Show a confetti animation filling the slot (for success/celebration states).\n * Requires `useContainerDimensions` to measure the slot. Default false.\n */\n showConfetti?: boolean\n sx?: SxProps\n}\n\n// Default center-badge glyph. Hoisted to a stable reference so it isn't\n// re-created each render (`neutral.lighter` is the theme-aware inverse of the\n// badge fill: light glyph on dark badge, and vice-versa in dark).\nconst defaultTransferIcon = (\n <Icon aria-hidden={true} name=\"arrow_forward\" size={20} sx={{ color: 'neutral.lighter' }} />\n)\n\n// Connector dot: a small rounded square that reads as a dot at this size\n// (matches v1 `ConnectionCard`'s `Dot`). `neutral.darker` is theme-aware. The\n// inner pair is larger (`bigDots`, as Discovered Accounts uses) than the outer.\nconst Dot = ({ color = 'neutral.darker', size = 4 }: { color?: string; size?: number }) => (\n <Box sx={{ bgcolor: color, borderRadius: '4px', flexShrink: 0, height: size, width: size }} />\n)\n\n/**\n * A from → to account transfer visual: two institution logos on a rounded track\n * with a central arrow badge and connector dots between them.\n *\n * Figma: Switch Direct Deposit (default) and Discovered Accounts Content. Scope is the Content\n * section only.\n */\nconst TransferLogoCard = ({\n badgeBgColor = 'neutral.darker',\n bgcolor = 'primary.lighter',\n backgroundImage,\n dotColor = 'neutral.darker',\n from,\n hasBigDots = true,\n icon = defaultTransferIcon,\n showConfetti = false,\n size = 64,\n to,\n sx,\n}: TransferLogoCardProps) => {\n const dotSize = hasBigDots ? 6 : 4\n const logoSx = {\n borderRadius: '4px',\n flexShrink: 0,\n height: size,\n overflow: 'hidden',\n width: size,\n } as const\n\n return (\n <Box\n sx={{\n bgcolor,\n ...(backgroundImage && { backgroundImage }),\n p: 16,\n // Positioned wrapper so the confetti overlay can fill the slot; the card\n // sits above it (zIndex). No `overflow: hidden` — that would clip the\n // burst's upper area (per the figma-to-code confetti guidance).\n position: 'relative',\n width: '100%',\n ...sx,\n }}\n >\n {showConfetti && <ConfettiOverlay />}\n <Card sx={{ position: 'relative', py: 16, zIndex: 1 }}>\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n position: 'relative',\n }}\n >\n {/* Track, vertically centred behind the row and inset from the card's edges. */}\n <Box\n sx={{\n bgcolor: 'divider',\n borderRadius: '24px',\n height: TRACK_HEIGHT,\n left: TRACK_INSET,\n position: 'absolute',\n right: TRACK_INSET,\n top: '50%',\n transform: 'translateY(-50%)',\n }}\n />\n {/* Seven direct items, so space-between spreads the dots and badge evenly between the logos. */}\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n height: size,\n justifyContent: 'space-between',\n maxWidth: ROW_MAX_WIDTH,\n position: 'relative',\n px: ROW_PADDING_X,\n width: '100%',\n }}\n >\n <Box sx={logoSx}>{from}</Box>\n <Dot color={dotColor} />\n <Dot color={dotColor} size={dotSize} />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: badgeBgColor,\n borderRadius: '50%',\n flexShrink: 0,\n height: 28,\n justifyContent: 'center',\n width: 28,\n }}\n >\n {icon}\n </Stack>\n <Dot color={dotColor} size={dotSize} />\n <Dot color={dotColor} />\n <Box sx={logoSx}>{to}</Box>\n </Stack>\n </Box>\n </Card>\n </Box>\n )\n}\n\nexport default TransferLogoCard\n"],"mappings":";;;;;;AAYA,IAAM,IAAe,IACf,IAAc,IACd,IAAgB,KAChB,IAAgB,IAwChB,IACJ,gBAAA,EAAC,GAAD;AAAA,EAAM,eAAa;AAAA,EAAM,MAAK;AAAA,EAAgB,MAAM;AAAA,EAAI,IAAI,EAAE,OAAO,kBAAkB;AAAI,CAAA,GAMvF,IAAA,CAAO,EAAE,OAAA,IAAQ,kBAAkB,MAAA,IAAO,EAAA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,UACE,IAAI;AAAA,YACF,YAAY;AAAA,YACZ,eAAe;AAAA,YACf,QAAQ;AAAA,YACR,gBAAgB;AAAA,YAChB,UAAU;AAAA,YACV,UAAU;AAAA,YACV,IAAI;AAAA,YACJ,OAAO;AAAA,UACT;AAAA,UAVF,UAAA;AAAA,YAYE,gBAAA,EAAC,GAAD;AAAA,cAAK,IAAI;AAAA,cAAS,UAAA;AAAA,YAAU,CAAA;AAAA,YAC5B,gBAAA,EAAC,GAAD,EAAK,OAAO,EAAW,CAAA;AAAA,YACvB,gBAAA,EAAC,GAAD;AAAA,cAAK,OAAO;AAAA,cAAU,MAAM;AAAA,YAAU,CAAA;AAAA,YACtC,gBAAA,EAAC,GAAD;AAAA,cACE,IAAI;AAAA,gBACF,YAAY;AAAA,gBACZ,SAAS;AAAA,gBACT,cAAc;AAAA,gBACd,YAAY;AAAA,gBACZ,QAAQ;AAAA,gBACR,gBAAgB;AAAA,gBAChB,OAAO;AAAA,cACT;AAAA,cAEC,UAAA;AAAA,YACI,CAAA;AAAA,YACP,gBAAA,EAAC,GAAD;AAAA,cAAK,OAAO;AAAA,cAAU,MAAM;AAAA,YAAU,CAAA;AAAA,YACtC,gBAAA,EAAC,GAAD,EAAK,OAAO,EAAW,CAAA;AAAA,YACvB,gBAAA,EAAC,GAAD;AAAA,cAAK,IAAI;AAAA,cAAS,UAAA;AAAA,YAAQ,CAAA;AAAA,UACrB;AAAA,QACJ,CAAA,CAAA;AAAA;IACD,CAAA,CACH;AAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { alpha as a } from "@mui/material/styles";
|
|
2
|
-
var i = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)", n = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)", g = (r) => `linear-gradient(${r}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`, d = g(
|
|
2
|
+
var i = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)", n = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)", g = (r) => `linear-gradient(${r}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`, d = g(200.73), A = "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)", E = "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)", N = ({ palette: r }) => `linear-gradient(173deg, ${a(r.primary.light, 0.75)} 46.41%, ${a(r.primary.main, 0.75)} 78.14%)`;
|
|
3
3
|
export {
|
|
4
4
|
d as ACCOUNT_CONNECTED_GRADIENT,
|
|
5
5
|
n as CELEBRATION_GRADIENT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` is opaque and stands alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: low balance, off-track status.\n * - getPrimaryWashGradient(theme): pending connect / detected subscription, from the palette.\n */\n\n/**\n * Warm → lime accent wash at 20% opacity. Used as a tinted background behind\n * merchant categorization highlights and deposit celebration callouts.\n */\nexport const WARM_LIME_ACCENT_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)'\n\n/** Warm → pink wash behind balance/savings milestones. */\nexport const CELEBRATION_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)'\n\n/** Figma Celebrate Gradient; its angle varies per slot. */\nexport const celebrateGradient = (angleDeg: number) =>\n `linear-gradient(${angleDeg}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`\n\n/** Peach → pink gradient for Discovered Accounts success state. */\nexport const DISCOVERED_ACCOUNTS_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 224, 153, 1) 1.86%, rgba(255, 129, 230, 1) 101.54%)'\n\n/**\n * Warm → pink wash at 20% opacity for the account-connected success state.\n * Layer over `background.paper` (the Figma spec's `#FFF` base), not the\n * `background` shorthand — a 20% gradient over transparency renders wrong.\n */\nexport const ACCOUNT_CONNECTED_GRADIENT = celebrateGradient(
|
|
1
|
+
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` is opaque and stands alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: low balance, off-track status.\n * - getPrimaryWashGradient(theme): pending connect / detected subscription, from the palette.\n */\n\n/**\n * Warm → lime accent wash at 20% opacity. Used as a tinted background behind\n * merchant categorization highlights and deposit celebration callouts.\n */\nexport const WARM_LIME_ACCENT_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)'\n\n/** Warm → pink wash behind balance/savings milestones. */\nexport const CELEBRATION_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)'\n\n/** Figma Celebrate Gradient; its angle varies per slot. */\nexport const celebrateGradient = (angleDeg: number) =>\n `linear-gradient(${angleDeg}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`\n\n/** Peach → pink gradient for Discovered Accounts success state. */\nexport const DISCOVERED_ACCOUNTS_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 224, 153, 1) 1.86%, rgba(255, 129, 230, 1) 101.54%)'\n\n/**\n * Warm → pink wash at 20% opacity for the account-connected success state.\n * Layer over `background.paper` (the Figma spec's `#FFF` base), not the\n * `background` shorthand — a 20% gradient over transparency renders wrong.\n */\nexport const ACCOUNT_CONNECTED_GRADIENT = celebrateGradient(200.73)\n\n/**\n * Orange → red-orange wash at 25% opacity behind a flagged charge (Unexpected Subscription\n * Payment). Figma \"Warning Gradient 1\": a bespoke two-stop blend with no palette token, so it\n * stays a literal like the other washes here rather than being derived from `palette.warning`.\n */\nexport const WARNING_WASH_GRADIENT =\n 'linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)'\n\n/** Red wash at 20%: low balance, off-track status. */\nexport const ERROR_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)'\n\n/**\n * Blue slot wash behind a pending connect / detected-subscription row: `primary.light` →\n * `primary.main` at 75% over paper, built from the live palette so it follows the theme.\n */\nexport const getPrimaryWashGradient = ({ palette }: Theme) =>\n `linear-gradient(173deg, ${alpha(palette.primary.light, 0.75)} 46.41%, ${alpha(palette.primary.main, 0.75)} 78.14%)`\n"],"mappings":";AAmBA,IAAa,IACX,+FAGW,IACX,gGAGW,IAAA,CAAqB,MAChC,mBAAmB,CAAA,0EAWR,IAA6B,EAAkB,MAAM,GAOrD,IACX,0FAGW,IACX,2FAMW,IAAA,CAA0B,EAAE,SAAA,EAAA,MACvC,2BAA2B,EAAM,EAAQ,QAAQ,OAAO,IAAI,CAAA,YAAa,EAAM,EAAQ,QAAQ,MAAM,IAAI,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import D from "react";
|
|
2
2
|
import { P as b, Text as m } from "@mxenabled/mxui";
|
|
3
|
-
import { Close as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { Box as j, Button as u, Card as I, CardActionArea as
|
|
6
|
-
var O =
|
|
7
|
-
const a = !!(s && d), g = /* @__PURE__ */ e(
|
|
3
|
+
import { Close as M } from "@mxenabled/mx-icons";
|
|
4
|
+
import { Fragment as T, jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
5
|
+
import { Box as j, Button as u, Card as I, CardActionArea as R, IconButton as S, Stack as i } from "@mui/material";
|
|
6
|
+
var O = D.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v, elevation: P, icon: r, isActiveCard: l, heightOverrides: k, onClose: p, onCardClick: n, onPrimaryAction: s, onSecondaryAction: h, primaryActionText: d, secondaryActionText: c, title: y, variant: C, widthOverrides: x, ...W }, B) {
|
|
7
|
+
const a = !!(s && d), g = /* @__PURE__ */ e(T, { children: [p && /* @__PURE__ */ o(S, {
|
|
8
8
|
"aria-label": w,
|
|
9
|
-
onClick: (
|
|
10
|
-
|
|
9
|
+
onClick: (t) => {
|
|
10
|
+
t.stopPropagation(), p?.();
|
|
11
11
|
},
|
|
12
|
-
onMouseDown: (
|
|
13
|
-
|
|
12
|
+
onMouseDown: (t) => {
|
|
13
|
+
t.stopPropagation();
|
|
14
14
|
},
|
|
15
|
-
onTouchStart: (
|
|
16
|
-
|
|
15
|
+
onTouchStart: (t) => {
|
|
16
|
+
t.stopPropagation();
|
|
17
17
|
},
|
|
18
18
|
sx: {
|
|
19
19
|
minHeight: 40,
|
|
@@ -22,7 +22,7 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
22
22
|
right: 4,
|
|
23
23
|
top: 4
|
|
24
24
|
},
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ o(M, {})
|
|
26
26
|
}), /* @__PURE__ */ e(i, {
|
|
27
27
|
sx: {
|
|
28
28
|
gap: 6,
|
|
@@ -36,21 +36,22 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
36
36
|
},
|
|
37
37
|
children: [r, /* @__PURE__ */ e(i, {
|
|
38
38
|
sx: { gap: 6 },
|
|
39
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ o(i, {
|
|
40
40
|
sx: {
|
|
41
41
|
flexDirection: "row",
|
|
42
42
|
justifyContent: "space-between"
|
|
43
43
|
},
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ o(b, {
|
|
45
45
|
bold: !0,
|
|
46
46
|
sx: { lineHeight: "16px" },
|
|
47
47
|
variant: "body1",
|
|
48
48
|
children: y
|
|
49
49
|
})
|
|
50
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ o(b, {
|
|
51
51
|
dangerouslySetInnerHTML: { __html: v },
|
|
52
52
|
sx: {
|
|
53
53
|
display: "-webkit-box",
|
|
54
|
+
fontWeight: "fontWeightRegular",
|
|
54
55
|
overflow: "hidden",
|
|
55
56
|
textOverflow: "ellipsis",
|
|
56
57
|
WebkitBoxOrient: "vertical",
|
|
@@ -71,15 +72,15 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
71
72
|
pb: 4,
|
|
72
73
|
pl: r ? 36 : 0
|
|
73
74
|
},
|
|
74
|
-
children: [a && /* @__PURE__ */
|
|
75
|
-
onClick: (
|
|
76
|
-
|
|
75
|
+
children: [a && /* @__PURE__ */ o(u, {
|
|
76
|
+
onClick: (t) => {
|
|
77
|
+
t.stopPropagation(), s?.();
|
|
77
78
|
},
|
|
78
|
-
onMouseDown: (
|
|
79
|
-
|
|
79
|
+
onMouseDown: (t) => {
|
|
80
|
+
t.stopPropagation();
|
|
80
81
|
},
|
|
81
|
-
onTouchStart: (
|
|
82
|
-
|
|
82
|
+
onTouchStart: (t) => {
|
|
83
|
+
t.stopPropagation();
|
|
83
84
|
},
|
|
84
85
|
size: "small",
|
|
85
86
|
sx: {
|
|
@@ -87,25 +88,25 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
87
88
|
ml: r ? 0 : -8
|
|
88
89
|
},
|
|
89
90
|
variant: "text",
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ o(m, {
|
|
91
92
|
bold: !0,
|
|
92
93
|
variant: "body2",
|
|
93
94
|
children: d
|
|
94
95
|
})
|
|
95
|
-
}), !!(h && c) && /* @__PURE__ */
|
|
96
|
-
onClick: (
|
|
97
|
-
|
|
96
|
+
}), !!(h && c) && /* @__PURE__ */ o(u, {
|
|
97
|
+
onClick: (t) => {
|
|
98
|
+
t.stopPropagation(), h?.();
|
|
98
99
|
},
|
|
99
|
-
onMouseDown: (
|
|
100
|
-
|
|
100
|
+
onMouseDown: (t) => {
|
|
101
|
+
t.stopPropagation();
|
|
101
102
|
},
|
|
102
|
-
onTouchStart: (
|
|
103
|
-
|
|
103
|
+
onTouchStart: (t) => {
|
|
104
|
+
t.stopPropagation();
|
|
104
105
|
},
|
|
105
106
|
size: "small",
|
|
106
107
|
sx: { px: 8 },
|
|
107
108
|
variant: "text",
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ o(m, {
|
|
109
110
|
bold: !0,
|
|
110
111
|
sx: { color: "text.secondary" },
|
|
111
112
|
variant: "body2",
|
|
@@ -114,11 +115,11 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
114
115
|
})]
|
|
115
116
|
})]
|
|
116
117
|
})] });
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ o(I, {
|
|
118
119
|
"aria-hidden": !l,
|
|
119
120
|
"aria-label": f,
|
|
120
121
|
elevation: P,
|
|
121
|
-
ref:
|
|
122
|
+
ref: B,
|
|
122
123
|
role: "group",
|
|
123
124
|
sx: {
|
|
124
125
|
backgroundColor: "background.paper",
|
|
@@ -130,8 +131,8 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
130
131
|
},
|
|
131
132
|
tabIndex: n || !l ? -1 : 0,
|
|
132
133
|
variant: C,
|
|
133
|
-
...
|
|
134
|
-
children: n ? /* @__PURE__ */
|
|
134
|
+
...W,
|
|
135
|
+
children: n ? /* @__PURE__ */ o(R, {
|
|
135
136
|
component: "div",
|
|
136
137
|
onClick: n,
|
|
137
138
|
sx: {
|
|
@@ -141,7 +142,7 @@ var O = M.forwardRef(function({ ariaLabel: f, closeAriaLabel: w, description: v,
|
|
|
141
142
|
height: "100%"
|
|
142
143
|
},
|
|
143
144
|
children: g
|
|
144
|
-
}) : /* @__PURE__ */
|
|
145
|
+
}) : /* @__PURE__ */ o(j, {
|
|
145
146
|
sx: {
|
|
146
147
|
pb: 8,
|
|
147
148
|
pt: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MicroCardTemplate.es.js","names":[],"sources":["../../src/microinsights/MicroCardTemplate.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, Button, Card, CardActionArea, IconButton, Stack } from '@mui/material'\n\nimport { P, Text } from '@mxenabled/mxui'\nimport { Close } from '@mxenabled/mx-icons'\n\ninterface MicroCardTemplateProps {\n ariaLabel?: string\n closeAriaLabel?: string\n description: string\n elevation?: number\n icon?: React.ReactNode\n isActiveCard?: boolean\n heightOverrides?: string | number\n onClose?: () => void\n onCardClick?: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryActionText?: string\n secondaryActionText?: string\n title: string\n variant?: 'outlined' | 'elevation' | undefined\n widthOverrides?: string | number\n}\n\nconst MicroCardTemplate = React.forwardRef<HTMLDivElement, MicroCardTemplateProps>(\n function MicroCardTemplate(\n {\n ariaLabel,\n closeAriaLabel,\n description,\n elevation,\n icon,\n isActiveCard,\n heightOverrides,\n onClose,\n onCardClick,\n onPrimaryAction,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n variant,\n widthOverrides,\n ...restProps\n },\n inViewRef,\n ) {\n const hasPrimaryAction = Boolean(onPrimaryAction && primaryActionText)\n const hasSecondaryAction = Boolean(onSecondaryAction && secondaryActionText)\n\n const innerContent = (\n <>\n {onClose && (\n <IconButton\n aria-label={closeAriaLabel}\n onClick={(e) => {\n e.stopPropagation()\n onClose?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n sx={{ minHeight: 40, minWidth: 40, position: 'absolute', right: 4, top: 4 }}\n >\n <Close />\n </IconButton>\n )}\n <Stack sx={{ gap: 6, height: '100%', justifyContent: 'space-between' }}>\n <Stack sx={{ flexDirection: 'row', gap: 12 }}>\n {icon}\n <Stack sx={{ gap: 6 }}>\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <P bold={true} sx={{ lineHeight: '16px' }} variant=\"body1\">\n {title}\n </P>\n </Stack>\n <P\n dangerouslySetInnerHTML={{ __html: description }}\n sx={{\n display: '-webkit-box',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: hasPrimaryAction ? 2 : 3,\n '& .bold-copy': {\n fontWeight: 'bold',\n fontFamily: 'inherit',\n },\n }}\n variant=\"subtitle2\"\n />\n </Stack>\n </Stack>\n\n {hasPrimaryAction && (\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n height: 28,\n pb: 4,\n pl: icon ? 36 : 0,\n }}\n >\n {hasPrimaryAction && (\n <Button\n onClick={(e) => {\n e.stopPropagation()\n onPrimaryAction?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n size=\"small\"\n sx={{ px: 8, ml: icon ? 0 : -8 }}\n variant=\"text\"\n >\n <Text bold={true} variant=\"body2\">\n {primaryActionText}\n </Text>\n </Button>\n )}\n\n {hasSecondaryAction && (\n <Button\n onClick={(e) => {\n e.stopPropagation()\n onSecondaryAction?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n size=\"small\"\n sx={{ px: 8 }}\n variant=\"text\"\n >\n <Text bold={true} sx={{ color: 'text.secondary' }} variant=\"body2\">\n {secondaryActionText}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n </Stack>\n </>\n )\n\n return (\n <Card\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n elevation={elevation}\n ref={inViewRef}\n role=\"group\"\n sx={{\n backgroundColor: 'background.paper',\n height: heightOverrides ? '100%' : 120,\n minWidth: widthOverrides ? `${widthOverrides}px` : '100%',\n position: 'relative',\n my: 1,\n borderRadius: 2,\n }}\n tabIndex={onCardClick || !isActiveCard ? -1 : 0}\n variant={variant}\n {...restProps}\n >\n {onCardClick ? (\n <CardActionArea\n component=\"div\"\n onClick={onCardClick}\n sx={{\n pb: 8,\n pt: 16,\n px: 16,\n height: '100%',\n }}\n >\n {innerContent}\n </CardActionArea>\n ) : (\n <Box sx={{ pb: 8, pt: 16, px: 16, height: '100%' }}>{innerContent}</Box>\n )}\n </Card>\n )\n },\n)\n\nexport default MicroCardTemplate\n"],"mappings":";;;;;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AA,YAAG,MAAM;AAAA,YAAM,IAAI,EAAE,YAAY,OAAO;AAAA,YAAG,SAAQ;AAAA,YAChD,UAAA;AAAA,UACA,CAAA;AAAA,QACE,CAAA,GACP,gBAAA,EAAC,GAAD;AAAA,UACE,yBAAyB,EAAE,QAAQ,EAAY;AAAA,UAC/C,IAAI;AAAA,YACF,SAAS;AAAA,YACT,UAAU;AAAA,YACV,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,iBAAiB,IAAmB,IAAI;AAAA,YACxC,gBAAgB;AAAA,cACd,YAAY;AAAA,cACZ,YAAY;AAAA,YACd;AAAA,UACF;AAAA,UACA,SAAQ;AAAA,QACT,CAAA,CACI;AAAA,MACF,CAAA,CAAA;AAAA,IAEN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,IAAI;AAAA,QACJ,IAAI,IAAO,KAAK;AAAA,MAClB;AAAA,MAPF,UAAA,CASG,KACC,gBAAA,EAAC,GAAD;AAAA,QACE,SAAA,CAAU,MAAM;AACd,UAAA,EAAE,gBAAgB,GAClB,IAAkB;AAAA,QACpB;AAAA,QACA,aAAA,CAAc,MAAM;AAClB,UAAA,EAAE,gBAAgB;AAAA,QACpB;AAAA,QACA,cAAA,CAAe,MAAM;AACnB,UAAA,EAAE,gBAAgB;AAAA,QACpB;AAAA,QACA,MAAK;AAAA,QACL,IAAI;AAAA,UAAE,IAAI;AAAA,UAAG,IAAI,IAAO,IAAI;AAAA,QAAG;AAAA,QAC/B,SAAQ;AAAA,QAER,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,SAAQ;AAAA,UACvB,UAAA;AAAA,QACG,CAAA;AAAA,MACA,CAAA,
|
|
1
|
+
{"version":3,"file":"MicroCardTemplate.es.js","names":[],"sources":["../../src/microinsights/MicroCardTemplate.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, Button, Card, CardActionArea, IconButton, Stack } from '@mui/material'\n\nimport { P, Text } from '@mxenabled/mxui'\nimport { Close } from '@mxenabled/mx-icons'\n\ninterface MicroCardTemplateProps {\n ariaLabel?: string\n closeAriaLabel?: string\n description: string\n elevation?: number\n icon?: React.ReactNode\n isActiveCard?: boolean\n heightOverrides?: string | number\n onClose?: () => void\n onCardClick?: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryActionText?: string\n secondaryActionText?: string\n title: string\n variant?: 'outlined' | 'elevation' | undefined\n widthOverrides?: string | number\n}\n\nconst MicroCardTemplate = React.forwardRef<HTMLDivElement, MicroCardTemplateProps>(\n function MicroCardTemplate(\n {\n ariaLabel,\n closeAriaLabel,\n description,\n elevation,\n icon,\n isActiveCard,\n heightOverrides,\n onClose,\n onCardClick,\n onPrimaryAction,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n variant,\n widthOverrides,\n ...restProps\n },\n inViewRef,\n ) {\n const hasPrimaryAction = Boolean(onPrimaryAction && primaryActionText)\n const hasSecondaryAction = Boolean(onSecondaryAction && secondaryActionText)\n\n const innerContent = (\n <>\n {onClose && (\n <IconButton\n aria-label={closeAriaLabel}\n onClick={(e) => {\n e.stopPropagation()\n onClose?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n sx={{ minHeight: 40, minWidth: 40, position: 'absolute', right: 4, top: 4 }}\n >\n <Close />\n </IconButton>\n )}\n <Stack sx={{ gap: 6, height: '100%', justifyContent: 'space-between' }}>\n <Stack sx={{ flexDirection: 'row', gap: 12 }}>\n {icon}\n <Stack sx={{ gap: 6 }}>\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <P bold={true} sx={{ lineHeight: '16px' }} variant=\"body1\">\n {title}\n </P>\n </Stack>\n <P\n dangerouslySetInnerHTML={{ __html: description }}\n sx={{\n display: '-webkit-box',\n fontWeight: 'fontWeightRegular',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: hasPrimaryAction ? 2 : 3,\n '& .bold-copy': {\n fontWeight: 'bold',\n fontFamily: 'inherit',\n },\n }}\n variant=\"subtitle2\"\n />\n </Stack>\n </Stack>\n\n {hasPrimaryAction && (\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n height: 28,\n pb: 4,\n pl: icon ? 36 : 0,\n }}\n >\n {hasPrimaryAction && (\n <Button\n onClick={(e) => {\n e.stopPropagation()\n onPrimaryAction?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n size=\"small\"\n sx={{ px: 8, ml: icon ? 0 : -8 }}\n variant=\"text\"\n >\n <Text bold={true} variant=\"body2\">\n {primaryActionText}\n </Text>\n </Button>\n )}\n\n {hasSecondaryAction && (\n <Button\n onClick={(e) => {\n e.stopPropagation()\n onSecondaryAction?.()\n }}\n onMouseDown={(e) => {\n e.stopPropagation()\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n }}\n size=\"small\"\n sx={{ px: 8 }}\n variant=\"text\"\n >\n <Text bold={true} sx={{ color: 'text.secondary' }} variant=\"body2\">\n {secondaryActionText}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n </Stack>\n </>\n )\n\n return (\n <Card\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n elevation={elevation}\n ref={inViewRef}\n role=\"group\"\n sx={{\n backgroundColor: 'background.paper',\n height: heightOverrides ? '100%' : 120,\n minWidth: widthOverrides ? `${widthOverrides}px` : '100%',\n position: 'relative',\n my: 1,\n borderRadius: 2,\n }}\n tabIndex={onCardClick || !isActiveCard ? -1 : 0}\n variant={variant}\n {...restProps}\n >\n {onCardClick ? (\n <CardActionArea\n component=\"div\"\n onClick={onCardClick}\n sx={{\n pb: 8,\n pt: 16,\n px: 16,\n height: '100%',\n }}\n >\n {innerContent}\n </CardActionArea>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