@mx-cartographer/experiences 9.4.12-alpha.al0 → 9.4.12
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 +3 -1
- package/dist/common/context/hooks.d.ts +1 -0
- package/dist/common/context/hooks.es.js +18 -17
- package/dist/common/context/hooks.es.js.map +1 -1
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +130 -129
- package/dist/common/utils/Theme.es.js +23 -23
- package/dist/common/utils/Theme.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.d.ts +24 -7
- package/dist/core/stores/InsightsV2Store.es.js +18 -23
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.d.ts +4 -27
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +253 -206
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.d.ts +5 -4
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -20
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/index.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +9 -43
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +12 -79
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +35 -13
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +17 -13
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +7 -7
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +17 -13
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +19 -25
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/createVariantBlock.d.ts +29 -0
- package/dist/insights-v2/blocks/createVariantBlock.es.js +13 -0
- package/dist/insights-v2/blocks/createVariantBlock.es.js.map +1 -0
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js +24 -25
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +18 -19
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +52 -50
- package/dist/insights-v2/mappings/blocks.es.js +20 -20
- package/package.json +1 -1
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
import { DrilldownPayload } from '../types';
|
|
2
1
|
import { GlobalStore } from './GlobalStore';
|
|
3
2
|
export type ActionDrawerTrigger = 'primaryCta' | 'secondaryCta' | 'chartBar';
|
|
4
3
|
export interface ActionDrawerState {
|
|
5
4
|
isDrawerOpen: boolean;
|
|
6
5
|
trigger: ActionDrawerTrigger;
|
|
7
|
-
chartBarIndex: number;
|
|
8
|
-
tabIndex: number;
|
|
9
6
|
guid: string;
|
|
7
|
+
/**
|
|
8
|
+
* Block-specific drilldown data, opaque to the store. Each action block defines
|
|
9
|
+
* and reads its own shape (via useActionContext<T>()), so adding a block never
|
|
10
|
+
* widens this envelope. Chart drilldowns put `{ chartBarIndex, tabIndex }` here;
|
|
11
|
+
* CTAs carry none.
|
|
12
|
+
*/
|
|
13
|
+
context: unknown;
|
|
10
14
|
}
|
|
11
15
|
export declare const CLOSED_ACTION_DRAWER: ActionDrawerState;
|
|
16
|
+
interface OpenActionDrawerArgs {
|
|
17
|
+
guid: string;
|
|
18
|
+
trigger: ActionDrawerTrigger;
|
|
19
|
+
context?: unknown;
|
|
20
|
+
}
|
|
12
21
|
/**
|
|
13
|
-
* UI state shared across the insights-v2 widget tree. Owns the action drawer
|
|
14
|
-
*
|
|
15
|
-
*
|
|
22
|
+
* UI state shared across the insights-v2 widget tree. Owns the action drawer so
|
|
23
|
+
* cards, charts, and action blocks coordinate through the store instead of prop
|
|
24
|
+
* drilling. The drawer state is a fixed envelope (isDrawerOpen/guid/trigger) plus
|
|
25
|
+
* an opaque `context` bag, so per-block drilldown data never leaks into this shape.
|
|
16
26
|
*/
|
|
17
27
|
export declare class InsightsV2Store {
|
|
18
28
|
globalStore: GlobalStore;
|
|
19
29
|
actionDrawer: ActionDrawerState;
|
|
20
30
|
constructor(globalStore: GlobalStore);
|
|
31
|
+
/**
|
|
32
|
+
* Generic drawer opener — the only opener a new action block needs. Pass the
|
|
33
|
+
* beat guid, the CTA/source that triggered it, and (optionally) a block-specific
|
|
34
|
+
* context object the block reads back via useActionContext.
|
|
35
|
+
*/
|
|
36
|
+
openActionDrawer: ({ guid, trigger, context }: OpenActionDrawerArgs) => void;
|
|
37
|
+
/** Convenience opener for CTA drawers (no drilldown context). */
|
|
21
38
|
openCtaDrawer: (guid: string, trigger: "primaryCta" | "secondaryCta") => void;
|
|
22
|
-
openChartDrilldown: (guid: string, { chartBarIndex, tabIndex }: DrilldownPayload) => void;
|
|
23
39
|
closeActionDrawer: () => void;
|
|
24
40
|
}
|
|
41
|
+
export {};
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import { makeAutoObservable as
|
|
2
|
-
var
|
|
3
|
-
chartBarIndex: 0,
|
|
4
|
-
tabIndex: 0,
|
|
1
|
+
import { makeAutoObservable as a } from "mobx";
|
|
2
|
+
var o = {
|
|
5
3
|
isDrawerOpen: !1,
|
|
6
4
|
trigger: "primaryCta",
|
|
7
|
-
guid: ""
|
|
8
|
-
|
|
5
|
+
guid: "",
|
|
6
|
+
context: void 0
|
|
7
|
+
}, s = class {
|
|
9
8
|
globalStore;
|
|
10
|
-
actionDrawer =
|
|
9
|
+
actionDrawer = o;
|
|
11
10
|
constructor(r) {
|
|
12
|
-
this.globalStore = r,
|
|
11
|
+
this.globalStore = r, a(this);
|
|
13
12
|
}
|
|
14
|
-
|
|
13
|
+
openActionDrawer = ({ guid: r, trigger: e, context: t }) => {
|
|
15
14
|
this.actionDrawer = {
|
|
16
|
-
chartBarIndex: 0,
|
|
17
|
-
tabIndex: 0,
|
|
18
15
|
isDrawerOpen: !0,
|
|
19
|
-
trigger:
|
|
20
|
-
guid: r
|
|
16
|
+
trigger: e,
|
|
17
|
+
guid: r,
|
|
18
|
+
context: t
|
|
21
19
|
};
|
|
22
20
|
};
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
trigger: "chartBar",
|
|
29
|
-
guid: r
|
|
30
|
-
};
|
|
21
|
+
openCtaDrawer = (r, e) => {
|
|
22
|
+
this.openActionDrawer({
|
|
23
|
+
guid: r,
|
|
24
|
+
trigger: e
|
|
25
|
+
});
|
|
31
26
|
};
|
|
32
27
|
closeActionDrawer = () => {
|
|
33
28
|
this.actionDrawer = {
|
|
@@ -38,8 +33,8 @@ var i = {
|
|
|
38
33
|
};
|
|
39
34
|
};
|
|
40
35
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
o as CLOSED_ACTION_DRAWER,
|
|
37
|
+
s as InsightsV2Store
|
|
43
38
|
};
|
|
44
39
|
|
|
45
40
|
//# sourceMappingURL=InsightsV2Store.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsV2Store.es.js","names":[],"sources":["../../../src/core/stores/InsightsV2Store.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport type {
|
|
1
|
+
{"version":3,"file":"InsightsV2Store.es.js","names":[],"sources":["../../../src/core/stores/InsightsV2Store.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport type { GlobalStore } from './GlobalStore'\n\nexport type ActionDrawerTrigger = 'primaryCta' | 'secondaryCta' | 'chartBar'\n\nexport interface ActionDrawerState {\n isDrawerOpen: boolean\n trigger: ActionDrawerTrigger\n guid: string\n /**\n * Block-specific drilldown data, opaque to the store. Each action block defines\n * and reads its own shape (via useActionContext<T>()), so adding a block never\n * widens this envelope. Chart drilldowns put `{ chartBarIndex, tabIndex }` here;\n * CTAs carry none.\n */\n context: unknown\n}\n\nexport const CLOSED_ACTION_DRAWER: ActionDrawerState = {\n isDrawerOpen: false,\n trigger: 'primaryCta',\n guid: '',\n context: undefined,\n}\n\ninterface OpenActionDrawerArgs {\n guid: string\n trigger: ActionDrawerTrigger\n context?: unknown\n}\n\n/**\n * UI state shared across the insights-v2 widget tree. Owns the action drawer so\n * cards, charts, and action blocks coordinate through the store instead of prop\n * drilling. The drawer state is a fixed envelope (isDrawerOpen/guid/trigger) plus\n * an opaque `context` bag, so per-block drilldown data never leaks into this shape.\n */\nexport class InsightsV2Store {\n globalStore: GlobalStore\n\n actionDrawer: ActionDrawerState = CLOSED_ACTION_DRAWER\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n\n makeAutoObservable(this)\n }\n\n /**\n * Generic drawer opener — the only opener a new action block needs. Pass the\n * beat guid, the CTA/source that triggered it, and (optionally) a block-specific\n * context object the block reads back via useActionContext.\n */\n openActionDrawer = ({ guid, trigger, context }: OpenActionDrawerArgs) => {\n this.actionDrawer = { isDrawerOpen: true, trigger, guid, context }\n }\n\n /** Convenience opener for CTA drawers (no drilldown context). */\n openCtaDrawer = (guid: string, trigger: 'primaryCta' | 'secondaryCta') => {\n this.openActionDrawer({ guid, trigger })\n }\n\n closeActionDrawer = () => {\n // Preserve `trigger` + `context` so the drawer keeps its variant-specific\n // title/content through the slide-out animation (ActionBlockLayer stays\n // mounted while closing). Only flip isDrawerOpen off and clear the beat guid.\n this.actionDrawer = { ...this.actionDrawer, isDrawerOpen: false, guid: '' }\n }\n}\n"],"mappings":";AAmBA,IAAa,IAA0C;AAAA,EACrD,cAAc;AAAA,EACd,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX,GAca,IAAb,MAA6B;AAAA,EAC3B;AAAA,EAEA,eAAkC;AAAA,EAElC,YAAY,GAA0B;AACpC,SAAK,cAAc,GAEnB,EAAmB,IAAI;AAAA,EACzB;AAAA,EAOA,mBAAA,CAAoB,EAAE,MAAA,GAAM,SAAA,GAAS,SAAA,EAAA,MAAoC;AACvE,SAAK,eAAe;AAAA,MAAE,cAAc;AAAA,MAAM,SAAA;AAAA,MAAS,MAAA;AAAA,MAAM,SAAA;AAAA,IAAQ;AAAA,EACnE;AAAA,EAGA,gBAAA,CAAiB,GAAc,MAA2C;AACxE,SAAK,iBAAiB;AAAA,MAAE,MAAA;AAAA,MAAM,SAAA;AAAA,IAAQ,CAAC;AAAA,EACzC;AAAA,EAEA,oBAAA,MAA0B;AAIxB,SAAK,eAAe;AAAA,MAAE,GAAG,KAAK;AAAA,MAAc,cAAc;AAAA,MAAO,MAAM;AAAA,IAAG;AAAA,EAC5E;AACF"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
description?: string;
|
|
6
|
-
body_content?: string;
|
|
7
|
-
body_description?: string;
|
|
8
|
-
available_text?: string;
|
|
9
|
-
total_remaining_text?: string;
|
|
10
|
-
increment_aria_label?: string;
|
|
11
|
-
decrement_aria_label?: string;
|
|
12
|
-
expenses_text?: string;
|
|
13
|
-
available_balances_text?: string;
|
|
14
|
-
average_monthly_spend_text?: string;
|
|
15
|
-
your_available_balances_text?: string;
|
|
16
|
-
}
|
|
17
|
-
interface MakeTransferActionBlockProps {
|
|
18
|
-
date?: string;
|
|
19
|
-
variant: (typeof variants)[keyof typeof variants];
|
|
20
|
-
svgDateContent?: string;
|
|
21
|
-
availableBalances?: number;
|
|
22
|
-
copy: CopyContent;
|
|
23
|
-
averageMonthlySpend?: number;
|
|
24
|
-
/** SAVE_AN_EXTRA_100: total remaining from the payload; falls back to available − expenses. */
|
|
25
|
-
totalRemaining?: number;
|
|
26
|
-
}
|
|
27
|
-
export declare const MakeTransferActionBlock: ({ variant, svgDateContent, date, copy, availableBalances, averageMonthlySpend, totalRemaining, }: MakeTransferActionBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { MakeTransferVariant, MakeTransferVariantProps } from './layout';
|
|
2
|
+
export declare const MakeTransferActionBlock: ({ variant, slotData, copy, }: MakeTransferVariantProps & {
|
|
3
|
+
variant: MakeTransferVariant;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,228 +1,275 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { formatCurrency as
|
|
3
|
-
import { BalanceStepper as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Text as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { Card as
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
1
|
+
import { buildDynamicCopy as y } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { formatCurrency as d } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import { BalanceStepper as S } from "./BalanceStepper.es.js";
|
|
4
|
+
import w from "./SaveEnoughToLiveOnBottomSection.es.js";
|
|
5
|
+
import { toNumber as p, variants as C } from "./layout.es.js";
|
|
6
|
+
import v from "react";
|
|
7
|
+
import { Text as i } from "@mxenabled/mxui";
|
|
8
|
+
import { Icon as E } from "@mxenabled/mx-icons";
|
|
9
|
+
import { Fragment as f, jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
10
|
+
import { Card as I, Divider as A, List as T, ListItem as H, Stack as l } from "@mui/material";
|
|
11
|
+
var N = [
|
|
12
|
+
{
|
|
13
|
+
label: "3 months",
|
|
14
|
+
value: 3
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "6 months",
|
|
18
|
+
value: 6
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "9 months",
|
|
22
|
+
value: 9
|
|
23
|
+
}
|
|
24
|
+
], O = [
|
|
25
|
+
{
|
|
26
|
+
label: "1 month",
|
|
27
|
+
value: 1
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "3 months",
|
|
31
|
+
value: 3
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "6 months",
|
|
35
|
+
value: 6
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: "9 months",
|
|
39
|
+
value: 9
|
|
40
|
+
}
|
|
41
|
+
], W = ({ copy: o, leading: r }) => /* @__PURE__ */ a(l, {
|
|
42
|
+
sx: {
|
|
43
|
+
bgcolor: "background.paper",
|
|
44
|
+
p: 24,
|
|
45
|
+
borderBottom: "1px solid",
|
|
46
|
+
borderColor: "divider"
|
|
47
|
+
},
|
|
48
|
+
children: [r, /* @__PURE__ */ a(l, {
|
|
49
|
+
sx: { gap: 8 },
|
|
50
|
+
children: [/* @__PURE__ */ e(i, {
|
|
51
|
+
variant: "h3",
|
|
52
|
+
children: o.header_content
|
|
53
|
+
}), /* @__PURE__ */ e(i, {
|
|
54
|
+
sx: { lineHeight: "24px" },
|
|
55
|
+
truncate: !1,
|
|
56
|
+
variant: "body1",
|
|
57
|
+
children: o.description
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), j = ({ availableBalances: o, expenses: r, totalRemaining: t, copy: n }) => /* @__PURE__ */ e(l, {
|
|
61
|
+
sx: {
|
|
62
|
+
pt: 24,
|
|
63
|
+
px: 24
|
|
64
|
+
},
|
|
65
|
+
children: /* @__PURE__ */ a(I, {
|
|
66
|
+
sx: {
|
|
67
|
+
px: 16,
|
|
68
|
+
pt: 16,
|
|
69
|
+
pb: 12
|
|
70
|
+
},
|
|
71
|
+
children: [/* @__PURE__ */ a(l, {
|
|
17
72
|
sx: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
73
|
+
border: 1,
|
|
74
|
+
borderColor: "divider",
|
|
75
|
+
borderRadius: "4px",
|
|
76
|
+
gap: 12,
|
|
77
|
+
flexDirection: "row",
|
|
78
|
+
justifyContent: "space-between",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
p: 8,
|
|
81
|
+
mb: 12
|
|
22
82
|
},
|
|
23
|
-
children: [
|
|
24
|
-
|
|
25
|
-
leftLabel: i.available_balances_text,
|
|
26
|
-
leftValue: l(c, "0,0.00"),
|
|
27
|
-
rightLabel: i.average_monthly_spend_text,
|
|
28
|
-
rightValue: l(o, "0,0.00"),
|
|
29
|
-
sx: {
|
|
30
|
-
width: "100%",
|
|
31
|
-
mb: 24
|
|
32
|
-
}
|
|
33
|
-
}), /* @__PURE__ */ r(n, {
|
|
34
|
-
sx: { gap: 8 },
|
|
35
|
-
children: [/* @__PURE__ */ t(e, {
|
|
36
|
-
variant: "h3",
|
|
37
|
-
children: i.header_content
|
|
38
|
-
}), /* @__PURE__ */ t(e, {
|
|
39
|
-
sx: { lineHeight: "24px" },
|
|
40
|
-
truncate: !1,
|
|
41
|
-
variant: "body1",
|
|
42
|
-
children: i.description
|
|
43
|
-
})]
|
|
44
|
-
})]
|
|
45
|
-
}),
|
|
46
|
-
a.showRemainingCard && c != null && o != null && /* @__PURE__ */ t(n, {
|
|
47
|
-
sx: {
|
|
48
|
-
pt: 24,
|
|
49
|
-
px: 24
|
|
50
|
-
},
|
|
51
|
-
children: /* @__PURE__ */ r(W, {
|
|
52
|
-
sx: {
|
|
53
|
-
px: 16,
|
|
54
|
-
pt: 16,
|
|
55
|
-
pb: 12
|
|
56
|
-
},
|
|
57
|
-
children: [/* @__PURE__ */ r(n, {
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ a(l, {
|
|
58
85
|
sx: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
borderRadius: "4px",
|
|
62
|
-
gap: 12,
|
|
63
|
-
flexDirection: "row",
|
|
64
|
-
justifyContent: "space-between",
|
|
65
|
-
alignItems: "center",
|
|
66
|
-
p: 8,
|
|
67
|
-
mb: 12
|
|
86
|
+
width: 155,
|
|
87
|
+
textAlign: "center"
|
|
68
88
|
},
|
|
69
|
-
children: [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ t(L, {
|
|
86
|
-
name: "remove",
|
|
87
|
-
size: 20
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ r(n, {
|
|
90
|
-
sx: {
|
|
91
|
-
width: 155,
|
|
92
|
-
textAlign: "center"
|
|
93
|
-
},
|
|
94
|
-
children: [/* @__PURE__ */ t(e, {
|
|
95
|
-
sx: { fontWeight: 600 },
|
|
96
|
-
variant: "body1",
|
|
97
|
-
children: l(o, "0,0.00")
|
|
98
|
-
}), /* @__PURE__ */ t(e, {
|
|
99
|
-
sx: { color: "text.secondary" },
|
|
100
|
-
variant: "caption",
|
|
101
|
-
children: i.expenses_text
|
|
102
|
-
})]
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
}), /* @__PURE__ */ r(n, {
|
|
89
|
+
children: [/* @__PURE__ */ e(i, {
|
|
90
|
+
sx: { fontWeight: 600 },
|
|
91
|
+
variant: "body1",
|
|
92
|
+
children: d(o, "0,0.00")
|
|
93
|
+
}), /* @__PURE__ */ e(i, {
|
|
94
|
+
sx: { color: "text.secondary" },
|
|
95
|
+
variant: "caption",
|
|
96
|
+
children: n.available_text
|
|
97
|
+
})]
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ e(E, {
|
|
100
|
+
name: "remove",
|
|
101
|
+
size: 20
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ a(l, {
|
|
106
104
|
sx: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
justifyContent: "center",
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
gap: 4
|
|
105
|
+
width: 155,
|
|
106
|
+
textAlign: "center"
|
|
112
107
|
},
|
|
113
|
-
children: [/* @__PURE__ */
|
|
114
|
-
sx: { color: "text.secondary" },
|
|
115
|
-
variant: "body2",
|
|
116
|
-
children: [i.total_remaining_text, ":"]
|
|
117
|
-
}), /* @__PURE__ */ t(e, {
|
|
108
|
+
children: [/* @__PURE__ */ e(i, {
|
|
118
109
|
sx: { fontWeight: 600 },
|
|
119
|
-
variant: "
|
|
120
|
-
children:
|
|
110
|
+
variant: "body1",
|
|
111
|
+
children: d(r, "0,0.00")
|
|
112
|
+
}), /* @__PURE__ */ e(i, {
|
|
113
|
+
sx: { color: "text.secondary" },
|
|
114
|
+
variant: "caption",
|
|
115
|
+
children: n.expenses_text
|
|
121
116
|
})]
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
}),
|
|
125
|
-
/* @__PURE__ */ r(n, {
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
}), /* @__PURE__ */ a(l, {
|
|
126
120
|
sx: {
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
textAlign: "center",
|
|
122
|
+
flexDirection: "row",
|
|
123
|
+
justifyContent: "center",
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
gap: 4
|
|
129
126
|
},
|
|
130
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ a(i, {
|
|
128
|
+
sx: { color: "text.secondary" },
|
|
129
|
+
variant: "body2",
|
|
130
|
+
children: [n.total_remaining_text, ":"]
|
|
131
|
+
}), /* @__PURE__ */ e(i, {
|
|
131
132
|
sx: { fontWeight: 600 },
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
children: i.body_content
|
|
135
|
-
}), /* @__PURE__ */ t(C, {
|
|
136
|
-
amount: l(f, "0,0.00"),
|
|
137
|
-
copy: i,
|
|
138
|
-
onDecrement: () => d((s) => Math.max(0, s - u)),
|
|
139
|
-
onIncrement: () => d((s) => s + u)
|
|
133
|
+
variant: "body2",
|
|
134
|
+
children: d(t, "0,0.00")
|
|
140
135
|
})]
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
}), k = ({ availableBalances: o, date: r, copy: t }) => /* @__PURE__ */ a(l, {
|
|
139
|
+
sx: {
|
|
140
|
+
pt: 6,
|
|
141
|
+
pb: 14,
|
|
142
|
+
px: 24,
|
|
143
|
+
textAlign: "right",
|
|
144
|
+
gap: 4
|
|
145
|
+
},
|
|
146
|
+
children: [/* @__PURE__ */ e(i, {
|
|
147
|
+
truncate: !1,
|
|
148
|
+
variant: "h3",
|
|
149
|
+
children: d(o, "0,0.00")
|
|
150
|
+
}), r && /* @__PURE__ */ e(i, {
|
|
151
|
+
sx: {
|
|
152
|
+
color: "text.secondary",
|
|
153
|
+
fontWeight: 400
|
|
154
|
+
},
|
|
155
|
+
truncate: !1,
|
|
156
|
+
variant: "subtitle2",
|
|
157
|
+
children: y(t.your_available_balances_text, r)
|
|
158
|
+
})]
|
|
159
|
+
}), L = ({ bodyContent: o, bodyDescription: r, monthsTable: t, deltaAmount: n, initialAmount: s, seedAmount: c, copy: m }) => {
|
|
160
|
+
const [b, h] = v.useState(s ?? c ?? 0);
|
|
161
|
+
v.useEffect(() => {
|
|
162
|
+
s == null && c != null && h(c);
|
|
163
|
+
}, [s, c]);
|
|
164
|
+
const g = t.length - 1;
|
|
165
|
+
return /* @__PURE__ */ a(f, { children: [/* @__PURE__ */ a(l, {
|
|
166
|
+
sx: {
|
|
167
|
+
p: 24,
|
|
168
|
+
gap: 8
|
|
169
|
+
},
|
|
170
|
+
children: [/* @__PURE__ */ e(i, {
|
|
171
|
+
sx: { fontWeight: 600 },
|
|
172
|
+
truncate: !1,
|
|
173
|
+
variant: "body1",
|
|
174
|
+
children: o
|
|
175
|
+
}), /* @__PURE__ */ e(S, {
|
|
176
|
+
amount: d(b, "0,0.00"),
|
|
177
|
+
copy: m,
|
|
178
|
+
onDecrement: () => h((x) => Math.max(0, x - n)),
|
|
179
|
+
onIncrement: () => h((x) => x + n)
|
|
180
|
+
})]
|
|
181
|
+
}), /* @__PURE__ */ a(l, {
|
|
182
|
+
sx: { gap: 8 },
|
|
183
|
+
children: [/* @__PURE__ */ e(i, {
|
|
184
|
+
sx: {
|
|
185
|
+
fontWeight: 600,
|
|
186
|
+
mx: 24
|
|
187
|
+
},
|
|
188
|
+
truncate: !1,
|
|
189
|
+
variant: "body1",
|
|
190
|
+
children: r
|
|
191
|
+
}), /* @__PURE__ */ e(T, {
|
|
192
|
+
sx: {
|
|
193
|
+
bgcolor: "background.paper",
|
|
194
|
+
width: "100%"
|
|
195
|
+
},
|
|
196
|
+
children: t.map(({ label: x, value: u }, _) => /* @__PURE__ */ a(v.Fragment, { children: [/* @__PURE__ */ e(H, {
|
|
197
|
+
disableGutters: !0,
|
|
198
|
+
disablePadding: !0,
|
|
199
|
+
sx: {
|
|
200
|
+
minHeight: 52,
|
|
201
|
+
bgcolor: "background.paper"
|
|
202
|
+
},
|
|
203
|
+
children: /* @__PURE__ */ e(l, {
|
|
204
|
+
sx: { width: "100%" },
|
|
205
|
+
children: /* @__PURE__ */ a(l, {
|
|
210
206
|
sx: {
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
flexDirection: "row",
|
|
208
|
+
justifyContent: "space-between",
|
|
209
|
+
alignItems: "center",
|
|
210
|
+
width: "100%",
|
|
211
|
+
px: 24,
|
|
212
|
+
py: 8
|
|
213
213
|
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
children: [/* @__PURE__ */ e(i, {
|
|
215
|
+
truncate: !1,
|
|
216
|
+
variant: "body1",
|
|
217
|
+
children: x
|
|
218
|
+
}), /* @__PURE__ */ e(i, {
|
|
219
|
+
sx: { fontWeight: 600 },
|
|
220
|
+
truncate: !1,
|
|
221
|
+
variant: "body1",
|
|
222
|
+
children: d(u * b, "0,0")
|
|
223
|
+
})]
|
|
224
|
+
})
|
|
218
225
|
})
|
|
219
|
-
|
|
226
|
+
}), /* @__PURE__ */ e(A, {
|
|
227
|
+
component: "li",
|
|
228
|
+
sx: { ml: _ === g ? 0 : 24 }
|
|
229
|
+
})] }, u))
|
|
230
|
+
})]
|
|
231
|
+
})] });
|
|
232
|
+
}, z = ({ variant: o, slotData: r, copy: t }) => {
|
|
233
|
+
const n = o === C.SAVE_ENOUGH_TO_LIVE_ON, s = r?.available_balance, c = p(r?.avg_monthly_spend), m = p(r?.upcoming_expenses), b = p(r?.total_remaining), h = r?.time_period, g = r?.date;
|
|
234
|
+
return /* @__PURE__ */ a(f, { children: [
|
|
235
|
+
/* @__PURE__ */ e(W, {
|
|
236
|
+
copy: t,
|
|
237
|
+
leading: n && s != null && c != null && h ? /* @__PURE__ */ e(w, {
|
|
238
|
+
content: h,
|
|
239
|
+
leftLabel: t.available_balances_text,
|
|
240
|
+
leftValue: d(s, "0,0.00"),
|
|
241
|
+
rightLabel: t.average_monthly_spend_text,
|
|
242
|
+
rightValue: d(c, "0,0.00"),
|
|
243
|
+
sx: {
|
|
244
|
+
width: "100%",
|
|
245
|
+
mb: 24
|
|
246
|
+
}
|
|
247
|
+
}) : null
|
|
248
|
+
}),
|
|
249
|
+
!n && s != null && m != null && /* @__PURE__ */ e(j, {
|
|
250
|
+
availableBalances: s,
|
|
251
|
+
copy: t,
|
|
252
|
+
expenses: m,
|
|
253
|
+
totalRemaining: b
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ e(L, {
|
|
256
|
+
bodyContent: n ? t.body_spending_content : t.body_saving_content,
|
|
257
|
+
bodyDescription: n ? t.body_spending_description : t.body_saving_description,
|
|
258
|
+
copy: t,
|
|
259
|
+
deltaAmount: n ? 50 : 5,
|
|
260
|
+
initialAmount: n ? null : 100,
|
|
261
|
+
monthsTable: n ? O : N,
|
|
262
|
+
seedAmount: n ? c : void 0
|
|
263
|
+
}),
|
|
264
|
+
n && s != null && /* @__PURE__ */ e(k, {
|
|
265
|
+
availableBalances: s,
|
|
266
|
+
copy: t,
|
|
267
|
+
date: g
|
|
220
268
|
})
|
|
221
269
|
] });
|
|
222
270
|
};
|
|
223
271
|
export {
|
|
224
|
-
|
|
225
|
-
T as variants
|
|
272
|
+
z as MakeTransferActionBlock
|
|
226
273
|
};
|
|
227
274
|
|
|
228
275
|
//# sourceMappingURL=MakeTransferActionBlock.es.js.map
|