@mx-cartographer/experiences 9.7.78 → 9.7.79

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 (45) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
  3. package/dist/core/stores/GlobalCopyStore.es.js +14 -8
  4. package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
  5. package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
  6. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
  7. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +161 -0
  8. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
  9. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +86 -61
  10. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  11. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -1
  12. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
  13. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  14. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
  15. package/dist/insights-v2/components/BaseLayout.es.js +106 -105
  16. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  17. package/dist/insights-v2/components/CtaStatus.d.ts +5 -1
  18. package/dist/insights-v2/components/CtaStatus.es.js +25 -22
  19. package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
  20. package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
  21. package/dist/insights-v2/components/TransactionListCard.es.js +61 -45
  22. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  23. package/dist/insights-v2/ctaActions/ctaConfig.es.js +35 -14
  24. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  25. package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +9 -1
  26. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +62 -57
  27. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -1
  28. package/dist/insights-v2/ctaActions/types.d.ts +10 -2
  29. package/dist/insights-v2/ctaActions/useCtaAction.d.ts +5 -2
  30. package/dist/insights-v2/ctaActions/useCtaAction.es.js +45 -37
  31. package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
  32. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  33. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  34. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  35. package/dist/insights-v2/mappings/blocks.es.js +82 -76
  36. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  37. package/dist/microinsights/cards/InsightCard.es.js +92 -83
  38. package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
  39. package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
  40. package/dist/microinsights/cards/MicroCtaStatus.es.js +50 -0
  41. package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
  42. package/dist/microinsights/stores/CopyStore.d.ts +10 -1
  43. package/dist/microinsights/stores/CopyStore.es.js +20 -11
  44. package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
  45. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { useState as d } from "react";
