@mx-cartographer/experiences 9.7.189 → 9.7.191
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 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +31 -30
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +3 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +11 -9
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.d.ts +5 -3
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +34 -31
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.d.ts +8 -0
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.es.js +11 -0
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/components/CategoryTile.es.js.map +1 -1
- package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.d.ts +3 -1
- package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.es.js +63 -51
- package/dist/insights-v2/components/ComponentBlocks/StatusIndicator.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +3 -1
- package/dist/insights-v2/components/LogoFromGuid.es.js +12 -11
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
- package/dist/insights-v2/components/LogoMark.d.ts +3 -1
- package/dist/insights-v2/components/LogoMark.es.js +20 -19
- package/dist/insights-v2/components/LogoMark.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +5 -4
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +56 -55
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js +0 -8
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.d.ts +0 -7
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.es.js +0 -12
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/util.es.js.map +0 -1
|
@@ -1,65 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { H2 as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...f
|
|
13
|
-
},
|
|
14
|
-
children: [/* @__PURE__ */ i(r, {
|
|
1
|
+
import i from "@mui/material/Stack";
|
|
2
|
+
import { H2 as v, P as u, Text as h } from "@mxenabled/mxui";
|
|
3
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
4
|
+
import p from "@mui/material/Box";
|
|
5
|
+
var D = ({ amount: a, borderRadius: o = "2px", completeColor: f = "success.main", icon: m, label: e, labelBelowAmount: n = !1, leftLabel: s, labelVariant: c = "caption", percentComplete: d = 0, rightLabel: l, sx: g }) => {
|
|
6
|
+
const x = typeof e == "string" ? /* @__PURE__ */ r(u, {
|
|
7
|
+
dangerouslySetInnerHTML: { __html: e },
|
|
8
|
+
variant: "body2"
|
|
9
|
+
}) : e;
|
|
10
|
+
return /* @__PURE__ */ t(i, {
|
|
11
|
+
className: "details-container",
|
|
15
12
|
sx: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
px: 16,
|
|
14
|
+
py: 8,
|
|
15
|
+
width: "100%",
|
|
16
|
+
gap: 16,
|
|
17
|
+
...g
|
|
19
18
|
},
|
|
20
|
-
children: [/* @__PURE__ */ t(
|
|
21
|
-
dangerouslySetInnerHTML: { __html: n },
|
|
22
|
-
variant: "body2"
|
|
23
|
-
}) : n, typeof e == "string" ? /* @__PURE__ */ t(g, { children: e }) : e] })]
|
|
24
|
-
}), /* @__PURE__ */ i(r, {
|
|
25
|
-
sx: { gap: 4 },
|
|
26
|
-
children: [/* @__PURE__ */ t(r, {
|
|
27
|
-
"data-testid": "status-indicator-track",
|
|
19
|
+
children: [/* @__PURE__ */ t(i, {
|
|
28
20
|
sx: {
|
|
29
|
-
|
|
30
|
-
borderRadius: o,
|
|
21
|
+
alignItems: "center",
|
|
31
22
|
flexDirection: "row",
|
|
32
|
-
|
|
33
|
-
width: "100%"
|
|
23
|
+
gap: 12
|
|
34
24
|
},
|
|
35
|
-
children: /* @__PURE__ */ t(
|
|
36
|
-
|
|
25
|
+
children: [/* @__PURE__ */ r(p, { children: m }), /* @__PURE__ */ t(i, { children: [
|
|
26
|
+
!n && x,
|
|
27
|
+
typeof a == "string" ? /* @__PURE__ */ r(v, { children: a }) : a,
|
|
28
|
+
n && x
|
|
29
|
+
] })]
|
|
30
|
+
}), /* @__PURE__ */ t(i, {
|
|
31
|
+
sx: { gap: 4 },
|
|
32
|
+
children: [/* @__PURE__ */ r(i, {
|
|
33
|
+
"aria-label": [s, l].filter(Boolean).join(", ") || void 0,
|
|
34
|
+
"aria-valuemax": 100,
|
|
35
|
+
"aria-valuemin": 0,
|
|
36
|
+
"aria-valuenow": Math.round(Math.min(100, Math.max(0, d))),
|
|
37
|
+
"data-testid": "status-indicator-track",
|
|
38
|
+
role: "progressbar",
|
|
37
39
|
sx: {
|
|
38
|
-
bgcolor:
|
|
40
|
+
bgcolor: "divider",
|
|
39
41
|
borderRadius: o,
|
|
42
|
+
flexDirection: "row",
|
|
40
43
|
height: 12,
|
|
41
|
-
width:
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
width: "100%"
|
|
45
|
+
},
|
|
46
|
+
children: /* @__PURE__ */ r(p, {
|
|
47
|
+
"data-testid": "status-indicator-fill",
|
|
48
|
+
sx: {
|
|
49
|
+
bgcolor: f,
|
|
50
|
+
borderRadius: o,
|
|
51
|
+
height: 12,
|
|
52
|
+
width: `${d}%`
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}), /* @__PURE__ */ t(i, {
|
|
56
|
+
sx: {
|
|
57
|
+
flexDirection: "row",
|
|
58
|
+
justifyContent: "space-between"
|
|
59
|
+
},
|
|
60
|
+
children: [/* @__PURE__ */ r(h, {
|
|
61
|
+
sx: { color: "text.secondary" },
|
|
62
|
+
variant: c,
|
|
63
|
+
children: s
|
|
64
|
+
}), /* @__PURE__ */ r(h, {
|
|
65
|
+
sx: { color: "text.secondary" },
|
|
66
|
+
variant: c,
|
|
67
|
+
children: l
|
|
68
|
+
})]
|
|
57
69
|
})]
|
|
58
70
|
})]
|
|
59
|
-
})
|
|
60
|
-
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
61
73
|
export {
|
|
62
|
-
|
|
74
|
+
D as default
|
|
63
75
|
};
|
|
64
76
|
|
|
65
77
|
//# sourceMappingURL=StatusIndicator.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIndicator.es.js","names":[],"sources":["../../../../src/insights-v2/components/ComponentBlocks/StatusIndicator.tsx"],"sourcesContent":["import { H2, P, Text } from '@mxenabled/mxui'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\ninterface StatusIndicatorProps {\n amount: string | React.ReactNode\n borderRadius?: string\n completeColor?: string\n icon: React.ReactNode\n label: string | React.ReactNode\n leftLabel?: string\n /** Type of `leftLabel` / `rightLabel` under the bar (not `label`): caption on the card, body2 in the drawer. */\n labelVariant?: 'caption' | 'body2'\n percentComplete?: number\n rightLabel?: string\n sx?: SxProps\n}\n\nconst StatusIndicator = ({\n amount,\n borderRadius = '2px',\n completeColor = 'success.main',\n icon,\n label,\n leftLabel,\n labelVariant = 'caption',\n percentComplete = 0,\n rightLabel,\n sx,\n}: StatusIndicatorProps) => {\n return (\n <Stack className=\"details-container\" sx={{ px: 16, py: 8, width: '100%', gap: 16, ...sx }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <Box>{icon}</Box>\n <Stack>\n {
|
|
1
|
+
{"version":3,"file":"StatusIndicator.es.js","names":[],"sources":["../../../../src/insights-v2/components/ComponentBlocks/StatusIndicator.tsx"],"sourcesContent":["import { H2, P, Text } from '@mxenabled/mxui'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\ninterface StatusIndicatorProps {\n amount: string | React.ReactNode\n borderRadius?: string\n completeColor?: string\n icon: React.ReactNode\n label: string | React.ReactNode\n /** Draw the label under the amount instead of above it. Default false. */\n labelBelowAmount?: boolean\n leftLabel?: string\n /** Type of `leftLabel` / `rightLabel` under the bar (not `label`): caption on the card, body2 in the drawer. */\n labelVariant?: 'caption' | 'body2'\n percentComplete?: number\n rightLabel?: string\n sx?: SxProps\n}\n\nconst StatusIndicator = ({\n amount,\n borderRadius = '2px',\n completeColor = 'success.main',\n icon,\n label,\n labelBelowAmount = false,\n leftLabel,\n labelVariant = 'caption',\n percentComplete = 0,\n rightLabel,\n sx,\n}: StatusIndicatorProps) => {\n const labelNode =\n typeof label === 'string' ? (\n <P dangerouslySetInnerHTML={{ __html: label }} variant={'body2'} />\n ) : (\n label\n )\n\n return (\n <Stack className=\"details-container\" sx={{ px: 16, py: 8, width: '100%', gap: 16, ...sx }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <Box>{icon}</Box>\n <Stack>\n {!labelBelowAmount && labelNode}\n {typeof amount === 'string' ? <H2>{amount}</H2> : amount}\n {labelBelowAmount && labelNode}\n </Stack>\n </Stack>\n <Stack sx={{ gap: 4 }}>\n <Stack\n aria-label={[leftLabel, rightLabel].filter(Boolean).join(', ') || undefined}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={Math.round(Math.min(100, Math.max(0, percentComplete)))}\n data-testid=\"status-indicator-track\"\n role=\"progressbar\"\n sx={{\n bgcolor: 'divider',\n borderRadius,\n flexDirection: 'row',\n height: 12,\n width: '100%',\n }}\n >\n <Box\n data-testid=\"status-indicator-fill\"\n sx={{\n bgcolor: completeColor,\n borderRadius,\n height: 12,\n width: `${percentComplete}%`,\n }}\n />\n </Stack>\n\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text sx={{ color: 'text.secondary' }} variant={labelVariant}>\n {leftLabel}\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant={labelVariant}>\n {rightLabel}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default StatusIndicator\n"],"mappings":";;;;AAsBA,IAAM,IAAA,CAAmB,EACvB,QAAA,GACA,cAAA,IAAe,OACf,eAAA,IAAgB,gBAChB,MAAA,GACA,OAAA,GACA,kBAAA,IAAmB,IACnB,WAAA,GACA,cAAA,IAAe,WACf,iBAAA,IAAkB,GAClB,YAAA,GACA,IAAA,EAAA,MAC0B;AAC1B,QAAM,IACJ,OAAO,KAAU,WACf,gBAAA,EAAC,GAAD;AAAA,IAAG,yBAAyB,EAAE,QAAQ,EAAM;AAAA,IAAG,SAAS;AAAA,EAAU,CAAA,IAElE;AAGJ,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,WAAU;AAAA,IAAoB,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAG,OAAO;AAAA,MAAQ,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,YAAY;AAAA,QAAU,eAAe;AAAA,QAAO,KAAK;AAAA,MAAG;AAAA,MAAjE,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAM,EAAU,CAAA,GAChB,gBAAA,EAAC,GAAD,EAAA,UAAA;AAAA,QACG,CAAC,KAAoB;AAAA,QACrB,OAAO,KAAW,WAAW,gBAAA,EAAC,GAAD,EAAA,UAAK,EAAW,CAAA,IAAI;AAAA,QACjD,KAAoB;AAAA,MAChB,EAAA,CAAA,CACF;AAAA,IACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,KAAK,EAAE;AAAA,MAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,CAAC,GAAW,CAAU,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,KAAK;AAAA,QAClE,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,iBAAe,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAe,CAAC,CAAC;AAAA,QACrE,eAAY;AAAA,QACZ,MAAK;AAAA,QACL,IAAI;AAAA,UACF,SAAS;AAAA,UACT,cAAA;AAAA,UACA,eAAe;AAAA,UACf,QAAQ;AAAA,UACR,OAAO;AAAA,QACT;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,eAAY;AAAA,UACZ,IAAI;AAAA,YACF,SAAS;AAAA,YACT,cAAA;AAAA,YACA,QAAQ;AAAA,YACR,OAAO,GAAG,CAAA;AAAA,UACZ;AAAA,QACD,CAAA;AAAA,MACI,CAAA,GAEP,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,eAAe;AAAA,UAAO,gBAAgB;AAAA,QAAgB;AAAA,QAAnE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,UAAG,SAAS;AAAA,UAC7C,UAAA;AAAA,QACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,UAAM,IAAI,EAAE,OAAO,iBAAiB;AAAA,UAAG,SAAS;AAAA,UAC7C,UAAA;AAAA,QACG,CAAA,CACD;AAAA,MACF,CAAA,CAAA;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -6,11 +6,13 @@ export interface LogoFromGuidProps {
|
|
|
6
6
|
/** Rendered square size in px (32 on rows, 40 on the compact card, 33 on the notification row). */
|
|
7
7
|
size: number;
|
|
8
8
|
className?: string;
|
|
9
|
+
/** A category tile's tint: its colour at this opacity behind the glyph, bordered in it (budget tiles). */
|
|
10
|
+
categoryTint?: number;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* One component for every V2 logo. The envelope sends a single `{ guid, fallback_guid?, alt? }`
|
|
12
14
|
* object whose prefix says what it is; anything else (`PARENT-ENTITY`, an `ACT-`/`BGT-` guid, an
|
|
13
15
|
* empty guid) renders nothing, never a guess. The asset → category tile → `alt` fallback is mxui's.
|
|
14
16
|
*/
|
|
15
|
-
declare const LogoFromGuid: ({ className, logo, size }: LogoFromGuidProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
declare const LogoFromGuid: ({ categoryTint, className, logo, size }: LogoFromGuidProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
18
|
export default LogoFromGuid;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { logoFromRef as
|
|
1
|
+
import n, { isKnownIcon as a } from "./LogoMark.es.js";
|
|
2
|
+
import { logoFromRef as u } from "./shared/EntityLogo.es.js";
|
|
3
3
|
import { jsx as e } from "react/jsx-runtime";
|
|
4
|
-
import
|
|
5
|
-
var
|
|
6
|
-
if (!r || !
|
|
7
|
-
const t =
|
|
4
|
+
import f from "@mui/material/Box";
|
|
5
|
+
var d = /^(MCH|CAT|INS)-|^ICO-[a-z0-9_-]+$/, m = (o) => !!o && d.test(o), p = ({ categoryTint: o, className: l, logo: r, size: i }) => {
|
|
6
|
+
if (!r || !m(r.guid)) return null;
|
|
7
|
+
const t = u({
|
|
8
8
|
alt: r.alt,
|
|
9
9
|
color: r.color,
|
|
10
10
|
fallback_guid: r.fallback_guid,
|
|
11
11
|
guid: r.guid
|
|
12
12
|
});
|
|
13
|
-
return !t || t.logo_name && !
|
|
14
|
-
className:
|
|
13
|
+
return !t || t.logo_name && !a(t.logo_name) ? null : /* @__PURE__ */ e(f, {
|
|
14
|
+
className: l,
|
|
15
15
|
"data-testid": "logo-from-guid",
|
|
16
16
|
sx: {
|
|
17
17
|
alignItems: "center",
|
|
@@ -21,15 +21,16 @@ var f = /^(MCH|CAT|INS)-|^ICO-[a-z0-9_-]+$/, d = (o) => !!o && f.test(o), _ = ({
|
|
|
21
21
|
justifyContent: "center",
|
|
22
22
|
width: i
|
|
23
23
|
},
|
|
24
|
-
children: /* @__PURE__ */ e(
|
|
24
|
+
children: /* @__PURE__ */ e(n, {
|
|
25
|
+
categoryTint: o,
|
|
25
26
|
logo: t,
|
|
26
27
|
size: i
|
|
27
28
|
})
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
p as default,
|
|
33
|
+
m as isLogoGuid
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
//# sourceMappingURL=LogoFromGuid.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoFromGuid.es.js","names":[],"sources":["../../../src/insights-v2/components/LogoFromGuid.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\n\nimport type { LogoRef } from '../../core'\nimport LogoMark, { isKnownIcon } from './LogoMark'\nimport { logoFromRef } from './shared/EntityLogo'\n\n/**\n * The guid prefixes that name a logo entity. A prefix heuristic by design: the V2 envelope carries\n * the entity only in the guid, and the notification row relies on non-insight rows carrying account\n * or budget guids and legacy insight rows carrying the `\"PARENT-ENTITY\"` sentinel. Exported beside\n * the component so a caller's branch (`NotificationCard`) and the dispatch here cannot drift apart.\n */\nconst LOGO_GUID_PREFIX = /^(MCH|CAT|INS)-|^ICO-[a-z0-9_-]+$/\n\nexport const isLogoGuid = (guid?: string | null): guid is string =>\n !!guid && LOGO_GUID_PREFIX.test(guid)\n\nexport interface LogoFromGuidProps {\n /** The envelope's logo object: `{ guid, fallback_guid?, alt?, color? }` (`color` is read for `ICO-` icons). */\n logo?: Pick<LogoRef, 'alt' | 'color' | 'fallback_guid' | 'guid'> | null\n /** Rendered square size in px (32 on rows, 40 on the compact card, 33 on the notification row). */\n size: number\n className?: string\n}\n\n/**\n * One component for every V2 logo. The envelope sends a single `{ guid, fallback_guid?, alt? }`\n * object whose prefix says what it is; anything else (`PARENT-ENTITY`, an `ACT-`/`BGT-` guid, an\n * empty guid) renders nothing, never a guess. The asset → category tile → `alt` fallback is mxui's.\n */\nconst LogoFromGuid = ({ className, logo, size }: LogoFromGuidProps) => {\n if (!logo || !isLogoGuid(logo.guid)) return null\n\n // Guid-only on purpose: `logoFromRef` lets a status `icon` win over `guid`, which is right for a\n // row but would silently turn this component into an icon renderer.\n const resolved = logoFromRef({\n alt: logo.alt,\n color: logo.color,\n fallback_guid: logo.fallback_guid,\n guid: logo.guid,\n })\n\n if (!resolved) return null\n\n // Checked before the sized box, so an unknown icon leaves no empty gap.\n if (resolved.logo_name && !isKnownIcon(resolved.logo_name)) return null\n\n return (\n <Box\n className={className}\n data-testid=\"logo-from-guid\"\n sx={{\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: size,\n justifyContent: 'center',\n width: size,\n }}\n >\n <LogoMark logo={resolved} size={size} />\n </Box>\n )\n}\n\nexport default LogoFromGuid\n"],"mappings":";;;;AAYA,IAAM,IAAmB,qCAEZ,IAAA,CAAc,MACzB,CAAC,CAAC,KAAQ,EAAiB,KAAK,CAAI,
|
|
1
|
+
{"version":3,"file":"LogoFromGuid.es.js","names":[],"sources":["../../../src/insights-v2/components/LogoFromGuid.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\n\nimport type { LogoRef } from '../../core'\nimport LogoMark, { isKnownIcon } from './LogoMark'\nimport { logoFromRef } from './shared/EntityLogo'\n\n/**\n * The guid prefixes that name a logo entity. A prefix heuristic by design: the V2 envelope carries\n * the entity only in the guid, and the notification row relies on non-insight rows carrying account\n * or budget guids and legacy insight rows carrying the `\"PARENT-ENTITY\"` sentinel. Exported beside\n * the component so a caller's branch (`NotificationCard`) and the dispatch here cannot drift apart.\n */\nconst LOGO_GUID_PREFIX = /^(MCH|CAT|INS)-|^ICO-[a-z0-9_-]+$/\n\nexport const isLogoGuid = (guid?: string | null): guid is string =>\n !!guid && LOGO_GUID_PREFIX.test(guid)\n\nexport interface LogoFromGuidProps {\n /** The envelope's logo object: `{ guid, fallback_guid?, alt?, color? }` (`color` is read for `ICO-` icons). */\n logo?: Pick<LogoRef, 'alt' | 'color' | 'fallback_guid' | 'guid'> | null\n /** Rendered square size in px (32 on rows, 40 on the compact card, 33 on the notification row). */\n size: number\n className?: string\n /** A category tile's tint: its colour at this opacity behind the glyph, bordered in it (budget tiles). */\n categoryTint?: number\n}\n\n/**\n * One component for every V2 logo. The envelope sends a single `{ guid, fallback_guid?, alt? }`\n * object whose prefix says what it is; anything else (`PARENT-ENTITY`, an `ACT-`/`BGT-` guid, an\n * empty guid) renders nothing, never a guess. The asset → category tile → `alt` fallback is mxui's.\n */\nconst LogoFromGuid = ({ categoryTint, className, logo, size }: LogoFromGuidProps) => {\n if (!logo || !isLogoGuid(logo.guid)) return null\n\n // Guid-only on purpose: `logoFromRef` lets a status `icon` win over `guid`, which is right for a\n // row but would silently turn this component into an icon renderer.\n const resolved = logoFromRef({\n alt: logo.alt,\n color: logo.color,\n fallback_guid: logo.fallback_guid,\n guid: logo.guid,\n })\n\n if (!resolved) return null\n\n // Checked before the sized box, so an unknown icon leaves no empty gap.\n if (resolved.logo_name && !isKnownIcon(resolved.logo_name)) return null\n\n return (\n <Box\n className={className}\n data-testid=\"logo-from-guid\"\n sx={{\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: size,\n justifyContent: 'center',\n width: size,\n }}\n >\n <LogoMark categoryTint={categoryTint} logo={resolved} size={size} />\n </Box>\n )\n}\n\nexport default LogoFromGuid\n"],"mappings":";;;;AAYA,IAAM,IAAmB,qCAEZ,IAAA,CAAc,MACzB,CAAC,CAAC,KAAQ,EAAiB,KAAK,CAAI,GAiBhC,IAAA,CAAgB,EAAE,cAAA,GAAc,WAAA,GAAW,MAAA,GAAM,MAAA,EAAA,MAA8B;AACnF,MAAI,CAAC,KAAQ,CAAC,EAAW,EAAK,IAAI,EAAG,QAAO;AAI5C,QAAM,IAAW,EAAY;AAAA,IAC3B,KAAK,EAAK;AAAA,IACV,OAAO,EAAK;AAAA,IACZ,eAAe,EAAK;AAAA,IACpB,MAAM,EAAK;AAAA,EACb,CAAC;AAKD,SAHI,CAAC,KAGD,EAAS,aAAa,CAAC,EAAY,EAAS,SAAS,IAAU,OAGjE,gBAAA,EAAC,GAAD;AAAA,IACa,WAAA;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAwB,cAAA;AAAA,MAAc,MAAM;AAAA,MAAgB,MAAA;AAAA,IAAO,CAAA;AAAA,EAChE,CAAA;AAET"}
|
|
@@ -2,6 +2,8 @@ import { Logo } from '../../core';
|
|
|
2
2
|
interface LogoMarkProps {
|
|
3
3
|
logo: Logo;
|
|
4
4
|
size: number;
|
|
5
|
+
/** Passed to a category's `CategoryTile`; other logos ignore it. */
|
|
6
|
+
categoryTint?: number;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
9
|
* Whether mx-icons draws `name` (own keys only, so `constructor` is rejected). An unknown name would
|
|
@@ -13,7 +15,7 @@ export declare const isKnownIcon: (name: string) => boolean;
|
|
|
13
15
|
* parent as `CategoryTile` does, since mxui only knows those. Reads the category store, so it renders
|
|
14
16
|
* inside the app's providers.
|
|
15
17
|
*/
|
|
16
|
-
declare const LogoMark: (({ logo, size }: LogoMarkProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
18
|
+
declare const LogoMark: (({ categoryTint, logo, size }: LogoMarkProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
17
19
|
displayName: string;
|
|
18
20
|
};
|
|
19
21
|
export default LogoMark;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { InstitutionLogo as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { jsx as
|
|
7
|
-
var
|
|
8
|
-
const { getTopLevelCategoryGuid:
|
|
9
|
-
return r.logo_name ?
|
|
1
|
+
import { useCategoryStore as o } from "../../common/context/hooks.es.js";
|
|
2
|
+
import a from "./CategoryTile.es.js";
|
|
3
|
+
import { observer as u } from "mobx-react-lite";
|
|
4
|
+
import { InstitutionLogo as m, MerchantLogo as c } from "@mxenabled/mxui";
|
|
5
|
+
import { Icon as f, IconList as s } from "@mxenabled/mx-icons";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
var d = (t) => Object.hasOwn(s, t) ? !0 : (console.warn(`[LogoMark] "${t}" names no mx-icons icon — rendering nothing.`), !1), L = u(({ categoryTint: t, logo: r, size: n }) => {
|
|
8
|
+
const { getTopLevelCategoryGuid: e } = o();
|
|
9
|
+
return r.logo_name ? d(r.logo_name) ? /* @__PURE__ */ i(f, {
|
|
10
10
|
fill: r.logo_fill,
|
|
11
11
|
name: r.logo_name,
|
|
12
|
-
size:
|
|
12
|
+
size: n,
|
|
13
13
|
sx: { color: r.logo_color }
|
|
14
|
-
}) : null : r.merchant_guid ? /* @__PURE__ */
|
|
14
|
+
}) : null : r.merchant_guid ? /* @__PURE__ */ i(c, {
|
|
15
15
|
alt: r.merchant_name ?? "",
|
|
16
|
-
categoryGuid: r.category_guid ?
|
|
16
|
+
categoryGuid: r.category_guid ? e(r.category_guid) : "",
|
|
17
17
|
merchantGuid: r.merchant_guid,
|
|
18
|
-
size:
|
|
19
|
-
}) : r.institution_guid ? /* @__PURE__ */
|
|
18
|
+
size: n
|
|
19
|
+
}) : r.institution_guid ? /* @__PURE__ */ i(m, {
|
|
20
20
|
alt: r.institution_name ?? "",
|
|
21
21
|
institutionGuid: r.institution_guid,
|
|
22
|
-
size:
|
|
23
|
-
}) : r.category_guid ? /* @__PURE__ */
|
|
22
|
+
size: n
|
|
23
|
+
}) : r.category_guid ? /* @__PURE__ */ i(a, {
|
|
24
24
|
categoryGuid: r.category_guid,
|
|
25
|
-
size:
|
|
25
|
+
size: n,
|
|
26
|
+
tint: t
|
|
26
27
|
}) : null;
|
|
27
28
|
});
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
L as default,
|
|
31
|
+
d as isKnownIcon
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
//# sourceMappingURL=LogoMark.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoMark.es.js","names":[],"sources":["../../../src/insights-v2/components/LogoMark.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { Icon, IconList } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\n\nimport { useCategoryStore } from '../../common'\nimport type { Logo } from '../../core'\n\nimport CategoryTile from './CategoryTile'\n\ninterface LogoMarkProps {\n logo: Logo\n size: number\n}\n\n/**\n * Whether mx-icons draws `name` (own keys only, so `constructor` is rejected). An unknown name would\n * draw an empty box, so it is logged and the caller draws nothing.\n */\nexport const isKnownIcon = (name: string): boolean => {\n if (Object.hasOwn(IconList, name)) return true\n\n console.warn(`[LogoMark] \"${name}\" names no mx-icons icon — rendering nothing.`)\n return false\n}\n\n/**\n * A resolved `Logo` as its mxui component. A merchant's fallback category walks up to its top-level\n * parent as `CategoryTile` does, since mxui only knows those. Reads the category store, so it renders\n * inside the app's providers.\n */\nconst LogoMark = observer(({ logo, size }: LogoMarkProps) => {\n const { getTopLevelCategoryGuid } = useCategoryStore()\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return null\n\n return (\n <Icon\n fill={logo.logo_fill}\n name={logo.logo_name}\n size={size}\n sx={{ color: logo.logo_color }}\n />\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? getTopLevelCategoryGuid(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={size}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={size}\n />\n )\n }\n\n if (logo.category_guid) {\n return <CategoryTile categoryGuid={logo.category_guid} size={size} />\n }\n\n return null\n})\n\nexport default LogoMark\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"LogoMark.es.js","names":[],"sources":["../../../src/insights-v2/components/LogoMark.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { Icon, IconList } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\n\nimport { useCategoryStore } from '../../common'\nimport type { Logo } from '../../core'\n\nimport CategoryTile from './CategoryTile'\n\ninterface LogoMarkProps {\n logo: Logo\n size: number\n /** Passed to a category's `CategoryTile`; other logos ignore it. */\n categoryTint?: number\n}\n\n/**\n * Whether mx-icons draws `name` (own keys only, so `constructor` is rejected). An unknown name would\n * draw an empty box, so it is logged and the caller draws nothing.\n */\nexport const isKnownIcon = (name: string): boolean => {\n if (Object.hasOwn(IconList, name)) return true\n\n console.warn(`[LogoMark] \"${name}\" names no mx-icons icon — rendering nothing.`)\n return false\n}\n\n/**\n * A resolved `Logo` as its mxui component. A merchant's fallback category walks up to its top-level\n * parent as `CategoryTile` does, since mxui only knows those. Reads the category store, so it renders\n * inside the app's providers.\n */\nconst LogoMark = observer(({ categoryTint, logo, size }: LogoMarkProps) => {\n const { getTopLevelCategoryGuid } = useCategoryStore()\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return null\n\n return (\n <Icon\n fill={logo.logo_fill}\n name={logo.logo_name}\n size={size}\n sx={{ color: logo.logo_color }}\n />\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? getTopLevelCategoryGuid(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={size}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={size}\n />\n )\n }\n\n if (logo.category_guid) {\n return <CategoryTile categoryGuid={logo.category_guid} size={size} tint={categoryTint} />\n }\n\n return null\n})\n\nexport default LogoMark\n"],"mappings":";;;;;;AAqBA,IAAa,IAAA,CAAe,MACtB,OAAO,OAAO,GAAU,CAAI,IAAU,MAE1C,QAAQ,KAAK,eAAe,CAAA,+CAAmD,GACxE,KAQH,IAAW,EAAA,CAAU,EAAE,cAAA,GAAc,MAAA,GAAM,MAAA,EAAA,MAA0B;AACzE,QAAM,EAAE,yBAAA,EAAA,IAA4B,EAAiB;AAErD,SAAI,EAAK,YACF,EAAY,EAAK,SAAS,IAG7B,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAK;AAAA,IACX,MAAM,EAAK;AAAA,IACL,MAAA;AAAA,IACN,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,EAC9B,CAAA,IARsC,OAYvC,EAAK,gBAEL,gBAAA,EAAC,GAAD;AAAA,IACE,KAAK,EAAK,iBAAiB;AAAA,IAC3B,cAAc,EAAK,gBAAgB,EAAwB,EAAK,aAAa,IAAI;AAAA,IACjF,cAAc,EAAK;AAAA,IACb,MAAA;AAAA,EACP,CAAA,IAID,EAAK,mBAEL,gBAAA,EAAC,GAAD;AAAA,IACE,KAAK,EAAK,oBAAoB;AAAA,IAC9B,iBAAiB,EAAK;AAAA,IAChB,MAAA;AAAA,EACP,CAAA,IAID,EAAK,gBACA,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc,EAAK;AAAA,IAAqB,MAAA;AAAA,IAAM,MAAM;AAAA,EAAe,CAAA,IAGnF;AACT,CAAC"}
|
|
@@ -4,8 +4,8 @@ import { Theme } from '@mui/material/styles';
|
|
|
4
4
|
* one source holds each gradient. The 20%–25% washes layer over `background.paper` via
|
|
5
5
|
* `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` and the tile gradients are opaque and stand alone.
|
|
6
6
|
*
|
|
7
|
-
* - WARM_LIME_ACCENT_GRADIENT: merchant categorization and
|
|
8
|
-
* - DIRECT_DEPOSIT_COMPLETE_GRADIENT: the direct deposit complete tile.
|
|
7
|
+
* - WARM_LIME_ACCENT_GRADIENT: merchant categorization and on-track states.
|
|
8
|
+
* - DIRECT_DEPOSIT_COMPLETE_GRADIENT: the direct deposit complete tile and the deposit tile.
|
|
9
9
|
* - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.
|
|
10
10
|
* - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.
|
|
11
11
|
* - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).
|
|
@@ -16,11 +16,12 @@ import { Theme } from '@mui/material/styles';
|
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* Warm → lime accent wash at 20% opacity. Used as a tinted background behind
|
|
19
|
-
* merchant categorization highlights and
|
|
19
|
+
* merchant categorization highlights and on-track states.
|
|
20
20
|
*/
|
|
21
21
|
export declare const WARM_LIME_ACCENT_GRADIENT = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)";
|
|
22
22
|
/**
|
|
23
|
-
* Warm → lime wash at 20% behind the Direct Deposit complete tile (Set Up / Switch Direct Deposit)
|
|
23
|
+
* Warm → lime wash at 20% behind the Direct Deposit complete tile (Set Up / Switch Direct Deposit) and
|
|
24
|
+
* the deposit tile (Unified Deposit).
|
|
24
25
|
* Figma gives it its own angle and stops, so it does not reuse WARM_LIME_ACCENT_GRADIENT.
|
|
25
26
|
*/
|
|
26
27
|
export declare const DIRECT_DEPOSIT_COMPLETE_GRADIENT = "linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 0.2) 101.54%)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` and the tile gradients are opaque and stand alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and
|
|
1
|
+
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` and the tile gradients are opaque and stand alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and on-track states.\n * - DIRECT_DEPOSIT_COMPLETE_GRADIENT: the direct deposit complete tile and the deposit tile.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: low balance, off-track status.\n * - FEES_WASH_GRADIENT: fees and interest charges.\n * - PRIMARY_TILE_GRADIENTS / SUCCESS_TILE_GRADIENTS: blue and green tiles, per theme mode.\n * - getPrimaryWashGradient(theme, angle?): pending connect / detected subscription, from the palette.\n */\n\n/**\n * Warm → lime accent wash at 20% opacity. Used as a tinted background behind\n * merchant categorization highlights and on-track states.\n */\nexport const WARM_LIME_ACCENT_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)'\n\n/**\n * Warm → lime wash at 20% behind the Direct Deposit complete tile (Set Up / Switch Direct Deposit) and\n * the deposit tile (Unified Deposit).\n * Figma gives it its own angle and stops, so it does not reuse WARM_LIME_ACCENT_GRADIENT.\n */\nexport const DIRECT_DEPOSIT_COMPLETE_GRADIENT =\n 'linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 0.2) 101.54%)'\n\n/** Warm → pink wash behind balance/savings milestones. */\nexport const CELEBRATION_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)'\n\n/** Figma Celebrate Gradient; its angle varies per slot. */\nexport const celebrateGradient = (angleDeg: number) =>\n `linear-gradient(${angleDeg}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`\n\n/** Peach → pink gradient for Discovered Accounts success state. */\nexport const DISCOVERED_ACCOUNTS_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 224, 153, 1) 1.86%, rgba(255, 129, 230, 1) 101.54%)'\n\n/**\n * Warm → pink wash at 20% opacity for the account-connected success state.\n * Layer over `background.paper` (the Figma spec's `#FFF` base), not the\n * `background` shorthand — a 20% gradient over transparency renders wrong.\n */\nexport const ACCOUNT_CONNECTED_GRADIENT = celebrateGradient(200.73)\n\n/**\n * Orange → red-orange wash at 25% opacity behind a flagged charge (Unexpected Subscription\n * Payment). Figma \"Warning Gradient 1\": a bespoke two-stop blend with no palette token, so it\n * stays a literal like the other washes here rather than being derived from `palette.warning`.\n */\nexport const WARNING_WASH_GRADIENT =\n 'linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)'\n\n/** Red wash at 20%: low balance, off-track status. */\nexport const ERROR_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)'\n\n/** Red → orange wash at 20%: fees and interest charges. */\nexport const FEES_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)'\n\n/** Blue tile, per theme mode (Missing Interest Rate before the rate is added). */\nexport const PRIMARY_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)',\n dark: 'linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)',\n} as const\n\n/** Green tile, per theme mode (Missing Interest Rate once the rate is added). */\nexport const SUCCESS_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #94C9B7 0%, #12875E 100%)',\n dark: 'linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)',\n} as const\n\n/**\n * Blue slot wash behind a pending connect / detected-subscription row: `primary.light` →\n * `primary.main` at 75% over paper, built from the live palette so it follows the theme. Figma's\n * angle follows the slot's shape, so a slot passes its own.\n */\nexport const getPrimaryWashGradient = ({ palette }: Theme, angleDeg = 173) =>\n `linear-gradient(${angleDeg}deg, ${alpha(palette.primary.light, 0.75)} 46.41%, ${alpha(palette.primary.main, 0.75)} 78.14%)`\n"],"mappings":";AAsBA,IAAa,IACX,+FAOW,IACX,4FAGW,IACX,gGAGW,IAAA,CAAqB,MAChC,mBAAmB,CAAA,0EAWR,IAA6B,EAAkB,MAAM,GAOrD,IACX,0FAGW,IACX,2FAGW,IACX,4FAGW,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAGa,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAOa,IAAA,CAA0B,EAAE,SAAA,EAAA,GAAkB,IAAW,QACpE,mBAAmB,CAAA,QAAgB,EAAM,EAAQ,QAAQ,OAAO,IAAI,CAAA,YAAa,EAAM,EAAQ,QAAQ,MAAM,IAAI,CAAA"}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { GlobalDataContext as Z } from "../../common/context/GlobalDataProvider.es.js";
|
|
2
|
-
import { slot as
|
|
2
|
+
import { slot as y } from "../../core/types/Insights.es.js";
|
|
3
3
|
import { resolveInsightRender as b } from "../../insights-v2/resolveInsightRender.es.js";
|
|
4
|
-
import { asLogoRef as
|
|
4
|
+
import { asLogoRef as F } from "../../insights-v2/blocks/slotReaders.es.js";
|
|
5
5
|
import { hasDrawerBlock as ii } from "../../insights-v2/mappings/hasDrawerBlock.es.js";
|
|
6
6
|
import ti, { isLogoGuid as ei } from "../../insights-v2/components/LogoFromGuid.es.js";
|
|
7
|
-
import { statusIconAccentColor as oi, statusIconName as
|
|
8
|
-
import { ON_CLICK_EVENT as
|
|
9
|
-
import
|
|
7
|
+
import { statusIconAccentColor as oi, statusIconName as k, statusIconPalette as ri } from "../../insights-v2/components/statusIcon.es.js";
|
|
8
|
+
import { ON_CLICK_EVENT as S, ON_VIEW_EVENT as ni, ON_VIEW_FIRST_TIME_EVENT as si } from "../constants/Analytics.es.js";
|
|
9
|
+
import D from "../beaticons/BeatMaterialIcon.es.js";
|
|
10
10
|
import { BeatIcon as ci } from "../beaticons/BeatIcon.es.js";
|
|
11
|
-
import { useCopyStore as
|
|
12
|
-
import { microCardMinWidth as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { MicroCtaStatusGate as
|
|
11
|
+
import { useCopyStore as li, useEvent as mi, useInsightsMicroWidgetStore as ai } from "../context/hooks.es.js";
|
|
12
|
+
import { microCardMinWidth as _i } from "../utils/cardWidth.es.js";
|
|
13
|
+
import q from "../MicroCardTemplate.es.js";
|
|
14
|
+
import pi from "./InlineActionBlock.es.js";
|
|
15
|
+
import { MicroCtaStatusGate as di } from "./MicroCtaStatus.es.js";
|
|
16
16
|
import ui from "../../insights-v2/components/InsightErrorCard.es.js";
|
|
17
17
|
import gi, { useEffect as j, useState as fi } from "react";
|
|
18
18
|
import { Fragment as hi, jsx as e, jsxs as Ii } from "react/jsx-runtime";
|
|
19
|
-
import { alpha as
|
|
20
|
-
import
|
|
21
|
-
import { useInView as
|
|
22
|
-
var zi = ({ ariaLabel: g, beat: i, elevation: N, inDescriptionCtaBehavior:
|
|
23
|
-
const { ref: C, inView:
|
|
19
|
+
import { alpha as K, useTheme as Ci } from "@mui/material/styles";
|
|
20
|
+
import Ei from "@mui/material/Box";
|
|
21
|
+
import { useInView as Ti } from "react-intersection-observer";
|
|
22
|
+
var vi = "budget_block", yi = 0.25, zi = ({ ariaLabel: g, beat: i, elevation: N, inDescriptionCtaBehavior: Y = "external", index: s, isActiveCard: f, onCardClick: c, posthog: r, widthOverrides: h, variant: R, showIcon: x, heightOverrides: I }) => {
|
|
23
|
+
const { ref: C, inView: l } = Ti({ threshold: 1 }), E = Ci(), { cardsCopy: z } = li(), { onEvent: m } = mi(), { updateBeat: H, updateOffer: $ } = ai(), a = "is_insights_v2" in i && i.is_insights_v2, _ = a ? { metadata: { is_insights_v2: !0 } } : void 0;
|
|
24
24
|
j(() => {
|
|
25
|
-
|
|
25
|
+
l && (i.has_been_displayed ? m(ni(i.template), _) : (i.guid.startsWith("OFR") ? $({
|
|
26
26
|
...i,
|
|
27
27
|
has_been_displayed: !0
|
|
28
|
-
}) :
|
|
28
|
+
}) : H({
|
|
29
29
|
...i,
|
|
30
30
|
has_been_displayed: !0
|
|
31
|
-
}),
|
|
32
|
-
}, [
|
|
33
|
-
if (
|
|
31
|
+
}), m(si(i.template), _)));
|
|
32
|
+
}, [l]), j(() => {
|
|
33
|
+
if (l && i) if (i.template === "MarketingOffer") {
|
|
34
34
|
const t = i;
|
|
35
|
-
|
|
35
|
+
r?.capture("viewed_messaging_insight", {
|
|
36
36
|
template: i.template,
|
|
37
37
|
campaign_guid: t.campaign_guid,
|
|
38
38
|
campaign_name: t.pulse_campaign_name,
|
|
39
39
|
offer_guid: t.guid,
|
|
40
40
|
user_guid: t.user_guid
|
|
41
41
|
});
|
|
42
|
-
} else
|
|
42
|
+
} else r?.capture("viewed_insight", {
|
|
43
43
|
beat_guid: i.guid,
|
|
44
44
|
template: i.template,
|
|
45
45
|
position: s,
|
|
@@ -48,26 +48,26 @@ var zi = ({ ariaLabel: g, beat: i, elevation: N, inDescriptionCtaBehavior: H = "
|
|
|
48
48
|
}, [
|
|
49
49
|
i,
|
|
50
50
|
s,
|
|
51
|
-
|
|
51
|
+
l
|
|
52
52
|
]);
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
53
|
+
const B = b(i), o = B === "v2" ? i.insights_payload : void 0, J = gi.useContext(Z) !== null, V = Y === "internal" && J && ii(o?.in_description_cta?.block), [M, Q] = fi(0), p = () => {
|
|
54
|
+
if (V ? Q((t) => t + 1) : c && c(i), m(S(i.template), _), i.template === "MarketingOffer") {
|
|
55
55
|
const t = i;
|
|
56
|
-
|
|
56
|
+
r?.capture("clicked_messaging_insight", {
|
|
57
57
|
template: i.template,
|
|
58
58
|
campaign_guid: t.campaign_guid,
|
|
59
59
|
campaign_name: t.pulse_campaign_name,
|
|
60
60
|
offer_guid: t.guid,
|
|
61
61
|
user_guid: t.user_guid
|
|
62
62
|
});
|
|
63
|
-
} else
|
|
63
|
+
} else r?.capture("clicked_insight", {
|
|
64
64
|
beat_guid: i.guid,
|
|
65
65
|
template: i.template,
|
|
66
66
|
position: s,
|
|
67
67
|
...a && { is_insights_v2: !0 }
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
return
|
|
70
|
+
return B === "error" ? /* @__PURE__ */ e(Ei, {
|
|
71
71
|
"aria-hidden": !f,
|
|
72
72
|
"aria-label": g,
|
|
73
73
|
"aria-roledescription": "slide",
|
|
@@ -75,66 +75,67 @@ var zi = ({ ariaLabel: g, beat: i, elevation: N, inDescriptionCtaBehavior: H = "
|
|
|
75
75
|
role: "group",
|
|
76
76
|
sx: {
|
|
77
77
|
height: I ? "100%" : 120,
|
|
78
|
-
minWidth:
|
|
78
|
+
minWidth: _i(h),
|
|
79
79
|
my: 1
|
|
80
80
|
},
|
|
81
81
|
children: /* @__PURE__ */ e(ui, { beat: i })
|
|
82
|
-
}) :
|
|
82
|
+
}) : o ? /* @__PURE__ */ e(di, {
|
|
83
83
|
beat: i,
|
|
84
|
-
posthog:
|
|
84
|
+
posthog: r,
|
|
85
85
|
children: ({ presentation: n }) => {
|
|
86
|
-
const
|
|
87
|
-
c && c(i),
|
|
86
|
+
const O = n?.kind === "status" ? n : void 0, { data: T } = o.instance_slot, d = F(y(T, "logo")), A = [O ? y(T, "reviewed_icon") : void 0, y(T, "icon")].map(F).find((X) => k(X?.guid)), v = k(d?.guid), G = v ? d?.color || "primary.main" : A?.color, L = v ?? k(A?.guid), w = ri(G), u = oi(E.palette, G), U = n ? O?.action?.label : o.primary_cta?.label || o.in_description_cta?.label || void 0, P = () => {
|
|
87
|
+
c && c(i), m(S(i.template), _), r?.capture("clicked_insight", {
|
|
88
88
|
beat_guid: i.guid,
|
|
89
89
|
template: i.template,
|
|
90
90
|
position: s,
|
|
91
91
|
...a && { is_insights_v2: !0 }
|
|
92
92
|
});
|
|
93
|
-
},
|
|
93
|
+
}, W = /* @__PURE__ */ e(q, {
|
|
94
94
|
"aria-roledescription": "slide",
|
|
95
95
|
ariaLabel: g,
|
|
96
|
-
description:
|
|
96
|
+
description: o.description.html_text,
|
|
97
97
|
elevation: N,
|
|
98
98
|
heightOverrides: I,
|
|
99
|
-
icon:
|
|
100
|
-
|
|
99
|
+
icon: x && (ei(d?.guid) && !v ? /* @__PURE__ */ e(ti, {
|
|
100
|
+
categoryTint: o.instance_slot.block === vi ? yi : void 0,
|
|
101
|
+
logo: d,
|
|
101
102
|
size: 32
|
|
102
|
-
}) :
|
|
103
|
-
bgColor:
|
|
104
|
-
iconColor: u ? "inherit" :
|
|
105
|
-
name:
|
|
103
|
+
}) : L ? /* @__PURE__ */ e(D, {
|
|
104
|
+
bgColor: K(u ?? E.palette[w].main, 0.15),
|
|
105
|
+
iconColor: u ? "inherit" : w,
|
|
106
|
+
name: L,
|
|
106
107
|
sx: u ? { color: u } : void 0
|
|
107
|
-
}) : /* @__PURE__ */ e(
|
|
108
|
-
bgColor:
|
|
108
|
+
}) : /* @__PURE__ */ e(D, {
|
|
109
|
+
bgColor: K(E.palette.primary.main, 0.15),
|
|
109
110
|
name: "lightbulb"
|
|
110
111
|
})),
|
|
111
112
|
isActiveCard: f,
|
|
112
113
|
isInsightsV2: !0,
|
|
113
|
-
onCardClick: n ?
|
|
114
|
-
onPrimaryAction: n ?
|
|
115
|
-
primaryActionText:
|
|
114
|
+
onCardClick: n ? P : p,
|
|
115
|
+
onPrimaryAction: n ? P : p,
|
|
116
|
+
primaryActionText: U,
|
|
116
117
|
ref: C,
|
|
117
|
-
title: n?.title ||
|
|
118
|
+
title: n?.title || o.title || "",
|
|
118
119
|
variant: R,
|
|
119
120
|
widthOverrides: h
|
|
120
121
|
});
|
|
121
|
-
return
|
|
122
|
+
return V ? /* @__PURE__ */ Ii(hi, { children: [W, M > 0 && /* @__PURE__ */ e(pi, {
|
|
122
123
|
beat: i,
|
|
123
124
|
openRequest: M,
|
|
124
|
-
posthog:
|
|
125
|
-
})] }) :
|
|
125
|
+
posthog: r
|
|
126
|
+
})] }) : W;
|
|
126
127
|
}
|
|
127
|
-
}) : /* @__PURE__ */ e(
|
|
128
|
+
}) : /* @__PURE__ */ e(q, {
|
|
128
129
|
"aria-roledescription": "slide",
|
|
129
130
|
ariaLabel: g,
|
|
130
131
|
description: i?.html_micro_description && i?.html_micro_description.length > 0 ? i.html_micro_description : i.html_description || "",
|
|
131
132
|
elevation: N,
|
|
132
133
|
heightOverrides: I,
|
|
133
|
-
icon:
|
|
134
|
+
icon: x && /* @__PURE__ */ e(ci, { beat: i }),
|
|
134
135
|
isActiveCard: f,
|
|
135
|
-
onCardClick:
|
|
136
|
-
onPrimaryAction:
|
|
137
|
-
primaryActionText: i.micro_call_to_action ||
|
|
136
|
+
onCardClick: p,
|
|
137
|
+
onPrimaryAction: p,
|
|
138
|
+
primaryActionText: i.micro_call_to_action || z?.micro_card_cta,
|
|
138
139
|
ref: C,
|
|
139
140
|
title: i.micro_title && i.micro_title.length > 0 ? i.micro_title : i.title,
|
|
140
141
|
variant: R,
|