@mx-cartographer/experiences 9.4.7 → 9.4.8
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 +10 -0
- package/dist/core/stores/InsightsV2Store.es.js +12 -8
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +2 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +19 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +19 -0
- package/dist/core/types/localization/index.d.ts +1 -1
- package/dist/insights-v2/{blocks/ComponentBlocks/ActionBlock → actionBlocks}/ActionBlockLayer.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +35 -0
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js +58 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.d.ts +27 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +228 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.d.ts +13 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +26 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.d.ts +11 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +77 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/images/SaveEnoughToLiveOnBottom.es.js +21 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/images/SaveEnoughToLiveOnBottom.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/index.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +57 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +85 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/{blocks/ComponentBlocks/ActionBlock → actionBlocks}/PlaceholderActionBlock.d.ts +1 -1
- package/dist/insights-v2/{blocks/ComponentBlocks/ActionBlock → actionBlocks}/PlaceholderActionBlock.es.js +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.d.ts +4 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js +18 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +18 -18
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/SaveAnExtraCard.d.ts +3 -21
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +55 -47
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/ThemedSVGImage.es.js +12 -12
- package/dist/insights-v2/components/chartblocks/ThemedSVGImage.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +46 -44
- package/dist/insights-v2/mappings/blocks.d.ts +3 -2
- package/dist/insights-v2/mappings/blocks.es.js +48 -29
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/ActionBlock/ActionBlockLayer.es.js +0 -41
- package/dist/insights-v2/blocks/ComponentBlocks/ActionBlock/ActionBlockLayer.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/ActionBlock/PlaceholderActionBlock.es.js.map +0 -1
|
@@ -2,17 +2,17 @@ import { useInsightsV2Store as u } from "../../common/context/hooks.es.js";
|
|
|
2
2
|
import { blocks as g } from "../mappings/blocks.es.js";
|
|
3
3
|
import y from "./Footer.es.js";
|
|
4
4
|
import _ from "./Header.es.js";
|
|
5
|
-
import { ActionBlockLayer as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { ChevronRight as
|
|
5
|
+
import { ActionBlockLayer as k } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
6
|
+
import l from "@mui/material/Stack";
|
|
7
|
+
import c from "@mui/material/Button";
|
|
8
|
+
import { ChevronRight as x } from "@mxenabled/mx-icons";
|
|
9
9
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
10
10
|
import C from "@mui/material/Card";
|
|
11
11
|
var A = ({ beat: o }) => {
|
|
12
|
-
const { openCtaDrawer:
|
|
12
|
+
const { openCtaDrawer: s } = u(), t = o.insights_payload;
|
|
13
13
|
if (!t) return null;
|
|
14
|
-
const { instance_slot: p, primary_cta:
|
|
15
|
-
return /* @__PURE__ */ i(
|
|
14
|
+
const { instance_slot: p, primary_cta: n, secondary_cta: e, subtitle: m, widget_type: h } = t, { block: f } = p, a = g[f], d = h === "mini";
|
|
15
|
+
return /* @__PURE__ */ i(l, {
|
|
16
16
|
sx: { mb: 16 },
|
|
17
17
|
children: [
|
|
18
18
|
/* @__PURE__ */ i(C, { children: [
|
|
@@ -25,7 +25,7 @@ var A = ({ beat: o }) => {
|
|
|
25
25
|
beatGuid: o.guid,
|
|
26
26
|
payload: t
|
|
27
27
|
}),
|
|
28
|
-
/* @__PURE__ */ i(
|
|
28
|
+
/* @__PURE__ */ i(l, {
|
|
29
29
|
sx: {
|
|
30
30
|
gap: 6,
|
|
31
31
|
pb: 16,
|
|
@@ -36,8 +36,8 @@ var A = ({ beat: o }) => {
|
|
|
36
36
|
children: [/* @__PURE__ */ r("div", {
|
|
37
37
|
dangerouslySetInnerHTML: { __html: o.html_description },
|
|
38
38
|
style: { paddingLeft: 4 }
|
|
39
|
-
}), o?.in_description_cta && /* @__PURE__ */ r(
|
|
40
|
-
endIcon: /* @__PURE__ */ r(
|
|
39
|
+
}), o?.in_description_cta && /* @__PURE__ */ r(c, {
|
|
40
|
+
endIcon: /* @__PURE__ */ r(x, {}),
|
|
41
41
|
onClick: () => {
|
|
42
42
|
},
|
|
43
43
|
sx: {
|
|
@@ -48,24 +48,24 @@ var A = ({ beat: o }) => {
|
|
|
48
48
|
children: o.in_description_cta
|
|
49
49
|
})]
|
|
50
50
|
}),
|
|
51
|
-
!d &&
|
|
51
|
+
!d && n?.label && /* @__PURE__ */ i(l, {
|
|
52
52
|
sx: {
|
|
53
53
|
gap: 8,
|
|
54
54
|
pb: 16,
|
|
55
55
|
px: 16
|
|
56
56
|
},
|
|
57
|
-
children: [/* @__PURE__ */ r(
|
|
58
|
-
onClick: () =>
|
|
57
|
+
children: [/* @__PURE__ */ r(c, {
|
|
58
|
+
onClick: () => n.block && s(o.guid, "primaryCta"),
|
|
59
59
|
variant: "outlined",
|
|
60
|
-
children:
|
|
61
|
-
}),
|
|
60
|
+
children: n.label
|
|
61
|
+
}), e?.label && /* @__PURE__ */ r(c, {
|
|
62
62
|
color: "secondary",
|
|
63
|
-
onClick: () =>
|
|
64
|
-
children:
|
|
63
|
+
onClick: () => e.block && s(o.guid, "secondaryCta"),
|
|
64
|
+
children: e.label
|
|
65
65
|
})]
|
|
66
66
|
})
|
|
67
67
|
] }),
|
|
68
|
-
/* @__PURE__ */ r(
|
|
68
|
+
/* @__PURE__ */ r(k, { beat: o }),
|
|
69
69
|
t.footer && /* @__PURE__ */ r(y, { footer: t.footer })
|
|
70
70
|
]
|
|
71
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { blocks } from '../mappings/blocks'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport { useInsightsV2Store } from '../../common'\nimport type { Beat } from '../../core'\nimport { ActionBlockLayer } from '../
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { blocks } from '../mappings/blocks'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport { useInsightsV2Store } from '../../common'\nimport type { Beat } from '../../core'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\n\ninterface BaseLayoutProps {\n beat: Beat\n}\n\nconst BaseLayout = ({ beat }: BaseLayoutProps) => {\n const { openCtaDrawer } = useInsightsV2Store()\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) {\n return null\n }\n\n const { instance_slot, primary_cta, secondary_cta, subtitle, widget_type } = insights_payload\n const { block } = instance_slot\n\n const Block = blocks[block as keyof typeof blocks]\n\n const isMini = widget_type === 'mini'\n\n return (\n <Stack sx={{ mb: 16 }}>\n <Card>\n {/* Header */}\n <Header isMini={isMini} subtitle={subtitle} title={beat.title} />\n\n {/* Instance Slot */}\n {Block && <Block beatGuid={beat.guid} payload={insights_payload} />}\n\n {/* Body */}\n <Stack sx={{ gap: 6, pb: 16, pl: 12, pr: 16, pt: 12 }}>\n <div\n dangerouslySetInnerHTML={{\n __html: beat.html_description as string,\n }}\n style={{ paddingLeft: 4 }}\n />\n {beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {/* CTA. A CTA without a real `block` doesn't open a drawer (it may trigger\n a postMessage etc.) — restrict the drawer to CTAs that carry a block. */}\n {!isMini && primary_cta?.label && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n <Button\n onClick={() => primary_cta.block && openCtaDrawer(beat.guid, 'primaryCta')}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n {secondary_cta?.label && (\n <Button\n color=\"secondary\"\n onClick={() => secondary_cta.block && openCtaDrawer(beat.guid, 'secondaryCta')}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n </Card>\n\n {/* Always mounted: the drawer's slide in/out animation only plays when\n MUI sees isOpen CHANGE on a mounted Drawer — conditionally mounting\n it here made it snap open and vanish on close. */}\n <ActionBlockLayer beat={beat} />\n\n {/* Footer */}\n {insights_payload.footer && <Footer footer={insights_payload.footer} />}\n </Stack>\n )\n}\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;AAkBA,IAAM,IAAA,CAAc,EAAE,MAAA,EAAA,MAA4B;AAChD,QAAM,EAAE,eAAA,EAAA,IAAkB,EAAmB,GAEvC,IAAmB,EAAK;AAE9B,MAAI,CAAC,EACH,QAAO;AAGT,QAAM,EAAE,eAAA,GAAe,aAAA,GAAa,eAAA,GAAe,UAAA,GAAU,aAAA,EAAA,IAAgB,GACvE,EAAE,OAAA,EAAA,IAAU,GAEZ,IAAQ,EAAO,CAAA,GAEf,IAAS,MAAgB;AAE/B,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAApB,UAAA;AAAA,MACE,gBAAA,EAAC,GAAD,EAAA,UAAA;AAAA,QAEE,gBAAA,EAAC,GAAD;AAAA,UAAgB,QAAA;AAAA,UAAkB,UAAA;AAAA,UAAU,OAAO,EAAK;AAAA,QAAQ,CAAA;AAAA,QAG/D,KAAS,gBAAA,EAAC,GAAD;AAAA,UAAO,UAAU,EAAK;AAAA,UAAM,SAAS;AAAA,QAAmB,CAAA;AAAA,QAGlE,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,KAAK;AAAA,YAAG,IAAI;AAAA,YAAI,IAAI;AAAA,YAAI,IAAI;AAAA,YAAI,IAAI;AAAA,UAAG;AAAA,UAApD,UAAA,CACE,gBAAA,EAAC,OAAD;AAAA,YACE,yBAAyB,EACvB,QAAQ,EAAK,iBACf;AAAA,YACA,OAAO,EAAE,aAAa,EAAE;AAAA,UACzB,CAAA,GACA,GAAM,sBACL,gBAAA,EAAC,GAAD;AAAA,YACE,SAAS,gBAAA,EAAC,GAAD,CAAe,CAAA;AAAA,YACxB,SAAA,MAAe;AAAA,YAAC;AAAA,YAChB,IAAI;AAAA,cAAE,QAAQ;AAAA,cAAI,GAAG;AAAA,cAAG,OAAO;AAAA,YAAc;AAAA,YAE5C,UAAA,EAAK;AAAA,UACA,CAAA,CAEL;AAAA;QAIN,CAAC,KAAU,GAAa,SACvB,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,KAAK;AAAA,YAAG,IAAI;AAAA,YAAI,IAAI;AAAA,UAAG;AAAA,UAApC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YACE,SAAA,MAAe,EAAY,SAAS,EAAc,EAAK,MAAM,YAAY;AAAA,YACzE,SAAQ;AAAA,YAEP,UAAA,EAAY;AAAA,UACP,CAAA,GACP,GAAe,SACd,gBAAA,EAAC,GAAD;AAAA,YACE,OAAM;AAAA,YACN,SAAA,MAAe,EAAc,SAAS,EAAc,EAAK,MAAM,cAAc;AAAA,YAE5E,UAAA,EAAc;AAAA,UACT,CAAA,CAEL;AAAA;MAEL,EAAA,CAAA;AAAA,MAKN,gBAAA,EAAC,GAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,MAG9B,EAAiB,UAAU,gBAAA,EAAC,GAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,IACjE;AAAA;AAEX"}
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
2
|
interface SaveAnExtraCardProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** Large amount in the green header (e.g. "$100.00"). */
|
|
6
|
-
amount: string;
|
|
7
|
-
/** Small caption under the header amount (e.g. "to help your funds grow"). */
|
|
8
|
-
description: string;
|
|
9
|
-
/** Large amount in the white footer (e.g. "$3,320.00"). */
|
|
10
|
-
footerAmount: string;
|
|
11
|
-
/** Small caption under the footer amount (e.g. "After payday & projected expenses"). */
|
|
12
|
-
footerDescription: string;
|
|
13
|
-
/** Header surface color token. Default `success.main` (green). */
|
|
3
|
+
primaryText?: string[];
|
|
4
|
+
secondaryText?: string[];
|
|
14
5
|
bgcolor?: string;
|
|
15
6
|
sx?: SxProps<Theme>;
|
|
16
7
|
}
|
|
17
|
-
|
|
18
|
-
* Save an Extra content: a green header ("Save an extra" / amount / caption)
|
|
19
|
-
* over a white footer (projected amount / caption), wrapped in a rounded,
|
|
20
|
-
* green-outlined card. Mirrors the v1 `SaveAnExtra100` structure with
|
|
21
|
-
* theme-aware tokens so it flips correctly in dark mode.
|
|
22
|
-
*
|
|
23
|
-
* Figma: Save an Extra $100 Content (Full variant). Scope is the Content
|
|
24
|
-
* section only.
|
|
25
|
-
*/
|
|
26
|
-
declare const SaveAnExtraCard: ({ title, amount, description, footerAmount, footerDescription, bgcolor, sx, }: SaveAnExtraCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const SaveAnExtraCard: ({ primaryText, secondaryText, bgcolor, sx, }: SaveAnExtraCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
9
|
export default SaveAnExtraCard;
|
|
@@ -1,57 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatCurrency as i } from "../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import { getLogoElevation as h } from "./logoShadow.es.js";
|
|
2
3
|
import { Text as r } from "@mxenabled/mxui";
|
|
3
|
-
import { jsx as
|
|
4
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
4
5
|
import t from "@mui/material/Box";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
borderColor: "success.main",
|
|
9
|
-
borderRadius: 2,
|
|
10
|
-
boxShadow: x,
|
|
11
|
-
overflow: "hidden",
|
|
12
|
-
...l
|
|
13
|
-
},
|
|
14
|
-
children: [/* @__PURE__ */ o(t, {
|
|
6
|
+
var C = ({ primaryText: n = [], secondaryText: a = [], bgcolor: c = "success.main", sx: l }) => {
|
|
7
|
+
const [d, s, p] = n, [m, x] = a;
|
|
8
|
+
return /* @__PURE__ */ e(t, {
|
|
15
9
|
sx: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
border: "1px solid",
|
|
11
|
+
borderColor: "success.main",
|
|
12
|
+
borderRadius: 2,
|
|
13
|
+
boxShadow: h,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
...l
|
|
21
16
|
},
|
|
22
|
-
children: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
children: [/* @__PURE__ */ e(t, {
|
|
18
|
+
sx: {
|
|
19
|
+
bgcolor: c,
|
|
20
|
+
color: "success.contrastText",
|
|
21
|
+
p: 16,
|
|
22
|
+
pt: 12,
|
|
23
|
+
textAlign: "center"
|
|
24
|
+
},
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ o(r, {
|
|
27
|
+
color: "inherit",
|
|
28
|
+
variant: "subtitle1",
|
|
29
|
+
children: d
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ o(r, {
|
|
32
|
+
bold: !0,
|
|
33
|
+
color: "inherit",
|
|
34
|
+
variant: "h1",
|
|
35
|
+
children: i(Number(s ?? "0"), "0,0.00")
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ o(r, {
|
|
38
|
+
color: "inherit",
|
|
39
|
+
variant: "caption",
|
|
40
|
+
children: p
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}), /* @__PURE__ */ e(t, {
|
|
44
|
+
sx: {
|
|
45
|
+
bgcolor: "background.paper",
|
|
46
|
+
px: 16,
|
|
47
|
+
py: 12,
|
|
48
|
+
textAlign: "center"
|
|
49
|
+
},
|
|
50
|
+
children: [/* @__PURE__ */ o(r, {
|
|
51
|
+
variant: "h3",
|
|
52
|
+
children: i(Number(m ?? "0"), "0,0.00")
|
|
53
|
+
}), /* @__PURE__ */ o(r, {
|
|
54
|
+
color: "text.secondary",
|
|
32
55
|
variant: "caption",
|
|
33
|
-
children:
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
}), /* @__PURE__ */ o(t, {
|
|
37
|
-
sx: {
|
|
38
|
-
bgcolor: "background.paper",
|
|
39
|
-
px: 16,
|
|
40
|
-
py: 12,
|
|
41
|
-
textAlign: "center"
|
|
42
|
-
},
|
|
43
|
-
children: [/* @__PURE__ */ e(r, {
|
|
44
|
-
variant: "h3",
|
|
45
|
-
children: c
|
|
46
|
-
}), /* @__PURE__ */ e(r, {
|
|
47
|
-
color: "text.secondary",
|
|
48
|
-
variant: "caption",
|
|
49
|
-
children: s
|
|
56
|
+
children: x
|
|
57
|
+
})]
|
|
50
58
|
})]
|
|
51
|
-
})
|
|
52
|
-
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
53
61
|
export {
|
|
54
|
-
|
|
62
|
+
C as default
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
//# sourceMappingURL=SaveAnExtraCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveAnExtraCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SaveAnExtraCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport {
|
|
1
|
+
{"version":3,"file":"SaveAnExtraCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SaveAnExtraCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport type { SxProps, Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\nimport { getLogoElevation } from './logoShadow'\n\ninterface SaveAnExtraCardProps {\n primaryText?: string[]\n secondaryText?: string[]\n bgcolor?: string\n sx?: SxProps<Theme>\n}\n\nconst SaveAnExtraCard = ({\n primaryText = [],\n secondaryText = [],\n bgcolor = 'success.main',\n sx,\n}: SaveAnExtraCardProps) => {\n const [leadIn, amount, trailingCopy] = primaryText\n const [projected, projectedCaption] = secondaryText\n\n return (\n <Box\n sx={{\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: 2,\n boxShadow: getLogoElevation,\n overflow: 'hidden',\n ...sx,\n }}\n >\n {/* Green header */}\n <Box\n sx={{\n bgcolor,\n color: 'success.contrastText',\n p: 16,\n pt: 12,\n textAlign: 'center',\n }}\n >\n <Text color=\"inherit\" variant=\"subtitle1\">\n {leadIn}\n </Text>\n <Text bold={true} color=\"inherit\" variant=\"h1\">\n {formatCurrency(Number(amount ?? '0'), '0,0.00')}\n </Text>\n <Text color=\"inherit\" variant=\"caption\">\n {trailingCopy}\n </Text>\n </Box>\n\n {/* White footer with projected amount */}\n <Box sx={{ bgcolor: 'background.paper', px: 16, py: 12, textAlign: 'center' }}>\n <Text variant=\"h3\">{formatCurrency(Number(projected ?? '0'), '0,0.00')}</Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {projectedCaption}\n </Text>\n </Box>\n </Box>\n )\n}\n\nexport default SaveAnExtraCard\n"],"mappings":";;;;;AAgBA,IAAM,IAAA,CAAmB,EACvB,aAAA,IAAc,CAAC,GACf,eAAA,IAAgB,CAAC,GACjB,SAAA,IAAU,gBACV,IAAA,EAAA,MAC0B;AAC1B,QAAM,CAAC,GAAQ,GAAQ,CAAA,IAAgB,GACjC,CAAC,GAAW,CAAA,IAAoB;AAEtC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,WAAW;AAAA,MACX,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IARF,UAAA,CAWE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAA;AAAA,QACA,OAAO;AAAA,QACP,GAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MAPF,UAAA;AAAA,QASE,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,SAAQ;AAAA,UAC3B,UAAA;AAAA,QACG,CAAA;AAAA,QACN,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,OAAM;AAAA,UAAU,SAAQ;AAAA,UACvC,UAAA,EAAe,OAAO,KAAU,GAAG,GAAG,QAAQ;AAAA,QAC3C,CAAA;AAAA,QACN,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,SAAQ;AAAA,UAC3B,UAAA;AAAA,QACG,CAAA;AAAA,MACH;AAAA,IAGL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MAAK,IAAI;AAAA,QAAE,SAAS;AAAA,QAAoB,IAAI;AAAA,QAAI,IAAI;AAAA,QAAI,WAAW;AAAA,MAAS;AAAA,MAA5E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,SAAQ;AAAA,QAAM,UAAA,EAAe,OAAO,KAAa,GAAG,GAAG,QAAQ;AAAA,MAAQ,CAAA,GAC7E,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,SAAQ;AAAA,QAClC,UAAA;AAAA,MACG,CAAA,CACH;AAAA,IACF,CAAA,CAAA;AAAA;AAET"}
|
|
@@ -13,16 +13,16 @@ var h = 200, v = 130, b = (r) => r || null, c = (r, o) => {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
}, E = ({ divProps: r, image: o, isMini: n = !1 }) => {
|
|
16
|
-
const e = d(), t = u(null)
|
|
17
|
-
100: e.palette.primary.lighter,
|
|
18
|
-
200: e.palette.primary.light,
|
|
19
|
-
300: e.palette.primary.main,
|
|
20
|
-
400: e.palette.primary.dark,
|
|
21
|
-
500: e.palette.primary.darker
|
|
22
|
-
};
|
|
16
|
+
const e = d(), t = u(null);
|
|
23
17
|
return y(() => {
|
|
24
18
|
if (!t.current) return;
|
|
25
|
-
const
|
|
19
|
+
const l = t.current, a = {
|
|
20
|
+
100: e.palette.primary.lighter,
|
|
21
|
+
200: e.palette.primary.light,
|
|
22
|
+
300: e.palette.primary.main,
|
|
23
|
+
400: e.palette.primary.dark,
|
|
24
|
+
500: e.palette.primary.darker
|
|
25
|
+
}, m = l.querySelectorAll(".Overlay");
|
|
26
26
|
[
|
|
27
27
|
"brand100",
|
|
28
28
|
"brand200",
|
|
@@ -30,10 +30,10 @@ var h = 200, v = 130, b = (r) => r || null, c = (r, o) => {
|
|
|
30
30
|
"brand400",
|
|
31
31
|
"brand500"
|
|
32
32
|
].forEach((i) => {
|
|
33
|
-
const f =
|
|
34
|
-
c(f,
|
|
35
|
-
}), c(m,
|
|
36
|
-
}, [
|
|
33
|
+
const f = l.querySelectorAll(`.${i}`), p = i.replace("brand", "");
|
|
34
|
+
c(f, a[p]);
|
|
35
|
+
}), c(m, a[300]);
|
|
36
|
+
}, [e]), /* @__PURE__ */ s("div", {
|
|
37
37
|
style: {
|
|
38
38
|
maxWidth: n ? v : h,
|
|
39
39
|
width: "100%"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedSVGImage.es.js","names":[],"sources":["../../../../src/insights-v2/components/chartblocks/ThemedSVGImage.tsx"],"sourcesContent":["/* eslint-disable react/jsx-pascal-case */\n\nimport { useEffect, useRef } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport type { ThemedSVGImageProps } from '../../../core'\n\nconst MAX_SVG_WIDTH = 200\nconst MINI_SVG_WIDTH = 130\n\n// Utility function to get an SVG element from a DOM node\nconst getSVGElement = (element: Element | null): SVGElement | null => {\n return element ? (element as SVGElement) : null\n}\n\n// Utility function to apply color to SVG elements\nconst applyColorToSVG = (elements: NodeListOf<Element>, color: string) => {\n elements.forEach((element) => {\n const svgElement = getSVGElement(element)\n if (svgElement) {\n const strokeAttr = svgElement.getAttribute('stroke')\n const fillAttr = svgElement.getAttribute('fill')\n\n if (strokeAttr && strokeAttr !== 'white') {\n svgElement.style.setProperty('stroke', color)\n }\n\n if (fillAttr) {\n const fillColor = fillAttr === 'white' ? 'white' : color\n svgElement.style.setProperty('fill', fillColor)\n }\n }\n })\n}\n\nexport const ThemedSVGImage = ({ divProps, image: SVG, isMini = false }: ThemedSVGImageProps) => {\n const theme = useTheme()\n const containerRef = useRef<SVGSVGElement | null>(null)\n\n
|
|
1
|
+
{"version":3,"file":"ThemedSVGImage.es.js","names":[],"sources":["../../../../src/insights-v2/components/chartblocks/ThemedSVGImage.tsx"],"sourcesContent":["/* eslint-disable react/jsx-pascal-case */\n\nimport { useEffect, useRef } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport type { ThemedSVGImageProps } from '../../../core'\n\nconst MAX_SVG_WIDTH = 200\nconst MINI_SVG_WIDTH = 130\n\n// Utility function to get an SVG element from a DOM node\nconst getSVGElement = (element: Element | null): SVGElement | null => {\n return element ? (element as SVGElement) : null\n}\n\n// Utility function to apply color to SVG elements\nconst applyColorToSVG = (elements: NodeListOf<Element>, color: string) => {\n elements.forEach((element) => {\n const svgElement = getSVGElement(element)\n if (svgElement) {\n const strokeAttr = svgElement.getAttribute('stroke')\n const fillAttr = svgElement.getAttribute('fill')\n\n if (strokeAttr && strokeAttr !== 'white') {\n svgElement.style.setProperty('stroke', color)\n }\n\n if (fillAttr) {\n const fillColor = fillAttr === 'white' ? 'white' : color\n svgElement.style.setProperty('fill', fillColor)\n }\n }\n })\n}\n\nexport const ThemedSVGImage = ({ divProps, image: SVG, isMini = false }: ThemedSVGImageProps) => {\n const theme = useTheme()\n const containerRef = useRef<SVGSVGElement | null>(null)\n\n // If the client does not have a color scheme aka widget brand color, set the colors to the primary kyper token colors\n // Apply color scheme to SVG elements when the component mounts or the theme changes.\n // `colors` is derived inside the effect so it isn't a new reference every render.\n useEffect(() => {\n if (!containerRef.current) return\n\n const container = containerRef.current\n\n const colors = {\n '100': (theme as any).palette.primary.lighter,\n '200': theme.palette.primary.light,\n '300': theme.palette.primary.main,\n '400': theme.palette.primary.dark,\n '500': (theme as any).palette.primary.darker,\n }\n\n const overlayElements = container.querySelectorAll('.Overlay')\n const brandElements = ['brand100', 'brand200', 'brand300', 'brand400', 'brand500']\n\n brandElements.forEach((className) => {\n const elements = container.querySelectorAll(`.${className}`)\n const colorKey = className.replace('brand', '') as keyof typeof colors\n applyColorToSVG(elements, colors[colorKey])\n })\n\n // Apply the color for overlays separately (using the 300 color scheme)\n applyColorToSVG(overlayElements, colors['300'])\n }, [theme])\n\n return (\n <div\n style={{\n maxWidth: isMini ? MINI_SVG_WIDTH : MAX_SVG_WIDTH,\n width: '100%',\n }}\n {...divProps}\n >\n <SVG ref={containerRef} />\n </div>\n )\n}\n"],"mappings":";;;AAOA,IAAM,IAAgB,KAChB,IAAiB,KAGjB,IAAA,CAAiB,MACd,KAAoC,MAIvC,IAAA,CAAmB,GAA+B,MAAkB;AACxE,EAAA,EAAS,QAAA,CAAS,MAAY;AAC5B,UAAM,IAAa,EAAc,CAAO;AACxC,QAAI,GAAY;AACd,YAAM,IAAa,EAAW,aAAa,QAAQ,GAC7C,IAAW,EAAW,aAAa,MAAM;AAM/C,UAJI,KAAc,MAAe,WAC/B,EAAW,MAAM,YAAY,UAAU,CAAK,GAG1C,GAAU;AACZ,cAAM,IAAY,MAAa,UAAU,UAAU;AACnD,QAAA,EAAW,MAAM,YAAY,QAAQ,CAAS;AAAA,MAChD;AAAA,IACF;AAAA,EACF,CAAC;AACH,GAEa,IAAA,CAAkB,EAAE,UAAA,GAAU,OAAO,GAAK,QAAA,IAAS,GAAA,MAAiC;AAC/F,QAAM,IAAQ,EAAS,GACjB,IAAe,EAA6B,IAAI;AAKtD,SAAA,EAAA,MAAgB;AACd,QAAI,CAAC,EAAa,QAAS;AAE3B,UAAM,IAAY,EAAa,SAEzB,IAAS;AAAA,MACb,KAAQ,EAAc,QAAQ,QAAQ;AAAA,MACtC,KAAO,EAAM,QAAQ,QAAQ;AAAA,MAC7B,KAAO,EAAM,QAAQ,QAAQ;AAAA,MAC7B,KAAO,EAAM,QAAQ,QAAQ;AAAA,MAC7B,KAAQ,EAAc,QAAQ,QAAQ;AAAA,IACxC,GAEM,IAAkB,EAAU,iBAAiB,UAAU;AAG7D;AAAA,MAFuB;AAAA,MAAY;AAAA,MAAY;AAAA,MAAY;AAAA,MAAY;AAAA,IAEvE,EAAc,QAAA,CAAS,MAAc;AACnC,YAAM,IAAW,EAAU,iBAAiB,IAAI,CAAA,EAAW,GACrD,IAAW,EAAU,QAAQ,SAAS,EAAE;AAC9C,MAAA,EAAgB,GAAU,EAAO,CAAA,CAAS;AAAA,IAC5C,CAAC,GAGD,EAAgB,GAAiB,EAAO,GAAA,CAAM;AAAA,EAChD,GAAG,CAAC,CAAK,CAAC,GAGR,gBAAA,EAAC,OAAD;AAAA,IACE,OAAO;AAAA,MACL,UAAU,IAAS,IAAiB;AAAA,MACpC,OAAO;AAAA,IACT;AAAA,IACA,GAAI;AAAA,IAEJ,UAAA,gBAAA,EAAC,GAAD,EAAK,KAAK,EAAe,CAAA;AAAA,EACtB,CAAA;AAET"}
|
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { BAR_CHART_VARIANTS as o, barChartVariant as t, buildChartData as m, buildDataSeries as
|
|
1
|
+
import { BAR_CHART_VARIANTS as o, barChartVariant as t, buildChartData as m, buildDataSeries as a } from "./blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
2
2
|
import { BarchartBlock as p } from "./blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
3
3
|
import { DoubleBarChartBlock as e } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
4
|
-
import
|
|
4
|
+
import l from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
5
5
|
import s from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
6
6
|
import g from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
7
|
-
import { BudgetBlock as
|
|
8
|
-
import S from "./components/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import P from "./
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import _ from "./components/
|
|
18
|
-
import G from "./components/
|
|
19
|
-
import O from "./components/
|
|
20
|
-
import j from "./components/
|
|
21
|
-
import z from "./components/
|
|
22
|
-
import J from "./components/
|
|
23
|
-
import Q from "./components/
|
|
24
|
-
import X from "./components/
|
|
25
|
-
import Z from "./components/
|
|
26
|
-
import rr from "./components/
|
|
7
|
+
import { BudgetBlock as u } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
8
|
+
import S from "./components/SaveAnExtraCard.es.js";
|
|
9
|
+
import h from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
10
|
+
import T from "./components/InsightTransactionRow.es.js";
|
|
11
|
+
import D from "./components/TransactionListCard.es.js";
|
|
12
|
+
import { CategoryTransactionsBlock as P } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
13
|
+
import { SVGImageBlock as y } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
14
|
+
import R from "./components/AccountHeroCard.es.js";
|
|
15
|
+
import E from "./components/AmountPill.es.js";
|
|
16
|
+
import V from "./components/DesignateEmergencySavingsCard.es.js";
|
|
17
|
+
import _ from "./components/BaseLayout.es.js";
|
|
18
|
+
import G from "./components/StatusMessageCard.es.js";
|
|
19
|
+
import O from "./components/LogoTile.es.js";
|
|
20
|
+
import j from "./components/LogoClusterCard.es.js";
|
|
21
|
+
import z from "./components/MerchantHighlightCard.es.js";
|
|
22
|
+
import J from "./components/P2PLogoStack.es.js";
|
|
23
|
+
import Q from "./components/SavingsOpportunityCard.es.js";
|
|
24
|
+
import X from "./components/StatusPill.es.js";
|
|
25
|
+
import Z from "./components/SubscriptionHeroCard.es.js";
|
|
26
|
+
import rr from "./components/TransferLogoCard.es.js";
|
|
27
|
+
import tr from "./components/UpcomingBillCard.es.js";
|
|
27
28
|
export {
|
|
28
29
|
g as AccountBlock,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
R as AccountHeroCard,
|
|
31
|
+
E as AmountPill,
|
|
31
32
|
o as BAR_CHART_VARIANTS,
|
|
32
33
|
p as BarchartBlock,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
_ as BaseLayout,
|
|
35
|
+
u as BudgetBlock,
|
|
36
|
+
P as CategoryTransactionsBlock,
|
|
37
|
+
V as DesignateEmergencySavingsCard,
|
|
38
|
+
l as DonutChartBlock,
|
|
38
39
|
e as DoubleBarChartBlock,
|
|
39
40
|
s as DoubleProgressBarBlock,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
X as
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
rr as
|
|
41
|
+
T as InsightTransactionRow,
|
|
42
|
+
j as LogoClusterCard,
|
|
43
|
+
O as LogoTile,
|
|
44
|
+
z as MerchantHighlightCard,
|
|
45
|
+
J as P2PLogoStack,
|
|
46
|
+
y as SVGImageBlock,
|
|
47
|
+
S as SaveAnExtraCard,
|
|
48
|
+
h as SaveExtraBlock,
|
|
49
|
+
Q as SavingsOpportunityCard,
|
|
50
|
+
G as StatusMessageCard,
|
|
51
|
+
X as StatusPill,
|
|
52
|
+
Z as SubscriptionHeroCard,
|
|
53
|
+
D as TransactionListCard,
|
|
54
|
+
rr as TransferLogoCard,
|
|
55
|
+
tr as UpcomingBillCard,
|
|
54
56
|
t as barChartVariant,
|
|
55
57
|
m as buildChartData,
|
|
56
|
-
|
|
58
|
+
a as buildDataSeries
|
|
57
59
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Beat, InsightsPayload } from '../../core';
|
|
1
|
+
import { Beat, GlobalCopy, InsightsPayload } from '../../core';
|
|
2
2
|
export interface ActionBlockProps {
|
|
3
3
|
beat: Beat;
|
|
4
4
|
}
|
|
5
|
+
export declare const hasDrawerBlock: (block?: string | null) => boolean;
|
|
5
6
|
export interface ActionBlockEntry {
|
|
6
7
|
Component: React.ComponentType<ActionBlockProps>;
|
|
7
8
|
usePrepare: (props: ActionBlockProps) => void;
|
|
8
|
-
title: string;
|
|
9
|
+
title?: (variant: string | null | undefined, copy: GlobalCopy) => string;
|
|
9
10
|
}
|
|
10
11
|
export declare const actionBlocks: Record<string, ActionBlockEntry>;
|
|
11
12
|
export declare const blocks: Record<string, React.ComponentType<{
|
|
@@ -1,34 +1,53 @@
|
|
|
1
|
-
import { BarchartBlock as
|
|
2
|
-
import { DoubleBarChartBlock as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { BudgetBlock as
|
|
7
|
-
import
|
|
8
|
-
import B from "../blocks/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { BarchartBlock as e } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
2
|
+
import { DoubleBarChartBlock as a } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
3
|
+
import m from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
4
|
+
import l from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
5
|
+
import c from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
6
|
+
import { BudgetBlock as i } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
7
|
+
import n from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
8
|
+
import { CategoryTransactionsBlock as B } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
9
|
+
import k from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
10
|
+
import { SVGImageBlock as p } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
11
|
+
import f from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
12
|
+
import { PlaceholderActionBlock as s } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
13
|
+
import { getMakeTransferDrawerTitle as u } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
14
|
+
import { MakeTransferActionBlockLayer as h } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
15
|
+
var t = (o) => {
|
|
16
|
+
}, C = /* @__PURE__ */ new Set([
|
|
17
|
+
"",
|
|
18
|
+
"null",
|
|
19
|
+
"undefined"
|
|
20
|
+
]), E = (o) => {
|
|
21
|
+
const r = o?.trim().toLowerCase();
|
|
22
|
+
return !!r && !C.has(r);
|
|
23
|
+
}, I = {
|
|
24
|
+
PlaceholderActionBlock: {
|
|
25
|
+
Component: s,
|
|
26
|
+
usePrepare: t,
|
|
27
|
+
title: () => "Action Block Layer Drilldown"
|
|
28
|
+
},
|
|
29
|
+
make_transfer: {
|
|
30
|
+
Component: h,
|
|
31
|
+
usePrepare: t,
|
|
32
|
+
title: u
|
|
33
|
+
}
|
|
34
|
+
}, M = {
|
|
35
|
+
AccountBlock: c,
|
|
36
|
+
BarChartBlock: e,
|
|
37
|
+
BudgetBlock: i,
|
|
38
|
+
CategoryTransactionsBlock: B,
|
|
39
|
+
DonutChartBlock: m,
|
|
40
|
+
DoubleBarChartBlock: a,
|
|
41
|
+
DoubleProgressBarBlock: l,
|
|
42
|
+
ImageBlock: k,
|
|
43
|
+
save_extra_block: n,
|
|
44
|
+
StepChartBlock: f,
|
|
45
|
+
SVGImageBlock: p
|
|
28
46
|
};
|
|
29
47
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
I as actionBlocks,
|
|
49
|
+
M as blocks,
|
|
50
|
+
E as hasDrawerBlock
|
|
32
51
|
};
|
|
33
52
|
|
|
34
53
|
//# sourceMappingURL=blocks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n BarchartBlock,\n BudgetBlock,\n CategoryTransactionsBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SVGImageBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, InsightsPayload } from '../../core'\nimport { PlaceholderActionBlock } from '../
|
|
1
|
+
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n BarchartBlock,\n BudgetBlock,\n CategoryTransactionsBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy (e.g.\n // MakeTransfer reads its variant title from layout.ts). Falls back to the CTA label.\n title?: (variant: string | null | undefined, copy: GlobalCopy) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\nexport const actionBlocks = {\n PlaceholderActionBlock: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n make_transfer: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n AccountBlock: AccountBlock,\n BarChartBlock: BarchartBlock,\n BudgetBlock: BudgetBlock,\n CategoryTransactionsBlock: CategoryTransactionsBlock,\n DonutChartBlock: DonutChartBlock,\n DoubleBarChartBlock: DoubleBarChartBlock,\n DoubleProgressBarBlock: DoubleProgressBarBlock,\n ImageBlock: ImageBlock,\n save_extra_block: SaveExtraBlock,\n StepChartBlock: StepChartBlock,\n SVGImageBlock: SVGImageBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;AAyBA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAKjC,IAAmB,oBAAI,IAAI;AAAA,EAAC;AAAA,EAAI;AAAA,EAAQ;AAAW,CAAC,GAC7C,IAAA,CAAkB,MAAmC;AAChE,QAAM,IAAa,GAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,CAAC,CAAC,KAAc,CAAC,EAAiB,IAAI,CAAU;AACzD,GAea,IAAe;AAAA,EAC1B,wBAAwB;AAAA,IACtB,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EACA,eAAe;AAAA,IACb,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AACF,GAEa,IAAS;AAAA,EACN,cAAA;AAAA,EACd,eAAe;AAAA,EACF,aAAA;AAAA,EACc,2BAAA;AAAA,EACV,iBAAA;AAAA,EACI,qBAAA;AAAA,EACG,wBAAA;AAAA,EACZ,YAAA;AAAA,EACZ,kBAAkB;AAAA,EACF,gBAAA;AAAA,EACD,eAAA;AACjB"}
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useGlobalCopyStore as d, useGlobalUiStore as f, useInsightsV2Store as C } from "../../../../common/context/hooks.es.js";
|
|
2
|
-
import m from "../../../../common/components/drawer/Drawer.es.js";
|
|
3
|
-
import y from "../../../../common/components/Loader.es.js";
|
|
4
|
-
import { actionBlocks as g } from "../../../mappings/blocks.es.js";
|
|
5
|
-
import { observer as h } from "mobx-react-lite";
|
|
6
|
-
import _ from "@mui/material/Stack";
|
|
7
|
-
import { Text as k } from "@mxenabled/mxui";
|
|
8
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
-
var B = ({ actionBlock: c, ...r }) => {
|
|
10
|
-
const { Component: e, usePrepare: t } = c;
|
|
11
|
-
return t(r), /* @__PURE__ */ o(e, { ...r });
|
|
12
|
-
}, v = h(function({ beat: r }) {
|
|
13
|
-
const { common: e } = d(), { isCopyLoaded: t } = f(), { actionDrawer: n, closeActionDrawer: s } = C(), i = n.isDrawerOpen && n.guid === r.guid;
|
|
14
|
-
if (!t) return i ? /* @__PURE__ */ o(y, {}) : null;
|
|
15
|
-
if (!r.insights_payload) return null;
|
|
16
|
-
const { primary_cta: p, secondary_cta: u } = r.insights_payload, l = n.trigger === "secondaryCta" ? u : p, a = g[l?.block];
|
|
17
|
-
return a ? /* @__PURE__ */ o(m, {
|
|
18
|
-
ariaLabelClose: e.close_aria,
|
|
19
|
-
isOpen: i,
|
|
20
|
-
onClose: s,
|
|
21
|
-
title: a.title,
|
|
22
|
-
children: /* @__PURE__ */ o(B, {
|
|
23
|
-
actionBlock: a,
|
|
24
|
-
beat: r
|
|
25
|
-
}, l?.block)
|
|
26
|
-
}) : /* @__PURE__ */ o(m, {
|
|
27
|
-
ariaLabelClose: e.close_aria,
|
|
28
|
-
isOpen: i,
|
|
29
|
-
onClose: s,
|
|
30
|
-
title: e.error_heading,
|
|
31
|
-
children: /* @__PURE__ */ o(_, {
|
|
32
|
-
sx: { p: 24 },
|
|
33
|
-
children: /* @__PURE__ */ o(k, { children: e.error_message })
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
v as ActionBlockLayer
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=ActionBlockLayer.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBlockLayer.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/ActionBlock/ActionBlockLayer.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../../../common'\nimport { type Beat } from '../../../../core'\nimport {\n actionBlocks,\n type ActionBlockEntry,\n type ActionBlockProps,\n} from '../../../mappings/blocks'\n\ninterface ActionBlockLayerProps {\n beat: Beat\n}\n\n/**\n * Renders a registered action block. Callers MUST key this per block name — a\n * block with `usePrepare` and one without run a different number of hooks, so\n * reusing the same fiber across a block switch violates the rules of hooks.\n */\nconst ActionBlockRunner = ({\n actionBlock,\n ...blockProps\n}: ActionBlockProps & { actionBlock: ActionBlockEntry }) => {\n const { Component, usePrepare } = actionBlock\n\n usePrepare(blockProps)\n\n return <Component {...blockProps} />\n}\n\n// `observer` is required: this reads `isCopyLoaded` off GlobalUiStore and the\n// action drawer off InsightsV2Store. Without it the component never re-renders\n// and stays stuck on <Loader /> forever.\nexport const ActionBlockLayer = observer(function ActionBlockLayer({\n beat,\n}: ActionBlockLayerProps) {\n const { common: commonCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n\n // Every card in the feed renders its own layer against the shared store, so\n // this card's drawer only opens when its beat is the one that triggered it.\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === beat.guid\n\n if (!isCopyLoaded) return isCurrentBeatOpen ? <Loader /> : null\n\n // Mirrors BaseLayout's guard — the layer is exported, so callers are not\n // guaranteed to have narrowed this already.\n if (!beat.insights_payload) return null\n\n const { primary_cta, secondary_cta } = beat.insights_payload\n\n const currentCta = actionDrawer.trigger === 'secondaryCta' ? secondary_cta : primary_cta\n const actionBlock = actionBlocks[currentCta?.block as keyof typeof actionBlocks]\n\n if (!actionBlock) {\n return (\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isCurrentBeatOpen}\n onClose={closeActionDrawer}\n title={commonCopy.error_heading}\n >\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy.error_message}</Text>\n </Stack>\n </Drawer>\n )\n }\n\n return (\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isCurrentBeatOpen}\n onClose={closeActionDrawer}\n title={actionBlock.title}\n >\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n </Drawer>\n )\n})\n"],"mappings":";;;;;;;;AA4BA,IAAM,IAAA,CAAqB,EACzB,aAAA,GACA,GAAG,EAAA,MACuD;AAC1D,QAAM,EAAE,WAAA,GAAW,YAAA,EAAA,IAAe;AAElC,SAAA,EAAW,CAAU,GAEd,gBAAA,EAAC,GAAD,EAAW,GAAI,EAAa,CAAA;AACrC,GAKa,IAAmB,EAAS,SAA0B,EACjE,MAAA,EAAA,GACwB;AACxB,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,cAAA,GAAc,mBAAA,EAAA,IAAsB,EAAmB,GAIzD,IAAoB,EAAa,gBAAgB,EAAa,SAAS,EAAK;AAElF,MAAI,CAAC,EAAc,QAAO,IAAoB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAAI;AAI3D,MAAI,CAAC,EAAK,iBAAkB,QAAO;AAEnC,QAAM,EAAE,aAAA,GAAa,eAAA,EAAA,IAAkB,EAAK,kBAEtC,IAAa,EAAa,YAAY,iBAAiB,IAAgB,GACvE,IAAc,EAAa,GAAY,KAAA;AAE7C,SAAK,IAgBH,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO,EAAY;AAAA,IAEnB,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAgC,aAAA;AAAA,MAAmB,MAAA;AAAA,IAA+B,GAApB,GAAY,KAAQ;AAAA,EAC5E,CAAA,IArBN,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO,EAAW;AAAA,IAElB,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,GAAG,GAAG;AAAA,MACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,IACjC,CAAA;AAAA,EACD,CAAA;AAcd,CAAC"}
|