@mx-cartographer/experiences 9.7.57 → 9.7.58

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 (28) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/core/types/InsightsInstanceSlotData.d.ts +2 -1
  3. package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
  4. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +93 -53
  5. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
  6. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +20 -20
  7. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +48 -39
  8. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
  9. package/dist/insights-v2/components/LogoClusterCard.d.ts +7 -1
  10. package/dist/insights-v2/components/LogoClusterCard.es.js +54 -48
  11. package/dist/insights-v2/components/LogoClusterCard.es.js.map +1 -1
  12. package/dist/insights-v2/components/LogoTile.d.ts +6 -4
  13. package/dist/insights-v2/components/LogoTile.es.js +21 -19
  14. package/dist/insights-v2/components/LogoTile.es.js.map +1 -1
  15. package/dist/insights-v2/components/MerchantHighlightCard.d.ts +8 -3
  16. package/dist/insights-v2/components/MerchantHighlightCard.es.js +24 -21
  17. package/dist/insights-v2/components/MerchantHighlightCard.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 +34 -26
  20. package/dist/insights-v2/components/P2PLogoStack.es.js.map +1 -1
  21. package/dist/insights-v2/components/celebrationGradients.d.ts +6 -3
  22. package/dist/insights-v2/components/celebrationGradients.es.js +8 -7
  23. package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
  24. package/dist/insights-v2/components/statusTokens.d.ts +0 -5
  25. package/dist/insights-v2/components/statusTokens.es.js +0 -5
  26. package/dist/insights-v2/components/statusTokens.es.js.map +1 -1
  27. package/dist/insights-v2/index.es.js +75 -75
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [9.7.58] - 10-28-2026
2
+
3
+ - **CHANGED** - `merchant_block` adds the `highlight`, `single_subscription`, `multiple_subscription` and `multiple_badged` variants, matches the rest to Figma, and removes `single_large`, `single_error` and `multiple_error` (MEW2-3372)
4
+
1
5
  ## [9.7.57] - 10-28-2026
2
6
 
3
7
  - **CHANGED** - The Upcoming Bill "View Details" drawer (`transaction_history_block` / `upcoming_bill`) reads its facts from the envelope's `drilldown_data` instead of `instance_slot.data`, which fixes its empty chart: `transaction_guids` select the paid bills, `due_date` (YYYY-MM-DD) and `amount` add the projected bar last, `category_guid` colours the bars and `average_amount` is the Trend legend. The source is the registry entry's new optional `slotData` resolver (`resolveUpcomingBillSlotData`); every other drilldown variant still reads `instance_slot.data`. Each fact is narrowed and fails closed: a missing or mistyped due date, amount or `transaction_guids` draws no chart and lists no rows, while a missing average or category only drops the Trend figure or the category colour (WEC-1962)
@@ -135,8 +135,9 @@ export interface MerchantBlockData {
135
135
  merchant_name?: string;
136
136
  logo?: LogoRef;
137
137
  amount?: number;
138
- /** Pre-localized eyebrow above the name (New Merchant's date). */
138
+ /** Pre-localized eyebrow; ditto sends `header_text`. */
139
139
  date?: string;
140
+ header_text?: string;
140
141
  status_text?: string;
141
142
  logos?: LogoRef[];
142
143
  }
