@mx-cartographer/experiences 9.7.87 → 9.7.88-alpha-usp-ram1

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 (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/core/stores/InsightsV2Store.d.ts +2 -2
  3. package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
  4. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +80 -70
  5. package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
  6. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +44 -43
  7. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  8. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +2 -0
  9. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +1 -0
  10. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
  11. package/dist/insights-v2/components/TransactionListCard.es.js +32 -28
  12. package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
  13. package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +11 -1
  14. package/dist/insights-v2/components/shared/StatusSnackbar.es.js +31 -11
  15. package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
  16. package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
  17. package/dist/insights-v2/components/shared/elevation.es.js +15 -0
  18. package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
  19. package/dist/insights-v2/ctaActions/ctaConfig.es.js +16 -8
  20. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  21. package/dist/insights-v2/ctaActions/index.d.ts +2 -2
  22. package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -1
  23. package/dist/insights-v2/ctaActions/runCtaAction.es.js +110 -68
  24. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  25. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +53 -49
  26. package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -1
  27. package/dist/insights-v2/ctaActions/types.d.ts +6 -2
  28. package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
  29. package/dist/insights-v2/index.d.ts +2 -2
  30. package/dist/insights-v2/index.es.js +132 -130
  31. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n})\n"],"mappings":";AAwBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GA6Ba,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,QAAQ;AAAA,IACR,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IAEpB,IAAI,EAAE,GAAG,sBAAsB;AAAA,EACjC;AAAA,EAEC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the\n * subscription's live frequency under the amount (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Caption each amount with the beat's live repeating transaction frequency. */\n showFrequency?: boolean\n /** Status badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** The rows' card on the wash gets `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n /** Border and shadow on the row card. */\n raised?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n raised: true,\n showFrequency: true,\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n showFrequency: true,\n followsSubscription: true,\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n // Figma: the row card on the wash is elevation/1.\n elevated: true,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n // Figma 1941:207336: the banner sits on the warm-to-lime slot wash.\n [transactionBlockVariant.StatusMessage]: {\n showHeader: false,\n statusMessage: true,\n background: WARM_LIME_ACCENT_GRADIENT,\n },\n})\n"],"mappings":";AAwBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GA+Ba,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,IACxC,QAAQ;AAAA,IACR,eAAe;AAAA,EACjB;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IAEpB,UAAU;AAAA,IAEV,IAAI,EAAE,GAAG,sBAAsB;AAAA,EACjC;AAAA,EAEC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AACF"}
@@ -1,11 +1,12 @@
1
1
  import k from "./InsightTransactionRow.es.js";
2
- import { Fragment as T } from "react";
2
+ import { ELEVATION_SHADOW as I, elevationOverlay as T } from "./shared/elevation.es.js";
3
+ import { Fragment as S } from "react";
3
4
  import i from "@mui/material/Stack";
