@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.
Files changed (66) hide show
  1. package/CHANGELOG.md +2 -5
  2. package/dist/core/stores/GlobalCopyStore.d.ts +0 -6
  3. package/dist/core/stores/GlobalCopyStore.es.js +8 -14
  4. package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
  5. package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -24
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
  8. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +59 -92
  9. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  10. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +1 -9
  11. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +5 -9
  12. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  13. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
  14. package/dist/insights-v2/components/BaseLayout.es.js +146 -160
  15. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  16. package/dist/insights-v2/components/CtaStatus.d.ts +1 -14
  17. package/dist/insights-v2/components/CtaStatus.es.js +38 -76
  18. package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
  19. package/dist/insights-v2/components/InsightTransactionRow.d.ts +1 -3
  20. package/dist/insights-v2/components/InsightTransactionRow.es.js +20 -36
  21. package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
  22. package/dist/insights-v2/components/TransactionListCard.d.ts +1 -5
  23. package/dist/insights-v2/components/TransactionListCard.es.js +49 -69
  24. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  25. package/dist/insights-v2/components/WithdrawalCard.es.js +8 -10
  26. package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -1
  27. package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +1 -10
  28. package/dist/insights-v2/components/shared/StatusSnackbar.es.js +11 -27
  29. package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
  30. package/dist/insights-v2/ctaActions/ctaConfig.es.js +9 -23
  31. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  32. package/dist/insights-v2/ctaActions/runCtaAction.d.ts +0 -7
  33. package/dist/insights-v2/ctaActions/runCtaAction.es.js +62 -73
  34. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  35. package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +1 -10
  36. package/dist/insights-v2/ctaActions/types.d.ts +2 -5
  37. package/dist/insights-v2/ctaActions/useCtaAction.d.ts +0 -6
  38. package/dist/insights-v2/ctaActions/useCtaAction.es.js +27 -32
  39. package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
  40. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +0 -1
  41. package/dist/insights-v2/mappings/actionBlocksKey.es.js +0 -1
  42. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  43. package/dist/insights-v2/mappings/blocks.es.js +68 -74
  44. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  45. package/dist/microinsights/MicroCardTemplate.es.js +17 -21
  46. package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
  47. package/dist/microinsights/cards/InsightCard.es.js +86 -91
  48. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  49. package/dist/microinsights/stores/CopyStore.d.ts +1 -4
  50. package/dist/microinsights/stores/CopyStore.es.js +10 -13
  51. package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +0 -6
  54. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +0 -168
  55. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +0 -1
  56. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +0 -4
  57. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +0 -10
  58. package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +0 -1
  59. package/dist/insights-v2/components/shared/elevation.d.ts +0 -16
  60. package/dist/insights-v2/components/shared/elevation.es.js +0 -15
  61. package/dist/insights-v2/components/shared/elevation.es.js.map +0 -1
  62. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +0 -115
  63. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +0 -1
  64. package/dist/microinsights/cards/MicroCtaStatus.d.ts +0 -18
  65. package/dist/microinsights/cards/MicroCtaStatus.es.js +0 -44
  66. package/dist/microinsights/cards/MicroCtaStatus.es.js.map +0 -1
