@mx-cartographer/experiences 9.7.171 → 9.7.172-alpha-harini-cb

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 (26) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +16 -18
  3. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
  4. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.d.ts +5 -3
  5. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +32 -32
  6. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
  7. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.d.ts +8 -0
  8. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.es.js +11 -0
  9. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.es.js.map +1 -0
  10. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +43 -40
  11. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  12. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +6 -0
  13. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +28 -7
  14. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  15. package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.d.ts +3 -1
  16. package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.es.js +28 -23
  17. package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.es.js.map +1 -1
  18. package/dist/insights-v2/components/P2PLogoStack.d.ts +7 -1
  19. package/dist/insights-v2/components/P2PLogoStack.es.js +22 -22
  20. package/dist/insights-v2/components/P2PLogoStack.es.js.map +1 -1
  21. package/package.json +1 -1
  22. package/dist/core/types/InsightsInstanceSlotData.es.js +0 -8
  23. package/dist/core/types/InsightsInstanceSlotData.es.js.map +0 -1
  24. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.d.ts +0 -7
  25. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.es.js +0 -12
  26. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.es.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [9.7.172] - 11-17-2026
2
+
3
+ - **FIXED** - Monthly Subscription Aggregate V2: 72px bordered logos and Subscriptions drawer count tile type and icon match Figma (WEC-2298)
4
+
1
5
  ## [9.7.171] - 11-17-2026
2
6
 
3
7
  - **CHANGED** - Credit Card Close to Limit's embedded card matches Figma (bold amounts, "Remains", a tighter donut), and micro card titles and notification rows use Figma's line height and logo size (WEC-2030)
@@ -1,14 +1,14 @@
1
1
  import { buildDynamicCopy as c } from "../../../core/utils/Localization.es.js";
2
- import { DATE_FORMATS_INTL as p, formatDate as d } from "../../../core/constants/DateFormats.es.js";
3
- import { getLogoElevation as u } from "../../components/logoShadow.es.js";
2
+ import { DATE_FORMATS_INTL as m, formatDate as p } from "../../../core/constants/DateFormats.es.js";
3
+ import { getLogoElevation as d } from "../../components/logoShadow.es.js";
4
4
  import { TipSection as l } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
5
- import { DRAWER_TIP_ICON as g } from "../../components/drawerTip.es.js";
6
- import { TransactionListHeaderIconTile as _ } from "./TransactionListHeaderIconTile.es.js";
5
+ import { DRAWER_TIP_ICON as u } from "../../components/drawerTip.es.js";
6
+ import { TransactionListHeaderIconTile as g } from "./TransactionListHeaderIconTile.es.js";
7
7
  import n from "@mui/material/Stack";
8
- import { Text as m } from "@mxenabled/mxui";
8
+ import { H2 as x, Text as _ } from "@mxenabled/mxui";
9
9
  import { jsx as r, jsxs as e } from "react/jsx-runtime";