4
- import { Text as h } from "@mxenabled/mxui";
5
- import { Fragment as b, jsx as r, jsxs as d } from "react/jsx-runtime";
6
- import f from "@mui/material/Box";
7
- import m from "@mui/material/Divider";
8
- var I = (n) => n === "primary" ? {
5
+ import { Text as m } from "@mxenabled/mxui";
6
+ import { Fragment as f, 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 L = (n) => n === "primary" ? {
9
10
  radius: "8px",
10
11
  borderColor: "primary.main",
11
12
  headerBg: "primary.main",
@@ -29,21 +30,21 @@ var I = (n) => n === "primary" ? {
29
30
  px: 16,
30
31
  py: 2
31
32
  }
32
- }, V = ({ background: n, badge: c, elevated: g = !1, footer: l, header: a, raised: B = !1, rows: u, variant: y = "default", sx: C }) => {
33
- if (u.length === 0) return null;
34
- const e = I(y), o = !!n, t = o ? "8px" : e.radius, s = !!a && !o && e.headerInsideBorder, p = a ? /* @__PURE__ */ r(i, {
33
+ }, z = ({ background: n, badge: c, elevated: B = !1, footer: l, header: d, raised: y = !1, rows: x, variant: v = "default", sx: C }) => {
34
+ if (x.length === 0) return null;
35
+ const e = L(v), o = !!n, t = o ? "8px" : e.radius, s = !!d && !o && e.headerInsideBorder, p = d ? /* @__PURE__ */ r(i, {
35
36
  sx: {
36
37
  bgcolor: e.headerBg,
37
38
  justifyContent: "center",
38
39
  ...e.headerSx
39
40
  },
40
- children: /* @__PURE__ */ r(h, {
41
+ children: /* @__PURE__ */ r(m, {
41
42
  bold: e.headerBold,
42
43
  color: e.headerColor,
43
44
  variant: "caption",
44
- children: a
45
+ children: d
45
46
  })
46
- }) : null, v = l ? /* @__PURE__ */ d(b, { children: [/* @__PURE__ */ r(m, {}), /* @__PURE__ */ d(i, {
47
+ }) : null, w = l ? /* @__PURE__ */ a(f, { children: [/* @__PURE__ */ r(u, {}), /* @__PURE__ */ a(i, {
47
48
  sx: {
48
49
  alignItems: "center",
49
50
  bgcolor: o ? "background.paper" : "background.default",
@@ -53,25 +54,25 @@ var I = (n) => n === "primary" ? {
53
54
  px: 16,
54
55
  py: 2
55
56
  },
56
- children: [/* @__PURE__ */ r(h, {
57
+ children: [/* @__PURE__ */ r(m, {
57
58
  color: "text.secondary",
58
59
  variant: "caption",
59
60
  children: l.label
60
- }), /* @__PURE__ */ r(h, {
61
+ }), /* @__PURE__ */ r(m, {
61
62
  bold: !0,
62
63
  color: l.amountColor ?? "text.primary",
63
64
  variant: "body2",
64
65
  children: l.amount
65
66
  })]
66
- })] }) : null, w = /* @__PURE__ */ r(i, {
67
+ })] }) : null, R = /* @__PURE__ */ r(i, {
67
68
  role: "list",
68
69
  sx: { width: "100%" },
69
- children: u.map((R, x) => /* @__PURE__ */ d(T, { children: [x > 0 && /* @__PURE__ */ r(m, { role: "presentation" }), /* @__PURE__ */ r(f, {
70
+ children: x.map((h, b) => /* @__PURE__ */ a(S, { children: [b > 0 && /* @__PURE__ */ r(u, { role: "presentation" }), /* @__PURE__ */ r(g, {
70
71
  role: "listitem",
71
- children: /* @__PURE__ */ r(k, { ...R })
72
- })] }, x))
72
+ children: /* @__PURE__ */ r(k, { ...h })
73
+ })] }, b))
73
74
  });
74
- return /* @__PURE__ */ d(i, {
75
+ return /* @__PURE__ */ a(i, {
75
76
  "data-testid": "transaction-list-card",
76
77
  sx: {
77
78
  ...o ? {
@@ -86,7 +87,7 @@ var I = (n) => n === "primary" ? {
86
87
  ...C
87
88
  },
88
89
  children: [
89
- o && c && /* @__PURE__ */ r(f, {
90
+ o && c && /* @__PURE__ */ r(g, {
90
91
  sx: {
91
92
  left: 16,
92
93
  position: "absolute",
@@ -103,12 +104,15 @@ var I = (n) => n === "primary" ? {
103
104
  },
104
105
  children: p
105
106
  }),
106
- /* @__PURE__ */ d(i, {
107
+ /* @__PURE__ */ a(i, {
107
108
  sx: {
108
109
  ...o ? {
109
110
  bgcolor: "background.paper",
110
- ...g && { boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.12)" },
111
111
  ...B && {
112
+ backgroundImage: (h) => T(h, 1),
113
+ boxShadow: I[1]
114
+ },
115
+ ...y && {
112
116
  border: "1px solid",
113
117
  borderColor: "divider",
114
118
  boxShadow: 1
@@ -119,22 +123,22 @@ var I = (n) => n === "primary" ? {
119
123
  },
120
124
  borderBottomLeftRadius: t,
121
125
  borderBottomRightRadius: t,
122
- borderTopLeftRadius: s || !a ? t : 0,
123
- borderTopRightRadius: s || !a ? t : 0,
126
+ borderTopLeftRadius: s || !d ? t : 0,
127
+ borderTopRightRadius: s || !d ? t : 0,
124
128
  overflow: "hidden",
125
129
  width: "100%"
126
130
  },
127
131
  children: [
128
- s && /* @__PURE__ */ d(b, { children: [p, /* @__PURE__ */ r(m, {})] }),
129
- w,
130
- v
132
+ s && /* @__PURE__ */ a(f, { children: [p, /* @__PURE__ */ r(u, {})] }),
133
+ R,
134
+ w
131
135
  ]
132
136
  })
133
137
  ]
134
138
  });
135
139
  };
136
140
  export {
137
- V as default
141
+ z as default
138
142
  };
139
143
 
140
144
  //# 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), unless `raised`.\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 /** Border and shadow on the inner card; only with `background` (Figma Transaction Row). */\n raised?: 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 raised = false,\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 ...(raised && { border: '1px solid', borderColor: 'divider', boxShadow: 1 }),\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":";;;;;;;AAqDA,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;AA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;AAAA,YACE,SAAS;AAAA,YACT,GAAI,KAAY,EAAE,WAAW,kCAAkC;AAAA,YAC/D,GAAI,KAAU;AAAA,cAAE,QAAQ;AAAA,cAAa,aAAa;AAAA,cAAW,WAAW;AAAA,YAAE;AAAA,UAC5E,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,QAfF,UAAA;AAAA,UAkBG,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, 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), unless `raised`.\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 /** Border and shadow on the inner card; only with `background` (Figma Transaction Row). */\n raised?: 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 raised = false,\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 ...(raised && { border: '1px solid', borderColor: 'divider', boxShadow: 1 }),\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":";;;;;;;;AAsDA,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,QAAA,IAAS,IACT,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,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AC,IAAS,IAAS;AAAA,UAC/D,UAAU;AAAA,UACV,OAAO;AAAA,QACT;AAAA,QAnBF,UAAA;AAAA,UAsBG,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,7 +1,17 @@
1
+ /**
2
+ * How the snackbar is drawn. `standard` (default): the mxui Toast as is (the tone's `main` fill).
3
+ * `strong`: Figma's `<Snackbar>` (`_components/snackbar/<tone>/background`): the tone's 600 step with
4
+ * white words in light and dark, `elevation/16`, a 24px message line, a 15/20 semibold action and
5
+ * Figma's close frame (20px gap, 16px right edge; the button keeps mxui's 44px touch target). A new
6
+ * design adds a variant here; a surface picks one with the `variant` prop.
7
+ */
8
+ export type StatusSnackbarVariant = 'standard' | 'strong';
1
9
  export interface StatusSnackbarProps {
2
10
  open: boolean;
3
11
  /** Snackbar tone — success (green, Figma 1941:167636) or error (red, Figma 1941:167637). */
4
12
  severity?: 'success' | 'error';
13
+ /** Which snackbar design to draw; defaults to `standard`. */
14
+ variant?: StatusSnackbarVariant;
5
15
  /** Status description, e.g. "Your feedback has been submitted.". */
6
16
  message: string;
7
17
  /** ARIA label for the close button. */
@@ -24,5 +34,5 @@ export interface StatusSnackbarProps {
24
34
  * so every surface renders the same Figma variants instead of re-wiring
25
35
  * Toast props.
26
36
  */
27
- declare const StatusSnackbar: ({ actionText, autoHideDuration, closeAriaLabel, message, onActionClick, onClose, open, severity, }: StatusSnackbarProps) => import("react/jsx-runtime").JSX.Element;
37
+ declare const StatusSnackbar: ({ actionText, autoHideDuration, closeAriaLabel, message, onActionClick, onClose, open, severity, variant, }: StatusSnackbarProps) => import("react/jsx-runtime").JSX.Element;
28
38
  export default StatusSnackbar;
@@ -1,19 +1,39 @@
1
+ import { ELEVATION_SHADOW as c } from "./elevation.es.js";
1
2
  import { Toast as u } from "@mxenabled/mxui";
2
- import { jsx as c } from "react/jsx-runtime";
3
- var p = ({ actionText: s, autoHideDuration: o, closeAriaLabel: r, message: a, onActionClick: t, onClose: e, open: l, severity: m = "success" }) => /* @__PURE__ */ c(u, {
4
- actionText: s,
5
- autoHideDuration: o,
6
- closeAriaLabel: r,
7
- handleClose: e,
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ var p = (o) => ({
5
+ "& .MuiAlert-root": {
6
+ backgroundColor: (t) => t.palette[o][600] ?? t.palette[o].dark,
7
+ boxShadow: c[16],
8
+ color: "common.white"
9
+ },
10
+ "& .MuiAlert-icon, & .MuiAlert-action .MuiIconButton-root": { color: "common.white" },
11
+ "& .MuiAlert-action": {
12
+ mr: 0,
13
+ pl: 20
14
+ },
15
+ "& .MuiAlert-message p": { lineHeight: "24px" },
16
+ "& .MuiAlert-message .MuiButton-root": {
17
+ color: "common.white",
18
+ fontSize: 15,
19
+ fontWeight: 600,
20
+ lineHeight: "20px"
21
+ }
22
+ }), M = ({ actionText: o, autoHideDuration: t, closeAriaLabel: e, message: a, onActionClick: i, onClose: n, open: l, severity: r = "success", variant: s = "standard" }) => /* @__PURE__ */ m(u, {
23
+ actionText: o,
24
+ autoHideDuration: t,
25
+ closeAriaLabel: e,
26
+ handleClose: n,
8
27
  message: a,
9
- onActionClick: t,
28
+ onActionClick: i,
10
29
  open: l,
11
- severity: m,
12
- showAction: !!s,
13
- showClose: !0
30
+ severity: r,
31
+ showAction: !!o,
32
+ showClose: !0,
33
+ ...s === "strong" && { snackbarSx: p(r) }
14
34
  });
15
35
  export {
16
- p as default
36
+ M as default
17
37
  };
18
38
 
19
39
  //# sourceMappingURL=StatusSnackbar.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusSnackbar.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/StatusSnackbar.tsx"],"sourcesContent":["import { Toast } from '@mxenabled/mxui'\n\nexport interface StatusSnackbarProps {\n open: boolean\n /** Snackbar tone — success (green, Figma 1941:167636) or error (red, Figma 1941:167637). */\n severity?: 'success' | 'error'\n /** Status description, e.g. \"Your feedback has been submitted.\". */\n message: string\n /** ARIA label for the close button. */\n closeAriaLabel: string\n /** Fired on close / auto-hide. */\n onClose: () => void\n /**\n * Optional action button label (e.g. \"Try Again\"). The button renders only\n * when this is provided.\n */\n actionText?: string\n onActionClick?: () => void\n /** Auto-hide in ms; defaults to the mxui Toast default (3s). */\n autoHideDuration?: number\n}\n\n/**\n * Shared status snackbar for insights-v2 (Figma `<Snackbar>`): a filled\n * success/error toast with a message, a close button, and an optional action\n * (e.g. the feedback modal's Try Again). Thin wrapper over the mxui `Toast`\n * so every surface renders the same Figma variants instead of re-wiring\n * Toast props.\n */\nconst StatusSnackbar = ({\n actionText,\n autoHideDuration,\n closeAriaLabel,\n message,\n onActionClick,\n onClose,\n open,\n severity = 'success',\n}: StatusSnackbarProps) => (\n <Toast\n actionText={actionText}\n autoHideDuration={autoHideDuration}\n closeAriaLabel={closeAriaLabel}\n handleClose={onClose}\n message={message}\n onActionClick={onActionClick}\n open={open}\n severity={severity}\n showAction={!!actionText}\n showClose={true}\n />\n)\n\nexport default StatusSnackbar\n"],"mappings":";;AA6BA,IAAM,IAAA,CAAkB,EACtB,YAAA,GACA,kBAAA,GACA,gBAAA,GACA,SAAA,GACA,eAAA,GACA,SAAA,GACA,MAAA,GACA,UAAA,IAAW,UAAA,MAEX,gBAAA,EAAC,GAAD;AAAA,EACc,YAAA;AAAA,EACM,kBAAA;AAAA,EACF,gBAAA;AAAA,EAChB,aAAa;AAAA,EACJ,SAAA;AAAA,EACM,eAAA;AAAA,EACT,MAAA;AAAA,EACI,UAAA;AAAA,EACV,YAAY,CAAC,CAAC;AAAA,EACd,WAAW;AACZ,CAAA"}
1
+ {"version":3,"file":"StatusSnackbar.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/StatusSnackbar.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport { Toast } from '@mxenabled/mxui'\n\nimport { ELEVATION_SHADOW } from './elevation'\n\n/**\n * How the snackbar is drawn. `standard` (default): the mxui Toast as is (the tone's `main` fill).\n * `strong`: Figma's `<Snackbar>` (`_components/snackbar/<tone>/background`): the tone's 600 step with\n * white words in light and dark, `elevation/16`, a 24px message line, a 15/20 semibold action and\n * Figma's close frame (20px gap, 16px right edge; the button keeps mxui's 44px touch target). A new\n * design adds a variant here; a surface picks one with the `variant` prop.\n */\nexport type StatusSnackbarVariant = 'standard' | 'strong'\n\nexport interface StatusSnackbarProps {\n open: boolean\n /** Snackbar tone — success (green, Figma 1941:167636) or error (red, Figma 1941:167637). */\n severity?: 'success' | 'error'\n /** Which snackbar design to draw; defaults to `standard`. */\n variant?: StatusSnackbarVariant\n /** Status description, e.g. \"Your feedback has been submitted.\". */\n message: string\n /** ARIA label for the close button. */\n closeAriaLabel: string\n /** Fired on close / auto-hide. */\n onClose: () => void\n /**\n * Optional action button label (e.g. \"Try Again\"). The button renders only\n * when this is provided.\n */\n actionText?: string\n onActionClick?: () => void\n /** Auto-hide in ms; defaults to the mxui Toast default (3s). */\n autoHideDuration?: number\n}\n\n// Applied to the Toast's Snackbar root; reaches its Alert, icon, message and action.\nconst strongSx = (severity: 'success' | 'error'): SxProps<Theme> => ({\n '& .MuiAlert-root': {\n backgroundColor: (theme: Theme) => theme.palette[severity][600] ?? theme.palette[severity].dark,\n boxShadow: ELEVATION_SHADOW[16],\n color: 'common.white',\n },\n '& .MuiAlert-icon, & .MuiAlert-action .MuiIconButton-root': { color: 'common.white' },\n // Figma close frame: 20px gap and 16px to the edge (MUI's -8px action margin drops). The close\n // button stays mxui's 44px touch target (theme minWidth/minHeight), not Figma's 40px.\n '& .MuiAlert-action': { mr: 0, pl: 20 },\n '& .MuiAlert-message p': { lineHeight: '24px' },\n '& .MuiAlert-message .MuiButton-root': {\n color: 'common.white',\n fontSize: 15,\n fontWeight: 600,\n lineHeight: '20px',\n },\n})\n\n/**\n * Shared status snackbar for insights-v2 (Figma `<Snackbar>`): a filled\n * success/error toast with a message, a close button, and an optional action\n * (e.g. the feedback modal's Try Again). Thin wrapper over the mxui `Toast`\n * so every surface renders the same Figma variants instead of re-wiring\n * Toast props.\n */\nconst StatusSnackbar = ({\n actionText,\n autoHideDuration,\n closeAriaLabel,\n message,\n onActionClick,\n onClose,\n open,\n severity = 'success',\n variant = 'standard',\n}: StatusSnackbarProps) => (\n <Toast\n actionText={actionText}\n autoHideDuration={autoHideDuration}\n closeAriaLabel={closeAriaLabel}\n handleClose={onClose}\n message={message}\n onActionClick={onActionClick}\n open={open}\n severity={severity}\n showAction={!!actionText}\n showClose={true}\n {...(variant === 'strong' && { snackbarSx: strongSx(severity) })}\n />\n)\n\nexport default StatusSnackbar\n"],"mappings":";;;AAsCA,IAAM,IAAA,CAAY,OAAmD;AAAA,EACnE,oBAAoB;AAAA,IAClB,iBAAA,CAAkB,MAAiB,EAAM,QAAQ,CAAA,EAAU,GAAA,KAAQ,EAAM,QAAQ,CAAA,EAAU;AAAA,IAC3F,WAAW,EAAiB,EAAA;AAAA,IAC5B,OAAO;AAAA,EACT;AAAA,EACA,4DAA4D,EAAE,OAAO,eAAe;AAAA,EAGpF,sBAAsB;AAAA,IAAE,IAAI;AAAA,IAAG,IAAI;AAAA,EAAG;AAAA,EACtC,yBAAyB,EAAE,YAAY,OAAO;AAAA,EAC9C,uCAAuC;AAAA,IACrC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AACF,IASM,IAAA,CAAkB,EACtB,YAAA,GACA,kBAAA,GACA,gBAAA,GACA,SAAA,GACA,eAAA,GACA,SAAA,GACA,MAAA,GACA,UAAA,IAAW,WACX,SAAA,IAAU,WAAA,MAEV,gBAAA,EAAC,GAAD;AAAA,EACc,YAAA;AAAA,EACM,kBAAA;AAAA,EACF,gBAAA;AAAA,EAChB,aAAa;AAAA,EACJ,SAAA;AAAA,EACM,eAAA;AAAA,EACT,MAAA;AAAA,EACI,UAAA;AAAA,EACV,YAAY,CAAC,CAAC;AAAA,EACd,WAAW;AAAA,EACX,GAAK,MAAY,YAAY,EAAE,YAAY,EAAS,CAAQ,EAAE;AAC/D,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ /**
3
+ * Figma elevation effects, as box-shadows. The MUI theme's `shadows[n]` are Material's three-layer
4
+ * shadows; the insights designs use these single drop shadows instead.
5
+ */
6
+ export declare const ELEVATION_SHADOW: {
7
+ /** `elevation/1`: cards and rows on a wash. */
8
+ readonly 1: "0px 2px 8px rgba(0, 0, 0, 0.12)";
9
+ /** `elevation/16`: dialogs and snackbars. */
10
+ readonly 16: "0px 12px 20px rgba(0, 0, 0, 0.22)";
11
+ };
12
+ /**
13
+ * The surface tint MUI's Paper adds in dark mode at this elevation (`paper-elevation-n` in Figma),
14
+ * for surfaces that are not a Paper. `none` in light mode.
15
+ */
16
+ export declare const elevationOverlay: (theme: Theme, elevation: number) => string;
@@ -0,0 +1,15 @@
1
+ import { alpha as t, getOverlayAlpha as p } from "@mui/material/styles";
2
+ var o = {
3
+ 1: "0px 2px 8px rgba(0, 0, 0, 0.12)",
4
+ 16: "0px 12px 20px rgba(0, 0, 0, 0.22)"
5
+ }, l = (r, e) => {
6
+ if (r.palette.mode !== "dark") return "none";
7
+ const a = t(r.palette.common.white, p(e));
8
+ return `linear-gradient(${a}, ${a})`;
9
+ };
10
+ export {
11
+ o as ELEVATION_SHADOW,
12
+ l as elevationOverlay
13
+ };
14
+
15
+ //# sourceMappingURL=elevation.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevation.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/elevation.ts"],"sourcesContent":["import { alpha, getOverlayAlpha, type Theme } from '@mui/material/styles'\n\n/**\n * Figma elevation effects, as box-shadows. The MUI theme's `shadows[n]` are Material's three-layer\n * shadows; the insights designs use these single drop shadows instead.\n */\nexport const ELEVATION_SHADOW = {\n /** `elevation/1`: cards and rows on a wash. */\n 1: '0px 2px 8px rgba(0, 0, 0, 0.12)',\n /** `elevation/16`: dialogs and snackbars. */\n 16: '0px 12px 20px rgba(0, 0, 0, 0.22)',\n} as const\n\n/**\n * The surface tint MUI's Paper adds in dark mode at this elevation (`paper-elevation-n` in Figma),\n * for surfaces that are not a Paper. `none` in light mode.\n */\nexport const elevationOverlay = (theme: Theme, elevation: number): string => {\n if (theme.palette.mode !== 'dark') return 'none'\n\n const tint = alpha(theme.palette.common.white, getOverlayAlpha(elevation))\n\n return `linear-gradient(${tint}, ${tint})`\n}\n"],"mappings":";AAMA,IAAa,IAAmB;AAAA,EAE9B,GAAG;AAAA,EAEH,IAAI;AACN,GAMa,IAAA,CAAoB,GAAc,MAA8B;AAC3E,MAAI,EAAM,QAAQ,SAAS,OAAQ,QAAO;AAE1C,QAAM,IAAO,EAAM,EAAM,QAAQ,OAAO,OAAO,EAAgB,CAAS,CAAC;AAEzE,SAAO,mBAAmB,CAAA,KAAS,CAAA;AACrC"}
@@ -1,12 +1,12 @@
1
1
  import { ANALYTICS_EVENTS_CONFIG as o } from "../analytics/analyticsEventsConfig.es.js";
2
2
  import { CTA_STATUS_CONTENT_CLASS as r } from "../components/CtaStatus.es.js";
3
3
  import { HOST_ACTIONS as a } from "./hostActions.es.js";
4
- import { subscriptionEntryStep as n, subscriptionSurvey as _ } from "./subscriptionAnswer.es.js";
4
+ import { subscriptionEntryStep as n, subscriptionSurvey as p } from "./subscriptionAnswer.es.js";
5
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;
6
+ var u = ({ beat: t, stores: s }) => {
7
+ const e = s.insightsV2Store.beatContext[t.guid]?.selected_account_guid;
8
8
  if (typeof e == "string")
9
- return i.accountStore.visibleSavingsAccounts.some((s) => s.guid === e && !s.is_closed && !s.is_deleted) ? e : void 0;
9
+ return s.accountStore.visibleSavingsAccounts.some((i) => i.guid === e && !i.is_closed && !i.is_deleted) ? e : void 0;
10
10
  }, S = {
11
11
  dismiss_beat: {
12
12
  run: "delegateToHost",
@@ -29,7 +29,7 @@ var u = ({ beat: t, stores: i }) => {
29
29
  positive: "confirmed",
30
30
  negative: "incorrect"
31
31
  } }),
32
- surveyAnswer: _
32
+ surveyAnswer: p
33
33
  },
34
34
  confirm_subscription_status: {
35
35
  ...n({
@@ -39,12 +39,20 @@ var u = ({ beat: t, stores: i }) => {
39
39
  },
40
40
  sx: {
41
41
  minHeight: 56,
42
- [`& .${r}`]: { gap: 10 }
42
+ [`& .${r}`]: { gap: 10 },
43
+ "& .MuiButton-root": {
44
+ fontSize: 13,
45
+ fontWeight: 600,
46
+ lineHeight: "16px",
47
+ minWidth: 0,
48
+ px: 8,
49
+ py: 4
50
+ }
43
51
  },
44
52
  negativeSx: {
45
53
  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) }
54
+ borderColor: (t) => c(t.palette.text.primary, 0.5),
55
+ [`& .${r} .MuiSvgIcon-root`]: { color: (t) => c(t.palette.text.primary, 0.7) }
48
56
  },
49
57
  answeredTitle: (t) => t.insights_feed?.subscription_status_modal?.reviewed_title
50
58
  }),
@@ -1 +1 @@
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
+ {"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 <Alert>: a 56px bar with a 13/16 Undo, and a paper \"Not\n * subscribed\" bar with a 50% border and 70% icon in `text.primary` (black on a light card, white on\n * a dark one). Mini and micro mirror the status (`compactStatus`).\n */\n confirm_subscription_status: {\n ...subscriptionEntryStep({\n statusLabels: { positive: 'subscribed', negative: 'not_subscribed' },\n sx: {\n minHeight: 56,\n [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 },\n '& .MuiButton-root': {\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n minWidth: 0,\n px: 8,\n py: 4,\n },\n },\n negativeSx: {\n bgcolor: 'background.paper',\n borderColor: (theme: Theme) => alpha(theme.palette.text.primary, 0.5),\n [`& .${CTA_STATUS_CONTENT_CLASS} .MuiSvgIcon-root`]: {\n color: (theme: Theme) => alpha(theme.palette.text.primary, 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,YA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M,EAAM,QAAQ,KAAK,SAAS,GAAG;AAAA,QACnE,CAAA,MAAM,CAAA,mBAAyB,GAAqB,EACnD,OAAA,CAAQ,MAAiB,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG,EAChE;AAAA,MACF;AAAA,MACA,eAAA,CAAgB,MAAS,EAAK,eAAe,2BAA2B;AAAA,IAC1E,CAAC;AAAA,IACD,eAAe;AAAA,EACjB;AACF"}
@@ -2,6 +2,6 @@ export { ctaActions } from './ctaConfig';
2
2
  export { ctaHandlers, type CtaHandlerName } from './ctaHandlers';
3
3
  export { ctaPostMessages, resolveCtaMetadata, type CtaPostMessageResolver } from './ctaPostMessages';
4
4
  export { HOST_ACTIONS, type HostActionName } from './hostActions';
5
- export { beatContextOf, reportCtaClick, resolveCtaState, resolveStep, runCtaAction, runCtaHandler, sendCtaAnalytics, } from './runCtaAction';
5
+ export { beatContextOf, reportCtaClick, resolveCtaState, resolveStep, runCtaAction, runCtaHandler, runInDescriptionCta, sendCtaAnalytics, } from './runCtaAction';
6
6
  export { useBeatCtaActions, useCtaHandler, type BeatCtaActions } from './useCtaAction';
7
- export type { CtaContext, CtaEffect, CtaHandler, CtaHandlerContext, CtaParams, CtaPresentation, CtaSurveyAnswer, CtaSlot, CtaState, CtaStateContext, CtaStep, RunHandlerOptions, } from './types';
7
+ export type { CtaContext, CtaEffect, CtaHandler, CtaHandlerContext, CtaParams, CtaPresentation, CtaSurveyAnswer, CtaSlot, CtaState, CtaStateContext, CtaStep, RunHandlerOptions, RunInDescriptionCtaArgs, } from './types';
@@ -1,6 +1,6 @@
1
1
  import { AnalyticsEventConfigEntry } from '../analytics/analyticsEventsConfig';
2
2
  import { CtaHandlerName } from './ctaHandlers';
3
- import { CtaContext, CtaHandlerContext, CtaState, CtaStateContext, CtaStep, RunHandlerOptions } from './types';
3
+ import { CtaContext, CtaHandlerContext, CtaState, CtaStateContext, CtaStep, RunHandlerOptions, RunInDescriptionCtaArgs } from './types';
4
4
  /** The beat's own context (input a block collected for it), `{}` until something is written. */
5
5
  export declare const beatContextOf: ({ beat, stores }: Pick<CtaStateContext, "beat" | "stores">) => Record<string, unknown>;
6
6
  /** The step named by the CTA's `action_key`, or the empty default (no key / unknown key). */
@@ -30,6 +30,12 @@ export declare const reportCtaClick: (ctx: AnalyticsCtx & Pick<CtaContext, "slot
30
30
  skipCtaClicked?: boolean;
31
31
  }) => void;
32
32
  export declare const runCtaAction: (ctx: CtaContext) => Promise<void>;
33
+ /**
34
+ * A pinned beat's auto-open: runs the card action's (`in_description_cta`) step and opens its block,
35
+ * with no press analytics or post message. Does nothing while the step shows a status (e.g. an
36
+ * answered subscription), nothing or a disabled button. Never rejects: failures are reported.
37
+ */
38
+ export declare const runInDescriptionCta: ({ beat, stores, hostActions, }: RunInDescriptionCtaArgs) => Promise<void>;
33
39
  /** Runs a handler directly (drawer Save buttons). True on success. */
34
40
  export declare const runCtaHandler: (ctx: CtaHandlerContext, handlerName: CtaHandlerName, { onSuccess, analytics }?: RunHandlerOptions) => Promise<boolean>;
35
41
  export {};