@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.
- package/CHANGELOG.md +4 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +2 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +93 -53
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +20 -20
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +48 -39
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/LogoClusterCard.d.ts +7 -1
- package/dist/insights-v2/components/LogoClusterCard.es.js +54 -48
- package/dist/insights-v2/components/LogoClusterCard.es.js.map +1 -1
- package/dist/insights-v2/components/LogoTile.d.ts +6 -4
- package/dist/insights-v2/components/LogoTile.es.js +21 -19
- package/dist/insights-v2/components/LogoTile.es.js.map +1 -1
- package/dist/insights-v2/components/MerchantHighlightCard.d.ts +8 -3
- package/dist/insights-v2/components/MerchantHighlightCard.es.js +24 -21
- package/dist/insights-v2/components/MerchantHighlightCard.es.js.map +1 -1
- package/dist/insights-v2/components/P2PLogoStack.d.ts +7 -1
- package/dist/insights-v2/components/P2PLogoStack.es.js +34 -26
- package/dist/insights-v2/components/P2PLogoStack.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +6 -3
- package/dist/insights-v2/components/celebrationGradients.es.js +8 -7
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/components/statusTokens.d.ts +0 -5
- package/dist/insights-v2/components/statusTokens.es.js +0 -5
- package/dist/insights-v2/components/statusTokens.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +75 -75
- 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
|
|
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
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { resolveVariantConfig as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
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
|
|
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:
|
|
36
|
+
size: F,
|
|
16
37
|
sx: { color: "text.secondary" }
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
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":
|
|
28
|
-
|
|
45
|
+
"data-icon": "check_circle",
|
|
46
|
+
fill: !0,
|
|
47
|
+
name: "check_circle",
|
|
29
48
|
size: 16,
|
|
30
|
-
sx: { color:
|
|
49
|
+
sx: { color: "success.700" }
|
|
31
50
|
}),
|
|
32
51
|
label: m,
|
|
33
|
-
|
|
34
|
-
sx: a.kind === "multiple" ? {
|
|
52
|
+
sx: o.kind === "single" ? void 0 : {
|
|
35
53
|
alignSelf: "stretch",
|
|
36
54
|
justifyContent: "center"
|
|
37
|
-
}
|
|
55
|
+
}
|
|
38
56
|
}) : void 0;
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */ e(
|
|
42
|
-
background:
|
|
43
|
-
|
|
44
|
-
logos:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
51
|
-
if (!
|
|
52
|
-
const c =
|
|
53
|
-
alt:
|
|
54
|
-
fallback_guid:
|
|
55
|
-
guid:
|
|
56
|
-
}
|
|
57
|
-
return /* @__PURE__ */ e(
|
|
58
|
-
amount: typeof c == "number" && c !== 0 ?
|
|
59
|
-
amountVariant:
|
|
60
|
-
background:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
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
|
|
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}\n logoShadow={config.logo?.shadow}\n logoSize={logoSize}\n name={merchantName}\n trailing={statusPill}\n />\n )\n}\n\nexport default MerchantBlock\n"],"mappings":"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"}
|
|
@@ -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
|
|
6
|
+
readonly SingleSubscription: "single_subscription";
|
|
11
7
|
readonly MultipleStandard: "multiple_standard";
|
|
12
8
|
readonly MultipleSuccess: "multiple_success";
|
|
13
|
-
readonly
|
|
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
|
-
|
|
19
|
-
|
|
14
|
+
/** Merchant card, logo cascade, or ranked logos. */
|
|
15
|
+
kind: 'single' | 'cascade' | 'ranked';
|
|
20
16
|
amountVariant?: 'pill' | 'text';
|
|
21
|
-
/** A wash
|
|
17
|
+
/** A wash; replaces `bgcolor`. */
|
|
22
18
|
background?: string;
|
|
23
|
-
|
|
24
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
+
SingleSubscription: "single_subscription",
|
|
8
7
|
MultipleStandard: "multiple_standard",
|
|
9
8
|
MultipleSuccess: "multiple_success",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
...
|
|
31
|
-
|
|
32
|
-
status: "success"
|
|
37
|
+
...e,
|
|
38
|
+
...a
|
|
33
39
|
},
|
|
34
|
-
|
|
35
|
-
...
|
|
36
|
-
background:
|
|
37
|
-
|
|
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: "
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
kind: "cascade",
|
|
50
|
+
...a
|
|
51
|
+
},
|
|
52
|
+
multiple_subscription: {
|
|
53
|
+
kind: "cascade",
|
|
54
|
+
background: i(200.73)
|
|
44
55
|
},
|
|
45
|
-
|
|
46
|
-
kind: "
|
|
47
|
-
background:
|
|
48
|
-
status: "error"
|
|
56
|
+
multiple_badged: {
|
|
57
|
+
kind: "ranked",
|
|
58
|
+
background: i(242.46)
|
|
49
59
|
}
|
|
50
60
|
};
|
|
51
61
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
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;
|