2
- import i from "@mui/material/Stack";
3
- import { Text as u } from "@mxenabled/mxui";
4
- import x from "@mui/material/Button";
5
- import { Icon as f } from "@mxenabled/mx-icons";
6
- import { jsx as t, jsxs as a } from "react/jsx-runtime";
7
- var p = {
1
+ import { useState as u } from "react";
2
+ import a from "@mui/material/Stack";
3
+ import { Text as x } from "@mxenabled/mxui";
4
+ import f from "@mui/material/Button";
5
+ import { Icon as p } from "@mxenabled/mx-icons";
6
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
7
+ var g = {
8
8
  success: {
9
9
  main: "success.main",
10
10
  fill: "success.lighter",
@@ -20,16 +20,16 @@ var p = {
20
20
  fill: "error.lighter",
21
21
  text: "error.dark"
22
22
  }
23
- }, w = ({ label: l, tone: n, icon: o, action: e }) => {
24
- const r = p[n], [c, s] = d(!1), m = async () => {
25
- s(!0);
23
+ }, b = "CtaStatus-content", v = ({ label: n, tone: l, icon: s, action: e, sx: c }) => {
24
+ const r = g[l], [m, o] = u(!1), d = async () => {
25
+ o(!0);
26
26
  try {
27
27
  await e?.onPress();
28
28
  } finally {
29
- s(!1);
29
+ o(!1);
30
30
  }
31
31
  };
32
- return /* @__PURE__ */ a(i, {
32
+ return /* @__PURE__ */ i(a, {
33
33
  alignItems: "center",
34
34
  direction: "row",
35
35
  gap: 8,
@@ -41,28 +41,30 @@ var p = {
41
41
  borderRadius: 1,
42
42
  minHeight: 44,
43
43
  px: 16,
44
- py: 8
44
+ py: 8,
45
+ ...c
45
46
  },
46
- children: [/* @__PURE__ */ a(i, {
47
+ children: [/* @__PURE__ */ i(a, {
47
48
  alignItems: "center",
49
+ className: b,
48
50
  direction: "row",
49
51
  gap: 8,
50
52
  role: "status",
51
- children: [o && /* @__PURE__ */ t(f, {
53
+ children: [s && /* @__PURE__ */ t(p, {
52
54
  "aria-hidden": !0,
53
55
  fill: !0,
54
- name: o,
56
+ name: s,
55
57
  size: 24,
56
58
  sx: { color: r.main }
57
- }), /* @__PURE__ */ t(u, {
59
+ }), /* @__PURE__ */ t(x, {
58
60
  bold: !0,
59
61
  sx: { color: r.text },
60
62
  variant: "body1",
61
- children: l
63
+ children: n
62
64
  })]
63
- }), e && /* @__PURE__ */ t(x, {
64
- disabled: c,
65
- onClick: m,
65
+ }), e && /* @__PURE__ */ t(f, {
66
+ disabled: m,
67
+ onClick: d,
66
68
  size: "small",
67
69
  sx: { color: r.text },
68
70
  children: e.label
@@ -70,7 +72,8 @@ var p = {
70
72
  });
71
73
  };
72
74
  export {
73
- w as CtaStatus
75
+ b as CTA_STATUS_CONTENT_CLASS,
76
+ v as CtaStatus
74
77
  };
75
78
 
76
79
  //# sourceMappingURL=CtaStatus.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import { useState } from 'react'\nimport 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\"), disabled while it runs. */\n action?: { label: string; onPress: () => void | Promise<unknown> }\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 const [pending, setPending] = useState(false)\n\n const press = async () => {\n setPending(true)\n try {\n await action?.onPress()\n } finally {\n setPending(false)\n }\n }\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 disabled={pending} onClick={press} size=\"small\" sx={{ color: colors.text }}>\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;AAsBA,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,GACrB,CAAC,GAAS,CAAA,IAAc,EAAS,EAAK,GAEtC,IAAQ,YAAY;AACxB,IAAA,EAAW,EAAI;AACf,QAAI;AACF,YAAM,GAAQ,QAAQ;AAAA,IACxB,UAAA;AACE,MAAA,EAAW,EAAK;AAAA,IAClB;AAAA,EACF;AAEA,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,UAAU;AAAA,MAAS,SAAS;AAAA,MAAO,MAAK;AAAA,MAAQ,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MAC9E,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 { useState } from 'react'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps, 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\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 /** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */\n sx?: SxProps<Theme>\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"), disabled while it runs. */\n action?: { label: string; onPress: () => void | Promise<unknown> }\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// 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\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, sx }: CtaStatusProps) => {\n const colors = TONE_COLORS[tone]\n const [pending, setPending] = useState(false)\n\n const press = async () => {\n setPending(true)\n try {\n await action?.onPress()\n } finally {\n setPending(false)\n }\n }\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 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 disabled={pending} onClick={press} size=\"small\" sx={{ color: colors.text }}>\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;AAyBA,IAAM,IAAmF;AAAA,EACvF,SAAS;AAAA,IAAE,MAAM;AAAA,IAAgB,MAAM;AAAA,IAAmB,MAAM;AAAA,EAAe;AAAA,EAC/E,SA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AA,CACD;AAAA,IACN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MAAQ,UAAU;AAAA,MAAS,SAAS;AAAA,MAAO,MAAK;AAAA,MAAQ,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,MAC9E,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
@@ -32,6 +32,10 @@ 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;
35
39
  sx?: SxProps;
36
40
  }
37
41
  /**
@@ -41,5 +45,5 @@ interface TransactionListCardProps {
41
45
  *
42
46
  * Scope is the Content section only; Header/Description are out of scope.
43
47
  */
44
- declare const TransactionListCard: ({ background, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
48
+ declare const TransactionListCard: ({ background, badge, elevated, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
45
49
  export default TransactionListCard;
@@ -1,11 +1,11 @@
1
- import C from "./InsightTransactionRow.es.js";
2
- import { Fragment as R } from "react";
3
- import t from "@mui/material/Stack";
1
+ import R from "./InsightTransactionRow.es.js";
2
+ import { Fragment as k } from "react";
3
+ import i from "@mui/material/Stack";
4
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" ? {
5
+ import { Fragment as b, jsx as r, jsxs as a } from "react/jsx-runtime";
6
+ import f from "@mui/material/Box";
7
+ import m from "@mui/material/Divider";
8
+ var T = (n) => n === "primary" ? {
9
9
  radius: "8px",
10
10
  borderColor: "primary.main",
11
11
  headerBg: "primary.main",
@@ -29,9 +29,9 @@ var w = (n) => n === "primary" ? {
29
29
  px: 16,
30
30
  py: 2
31
31
  }
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, {
32
+ }, z = ({ background: n, badge: c, elevated: g = !1, footer: l, header: d, rows: u, variant: B = "default", sx: y }) => {
33
+ if (u.length === 0) return null;
34
+ const e = T(B), o = !!n, t = o ? "8px" : e.radius, s = !!d && !o && e.headerInsideBorder, p = d ? /* @__PURE__ */ r(i, {
35
35
  sx: {
36
36
  bgcolor: e.headerBg,
37
37
  justifyContent: "center",
@@ -43,10 +43,10 @@ var w = (n) => n === "primary" ? {
43
43
  variant: "caption",
44
44
  children: d
45
45
  })
46
- }) : null, f = l ? /* @__PURE__ */ a(x, { children: [/* @__PURE__ */ r(p, {}), /* @__PURE__ */ a(t, {
46
+ }) : null, C = l ? /* @__PURE__ */ a(b, { children: [/* @__PURE__ */ r(m, {}), /* @__PURE__ */ a(i, {
47
47
  sx: {
48
48
  alignItems: "center",
49
- bgcolor: i ? "background.paper" : "background.default",
49
+ bgcolor: o ? "background.paper" : "background.default",
50
50
  flexDirection: "row",
51
51
  justifyContent: "space-between",
52
52
  minHeight: 40,
@@ -63,57 +63,73 @@ var w = (n) => n === "primary" ? {
63
63
  variant: "body2",
64
64
  children: l.amount
65
65
  })]
66
- })] }) : null, B = /* @__PURE__ */ r(t, {
66
+ })] }) : null, v = /* @__PURE__ */ r(i, {
67
67
  role: "list",
68
68
  sx: { width: "100%" },
69
- children: m.map((y, u) => /* @__PURE__ */ a(R, { children: [u > 0 && /* @__PURE__ */ r(p, { role: "presentation" }), /* @__PURE__ */ r(v, {
69
+ children: u.map((w, x) => /* @__PURE__ */ a(k, { children: [x > 0 && /* @__PURE__ */ r(m, { role: "presentation" }), /* @__PURE__ */ r(f, {
70
70
  role: "listitem",
71
- children: /* @__PURE__ */ r(C, { ...y })
72
- })] }, u))
71
+ children: /* @__PURE__ */ r(R, { ...w })
72
+ })] }, x))
73
73
  });
74
- return /* @__PURE__ */ a(t, {
74
+ return /* @__PURE__ */ a(i, {
75
75
  "data-testid": "transaction-list-card",
76
76
  sx: {
77
- ...i ? {
77
+ ...o ? {
78
78
  background: n,
79
79
  p: 16
80
80
  } : {
81
81
  pt: 8,
82
82
  px: 16
83
83
  },
84
+ ...o && c ? { position: "relative" } : {},
84
85
  width: "100%",
85
- ...b
86
+ ...y
86
87
  },
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
88
+ children: [
89
+ o && c && /* @__PURE__ */ r(f, {
90
+ sx: {
91
+ left: 16,
92
+ position: "absolute",
93
+ top: 12,
94
+ zIndex: 1
99
95
  },
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
- })]
96
+ children: c
97
+ }),
98
+ !s && p && /* @__PURE__ */ r(i, {
99
+ sx: {
100
+ borderTopLeftRadius: t,
101
+ borderTopRightRadius: t,
102
+ overflow: "hidden"
103
+ },
104
+ children: p
105
+ }),
106
+ /* @__PURE__ */ a(i, {
107
+ sx: {
108
+ ...o ? {
109
+ bgcolor: "background.paper",
110
+ ...g && { boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.12)" }
111
+ } : {
112
+ border: "1px solid",
113
+ borderColor: e.borderColor
114
+ },
115
+ borderBottomLeftRadius: t,
116
+ borderBottomRightRadius: t,
117
+ borderTopLeftRadius: s || !d ? t : 0,
118
+ borderTopRightRadius: s || !d ? t : 0,
119
+ overflow: "hidden",
120
+ width: "100%"
121
+ },
122
+ children: [
123
+ s && /* @__PURE__ */ a(b, { children: [p, /* @__PURE__ */ r(m, {})] }),
124
+ v,
125
+ C
126
+ ]
127
+ })
128
+ ]
113
129
  });
114
130
  };
115
131
  export {
116
- H as default
132
+ z as default
117
133
  };
118
134
 
119
135
  //# 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 } 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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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
+ {"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 /** 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 ...(elevated && { boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.12)' }),\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":";;;;;;;AAmDA,IAAM,IAAA,CAAoB,MAChB,MACD,YAEI;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,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ACF,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,YACT,GAAI,KAAY,EAAE,WAAW,kCAAkC;AAAA,UACjE,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,QAdF,UAAA;AAAA,UAiBG,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,37 +1,58 @@
1
1
  import { ANALYTICS_EVENTS_CONFIG as o } from "../analytics/analyticsEventsConfig.es.js";
2
- import { HOST_ACTIONS as n } from "./hostActions.es.js";
3
- import { subscriptionEntryStep as a, subscriptionSurvey as c } from "./subscriptionAnswer.es.js";
4
- var r = ({ beat: e, stores: i }) => {
5
- const s = i.insightsV2Store.beatContext[e.guid]?.selected_account_guid;
6
- if (typeof s == "string")
7
- return i.accountStore.visibleSavingsAccounts.some((t) => t.guid === s && !t.is_closed && !t.is_deleted) ? s : void 0;
8
- }, m = {
2
+ import { CTA_STATUS_CONTENT_CLASS as r } from "../components/CtaStatus.es.js";
3
+ import { HOST_ACTIONS as a } from "./hostActions.es.js";
4
+ import { subscriptionEntryStep as n, subscriptionSurvey as _ } from "./subscriptionAnswer.es.js";
5
+ import { alpha as c } from "@mui/material/styles";
6
+ var u = ({ beat: t, stores: i }) => {
7
+ const e = i.insightsV2Store.beatContext[t.guid]?.selected_account_guid;
8
+ if (typeof e == "string")
9
+ return i.accountStore.visibleSavingsAccounts.some((s) => s.guid === e && !s.is_closed && !s.is_deleted) ? e : void 0;
10
+ }, S = {
9
11
  dismiss_beat: {
10
12
  run: "delegateToHost",
11
- params: { hostAction: n.dismissBeat }
13
+ params: { hostAction: a.dismissBeat }
12
14
  },
13
15
  select_savings_account: {
14
16
  run: "updateUserInsightProfile",
15
- params: (e) => ({ fields: { emergency_savings_account_guid: r(e) } }),
16
- disabledWhen: (e) => !r(e),
17
+ params: (t) => ({ fields: { emergency_savings_account_guid: u(t) } }),
18
+ disabledWhen: (t) => !u(t),
17
19
  onSuccess: ["refreshBeat"],
18
20
  analytics: o.EMERGENCY_SAVINGS_ACCT_SAVED
19
21
  },
20
22
  open_savings_account: { analytics: o.EMERGENCY_SAVINGS_ACCT_CREATED },
21
23
  atomic_flow: {
22
24
  run: "delegateToHost",
23
- params: { hostAction: n.atomicTransact }
25
+ params: { hostAction: a.atomicTransact }
24
26
  },
25
27
  confirm_subscription_detected: {
26
- ...a({ statusLabels: {
28
+ ...n({ statusLabels: {
27
29
  positive: "confirmed",
28
30
  negative: "incorrect"
29
31
  } }),
30
- surveyAnswer: c
32
+ surveyAnswer: _
33
+ },
34
+ confirm_subscription_status: {
35
+ ...n({
36
+ statusLabels: {
37
+ positive: "subscribed",
38
+ negative: "not_subscribed"
39
+ },
40
+ sx: {
41
+ minHeight: 56,
42
+ [`& .${r}`]: { gap: 10 }
43
+ },
44
+ negativeSx: {
45
+ bgcolor: "background.paper",
46
+ borderColor: (t) => c(t.palette.common.black, 0.5),
47
+ [`& .${r} .MuiSvgIcon-root`]: { color: (t) => c(t.palette.common.black, 0.7) }
48
+ },
49
+ answeredTitle: (t) => t.insights_feed?.subscription_status_modal?.reviewed_title
50
+ }),
51
+ compactStatus: !0
31
52
  }
32
53
  };
33
54
  export {
34
- m as ctaActions
55
+ S as ctaActions
35
56
  };
36
57
 
37
58
  //# sourceMappingURL=ctaConfig.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { ANALYTICS_EVENTS_CONFIG } from '../analytics/analyticsEventsConfig'\nimport { HOST_ACTIONS } from './hostActions'\nimport { subscriptionEntryStep, subscriptionSurvey } from './subscriptionAnswer'\nimport type { CtaStateContext, CtaStep } from './types'\n\n/**\n * The account the svg_image_block picker wrote into this beat's context, and only while it is\n * still one the user can save into (visible, open, not deleted) — a pick that went stale between\n * pick and Save never reaches the API.\n */\nconst pickedSavingsAccountGuid = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) => {\n const picked = stores.insightsV2Store.beatContext[beat.guid]?.selected_account_guid\n\n if (typeof picked !== 'string') return undefined\n\n const usable = stores.accountStore.visibleSavingsAccounts.some(\n (account) => account.guid === picked && !account.is_closed && !account.is_deleted,\n )\n\n return usable ? picked : undefined\n}\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n\n /**\n * Designate Emergency Savings Account \"Save\": designates the account picked in the\n * svg_image_block picker (kept in the per-beat context), then refreshes the beat. The beat is\n * sampled, so the refresh re-reads its sample, which the backend rebuilds as the saved card\n * (change_account: \"Account Saved!\", no CTA). Disabled until a pick is made.\n */\n select_savings_account: {\n run: 'updateUserInsightProfile',\n params: (ctx) => ({\n fields: { emergency_savings_account_guid: pickedSavingsAccountGuid(ctx) },\n }),\n disabledWhen: (ctx) => !pickedSavingsAccountGuid(ctx),\n onSuccess: ['refreshBeat'],\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SAVED,\n },\n\n /**\n * Designate Emergency Savings Account \"Open a Savings Account\": no handler. The op_1 post\n * message comes from `ctaPostMessages`; this step adds the Created event.\n */\n open_savings_account: {\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_CREATED,\n },\n\n /**\n * SetUpDirectDeposit `not_set_up`: hand the press to the host, which owns the Atomic SDK and its\n * lifecycle. No drawer, no `refreshBeat`, and no interim post message is registered for the\n * template (a backend-supplied `cta.metadata` would still post).\n */\n atomic_flow: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.atomicTransact },\n },\n\n /**\n * SubscriptionDetected \"Does this look right?\": the shared subscription status CTA (every answer\n * counts, as pulse), answered through the survey.\n */\n confirm_subscription_detected: {\n ...subscriptionEntryStep({ statusLabels: { positive: 'confirmed', negative: 'incorrect' } }),\n surveyAnswer: subscriptionSurvey,\n },\n}\n"],"mappings":";;;AAUA,IAAM,IAAA,CAA4B,EAAE,MAAA,GAAM,QAAA,EAAA,MAAuD;AAC/F,QAAM,IAAS,EAAO,gBAAgB,YAAY,EAAK,IAAA,GAAO;AAE9D,MAAI,OAAO,KAAW;AAMtB,WAJe,EAAO,aAAa,uBAAuB,KAAA,CACvD,MAAY,EAAQ,SAAS,KAAU,CAAC,EAAQ,aAAa,CAAC,EAAQ,UAGlE,IAAS,IAAS;AAC3B,GAQa,IAAsC;AAAA,EAEjD,cAAc;AAAA,IACZ,KAAK;AAAA,IACL,QAAQ,EAAE,YAAY,EAAa,YAAY;AAAA,EACjD;AAAA,EAQA,wBAAwB;AAAA,IACtB,KAAK;AAAA,IACL,QAAA,CAAS,OAAS,EAChB,QAAQ,EAAE,gCAAgC,EAAyB,CAAG,EAAE,EAC1E;AAAA,IACA,cAAA,CAAe,MAAQ,CAAC,EAAyB,CAAG;AAAA,IACpD,WAAW,CAAC,aAAa;AAAA,IACzB,WAAW,EAAwB;AAAA,EACrC;AAAA,EAMA,sBAAsB,EACpB,WAAW,EAAwB,+BACrC;AAAA,EAOA,aAAa;AAAA,IACX,KAAK;AAAA,IACL,QAAQ,EAAE,YAAY,EAAa,eAAe;AAAA,EACpD;AAAA,EAMA,+BAA+B;AAAA,IAC7B,GAAG,EAAsB,EAAE,cAAc;AAAA,MAAE,UAAU;AAAA,MAAa,UAAU;AAAA,IAAY,EAAE,CAAC;AAAA,IAC3F,cAAc;AAAA,EAChB;AACF"}
1
+ {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\nimport { ANALYTICS_EVENTS_CONFIG } from '../analytics/analyticsEventsConfig'\nimport { CTA_STATUS_CONTENT_CLASS } from '../components/CtaStatus'\nimport { HOST_ACTIONS } from './hostActions'\nimport { subscriptionEntryStep, subscriptionSurvey } from './subscriptionAnswer'\nimport type { CtaStateContext, CtaStep } from './types'\n\n/**\n * The account the svg_image_block picker wrote into this beat's context, and only while it is\n * still one the user can save into (visible, open, not deleted) — a pick that went stale between\n * pick and Save never reaches the API.\n */\nconst pickedSavingsAccountGuid = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) => {\n const picked = stores.insightsV2Store.beatContext[beat.guid]?.selected_account_guid\n\n if (typeof picked !== 'string') return undefined\n\n const usable = stores.accountStore.visibleSavingsAccounts.some(\n (account) => account.guid === picked && !account.is_closed && !account.is_deleted,\n )\n\n return usable ? picked : undefined\n}\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n\n /**\n * Designate Emergency Savings Account \"Save\": designates the account picked in the\n * svg_image_block picker (kept in the per-beat context), then refreshes the beat. The beat is\n * sampled, so the refresh re-reads its sample, which the backend rebuilds as the saved card\n * (change_account: \"Account Saved!\", no CTA). Disabled until a pick is made.\n */\n select_savings_account: {\n run: 'updateUserInsightProfile',\n params: (ctx) => ({\n fields: { emergency_savings_account_guid: pickedSavingsAccountGuid(ctx) },\n }),\n disabledWhen: (ctx) => !pickedSavingsAccountGuid(ctx),\n onSuccess: ['refreshBeat'],\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SAVED,\n },\n\n /**\n * Designate Emergency Savings Account \"Open a Savings Account\": no handler. The op_1 post\n * message comes from `ctaPostMessages`; this step adds the Created event.\n */\n open_savings_account: {\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_CREATED,\n },\n\n /**\n * SetUpDirectDeposit `not_set_up`: hand the press to the host, which owns the Atomic SDK and its\n * lifecycle. No drawer, no `refreshBeat`, and no interim post message is registered for the\n * template (a backend-supplied `cta.metadata` would still post).\n */\n atomic_flow: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.atomicTransact },\n },\n\n /**\n * SubscriptionDetected \"Does this look right?\": the shared subscription status CTA (every answer\n * counts, as pulse), answered through the survey.\n */\n confirm_subscription_detected: {\n ...subscriptionEntryStep({ statusLabels: { positive: 'confirmed', negative: 'incorrect' } }),\n surveyAnswer: subscriptionSurvey,\n },\n\n /**\n * Unexpected Subscription Payment: the shared subscription status CTA, answered through its\n * Subscription Status modal. Its Figma: a 56px bar, and a white \"Not subscribed\" bar with a 50%\n * black border and 70% black icon. Mini and micro mirror the status (`compactStatus`).\n */\n confirm_subscription_status: {\n ...subscriptionEntryStep({\n statusLabels: { positive: 'subscribed', negative: 'not_subscribed' },\n sx: { minHeight: 56, [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 } },\n negativeSx: {\n bgcolor: 'background.paper',\n borderColor: (theme: Theme) => alpha(theme.palette.common.black, 0.5),\n [`& .${CTA_STATUS_CONTENT_CLASS} .MuiSvgIcon-root`]: {\n color: (theme: Theme) => alpha(theme.palette.common.black, 0.7),\n },\n },\n answeredTitle: (copy) => copy.insights_feed?.subscription_status_modal?.reviewed_title,\n }),\n compactStatus: true,\n },\n}\n"],"mappings":";;;;;AAaA,IAAM,IAAA,CAA4B,EAAE,MAAA,GAAM,QAAA,EAAA,MAAuD;AAC/F,QAAM,IAAS,EAAO,gBAAgB,YAAY,EAAK,IAAA,GAAO;AAE9D,MAAI,OAAO,KAAW;AAMtB,WAJe,EAAO,aAAa,uBAAuB,KAAA,CACvD,MAAY,EAAQ,SAAS,KAAU,CAAC,EAAQ,aAAa,CAAC,EAAQ,UAGlE,IAAS,IAAS;AAC3B,GAQa,IAAsC;AAAA,EAEjD,cAAc;AAAA,IACZ,KAAK;AAAA,IACL,QAAQ,EAAE,YAAY,EAAa,YAAY;AAAA,EACjD;AAAA,EAQA,wBAAwB;AAAA,IACtB,KAAK;AAAA,IACL,QAAA,CAAS,OAAS,EAChB,QAAQ,EAAE,gCAAgC,EAAyB,CAAG,EAAE,EAC1E;AAAA,IACA,cAAA,CAAe,MAAQ,CAAC,EAAyB,CAAG;AAAA,IACpD,WAAW,CAAC,aAAa;AAAA,IACzB,WAAW,EAAwB;AAAA,EACrC;AAAA,EAMA,sBAAsB,EACpB,WAAW,EAAwB,+BACrC;AAAA,EAOA,aAAa;AAAA,IACX,KAAK;AAAA,IACL,QAAQ,EAAE,YAAY,EAAa,eAAe;AAAA,EACpD;AAAA,EAMA,+BAA+B;AAAA,IAC7B,GAAG,EAAsB,EAAE,cAAc;AAAA,MAAE,UAAU;AAAA,MAAa,UAAU;AAAA,IAAY,EAAE,CAAC;AAAA,IAC3F,cAAc;AAAA,EAChB;AAAA,EAOA,6BAA6B;AAAA,IAC3B,GAAG,EAAsB;AAAA,MACvB,cAAc;AAAA,QAAE,UAAU;AAAA,QAAc,UAAU;AAAA,MAAiB;AAAA,MACnE,IAAI;AAAA,QAAE,WAAW;AAAA,QAAK,CAAA,MAAM,CAAA,EAAA,GAA6B,EAAE,KAAK,GAAG;AAAA,MAAE;AAAA,MACrE,YAAY;AAAA,QACV,SAAS;AAAA,QACT,aAAA,CAAc,MAAiB,EAAM,EAAM,QAAQ,OAAO,OAAO,GAAG;AAAA,QACnE,CAAA,MAAM,CAAA,mBAAyB,GAAqB,EACnD,OAAA,CAAQ,MAAiB,EAAM,EAAM,QAAQ,OAAO,OAAO,GAAG,EAChE;AAAA,MACF;AAAA,MACA,eAAA,CAAgB,MAAS,EAAK,eAAe,2BAA2B;AAAA,IAC1E,CAAC;AAAA,IACD,eAAe;AAAA,EACjB;AACF"}
@@ -1,3 +1,5 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ import { GlobalCopy } from '../../core/types/GlobalCopy';
1
3
  import { InsightsFeedCopy, SurveyModalCopy } from '../../core/types/localization/InsightsFeedCopy';
2
4
  import { RepeatingTransaction } from '../../core/types/RepeatingTransaction';
3
5
  import { BeatActions } from '../beatActions';
@@ -37,12 +39,18 @@ export interface SubscriptionEntryOptions {
37
39
  };
38
40
  /** Whether the stored answer applies to this beat (default: every answer counts). */
39
41
  answerCounts?: (ctx: CtaStateContext, repeating: RepeatingTransaction) => boolean;
42
+ /** Status bar overrides for this step (e.g. a taller bar). */
43
+ sx?: SxProps<Theme>;
44
+ /** Extra overrides for a negative answer's bar (on top of `sx`), e.g. its own neutral look. */
45
+ negativeSx?: SxProps<Theme>;
46
+ /** The card's title once answered, from copy (mini and micro retitle; full keeps its title). */
47
+ answeredTitle?: (copy: GlobalCopy) => string | undefined;
40
48
  }
41
49
  /**
42
50
  * The step a beat's `action_key` names: the button until answered, then the status with Undo. No
43
51
  * repeating transaction or transaction: no CTAs, as pulse. A missing word draws nothing.
44
52
  */
45
- export declare const subscriptionEntryStep: ({ statusLabels, answerCounts, }: SubscriptionEntryOptions) => CtaStep;
53
+ export declare const subscriptionEntryStep: ({ statusLabels, sx, negativeSx, answeredTitle, answerCounts, }: SubscriptionEntryOptions) => CtaStep;
46
54
  /** A subscription entry's `surveyAnswer`: Yes writes CONFIRMED, a reason its value. */
47
55
  export declare const subscriptionSurvey: (ctx: WriteCtx, copy: SurveyModalCopy) => CtaSurveyAnswer;
48
56
  export {};