@@ -1,105 +1,67 @@
1
- import s from "@mui/material/Stack";
2
- import { Text as x } from "@mxenabled/mxui";
3
- import u from "@mui/material/Button";
4
- import { Icon as f } from "@mxenabled/mx-icons";
5
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
6
- import { alpha as c } from "@mui/material/styles";
7
- var m = {
8
- main: (e) => c(e.palette.text.primary, 0.5),
9
- fill: "background.paper",
10
- text: "text.primary",
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
- alert: {
30
- success: {
31
- main: "success.main",
32
- fill: p("success"),
33
- text: "text.primary",
34
- icon: "success.main"
35
- },
36
- neutral: m,
37
- error: {
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
- }, C = "CtaStatus-content", N = ({ label: e, tone: i, variant: r = "tinted", icon: l, action: a, sx: d }) => {
55
- const t = g[r][i];
56
- return /* @__PURE__ */ n(s, {
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: a ? "space-between" : "center",
28
+ justifyContent: e ? "space-between" : "center",
61
29
  sx: {
62
- bgcolor: t.fill,
30
+ bgcolor: r.fill,
63
31
  border: "1px solid",
64
- borderColor: t.main,
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__ */ n(s, {
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: [l && /* @__PURE__ */ o(f, {
43
+ children: [o && /* @__PURE__ */ t(m, {
78
44
  "aria-hidden": !0,
79
45
  fill: !0,
80
- name: l,
46
+ name: o,
81
47
  size: 24,
82
- sx: { color: t.icon ?? t.main }
83
- }), /* @__PURE__ */ o(x, {
48
+ sx: { color: r.main }
49
+ }), /* @__PURE__ */ t(n, {
84
50
  bold: !0,
85
- sx: { color: t.text },
51
+ sx: { color: r.text },
86
52
  variant: "body1",
87
- children: e
53
+ children: l
88
54
  })]
89
- }), a && /* @__PURE__ */ o(u, {
90
- onClick: a.onPress,
55
+ }), e && /* @__PURE__ */ t(c, {
56
+ onClick: e.onPress,
91
57
  size: "small",
92
- sx: {
93
- color: t.text,
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
- C as CTA_STATUS_CONTENT_CLASS,
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'\nimport { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nexport type CtaStatusTone = 'success' | 'neutral' | 'error'\n\n/**\n * How the status is drawn. `tinted` (default): a toned fill with toned text (Designate's \"Account\n * Saved!\"). `alert`: Figma's `<Alert>`: the alert background, `text.primary` words and a small\n * 13/16 action (Subscription Status's \"Subscribed | Undo\"). A new design adds a variant here; a CTA\n * step picks one through its presenter.\n */\nexport type CtaStatusVariant = 'tinted' | 'alert'\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 /** Which status design to draw; defaults to `tinted`. */\n variant?: CtaStatusVariant\n /** mx-icons name, drawn filled and hidden from assistive technology. */\n icon?: string\n /** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */\n sx?: SxProps\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"). */\n action?: { label: string; onPress: () => void }\n}\n\ntype ToneColor = string | ((theme: Theme) => string)\n\ninterface ToneColors {\n main: ToneColor\n fill: ToneColor\n text: ToneColor\n icon?: ToneColor\n}\n\n// Neutral in both variants: paper fill, a 50% / 70% `text.primary` border and icon, so it reads on\n// a light card (black) and a dark one (white).\nconst NEUTRAL: ToneColors = {\n main: (theme) => alpha(theme.palette.text.primary, 0.5),\n fill: 'background.paper',\n text: 'text.primary',\n icon: (theme) => alpha(theme.palette.text.primary, 0.7),\n}\n\n// The alert background per mode (Figma `_components/alert/<tone>/background`): the palette's 50 /\n// 800 steps, falling back to `lighter` / `darker` for a theme without the scale.\nconst alertFill =\n (tone: 'success' | 'error'): ToneColor =>\n (theme) => {\n const color = theme.palette[tone]\n\n return theme.palette.mode === 'dark'\n ? (color[800] ?? color.darker ?? color.dark)\n : (color[50] ?? color.lighter ?? color.light)\n }\n\nconst TONE_COLORS: Record<CtaStatusVariant, Record<CtaStatusTone, ToneColors>> = {\n tinted: {\n success: { main: 'success.main', fill: 'success.lighter', text: 'success.dark' },\n neutral: NEUTRAL,\n error: { main: 'error.main', fill: 'error.lighter', text: 'error.dark' },\n },\n alert: {\n success: {\n main: 'success.main',\n fill: alertFill('success'),\n text: 'text.primary',\n icon: 'success.main',\n },\n neutral: NEUTRAL,\n error: {\n main: 'error.main',\n fill: alertFill('error'),\n text: 'text.primary',\n icon: 'error.main',\n },\n },\n}\n\n// The inline action per variant. `alert`: Figma's 13/16 semibold button, padding 4/8.\nconst ACTION_SX: Record<CtaStatusVariant, SxProps<Theme>> = {\n tinted: {},\n alert: { fontSize: 13, fontWeight: 600, lineHeight: '16px', minWidth: 0, px: 8, py: 4 },\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 */\n// Stable class on the inner (icon + label) row, so a caller's `sx` can target it:\n// `{ [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 } }`.\nexport const CTA_STATUS_CONTENT_CLASS = 'CtaStatus-content'\n\nexport const CtaStatus = ({\n label,\n tone,\n variant = 'tinted',\n icon,\n action,\n sx,\n}: CtaStatusProps) => {\n const colors = TONE_COLORS[variant][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 ...sx,\n }}\n >\n <Stack\n alignItems=\"center\"\n className={CTA_STATUS_CONTENT_CLASS}\n direction=\"row\"\n gap={8}\n role=\"status\"\n >\n {icon && (\n <Icon\n aria-hidden={true}\n fill={true}\n name={icon}\n size={24}\n sx={{ color: colors.icon ?? colors.main }}\n />\n )}\n <Text bold={true} sx={{ color: colors.text }} variant=\"body1\">\n {label}\n </Text>\n </Stack>\n {action && (\n <Button\n onClick={action.onPress}\n size=\"small\"\n sx={{ color: colors.text, ...ACTION_SX[variant] }}\n >\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;AA2CA,IAAM,IAAsB;AAAA,EAC1B,MAAA,CAAO,MAAU,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAA,CAAO,MAAU,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AACxD,GAIM,IAAA,CACH,MAAA,CACA,MAAU;AACT,QAAM,IAAQ,EAAM,QAAQ,CAAA;AAE5B,SAAO,EAAM,QAAQ,SAAS,SACzB,EAAM,GAAA,KAAQ,EAAM,UAAU,EAAM,OACpC,EAAM,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ACE,YAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAK;AAAA,MALP,UAAA,CAOG,KACC,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI,EAAE,OAAO,EAAO,QAAQ,EAAO,KAAK;AAAA,MACzC,CAAA,GAEH,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,QAAG,SAAQ;AAAA,QACnD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,SAAS,EAAO;AAAA,MAChB,MAAK;AAAA,MACL,IAAI;AAAA,QAAE,OAAO,EAAO;AAAA,QAAM,GAAG,EAAU,CAAA;AAAA,MAAS;AAAA,MAE/C,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
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 onClick={action.onPress} size=\"small\" sx={{ color: colors.text }}>\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;AAqBA,IAAM,IAAmF;AAAA,EACvF,SAAS;AAAA,IAAE,MAAM;AAAA,IAAgB,MAAM;AAAA,IAAmB,MAAM;AAAA,EAAe;AAAA,EAC/E,SAAS;AAAA,IAAE,MAAM;AAAA,IAAkB,MAAM;AAAA,IAAsB,MAAM;AAAA,EAAe;AAAA,EACpF,OAAO;AAAA,IAAE,MAAM;AAAA,IAAc,MAAM;AAAA,IAAiB,MAAM;AAAA,EAAa;AACzE,GAMa,IAAA,CAAa,EAAE,OAAA,GAAO,MAAA,GAAM,MAAA,GAAM,QAAA,EAAA,MAA6B;AAC1E,QAAM,IAAS,EAAY,CAAA;AAE3B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAW;AAAA,IACX,WAAU;AAAA,IACV,KAAK;AAAA,IACL,gBAAgB,IAAS,kBAAkB;AAAA,IAC3C,IAAI;AAAA,MACF,SAAS,EAAO;AAAA,MAChB,QAAQ;AAAA,MACR,aAAa,EAAO;AAAA,MACpB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IAbF,UAAA,CAeE,gBAAA,EAAC,GAAD;AAAA,MAAO,YAAW;AAAA,MAAS,WAAU;AAAA,MAAM,KAAK;AAAA,MAAG,MAAK;AAAA,MAAxD,UAAA,CACG,KACC,gBAAA,EAAC,GAAD;AAAA,QAAM,eAAa;AAAA,QAAM,MAAM;AAAA,QAAM,MAAM;AAAA,QAAM,MAAM;AAAA,QAAI,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MAAI,CAAA,GAE1F,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,QAAG,SAAQ;AAAA,QACnD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACN,CAAA,GAAA,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, amountCaption, amountColor, leading, subtitle, title, sx, }: InsightTransactionRowProps) => import("react/jsx-runtime").JSX.Element;
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 e } from "@mxenabled/mxui";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
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 u = ({ amount: o, amountCaption: n, amountColor: l = "text.primary", leading: a, subtitle: c, title: x, sx: s }) => /* @__PURE__ */ i(t, {
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
- ...s
13
+ ...c
14
14
  },
15
- children: [/* @__PURE__ */ i(t, {
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: [a && /* @__PURE__ */ r(m, {
23
+ children: [n && /* @__PURE__ */ r(m, {
24
24
  sx: { flexShrink: 0 },
25
- children: a
26
- }), /* @__PURE__ */ i(t, {
25
+ children: n
26
+ }), /* @__PURE__ */ e(t, {
27
27
  sx: { minWidth: 0 },
28
- children: [/* @__PURE__ */ r(e, {
28
+ children: [/* @__PURE__ */ r(i, {
29
29
  bold: !0,
30
30
  truncate: !0,
31
31
  variant: "body1",
32
32
  children: x
33
- }), /* @__PURE__ */ r(e, {
33
+ }), /* @__PURE__ */ r(i, {
34
34
  color: "text.primary",
35
35
  truncate: !0,
36
36
  variant: "caption",
37
- children: c
37
+ children: l
38
38
  })]
39
39
  })]
40
- }), /* @__PURE__ */ i(t, {
40
+ }), /* @__PURE__ */ r(i, {
41
+ bold: !0,
42
+ color: a,
41
43
  sx: {
42
- alignItems: "flex-end",
43
- flexShrink: 0
44
+ flexShrink: 0,
45
+ fontVariantNumeric: "lining-nums tabular-nums",
46
+ letterSpacing: "-0.15px"
44
47
  },
45
- children: [/* @__PURE__ */ r(e, {
46
- bold: !0,
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
- u as default
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 /** Caption under the amount (e.g. frequency). */\n amountCaption?: ReactNode\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 amountCaption,\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 <Stack sx={{ alignItems: 'flex-end', flexShrink: 0 }}>\n <Text\n bold={true}\n color={amountColor}\n sx={{\n fontVariantNumeric: 'lining-nums tabular-nums',\n letterSpacing: '-0.15px',\n }}\n variant=\"body1\"\n >\n {amount}\n </Text>\n {/* Frequency caption. */}\n {amountCaption && (\n <Text\n color=\"text.secondary\"\n sx={{\n fontSize: 9,\n fontWeight: 700,\n letterSpacing: '0.03em',\n lineHeight: '12px',\n textTransform: 'uppercase',\n }}\n variant=\"caption\"\n >\n {amountCaption}\n </Text>\n )}\n </Stack>\n </Stack>\n)\n\nexport default InsightTransactionRow\n"],"mappings":";;;;AA8BA,IAAM,IAAA,CAAyB,EAC7B,QAAA,GACA,eAAA,GACA,aAAA,IAAc,gBACd,SAAA,GACA,UAAA,GACA,OAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAGF,YAAY;AAAA,IACZ,eA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,IACG,CAAA,CAEH;AAAA,EACF,CAAA,CAAA"}
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, badge, elevated, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
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 R from "./InsightTransactionRow.es.js";
2
- import { ELEVATION_SHADOW as k, elevationOverlay as I } from "./shared/elevation.es.js";
3
- import { Fragment as T } from "react";
4
- import i from "@mui/material/Stack";
5
- import { Text as m } from "@mxenabled/mxui";
6
- import { Fragment as b, jsx as r, jsxs as a } from "react/jsx-runtime";
7
- import g from "@mui/material/Box";
8
- import u from "@mui/material/Divider";
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
- }, V = ({ background: n, badge: c, elevated: B = !1, footer: l, header: d, rows: x, variant: y = "default", sx: v }) => {
34
- if (x.length === 0) return null;
35
- const e = S(y), o = !!n, t = o ? "8px" : e.radius, s = !!d && !o && e.headerInsideBorder, p = d ? /* @__PURE__ */ r(i, {
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(m, {
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, C = l ? /* @__PURE__ */ a(b, { children: [/* @__PURE__ */ r(u, {}), /* @__PURE__ */ a(i, {
46
+ }) : null, f = l ? /* @__PURE__ */ a(x, { children: [/* @__PURE__ */ r(p, {}), /* @__PURE__ */ a(t, {
48
47
  sx: {
49
48
  alignItems: "center",
50
- bgcolor: o ? "background.paper" : "background.default",
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(m, {
56
+ children: [/* @__PURE__ */ r(h, {
58
57
  color: "text.secondary",
59
58
  variant: "caption",
60
59
  children: l.label
61
- }), /* @__PURE__ */ r(m, {
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, w = /* @__PURE__ */ r(i, {
66
+ })] }) : null, B = /* @__PURE__ */ r(t, {
68
67
  role: "list",
69
68
  sx: { width: "100%" },
70
- children: x.map((h, f) => /* @__PURE__ */ a(T, { children: [f > 0 && /* @__PURE__ */ r(u, { role: "presentation" }), /* @__PURE__ */ r(g, {
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(R, { ...h })
73
- })] }, f))
71
+ children: /* @__PURE__ */ r(C, { ...y })
72
+ })] }, u))
74
73
  });
75
- return /* @__PURE__ */ a(i, {
74
+ return /* @__PURE__ */ a(t, {
76
75
  "data-testid": "transaction-list-card",
77
76
  sx: {
78
- ...o ? {
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
- ...v
85
+ ...b
88
86
  },
89
- children: [
90
- o && c && /* @__PURE__ */ r(g, {
91
- sx: {
92
- left: 16,
93
- position: "absolute",
94
- top: 12,
95
- zIndex: 1
96
- },
97
- children: c
98
- }),
99
- !s && p && /* @__PURE__ */ r(i, {
100
- sx: {
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
- children: [
127
- s && /* @__PURE__ */ a(b, { children: [p, /* @__PURE__ */ r(u, {})] }),
128
- w,
129
- C
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
- V as default
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,IAAgB,QAAQ,EAAO,QAGxC,IAAqB,EAAQ,KAAW,CAAC,KAAiB,EAAO,oBAEjE,IAAc,IAClB,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS,EAAO;AAAA,MAAU,gBAAgB;AAAA,MAAU,GAAG,EAAO;AAAA,IAAS;AAAA,IAClF,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM,EAAO;AAAA,MAAY,OAAO,EAAO;AAAA,MAAa,SA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AA,MAC5D,GAAI,KAAiB,IAAQ,EAAE,UAAU,WAAW,IAAI,CAAC;AAAA,MACzD,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IAPF,UAAA;AAAA,MASG,KACC,KAEE,gBAAA,EAAC,GAAD;AAAA,QAAK,IAAI;AAAA,UAAE,MAAM;AAAA,UAAI,UAAU;AAAA,UAAY,KAAK;AAAA,UAAI,QAAQ;AAAA,QAAE;AAAA,QAAI,UAAA;AAAA,MAAW,CAAA;AAAA,MAGhF,CAAC,KAAsB,KACtB,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,qBAAqB;AAAA,UACrB,sBAAsB;AAAA,UACtB,UAAU;AAAA,QACZ;AAAA,QAEC,UAAA;AAAA,MACI,CAAA;AAAA,MAGT,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,GAAI,IACA;AAAA,YACE,SAAS;AAAA,YAET,GAAI,KAAY;AAAA,cACd,iBAAA,CAAkB,MAAiB,EAAiB,GAAO,CAAC;AAAA,cAC5D,WAAW,EAAiB,CAAA;AAAA,YAC9B;AAAA,UACF,IACA;AAAA,YAAE,QAAQ;AAAA,YAAa,aAAa,EAAO;AAAA,UAAY;AAAA,UAC3D,wBAAwB;AAAA,UACxB,yBAAyB;AAAA,UACzB,qBAAqB,KAAsB,CAAC,IAAS,IAAS;AAAA,UAC9D,sBAAsB,KAAsB,CAAC,IAAS,IAAS;AAAA,UAC/D,UAAU;AAAA,UACV,OAAO;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,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,GAWA,IAAA,CAAuB,EAC3B,YAAA,GACA,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,IAAgB,QAAQ,EAAO,QAGxC,IAAqB,EAAQ,KAAW,CAAC,KAAiB,EA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AAA,CACG,EAAA,GALK,CAKL,CACX;AAAA,EACI,CAAA;AAGT,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,GAAI,IAAgB;AAAA,QAAE,YAAA;AAAA,QAAY,GAAG;AAAA,MAAG,IAAI;AAAA,QAAE,IAAI;AAAA,QAAG,IAAI;AAAA,MAAG;AAAA,MAC5D,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IANF,UAAA,CASG,CAAC,KAAsB,KACtB,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,qBAAqB;AAAA,QACrB,sBAAsB;AAAA,QACtB,UAAU;AAAA,MACZ;AAAA,MAEC,UAAA;AAAA,IACI,CAAA,GAGT,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,GAAI,IACA,EAAE,SAAS,mBAAmB,IAC9B;AAAA,UAAE,QAAQ;AAAA,UAAa,aAAa,EAAO;AAAA,QAAY;AAAA,QAC3D,wBAAwB;AAAA,QACxB,yBAAyB;AAAA,QACzB,qBAAqB,KAAsB,CAAC,IAAS,IAAS;AAAA,QAC9D,sBAAsB,KAAsB,CAAC,IAAS,IAAS;AAAA,QAC/D,UAAU;AAAA,QACV,OAAO;AAAA,MACT;AAAA,MAXF,UAAA;AAAA,QAcG,KACC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,GACD,gBAAA,EAAC,GAAD,CAAU,CAAA,CACV,EAAA,CAAA;AAAA,QAEH;AAAA,QACA;AAAA,MACI;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
@@ -1,20 +1,20 @@
1
- import { formatDate as f } from "../../core/constants/DateFormats.es.js";
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}$/, y = {
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
- }, g = (r) => {
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 : f(e, y);
16
- }, j = ({ amount: r, amountLabel: e, balance: s, balanceLabel: d, withdrawalDate: l, sx: p }) => {
17
- const m = g(l), c = m ? [e, m].filter(Boolean).join(" ") : "";
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
- ...p
25
+ ...l
26
26
  },
27
27
  children: [
28
28
  /* @__PURE__ */ a(i, {
29
29
  sx: {
30
30
  alignItems: "center",
31
31
  gap: 4,
32
- px: 16,
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, px: 16, py: 20 }}>\n <Text bold={true} 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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A,UAAM,SAAQ;AAAA,UACvB,UAAA,EAAe,GAAS,QAAQ;AAAA,QAC7B,CAAA,CACD;AAAA;IACF;AAAA;AAEX"}
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,I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