@mx-cartographer/experiences 9.7.57 → 9.7.59
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 +8 -1
- package/dist/common/components/Banner.es.js +33 -30
- package/dist/common/components/Banner.es.js.map +1 -1
- package/dist/common/constants/Connect.d.ts +7 -0
- package/dist/common/constants/Connect.es.js +13 -8
- package/dist/common/constants/Connect.es.js.map +1 -1
- package/dist/common/constants/index.d.ts +1 -1
- package/dist/common/index.es.js +131 -129
- package/dist/core/types/Handlers.d.ts +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
|
@@ -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":";;;;;;;;;;;;AAqBA,IAAM,IAAY,IACZ,IAAe,GACf,IAAmB,IACnB,IAAa,GACb,IAAiB;AAAA,EAAC;AAAA,EAAI;AAAA,EAAI;AAAE,GAC5B,IAAqB,IAErB,IAAA,CAAQ,MAAgB,OAAO,KAAM,WAAW,IAAI,QAGpD,IAAA,CAAa,MAAwC;AACzD,MAAI,CAAC,KAAS,OAAO,KAAU,YAAY,MAAM,QAAQ,CAAK,EAAG;AACjE,QAAM,EAAE,KAAA,GAAK,OAAA,GAAO,eAAA,GAAe,MAAA,EAAA,IAAS;AAC5C,MAAI,SAAO,KAAS,YAAY,CAAC,EAAW,CAAI;AAChD,WAAO;AAAA,MAAE,KAAK,EAAK,CA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AS,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
|
|
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;
|
|
@@ -1,98 +1,104 @@
|
|
|
1
|
-
import { getLogoElevation as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
var
|
|
1
|
+
import { getLogoElevation as E } from "./logoShadow.es.js";
|
|
2
|
+
import A from "./LogoTile.es.js";
|
|
3
|
+
import d from "@mui/material/Stack";
|
|
4
|
+
import { jsx as t, jsxs as G } from "react/jsx-runtime";
|
|
5
|
+
import m from "@mui/material/Box";
|
|
6
|
+
import _ from "@mui/material/Badge";
|
|
7
|
+
var T = (o) => `Rank ${o}`, p = [
|
|
8
8
|
"flex-start",
|
|
9
9
|
"center",
|
|
10
10
|
"flex-end"
|
|
11
|
-
],
|
|
11
|
+
], C = 20, I = [
|
|
12
12
|
10,
|
|
13
13
|
25,
|
|
14
14
|
43
|
|
15
|
-
],
|
|
15
|
+
], L = 122, i = {
|
|
16
16
|
x: 10,
|
|
17
17
|
y: 8
|
|
18
|
-
},
|
|
18
|
+
}, N = { "& .MuiBadge-badge": {
|
|
19
19
|
bgcolor: "common.black",
|
|
20
20
|
border: "1px solid",
|
|
21
21
|
borderColor: "common.white",
|
|
22
22
|
borderRadius: "999px",
|
|
23
|
-
boxShadow: (
|
|
23
|
+
boxShadow: (o) => E(o),
|
|
24
24
|
color: "common.white",
|
|
25
|
-
fontSize: (
|
|
26
|
-
fontWeight: (
|
|
25
|
+
fontSize: (o) => o.typography.body2.fontSize,
|
|
26
|
+
fontWeight: (o) => o.typography.fontWeightRegular,
|
|
27
27
|
height: 24,
|
|
28
28
|
minWidth: 24,
|
|
29
29
|
padding: 0,
|
|
30
|
-
transform: `translate(-${
|
|
31
|
-
} }, O = ({ background:
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
30
|
+
transform: `translate(-${i.x}px, -${i.y}px)`
|
|
31
|
+
} }, O = ({ background: o, footer: s, fullBleed: a = !1, logoSize: n = 72, logos: b, overlap: h, ranked: e = !1, rankLabel: v = T, rankOffsets: c = I, stagger: g = !0, sx: f }) => {
|
|
32
|
+
const w = g ? (p.length - 1) * C : 0, R = e ? L : n + w, S = e ? a ? 24 : 16 : 32, l = e && h !== void 0;
|
|
33
|
+
return /* @__PURE__ */ t(d, {
|
|
34
34
|
sx: {
|
|
35
|
-
pt: 8,
|
|
36
|
-
px: 16,
|
|
35
|
+
pt: a ? 0 : 8,
|
|
36
|
+
px: a ? 0 : 16,
|
|
37
37
|
width: "100%",
|
|
38
|
-
...
|
|
38
|
+
...f
|
|
39
39
|
},
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ G(d, {
|
|
41
41
|
sx: {
|
|
42
42
|
alignItems: "center",
|
|
43
|
-
background:
|
|
44
|
-
bgcolor:
|
|
45
|
-
borderRadius: "8px",
|
|
43
|
+
background: o ?? void 0,
|
|
44
|
+
bgcolor: o ? void 0 : "background.paper",
|
|
45
|
+
borderRadius: a ? 0 : "8px",
|
|
46
46
|
gap: 12,
|
|
47
47
|
py: 16,
|
|
48
48
|
width: "100%"
|
|
49
49
|
},
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ t(d, {
|
|
51
51
|
sx: {
|
|
52
52
|
alignItems: "flex-start",
|
|
53
53
|
flexDirection: "row",
|
|
54
|
-
justifyContent: "space-between",
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
justifyContent: l ? "center" : "space-between",
|
|
55
|
+
isolation: l ? "isolate" : void 0,
|
|
56
|
+
height: R,
|
|
57
|
+
px: S,
|
|
57
58
|
width: "100%"
|
|
58
59
|
},
|
|
59
|
-
children:
|
|
60
|
-
const
|
|
60
|
+
children: b.map((u, r) => {
|
|
61
|
+
const x = /* @__PURE__ */ t(A, {
|
|
61
62
|
borderColor: "divider",
|
|
62
63
|
shadow: "elevation",
|
|
63
|
-
size:
|
|
64
|
+
size: n,
|
|
64
65
|
children: u
|
|
65
|
-
}),
|
|
66
|
+
}), y = e ? {
|
|
66
67
|
boxSizing: "border-box",
|
|
67
|
-
mt:
|
|
68
|
-
pl:
|
|
69
|
-
width:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
mt: c[r % c.length],
|
|
69
|
+
pl: i.x,
|
|
70
|
+
width: n + i.x + 2,
|
|
71
|
+
...l && {
|
|
72
|
+
ml: r ? `${-(i.x + 2 + h)}px` : 0,
|
|
73
|
+
position: "relative",
|
|
74
|
+
zIndex: r + 1
|
|
75
|
+
}
|
|
76
|
+
} : { alignSelf: g ? p[r % p.length] : "center" };
|
|
77
|
+
return /* @__PURE__ */ t(m, {
|
|
78
|
+
sx: y,
|
|
79
|
+
children: e ? /* @__PURE__ */ t(_, {
|
|
74
80
|
anchorOrigin: {
|
|
75
81
|
horizontal: "left",
|
|
76
82
|
vertical: "top"
|
|
77
83
|
},
|
|
78
|
-
"aria-label":
|
|
84
|
+
"aria-label": v(r + 1),
|
|
79
85
|
role: "img",
|
|
80
|
-
badgeContent: /* @__PURE__ */
|
|
86
|
+
badgeContent: /* @__PURE__ */ t("span", {
|
|
81
87
|
"aria-hidden": !0,
|
|
82
|
-
children:
|
|
88
|
+
children: r + 1
|
|
83
89
|
}),
|
|
84
90
|
overlap: "rectangular",
|
|
85
|
-
sx:
|
|
86
|
-
children:
|
|
87
|
-
}) :
|
|
88
|
-
},
|
|
91
|
+
sx: N,
|
|
92
|
+
children: x
|
|
93
|
+
}) : x
|
|
94
|
+
}, r);
|
|
89
95
|
})
|
|
90
|
-
}),
|
|
96
|
+
}), s && /* @__PURE__ */ t(m, {
|
|
91
97
|
sx: {
|
|
92
98
|
px: 16,
|
|
93
99
|
width: "100%"
|
|
94
100
|
},
|
|
95
|
-
children:
|
|
101
|
+
children: s
|
|
96
102
|
})]
|
|
97
103
|
})
|
|
98
104
|
});
|