10
- var L = ({ header: o, copy: i, tipTitle: a }) => {
11
- const s = a && i.subscriptions_tip_message ? i.subscriptions_tip_message : void 0, t = o.month && i.subscriptions_in_month ? c(i.subscriptions_in_month, d(o.month, p.MONTH_LONG)) : void 0;
10
+ var L = ({ header: o, copy: i, tipTitle: s }) => {
11
+ const a = s && i.subscriptions_tip_message ? i.subscriptions_tip_message : void 0, t = o.month && i.subscriptions_in_month ? c(i.subscriptions_in_month, p(o.month, m.MONTH_LONG)) : void 0;
12
12
  return /* @__PURE__ */ e(n, {
13
13
  sx: {
14
14
  gap: 16,
@@ -21,30 +21,28 @@ var L = ({ header: o, copy: i, tipTitle: a }) => {
21
21
  alignItems: "center",
22
22
  bgcolor: "background.paper",
23
23
  borderRadius: "8px",
24
- boxShadow: u,
24
+ boxShadow: d,
25
25
  flexDirection: "row",
26
26
  gap: 12,
27
27
  p: 16
28
28
  },
29
- children: [/* @__PURE__ */ r(_, { name: "currency_exchange" }), /* @__PURE__ */ e(n, {
29
+ children: [/* @__PURE__ */ r(g, { name: "currency_exchange" }), /* @__PURE__ */ e(n, {
30
30
  "aria-label": t ? `${o.count} ${t}` : String(o.count),
31
31
  role: "group",
32
- children: [/* @__PURE__ */ r(m, {
32
+ children: [/* @__PURE__ */ r(x, {
33
33
  "aria-hidden": !0,
34
- bold: !0,
35
- component: "p",
36
- variant: "h1",
37
34
  children: o.count
38
- }), t && /* @__PURE__ */ r(m, {
35
+ }), t && /* @__PURE__ */ r(_, {
39
36
  "aria-hidden": !0,
40
37
  color: "text.secondary",
41
- variant: "caption",
38
+ sx: { lineHeight: "20px" },
39
+ variant: "body2",
42
40
  children: t
43
41
  })]
44
42
  })]
45
- }), s && /* @__PURE__ */ r(l, {
46
- icon: g,
47
- message: c(s, /* @__PURE__ */ r("strong", { children: a })),
43
+ }), a && /* @__PURE__ */ r(l, {
44
+ icon: u,
45
+ message: c(a, /* @__PURE__ */ r("strong", { children: s })),
48
46
  sx: { m: 0 }
49
47
  })]
50
48
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionListSubscriptionHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\nimport { TipSection } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { getLogoElevation } from '../../components/logoShadow'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { SubscriptionListHeader } from './layout'\n\nexport interface TransactionListSubscriptionHeaderProps {\n header: SubscriptionListHeader\n /** The caption and tip strings the header reads. */\n copy: Pick<\n NonNullable<InsightsFeedCopy['transaction_list_block']>,\n 'subscriptions_in_month' | 'subscriptions_tip_message'\n >\n /** The bold tip label (\"Tip\"), `insights_feed.general.tip_section_title`. */\n tipTitle: string\n}\n\n/** The Subscriptions drawer's header: the count tile and the tip (Figma 1268:54330). */\nexport const TransactionListSubscriptionHeader = ({\n header,\n copy,\n tipTitle,\n}: TransactionListSubscriptionHeaderProps) => {\n // Both halves or neither: a tip without its bold label would read \": Review…\".\n const tip =\n tipTitle && copy.subscriptions_tip_message ? copy.subscriptions_tip_message : undefined\n const caption =\n header.month && copy.subscriptions_in_month\n ? (buildDynamicCopy(\n copy.subscriptions_in_month,\n formatDate(header.month, DATE_FORMATS_INTL.MONTH_LONG),\n ) as string)\n : undefined\n\n return (\n <Stack sx={{ gap: 16, px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n flexDirection: 'row',\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"currency_exchange\" />\n {/* Read as one label: \"3 Subscriptions in October\", never a bare \"3\" read twice. */}\n <Stack\n aria-label={caption ? `${header.count} ${caption}` : String(header.count)}\n role=\"group\"\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h1\">\n {header.count}\n </Text>\n {caption && (\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"caption\">\n {caption}\n </Text>\n )}\n </Stack>\n </Stack>\n\n {tip && (\n <TipSection\n icon={DRAWER_TIP_ICON}\n message={buildDynamicCopy(tip, <strong>{tipTitle}</strong>) as ReactNode}\n sx={{ m: 0 }}\n />\n )}\n </Stack>\n )\n}\n\nexport default TransactionListSubscriptionHeader\n"],"mappings":";;;;;;;;;AA4BA,IAAa,IAAA,CAAqC,EAChD,QAAA,GACA,MAAA,GACA,UAAA,EAAA,MAC4C;AAE5C,QAAM,IACJ,KAAY,EAAK,4BAA4B,EAAK,4BAA4B,QAC1E,IACJ,EAAO,SAAS,EAAK,yBAChB,EACC,EAAK,wBACL,EAAW,EAAO,OAAO,EAAkB,UAAU,CACvD,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAA7C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;AAAA,QACX,eAAe;AAAA,QACf,KAAK;AAAA,QACL,GAAG;AAAA,MACL;AAAA,MATF,UAAA,CAWE,gBAAA,EAAC,GAAD,EAA+B,MAAK,oBAAqB,CAAA,GAEzD,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,IAAU,GAAG,EAAO,KAAA,IAAS,CAAA,KAAY,OAAO,EAAO,KAAK;AAAA,QACxE,MAAK;AAAA,QAFP,UAAA,CAIE,gBAAA,EAAC,GAAD;AAAA,UAAM,eAAa;AAAA,UAAM,MAAM;AAAA,UAAM,WAAU;AAAA,UAAI,SAAQ;AAAA,UACxD,UAAA,EAAO;AAAA,QACJ,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,eAAa;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UACrD,UAAA;AAAA,QACG,CAAA,CAEH;AAAA,MACF,CAAA,CAAA;AAAA,IAEN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,SAAS,EAAiB,GAAK,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAiB,CAAA,CAAC;AAAA,MAC1D,IAAI,EAAE,GAAG,EAAE;AAAA,IACZ,CAAA,CAEE;AAAA;AAEX"}
1
+ {"version":3,"file":"TransactionListSubscriptionHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\nimport { TipSection } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { getLogoElevation } from '../../components/logoShadow'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { SubscriptionListHeader } from './layout'\n\nexport interface TransactionListSubscriptionHeaderProps {\n header: SubscriptionListHeader\n /** The caption and tip strings the header reads. */\n copy: Pick<\n NonNullable<InsightsFeedCopy['transaction_list_block']>,\n 'subscriptions_in_month' | 'subscriptions_tip_message'\n >\n /** The bold tip label (\"Tip\"), `insights_feed.general.tip_section_title`. */\n tipTitle: string\n}\n\n/** The Subscriptions drawer's header: the count tile and the tip (Figma 1268:54330). */\nexport const TransactionListSubscriptionHeader = ({\n header,\n copy,\n tipTitle,\n}: TransactionListSubscriptionHeaderProps) => {\n // Both halves or neither: a tip without its bold label would read \": Review…\".\n const tip =\n tipTitle && copy.subscriptions_tip_message ? copy.subscriptions_tip_message : undefined\n const caption =\n header.month && copy.subscriptions_in_month\n ? (buildDynamicCopy(\n copy.subscriptions_in_month,\n formatDate(header.month, DATE_FORMATS_INTL.MONTH_LONG),\n ) as string)\n : undefined\n\n return (\n <Stack sx={{ gap: 16, px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n flexDirection: 'row',\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"currency_exchange\" />\n {/* Read as one label: \"3 Subscriptions in October\", never a bare \"3\" read twice. */}\n <Stack\n aria-label={caption ? `${header.count} ${caption}` : String(header.count)}\n role=\"group\"\n >\n <H2 aria-hidden={true}>{header.count}</H2>\n {caption && (\n // Figma 13/400/20: mxui body2 (13/400) at a 20px line height.\n <Text\n aria-hidden={true}\n color=\"text.secondary\"\n sx={{ lineHeight: '20px' }}\n variant=\"body2\"\n >\n {caption}\n </Text>\n )}\n </Stack>\n </Stack>\n\n {tip && (\n <TipSection\n icon={DRAWER_TIP_ICON}\n message={buildDynamicCopy(tip, <strong>{tipTitle}</strong>) as ReactNode}\n sx={{ m: 0 }}\n />\n )}\n </Stack>\n )\n}\n\nexport default TransactionListSubscriptionHeader\n"],"mappings":";;;;;;;;;AA4BA,IAAa,IAAA,CAAqC,EAChD,QAAA,GACA,MAAA,GACA,UAAA,EAAA,MAC4C;AAE5C,QAAM,IACJ,KAAY,EAAK,4BAA4B,EAAK,4BAA4B,QAC1E,IACJ,EAAO,SAAS,EAAK,yBAChB,EACC,EAAK,wBACL,EAAW,EAAO,OAAO,EAAkB,UAAU,CACvD,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAA7C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;AAAA,QACX,eAAe;AAAA,QACf,KAAK;AAAA,QACL,GAAG;AAAA,MACL;AAAA,MATF,UAAA,CAWE,gBAAA,EAAC,GAAD,EAA+B,MAAK,oBAAqB,CAAA,GAEzD,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,IAAU,GAAG,EAAO,KAAA,IAAS,CAAA,KAAY,OAAO,EAAO,KAAK;AAAA,QACxE,MAAK;AAAA,QAFP,UAAA,CAIE,gBAAA,EAAC,GAAD;AAAA,UAAI,eAAa;AAAA,UAAO,UAAA,EAAO;AAAA,QAAU,CAAA,GACxC,KAEC,gBAAA,EAAC,GAAD;AAAA,UACE,eAAa;AAAA,UACb,OAAM;AAAA,UACN,IAAI,EAAE,YAAY,OAAO;AAAA,UACzB,SAAQ;AAAA,UAEP,UAAA;AAAA,QACG,CAAA,CAEH;AAAA,MACF,CAAA,CAAA;AAAA,IAEN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,SAAS,EAAiB,GAAK,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAiB,CAAA,CAAC;AAAA,MAC1D,IAAI,EAAE,GAAG,EAAE;AAAA,IACZ,CAAA,CAEE;AAAA;AAEX"}
@@ -1,3 +1,5 @@
1
- import { BudgetBlockData } from '../../../../core/types/InsightsInstanceSlotData';
2
- import { BlockProps } from '../../types';
3
- export declare const BudgetBlock: ({ payload }: BlockProps<BudgetBlockData>) => import("react/jsx-runtime").JSX.Element;
1
+ import { InsightsPayload } from '../../../../core';
2
+ /** The budget card, from the Insights 2.0 slots on `instance_slot.data` (ditto budget_block.yml). */
3
+ export declare const BudgetBlock: ({ payload }: {
4
+ payload: InsightsPayload;
5
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,38 +1,38 @@
1
- import { buildDynamicCopy as l } from "../../../../core/utils/Localization.es.js";
2
- import { CURRENCY_FORMAT as e, formatCurrency as r } from "../../../../core/utils/NumberFormatting.es.js";
3
- import y from "../../../components/CategoryTile.es.js";
4
- import C from "../../../components/LogoMark.es.js";
5
- import x from "../../../components/ComponentBlocks/StatusIndicator.es.js";
6
- import { getColorByBudgetTier as h } from "./util.es.js";
7
- import { Text as T } from "@mxenabled/mxui";
8
- import { jsx as a } from "react/jsx-runtime";
9
- var j = ({ payload: i }) => {
10
- const { budget_percent: c, amount: n, budget_tier: m, category_guid: t, merchant_guid: s, spent_amount: u, budgeted_amount: d, localized_payload: o } = i.instance_slot_data, p = h(m), _ = t ? /* @__PURE__ */ a(y, {
11
- categoryGuid: t,
12
- size: 44,
13
- tint: 0.25
14
- }) : /* @__PURE__ */ a(C, {
15
- logo: { merchant_guid: s },
16
- size: 44
17
- }), g = l(o?.spent_label || "", r(u, e.cents)), b = l(o?.budgeted_label || "", r(d, e.cents)), f = /* @__PURE__ */ a(T, {
18
- bold: !0,
19
- variant: "h2",
20
- children: t && t !== null ? l(o?.amount_left_label || "", r(n, e.cents)) : r(n, e.cents)
21
- });
22
- return /* @__PURE__ */ a(x, {
23
- amount: f,
24
- borderRadius: "12px",
25
- completeColor: p,
26
- icon: _,
27
- label: o?.primary_text || "",
28
- leftLabel: g,
29
- percentComplete: c,
30
- rightLabel: b,
31
- sx: { "& .details-container": { gap: 12 } }
1
+ import { slot as e } from "../../../../core/types/Insights.es.js";
2
+ import { resolveVariantConfig as l } from "../../resolveVariantConfig.es.js";
3
+ import { asLogoRef as p, asNumber as c, asText as o } from "../../slotReaders.es.js";
4
+ import d from "../../../components/CategoryTile.es.js";
5
+ import f from "../../../components/LogoFromGuid.es.js";
6
+ import g from "../../../components/ComponentBlocks/StatusIndicator.es.js";
7
+ import { BUDGET_BLOCK_FALLBACK_VARIANT as x, BUDGET_BLOCK_LAYOUT as _ } from "./layout.es.js";
8
+ import { H2 as b } from "@mxenabled/mxui";
9
+ import { jsx as i } from "react/jsx-runtime";
10
+ var m = 48, L = (t) => t?.guid ? t.guid.startsWith("CAT-") ? /* @__PURE__ */ i(d, {
11
+ categoryGuid: t.guid,
12
+ size: m,
13
+ tint: 0.25
14
+ }) : /* @__PURE__ */ i(f, {
15
+ logo: t,
16
+ size: m
17
+ }) : null, K = ({ payload: t }) => {
18
+ const { data: r, variant: n } = t.instance_slot, a = o(e(r, "amount_text"));
19
+ if (!a) return null;
20
+ const { barColor: u } = l(_, n, x, "BudgetBlock"), s = Math.min(100, Math.max(0, c(e(r, "percent")) ?? 0));
21
+ return /* @__PURE__ */ i(g, {
22
+ amount: /* @__PURE__ */ i(b, { children: a }),
23
+ barHeight: 12,
24
+ borderRadius: "6px",
25
+ completeColor: u,
26
+ icon: L(p(e(r, "logo"))),
27
+ label: o(e(r, "sub_text")) ?? "",
28
+ leftLabel: o(e(r, "spent_text")),
29
+ percentComplete: s,
30
+ rightLabel: o(e(r, "budgeted_text")),
31
+ sx: { gap: 12 }
32
32
  });
33
33
  };
34
34
  export {
35
- j as BudgetBlock
35
+ K as BudgetBlock
36
36
  };
37
37
 
38
38
  //# sourceMappingURL=BudgetBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BudgetBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.tsx"],"sourcesContent":["import { Text } from '@mxenabled/mxui'\n\nimport { buildDynamicCopy } from '../../../../common'\nimport type { BudgetBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport CategoryTile from '../../../components/CategoryTile'\nimport StatusIndicator from '../../../components/ComponentBlocks/StatusIndicator'\nimport LogoMark from '../../../components/LogoMark'\n\nimport type { BlockProps } from '../../types'\n\nimport { getColorByBudgetTier } from './util'\n\nexport const BudgetBlock = ({ payload }: BlockProps<BudgetBlockData>) => {\n const {\n budget_percent,\n amount,\n budget_tier,\n category_guid,\n merchant_guid,\n spent_amount,\n budgeted_amount,\n localized_payload,\n } = payload.instance_slot_data\n\n const color = getColorByBudgetTier(budget_tier)\n\n // Precomputed as a JSX element (not a component defined during render) so it\n // isn't remounted on every re-render.\n const icon = category_guid ? (\n <CategoryTile categoryGuid={category_guid} size={44} tint={0.25} />\n ) : (\n <LogoMark logo={{ merchant_guid }} size={44} />\n )\n\n const block_left_footer = buildDynamicCopy(\n localized_payload?.spent_label || '',\n formatCurrency(spent_amount, CURRENCY_FORMAT.cents),\n ) as string\n\n const block_right_footer = buildDynamicCopy(\n localized_payload?.budgeted_label || '',\n formatCurrency(budgeted_amount, CURRENCY_FORMAT.cents),\n ) as string\n\n const amountToDisplay = (\n <Text bold={true} variant=\"h2\">\n {category_guid && category_guid !== null\n ? (buildDynamicCopy(\n localized_payload?.amount_left_label || '',\n formatCurrency(amount, CURRENCY_FORMAT.cents),\n ) as string)\n : formatCurrency(amount, CURRENCY_FORMAT.cents)}\n </Text>\n )\n\n return (\n <StatusIndicator\n amount={amountToDisplay}\n borderRadius=\"12px\"\n completeColor={color}\n icon={icon}\n label={localized_payload?.primary_text || ''}\n leftLabel={block_left_footer}\n percentComplete={budget_percent}\n rightLabel={block_right_footer}\n sx={{ '& .details-container': { gap: 12 } }}\n />\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,IAAA,CAAe,EAAE,SAAA,EAAA,MAA2C;AACvE,QAAM,EACJ,gBAAA,GACA,QAAA,GACA,aAAA,GACA,eAAA,GACA,eAAA,GACA,cAAA,GACA,iBAAA,GACA,mBAAA,EAAA,IACE,EAAQ,oBAEN,IAAQ,EAAqB,CAAW,GAIxC,IAAO,IACX,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc;AAAA,IAAe,MAAM;AAAA,IAAI,MAAM;AAAA,EAAO,CAAA,IAElE,gBAAA,EAAC,GAAD;AAAA,IAAU,MAAM,EAAE,eAAA,EAAc;AAAA,IAAG,MAAM;AAAA,EAAK,CAAA,GAG1C,IAAoB,EACxB,GAAmB,eAAe,IAClC,EAAe,GAAc,EAAgB,KAAK,CACpD,GAEM,IAAqB,EACzB,GAAmB,kBAAkB,IACrC,EAAe,GAAiB,EAAgB,KAAK,CACvD,GAEM,IACJ,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,SAAQ;AAAA,IACvB,UAAA,KAAiB,MAAkB,OAC/B,EACC,GAAmB,qBAAqB,IACxC,EAAe,GAAQ,EAAgB,KAAK,CAC9C,IACA,EAAe,GAAQ,EAAgB,KAAK;AAAA,EAC5C,CAAA;AAGR,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,QAAQ;AAAA,IACR,cAAa;AAAA,IACb,eAAe;AAAA,IACT,MAAA;AAAA,IACN,OAAO,GAAmB,gBAAgB;AAAA,IAC1C,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,IAAI,EAAE,wBAAwB,EAAE,KAAK,GAAG,EAAE;AAAA,EAC3C,CAAA;AAEL"}
1
+ {"version":3,"file":"BudgetBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.tsx"],"sourcesContent":["import { H2 } from '@mxenabled/mxui'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\n\nimport CategoryTile from '../../../components/CategoryTile'\nimport StatusIndicator from '../../../components/ComponentBlocks/StatusIndicator'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText } from '../../slotReaders'\n\nimport { BUDGET_BLOCK_FALLBACK_VARIANT, BUDGET_BLOCK_LAYOUT } from './layout'\n\nconst TILE_SIZE = 48\n\n// A category budget's tile is the tinted category tile; any other logo (a merchant's) draws as itself.\nconst budgetTile = (logo?: LogoRef) => {\n if (!logo?.guid) return null\n return logo.guid.startsWith('CAT-') ? (\n <CategoryTile categoryGuid={logo.guid} size={TILE_SIZE} tint={0.25} />\n ) : (\n <LogoFromGuid logo={logo} size={TILE_SIZE} />\n )\n}\n\n/** The budget card, from the Insights 2.0 slots on `instance_slot.data` (ditto budget_block.yml). */\nexport const BudgetBlock = ({ payload }: { payload: InsightsPayload }) => {\n const { data, variant } = payload.instance_slot\n const amountText = asText(slot(data, 'amount_text'))\n // Fail closed: without its amount the card says nothing true.\n if (!amountText) return null\n\n const { barColor } = resolveVariantConfig(\n BUDGET_BLOCK_LAYOUT,\n variant,\n BUDGET_BLOCK_FALLBACK_VARIANT,\n 'BudgetBlock',\n )\n const percent = Math.min(100, Math.max(0, asNumber(slot(data, 'percent')) ?? 0))\n\n // Figma 156:34790: 48px tile, h2 amount at 700, a 12px bar with 6px corners, 12px gaps.\n return (\n <StatusIndicator\n amount={<H2>{amountText}</H2>}\n barHeight={12}\n borderRadius=\"6px\"\n completeColor={barColor}\n icon={budgetTile(asLogoRef(slot(data, 'logo')))}\n label={asText(slot(data, 'sub_text')) ?? ''}\n leftLabel={asText(slot(data, 'spent_text'))}\n percentComplete={percent}\n rightLabel={asText(slot(data, 'budgeted_text'))}\n sx={{ gap: 12 }}\n />\n )\n}\n"],"mappings":";;;;;;;;;AAaA,IAAM,IAAY,IAGZ,IAAA,CAAc,MACb,GAAM,OACJ,EAAK,KAAK,WAAW,MAAM,IAChC,gBAAA,EAAC,GAAD;AAAA,EAAc,cAAc,EAAK;AAAA,EAAM,MAAM;AAAA,EAAW,MAAM;AAAO,CAAA,IAErE,gBAAA,EAAC,GAAD;AAAA,EAAoB,MAAA;AAAA,EAAM,MAAM;AAAY,CAAA,IAJtB,MASb,IAAA,CAAe,EAAE,SAAA,EAAA,MAA4C;AACxE,QAAM,EAAE,MAAA,GAAM,SAAA,EAAA,IAAY,EAAQ,eAC5B,IAAa,EAAO,EAAK,GAAM,aAAa,CAAC;AAEnD,MAAI,CAAC,EAAY,QAAO;AAExB,QAAM,EAAE,UAAA,EAAA,IAAa,EACnB,GACA,GACA,GACA,aACF,GACM,IAAU,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,EAAS,EAAK,GAAM,SAAS,CAAC,KAAK,CAAC,CAAC;AAG/E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,QAAQ,gBAAA,EAAC,GAAD,EAAA,UAAK,EAAe,CAAA;AAAA,IAC5B,WAAW;AAAA,IACX,cAAa;AAAA,IACb,eAAe;AAAA,IACf,MAAM,EAAW,EAAU,EAAK,GAAM,MAAM,CAAC,CAAC;AAAA,IAC9C,OAAO,EAAO,EAAK,GAAM,UAAU,CAAC,KAAK;AAAA,IACzC,WAAW,EAAO,EAAK,GAAM,YAAY,CAAC;AAAA,IAC1C,iBAAiB;AAAA,IACjB,YAAY,EAAO,EAAK,GAAM,eAAe,CAAC;AAAA,IAC9C,IAAI,EAAE,KAAK,GAAG;AAAA,EACf,CAAA;AAEL"}
@@ -0,0 +1,8 @@
1
+ /** Category Budget V2's bar colour per ditto layout variant (budget_block). */
2
+ export type BudgetBlockVariant = 'status_on_track' | 'status_near' | 'status_off_track';
3
+ export interface BudgetBlockLayoutConfig {
4
+ /** Theme colour path for the bar's fill. */
5
+ barColor: string;
6
+ }
7
+ export declare const BUDGET_BLOCK_LAYOUT: Record<BudgetBlockVariant, BudgetBlockLayoutConfig>;
8
+ export declare const BUDGET_BLOCK_FALLBACK_VARIANT: BudgetBlockVariant;
@@ -0,0 +1,11 @@
1
+ var a = {
2
+ status_on_track: { barColor: "success.main" },
3
+ status_near: { barColor: "warning.main" },
4
+ status_off_track: { barColor: "error.main" }
5
+ }, r = "status_on_track";
6
+ export {
7
+ r as BUDGET_BLOCK_FALLBACK_VARIANT,
8
+ a as BUDGET_BLOCK_LAYOUT
9
+ };
10
+
11
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.ts"],"sourcesContent":["/** Category Budget V2's bar colour per ditto layout variant (budget_block). */\nexport type BudgetBlockVariant = 'status_on_track' | 'status_near' | 'status_off_track'\n\nexport interface BudgetBlockLayoutConfig {\n /** Theme colour path for the bar's fill. */\n barColor: string\n}\n\nexport const BUDGET_BLOCK_LAYOUT: Record<BudgetBlockVariant, BudgetBlockLayoutConfig> = {\n status_on_track: { barColor: 'success.main' },\n status_near: { barColor: 'warning.main' },\n status_off_track: { barColor: 'error.main' },\n}\n\nexport const BUDGET_BLOCK_FALLBACK_VARIANT: BudgetBlockVariant = 'status_on_track'\n"],"mappings":"AAQA,IAAa,IAA2E;AAAA,EACtF,iBAAiB,EAAE,UAAU,eAAe;AAAA,EAC5C,aAAa,EAAE,UAAU,eAAe;AAAA,EACxC,kBAAkB,EAAE,UAAU,aAAa;AAC7C,GAEa,IAAoD"}
@@ -1,40 +1,40 @@
1
1
  import { slot as n } from "../../../../core/types/Insights.es.js";
2
- import { CURRENCY_FORMAT as O, formatCurrency as S } from "../../../../core/utils/NumberFormatting.es.js";
3
- import x from "../../../components/StatusPill.es.js";
4
- import { resolveVariantConfig as A } from "../../resolveVariantConfig.es.js";
5
- import { asLogoRef as E, asNumber as R, asText as i, slotOrFlat as d } from "../../slotReaders.es.js";
6
- import b, { isLogoGuid as y } from "../../../components/LogoFromGuid.es.js";
2
+ import { CURRENCY_FORMAT as O, formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
3
+ import A from "../../../components/StatusPill.es.js";
4
+ import { resolveVariantConfig as E } from "../../resolveVariantConfig.es.js";
5
+ import { asLogoRef as R, asNumber as y, asText as i, slotOrFlat as d } from "../../slotReaders.es.js";
6
+ import _, { isLogoGuid as z } from "../../../components/LogoFromGuid.es.js";
7
7
  import B from "../../../components/LogoClusterCard.es.js";
8
8
  import M from "../../../components/MerchantHighlightCard.es.js";
9
9
  import N from "../../../components/P2PLogoStack.es.js";
10
10
  import { MERCHANT_LAYOUT as P, merchantBlockVariant as T } from "./layout.es.js";
11
11
  import V from "@mui/material/Stack";
12
- import { Icon as _ } from "@mxenabled/mx-icons";
12
+ import { Icon as C } from "@mxenabled/mx-icons";
13
13
  import { jsx as e } from "react/jsx-runtime";
14
- var u = 64, p = 6, w = 72, z = 3, F = [
14
+ var p = 64, b = 6, w = 72, F = 3, G = [
15
15
  10,
16
16
  20,
17
17
  35
18
- ], G = 32, g = (a) => {
19
- const r = E(a);
20
- return r?.guid && y(r.guid) ? r : void 0;
21
- }, I = (a) => {
18
+ ], I = 32, g = (a) => {
19
+ const r = R(a);
20
+ return r?.guid && z(r.guid) ? r : void 0;
21
+ }, D = (a) => {
22
22
  if (!Array.isArray(a)) return [];
23
23
  const r = /* @__PURE__ */ new Map();
24
24
  for (const t of a.map(g)) t?.guid && !r.has(t.guid) && r.set(t.guid, t);
25
25
  return [...r.values()];
26
- }, C = /* @__PURE__ */ e(_, {
26
+ }, L = /* @__PURE__ */ e(C, {
27
27
  "aria-hidden": !0,
28
28
  "data-icon": "storefront",
29
29
  name: "storefront",
30
- size: G,
30
+ size: I,
31
31
  sx: { color: "text.secondary" }
32
- }), k = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(b, {
32
+ }), k = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(_, {
33
33
  logo: t,
34
34
  size: r
35
- }, t.guid)) : [C], oo = ({ payload: a }) => {
36
- const { instance_slot: r } = a, { data: t } = r, o = A(P, r.variant, T.SingleStandard, "MerchantBlock"), m = i(d(r, "status_text")), f = o.status && m ? /* @__PURE__ */ e(x, {
37
- icon: /* @__PURE__ */ e(_, {
35
+ }, t.guid)) : [L], ro = ({ payload: a }) => {
36
+ const { instance_slot: r } = a, { data: t } = r, o = E(P, r.variant, T.SingleStandard, "MerchantBlock"), u = i(d(r, "status_text")), m = o.status && u ? /* @__PURE__ */ e(A, {
37
+ icon: /* @__PURE__ */ e(C, {
38
38
  "aria-hidden": !0,
39
39
  "data-icon": "check_circle",
40
40
  fill: !0,
@@ -42,22 +42,24 @@ var u = 64, p = 6, w = 72, z = 3, F = [
42
42
  size: 16,
43
43
  sx: { color: "success.700" }
44
44
  }),
45
- label: m,
45
+ label: u,
46
46
  sx: o.kind === "single" ? void 0 : {
47
47
  alignSelf: "stretch",
48
48
  justifyContent: "center"
49
49
  }
50
50
  }) : void 0;
51
51
  if (o.kind !== "single") {
52
- const c = I(n(t, "logos"));
53
- return o.kind === "ranked" && c.length ? /* @__PURE__ */ e(B, {
52
+ const c = D(n(t, "logos"));
53
+ if (o.kind === "ranked" && c.length) return /* @__PURE__ */ e(B, {
54
54
  background: o.background,
55
55
  fullBleed: !0,
56
- logos: k(c.slice(0, z), w),
57
- overlap: p,
58
- rankOffsets: F,
56
+ logos: k(c.slice(0, F), w),
57
+ overlap: b,
58
+ rankOffsets: G,
59
59
  ranked: !0
60
- }) : /* @__PURE__ */ e(V, {
60
+ });
61
+ const v = o.logo?.size ?? p;
62
+ return /* @__PURE__ */ e(V, {
61
63
  sx: {
62
64
  background: o.background,
63
65
  bgcolor: o.background ? void 0 : o.bgcolor,
@@ -65,47 +67,48 @@ var u = 64, p = 6, w = 72, z = 3, F = [
65
67
  width: "100%"
66
68
  },
67
69
  children: /* @__PURE__ */ e(N, {
68
- borderColor: null,
69
- logos: k(c, u),
70
- overlap: p,
70
+ borderColor: o.logo?.borderColor ?? null,
71
+ logos: k(c, v),
72
+ offsets: o.cascade?.offsets,
73
+ overlap: o.cascade?.overlap ?? b,
71
74
  shadow: "elevation",
72
- size: u,
73
- status: f
75
+ size: v,
76
+ status: m
74
77
  })
75
78
  });
76
79
  }
77
80
  const l = i(n(t, "primary_text")) || i(d(r, "merchant_name"));
78
81
  if (!l) return null;
79
- const s = R(d(r, "amount")), L = i(n(t, "header_text")) || i(n(t, "date")), h = g(n(t, "logo")) ?? g({
82
+ const s = y(d(r, "amount")), S = i(n(t, "header_text")) || i(n(t, "date")), f = g(n(t, "logo")) ?? g({
80
83
  alt: l,
81
84
  fallback_guid: r.category_guid,
82
85
  guid: r.merchant_guid
83
- }), v = o.logo?.size ?? u;
86
+ }), h = o.logo?.size ?? p;
84
87
  return /* @__PURE__ */ e(M, {
85
- amount: s !== void 0 && s !== 0 ? S(s, O.cents) : void 0,
88
+ amount: s !== void 0 && s !== 0 ? x(s, O.cents) : void 0,
86
89
  amountPill: o.amountPill,
87
90
  amountVariant: o.amountVariant,
88
91
  background: o.background,
89
92
  bgcolor: o.bgcolor,
90
93
  borderColor: o.borderColor,
91
- eyebrow: o.hideDate ? void 0 : L,
94
+ eyebrow: o.hideDate ? void 0 : S,
92
95
  fullBleed: o.fullBleed,
93
96
  gap: o.gap,
94
- logo: h ? /* @__PURE__ */ e(b, {
95
- logo: h,
96
- size: v
97
- }) : C,
97
+ logo: f ? /* @__PURE__ */ e(_, {
98
+ logo: f,
99
+ size: h
100
+ }) : L,
98
101
  logoBorderColor: o.logo?.borderColor,
99
102
  logoRadius: o.logo?.radius,
100
103
  logoShadow: o.logo?.shadow,
101
- logoSize: v,
104
+ logoSize: h,
102
105
  name: l,
103
106
  nameVariant: o.nameVariant,
104
- trailing: f
107
+ trailing: m
105
108
  });
106
109
  };
107
110
  export {
108
- oo as default
111
+ ro as default
109
112
  };
110
113
 
111
114
  //# sourceMappingURL=MerchantBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 64\nconst LOGO_OVERLAP = 6\nconst RANKED_LOGO_SIZE = 72\nconst RANKED_MAX = 3\nconst RANKED_OFFSETS = [10, 20, 35] as const\nconst FALLBACK_ICON_SIZE = 32\n\n/** A logo ref naming a known logo guid, else undefined, so an unusable one falls through. */\nconst asMerchantLogo = (value: unknown): LogoRef | undefined => {\n const ref = asLogoRef(value)\n return ref?.guid && isLogoGuid(ref.guid) ? ref : undefined\n}\n\nconst uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const byGuid = new Map<string, LogoRef>()\n for (const ref of refs.map(asMerchantLogo)) {\n if (ref?.guid && !byGuid.has(ref.guid)) byGuid.set(ref.guid, ref)\n }\n return [...byGuid.values()]\n}\n\nconst storefront = (\n <Icon\n aria-hidden={true}\n data-icon=\"storefront\"\n name=\"storefront\"\n size={FALLBACK_ICON_SIZE}\n sx={{ color: 'text.secondary' }}\n />\n)\n\nconst logoTiles = (refs: LogoRef[], size: number) =>\n refs.length\n ? refs.map((ref) => <LogoFromGuid key={ref.guid} logo={ref} size={size} />)\n : [storefront]\n\nconst MerchantBlock = ({ payload }: MerchantBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const config = resolveVariantConfig(\n MERCHANT_LAYOUT,\n instance_slot.variant,\n merchantBlockVariant.SingleStandard,\n 'MerchantBlock',\n )\n const statusText = asText(slotOrFlat(instance_slot, 'status_text'))\n const statusPill =\n config.status && statusText ? (\n <StatusPill\n icon={\n <Icon\n aria-hidden={true}\n data-icon=\"check_circle\"\n fill={true}\n name=\"check_circle\"\n size={16}\n sx={{ color: 'success.700' }}\n />\n }\n label={statusText}\n sx={\n config.kind === 'single' ? undefined : { alignSelf: 'stretch', justifyContent: 'center' }\n }\n />\n ) : undefined\n\n if (config.kind !== 'single') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n if (config.kind === 'ranked' && logos.length) {\n return (\n <LogoClusterCard\n background={config.background}\n fullBleed={true}\n logos={logoTiles(logos.slice(0, RANKED_MAX), RANKED_LOGO_SIZE)}\n overlap={LOGO_OVERLAP}\n rankOffsets={RANKED_OFFSETS}\n ranked={true}\n />\n )\n }\n\n return (\n <Stack\n sx={{\n background: config.background,\n bgcolor: config.background ? undefined : config.bgcolor,\n p: 16,\n width: '100%',\n }}\n >\n <P2PLogoStack\n borderColor={null}\n logos={logoTiles(logos, LOGO_SIZE)}\n overlap={LOGO_OVERLAP}\n shadow=\"elevation\"\n size={LOGO_SIZE}\n status={statusPill}\n />\n </Stack>\n )\n }\n\n // ditto's slot names first.\n const merchantName =\n asText(slot(data, 'primary_text')) || asText(slotOrFlat(instance_slot, 'merchant_name'))\n if (!merchantName) return null\n\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n const date = asText(slot(data, 'header_text')) || asText(slot(data, 'date'))\n const logo =\n asMerchantLogo(slot<unknown>(data, 'logo')) ??\n asMerchantLogo({\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n })\n const logoSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <MerchantHighlightCard\n amount={\n amount !== undefined && amount !== 0\n ? formatCurrency(amount, CURRENCY_FORMAT.cents)\n : undefined\n }\n amountPill={config.amountPill}\n amountVariant={config.amountVariant}\n background={config.background}\n bgcolor={config.bgcolor}\n borderColor={config.borderColor}\n eyebrow={config.hideDate ? undefined : date}\n fullBleed={config.fullBleed}\n gap={config.gap}\n logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n nameVariant={config.nameVariant}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":"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"}
1
+ {"version":3,"file":"MerchantBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport P2PLogoStack from '../../../components/P2PLogoStack'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText, slotOrFlat } from '../../slotReaders'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst LOGO_SIZE = 64\nconst LOGO_OVERLAP = 6\nconst RANKED_LOGO_SIZE = 72\nconst RANKED_MAX = 3\nconst RANKED_OFFSETS = [10, 20, 35] as const\nconst FALLBACK_ICON_SIZE = 32\n\n/** A logo ref naming a known logo guid, else undefined, so an unusable one falls through. */\nconst asMerchantLogo = (value: unknown): LogoRef | undefined => {\n const ref = asLogoRef(value)\n return ref?.guid && isLogoGuid(ref.guid) ? ref : undefined\n}\n\nconst uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const byGuid = new Map<string, LogoRef>()\n for (const ref of refs.map(asMerchantLogo)) {\n if (ref?.guid && !byGuid.has(ref.guid)) byGuid.set(ref.guid, ref)\n }\n return [...byGuid.values()]\n}\n\nconst storefront = (\n <Icon\n aria-hidden={true}\n data-icon=\"storefront\"\n name=\"storefront\"\n size={FALLBACK_ICON_SIZE}\n sx={{ color: 'text.secondary' }}\n />\n)\n\nconst logoTiles = (refs: LogoRef[], size: number) =>\n refs.length\n ? refs.map((ref) => <LogoFromGuid key={ref.guid} logo={ref} size={size} />)\n : [storefront]\n\nconst MerchantBlock = ({ payload }: MerchantBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const config = resolveVariantConfig(\n MERCHANT_LAYOUT,\n instance_slot.variant,\n merchantBlockVariant.SingleStandard,\n 'MerchantBlock',\n )\n const statusText = asText(slotOrFlat(instance_slot, 'status_text'))\n const statusPill =\n config.status && statusText ? (\n <StatusPill\n icon={\n <Icon\n aria-hidden={true}\n data-icon=\"check_circle\"\n fill={true}\n name=\"check_circle\"\n size={16}\n sx={{ color: 'success.700' }}\n />\n }\n label={statusText}\n sx={\n config.kind === 'single' ? undefined : { alignSelf: 'stretch', justifyContent: 'center' }\n }\n />\n ) : undefined\n\n if (config.kind !== 'single') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n if (config.kind === 'ranked' && logos.length) {\n return (\n <LogoClusterCard\n background={config.background}\n fullBleed={true}\n logos={logoTiles(logos.slice(0, RANKED_MAX), RANKED_LOGO_SIZE)}\n overlap={LOGO_OVERLAP}\n rankOffsets={RANKED_OFFSETS}\n ranked={true}\n />\n )\n }\n\n const cascadeSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <Stack\n sx={{\n background: config.background,\n bgcolor: config.background ? undefined : config.bgcolor,\n p: 16,\n width: '100%',\n }}\n >\n <P2PLogoStack\n borderColor={config.logo?.borderColor ?? null}\n logos={logoTiles(logos, cascadeSize)}\n offsets={config.cascade?.offsets}\n overlap={config.cascade?.overlap ?? LOGO_OVERLAP}\n shadow=\"elevation\"\n size={cascadeSize}\n status={statusPill}\n />\n </Stack>\n )\n }\n\n // ditto's slot names first.\n const merchantName =\n asText(slot(data, 'primary_text')) || asText(slotOrFlat(instance_slot, 'merchant_name'))\n if (!merchantName) return null\n\n const amount = asNumber(slotOrFlat(instance_slot, 'amount'))\n const date = asText(slot(data, 'header_text')) || asText(slot(data, 'date'))\n const logo =\n asMerchantLogo(slot<unknown>(data, 'logo')) ??\n asMerchantLogo({\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n })\n const logoSize = config.logo?.size ?? LOGO_SIZE\n\n return (\n <MerchantHighlightCard\n amount={\n amount !== undefined && amount !== 0\n ? formatCurrency(amount, CURRENCY_FORMAT.cents)\n : undefined\n }\n amountPill={config.amountPill}\n amountVariant={config.amountVariant}\n background={config.background}\n bgcolor={config.bgcolor}\n borderColor={config.borderColor}\n eyebrow={config.hideDate ? undefined : date}\n fullBleed={config.fullBleed}\n gap={config.gap}\n logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n nameVariant={config.nameVariant}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAM,IAAY,IACZ,IAAe,GACf,IAAmB,IACnB,IAAa,GACb,IAAiB;AAAA,EAAC;AAAA,EAAI;AAAA,EAAI;AAAE,GAC5B,IAAqB,IAGrB,IAAA,CAAkB,MAAwC;AAC9D,QAAM,IAAM,EAAU,CAAK;AAC3B,SAAO,GAAK,QAAQ,EAAW,EAAI,IAAI,IAAI,IAAM;AACnD,GAEM,IAAA,CAAe,MAA6B;AAChD,MAAI,CAAC,MAAM,QAAQ,CAAI,EAAG,QAAO,CAAC;AAClC,QAAM,IAAS,oBAAI,IAAqB;AACxC,aAAW,KAAO,EAAK,IAAI,CAAc,EACvC,CAAI,GAAK,QAAQ,CAAC,EAAO,IAAI,EAAI,IAAI,KAAG,EAAO,IAAI,EAAI,MAAM,CAAG;AAElE,SAAO,CAAC,GAAG,EAAO,OAAO,CAAC;AAC5B,GAEM,IACJ,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,aAAU;AAAA,EACV,MAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI,EAAE,OAAO,iBAAiB;AAC/B,CAAA,GAGG,IAAA,CAAa,GAAiB,MAClC,EAAK,SACD,EAAK,IAAA,CAAK,MAAQ,gBAAA,EAAC,GAAD;AAAA,EAA6B,MAAM;AAAA,EAAW,MAAA;AAAO,GAAlC,EAAI,IAA8B,CAAC,IACxE,CAAC,CAAU,GAEX,KAAA,CAAiB,EAAE,SAAA,EAAA,MAAkC;AACzD,QAAM,EAAE,eAAA,EAAA,IAAkB,GACpB,EAAE,MAAA,EAAA,IAAS,GACX,IAAS,EACb,GACA,EAAc,SACd,EAAqB,gBACrB,eACF,GACM,IAAa,EAAO,EAAW,GAAe,aAAa,CAAC,GAC5D,IACJ,EAAO,UAAU,IACf,gBAAA,EAAC,GAAD;AAAA,IACE,MACE,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,aAAU;AAAA,MACV,MAAM;AAAA,MACN,MAAK;AAAA,MACL,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,cAAc;AAAA,IAC5B,CAAA;AAAA,IAEH,OAAO;AAAA,IACP,IACE,EAAO,SAAS,WAAW,SAAY;AAAA,MAAE,WAAW;AAAA,MAAW,gBAAgB;AAAA,IAAS;AAAA,EAE3F,CAAA,IACC;AAEN,MAAI,EAAO,SAAS,UAAU;AAC5B,UAAM,IAAQ,EAAY,EAAiC,GAAM,OAAO,CAAC;AAEzE,QAAI,EAAO,SAAS,YAAY,EAAM,OACpC,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,YAAY,EAAO;AAAA,MACnB,WAAW;AAAA,MACX,OAAO,EAAU,EAAM,MAAM,GAAG,CAAU,GAAG,CAAgB;AAAA,MAC7D,SAAS;AAAA,MACT,aAAa;AAAA,MACb,QAAQ;AAAA,IACT,CAAA;AAIL,UAAM,IAAc,EAAO,MAAM,QAAQ;AAEzC,WACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY,EAAO;AAAA,QACnB,SAAS,EAAO,aAAa,SAAY,EAAO;AAAA,QAChD,GAAG;AAAA,QACH,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,aAAa,EAAO,MAAM,eAAe;AAAA,QACzC,OAAO,EAAU,GAAO,CAAW;AAAA,QACnC,SAAS,EAAO,SAAS;AAAA,QACzB,SAAS,EAAO,SAAS,WAAW;AAAA,QACpC,QAAO;AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MACT,CAAA;AAAA,IACI,CAAA;AAAA,EAEX;AAGA,QAAM,IACJ,EAAO,EAAK,GAAM,cAAc,CAAC,KAAK,EAAO,EAAW,GAAe,eAAe,CAAC;AACzF,MAAI,CAAC,EAAc,QAAO;AAE1B,QAAM,IAAS,EAAS,EAAW,GAAe,QAAQ,CAAC,GACrD,IAAO,EAAO,EAAK,GAAM,aAAa,CAAC,KAAK,EAAO,EAAK,GAAM,MAAM,CAAC,GACrE,IACJ,EAAe,EAAc,GAAM,MAAM,CAAC,KAC1C,EAAe;AAAA,IACb,KAAK;AAAA,IACL,eAAe,EAAc;AAAA,IAC7B,MAAM,EAAc;AAAA,EACtB,CAAC,GACG,IAAW,EAAO,MAAM,QAAQ;AAEtC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,QACE,MAAW,UAAa,MAAW,IAC/B,EAAe,GAAQ,EAAgB,KAAK,IAC5C;AAAA,IAEN,YAAY,EAAO;AAAA,IACnB,eAAe,EAAO;AAAA,IACtB,YAAY,EAAO;AAAA,IACnB,SAAS,EAAO;AAAA,IAChB,aAAa,EAAO;AAAA,IACpB,SAAS,EAAO,WAAW,SAAY;AAAA,IACvC,WAAW,EAAO;AAAA,IAClB,KAAK,EAAO;AAAA,IACZ,MAAM,IAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAW,CAAA,IAAI;AAAA,IAC5D,iBAAiB,EAAO,MAAM;AAAA,IAC9B,YAAY,EAAO,MAAM;AAAA,IACzB,YAAY,EAAO,MAAM;AAAA,IACf,UAAA;AAAA,IACV,MAAM;AAAA,IACN,aAAa,EAAO;AAAA,IACpB,UAAU;AAAA,EACX,CAAA;AAEL"}
@@ -1,3 +1,4 @@
1
+ import { CascadeOffsets } from '../../../components/P2PLogoStack';
1
2
  import { AmountPillProps } from '../../../components/AmountPill';
2
3
  /** ditto declares only `highlight` today. */
3
4
  export declare const merchantBlockVariant: {
@@ -33,6 +34,11 @@ export interface MerchantBlockLayoutConfig {
33
34
  borderColor?: string;
34
35
  radius?: number;
35
36
  };
37
+ /** Cascade only: px the tiles overlap, and each tile's drop from the top of the row per tile count. */
38
+ cascade?: {
39
+ overlap?: number;
40
+ offsets?: CascadeOffsets;
41
+ };
36
42
  /** Draw `status_text` in a success pill. */
37
43
  status?: boolean;
38
44
  }
@@ -1,5 +1,5 @@
1
- import { WARM_LIME_ACCENT_GRADIENT as t, celebrateGradient as e } from "../../../components/celebrationGradients.es.js";
2
- var r = {
1
+ import { WARM_LIME_ACCENT_GRADIENT as r, celebrateGradient as e } from "../../../components/celebrationGradients.es.js";
2
+ var s = {
3
3
  Highlight: "highlight",
4
4
  SingleStandard: "single_standard",
5
5
  SingleSuccess: "single_success",
@@ -9,7 +9,7 @@ var r = {
9
9
  MultipleSubscription: "multiple_subscription",
10
10
  MultipleBadged: "multiple_badged"
11
11
  }, l = { bgcolor: "secondary.lighter" }, a = {
12
- background: t,
12
+ background: r,
13
13
  status: !0
14
14
  }, i = {
15
15
  kind: "single",
@@ -22,7 +22,7 @@ var r = {
22
22
  borderColor: "divider",
23
23
  radius: 8
24
24
  }
25
- }, s = {
25
+ }, n = {
26
26
  highlight: {
27
27
  kind: "single",
28
28
  amountVariant: "text",
@@ -61,7 +61,28 @@ var r = {
61
61
  },
62
62
  multiple_subscription: {
63
63
  kind: "cascade",
64
- background: e(200.73)
64
+ background: e(200.73),
65
+ cascade: {
66
+ overlap: 8,
67
+ offsets: {
68
+ 2: [0, 34],
69
+ 3: [
70
+ 0,
71
+ 17,
72
+ 34
73
+ ],
74
+ 4: [
75
+ 0,
76
+ 11,
77
+ 23,
78
+ 34
79
+ ]
80
+ }
81
+ },
82
+ logo: {
83
+ size: 72,
84
+ borderColor: "divider"
85
+ }
65
86
  },
66
87
  multiple_badged: {
67
88
  kind: "ranked",
@@ -69,8 +90,8 @@ var r = {
69
90
  }
70
91
  };
71
92
  export {
72
- s as MERCHANT_LAYOUT,
73
- r as merchantBlockVariant
93
+ n as MERCHANT_LAYOUT,
94
+ s as merchantBlockVariant
74
95
  };
75
96
 
76
97
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // Figma 1268:54330 (Single): 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n multiple_subscription: { kind: 'cascade', background: celebrateGradient(200.73) },\n multiple_badged: { kind: 'ranked', background: celebrateGradient(242.46) },\n}\n"],"mappings":";AAOA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GAyBM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAGhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA,IACL,MAAM;AAAA,MAAE,GAAG,EAAO;AAAA,MAAM,MAAM;AAAA,IAAG;AAAA,IACjC,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAS;AAAA,EAClD,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAQ;AAAA,EAChD,uBAAuB;AAAA,IAAE,MAAM;AAAA,IAAW,YAAY,EAAkB,MAAM;AAAA,EAAE;AAAA,EAChF,iBAAiB;AAAA,IAAE,MAAM;AAAA,IAAU,YAAY,EAAkB,MAAM;AAAA,EAAE;AAC3E"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import type { CascadeOffsets } from '../../../components/P2PLogoStack'\nimport {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Cascade only: px the tiles overlap, and each tile's drop from the top of the row per tile count. */\n cascade?: { overlap?: number; offsets?: CascadeOffsets }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // Figma 1268:54330 (Single): 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n // Figma 1268:54330 `Logos`: 72px tiles with a divider border, 64px apart, top/centre/bottom of 106px.\n // The 2- and 4-tile staircases (not drawn in Figma) keep the shared shape over the same 34px drop.\n multiple_subscription: {\n kind: 'cascade',\n background: celebrateGradient(200.73),\n cascade: { overlap: 8, offsets: { 2: [0, 34], 3: [0, 17, 34], 4: [0, 11, 23, 34] } },\n logo: { size: 72, borderColor: 'divider' },\n },\n multiple_badged: { kind: 'ranked', background: celebrateGradient(242.46) },\n}\n"],"mappings":";AAQA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GA2BM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAGhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA,IACL,MAAM;AAAA,MAAE,GAAG,EAAO;AAAA,MAAM,MAAM;AAAA,IAAG;AAAA,IACjC,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAS;AAAA,EAClD,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAQ;AAAA,EAGhD,uBAAuB;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,EAAkB,MAAM;AAAA,IACpC,SAAS;AAAA,MAAE,SAAS;AAAA,MAAG,SAAS;AAAA,QAAE,GAAG,CAAC,GAAG,EAAE;AAAA,QAAG,GAAG;AAAA,UAAC;AAAA,UAAG;AAAA,UAAI;AAAA,QAAE;AAAA,QAAG,GAAG;AAAA,UAAC;AAAA,UAAG;AAAA,UAAI;AAAA,UAAI;AAAA,QAAE;AAAA,MAAE;AAAA,IAAE;AAAA,IACnF,MAAM;AAAA,MAAE,MAAM;AAAA,MAAI,aAAa;AAAA,IAAU;AAAA,EAC3C;AAAA,EACA,iBAAiB;AAAA,IAAE,MAAM;AAAA,IAAU,YAAY,EAAkB,MAAM;AAAA,EAAE;AAC3E"}
@@ -1,6 +1,8 @@
1
1
  import { SxProps } from '@mui/material/styles';
2
2
  interface StatusIndicatorProps {
3
3
  amount: string | React.ReactNode;
4
+ /** Bar thickness in px. Default 16. */
5
+ barHeight?: number;
4
6
  borderRadius?: string;
5
7
  completeColor?: string;
6
8
  icon: React.ReactNode;
@@ -10,5 +12,5 @@ interface StatusIndicatorProps {
10
12
  rightLabel?: string;
11
13
  sx?: SxProps;
12
14
  }
13
- declare const StatusIndicator: ({ amount, borderRadius, completeColor, icon, label, leftLabel, percentComplete, rightLabel, sx, }: StatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const StatusIndicator: ({ amount, barHeight, borderRadius, completeColor, icon, label, leftLabel, percentComplete, rightLabel, sx, }: StatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
14
16
  export default StatusIndicator;
@@ -1,65 +1,70 @@
1
- import r from "@mui/material/Stack";
2
- import { H2 as f, P as g, Text as c } from "@mxenabled/mxui";
3
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
4
- import s from "@mui/material/Box";
5
- var I = ({ amount: i, borderRadius: o = "2px", completeColor: a = "success.main", icon: l, label: n, leftLabel: x, percentComplete: d = 0, rightLabel: p, sx: h }) => /* @__PURE__ */ t(r, {
1
+ import i from "@mui/material/Stack";
2
+ import { H2 as f, P as g, Text as x } from "@mxenabled/mxui";
3
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
4
+ import d from "@mui/material/Box";
5
+ var j = ({ amount: t, barHeight: n = 16, borderRadius: o = "2px", completeColor: h = "success.main", icon: p, label: a, leftLabel: s, percentComplete: c = 0, rightLabel: l, sx: m }) => /* @__PURE__ */ e(i, {
6
6
  className: "details-container",
7
7
  sx: {
8
8
  px: 16,
9
9
  py: 8,
10
10
  width: "100%",
11
11
  gap: 16,
12
- ...h
12
+ ...m
13
13
  },
14
- children: [/* @__PURE__ */ t(r, {
14
+ children: [/* @__PURE__ */ e(i, {
15
15
  sx: {
16
16
  alignItems: "center",
17
17
  flexDirection: "row",
18
18
  gap: 12
19
19
  },
20
- children: [/* @__PURE__ */ e(s, { children: l }), /* @__PURE__ */ t(r, { children: [typeof n == "string" ? /* @__PURE__ */ e(g, {
21
- dangerouslySetInnerHTML: { __html: n },
20
+ children: [/* @__PURE__ */ r(d, { children: p }), /* @__PURE__ */ e(i, { children: [typeof a == "string" ? /* @__PURE__ */ r(g, {
21
+ dangerouslySetInnerHTML: { __html: a },
22
22
  variant: "body2"
23
- }) : n, typeof i == "string" ? /* @__PURE__ */ e(f, { children: i }) : i] })]
24
- }), /* @__PURE__ */ t(r, {
23
+ }) : a, typeof t == "string" ? /* @__PURE__ */ r(f, { children: t }) : t] })]
24
+ }), /* @__PURE__ */ e(i, {
25
25
  sx: { gap: 4 },
26
- children: [/* @__PURE__ */ e(r, {
26
+ children: [/* @__PURE__ */ r(i, {
27
+ "aria-label": [s, l].filter(Boolean).join(", ") || void 0,
28
+ "aria-valuemax": 100,
29
+ "aria-valuemin": 0,
30
+ "aria-valuenow": Math.round(Math.min(100, Math.max(0, c))),
31
+ role: "progressbar",
27
32
  sx: {
28
33
  bgcolor: "divider",
29
34
  borderRadius: o,
30
35
  flexDirection: "row",
31
- height: 16,
36
+ height: n,
32
37
  width: "100%"
33
38
  },
34
- children: /* @__PURE__ */ e(s, { sx: {
39
+ children: /* @__PURE__ */ r(d, { sx: {
35
40
  alignItems: "center",
36
41
  display: "flex",
37
42
  py: 2,
38
43
  px: 12,
39
- bgcolor: a,
44
+ bgcolor: h,
40
45
  borderRadius: o,
41
- height: 16,
42
- width: `${d}%`
46
+ height: n,
47
+ width: `${c}%`
43
48
  } })
44
- }), /* @__PURE__ */ t(r, {
49
+ }), /* @__PURE__ */ e(i, {
45
50
  sx: {
46
51
  flexDirection: "row",
47
52
  justifyContent: "space-between"
48
53
  },
49
- children: [/* @__PURE__ */ e(c, {
54
+ children: [/* @__PURE__ */ r(x, {
50
55
  sx: { color: "text.secondary" },
51
56
  variant: "caption",
52
- children: x
53
- }), /* @__PURE__ */ e(c, {
57
+ children: s
58
+ }), /* @__PURE__ */ r(x, {
54
59
  sx: { color: "text.secondary" },
55
60
  variant: "caption",
56
- children: p
61
+ children: l
57
62
  })]
58
63
  })]
59
64
  })]
60
65
  });
61
66
  export {
62
- I as default
67
+ j as default
63
68
  };
64
69
 
65
70
  //# sourceMappingURL=StatusIndicator.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIndicator.es.js","names":[],"sources":["../../../../src/insights-v2/components/ComponentBlocks/StatusIndicator.tsx"],"sourcesContent":["import { H2, P, Text } from '@mxenabled/mxui'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\ninterface StatusIndicatorProps {\n amount: string | React.ReactNode\n borderRadius?: string\n completeColor?: string\n icon: React.ReactNode\n label: string | React.ReactNode\n leftLabel?: string\n percentComplete?: number\n rightLabel?: string\n sx?: SxProps\n}\n\nconst StatusIndicator = ({\n amount,\n borderRadius = '2px',\n completeColor = 'success.main',\n icon,\n label,\n leftLabel,\n percentComplete = 0,\n rightLabel,\n sx,\n}: StatusIndicatorProps) => {\n return (\n <Stack className=\"details-container\" sx={{ px: 16, py: 8, width: '100%', gap: 16, ...sx }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <Box>{icon}</Box>\n <Stack>\n {typeof label === 'string' ? (\n <P dangerouslySetInnerHTML={{ __html: label }} variant={'body2'} />\n ) : (\n label\n )}\n {typeof amount === 'string' ? <H2>{amount}</H2> : amount}\n </Stack>\n </Stack>\n <Stack sx={{ gap: 4 }}>\n <Stack\n sx={{\n bgcolor: 'divider',\n borderRadius,\n flexDirection: 'row',\n height: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n py: 2,\n px: 12,\n bgcolor: completeColor,\n borderRadius,\n height: 16,\n width: `${percentComplete}%`,\n }}\n />\n </Stack>\n\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {leftLabel}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {rightLabel}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default StatusIndicator\n"],"mappings":";;;;AAkBA,IAAM,IAAA,CAAmB,EACvB,QAAA,GACA,cAAA,IAAe,OACf,eAAA,IAAgB,gBAChB,MAAA,GACA,OAAA,GACA,WAAA,GACA,iBAAA,IAAkB,GAClB,YAAA,GACA,IAAA,EAAA,MAGE,gBAAA,EAAC,GAAD;AAAA,EAAO,WAAU;AAAA,EAAoB,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,IAAG,OAAO;AAAA,IAAQ,KAAK;AAAA,IAAI,GAAG;AAAA,EAAG;AAAA,EAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,KAAK;AAAA,IAAG;AAAA,IAAjE,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAM,EAAU,CAAA,GAChB,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,OAAO,KAAU,WAChB,gBAAA,EAAC,GAAD;AAAA,MAAG,yBAAyB,EAAE,QAAQ,EAAM;AAAA,MAAG,SAAS;AAAA,IAAU,CAAA,IAElE,GAED,OAAO,KAAW,WAAW,gBAAA,EAAC,GAAD,EAAA,UAAK,EAAW,CAAA,IAAI,CAC7C,EAAA,CAAA,CACF;AAAA,EACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,EAAE;AAAA,IAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,cAAA;AAAA,QACA,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD,EACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,cAAA;AAAA,QACA,QAAQ;AAAA,QACR,OAAO,GAAG,CAAA;AAAA,MACZ,EACD,CAAA;AAAA,IACI,CAAA,GAEP,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,eAAe;AAAA,QAAO,gBAAgB;AAAA,MAAgB;AAAA,MAAnE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA,EACF,CAAA,CAAA"}
1
+ {"version":3,"file":"StatusIndicator.es.js","names":[],"sources":["../../../../src/insights-v2/components/ComponentBlocks/StatusIndicator.tsx"],"sourcesContent":["import { H2, P, Text } from '@mxenabled/mxui'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\ninterface StatusIndicatorProps {\n amount: string | React.ReactNode\n /** Bar thickness in px. Default 16. */\n barHeight?: number\n borderRadius?: string\n completeColor?: string\n icon: React.ReactNode\n label: string | React.ReactNode\n leftLabel?: string\n percentComplete?: number\n rightLabel?: string\n sx?: SxProps\n}\n\nconst StatusIndicator = ({\n amount,\n barHeight = 16,\n borderRadius = '2px',\n completeColor = 'success.main',\n icon,\n label,\n leftLabel,\n percentComplete = 0,\n rightLabel,\n sx,\n}: StatusIndicatorProps) => {\n return (\n <Stack className=\"details-container\" sx={{ px: 16, py: 8, width: '100%', gap: 16, ...sx }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <Box>{icon}</Box>\n <Stack>\n {typeof label === 'string' ? (\n <P dangerouslySetInnerHTML={{ __html: label }} variant={'body2'} />\n ) : (\n label\n )}\n {typeof amount === 'string' ? <H2>{amount}</H2> : amount}\n </Stack>\n </Stack>\n <Stack sx={{ gap: 4 }}>\n <Stack\n aria-label={[leftLabel, rightLabel].filter(Boolean).join(', ') || undefined}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={Math.round(Math.min(100, Math.max(0, percentComplete)))}\n role=\"progressbar\"\n sx={{\n bgcolor: 'divider',\n borderRadius,\n flexDirection: 'row',\n height: barHeight,\n width: '100%',\n }}\n >\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n py: 2,\n px: 12,\n bgcolor: completeColor,\n borderRadius,\n height: barHeight,\n width: `${percentComplete}%`,\n }}\n />\n </Stack>\n\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {leftLabel}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {rightLabel}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default StatusIndicator\n"],"mappings":";;;;AAoBA,IAAM,IAAA,CAAmB,EACvB,QAAA,GACA,WAAA,IAAY,IACZ,cAAA,IAAe,OACf,eAAA,IAAgB,gBAChB,MAAA,GACA,OAAA,GACA,WAAA,GACA,iBAAA,IAAkB,GAClB,YAAA,GACA,IAAA,EAAA,MAGE,gBAAA,EAAC,GAAD;AAAA,EAAO,WAAU;AAAA,EAAoB,IAAI;AAAA,IAAE,IAAI;AAAA,IAAI,IAAI;AAAA,IAAG,OAAO;AAAA,IAAQ,KAAK;AAAA,IAAI,GAAG;AAAA,EAAG;AAAA,EAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,KAAK;AAAA,IAAG;AAAA,IAAjE,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAM,EAAU,CAAA,GAChB,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,OAAO,KAAU,WAChB,gBAAA,EAAC,GAAD;AAAA,MAAG,yBAAyB,EAAE,QAAQ,EAAM;AAAA,MAAG,SAAS;AAAA,IAAU,CAAA,IAElE,GAED,OAAO,KAAW,WAAW,gBAAA,EAAC,GAAD,EAAA,UAAK,EAAW,CAAA,IAAI,CAC7C,EAAA,CAAA,CACF;AAAA,EACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,EAAE;AAAA,IAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,cAAY,CAAC,GAAW,CAAU,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,KAAK;AAAA,MAClE,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAe,CAAC,CAAC;AAAA,MACrE,MAAK;AAAA,MACL,IAAI;AAAA,QACF,SAAS;AAAA,QACT,cAAA;AAAA,QACA,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD,EACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,cAAA;AAAA,QACA,QAAQ;AAAA,QACR,OAAO,GAAG,CAAA;AAAA,MACZ,EACD,CAAA;AAAA,IACI,CAAA,GAEP,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,eAAe;AAAA,QAAO,gBAAgB;AAAA,MAAgB;AAAA,MAAnE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA,EACF,CAAA,CAAA"}
@@ -16,6 +16,11 @@ interface P2PLogoStackProps {
16
16
  shadow?: boolean | 'offset' | 'elevation';
17
17
  /** Overlap px; centred, right-most tile on top. */
18
18
  overlap?: number;
19
+ /**
20
+ * Each tile's drop from the top of the row, keyed by rendered tile count (2, 3, or 4 incl. the "+N"
21
+ * tile), like `MT_OFFSETS`; a count it doesn't name keeps the shared cascade.
22
+ */
23
+ offsets?: CascadeOffsets;
19
24
  /**
20
25
  * Fixed height of the cascading row in px (Figma `Logos` frame: 106). Gives
21
26
  * the staircase `mt` offsets room without collapsing.
@@ -29,10 +34,11 @@ interface P2PLogoStackProps {
29
34
  status?: ReactNode;
30
35
  sx?: SxProps;
31
36
  }
37
+ export type CascadeOffsets = Partial<Record<2 | 3 | 4, number[]>>;
32
38
  /**
33
39
  * A cascading row of shadowed brand tiles with an optional "+N" overflow tile
34
40
  * (Peer-to-Peer Categorization). Layout math ported locally from v1
35
41
  * `shared/P2P/P2PMultipleCategorization`.
36
42
  */
37
- declare const P2PLogoStack: ({ logos, borderColor, overlap, rowHeight, shadow, size, status, total, sx, }: P2PLogoStackProps) => import("react/jsx-runtime").JSX.Element;
43
+ declare const P2PLogoStack: ({ logos, borderColor, offsets: offsetsOverride, overlap, rowHeight, shadow, size, status, total, sx, }: P2PLogoStackProps) => import("react/jsx-runtime").JSX.Element;
38
44
  export default P2PLogoStack;
@@ -1,8 +1,8 @@
1
- import T from "./LogoTile.es.js";
2
- import p from "@mui/material/Stack";
3
- import { Text as k } from "@mxenabled/mxui";
4
- import { jsx as b, jsxs as s } from "react/jsx-runtime";
5
- var j = {
1
+ import b from "./LogoTile.es.js";
2
+ import h from "@mui/material/Stack";
3
+ import { Text as j } from "@mxenabled/mxui";
4
+ import { jsx as y, jsxs as i } from "react/jsx-runtime";
5
+ var C = {
6
6
  2: [0, 36],
7
7
  3: [
8
8
  0,
@@ -15,49 +15,49 @@ var j = {
15
15
  24,
16
16
  36
17
17
  ]
18
- }, F = ({ logos: n, borderColor: h = "background.paper", overlap: l, rowHeight: m = 106, shadow: f = !0, size: g = 64, status: x, total: u, sx: d }) => {
19
- const o = l != null, a = u ?? n.length, e = a >= 4, r = e ? n.slice(0, 3) : n.slice(0, 4), v = j[e ? 4 : Math.min(Math.max(r.length, 2), 3)], S = e ? r.length + 1 : r.length, c = (i, t, w) => /* @__PURE__ */ b(T, {
20
- bgcolor: w,
21
- borderColor: h,
22
- reserveShadowSpace: t === S - 1,
23
- shadow: f,
24
- size: g,
18
+ }, O = ({ logos: n, borderColor: m = "background.paper", offsets: f, overlap: c, rowHeight: g = 106, shadow: x = !0, size: u = 64, status: d, total: v, sx: S }) => {
19
+ const o = c != null, a = v ?? n.length, e = a >= 4, r = e ? n.slice(0, 3) : n.slice(0, 4), l = e ? 4 : Math.min(Math.max(r.length, 2), 3), w = f?.[l] ?? C[l], T = e ? r.length + 1 : r.length, p = (s, t, k) => /* @__PURE__ */ y(b, {
20
+ bgcolor: k,
21
+ borderColor: m,
22
+ reserveShadowSpace: t === T - 1,
23
+ shadow: x,
24
+ size: u,
25
25
  sx: {
26
- mt: `${v?.[t] ?? 0}px`,
26
+ mt: `${w?.[t] ?? 0}px`,
27
27
  ...o && {
28
- ml: t ? `-${l}px` : 0,
28
+ ml: t ? `-${c}px` : 0,
29
29
  position: "relative",
30
30
  zIndex: t + 1
31
31
  }
32
32
  },
33
- children: i
33
+ children: s
34
34
  }, t);
35
- return /* @__PURE__ */ s(p, {
35
+ return /* @__PURE__ */ i(h, {
36
36
  sx: {
37
37
  gap: 12,
38
38
  width: "100%",
39
- ...d
39
+ ...S
40
40
  },
41
- children: [/* @__PURE__ */ s(p, {
41
+ children: [/* @__PURE__ */ i(h, {
42
42
  sx: {
43
43
  flexDirection: "row",
44
44
  gap: o ? 0 : e ? 8 : 24,
45
- height: m,
45
+ height: g,
46
46
  isolation: o ? "isolate" : void 0,
47
47
  justifyContent: o || !e ? "center" : "flex-start"
48
48
  },
49
- children: [r.map((i, t) => c(i, t, "background.paper")), e && c(/* @__PURE__ */ s(k, {
49
+ children: [r.map((s, t) => p(s, t, "background.paper")), e && p(/* @__PURE__ */ i(j, {
50
50
  "aria-label": `+${a - 3} more`,
51
51
  component: "span",
52
52
  sx: { color: "common.white" },
53
53
  variant: "h3",
54
54
  children: ["+", a - 3]
55
55
  }), 3, "grey.800")]
56
- }), x]
56
+ }), d]
57
57
  });
58
58
  };
59
59
  export {
60
- F as default
60
+ O as default
61
61
  };
62
62
 
63
63
  //# sourceMappingURL=P2PLogoStack.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"P2PLogoStack.es.js","names":[],"sources":["../../../src/insights-v2/components/P2PLogoStack.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport LogoTile from './LogoTile'\n\ninterface P2PLogoStackProps {\n /** Brand/merchant logo visuals (rendered as shadowed, cascading tiles). */\n logos: ReactNode[]\n /**\n * Total number of merchants. When it exceeds the rendered logos, the last\n * tile becomes a \"+N\" more indicator. Defaults to `logos.length`.\n */\n total?: number\n /** Tile border token; `null` draws none. */\n borderColor?: string | null\n /** Logo tile size in px (Figma: 64). */\n size?: number\n /** Tile shadow (see `LogoTile`). Default offset. */\n shadow?: boolean | 'offset' | 'elevation'\n /** Overlap px; centred, right-most tile on top. */\n overlap?: number\n /**\n * Fixed height of the cascading row in px (Figma `Logos` frame: 106). Gives\n * the staircase `mt` offsets room without collapsing.\n */\n rowHeight?: number\n /**\n * Optional status element rendered below the logos (Figma: the full-width\n * \"Categorized\" `<StatusPill>` in P2P's categorized state). Pass a\n * `<StatusPill sx={{ alignSelf: 'stretch', justifyContent: 'center' }} />`.\n */\n status?: ReactNode\n sx?: SxProps\n}\n\n// Vertical offsets that produce the diagonal cascade, keyed by tile count.\n// Mirrors the shared P2PMultipleCategorization layout.\nconst MT_OFFSETS: Record<number, number[]> = {\n 2: [0, 36],\n 3: [0, 18, 36],\n 4: [0, 12, 24, 36],\n}\n\n/**\n * A cascading row of shadowed brand tiles with an optional \"+N\" overflow tile\n * (Peer-to-Peer Categorization). Layout math ported locally from v1\n * `shared/P2P/P2PMultipleCategorization`.\n */\nconst P2PLogoStack = ({\n logos,\n borderColor = 'background.paper',\n overlap,\n rowHeight = 106,\n shadow = true,\n size = 64,\n status,\n total,\n sx,\n}: P2PLogoStackProps) => {\n const overlapping = overlap != null\n const merchantCount = total ?? logos.length\n // At 4+ merchants Figma shows 3 logos + a \"+N\" overflow tile (so exactly 4\n // renders as 3 + \"+1\"); below 4, all logos show. Mirrors v1.\n const hasOverflow = merchantCount >= 4\n const tiles = hasOverflow ? logos.slice(0, 3) : logos.slice(0, 4)\n const offsets = MT_OFFSETS[hasOverflow ? 4 : Math.min(Math.max(tiles.length, 2), 3)]\n // Total tiles actually rendered (logos, or 3 logos + the \"+N\" tile).\n const tileCount = hasOverflow ? tiles.length + 1 : tiles.length\n\n // The offset shadow takes no layout space, so interior tiles' shadows fall in\n // the row `gap`; only the LAST tile reserves its shadow footprint, else it\n // overlaps the card padding. (Index key is fine: the list is static.)\n const renderTile = (content: ReactNode, index: number, bgcolor: string) => (\n <LogoTile\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n bgcolor={bgcolor}\n borderColor={borderColor}\n reserveShadowSpace={index === tileCount - 1}\n shadow={shadow}\n size={size}\n sx={{\n mt: `${offsets?.[index] ?? 0}px`,\n ...(overlapping && {\n ml: index ? `-${overlap}px` : 0,\n position: 'relative',\n zIndex: index + 1,\n }),\n }}\n >\n {content}\n </LogoTile>\n )\n\n return (\n <Stack sx={{ gap: 12, width: '100%', ...sx }}>\n {/* Fixed-height row gives the `mt` staircase room to cascade. */}\n <Stack\n sx={{\n flexDirection: 'row',\n gap: overlapping ? 0 : hasOverflow ? 8 : 24,\n height: rowHeight,\n // Contain the overlap z-indexes.\n isolation: overlapping ? 'isolate' : undefined,\n justifyContent: overlapping || !hasOverflow ? 'center' : 'flex-start',\n }}\n >\n {tiles.map((logo, index) => renderTile(logo, index, 'background.paper'))}\n {hasOverflow &&\n renderTile(\n // h3-sized span, not a semantic heading, inside a decorative tile.\n <Text\n aria-label={`+${merchantCount - 3} more`}\n component=\"span\"\n sx={{ color: 'common.white' }}\n variant=\"h3\"\n >\n +{merchantCount - 3}\n </Text>,\n 3,\n 'grey.800',\n )}\n </Stack>\n {status}\n </Stack>\n )\n}\n\nexport default P2PLogoStack\n"],"mappings":";;;;AAyCA,IAAM,IAAuC;AAAA,EAC3C,GAAG,CAAC,GAAG,EAAE;AAAA,EACT,GAAG;AAAA,IAAC;AAAA,IAAG;AAAA,IAAI;AAAA,EAAE;AAAA,EACb,GAAG;AAAA,IAAC;AAAA,IAAG;AAAA,IAAI;AAAA,IAAI;AAAA,EAAE;AACnB,GAOM,IAAA,CAAgB,EACpB,OAAA,GACA,aAAA,IAAc,oBACd,SAAA,GACA,WAAA,IAAY,KACZ,QAAA,IAAS,IACT,MAAA,IAAO,IACP,QAAA,GACA,OAAA,GACA,IAAA,EAAA,MACuB;AACvB,QAAM,IAAc,KAAW,MACzB,IAAgB,KAAS,EAAM,QAG/B,IAAc,KAAiB,GAC/B,IAAQ,IAAc,EAAM,MAAM,GAAG,CAAC,IAAI,EAAM,MAAM,GAAG,CAAC,GAC1D,IAAU,EAAW,IAAc,IAAI,KAAK,IAAI,KAAK,IAAI,EAAM,QAAQ,CAAC,GAAG,CAAC,CAAA,GAE5E,IAAY,IAAc,EAAM,SAAS,IAAI,EAAM,QAKnD,IAAA,CAAc,GAAoB,GAAe,MACrD,gBAAA,EAAC,GAAD;AAAA,IAGW,SAAA;AAAA,IACI,aAAA;AAAA,IACb,oBAAoB,MAAU,IAAY;AAAA,IAClC,QAAA;AAAA,IACF,MAAA;AAAA,IACN,IAAI;AAAA,MACF,IAAI,GAAG,IAAU,CAAA,KAAU,CAAA;AAAA,MAC3B,GAAI,KAAe;AAAA,QACjB,IAAI,IAAQ,IAAI,CAAA,OAAc;AAAA,QAC9B,UAAU;AAAA,QACV,QAAQ,IAAQ;AAAA,MAClB;AAAA,IACF;AAAA,IAEC,UAAA;AAAA,EACO,GAhBH,CAgBG;AAGZ,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,OAAO;AAAA,MAAQ,GAAG;AAAA,IAAG;AAAA,IAA3C,UAAA,CAEE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,eAAe;AAAA,QACf,KAAK,IAAc,IAAI,IAAc,IAAI;AAAA,QACzC,QAAQ;AAAA,QAER,WAAW,IAAc,YAAY;AAAA,QACrC,gBAAgB,KAAe,CAAC,IAAc,WAAW;AAAA,MAC3D;AAAA,MARF,UAAA,CAUG,EAAM,IAAA,CAAK,GAAM,MAAU,EAAW,GAAM,GAAO,kBAAkB,CAAC,GACtE,KACC,EAEE,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,IAAI,IAAgB,CAAA;AAAA,QAChC,WAAU;AAAA,QACV,IAAI,EAAE,OAAO,eAAe;AAAA,QAC5B,SAAQ;AAAA,QAJV,UAAA,CAKC,KACG,IAAgB,CACd;AAAA,MACN,CAAA,GAAA,GACA,UACF,CACG;AAAA,IACN,CAAA,GAAA,CACI;AAAA;AAEX"}
1
+ {"version":3,"file":"P2PLogoStack.es.js","names":[],"sources":["../../../src/insights-v2/components/P2PLogoStack.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport LogoTile from './LogoTile'\n\ninterface P2PLogoStackProps {\n /** Brand/merchant logo visuals (rendered as shadowed, cascading tiles). */\n logos: ReactNode[]\n /**\n * Total number of merchants. When it exceeds the rendered logos, the last\n * tile becomes a \"+N\" more indicator. Defaults to `logos.length`.\n */\n total?: number\n /** Tile border token; `null` draws none. */\n borderColor?: string | null\n /** Logo tile size in px (Figma: 64). */\n size?: number\n /** Tile shadow (see `LogoTile`). Default offset. */\n shadow?: boolean | 'offset' | 'elevation'\n /** Overlap px; centred, right-most tile on top. */\n overlap?: number\n /**\n * Each tile's drop from the top of the row, keyed by rendered tile count (2, 3, or 4 incl. the \"+N\"\n * tile), like `MT_OFFSETS`; a count it doesn't name keeps the shared cascade.\n */\n offsets?: CascadeOffsets\n /**\n * Fixed height of the cascading row in px (Figma `Logos` frame: 106). Gives\n * the staircase `mt` offsets room without collapsing.\n */\n rowHeight?: number\n /**\n * Optional status element rendered below the logos (Figma: the full-width\n * \"Categorized\" `<StatusPill>` in P2P's categorized state). Pass a\n * `<StatusPill sx={{ alignSelf: 'stretch', justifyContent: 'center' }} />`.\n */\n status?: ReactNode\n sx?: SxProps\n}\n\nexport type CascadeOffsets = Partial<Record<2 | 3 | 4, number[]>>\n\n// Vertical offsets that produce the diagonal cascade, keyed by tile count.\n// Mirrors the shared P2PMultipleCategorization layout.\nconst MT_OFFSETS: Record<2 | 3 | 4, number[]> = {\n 2: [0, 36],\n 3: [0, 18, 36],\n 4: [0, 12, 24, 36],\n}\n\n/**\n * A cascading row of shadowed brand tiles with an optional \"+N\" overflow tile\n * (Peer-to-Peer Categorization). Layout math ported locally from v1\n * `shared/P2P/P2PMultipleCategorization`.\n */\nconst P2PLogoStack = ({\n logos,\n borderColor = 'background.paper',\n offsets: offsetsOverride,\n overlap,\n rowHeight = 106,\n shadow = true,\n size = 64,\n status,\n total,\n sx,\n}: P2PLogoStackProps) => {\n const overlapping = overlap != null\n const merchantCount = total ?? logos.length\n // At 4+ merchants Figma shows 3 logos + a \"+N\" overflow tile (so exactly 4\n // renders as 3 + \"+1\"); below 4, all logos show. Mirrors v1.\n const hasOverflow = merchantCount >= 4\n const tiles = hasOverflow ? logos.slice(0, 3) : logos.slice(0, 4)\n const offsetKey = (hasOverflow ? 4 : Math.min(Math.max(tiles.length, 2), 3)) as 2 | 3 | 4\n const offsets = offsetsOverride?.[offsetKey] ?? MT_OFFSETS[offsetKey]\n // Total tiles actually rendered (logos, or 3 logos + the \"+N\" tile).\n const tileCount = hasOverflow ? tiles.length + 1 : tiles.length\n\n // The offset shadow takes no layout space, so interior tiles' shadows fall in\n // the row `gap`; only the LAST tile reserves its shadow footprint, else it\n // overlaps the card padding. (Index key is fine: the list is static.)\n const renderTile = (content: ReactNode, index: number, bgcolor: string) => (\n <LogoTile\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n bgcolor={bgcolor}\n borderColor={borderColor}\n reserveShadowSpace={index === tileCount - 1}\n shadow={shadow}\n size={size}\n sx={{\n mt: `${offsets?.[index] ?? 0}px`,\n ...(overlapping && {\n ml: index ? `-${overlap}px` : 0,\n position: 'relative',\n zIndex: index + 1,\n }),\n }}\n >\n {content}\n </LogoTile>\n )\n\n return (\n <Stack sx={{ gap: 12, width: '100%', ...sx }}>\n {/* Fixed-height row gives the `mt` staircase room to cascade. */}\n <Stack\n sx={{\n flexDirection: 'row',\n gap: overlapping ? 0 : hasOverflow ? 8 : 24,\n height: rowHeight,\n // Contain the overlap z-indexes.\n isolation: overlapping ? 'isolate' : undefined,\n justifyContent: overlapping || !hasOverflow ? 'center' : 'flex-start',\n }}\n >\n {tiles.map((logo, index) => renderTile(logo, index, 'background.paper'))}\n {hasOverflow &&\n renderTile(\n // h3-sized span, not a semantic heading, inside a decorative tile.\n <Text\n aria-label={`+${merchantCount - 3} more`}\n component=\"span\"\n sx={{ color: 'common.white' }}\n variant=\"h3\"\n >\n +{merchantCount - 3}\n </Text>,\n 3,\n 'grey.800',\n )}\n </Stack>\n {status}\n </Stack>\n )\n}\n\nexport default P2PLogoStack\n"],"mappings":";;;;AAgDA,IAAM,IAA0C;AAAA,EAC9C,GAAG,CAAC,GAAG,EAAE;AAAA,EACT,GAAG;AAAA,IAAC;AAAA,IAAG;AAAA,IAAI;AAAA,EAAE;AAAA,EACb,GAAG;AAAA,IAAC;AAAA,IAAG;AAAA,IAAI;AAAA,IAAI;AAAA,EAAE;AACnB,GAOM,IAAA,CAAgB,EACpB,OAAA,GACA,aAAA,IAAc,oBACd,SAAS,GACT,SAAA,GACA,WAAA,IAAY,KACZ,QAAA,IAAS,IACT,MAAA,IAAO,IACP,QAAA,GACA,OAAA,GACA,IAAA,EAAA,MACuB;AACvB,QAAM,IAAc,KAAW,MACzB,IAAgB,KAAS,EAAM,QAG/B,IAAc,KAAiB,GAC/B,IAAQ,IAAc,EAAM,MAAM,GAAG,CAAC,IAAI,EAAM,MAAM,GAAG,CAAC,GAC1D,IAAa,IAAc,IAAI,KAAK,IAAI,KAAK,IAAI,EAAM,QAAQ,CAAC,GAAG,CAAC,GACpE,IAAU,IAAkB,CAAA,KAAc,EAAW,CAAA,GAErD,IAAY,IAAc,EAAM,SAAS,IAAI,EAAM,QAKnD,IAAA,CAAc,GAAoB,GAAe,MACrD,gBAAA,EAAC,GAAD;AAAA,IAGW,SAAA;AAAA,IACI,aAAA;AAAA,IACb,oBAAoB,MAAU,IAAY;AAAA,IAClC,QAAA;AAAA,IACF,MAAA;AAAA,IACN,IAAI;AAAA,MACF,IAAI,GAAG,IAAU,CAAA,KAAU,CAAA;AAAA,MAC3B,GAAI,KAAe;AAAA,QACjB,IAAI,IAAQ,IAAI,CAAA,OAAc;AAAA,QAC9B,UAAU;AAAA,QACV,QAAQ,IAAQ;AAAA,MAClB;AAAA,IACF;AAAA,IAEC,UAAA;AAAA,EACO,GAhBH,CAgBG;AAGZ,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,OAAO;AAAA,MAAQ,GAAG;AAAA,IAAG;AAAA,IAA3C,UAAA,CAEE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,eAAe;AAAA,QACf,KAAK,IAAc,IAAI,IAAc,IAAI;AAAA,QACzC,QAAQ;AAAA,QAER,WAAW,IAAc,YAAY;AAAA,QACrC,gBAAgB,KAAe,CAAC,IAAc,WAAW;AAAA,MAC3D;AAAA,MARF,UAAA,CAUG,EAAM,IAAA,CAAK,GAAM,MAAU,EAAW,GAAM,GAAO,kBAAkB,CAAC,GACtE,KACC,EAEE,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,IAAI,IAAgB,CAAA;AAAA,QAChC,WAAU;AAAA,QACV,IAAI,EAAE,OAAO,eAAe;AAAA,QAC5B,SAAQ;AAAA,QAJV,UAAA,CAKC,KACG,IAAgB,CACd;AAAA,MACN,CAAA,GAAA,GACA,UACF,CACG;AAAA,IACN,CAAA,GAAA,CACI;AAAA;AAEX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.171",
3
+ "version": "9.7.172-alpha-harini-cb",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,8 +0,0 @@
1
- var _ = /* @__PURE__ */ (function(E) {
2
- return E.LOW_BUDGET_TIER = "LOW", E.MEDIUM_BUDGET_TIER = "MEDIUM", E.OFF_TRACK_BUDGET_TIER = "OFF_TRACK", E;
3
- })({});
4
- export {
5
- _ as BudgetTierType
6
- };
7
-
8
- //# sourceMappingURL=InsightsInstanceSlotData.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends, LogoRef } from '../../core'\n\nexport interface InsightsInstanceSlotData\n extends\n Partial<BudgetBlockData>,\n Partial<DonutChartBlockData>,\n Partial<ImageBlockData>,\n Partial<AccountBlockData>,\n Partial<SaveExtraBlockData>,\n Partial<StepChartBlockData>,\n Partial<SVGImageBlockData>,\n Partial<AccountSwitchBlockData>,\n Partial<TransactionDetailsBlockData>,\n Partial<CreditUtilizationBlockData>,\n Partial<MerchantBlockData>,\n Partial<CommonProps> {}\n\n//when any of the type is used more than one times, we can use the common props\ninterface CommonProps {\n amount?: number\n ariaLabel?: string\n date?: string\n legends?: Legends[]\n category_guid?: string\n data_series?: DataSeries | DataSet[]\n transaction_guids?: string[]\n account_guids?: string[]\n primary_transaction_guid?: string\n}\n\n//BarChart Block: `instance_slot.data` (Insights 2.0)\nexport interface BarChartBlockData {\n series?: DataSeries\n category_guid?: string\n average_amount?: number\n /** [0] monthly amount, [1] trend. */\n additional_data?: Legends[]\n}\n\n//DonutChart Block: `instance_slot.data` (Insights 2.0) — the same shape V1 sent as `instance_slot_data`.\n/** The donut's centre: the total and its caption (\"$6,306\" / \"Total\"). */\nexport interface DonutChartMain {\n value: string | number\n value_type: string\n label: string\n /** The embedded donut's shorter caption (Credit Card Close to Limit: \"Remains\"). */\n compact_label?: string\n}\nexport interface DonutChartBlockData {\n main: DonutChartMain\n /** The category whose colour fills the primary slice (Cost of Living to Income: Housing). */\n category_guid?: string\n /** Legend rows beside the donut: a label, its amount and an optional share (\"$5,550.00 (88%)\"). */\n legends?: Legends[]\n}\n\n//DoubleBarChart Block\n// TODO : This has to be revisited again to update the below types based on API response once we have the final shape of the data_series for double bar chart from BE\nexport interface LegendProps extends Legends {\n amount: number\n formattedAmount: string\n label: string\n color?: string\n}\n\nexport interface DataSet extends DataSeries {\n ariaLabelComparison: string\n ariaLabelMain: string\n comparison: number\n // The comparison bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n comparisonGuids?: string[]\n // The month's 'yyyy-MM-dd' date (the main row's).\n date?: string\n formattedComparison: string\n formattedMain: string\n label: string\n main: number\n // The main bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n mainGuids?: string[]\n}\n\n//DoubleProgressBar Block\n\n//Image Block\nexport interface ImageBlockData {\n image: string\n}\n\n//Account Block\nexport interface AccountBlockData {\n sub_text: string\n institution_guid?: string\n institution_name?: string\n icon_name?: string\n /** Header bar text (standard card), or the colored category strip label (deposit cards). */\n header_text?: string\n // Deposit variants (Unified Deposit, Unified Deposit Emergency Fund, Savings Account Deposit)\n /** Merchant guid — renders a real merchant logo in the deposit card when present. */\n merchant_guid?: string\n /** Merchant display name — logo alt text and the payer line under the amount. */\n merchant_name?: string\n /** Secondary label beside the amount, e.g. `On {date}, you saved` or `Balance as of MM/DD/YY`. */\n label?: string\n}\n\nexport interface SaveExtraBlockData {\n /** Styled segments `[lead-in, amount digits, trailing copy]`, e.g. `['Save an extra', '100', 'to help your funds grow']`. */\n primary_text?: string[]\n /** Styled segments `[projected balance, caption]`, e.g. `['$8,313.87', 'After payday & projected expenses']`. */\n secondary_text?: string[]\n /** MakeTransfer drilldown: available balance (both variants). */\n available_balance?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: average monthly spend. */\n avg_monthly_spend?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: how long the balance lasts, overlaid on the timeline SVG (e.g. \"2 months, 11 days\"). */\n time_period?: string\n /** SAVE_AN_EXTRA_100: upcoming expenses (the \"Expenses\" figure). */\n upcoming_expenses?: number\n /** SAVE_AN_EXTRA_100: total remaining after expenses. */\n total_remaining?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: date for the \"Your available balances as of {date}\" line. */\n date?: string\n}\n\n// AccountSwitch Block. State comes from `instance_slot.variant`, not a data flag.\nexport interface AccountSwitchBlockData {\n discovered_institution_guid: string\n discovered_institution_name: string\n held_institution_guid: string\n held_institution_name: string\n}\n\n// AccountSwitch Block: `instance_slot.data` (Insights 2.0, Discovered Accounts V2). Each slot is\n// optional: tupac omits `to_logo` when the user holds no FI-managed account. `logo` is the compact\n// card's (micro, notification) discovered institution.\nexport interface AccountSwitchBlockV2Data {\n from_logo?: LogoRef\n to_logo?: LogoRef\n logo?: LogoRef\n}\n\n// StepChart Block\nexport interface StepChartBlockData {\n completed_steps: number\n label_1: string\n label_2?: string\n}\n\n//Budgets Blocks\nexport enum BudgetTierType {\n LOW_BUDGET_TIER = 'LOW',\n MEDIUM_BUDGET_TIER = 'MEDIUM',\n OFF_TRACK_BUDGET_TIER = 'OFF_TRACK',\n}\n\nexport type BudgetTierValue = `${BudgetTierType}`\n\nexport interface BudgetLocalizedPayload {\n primary_text?: string\n amount_left_label?: string\n spent_label?: string\n budgeted_label?: string\n}\n\nexport interface BudgetBlockData {\n budget_percent: number\n budget_tier: BudgetTierValue\n category_guid?: string\n merchant_guid?: string\n spent_amount: number\n budgeted_amount: number\n localized_payload: BudgetLocalizedPayload\n}\n\nexport interface SVGImageBlockData {\n isCIBC?: boolean\n}\n\n// TransactionDetails Action Block\n// The drawer's subject is `InsightsPayload.primary_transaction_guid`; only action configuration\n// lives here.\nexport interface TransactionDetailsBlockData {\n /** `TopActions` member names, e.g. `['Category', 'Date', 'Memo']`. Omit for the defaults. */\n top_actions?: string[]\n /** `BottomActions` member names, e.g. `['MerchantBudget', 'HideTransaction']`. Omit for defaults. */\n bottom_actions?: string[]\n}\n\n// Credit Utilization action block. The per-card rows are the beat's `data_series` table\n// (`guid`, `label`, `amount`, `total_amount`, `percentage`), carried on `CommonProps.data_series`.\nexport interface CreditUtilizationBlockData {\n accounts_balance_sum?: number\n accounts_credit_limit_sum?: number\n credit_utilization_percentage?: number\n}\n\n// Merchant block `instance_slot.data`; `primary_text` is ditto's name.\nexport interface MerchantBlockData {\n merchant_name?: string\n logo?: LogoRef\n amount?: number\n /** Pre-localized eyebrow; ditto sends `header_text`. */\n date?: string\n header_text?: string\n status_text?: string\n logos?: LogoRef[]\n}\n"],"mappings":"AAqJA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
@@ -1,7 +0,0 @@
1
- import { BudgetTierValue } from '../../../../core/types/InsightsInstanceSlotData';
2
- export declare const BUDGET_STATUS_COLORS_MAP: {
3
- LOW: string;
4
- MEDIUM: string;
5
- OFF_TRACK: string;
6
- };
7
- export declare const getColorByBudgetTier: (budgetTier: BudgetTierValue) => string;
@@ -1,12 +0,0 @@
1
- import { BudgetTierType as T } from "../../../../core/types/InsightsInstanceSlotData.es.js";
2
- var _ = {
3
- [T.LOW_BUDGET_TIER]: "success.main",
4
- [T.MEDIUM_BUDGET_TIER]: "warning.main",
5
- [T.OFF_TRACK_BUDGET_TIER]: "error.main"
6
- }, E = (r) => _[r];
7
- export {
8
- _ as BUDGET_STATUS_COLORS_MAP,
9
- E as getColorByBudgetTier
10
- };
11
-
12
- //# sourceMappingURL=util.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.ts"],"sourcesContent":["import {\n BudgetTierType,\n type BudgetTierValue,\n} from '../../../../core/types/InsightsInstanceSlotData'\n\nexport const BUDGET_STATUS_COLORS_MAP = {\n [BudgetTierType.LOW_BUDGET_TIER]: 'success.main',\n [BudgetTierType.MEDIUM_BUDGET_TIER]: 'warning.main',\n [BudgetTierType.OFF_TRACK_BUDGET_TIER]: 'error.main',\n}\n\nexport const getColorByBudgetTier = (budgetTier: BudgetTierValue) =>\n BUDGET_STATUS_COLORS_MAP[budgetTier]\n"],"mappings":";AAKA,IAAa,IAA2B;AAAA,EACrC,CAAA,EAAe,eAAA,GAAkB;AAAA,EACjC,CAAA,EAAe,kBAAA,GAAqB;AAAA,EACpC,CAAA,EAAe,qBAAA,GAAwB;AAC1C,GAEa,IAAA,CAAwB,MACnC,EAAyB,CAAA"}