@@ -1 +1 @@
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\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\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` (Insights 2.0). `single_*` variants read one merchant;\n// `multiple_*` read `logos`. `status_text` is the pill label on the `*_success` / `*_error` variants.\nexport interface MerchantBlockData {\n merchant_name?: string\n logo?: LogoRef\n amount?: number\n /** Pre-localized eyebrow above the name (New Merchant's date). */\n date?: string\n status_text?: string\n logos?: LogoRef[]\n}\n"],"mappings":"AA8IA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
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\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\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":"AA8IA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
@@ -1,74 +1,114 @@
1
1
  import { slot as s } from "../../../../core/types/Insights.es.js";
2
- import { formatCurrency as L } from "../../../../core/utils/NumberFormatting.es.js";
3
- import S from "../../../components/StatusPill.es.js";
4
- import _, { isLogoGuid as C } from "../../../components/LogoFromGuid.es.js";
5
- import { resolveVariantConfig as k } from "../../resolveVariantConfig.es.js";
6
- import x from "../../../components/LogoClusterCard.es.js";
7
- import y from "../../../components/MerchantHighlightCard.es.js";
8
- import { MERCHANT_LAYOUT as A, STATUS_PILL_TOKENS as E, merchantBlockVariant as I } from "./layout.es.js";
9
- import { Icon as b } from "@mxenabled/mx-icons";
2
+ import { formatCurrency as A } from "../../../../core/utils/NumberFormatting.es.js";
3
+ import L from "../../../components/StatusPill.es.js";
4
+ import v, { isLogoGuid as S } from "../../../components/LogoFromGuid.es.js";
5
+ import { resolveVariantConfig as x } from "../../resolveVariantConfig.es.js";
6
+ import O from "../../../components/LogoClusterCard.es.js";
7
+ import E from "../../../components/MerchantHighlightCard.es.js";
8
+ import B from "../../../components/P2PLogoStack.es.js";
9
+ import { MERCHANT_LAYOUT as N, merchantBlockVariant as R } from "./layout.es.js";
10
+ import w from "@mui/material/Stack";
11
+ import { Icon as _ } from "@mxenabled/mx-icons";
10
12
  import { jsx as e } from "react/jsx-runtime";
11
- var O = 64, T = 72, G = 32, d = (r) => typeof r == "string" ? r : void 0, h = /* @__PURE__ */ e(b, {
13
+ var u = 64, p = 6, z = 72, G = 3, M = [
14
+ 10,
15
+ 20,
16
+ 35
17
+ ], F = 32, i = (t) => typeof t == "string" ? t : void 0, g = (t) => {
18
+ if (!t || typeof t != "object" || Array.isArray(t)) return;
19
+ const { alt: a, color: r, fallback_guid: o, guid: n } = t;
20
+ if (!(typeof n != "string" || !S(n)))
21
+ return {
22
+ alt: i(a),
23
+ color: i(r),
24
+ fallback_guid: i(o),
25
+ guid: n
26
+ };
27
+ }, I = (t) => {
28
+ if (!Array.isArray(t)) return [];
29
+ const a = /* @__PURE__ */ new Map();
30
+ for (const r of t.map(g)) r?.guid && !a.has(r.guid) && a.set(r.guid, r);
31
+ return [...a.values()];
32
+ }, y = /* @__PURE__ */ e(_, {
12
33
  "aria-hidden": !0,
13
34
  "data-icon": "storefront",
14
35
  name: "storefront",
15
- size: G,
36
+ size: F,
16
37
  sx: { color: "text.secondary" }
17
- }), N = (r) => {
18
- if (!Array.isArray(r)) return [];
19
- const o = /* @__PURE__ */ new Set();
20
- return r.filter((t) => !C(t?.guid) || o.has(t.guid) ? !1 : (o.add(t.guid), !0));
21
- }, H = ({ payload: r }) => {
22
- const { instance_slot: o } = r, { data: t } = o, a = k(A, o.variant, I.SingleStandard, "MerchantBlock"), l = (i) => s(t, i) ?? o[i], m = d(l("status_text")), n = a.status ? E[a.status] : void 0, g = n && m ? /* @__PURE__ */ e(S, {
23
- bgcolor: n.bgcolor,
24
- borderColor: n.borderColor,
25
- icon: /* @__PURE__ */ e(b, {
38
+ }), k = (t, a) => t.length ? t.map((r) => /* @__PURE__ */ e(v, {
39
+ logo: r,
40
+ size: a
41
+ }, r.guid)) : [y], J = ({ payload: t }) => {
42
+ const { instance_slot: a } = t, { data: r } = a, o = x(N, a.variant, R.SingleStandard, "MerchantBlock"), n = (l) => s(r, l) ?? a[l], m = i(n("status_text")), f = o.status && m ? /* @__PURE__ */ e(L, {
43
+ icon: /* @__PURE__ */ e(_, {
26
44
  "aria-hidden": !0,
27
- "data-icon": n.icon,
28
- name: n.icon,
45
+ "data-icon": "check_circle",
46
+ fill: !0,
47
+ name: "check_circle",
29
48
  size: 16,
30
- sx: { color: n.borderColor }
49
+ sx: { color: "success.700" }
31
50
  }),
32
51
  label: m,
33
- labelColor: n.textColor,
34
- sx: a.kind === "multiple" ? {
52
+ sx: o.kind === "single" ? void 0 : {
35
53
  alignSelf: "stretch",
36
54
  justifyContent: "center"
37
- } : void 0
55
+ }
38
56
  }) : void 0;
39
- if (a.kind === "multiple") {
40
- const i = N(s(t, "logos"));
41
- return /* @__PURE__ */ e(x, {
42
- background: a.background,
43
- footer: g,
44
- logos: i.length ? i.map((p) => /* @__PURE__ */ e(_, {
45
- logo: p,
46
- size: T
47
- }, p.guid)) : [h]
57
+ if (o.kind !== "single") {
58
+ const l = I(s(r, "logos"));
59
+ return o.kind === "ranked" && l.length ? /* @__PURE__ */ e(O, {
60
+ background: o.background,
61
+ fullBleed: !0,
62
+ logos: k(l.slice(0, G), z),
63
+ overlap: p,
64
+ rankOffsets: M,
65
+ ranked: !0
66
+ }) : /* @__PURE__ */ e(w, {
67
+ sx: {
68
+ background: o.background,
69
+ bgcolor: o.background ? void 0 : o.bgcolor,
70
+ p: 16,
71
+ width: "100%"
72
+ },
73
+ children: /* @__PURE__ */ e(B, {
74
+ borderColor: null,
75
+ logos: k(l, u),
76
+ overlap: p,
77
+ shadow: "elevation",
78
+ size: u,
79
+ status: f
80
+ })
48
81
  });
49
82
  }
50
- const u = d(l("merchant_name"));
51
- if (!u) return null;
52
- const c = l("amount"), v = d(s(t, "date")), f = s(t, "logo") ?? (o.merchant_guid ? {
53
- alt: u,
54
- fallback_guid: o.category_guid,
55
- guid: o.merchant_guid
56
- } : void 0);
57
- return /* @__PURE__ */ e(y, {
58
- amount: typeof c == "number" && c !== 0 ? L(c, "0,0.00") : void 0,
59
- amountVariant: a.amountVariant,
60
- background: a.background,
61
- eyebrow: v,
62
- logo: C(f?.guid) ? /* @__PURE__ */ e(_, {
63
- logo: f,
64
- size: O
65
- }) : h,
66
- name: u,
67
- trailing: g
83
+ const d = i(s(r, "primary_text")) || i(n("merchant_name"));
84
+ if (!d) return null;
85
+ const c = n("amount"), C = i(s(r, "header_text")) || i(s(r, "date")), b = g(s(r, "logo")) ?? g({
86
+ alt: d,
87
+ fallback_guid: a.category_guid,
88
+ guid: a.merchant_guid
89
+ }), h = o.logo?.size ?? u;
90
+ return /* @__PURE__ */ e(E, {
91
+ amount: typeof c == "number" && Number.isFinite(c) && c !== 0 ? A(c, "0,0.00") : void 0,
92
+ amountVariant: o.amountVariant,
93
+ background: o.background,
94
+ bgcolor: o.bgcolor,
95
+ borderColor: o.borderColor,
96
+ eyebrow: o.hideDate ? void 0 : C,
97
+ fullBleed: o.fullBleed,
98
+ logo: b ? /* @__PURE__ */ e(v, {
99
+ logo: b,
100
+ size: h
101
+ }) : y,
102
+ logoBorderColor: o.logo?.borderColor,
103
+ logoRadius: o.logo?.radius,
104
+ logoShadow: o.logo?.shadow,
105
+ logoSize: h,
106
+ name: d,
107
+ trailing: f
68
108
  });
69
109
  };
70
110
  export {
71
- H as default
111
+ J as default
72
112
  };
73
113
 
74
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 { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type InstanceSlot, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoClusterCard from '../../../components/LogoClusterCard'\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport MerchantHighlightCard from '../../../components/MerchantHighlightCard'\nimport StatusPill from '../../../components/StatusPill'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { MERCHANT_LAYOUT, merchantBlockVariant, STATUS_PILL_TOKENS } from './layout'\n\ninterface MerchantBlockProps {\n payload: InsightsPayload\n}\n\nconst SINGLE_LOGO_SIZE = 64\nconst CLUSTER_LOGO_SIZE = 72\nconst FALLBACK_ICON_SIZE = 32\n\nconst text = (v: unknown) => (typeof v === 'string' ? v : undefined)\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 uniqueLogos = (refs: unknown): LogoRef[] => {\n if (!Array.isArray(refs)) return []\n const seen = new Set<string>()\n return refs.filter((ref: LogoRef | null | undefined): ref is LogoRef => {\n if (!isLogoGuid(ref?.guid) || seen.has(ref.guid)) return false\n seen.add(ref.guid)\n return true\n })\n}\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 field = <K extends keyof InstanceSlot>(key: K) =>\n slot<InstanceSlot[K]>(data, key) ?? instance_slot[key]\n\n const statusText = text(field('status_text'))\n const tokens = config.status ? STATUS_PILL_TOKENS[config.status] : undefined\n const statusPill =\n tokens && statusText ? (\n <StatusPill\n bgcolor={tokens.bgcolor}\n borderColor={tokens.borderColor}\n icon={\n <Icon\n aria-hidden={true}\n data-icon={tokens.icon}\n name={tokens.icon}\n size={16}\n sx={{ color: tokens.borderColor }}\n />\n }\n label={statusText}\n labelColor={tokens.textColor}\n sx={\n config.kind === 'multiple'\n ? { alignSelf: 'stretch', justifyContent: 'center' }\n : undefined\n }\n />\n ) : undefined\n\n if (config.kind === 'multiple') {\n const logos = uniqueLogos(slot<MerchantBlockData['logos']>(data, 'logos'))\n\n return (\n <LogoClusterCard\n background={config.background}\n footer={statusPill}\n logos={\n logos.length\n ? logos.map((ref) => (\n <LogoFromGuid key={ref.guid} logo={ref} size={CLUSTER_LOGO_SIZE} />\n ))\n : [storefront]\n }\n />\n )\n }\n\n const merchantName = text(field('merchant_name'))\n if (!merchantName) return null\n\n const amount = field('amount')\n const date = text(slot<unknown>(data, 'date'))\n const logo =\n slot<LogoRef>(data, 'logo') ??\n (instance_slot.merchant_guid\n ? {\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n }\n : undefined)\n\n return (\n <MerchantHighlightCard\n amount={\n typeof amount === 'number' && amount !== 0 ? formatCurrency(amount, '0,0.00') : undefined\n }\n amountVariant={config.amountVariant}\n background={config.background}\n eyebrow={date}\n logo={\n isLogoGuid(logo?.guid) ? <LogoFromGuid logo={logo} size={SINGLE_LOGO_SIZE} /> : storefront\n }\n name={merchantName}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":";;;;;;;;;;AAkBA,IAAM,IAAmB,IACnB,IAAoB,IACpB,IAAqB,IAErB,IAAA,CAAQ,MAAgB,OAAO,KAAM,WAAW,IAAI,QAEpD,IACJ,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACb,aAAU;AAAA,EACV,MAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI,EAAE,OAAO,iBAAiB;AAC/B,CAA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AAAA,QAAK,MAAM;AAAA,MAAoB,GAA/C,EAAI,IAA2C,CACnE,IACD,CAAC,CAAU;AAAA,IAElB,CAAA;AAAA,EAEL;AAEA,QAAM,IAAe,EAAK,EAAM,eAAe,CAAC;AAChD,MAAI,CAAC,EAAc,QAAO;AAE1B,QAAM,IAAS,EAAM,QAAQ,GACvB,IAAO,EAAK,EAAc,GAAM,MAAM,CAAC,GACvC,IACJ,EAAc,GAAM,MAAM,MACzB,EAAc,gBACX;AAAA,IACE,KAAK;AAAA,IACL,eAAe,EAAc;AAAA,IAC7B,MAAM,EAAc;AAAA,EACtB,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,QACE,OAAO,KAAW,YAAY,MAAW,IAAI,EAAe,GAAQ,QAAQ,IAAI;AAAA,IAElF,eAAe,EAAO;AAAA,IACtB,YAAY,EAAO;AAAA,IACnB,SAAS;AAAA,IACT,MACE,EAAW,GAAM,IAAI,IAAI,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAmB,CAAA,IAAI;AAAA,IAElF,MAAM;AAAA,IACN,UAAU;AAAA,EACX,CAAA;AAEL"}
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 InstanceSlot, type LogoRef } from '../../../../core'\nimport type { MerchantBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { 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'\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\nconst text = (v: unknown) => (typeof v === 'string' ? v : undefined)\n\n/** A logo-guid object as a `LogoRef`, else undefined. */\nconst asLogoRef = (value: unknown): LogoRef | undefined => {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined\n const { alt, color, fallback_guid, guid } = value as Record<string, unknown>\n if (typeof guid !== 'string' || !isLogoGuid(guid)) return undefined\n return { alt: text(alt), color: text(color), fallback_guid: text(fallback_guid), guid }\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(asLogoRef)) {\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 field = <K extends keyof InstanceSlot>(key: K) =>\n slot<InstanceSlot[K]>(data, key) ?? instance_slot[key]\n\n const statusText = text(field('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 = text(slot<unknown>(data, 'primary_text')) || text(field('merchant_name'))\n if (!merchantName) return null\n\n const amount = field('amount')\n const date = text(slot<unknown>(data, 'header_text')) || text(slot<unknown>(data, 'date'))\n const logo =\n asLogoRef(slot<unknown>(data, 'logo')) ??\n asLogoRef({\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 typeof amount === 'number' && Number.isFinite(amount) && amount !== 0\n ? formatCurrency(amount, '0,0.00')\n : undefined\n }\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 logo={logo ? <LogoFromGuid logo={logo} size={logoSize} /> : storefront}\n logoBorderColor={config.logo?.borderColor}\n logoRadius={config.logo?.radius}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AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MACT,CAAA;AAAA,IACI,CAAA;AAAA,EAEX;AAGA,QAAM,IAAe,EAAK,EAAc,GAAM,cAAc,CAAC,KAAK,EAAK,EAAM,eAAe,CAAC;AAC7F,MAAI,CAAC,EAAc,QAAO;AAE1B,QAAM,IAAS,EAAM,QAAQ,GACvB,IAAO,EAAK,EAAc,GAAM,aAAa,CAAC,KAAK,EAAK,EAAc,GAAM,MAAM,CAAC,GACnF,IACJ,EAAU,EAAc,GAAM,MAAM,CAAC,KACrC,EAAU;AAAA,IACR,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,OAAO,KAAW,YAAY,OAAO,SAAS,CAAM,KAAK,MAAW,IAChE,EAAe,GAAQ,QAAQ,IAC/B;AAAA,IAEN,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,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,UAAU;AAAA,EACX,CAAA;AAEL"}
@@ -1,32 +1,32 @@
1
- /**
2
- * Design branches of the Merchant component block (architecture doc, Merchant row): one
3
- * highlighted merchant (`single_*`, `MerchantHighlightCard`) or a row of merchant tiles
4
- * (`multiple_*`, `LogoClusterCard`), each plain, celebrated (`success`) or flagged (`error`).
5
- */
1
+ /** ditto declares only `highlight` today. */
6
2
  export declare const merchantBlockVariant: {
3
+ readonly Highlight: "highlight";
7
4
  readonly SingleStandard: "single_standard";
8
- readonly SingleLarge: "single_large";
9
5
  readonly SingleSuccess: "single_success";
10
- readonly SingleError: "single_error";
6
+ readonly SingleSubscription: "single_subscription";
11
7
  readonly MultipleStandard: "multiple_standard";
12
8
  readonly MultipleSuccess: "multiple_success";
13
- readonly MultipleError: "multiple_error";
9
+ readonly MultipleSubscription: "multiple_subscription";
10
+ readonly MultipleBadged: "multiple_badged";
14
11
  };
15
12
  export type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant];
16
- export type MerchantStatus = 'success' | 'error';
17
13
  export interface MerchantBlockLayoutConfig {
18
- kind: 'single' | 'multiple';
19
- /** Single: the amount as a dark pill or plain text. */
14
+ /** Merchant card, logo cascade, or ranked logos. */
15
+ kind: 'single' | 'cascade' | 'ranked';
20
16
  amountVariant?: 'pill' | 'text';
21
- /** A wash layered over the card. */
17
+ /** A wash; replaces `bgcolor`. */
22
18
  background?: string;
23
- /** Draws `status_text` in a pill of this tone: beside the single name, under the multiple row. */
24
- status?: MerchantStatus;
19
+ bgcolor?: string;
20
+ borderColor?: string;
21
+ fullBleed?: boolean;
22
+ hideDate?: boolean;
23
+ logo?: {
24
+ size?: number;
25
+ shadow?: 'offset' | 'elevation';
26
+ borderColor?: string;
27
+ radius?: number;
28
+ };
29
+ /** Draw `status_text` in a success pill. */
30
+ status?: boolean;
25
31
  }
26
- export declare const STATUS_PILL_TOKENS: Record<MerchantStatus, {
27
- bgcolor: string;
28
- borderColor: string;
29
- textColor: string;
30
- icon: string;
31
- }>;
32
32
  export declare const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig>;
@@ -1,57 +1,66 @@
1
- import { STATUS_ERROR_TOKENS as l, STATUS_SUCCESS_TOKENS as i } from "../../../components/statusTokens.es.js";
2
- import { ERROR_WASH_GRADIENT as e, WARM_LIME_ACCENT_GRADIENT as s } from "../../../components/celebrationGradients.es.js";
3
- var a = {
1
+ import { WARM_LIME_ACCENT_GRADIENT as r, celebrateGradient as i } from "../../../components/celebrationGradients.es.js";
2
+ var n = {
3
+ Highlight: "highlight",
4
4
  SingleStandard: "single_standard",
5
- SingleLarge: "single_large",
6
5
  SingleSuccess: "single_success",
7
- SingleError: "single_error",
6
+ SingleSubscription: "single_subscription",
8
7
  MultipleStandard: "multiple_standard",
9
8
  MultipleSuccess: "multiple_success",
10
- MultipleError: "multiple_error"
11
- }, u = {
12
- success: {
13
- ...i,
14
- icon: "check_circle"
15
- },
16
- error: {
17
- ...l,
18
- icon: "error"
19
- }
20
- }, r = {
9
+ MultipleSubscription: "multiple_subscription",
10
+ MultipleBadged: "multiple_badged"
11
+ }, l = { bgcolor: "secondary.lighter" }, a = {
12
+ background: r,
13
+ status: !0
14
+ }, e = {
21
15
  kind: "single",
22
- amountVariant: "pill"
23
- }, c = {
24
- single_standard: {
16
+ amountVariant: "pill",
17
+ fullBleed: !0,
18
+ hideDate: !0,
19
+ logo: {
20
+ size: 72,
21
+ shadow: "elevation",
22
+ borderColor: "divider",
23
+ radius: 8
24
+ }
25
+ }, s = {
26
+ highlight: {
25
27
  kind: "single",
26
- amountVariant: "text"
28
+ amountVariant: "text",
29
+ bgcolor: "warning.lighter",
30
+ borderColor: "warning.light"
31
+ },
32
+ single_standard: {
33
+ ...e,
34
+ ...l
27
35
  },
28
- single_large: r,
29
36
  single_success: {
30
- ...r,
31
- background: s,
32
- status: "success"
37
+ ...e,
38
+ ...a
33
39
  },
34
- single_error: {
35
- ...r,
36
- background: e,
37
- status: "error"
40
+ single_subscription: {
41
+ ...e,
42
+ background: i(232.03)
43
+ },
44
+ multiple_standard: {
45
+ kind: "cascade",
46
+ ...l
38
47
  },
39
- multiple_standard: { kind: "multiple" },
40
48
  multiple_success: {
41
- kind: "multiple",
42
- background: s,
43
- status: "success"
49
+ kind: "cascade",
50
+ ...a
51
+ },
52
+ multiple_subscription: {
53
+ kind: "cascade",
54
+ background: i(200.73)
44
55
  },
45
- multiple_error: {
46
- kind: "multiple",
47
- background: e,
48
- status: "error"
56
+ multiple_badged: {
57
+ kind: "ranked",
58
+ background: i(242.46)
49
59
  }
50
60
  };
51
61
  export {
52
- c as MERCHANT_LAYOUT,
53
- u as STATUS_PILL_TOKENS,
54
- a as merchantBlockVariant
62
+ s as MERCHANT_LAYOUT,
63
+ n as merchantBlockVariant
55
64
  };
56
65
 
57
66
  //# 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 ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport { STATUS_ERROR_TOKENS, STATUS_SUCCESS_TOKENS } from '../../../components/statusTokens'\n\n/**\n * Design branches of the Merchant component block (architecture doc, Merchant row): one\n * highlighted merchant (`single_*`, `MerchantHighlightCard`) or a row of merchant tiles\n * (`multiple_*`, `LogoClusterCard`), each plain, celebrated (`success`) or flagged (`error`).\n */\nexport const merchantBlockVariant = {\n SingleStandard: 'single_standard',\n SingleLarge: 'single_large',\n SingleSuccess: 'single_success',\n SingleError: 'single_error',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleError: 'multiple_error',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport type MerchantStatus = 'success' | 'error'\n\nexport interface MerchantBlockLayoutConfig {\n kind: 'single' | 'multiple'\n /** Single: the amount as a dark pill or plain text. */\n amountVariant?: 'pill' | 'text'\n /** A wash layered over the card. */\n background?: string\n /** Draws `status_text` in a pill of this tone: beside the single name, under the multiple row. */\n status?: MerchantStatus\n}\n\nexport const STATUS_PILL_TOKENS: Record<\n MerchantStatus,\n { bgcolor: string; borderColor: string; textColor: string; icon: string }\n> = {\n success: { ...STATUS_SUCCESS_TOKENS, icon: 'check_circle' },\n error: { ...STATUS_ERROR_TOKENS, icon: 'error' },\n}\n\nconst SINGLE_LARGE: MerchantBlockLayoutConfig = { kind: 'single', amountVariant: 'pill' }\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n single_standard: { kind: 'single', amountVariant: 'text' },\n single_large: SINGLE_LARGE,\n single_success: { ...SINGLE_LARGE, background: WARM_LIME_ACCENT_GRADIENT, status: 'success' },\n single_error: { ...SINGLE_LARGE, background: ERROR_WASH_GRADIENT, status: 'error' },\n multiple_standard: { kind: 'multiple' },\n multiple_success: { kind: 'multiple', background: WARM_LIME_ACCENT_GRADIENT, status: 'success' },\n multiple_error: { kind: 'multiple', background: ERROR_WASH_GRADIENT, status: 'error' },\n}\n"],"mappings":";;AAWA,IAAa,IAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,eAAe;AACjB,GAgBa,IAGT;AAAA,EACF,SAAS;AAAA,IAAE,GAAG;AAAA,IAAuB,MAAM;AAAA,EAAe;AAAA,EAC1D,OAAO;AAAA,IAAE,GAAG;AAAA,IAAqB,MAAM;AAAA,EAAQ;AACjD,GAEM,IAA0C;AAAA,EAAE,MAAM;AAAA,EAAU,eAAe;AAAO,GAE3E,IAA2E;AAAA,EACtF,iBAAiB;AAAA,IAAE,MAAM;AAAA,IAAU,eAAe;AAAA,EAAO;AAAA,EACzD,cAAc;AAAA,EACd,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAc,YAAY;AAAA,IAA2B,QAAQ;AAAA,EAAU;AAAA,EAC5F,cAAc;AAAA,IAAE,GAAG;AAAA,IAAc,YAAY;AAAA,IAAqB,QAAQ;AAAA,EAAQ;AAAA,EAClF,mBAAmB,EAAE,MAAM,WAAW;AAAA,EACtC,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAY,YAAY;AAAA,IAA2B,QAAQ;AAAA,EAAU;AAAA,EAC/F,gBAAgB;AAAA,IAAE,MAAM;AAAA,IAAY,YAAY;AAAA,IAAqB,QAAQ;AAAA,EAAQ;AACvF"}
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'\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 /** 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 single_subscription: { ...SINGLE, background: celebrateGradient(232.03) },\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":";AAMA,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,GAmBM,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,EACxC,qBAAqB;AAAA,IAAE,GAAG;AAAA,IAAQ,YAAY,EAAkB,MAAM;AAAA,EAAE;AAAA,EACxE,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"}
@@ -25,6 +25,12 @@ interface LogoClusterCardProps {
25
25
  * copy-store-derived function, or they will ship the English default.
26
26
  */
27
27
  rankLabel?: (rank: number) => string;
28
+ /** Ranked tile top offsets, cycled. */
29
+ rankOffsets?: readonly number[];
30
+ /** Ranked tiles overlap by this many px, centred. */
31
+ overlap?: number;
32
+ /** Edge to edge: no inset, square corners. */
33
+ fullBleed?: boolean;
28
34
  /**
29
35
  * Optional element rendered below the logo row (e.g. a `<StatusPill>`).
30
36
  * Figma: a status stacked beneath the logos on the slot.
@@ -36,5 +42,5 @@ interface LogoClusterCardProps {
36
42
  * A row of rounded brand/logo tiles on a card surface, diagonally staggered
37
43
  * (top -> center -> bottom). Figma: Monthly Subscription Aggregate V2.
38
44
  */
39
- declare const LogoClusterCard: ({ background, footer, logoSize, logos, ranked, rankLabel, stagger, sx, }: LogoClusterCardProps) => import("react/jsx-runtime").JSX.Element;
45
+ declare const LogoClusterCard: ({ background, footer, fullBleed, logoSize, logos, overlap, ranked, rankLabel, rankOffsets, stagger, sx, }: LogoClusterCardProps) => import("react/jsx-runtime").JSX.Element;
40
46
  export default LogoClusterCard;