@mx-cartographer/experiences 9.7.81 → 9.7.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [9.7.82] - 11-03-2026
2
+
3
+ - **FIXED** - Subscription Detected design QA (WEC-2195): the Confirmed status matches Figma (alert success fill, primary text, smaller Undo), and the `info_wash` row card gets a border and shadow (new opt-in `TransactionListCard` `raised`)
4
+
1
5
  ## [9.7.81] - 11-03-2026
2
6
 
3
7
  - **ADDED** - Micro Deposits beat on Insights 2.0 (MEW2-3417): the `with_header` transaction card whose "View Transactions" CTA opens the Transaction List drawer as a plain list. Fixture, story, contract test and block doc
@@ -1,24 +1,24 @@
1
- import { useCategoryStore as F, useGlobalCopyStore as N, useGlobalStore as M } from "../../../../common/context/hooks.es.js";
1
+ import { useCategoryStore as N, useGlobalCopyStore as M, useGlobalStore as Z } from "../../../../common/context/hooks.es.js";
2
2
  import { slot as a } from "../../../../core/types/Insights.es.js";
3
3
  import { formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
4
- import { useBeatActions as Z } from "../../../beatActions.es.js";
5
- import { USER_RESPONSE as $, repeatingTransactionOf as j } from "../../../ctaActions/subscriptionAnswer.es.js";
6
- import { logoFromRef as q } from "../../../components/shared/EntityLogo.es.js";
7
- import D from "../../../components/LogoFromGuid.es.js";
8
- import { statusIconName as H, statusIconPalette as b } from "../../../components/statusIcon.es.js";
9
- import { resolveVariantConfig as P } from "../../resolveVariantConfig.es.js";
10
- import V from "../../../components/TransactionListCard.es.js";
11
- import U from "../../../components/StatusMessageCard.es.js";
12
- import { subscriptionFrequency as W } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
13
- import { getLayoutConfig as Y, transactionBlockVariant as J } from "./layout.es.js";
14
- import { observer as K } from "mobx-react-lite";
15
- import { CategoryIcon as Q, InstitutionLogo as X, MerchantLogo as oo } from "@mxenabled/mxui";
4
+ import { useBeatActions as $ } from "../../../beatActions.es.js";
5
+ import { USER_RESPONSE as j, repeatingTransactionOf as q } from "../../../ctaActions/subscriptionAnswer.es.js";
6
+ import { logoFromRef as D } from "../../../components/shared/EntityLogo.es.js";
7
+ import H from "../../../components/LogoFromGuid.es.js";
8
+ import { statusIconName as P, statusIconPalette as b } from "../../../components/statusIcon.es.js";
9
+ import { resolveVariantConfig as V } from "../../resolveVariantConfig.es.js";
10
+ import U from "../../../components/TransactionListCard.es.js";
11
+ import W from "../../../components/StatusMessageCard.es.js";
12
+ import { subscriptionFrequency as Y } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
13
+ import { getLayoutConfig as J, transactionBlockVariant as K } from "./layout.es.js";
14
+ import { observer as Q } from "mobx-react-lite";
15
+ import { CategoryIcon as X, InstitutionLogo as oo, MerchantLogo as to } from "@mxenabled/mxui";
16
16
  import { Icon as I } from "@mxenabled/mx-icons";
17
17
  import { jsx as t } from "react/jsx-runtime";
18
- import { useTheme as to } from "@mui/material/styles";
18
+ import { useTheme as ro } from "@mui/material/styles";
19
19
  import u from "@mui/material/Box";
20
- var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon: e }) => {
21
- const n = H(e?.guid);
20
+ var s = 32, eo = Math.round(s * 0.625), no = 24, v = 32, io = 20, ao = ({ icon: e }) => {
21
+ const n = P(e?.guid);
22
22
  return n ? /* @__PURE__ */ t(u, {
23
23
  "aria-hidden": !0,
24
24
  "data-icon": n,
@@ -35,12 +35,12 @@ var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon:
35
35
  children: /* @__PURE__ */ t(I, {
36
36
  fill: !0,
37
37
  name: n,
38
- size: no,
38
+ size: io,
39
39
  sx: { color: `${b(e?.color)}.contrastText` }
40
40
  })
41
41
  }) : null;
42
- }, ao = (e, n) => {
43
- const o = q(e.logo, e.primary_text);
42
+ }, so = (e, n) => {
43
+ const o = D(e.logo, e.primary_text);
44
44
  if (o) {
45
45
  if (o.logo_name) return /* @__PURE__ */ t(u, {
46
46
  sx: {
@@ -52,17 +52,17 @@ var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon:
52
52
  },
53
53
  children: /* @__PURE__ */ t(I, {
54
54
  name: o.logo_name,
55
- size: ro,
55
+ size: eo,
56
56
  sx: { color: o.logo_color }
57
57
  })
58
58
  });
59
- if (o.merchant_guid) return /* @__PURE__ */ t(oo, {
59
+ if (o.merchant_guid) return /* @__PURE__ */ t(to, {
60
60
  alt: o.merchant_name ?? "",
61
61
  categoryGuid: o.category_guid ? n(o.category_guid) : "",
62
62
  merchantGuid: o.merchant_guid,
63
63
  size: s
64
64
  });
65
- if (o.institution_guid) return /* @__PURE__ */ t(X, {
65
+ if (o.institution_guid) return /* @__PURE__ */ t(oo, {
66
66
  alt: o.institution_name ?? "",
67
67
  institutionGuid: o.institution_guid,
68
68
  size: s
@@ -72,27 +72,27 @@ var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon:
72
72
  return /* @__PURE__ */ t(u, {
73
73
  "data-testid": `category-icon-${c}`,
74
74
  sx: { display: "flex" },
75
- children: /* @__PURE__ */ t(Q, {
75
+ children: /* @__PURE__ */ t(X, {
76
76
  categoryGuid: c,
77
77
  size: s
78
78
  })
79
79
  });
80
80
  }
81
81
  }
82
- }, To = K(({ payload: e }) => {
83
- const n = to(), { getTopLevelCategoryGuid: o } = F(), c = M(), { recurring: S } = N(), { beat: l } = Z(), { data: i, variant: C } = e.instance_slot, { answeredBackground: f, background: m, cardVariant: G, followsSubscription: d, showFooter: E, showFrequency: p, showHeader: T, statusMessage: B, sx: k } = P(Y(n), C, J.NoHeader, "TransactionBlock"), _ = (p || d) && l ? j({
82
+ }, Bo = Q(({ payload: e }) => {
83
+ const n = ro(), { getTopLevelCategoryGuid: o } = N(), c = Z(), { recurring: S } = M(), { beat: l } = $(), { data: i, variant: C } = e.instance_slot, { answeredBackground: f, background: m, cardVariant: G, followsSubscription: d, raised: E, showFooter: T, showFrequency: p, showHeader: B, statusMessage: k, sx: L } = V(J(n), C, K.NoHeader, "TransactionBlock"), _ = (p || d) && l ? q({
84
84
  beat: l,
85
85
  stores: c
86
- }) : void 0, y = !!d && _?.user_response === $.CONFIRMED;
87
- if (B) {
86
+ }) : void 0, y = !!d && _?.user_response === j.CONFIRMED;
87
+ if (k) {
88
88
  const r = a(i, "message");
89
- return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(U, {
89
+ return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ t(W, {
90
90
  icon: /* @__PURE__ */ t(u, {
91
91
  "aria-hidden": "true",
92
92
  sx: { display: "flex" },
93
- children: /* @__PURE__ */ t(D, {
93
+ children: /* @__PURE__ */ t(H, {
94
94
  logo: a(i, "icon"),
95
- size: eo
95
+ size: no
96
96
  })
97
97
  }),
98
98
  message: r,
@@ -104,28 +104,29 @@ var s = 32, ro = Math.round(s * 0.625), eo = 24, v = 32, no = 20, io = ({ icon:
104
104
  }
105
105
  const g = a(i, "series"), h = a(i, "header_text");
106
106
  if (!Array.isArray(g) || !g.length) return null;
107
- const L = T && typeof h == "string" ? h : void 0, O = a(i, "footer_text"), R = a(i, "footer_amount"), A = E ? {
108
- label: O,
109
- amount: x(R, "0,0.00")
110
- } : void 0, w = p ? W(S, _) : void 0, z = d ? /* @__PURE__ */ t(io, { icon: a(i, y ? "reviewed_icon" : "icon") }) : void 0;
111
- return /* @__PURE__ */ t(V, {
107
+ const O = B && typeof h == "string" ? h : void 0, R = a(i, "footer_text"), A = a(i, "footer_amount"), w = T ? {
108
+ label: R,
109
+ amount: x(A, "0,0.00")
110
+ } : void 0, z = p ? Y(S, _) : void 0, F = d ? /* @__PURE__ */ t(ao, { icon: a(i, y ? "reviewed_icon" : "icon") }) : void 0;
111
+ return /* @__PURE__ */ t(U, {
112
112
  background: y && f ? f : m,
113
- badge: z,
114
- footer: A,
115
- header: L,
116
- sx: k,
113
+ badge: F,
114
+ footer: w,
115
+ header: O,
116
+ raised: E,
117
+ sx: L,
117
118
  variant: G,
118
119
  rows: g.map((r) => ({
119
120
  amount: typeof r.amount == "number" ? x(r.amount, "0,0.00") : "",
120
- amountCaption: w,
121
- leading: ao(r, o),
121
+ amountCaption: z,
122
+ leading: so(r, o),
122
123
  subtitle: r.secondary_text ?? "",
123
124
  title: r.primary_text ?? ""
124
125
  }))
125
126
  });
126
127
  });
127
128
  export {
128
- To as TransactionBlock
129
+ Bo as TransactionBlock
129
130
  };
130
131
 
131
132
  //# sourceMappingURL=TransactionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n followsSubscription,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={slot<LogoRef>(data, subscribed ? 'reviewed_icon' : 'icon')} />\n ) : undefined\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n footer={footer}\n header={header}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,EAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AAAA,MACd,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACA,MAAA;AAAA,MACN,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,GAAG,EAAkB,GAAM,KAAK,CAAA,gBAAiB;AAAA,IAC/D,CAAA;AAAA,EACE,CAAA,IAvBW;AAyBpB,GAaM,KAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF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;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,KAAc,IAAqB,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACC,QAAA;AAAA,IACA,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 24\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n followsSubscription,\n raised,\n showFooter,\n showFrequency,\n showHeader,\n statusMessage,\n sx,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // The live repeating transaction (read-only), for the frequency and the badge / answered wash.\n const repeating =\n (showFrequency || followsSubscription) && beat\n ? repeatingTransactionOf({ beat, stores })\n : undefined\n const subscribed = !!followsSubscription && repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n // The 20% wash layers over paper, as Figma's slot does.\n sx={background ? { backgroundImage: background, bgcolor: 'background.paper' } : undefined}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n // Live, as pulse: the repeating transaction the CTA's `prepare` loads.\n const frequency = showFrequency ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={slot<LogoRef>(data, subscribed ? 'reviewed_icon' : 'icon')} />\n ) : undefined\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n footer={footer}\n header={header}\n raised={raised}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,EAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AAAA,MACd,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACA,MAAA;AAAA,MACN,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,GAAG,EAAkB,GAAM,KAAK,CAAA,gBAAiB;AAAA,IAC/D,CAAA;AAAA,EACE,CAAA,IAvBW;AAyBpB,GAaM,KAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA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AAI,CAAA,IACpF;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,KAAc,IAAqB,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACC,QAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
@@ -8,8 +8,8 @@ import { SxProps, Theme } from '@mui/material/styles';
8
8
  * `data.footer_text` / `data.footer_amount` (Replenish Savings' "Remaining Balance").
9
9
  * - `NoHeader` — the row alone (Large Transaction without a merchant).
10
10
  * - `UncategorizedTransaction` — filled primary header ("{count} transactions").
11
- * - `InfoWash` — borderless row on the blue slot wash, with the subscription's live
12
- * frequency under the amount (e.g. Subscription Detected).
11
+ * - `InfoWash` — raised row (border + shadow) on the blue slot wash, with the
12
+ * subscription's live frequency under the amount (e.g. Subscription Detected).
13
13
  * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected
14
14
  * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.
15
15
  * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`
@@ -32,7 +32,7 @@ export interface TransactionLayoutConfig {
32
32
  showFooter?: boolean;
33
33
  /** `TransactionListCard` style: grey utility header, or filled primary header. */
34
34
  cardVariant?: 'default' | 'primary';
35
- /** CSS background for the slot behind the card; the card then renders borderless on paper. */
35
+ /** CSS background for the slot behind the card; the card renders borderless unless `raised`. */
36
36
  background?: string;
37
37
  /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */
38
38
  statusMessage?: boolean;
@@ -44,6 +44,8 @@ export interface TransactionLayoutConfig {
44
44
  answeredBackground?: string;
45
45
  /** Slot padding override (CSS shorthand). */
46
46
  sx?: SxProps;
47
+ /** Border and shadow on the row card. */
48
+ raised?: boolean;
47
49
  }
48
50
  /** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */
49
51
  export declare const getLayoutConfig: (theme: Theme) => Record<TransactionBlockVariant, TransactionLayoutConfig>;
@@ -1,4 +1,4 @@
1
- import { WARM_LIME_ACCENT_GRADIENT as a, WARNING_WASH_GRADIENT as o, getPrimaryWashGradient as t } from "../../../components/celebrationGradients.es.js";
1
+ import { WARM_LIME_ACCENT_GRADIENT as a, WARNING_WASH_GRADIENT as t, getPrimaryWashGradient as o } from "../../../components/celebrationGradients.es.js";
2
2
  var e = {
3
3
  WithHeader: "with_header",
4
4
  WithHeaderFooter: "with_header_footer",
@@ -20,12 +20,13 @@ var e = {
20
20
  },
21
21
  [e.InfoWash]: {
22
22
  showHeader: !1,
23
- background: t(r),
23
+ background: o(r),
24
+ raised: !0,
24
25
  showFrequency: !0
25
26
  },
26
27
  [e.WarningWash]: {
27
28
  showHeader: !1,
28
- background: o,
29
+ background: t,
29
30
  showFrequency: !0,
30
31
  followsSubscription: !0,
31
32
  answeredBackground: a,
@@ -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` — borderless row on the blue slot wash, with the subscription's live\n * 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 then renders borderless on paper. */\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}\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 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,GA2Ba,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,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 /** 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,14 +1,14 @@
1
1
  import { useState as u } from "react";
2
- import a from "@mui/material/Stack";
2
+ import i from "@mui/material/Stack";
3
3
  import { Text as x } from "@mxenabled/mxui";
4
4
  import f from "@mui/material/Button";
5
5
  import { Icon as p } from "@mxenabled/mx-icons";
6
- import { jsx as t, jsxs as i } from "react/jsx-runtime";
7
- var g = {
6
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
7
+ var b = ({ palette: e }) => e.success[e.mode === "dark" ? 800 : 50], g = {
8
8
  success: {
9
9
  main: "success.main",
10
- fill: "success.lighter",
11
- text: "success.dark"
10
+ fill: b,
11
+ text: "text.primary"
12
12
  },
13
13
  neutral: {
14
14
  main: "text.secondary",
@@ -20,20 +20,20 @@ var g = {
20
20
  fill: "error.lighter",
21
21
  text: "error.dark"
22
22
  }
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);
23
+ }, S = "CtaStatus-content", w = ({ label: e, tone: l, icon: s, action: t, sx: c }) => {
24
+ const r = g[l], [m, a] = u(!1), d = async () => {
25
+ a(!0);
26
26
  try {
27
- await e?.onPress();
27
+ await t?.onPress();
28
28
  } finally {
29
- o(!1);
29
+ a(!1);
30
30
  }
31
31
  };
32
- return /* @__PURE__ */ i(a, {
32
+ return /* @__PURE__ */ n(i, {
33
33
  alignItems: "center",
34
34
  direction: "row",
35
35
  gap: 8,
36
- justifyContent: e ? "space-between" : "center",
36
+ justifyContent: t ? "space-between" : "center",
37
37
  sx: {
38
38
  bgcolor: r.fill,
39
39
  border: "1px solid",
@@ -44,36 +44,40 @@ var g = {
44
44
  py: 8,
45
45
  ...c
46
46
  },
47
- children: [/* @__PURE__ */ i(a, {
47
+ children: [/* @__PURE__ */ n(i, {
48
48
  alignItems: "center",
49
- className: b,
49
+ className: S,
50
50
  direction: "row",
51
51
  gap: 8,
52
52
  role: "status",
53
- children: [s && /* @__PURE__ */ t(p, {
53
+ children: [s && /* @__PURE__ */ o(p, {
54
54
  "aria-hidden": !0,
55
55
  fill: !0,
56
56
  name: s,
57
57
  size: 24,
58
58
  sx: { color: r.main }
59
- }), /* @__PURE__ */ t(x, {
59
+ }), /* @__PURE__ */ o(x, {
60
60
  bold: !0,
61
61
  sx: { color: r.text },
62
62
  variant: "body1",
63
- children: n
63
+ children: e
64
64
  })]
65
- }), e && /* @__PURE__ */ t(f, {
65
+ }), t && /* @__PURE__ */ o(f, {
66
66
  disabled: m,
67
67
  onClick: d,
68
68
  size: "small",
69
- sx: { color: r.text },
70
- children: e.label
69
+ sx: {
70
+ color: r.text,
71
+ fontSize: 13,
72
+ px: 8
73
+ },
74
+ children: t.label
71
75
  })]
72
76
  });
73
77
  };
74
78
  export {
75
- b as CTA_STATUS_CONTENT_CLASS,
76
- v as CtaStatus
79
+ S as CTA_STATUS_CONTENT_CLASS,
80
+ w as CtaStatus
77
81
  };
78
82
 
79
83
  //# 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'\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,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,GAIa,IAA2B,qBAM3B,IAAA,CAAa,EAAE,OAAA,GAAO,MAAA,GAAM,MAAA,GAAM,QAAA,GAAQ,IAAA,EAAA,MAAyB;AAC9E,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,MACJ,GAAG;AAAA,IACL;AAAA,IAdF,UAAA,CAgBE,gBAAA,EAAC,GAAD;AAAA,MACE,YAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAK;AAAA,MALP,UAAA,CAOG,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.\n// Success fill as mxui's Alert: success[50] in light mode, success[800] in dark.\nconst successFill = ({ palette }: Theme) => palette.success[palette.mode === 'dark' ? 800 : 50]\n\nconst TONE_COLORS: Record<\n CtaStatusTone,\n { main: string; fill: string | ((theme: Theme) => string | undefined); text: string }\n> = {\n success: { main: 'success.main', fill: successFill, text: 'text.primary' },\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\n disabled={pending}\n onClick={press}\n size=\"small\"\n sx={{ color: colors.text, fontSize: 13, px: 8 }}\n >\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAM,IAAA,CAAe,EAAE,SAAA,EAAA,MAAqB,EAAQ,QAAQ,EAAQ,SAAS,SAAS,MAAM,EAAA,GAEtF,IAGF;AAAA,EACF,SAAS;AAAA,IAAE,MAAM;AAAA,IAAgB,MAAM;AAAA,IAAa,MAAM;AAAA,EAAe;AAAA,EACzE,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,GAIa,IAA2B,qBAM3B,IAAA,CAAa,EAAE,OAAA,GAAO,MAAA,GAAM,MAAA,GAAM,QAAA,GAAQ,IAAA,EAAA,MAAyB;AAC9E,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,MACJ,GAAG;AAAA,IACL;AAAA,IAdF,UAAA,CAgBE,gBAAA,EAAC,GAAD;AAAA,MACE,YAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAK;AAAA,MALP,UAAA,CAOG,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,MACE,UAAU;AAAA,MACV,SAAS;AAAA,MACT,MAAK;AAAA,MACL,IAAI;AAAA,QAAE,OAAO,EAAO;AAAA,QAAM,UAAU;AAAA,QAAI,IAAI;AAAA,MAAE;AAAA,MAE7C,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
@@ -29,13 +29,15 @@ interface TransactionListCardProps {
29
29
  * background string (gradient or color in CSS format); MUI theme tokens are
30
30
  * not resolved here (this is the CSS `background` shorthand, not `bgcolor`), so
31
31
  * use a CSS color literal instead. When set, the inner card renders borderless
32
- * on a white surface inside the padded Slot (Figma HSA Deposit).
32
+ * on a white surface inside the padded Slot (Figma HSA Deposit), unless `raised`.
33
33
  */
34
34
  background?: string;
35
35
  /** Status disc over the card's corner (needs `background`). */
36
36
  badge?: ReactNode;
37
37
  /** Card shadow on the wash. */
38
38
  elevated?: boolean;
39
+ /** Border and shadow on the inner card; only with `background` (Figma Transaction Row). */
40
+ raised?: boolean;
39
41
  sx?: SxProps;
40
42
  }
41
43
  /**
@@ -45,5 +47,5 @@ interface TransactionListCardProps {
45
47
  *
46
48
  * Scope is the Content section only; Header/Description are out of scope.
47
49
  */
48
- declare const TransactionListCard: ({ background, badge, elevated, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
50
+ declare const TransactionListCard: ({ background, badge, elevated, footer, header, raised, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
49
51
  export default TransactionListCard;
@@ -1,11 +1,11 @@
1
- import R from "./InsightTransactionRow.es.js";
2
- import { Fragment as k } from "react";
1
+ import k from "./InsightTransactionRow.es.js";
2
+ import { Fragment as T } from "react";
3
3
  import i from "@mui/material/Stack";
4
4
  import { Text as h } from "@mxenabled/mxui";
5
- import { Fragment as b, jsx as r, jsxs as a } from "react/jsx-runtime";
5
+ import { Fragment as b, jsx as r, jsxs as d } from "react/jsx-runtime";
6
6
  import f from "@mui/material/Box";
7
7
  import m from "@mui/material/Divider";
8
- var T = (n) => n === "primary" ? {
8
+ var I = (n) => n === "primary" ? {
9
9
  radius: "8px",
10
10
  borderColor: "primary.main",
11
11
  headerBg: "primary.main",
@@ -29,9 +29,9 @@ var T = (n) => n === "primary" ? {
29
29
  px: 16,
30
30
  py: 2
31
31
  }
32
- }, z = ({ background: n, badge: c, elevated: g = !1, footer: l, header: d, rows: u, variant: B = "default", sx: y }) => {
32
+ }, V = ({ background: n, badge: c, elevated: g = !1, footer: l, header: a, raised: B = !1, rows: u, variant: y = "default", sx: C }) => {
33
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, {
34
+ const e = I(y), o = !!n, t = o ? "8px" : e.radius, s = !!a && !o && e.headerInsideBorder, p = a ? /* @__PURE__ */ r(i, {
35
35
  sx: {
36
36
  bgcolor: e.headerBg,
37
37
  justifyContent: "center",
@@ -41,9 +41,9 @@ var T = (n) => n === "primary" ? {
41
41
  bold: e.headerBold,
42
42
  color: e.headerColor,
43
43
  variant: "caption",
44
- children: d
44
+ children: a
45
45
  })
46
- }) : null, C = l ? /* @__PURE__ */ a(b, { children: [/* @__PURE__ */ r(m, {}), /* @__PURE__ */ a(i, {
46
+ }) : null, v = l ? /* @__PURE__ */ d(b, { children: [/* @__PURE__ */ r(m, {}), /* @__PURE__ */ d(i, {
47
47
  sx: {
48
48
  alignItems: "center",
49
49
  bgcolor: o ? "background.paper" : "background.default",
@@ -63,15 +63,15 @@ var T = (n) => n === "primary" ? {
63
63
  variant: "body2",
64
64
  children: l.amount
65
65
  })]
66
- })] }) : null, v = /* @__PURE__ */ r(i, {
66
+ })] }) : null, w = /* @__PURE__ */ r(i, {
67
67
  role: "list",
68
68
  sx: { width: "100%" },
69
- children: u.map((w, x) => /* @__PURE__ */ a(k, { children: [x > 0 && /* @__PURE__ */ r(m, { role: "presentation" }), /* @__PURE__ */ r(f, {
69
+ children: u.map((R, x) => /* @__PURE__ */ d(T, { children: [x > 0 && /* @__PURE__ */ r(m, { role: "presentation" }), /* @__PURE__ */ r(f, {
70
70
  role: "listitem",
71
- children: /* @__PURE__ */ r(R, { ...w })
71
+ children: /* @__PURE__ */ r(k, { ...R })
72
72
  })] }, x))
73
73
  });
74
- return /* @__PURE__ */ a(i, {
74
+ return /* @__PURE__ */ d(i, {
75
75
  "data-testid": "transaction-list-card",
76
76
  sx: {
77
77
  ...o ? {
@@ -83,7 +83,7 @@ var T = (n) => n === "primary" ? {
83
83
  },
84
84
  ...o && c ? { position: "relative" } : {},
85
85
  width: "100%",
86
- ...y
86
+ ...C
87
87
  },
88
88
  children: [
89
89
  o && c && /* @__PURE__ */ r(f, {
@@ -103,33 +103,38 @@ var T = (n) => n === "primary" ? {
103
103
  },
104
104
  children: p
105
105
  }),
106
- /* @__PURE__ */ a(i, {
106
+ /* @__PURE__ */ d(i, {
107
107
  sx: {
108
108
  ...o ? {
109
109
  bgcolor: "background.paper",
110
- ...g && { boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.12)" }
110
+ ...g && { boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.12)" },
111
+ ...B && {
112
+ border: "1px solid",
113
+ borderColor: "divider",
114
+ boxShadow: 1
115
+ }
111
116
  } : {
112
117
  border: "1px solid",
113
118
  borderColor: e.borderColor
114
119
  },
115
120
  borderBottomLeftRadius: t,
116
121
  borderBottomRightRadius: t,
117
- borderTopLeftRadius: s || !d ? t : 0,
118
- borderTopRightRadius: s || !d ? t : 0,
122
+ borderTopLeftRadius: s || !a ? t : 0,
123
+ borderTopRightRadius: s || !a ? t : 0,
119
124
  overflow: "hidden",
120
125
  width: "100%"
121
126
  },
122
127
  children: [
123
- s && /* @__PURE__ */ a(b, { children: [p, /* @__PURE__ */ r(m, {})] }),
124
- v,
125
- C
128
+ s && /* @__PURE__ */ d(b, { children: [p, /* @__PURE__ */ r(m, {})] }),
129
+ w,
130
+ v
126
131
  ]
127
132
  })
128
133
  ]
129
134
  });
130
135
  };
131
136
  export {
132
- z as default
137
+ V as default
133
138
  };
134
139
 
135
140
  //# 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 /** 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,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,IAGO;AAAA,EACL,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IAAE,WAAW;AAAA,IAAI,IAAI;AAAA,IAAI,IAAI;AAAA,EAAE;AAC3C,GAWA,IAAA,CAAuB,EAC3B,YAAA,GACA,OAAA,GACA,UAAA,IAAW,IACX,QAAA,GACA,QAAA,GACA,MAAA,GACA,SAAA,IAAU,WACV,IAAA,EAAA,MAC8B;AAG9B,MAAI,EAAK,WAAW,EAAG,QAAO;AAE9B,QAAM,IAAS,EAAiB,CAAO,GACjC,IAAgB,EAAQ,GACxB,IAAS,IAAgB,QAAQ,EAAO,QAGxC,IAAqB,EAAQ,KAAW,CAAC,KAAiB,EAAO,oBAEjE,IAAc,IAClB,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS,EAAO;AAAA,MAAU,gBAAgB;AAAA,MAAU,GAAG,EAAO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],"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,E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E,IAAI;AAAA,UACF,GAAI,IACA;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.81",
3
+ "version": "9.7.82",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",