@mx-cartographer/experiences 9.7.71-alpha-ram-usp-2 → 9.7.72
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 +2 -5
- package/dist/core/stores/GlobalCopyStore.d.ts +0 -6
- package/dist/core/stores/GlobalCopyStore.es.js +8 -14
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -24
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +59 -92
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +1 -9
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +5 -9
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/BaseLayout.es.js +146 -160
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +1 -14
- package/dist/insights-v2/components/CtaStatus.es.js +38 -76
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +1 -3
- package/dist/insights-v2/components/InsightTransactionRow.es.js +20 -36
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.d.ts +1 -5
- package/dist/insights-v2/components/TransactionListCard.es.js +49 -69
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/WithdrawalCard.es.js +8 -10
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +1 -10
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +11 -27
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +9 -23
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +0 -7
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +62 -73
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +1 -10
- package/dist/insights-v2/ctaActions/types.d.ts +2 -5
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +0 -6
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +27 -32
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +0 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +0 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +68 -74
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +17 -21
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +86 -91
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/stores/CopyStore.d.ts +1 -4
- package/dist/microinsights/stores/CopyStore.es.js +10 -13
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +0 -6
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +0 -168
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +0 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +0 -4
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +0 -10
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +0 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +0 -16
- package/dist/insights-v2/components/shared/elevation.es.js +0 -15
- package/dist/insights-v2/components/shared/elevation.es.js.map +0 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +0 -115
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +0 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +0 -18
- package/dist/microinsights/cards/MicroCtaStatus.es.js +0 -44
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +0 -1
|
@@ -1,105 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Text as
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { jsx as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
icon: (e) => c(e.palette.text.primary, 0.7)
|
|
12
|
-
}, p = (e) => (i) => {
|
|
13
|
-
const r = i.palette[e];
|
|
14
|
-
return i.palette.mode === "dark" ? r[800] ?? r.darker ?? r.dark : r[50] ?? r.lighter ?? r.light;
|
|
15
|
-
}, g = {
|
|
16
|
-
tinted: {
|
|
17
|
-
success: {
|
|
18
|
-
main: "success.main",
|
|
19
|
-
fill: "success.lighter",
|
|
20
|
-
text: "success.dark"
|
|
21
|
-
},
|
|
22
|
-
neutral: m,
|
|
23
|
-
error: {
|
|
24
|
-
main: "error.main",
|
|
25
|
-
fill: "error.lighter",
|
|
26
|
-
text: "error.dark"
|
|
27
|
-
}
|
|
1
|
+
import i from "@mui/material/Stack";
|
|
2
|
+
import { Text as n } from "@mxenabled/mxui";
|
|
3
|
+
import c from "@mui/material/Button";
|
|
4
|
+
import { Icon as m } from "@mxenabled/mx-icons";
|
|
5
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
var d = {
|
|
7
|
+
success: {
|
|
8
|
+
main: "success.main",
|
|
9
|
+
fill: "success.lighter",
|
|
10
|
+
text: "success.dark"
|
|
28
11
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
main: "error.main",
|
|
39
|
-
fill: p("error"),
|
|
40
|
-
text: "text.primary",
|
|
41
|
-
icon: "error.main"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, h = {
|
|
45
|
-
tinted: {},
|
|
46
|
-
alert: {
|
|
47
|
-
fontSize: 13,
|
|
48
|
-
fontWeight: 600,
|
|
49
|
-
lineHeight: "16px",
|
|
50
|
-
minWidth: 0,
|
|
51
|
-
px: 8,
|
|
52
|
-
py: 4
|
|
12
|
+
neutral: {
|
|
13
|
+
main: "text.secondary",
|
|
14
|
+
fill: "background.default",
|
|
15
|
+
text: "text.primary"
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
main: "error.main",
|
|
19
|
+
fill: "error.lighter",
|
|
20
|
+
text: "error.dark"
|
|
53
21
|
}
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
22
|
+
}, g = ({ label: l, tone: a, icon: o, action: e }) => {
|
|
23
|
+
const r = d[a];
|
|
24
|
+
return /* @__PURE__ */ s(i, {
|
|
57
25
|
alignItems: "center",
|
|
58
26
|
direction: "row",
|
|
59
27
|
gap: 8,
|
|
60
|
-
justifyContent:
|
|
28
|
+
justifyContent: e ? "space-between" : "center",
|
|
61
29
|
sx: {
|
|
62
|
-
bgcolor:
|
|
30
|
+
bgcolor: r.fill,
|
|
63
31
|
border: "1px solid",
|
|
64
|
-
borderColor:
|
|
32
|
+
borderColor: r.main,
|
|
65
33
|
borderRadius: 1,
|
|
66
34
|
minHeight: 44,
|
|
67
35
|
px: 16,
|
|
68
|
-
py: 8
|
|
69
|
-
...d
|
|
36
|
+
py: 8
|
|
70
37
|
},
|
|
71
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ s(i, {
|
|
72
39
|
alignItems: "center",
|
|
73
|
-
className: C,
|
|
74
40
|
direction: "row",
|
|
75
41
|
gap: 8,
|
|
76
42
|
role: "status",
|
|
77
|
-
children: [
|
|
43
|
+
children: [o && /* @__PURE__ */ t(m, {
|
|
78
44
|
"aria-hidden": !0,
|
|
79
45
|
fill: !0,
|
|
80
|
-
name:
|
|
46
|
+
name: o,
|
|
81
47
|
size: 24,
|
|
82
|
-
sx: { color:
|
|
83
|
-
}), /* @__PURE__ */
|
|
48
|
+
sx: { color: r.main }
|
|
49
|
+
}), /* @__PURE__ */ t(n, {
|
|
84
50
|
bold: !0,
|
|
85
|
-
sx: { color:
|
|
51
|
+
sx: { color: r.text },
|
|
86
52
|
variant: "body1",
|
|
87
|
-
children:
|
|
53
|
+
children: l
|
|
88
54
|
})]
|
|
89
|
-
}),
|
|
90
|
-
onClick:
|
|
55
|
+
}), e && /* @__PURE__ */ t(c, {
|
|
56
|
+
onClick: e.onPress,
|
|
91
57
|
size: "small",
|
|
92
|
-
sx: {
|
|
93
|
-
|
|
94
|
-
...h[r]
|
|
95
|
-
},
|
|
96
|
-
children: a.label
|
|
58
|
+
sx: { color: r.text },
|
|
59
|
+
children: e.label
|
|
97
60
|
})]
|
|
98
61
|
});
|
|
99
62
|
};
|
|
100
63
|
export {
|
|
101
|
-
|
|
102
|
-
N as CtaStatus
|
|
64
|
+
g as CtaStatus
|
|
103
65
|
};
|
|
104
66
|
|
|
105
67
|
//# sourceMappingURL=CtaStatus.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\
|
|
1
|
+
{"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nexport type CtaStatusTone = 'success' | 'neutral' | 'error'\n\nexport interface CtaStatusProps {\n /** The words, from the backend (copy or a slot) so they stay localized and customizable. */\n label: string\n /** Background, border, icon and text colours. */\n tone: CtaStatusTone\n /** mx-icons name, drawn filled and hidden from assistive technology. */\n icon?: string\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"). */\n action?: { label: string; onPress: () => void }\n}\n\n// Figma: the \"after the press\" bar drawn in a CTA's place (Designate's \"Account Saved!\",\n// Subscription Detected's \"Confirmed / Undo\"). Button-sized, outlined, tinted fill.\nconst TONE_COLORS: Record<CtaStatusTone, { main: string; fill: string; text: string }> = {\n success: { main: 'success.main', fill: 'success.lighter', text: 'success.dark' },\n neutral: { main: 'text.secondary', fill: 'background.default', text: 'text.primary' },\n error: { main: 'error.main', fill: 'error.lighter', text: 'error.dark' },\n}\n\n/**\n * A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a\n * control itself (`role=\"status\"`); only the optional inline `action` is pressable.\n */\nexport const CtaStatus = ({ label, tone, icon, action }: CtaStatusProps) => {\n const colors = TONE_COLORS[tone]\n\n return (\n <Stack\n alignItems=\"center\"\n direction=\"row\"\n gap={8}\n justifyContent={action ? 'space-between' : 'center'}\n sx={{\n bgcolor: colors.fill,\n border: '1px solid',\n borderColor: colors.main,\n borderRadius: 1,\n minHeight: 44,\n px: 16,\n py: 8,\n }}\n >\n <Stack alignItems=\"center\" direction=\"row\" gap={8} role=\"status\">\n {icon && (\n <Icon aria-hidden={true} fill={true} name={icon} size={24} sx={{ color: colors.main }} />\n )}\n <Text bold={true} sx={{ color: colors.text }} variant=\"body1\">\n {label}\n </Text>\n </Stack>\n {action && (\n <Button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KACC,gBAAA,EAAC,GAAD;AAAA,MAAQ,SAAS,EAAO;AAAA,MAAS,MAAK;AAAA,MAAQ,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MACpE,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
|
|
@@ -11,8 +11,6 @@ export interface InsightTransactionRowProps {
|
|
|
11
11
|
amount: ReactNode;
|
|
12
12
|
/** Theme token for the amount text (e.g. 'success.main' for credits). */
|
|
13
13
|
amountColor?: string;
|
|
14
|
-
/** Caption under the amount (e.g. frequency). */
|
|
15
|
-
amountCaption?: ReactNode;
|
|
16
14
|
sx?: SxProps;
|
|
17
15
|
}
|
|
18
16
|
/**
|
|
@@ -21,5 +19,5 @@ export interface InsightTransactionRowProps {
|
|
|
21
19
|
* `InsightTransactionRow` to avoid colliding with the transactions widget's
|
|
22
20
|
* public `TransactionRow` export.
|
|
23
21
|
*/
|
|
24
|
-
declare const InsightTransactionRow: ({ amount,
|
|
22
|
+
declare const InsightTransactionRow: ({ amount, amountColor, leading, subtitle, title, sx, }: InsightTransactionRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
export default InsightTransactionRow;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import t from "@mui/material/Stack";
|
|
2
|
-
import { Text as
|
|
3
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { Text as i } from "@mxenabled/mxui";
|
|
3
|
+
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
4
4
|
import m from "@mui/material/Box";
|
|
5
|
-
var
|
|
5
|
+
var f = ({ amount: o, amountColor: a = "text.primary", leading: n, subtitle: l, title: x, sx: c }) => /* @__PURE__ */ e(t, {
|
|
6
6
|
sx: {
|
|
7
7
|
alignItems: "flex-start",
|
|
8
8
|
flexDirection: "row",
|
|
@@ -10,9 +10,9 @@ var u = ({ amount: o, amountCaption: n, amountColor: l = "text.primary", leading
|
|
|
10
10
|
px: 16,
|
|
11
11
|
py: 14,
|
|
12
12
|
width: "100%",
|
|
13
|
-
...
|
|
13
|
+
...c
|
|
14
14
|
},
|
|
15
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ e(t, {
|
|
16
16
|
sx: {
|
|
17
17
|
alignItems: "center",
|
|
18
18
|
flexDirection: "row",
|
|
@@ -20,53 +20,37 @@ var u = ({ amount: o, amountCaption: n, amountColor: l = "text.primary", leading
|
|
|
20
20
|
gap: 12,
|
|
21
21
|
minWidth: 0
|
|
22
22
|
},
|
|
23
|
-
children: [
|
|
23
|
+
children: [n && /* @__PURE__ */ r(m, {
|
|
24
24
|
sx: { flexShrink: 0 },
|
|
25
|
-
children:
|
|
26
|
-
}), /* @__PURE__ */
|
|
25
|
+
children: n
|
|
26
|
+
}), /* @__PURE__ */ e(t, {
|
|
27
27
|
sx: { minWidth: 0 },
|
|
28
|
-
children: [/* @__PURE__ */ r(
|
|
28
|
+
children: [/* @__PURE__ */ r(i, {
|
|
29
29
|
bold: !0,
|
|
30
30
|
truncate: !0,
|
|
31
31
|
variant: "body1",
|
|
32
32
|
children: x
|
|
33
|
-
}), /* @__PURE__ */ r(
|
|
33
|
+
}), /* @__PURE__ */ r(i, {
|
|
34
34
|
color: "text.primary",
|
|
35
35
|
truncate: !0,
|
|
36
36
|
variant: "caption",
|
|
37
|
-
children:
|
|
37
|
+
children: l
|
|
38
38
|
})]
|
|
39
39
|
})]
|
|
40
|
-
}), /* @__PURE__ */ i
|
|
40
|
+
}), /* @__PURE__ */ r(i, {
|
|
41
|
+
bold: !0,
|
|
42
|
+
color: a,
|
|
41
43
|
sx: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
flexShrink: 0,
|
|
45
|
+
fontVariantNumeric: "lining-nums tabular-nums",
|
|
46
|
+
letterSpacing: "-0.15px"
|
|
44
47
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: l,
|
|
48
|
-
sx: {
|
|
49
|
-
fontVariantNumeric: "lining-nums tabular-nums",
|
|
50
|
-
letterSpacing: "-0.15px"
|
|
51
|
-
},
|
|
52
|
-
variant: "body1",
|
|
53
|
-
children: o
|
|
54
|
-
}), n && /* @__PURE__ */ r(e, {
|
|
55
|
-
color: "text.secondary",
|
|
56
|
-
sx: {
|
|
57
|
-
fontSize: 9,
|
|
58
|
-
fontWeight: 700,
|
|
59
|
-
letterSpacing: "0.03em",
|
|
60
|
-
lineHeight: "12px",
|
|
61
|
-
textTransform: "uppercase"
|
|
62
|
-
},
|
|
63
|
-
variant: "caption",
|
|
64
|
-
children: n
|
|
65
|
-
})]
|
|
48
|
+
variant: "body1",
|
|
49
|
+
children: o
|
|
66
50
|
})]
|
|
67
51
|
});
|
|
68
52
|
export {
|
|
69
|
-
|
|
53
|
+
f as default
|
|
70
54
|
};
|
|
71
55
|
|
|
72
56
|
//# sourceMappingURL=InsightTransactionRow.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightTransactionRow.es.js","names":[],"sources":["../../../src/insights-v2/components/InsightTransactionRow.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface InsightTransactionRowProps {\n /** Leading visual: merchant/institution logo, category icon, or date badge. */\n leading?: ReactNode\n /** Primary line (e.g. merchant, payee, transaction name). */\n title: ReactNode\n /** Secondary line beneath the title (e.g. category). */\n subtitle: ReactNode\n /** Trailing amount, pre-formatted by the caller. */\n amount: ReactNode\n /** Theme token for the amount text (e.g. 'success.main' for credits). */\n amountColor?: string\n
|
|
1
|
+
{"version":3,"file":"InsightTransactionRow.es.js","names":[],"sources":["../../../src/insights-v2/components/InsightTransactionRow.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface InsightTransactionRowProps {\n /** Leading visual: merchant/institution logo, category icon, or date badge. */\n leading?: ReactNode\n /** Primary line (e.g. merchant, payee, transaction name). */\n title: ReactNode\n /** Secondary line beneath the title (e.g. category). */\n subtitle: ReactNode\n /** Trailing amount, pre-formatted by the caller. */\n amount: ReactNode\n /** Theme token for the amount text (e.g. 'success.main' for credits). */\n amountColor?: string\n sx?: SxProps\n}\n\n/**\n * A single transaction/list row for the insights-v2 transaction-list family:\n * leading visual + title/subtitle on the left, amount on the right. Named\n * `InsightTransactionRow` to avoid colliding with the transactions widget's\n * public `TransactionRow` export.\n */\nconst InsightTransactionRow = ({\n amount,\n amountColor = 'text.primary',\n leading,\n subtitle,\n title,\n sx,\n}: InsightTransactionRowProps) => (\n <Stack\n sx={{\n // The amount shares the title's top line while the subtitle sits below, so\n // the row is top-aligned and the inner left group is centered.\n alignItems: 'flex-start',\n flexDirection: 'row',\n gap: 16,\n px: 16,\n py: 14,\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n {leading && <Box sx={{ flexShrink: 0 }}>{leading}</Box>}\n <Stack sx={{ minWidth: 0 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text color=\"text.primary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n </Stack>\n </Stack>\n {/* Figma `typography/body1 (bold tabular)`: tabular figures so amounts align column-wise. */}\n <Text\n bold={true}\n color={amountColor}\n sx={{\n flexShrink: 0,\n fontVariantNumeric: 'lining-nums tabular-nums',\n letterSpacing: '-0.15px',\n }}\n variant=\"body1\"\n >\n {amount}\n </Text>\n </Stack>\n)\n\nexport default InsightTransactionRow\n"],"mappings":";;;;AA4BA,IAAM,IAAA,CAAyB,EAC7B,QAAA,GACA,aAAA,IAAc,gBACd,SAAA,GACA,UAAA,GACA,OAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAGF,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,GAAG;AAAA,EACL;AAAA,EAXF,UAAA,CAaE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,MAAG,KAAK;AAAA,MAAI,UAAU;AAAA,IAAE;AAAA,IAA3F,UAAA,CACG,KAAW,gBAAA,EAAC,GAAD;AAAA,MAAK,IAAI,EAAE,YAAY,EAAE;AAAA,MAAI,UAAA;AAAA,IAAa,CAAA,GACtD,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,UAAU,EAAE;AAAA,MAAzB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,UAAU;AAAA,QAAM,SAAQ;AAAA,QACvC,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAe,UAAU;AAAA,QAAM,SAAQ;AAAA,QAChD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA,EAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,oBAAoB;AAAA,MACpB,eAAe;AAAA,IACjB;AAAA,IACA,SAAQ;AAAA,IAEP,UAAA;AAAA,EACG,CAAA,CACD"}
|
|
@@ -32,10 +32,6 @@ interface TransactionListCardProps {
|
|
|
32
32
|
* on a white surface inside the padded Slot (Figma HSA Deposit).
|
|
33
33
|
*/
|
|
34
34
|
background?: string;
|
|
35
|
-
/** Status disc over the card's corner (needs `background`). */
|
|
36
|
-
badge?: ReactNode;
|
|
37
|
-
/** Card shadow on the wash. */
|
|
38
|
-
elevated?: boolean;
|
|
39
35
|
sx?: SxProps;
|
|
40
36
|
}
|
|
41
37
|
/**
|
|
@@ -45,5 +41,5 @@ interface TransactionListCardProps {
|
|
|
45
41
|
*
|
|
46
42
|
* Scope is the Content section only; Header/Description are out of scope.
|
|
47
43
|
*/
|
|
48
|
-
declare const TransactionListCard: ({ background,
|
|
44
|
+
declare const TransactionListCard: ({ background, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
49
45
|
export default TransactionListCard;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
var S = (n) => n === "primary" ? {
|
|
1
|
+
import C from "./InsightTransactionRow.es.js";
|
|
2
|
+
import { Fragment as R } from "react";
|
|
3
|
+
import t from "@mui/material/Stack";
|
|
4
|
+
import { Text as h } from "@mxenabled/mxui";
|
|
5
|
+
import { Fragment as x, jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import v from "@mui/material/Box";
|
|
7
|
+
import p from "@mui/material/Divider";
|
|
8
|
+
var w = (n) => n === "primary" ? {
|
|
10
9
|
radius: "8px",
|
|
11
10
|
borderColor: "primary.main",
|
|
12
11
|
headerBg: "primary.main",
|
|
@@ -30,110 +29,91 @@ var S = (n) => n === "primary" ? {
|
|
|
30
29
|
px: 16,
|
|
31
30
|
py: 2
|
|
32
31
|
}
|
|
33
|
-
},
|
|
34
|
-
if (
|
|
35
|
-
const e =
|
|
32
|
+
}, H = ({ background: n, footer: l, header: d, rows: m, variant: g = "default", sx: b }) => {
|
|
33
|
+
if (m.length === 0) return null;
|
|
34
|
+
const e = w(g), i = !!n, o = i ? "8px" : e.radius, s = !!d && !i && e.headerInsideBorder, c = d ? /* @__PURE__ */ r(t, {
|
|
36
35
|
sx: {
|
|
37
36
|
bgcolor: e.headerBg,
|
|
38
37
|
justifyContent: "center",
|
|
39
38
|
...e.headerSx
|
|
40
39
|
},
|
|
41
|
-
children: /* @__PURE__ */ r(
|
|
40
|
+
children: /* @__PURE__ */ r(h, {
|
|
42
41
|
bold: e.headerBold,
|
|
43
42
|
color: e.headerColor,
|
|
44
43
|
variant: "caption",
|
|
45
44
|
children: d
|
|
46
45
|
})
|
|
47
|
-
}) : null,
|
|
46
|
+
}) : null, f = l ? /* @__PURE__ */ a(x, { children: [/* @__PURE__ */ r(p, {}), /* @__PURE__ */ a(t, {
|
|
48
47
|
sx: {
|
|
49
48
|
alignItems: "center",
|
|
50
|
-
bgcolor:
|
|
49
|
+
bgcolor: i ? "background.paper" : "background.default",
|
|
51
50
|
flexDirection: "row",
|
|
52
51
|
justifyContent: "space-between",
|
|
53
52
|
minHeight: 40,
|
|
54
53
|
px: 16,
|
|
55
54
|
py: 2
|
|
56
55
|
},
|
|
57
|
-
children: [/* @__PURE__ */ r(
|
|
56
|
+
children: [/* @__PURE__ */ r(h, {
|
|
58
57
|
color: "text.secondary",
|
|
59
58
|
variant: "caption",
|
|
60
59
|
children: l.label
|
|
61
|
-
}), /* @__PURE__ */ r(
|
|
60
|
+
}), /* @__PURE__ */ r(h, {
|
|
62
61
|
bold: !0,
|
|
63
62
|
color: l.amountColor ?? "text.primary",
|
|
64
63
|
variant: "body2",
|
|
65
64
|
children: l.amount
|
|
66
65
|
})]
|
|
67
|
-
})] }) : null,
|
|
66
|
+
})] }) : null, B = /* @__PURE__ */ r(t, {
|
|
68
67
|
role: "list",
|
|
69
68
|
sx: { width: "100%" },
|
|
70
|
-
children:
|
|
69
|
+
children: m.map((y, u) => /* @__PURE__ */ a(R, { children: [u > 0 && /* @__PURE__ */ r(p, { role: "presentation" }), /* @__PURE__ */ r(v, {
|
|
71
70
|
role: "listitem",
|
|
72
|
-
children: /* @__PURE__ */ r(
|
|
73
|
-
})] },
|
|
71
|
+
children: /* @__PURE__ */ r(C, { ...y })
|
|
72
|
+
})] }, u))
|
|
74
73
|
});
|
|
75
|
-
return /* @__PURE__ */ a(
|
|
74
|
+
return /* @__PURE__ */ a(t, {
|
|
76
75
|
"data-testid": "transaction-list-card",
|
|
77
76
|
sx: {
|
|
78
|
-
...
|
|
77
|
+
...i ? {
|
|
79
78
|
background: n,
|
|
80
79
|
p: 16
|
|
81
80
|
} : {
|
|
82
81
|
pt: 8,
|
|
83
82
|
px: 16
|
|
84
83
|
},
|
|
85
|
-
...o && c ? { position: "relative" } : {},
|
|
86
84
|
width: "100%",
|
|
87
|
-
...
|
|
85
|
+
...b
|
|
88
86
|
},
|
|
89
|
-
children: [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
borderTopLeftRadius: t,
|
|
102
|
-
borderTopRightRadius: t,
|
|
103
|
-
overflow: "hidden"
|
|
104
|
-
},
|
|
105
|
-
children: p
|
|
106
|
-
}),
|
|
107
|
-
/* @__PURE__ */ a(i, {
|
|
108
|
-
sx: {
|
|
109
|
-
...o ? {
|
|
110
|
-
bgcolor: "background.paper",
|
|
111
|
-
...B && {
|
|
112
|
-
backgroundImage: (h) => I(h, 1),
|
|
113
|
-
boxShadow: k[1]
|
|
114
|
-
}
|
|
115
|
-
} : {
|
|
116
|
-
border: "1px solid",
|
|
117
|
-
borderColor: e.borderColor
|
|
118
|
-
},
|
|
119
|
-
borderBottomLeftRadius: t,
|
|
120
|
-
borderBottomRightRadius: t,
|
|
121
|
-
borderTopLeftRadius: s || !d ? t : 0,
|
|
122
|
-
borderTopRightRadius: s || !d ? t : 0,
|
|
123
|
-
overflow: "hidden",
|
|
124
|
-
width: "100%"
|
|
87
|
+
children: [!s && c && /* @__PURE__ */ r(t, {
|
|
88
|
+
sx: {
|
|
89
|
+
borderTopLeftRadius: o,
|
|
90
|
+
borderTopRightRadius: o,
|
|
91
|
+
overflow: "hidden"
|
|
92
|
+
},
|
|
93
|
+
children: c
|
|
94
|
+
}), /* @__PURE__ */ a(t, {
|
|
95
|
+
sx: {
|
|
96
|
+
...i ? { bgcolor: "background.paper" } : {
|
|
97
|
+
border: "1px solid",
|
|
98
|
+
borderColor: e.borderColor
|
|
125
99
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
100
|
+
borderBottomLeftRadius: o,
|
|
101
|
+
borderBottomRightRadius: o,
|
|
102
|
+
borderTopLeftRadius: s || !d ? o : 0,
|
|
103
|
+
borderTopRightRadius: s || !d ? o : 0,
|
|
104
|
+
overflow: "hidden",
|
|
105
|
+
width: "100%"
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
s && /* @__PURE__ */ a(x, { children: [c, /* @__PURE__ */ r(p, {})] }),
|
|
109
|
+
B,
|
|
110
|
+
f
|
|
111
|
+
]
|
|
112
|
+
})]
|
|
133
113
|
});
|
|
134
114
|
};
|
|
135
115
|
export {
|
|
136
|
-
|
|
116
|
+
H as default
|
|
137
117
|
};
|
|
138
118
|
|
|
139
119
|
//# sourceMappingURL=TransactionListCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListCard.es.js","names":[],"sources":["../../../src/insights-v2/components/TransactionListCard.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport InsightTransactionRow, { type InsightTransactionRowProps } from './InsightTransactionRow'\nimport { ELEVATION_SHADOW, elevationOverlay } from './shared/elevation'\n\nexport interface FooterRow {\n label: ReactNode\n amount: ReactNode\n amountColor?: string\n}\n\ntype TransactionListCardVariant = 'default' | 'primary'\n\ninterface TransactionListCardProps {\n /** Optional header label above the rows (e.g. \"{Date}\", \"3 transactions\"). */\n header?: ReactNode\n /** One or more transaction rows. */\n rows: InsightTransactionRowProps[]\n /** Optional summary/total row rendered beneath a divider. */\n footer?: FooterRow\n /**\n * Card style:\n * - `default` — grey utility header, hairline border, radius 4.\n * - `primary` — filled `primary.main` header with white text and a matching\n * border, radius 8 (Figma \"Multi\" variant).\n *\n * In both cases the header is borderless; the border wraps the content block\n * below it.\n */\n variant?: TransactionListCardVariant\n /**\n * Optional background applied to the Slot behind the card. Must be a valid CSS\n * background string (gradient or color in CSS format); MUI theme tokens are\n * not resolved here (this is the CSS `background` shorthand, not `bgcolor`), so\n * use a CSS color literal instead. When set, the inner card renders borderless\n * on a white surface inside the padded Slot (Figma HSA Deposit).\n */\n background?: string\n /** Status disc over the card's corner (needs `background`). */\n badge?: ReactNode\n /** Card shadow on the wash. */\n elevated?: boolean\n sx?: SxProps\n}\n\nconst getVariantStyles = (variant: TransactionListCardVariant) => {\n switch (variant) {\n case 'primary':\n // Borderless filled header on top of the bordered rows block.\n return {\n radius: '8px',\n borderColor: 'primary.main',\n headerBg: 'primary.main',\n headerColor: 'primary.contrastText',\n headerBold: false,\n headerInsideBorder: false,\n headerSx: { minHeight: 24, px: 12, py: 4 } as const,\n }\n default:\n // A single border wraps the card; the grey header sits inside it.\n return {\n radius: '8px',\n borderColor: 'divider',\n headerBg: 'background.default',\n headerColor: 'text.primary',\n headerBold: true,\n headerInsideBorder: true,\n headerSx: { minHeight: 36, px: 16, py: 2 } as const,\n }\n }\n}\n\n/**\n * List card composing an optional header label, one or more\n * `InsightTransactionRow`s (divided), and an optional footer/total row.\n * `variant` supplies the Figma design defaults for the two card styles.\n *\n * Scope is the Content section only; Header/Description are out of scope.\n */\nconst TransactionListCard = ({\n background,\n badge,\n elevated = false,\n footer,\n header,\n rows,\n variant = 'default',\n sx,\n}: TransactionListCardProps) => {\n // rows usually comes from mapped API data, so an empty array is reachable and\n // would render a broken border shell; render nothing instead.\n if (rows.length === 0) return null\n\n const styles = getVariantStyles(variant)\n const hasBackground = Boolean(background)\n const radius = hasBackground ? '8px' : styles.radius\n // The header sits inside the border only for the bordered `default` variant;\n // for `primary`/backgrounded cards it sits above a separately-bordered body.\n const headerInsideBorder = Boolean(header) && !hasBackground && styles.headerInsideBorder\n\n const headerBlock = header ? (\n <Stack sx={{ bgcolor: styles.headerBg, justifyContent: 'center', ...styles.headerSx }}>\n <Text bold={styles.headerBold} color={styles.headerColor} variant=\"caption\">\n {header}\n </Text>\n </Stack>\n ) : null\n\n const footerBlock = footer ? (\n <>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: hasBackground ? 'background.paper' : 'background.default',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {footer.label}\n </Text>\n <Text bold={true} color={footer.amountColor ?? 'text.primary'} variant=\"body2\">\n {footer.amount}\n </Text>\n </Stack>\n </>\n ) : null\n\n const rowsBlock = (\n <Stack role=\"list\" sx={{ width: '100%' }}>\n {rows.map((row, index) => (\n // Static, caller-ordered list that may contain identical rows, so the\n // array index is the correct key (a content-based key would collide).\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={index}>\n {index > 0 && <Divider role=\"presentation\" />}\n <Box role=\"listitem\">\n <InsightTransactionRow {...row} />\n </Box>\n </Fragment>\n ))}\n </Stack>\n )\n\n return (\n <Stack\n data-testid=\"transaction-list-card\"\n sx={{\n ...(hasBackground ? { background, p: 16 } : { pt: 8, px: 16 }),\n ...(hasBackground && badge ? { position: 'relative' } : {}),\n width: '100%',\n ...sx,\n }}\n >\n {hasBackground &&\n badge && (\n // Centred on the card's top-left corner.\n <Box sx={{ left: 16, position: 'absolute', top: 12, zIndex: 1 }}>{badge}</Box>\n )}\n {/* Header above the border for `primary`/backgrounded cards; top-rounded. */}\n {!headerInsideBorder && headerBlock && (\n <Stack\n sx={{\n borderTopLeftRadius: radius,\n borderTopRightRadius: radius,\n overflow: 'hidden',\n }}\n >\n {headerBlock}\n </Stack>\n )}\n\n <Stack\n sx={{\n ...(hasBackground\n ? {\n bgcolor: 'background.paper',\n // elevation/1: the shadow, plus the dark-mode surface tint a Paper would get.\n ...(elevated && {\n backgroundImage: (theme: Theme) => elevationOverlay(theme, 1),\n boxShadow: ELEVATION_SHADOW[1],\n }),\n }\n : { border: '1px solid', borderColor: styles.borderColor }),\n borderBottomLeftRadius: radius,\n borderBottomRightRadius: radius,\n borderTopLeftRadius: headerInsideBorder || !header ? radius : 0,\n borderTopRightRadius: headerInsideBorder || !header ? radius : 0,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n {/* Header inside the border for the `default` table variant. */}\n {headerInsideBorder && (\n <>\n {headerBlock}\n <Divider />\n </>\n )}\n {rowsBlock}\n {footerBlock}\n </Stack>\n </Stack>\n )\n}\n\nexport default TransactionListCard\n"],"mappings":";;;;;;;;AAoDA,IAAM,IAAA,CAAoB,MAChB,MACD,YAEI;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,IAGO;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,GAWA,IAAA,CAAuB,EAC3B,YAAA,GACA,OAAA,GACA,UAAA,IAAW,IACX,QAAA,GACA,QAAA,GACA,MAAA,GACA,SAAA,IAAU,WACV,IAAA,EAAA,MAC8B;AAG9B,MAAI,EAAK,WAAW,EAAG,QAAO;AAE9B,QAAM,IAAS,EAAiB,CAAO,GACjC,IAAgB,EAAQ,GACxB,IAAS,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;AAAA,QACT;AAAA,QAlBF,UAAA;AAAA,UAqBG,KACC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,GACD,gBAAA,EAAC,GAAD,CAAU,CAAA,CACV,EAAA,CAAA;AAAA,UAEH;AAAA,UACA;AAAA,QACI;AAAA;IACF;AAAA;AAEX"}
|
|
1
|
+
{"version":3,"file":"TransactionListCard.es.js","names":[],"sources":["../../../src/insights-v2/components/TransactionListCard.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport InsightTransactionRow, { type InsightTransactionRowProps } from './InsightTransactionRow'\n\nexport interface FooterRow {\n label: ReactNode\n amount: ReactNode\n amountColor?: string\n}\n\ntype TransactionListCardVariant = 'default' | 'primary'\n\ninterface TransactionListCardProps {\n /** Optional header label above the rows (e.g. \"{Date}\", \"3 transactions\"). */\n header?: ReactNode\n /** One or more transaction rows. */\n rows: InsightTransactionRowProps[]\n /** Optional summary/total row rendered beneath a divider. */\n footer?: FooterRow\n /**\n * Card style:\n * - `default` — grey utility header, hairline border, radius 4.\n * - `primary` — filled `primary.main` header with white text and a matching\n * border, radius 8 (Figma \"Multi\" variant).\n *\n * In both cases the header is borderless; the border wraps the content block\n * below it.\n */\n variant?: TransactionListCardVariant\n /**\n * Optional background applied to the Slot behind the card. Must be a valid CSS\n * background string (gradient or color in CSS format); MUI theme tokens are\n * not resolved here (this is the CSS `background` shorthand, not `bgcolor`), so\n * use a CSS color literal instead. When set, the inner card renders borderless\n * on a white surface inside the padded Slot (Figma HSA Deposit).\n */\n background?: string\n sx?: SxProps\n}\n\nconst getVariantStyles = (variant: TransactionListCardVariant) => {\n switch (variant) {\n case 'primary':\n // Borderless filled header on top of the bordered rows block.\n return {\n radius: '8px',\n borderColor: 'primary.main',\n headerBg: 'primary.main',\n headerColor: 'primary.contrastText',\n headerBold: false,\n headerInsideBorder: false,\n headerSx: { minHeight: 24, px: 12, py: 4 } as const,\n }\n default:\n // A single border wraps the card; the grey header sits inside it.\n return {\n radius: '8px',\n borderColor: 'divider',\n headerBg: 'background.default',\n headerColor: 'text.primary',\n headerBold: true,\n headerInsideBorder: true,\n headerSx: { minHeight: 36, px: 16, py: 2 } as const,\n }\n }\n}\n\n/**\n * List card composing an optional header label, one or more\n * `InsightTransactionRow`s (divided), and an optional footer/total row.\n * `variant` supplies the Figma design defaults for the two card styles.\n *\n * Scope is the Content section only; Header/Description are out of scope.\n */\nconst TransactionListCard = ({\n background,\n footer,\n header,\n rows,\n variant = 'default',\n sx,\n}: TransactionListCardProps) => {\n // rows usually comes from mapped API data, so an empty array is reachable and\n // would render a broken border shell; render nothing instead.\n if (rows.length === 0) return null\n\n const styles = getVariantStyles(variant)\n const hasBackground = Boolean(background)\n const radius = hasBackground ? '8px' : styles.radius\n // The header sits inside the border only for the bordered `default` variant;\n // for `primary`/backgrounded cards it sits above a separately-bordered body.\n const headerInsideBorder = Boolean(header) && !hasBackground && styles.headerInsideBorder\n\n const headerBlock = header ? (\n <Stack sx={{ bgcolor: styles.headerBg, justifyContent: 'center', ...styles.headerSx }}>\n <Text bold={styles.headerBold} color={styles.headerColor} variant=\"caption\">\n {header}\n </Text>\n </Stack>\n ) : null\n\n const footerBlock = footer ? (\n <>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: hasBackground ? 'background.paper' : 'background.default',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {footer.label}\n </Text>\n <Text bold={true} color={footer.amountColor ?? 'text.primary'} variant=\"body2\">\n {footer.amount}\n </Text>\n </Stack>\n </>\n ) : null\n\n const rowsBlock = (\n <Stack role=\"list\" sx={{ width: '100%' }}>\n {rows.map((row, index) => (\n // Static, caller-ordered list that may contain identical rows, so the\n // array index is the correct key (a content-based key would collide).\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={index}>\n {index > 0 && <Divider role=\"presentation\" />}\n <Box role=\"listitem\">\n <InsightTransactionRow {...row} />\n </Box>\n </Fragment>\n ))}\n </Stack>\n )\n\n return (\n <Stack\n data-testid=\"transaction-list-card\"\n sx={{\n ...(hasBackground ? { background, p: 16 } : { pt: 8, px: 16 }),\n width: '100%',\n ...sx,\n }}\n >\n {/* Header above the border for `primary`/backgrounded cards; top-rounded. */}\n {!headerInsideBorder && headerBlock && (\n <Stack\n sx={{\n borderTopLeftRadius: radius,\n borderTopRightRadius: radius,\n overflow: 'hidden',\n }}\n >\n {headerBlock}\n </Stack>\n )}\n\n <Stack\n sx={{\n ...(hasBackground\n ? { bgcolor: 'background.paper' }\n : { border: '1px solid', borderColor: styles.borderColor }),\n borderBottomLeftRadius: radius,\n borderBottomRightRadius: radius,\n borderTopLeftRadius: headerInsideBorder || !header ? radius : 0,\n borderTopRightRadius: headerInsideBorder || !header ? radius : 0,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n {/* Header inside the border for the `default` table variant. */}\n {headerInsideBorder && (\n <>\n {headerBlock}\n <Divider />\n </>\n )}\n {rowsBlock}\n {footerBlock}\n </Stack>\n </Stack>\n )\n}\n\nexport default TransactionListCard\n"],"mappings":";;;;;;;AA+CA,IAAM,IAAA,CAAoB,MAChB,MACD,YAEI;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,IAGO;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IA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;AAAA,QAEH;AAAA,QACA;AAAA,MACI;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { formatDate as
|
|
1
|
+
import { formatDate as p } from "../../core/constants/DateFormats.es.js";
|
|
2
2
|
import { formatCurrency as n } from "../../core/utils/NumberFormatting.es.js";
|
|
3
3
|
import i from "@mui/material/Stack";
|
|
4
4
|
import { Text as o } from "@mxenabled/mxui";
|
|
5
5
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
import { parseISO as h } from "date-fns";
|
|
7
7
|
import x from "@mui/material/Divider";
|
|
8
|
-
var u = (r) => r === 0 ? n(0, "0,0.00") : `-${n(Math.abs(r), "0,0.00")}`, b = /^\d{4}-\d{2}-\d{2}$/,
|
|
8
|
+
var u = (r) => r === 0 ? n(0, "0,0.00") : `-${n(Math.abs(r), "0,0.00")}`, b = /^\d{4}-\d{2}-\d{2}$/, g = {
|
|
9
9
|
month: "long",
|
|
10
10
|
day: "numeric",
|
|
11
11
|
year: "numeric"
|
|
12
|
-
},
|
|
12
|
+
}, v = (r) => {
|
|
13
13
|
if (!r || !b.test(r)) return r;
|
|
14
14
|
const e = h(r);
|
|
15
|
-
return Number.isNaN(e.getTime()) ? r :
|
|
16
|
-
}, j = ({ amount: r, amountLabel: e, balance: s, balanceLabel: d, withdrawalDate:
|
|
17
|
-
const m =
|
|
15
|
+
return Number.isNaN(e.getTime()) ? r : p(e, g);
|
|
16
|
+
}, j = ({ amount: r, amountLabel: e, balance: s, balanceLabel: d, withdrawalDate: f, sx: l }) => {
|
|
17
|
+
const m = v(f), c = m ? [e, m].filter(Boolean).join(" ") : "";
|
|
18
18
|
return /* @__PURE__ */ a(i, {
|
|
19
19
|
sx: {
|
|
20
20
|
border: "1px solid",
|
|
@@ -22,18 +22,16 @@ var u = (r) => r === 0 ? n(0, "0,0.00") : `-${n(Math.abs(r), "0,0.00")}`, b = /^
|
|
|
22
22
|
borderRadius: "4px",
|
|
23
23
|
overflow: "hidden",
|
|
24
24
|
width: "100%",
|
|
25
|
-
...
|
|
25
|
+
...l
|
|
26
26
|
},
|
|
27
27
|
children: [
|
|
28
28
|
/* @__PURE__ */ a(i, {
|
|
29
29
|
sx: {
|
|
30
30
|
alignItems: "center",
|
|
31
31
|
gap: 4,
|
|
32
|
-
|
|
33
|
-
py: 20
|
|
32
|
+
p: 16
|
|
34
33
|
},
|
|
35
34
|
children: [/* @__PURE__ */ t(o, {
|
|
36
|
-
bold: !0,
|
|
37
35
|
variant: "h1",
|
|
38
36
|
children: u(r)
|
|
39
37
|
}), c && /* @__PURE__ */ t(o, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithdrawalCard.es.js","names":[],"sources":["../../../src/insights-v2/components/WithdrawalCard.tsx"],"sourcesContent":["import Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { parseISO } from 'date-fns'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatDate } from '../../core/constants'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\n// A withdrawal is a debit, so a non-zero amount is shown with a leading minus (\"-$100.00\"); zero is\n// shown unsigned (\"$0.00\"). The sign comes from the magnitude, so an amount that already arrives\n// negative does not render a double minus.\nconst formatWithdrawalAmount = (amount: number) =>\n amount === 0 ? formatCurrency(0, '0,0.00') : `-${formatCurrency(Math.abs(amount), '0,0.00')}`\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\nconst WITHDRAWAL_DATE_FORMAT = { month: 'long', day: 'numeric', year: 'numeric' }\n\n// The bucket 1 slot sends the stored beat date as a calendar day (\"2026-10-05\"). parseISO reads a\n// date-only string as local midnight, so the viewer sees the day it names; new Date() would read UTC\n// midnight and show the day before west of UTC. A date that already arrives worded renders as sent,\n// and so does one that matches the shape but names no real day (\"2026-02-30\" parses to an Invalid\n// Date, which Intl cannot format) - the same guard Footer applies before formatting.\nconst formatWithdrawalDate = (value?: string) => {\n if (!value || !ISO_DATE.test(value)) return value\n\n const parsed = parseISO(value)\n\n return Number.isNaN(parsed.getTime()) ? value : formatDate(parsed, WITHDRAWAL_DATE_FORMAT)\n}\n\ninterface WithdrawalCardProps {\n /** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */\n amount: number\n /** Pre-localized lead-in for the date line (e.g. \"Withdrawn on\"). */\n amountLabel?: string\n /** Account balance after the withdrawal, shown in the grey footer row. */\n balance: number\n /** Pre-localized footer label for the balance (e.g. \"Balance\"). */\n balanceLabel?: string\n /** Pre-localized withdrawal date (e.g. \"October 5, 2026\"). */\n withdrawalDate?: string\n sx?: SxProps\n}\n\n/**\n * A centered withdrawal highlight: the amount as a headline with a date line beneath it\n * (\"{amountLabel} {withdrawalDate}\"), over a grey footer row showing the balance. Labels arrive\n * localized from the backend; the card formats the two numbers (the amount gets a leading minus\n * unless it is zero) and an ISO `withdrawalDate` (as the calendar day it names). The date line is\n * hidden when `withdrawalDate` is empty.\n *\n * Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.\n */\nconst WithdrawalCard = ({\n amount,\n amountLabel,\n balance,\n balanceLabel,\n withdrawalDate,\n sx,\n}: WithdrawalCardProps) => {\n const formattedDate = formatWithdrawalDate(withdrawalDate)\n const dateLine = formattedDate ? [amountLabel, formattedDate].filter(Boolean).join(' ') : ''\n\n return (\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '4px',\n overflow: 'hidden',\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', gap: 4,
|
|
1
|
+
{"version":3,"file":"WithdrawalCard.es.js","names":[],"sources":["../../../src/insights-v2/components/WithdrawalCard.tsx"],"sourcesContent":["import Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { parseISO } from 'date-fns'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatDate } from '../../core/constants'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\n// A withdrawal is a debit, so a non-zero amount is shown with a leading minus (\"-$100.00\"); zero is\n// shown unsigned (\"$0.00\"). The sign comes from the magnitude, so an amount that already arrives\n// negative does not render a double minus.\nconst formatWithdrawalAmount = (amount: number) =>\n amount === 0 ? formatCurrency(0, '0,0.00') : `-${formatCurrency(Math.abs(amount), '0,0.00')}`\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\nconst WITHDRAWAL_DATE_FORMAT = { month: 'long', day: 'numeric', year: 'numeric' }\n\n// The bucket 1 slot sends the stored beat date as a calendar day (\"2026-10-05\"). parseISO reads a\n// date-only string as local midnight, so the viewer sees the day it names; new Date() would read UTC\n// midnight and show the day before west of UTC. A date that already arrives worded renders as sent,\n// and so does one that matches the shape but names no real day (\"2026-02-30\" parses to an Invalid\n// Date, which Intl cannot format) - the same guard Footer applies before formatting.\nconst formatWithdrawalDate = (value?: string) => {\n if (!value || !ISO_DATE.test(value)) return value\n\n const parsed = parseISO(value)\n\n return Number.isNaN(parsed.getTime()) ? value : formatDate(parsed, WITHDRAWAL_DATE_FORMAT)\n}\n\ninterface WithdrawalCardProps {\n /** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */\n amount: number\n /** Pre-localized lead-in for the date line (e.g. \"Withdrawn on\"). */\n amountLabel?: string\n /** Account balance after the withdrawal, shown in the grey footer row. */\n balance: number\n /** Pre-localized footer label for the balance (e.g. \"Balance\"). */\n balanceLabel?: string\n /** Pre-localized withdrawal date (e.g. \"October 5, 2026\"). */\n withdrawalDate?: string\n sx?: SxProps\n}\n\n/**\n * A centered withdrawal highlight: the amount as a headline with a date line beneath it\n * (\"{amountLabel} {withdrawalDate}\"), over a grey footer row showing the balance. Labels arrive\n * localized from the backend; the card formats the two numbers (the amount gets a leading minus\n * unless it is zero) and an ISO `withdrawalDate` (as the calendar day it names). The date line is\n * hidden when `withdrawalDate` is empty.\n *\n * Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.\n */\nconst WithdrawalCard = ({\n amount,\n amountLabel,\n balance,\n balanceLabel,\n withdrawalDate,\n sx,\n}: WithdrawalCardProps) => {\n const formattedDate = formatWithdrawalDate(withdrawalDate)\n const dateLine = formattedDate ? [amountLabel, formattedDate].filter(Boolean).join(' ') : ''\n\n return (\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '4px',\n overflow: 'hidden',\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', gap: 4, p: 16 }}>\n <Text variant=\"h1\">\n {formatWithdrawalAmount(amount)}\n </Text>\n {dateLine && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateLine}\n </Text>\n )}\n </Stack>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.default',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n {balanceLabel && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {balanceLabel}\n </Text>\n )}\n <Text bold={true} variant=\"body2\">\n {formatCurrency(balance, '0,0.00')}\n </Text>\n </Stack>\n </Stack>\n )\n}\n\nexport default WithdrawalCard\n"],"mappings":";;;;;;;AAcA,IAAM,IAAA,CAA0B,MAC9B,MAAW,IAAI,EAAe,GAAG,QAAQ,IAAI,IAAI,EAAe,KAAK,IAAI,CAAM,GAAG,QAAQ,CAAA,IAEtF,IAAW,uBACX,IAAyB;AAAA,EAAE,OAAO;AAAA,EAAQ,KAAK;AAAA,EAAW,MAAM;AAAU,GAO1E,IAAA,CAAwB,MAAmB;AAC/C,MAAI,CAAC,KAAS,CAAC,EAAS,KAAK,CAAK,EAAG,QAAO;AAE5C,QAAM,IAAS,EAAS,CAAK;AAE7B,SAAO,OAAO,MAAM,EAAO,QAAQ,CAAC,IAAI,IAAQ,EAAW,GAAQ,CAAsB;AAC3F,GAyBM,IAAA,CAAkB,EACtB,QAAA,GACA,a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