@mx-cartographer/experiences 9.7.155 → 9.7.157-alpha-ram-cccl-1
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 +15 -1
- package/dist/common/components/CurrencyDialog.d.ts +3 -1
- package/dist/common/components/CurrencyDialog.es.js +45 -42
- package/dist/common/components/CurrencyDialog.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +14 -5
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +19 -22
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +44 -49
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +37 -41
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +83 -83
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +36 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js +63 -15
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js +17 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +116 -120
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +14 -18
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.d.ts +0 -6
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +34 -26
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.d.ts +4 -4
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js +239 -220
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js +36 -32
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js +4 -8
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -28
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +11 -14
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +28 -30
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +53 -55
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +26 -31
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +38 -41
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +11 -16
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -42
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +76 -78
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +64 -59
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.d.ts +11 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js +123 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +18 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +88 -66
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +17 -17
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +11 -2
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +16 -7
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.d.ts +4 -0
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js +13 -7
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +4 -4
- package/dist/insights-v2/components/CompactInsightCard.es.js +162 -138
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/UtilizationBar.d.ts +15 -0
- package/dist/insights-v2/components/shared/UtilizationBar.es.js +31 -0
- package/dist/insights-v2/components/shared/UtilizationBar.es.js.map +1 -0
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
## [9.7.157] - 11-13-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - Credit Utilization drawer matches the Figma drill-down with short definitions, a marker on the utilization bands, a tip and a card per credit card that opens Account Details (WEC-2318)
|
|
4
|
+
- **CHANGED** - CreditUtilizationCopy adds six optional keys for the new wording and removes total_credit_utilized, total_credit_utilized_aria, credit_utilized and credit_utilization_ratio (WEC-2318)
|
|
5
|
+
|
|
6
|
+
## [9.7.156] - 11-13-2026
|
|
7
|
+
|
|
8
|
+
- **CHANGED** - Insights 2.0 action blocks show one shared error message when their copy or data is missing; no visible change when copy has loaded (WEC-2262)
|
|
9
|
+
- **CHANGED** - Action blocks rely on `ActionBlockLayer`'s copy loader and no longer check copy loading themselves (WEC-2262)
|
|
10
|
+
- **FIXED** - After a failed copy request, the error drawer shows "Something went wrong." with a named title and close button instead of throwing, Transaction History shows it instead of throwing, and Remaining Cash shows it instead of a loader that never ends (WEC-2262)
|
|
11
|
+
|
|
1
12
|
## [9.7.155] - 11-13-2026
|
|
2
13
|
|
|
3
|
-
- **CHANGED** - Insights 2.0 action blocks read the CTA that opened their drawer through one shared `useOpenedCta` hook
|
|
14
|
+
- **CHANGED** - Insights 2.0 action blocks read the CTA that opened their drawer through one shared `useOpenedCta` hook instead of resolving it themselves; drawers behave the same (WEC-2262)
|
|
15
|
+
- **CHANGED** - The placeholder action block resolves its in-description link and chart-bar trigger like the other action blocks (WEC-2262)
|
|
16
|
+
- **CHANGED** - Debt Payoff Strategies uses the shared currency format for account balances; no visible change (WEC-2259)
|
|
17
|
+
- **CHANGED** - The Transaction List summary and Subscriptions header cards share one icon tile; no visible change (WEC-2262)
|
|
4
18
|
|
|
5
19
|
## [9.7.154] - 11-13-2026
|
|
6
20
|
|
|
@@ -27,6 +27,8 @@ interface CurrencyDialogProps {
|
|
|
27
27
|
/** A line under the title, e.g. the account a setting applies to. */
|
|
28
28
|
subtitle?: ReactNode;
|
|
29
29
|
title: string;
|
|
30
|
+
/** `$` before the value (the default), or `%` after it for a percentage. */
|
|
31
|
+
unit?: 'currency' | 'percent';
|
|
30
32
|
}
|
|
31
|
-
declare const CurrencyDialog: ({ closeAriaLabel, content, errorText, inputLabel, inputValue, isOpen, isPrimaryDisabled, handleInputChange, handleInputClick, handleModalClose, handlePrimaryAction, handleSecondaryAction, primaryColor, primaryText, secondaryColor, secondaryText, subtitle, title, }: CurrencyDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare const CurrencyDialog: ({ closeAriaLabel, content, errorText, inputLabel, inputValue, isOpen, isPrimaryDisabled, handleInputChange, handleInputClick, handleModalClose, handlePrimaryAction, handleSecondaryAction, primaryColor, primaryText, secondaryColor, secondaryText, subtitle, title, unit, }: CurrencyDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
34
|
export default CurrencyDialog;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useScreenSize as
|
|
1
|
+
import { useScreenSize as M } from "../hooks/useScreenSize.es.js";
|
|
2
2
|
import n from "@mui/material/Stack";
|
|
3
|
-
import { H3 as
|
|
3
|
+
import { H3 as $, P as A } from "@mxenabled/mxui";
|
|
4
4
|
import f from "@mui/material/Button";
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { jsx as o, jsxs as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
var
|
|
14
|
-
const d =
|
|
15
|
-
return /* @__PURE__ */ o(
|
|
16
|
-
"aria-label":
|
|
5
|
+
import { Icon as B } from "@mxenabled/mx-icons";
|
|
6
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
7
|
+
import F from "@mui/material/Dialog";
|
|
8
|
+
import H from "@mui/material/DialogContent";
|
|
9
|
+
import w from "@mui/material/IconButton";
|
|
10
|
+
import N from "@mui/material/DialogActions";
|
|
11
|
+
import h from "@mui/material/InputAdornment";
|
|
12
|
+
import P from "@mui/material/TextField";
|
|
13
|
+
var Y = ({ closeAriaLabel: u, content: g, errorText: a, inputLabel: t, inputValue: e, isOpen: x, isPrimaryDisabled: b = !1, handleInputChange: C, handleInputClick: D, handleModalClose: m, handlePrimaryAction: s, handleSecondaryAction: y, primaryColor: k = "primary", primaryText: c, secondaryColor: v = "primary", secondaryText: l, subtitle: I, title: p, unit: S = "currency" }) => {
|
|
14
|
+
const d = b || (t ? !(e !== "" && e !== "0" && !isNaN(parseFloat(e ?? "0"))) : !1), { isSmallMobile: j } = M();
|
|
15
|
+
return /* @__PURE__ */ o(F, {
|
|
16
|
+
"aria-label": p,
|
|
17
17
|
"aria-labelledby": "modal-title",
|
|
18
18
|
maxWidth: "xs",
|
|
19
19
|
onClose: m,
|
|
20
|
-
open:
|
|
20
|
+
open: x,
|
|
21
21
|
role: "dialog",
|
|
22
22
|
sx: {
|
|
23
23
|
"& .MuiDialogContent-root": { p: 0 },
|
|
24
|
-
...
|
|
24
|
+
...j && { "& .MuiDialog-paper": { minWidth: "100%" } }
|
|
25
25
|
},
|
|
26
|
-
children: /* @__PURE__ */ o(
|
|
27
|
-
onSubmit: (
|
|
28
|
-
|
|
26
|
+
children: /* @__PURE__ */ o(H, { children: /* @__PURE__ */ r("form", {
|
|
27
|
+
onSubmit: (i) => {
|
|
28
|
+
i.preventDefault(), d || s();
|
|
29
29
|
},
|
|
30
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ r(n, {
|
|
32
32
|
sx: {
|
|
33
33
|
alignItems: "center",
|
|
34
34
|
flexDirection: "row",
|
|
@@ -39,14 +39,14 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
|
|
|
39
39
|
pr: 16,
|
|
40
40
|
pt: 24
|
|
41
41
|
},
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ r(n, {
|
|
43
43
|
sx: { gap: 4 },
|
|
44
|
-
children: [/* @__PURE__ */ o(
|
|
44
|
+
children: [/* @__PURE__ */ o($, {
|
|
45
45
|
id: "modal-title",
|
|
46
|
-
children:
|
|
47
|
-
}),
|
|
48
|
-
}), /* @__PURE__ */ o(
|
|
49
|
-
"aria-label":
|
|
46
|
+
children: p
|
|
47
|
+
}), I]
|
|
48
|
+
}), /* @__PURE__ */ o(w, {
|
|
49
|
+
"aria-label": u,
|
|
50
50
|
onClick: m,
|
|
51
51
|
sx: {
|
|
52
52
|
minHeight: 24,
|
|
@@ -54,47 +54,50 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
|
|
|
54
54
|
right: 8,
|
|
55
55
|
top: 18
|
|
56
56
|
},
|
|
57
|
-
children: /* @__PURE__ */ o(
|
|
57
|
+
children: /* @__PURE__ */ o(B, {
|
|
58
58
|
name: "close",
|
|
59
59
|
sx: { color: "action.active" }
|
|
60
60
|
})
|
|
61
61
|
})]
|
|
62
62
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ r(n, {
|
|
64
64
|
sx: {
|
|
65
65
|
gap: 24,
|
|
66
66
|
px: 24
|
|
67
67
|
},
|
|
68
|
-
children: [/* @__PURE__ */ o(
|
|
68
|
+
children: [/* @__PURE__ */ o(A, {
|
|
69
69
|
variant: "subtitle1",
|
|
70
70
|
children: g
|
|
71
|
-
}),
|
|
71
|
+
}), t && /* @__PURE__ */ o(P, {
|
|
72
72
|
autoFocus: !0,
|
|
73
73
|
error: !!a,
|
|
74
74
|
helperText: a,
|
|
75
75
|
inputMode: "decimal",
|
|
76
|
-
label:
|
|
77
|
-
onChange: ({ target: { value:
|
|
78
|
-
/^\d*\.?\d*$/.test(
|
|
76
|
+
label: t,
|
|
77
|
+
onChange: ({ target: { value: i } }) => {
|
|
78
|
+
/^\d*\.?\d*$/.test(i) && C?.(i);
|
|
79
79
|
},
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: D,
|
|
81
81
|
slotProps: {
|
|
82
|
-
input: {
|
|
82
|
+
input: S === "percent" ? { endAdornment: /* @__PURE__ */ o(h, {
|
|
83
|
+
position: "end",
|
|
84
|
+
children: "%"
|
|
85
|
+
}) } : { startAdornment: /* @__PURE__ */ o(h, {
|
|
83
86
|
position: "start",
|
|
84
87
|
children: "$"
|
|
85
88
|
}) },
|
|
86
89
|
formHelperText: { role: "alert" },
|
|
87
90
|
htmlInput: {
|
|
88
|
-
"aria-label":
|
|
91
|
+
"aria-label": t,
|
|
89
92
|
noValidate: !0,
|
|
90
93
|
pattern: "[0-9]*\\.?[0-9]*"
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
96
|
type: "text",
|
|
94
|
-
value:
|
|
97
|
+
value: e
|
|
95
98
|
})]
|
|
96
99
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ r(N, {
|
|
98
101
|
sx: {
|
|
99
102
|
justifyContent: "flex-end",
|
|
100
103
|
gap: 16,
|
|
@@ -104,15 +107,15 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
|
|
|
104
107
|
children: [l && /* @__PURE__ */ o(f, {
|
|
105
108
|
"aria-label": l,
|
|
106
109
|
color: v,
|
|
107
|
-
onClick:
|
|
110
|
+
onClick: y,
|
|
108
111
|
children: l
|
|
109
112
|
}), /* @__PURE__ */ o(f, {
|
|
110
|
-
"aria-label":
|
|
113
|
+
"aria-label": c,
|
|
111
114
|
color: k,
|
|
112
115
|
disabled: d,
|
|
113
116
|
onClick: s,
|
|
114
117
|
variant: "contained",
|
|
115
|
-
children:
|
|
118
|
+
children: c
|
|
116
119
|
})]
|
|
117
120
|
})
|
|
118
121
|
]
|
|
@@ -120,7 +123,7 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
|
|
|
120
123
|
});
|
|
121
124
|
};
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
Y as default
|
|
124
127
|
};
|
|
125
128
|
|
|
126
129
|
//# sourceMappingURL=CurrencyDialog.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyDialog.es.js","names":[],"sources":["../../../src/common/components/CurrencyDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, P } from '@mxenabled/mxui'\n\nimport Button, { type ButtonProps } from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogActions from '@mui/material/DialogActions'\nimport DialogContent from '@mui/material/DialogContent'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { useScreenSize } from '../hooks'\n\ninterface CurrencyDialogProps {\n closeAriaLabel: string\n /** Body copy; a node so callers can emphasise part of it (e.g. a bold account name). */\n content?: ReactNode\n /** Validation or save error, shown under the input and marking it invalid. */\n errorText?: string\n inputLabel?: string\n inputValue?: string\n isOpen: boolean\n /** Disables the primary button on top of the built-in input check (e.g. while saving). */\n isPrimaryDisabled?: boolean\n handleInputChange?: (value: string) => void\n /**\n * Click on the amount input (e.g. analytics). Click, not focus: the input autofocuses on open,\n * so a focus callback would fire per open rather than per user interaction.\n */\n handleInputClick?: () => void\n handleModalClose: () => void\n handlePrimaryAction: () => void\n handleSecondaryAction?: () => void\n primaryColor?: ButtonProps['color']\n primaryText: string\n secondaryColor?: ButtonProps['color']\n secondaryText?: string\n /** A line under the title, e.g. the account a setting applies to. */\n subtitle?: ReactNode\n title: string\n}\n\n// Created for V2 of BudgetDetailsDrawer.\n// The previous design will be replaced once the new design is finalized.\n// Also needs to be updated to use the mxui library\n// with the updated Dialog components.\n\nconst CurrencyDialog = ({\n closeAriaLabel,\n content,\n errorText,\n inputLabel,\n inputValue,\n isOpen,\n isPrimaryDisabled = false,\n handleInputChange,\n handleInputClick,\n handleModalClose,\n handlePrimaryAction,\n handleSecondaryAction,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n subtitle,\n title,\n}: CurrencyDialogProps) => {\n const numericValue = parseFloat(inputValue ?? '0')\n const isValid = inputValue !== '' && inputValue !== '0' && !isNaN(numericValue)\n // One rule for the button and for Enter: the form's submit must not bypass a disabled button.\n const isPrimaryBlocked = isPrimaryDisabled || (inputLabel ? !isValid : false)\n\n const { isSmallMobile } = useScreenSize()\n\n return (\n <Dialog\n aria-label={title}\n aria-labelledby=\"modal-title\"\n maxWidth=\"xs\"\n onClose={handleModalClose}\n open={isOpen}\n role=\"dialog\"\n sx={{\n '& .MuiDialogContent-root': { p: 0 },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n }}\n >\n <DialogContent>\n <form\n onSubmit={(e) => {\n e.preventDefault()\n if (!isPrimaryBlocked) handlePrimaryAction()\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 12,\n pl: 24,\n position: 'relative',\n pr: 16,\n pt: 24,\n }}\n >\n <Stack sx={{ gap: 4 }}>\n <H3 id=\"modal-title\">{title}</H3>\n {subtitle}\n </Stack>\n <IconButton\n aria-label={closeAriaLabel}\n onClick={handleModalClose}\n sx={{ minHeight: 24, position: 'absolute', right: 8, top: 18 }}\n >\n <Icon name=\"close\" sx={{ color: 'action.active' }} />\n </IconButton>\n </Stack>\n <Stack sx={{ gap: 24, px: 24 }}>\n <P variant=\"subtitle1\">{content}</P>\n {inputLabel && (\n <TextField\n autoFocus={true}\n error={!!errorText}\n helperText={errorText}\n inputMode=\"decimal\"\n label={inputLabel}\n onChange={({ target: { value } }) => {\n if (!/^\\d*\\.?\\d*$/.test(value)) return\n\n handleInputChange?.(value)\n }}\n onClick={handleInputClick}\n slotProps={{\n input:
|
|
1
|
+
{"version":3,"file":"CurrencyDialog.es.js","names":[],"sources":["../../../src/common/components/CurrencyDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, P } from '@mxenabled/mxui'\n\nimport Button, { type ButtonProps } from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogActions from '@mui/material/DialogActions'\nimport DialogContent from '@mui/material/DialogContent'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { useScreenSize } from '../hooks'\n\ninterface CurrencyDialogProps {\n closeAriaLabel: string\n /** Body copy; a node so callers can emphasise part of it (e.g. a bold account name). */\n content?: ReactNode\n /** Validation or save error, shown under the input and marking it invalid. */\n errorText?: string\n inputLabel?: string\n inputValue?: string\n isOpen: boolean\n /** Disables the primary button on top of the built-in input check (e.g. while saving). */\n isPrimaryDisabled?: boolean\n handleInputChange?: (value: string) => void\n /**\n * Click on the amount input (e.g. analytics). Click, not focus: the input autofocuses on open,\n * so a focus callback would fire per open rather than per user interaction.\n */\n handleInputClick?: () => void\n handleModalClose: () => void\n handlePrimaryAction: () => void\n handleSecondaryAction?: () => void\n primaryColor?: ButtonProps['color']\n primaryText: string\n secondaryColor?: ButtonProps['color']\n secondaryText?: string\n /** A line under the title, e.g. the account a setting applies to. */\n subtitle?: ReactNode\n title: string\n /** `$` before the value (the default), or `%` after it for a percentage. */\n unit?: 'currency' | 'percent'\n}\n\n// Created for V2 of BudgetDetailsDrawer.\n// The previous design will be replaced once the new design is finalized.\n// Also needs to be updated to use the mxui library\n// with the updated Dialog components.\n\nconst CurrencyDialog = ({\n closeAriaLabel,\n content,\n errorText,\n inputLabel,\n inputValue,\n isOpen,\n isPrimaryDisabled = false,\n handleInputChange,\n handleInputClick,\n handleModalClose,\n handlePrimaryAction,\n handleSecondaryAction,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n subtitle,\n title,\n unit = 'currency',\n}: CurrencyDialogProps) => {\n const numericValue = parseFloat(inputValue ?? '0')\n const isValid = inputValue !== '' && inputValue !== '0' && !isNaN(numericValue)\n // One rule for the button and for Enter: the form's submit must not bypass a disabled button.\n const isPrimaryBlocked = isPrimaryDisabled || (inputLabel ? !isValid : false)\n\n const { isSmallMobile } = useScreenSize()\n\n return (\n <Dialog\n aria-label={title}\n aria-labelledby=\"modal-title\"\n maxWidth=\"xs\"\n onClose={handleModalClose}\n open={isOpen}\n role=\"dialog\"\n sx={{\n '& .MuiDialogContent-root': { p: 0 },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n }}\n >\n <DialogContent>\n <form\n onSubmit={(e) => {\n e.preventDefault()\n if (!isPrimaryBlocked) handlePrimaryAction()\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 12,\n pl: 24,\n position: 'relative',\n pr: 16,\n pt: 24,\n }}\n >\n <Stack sx={{ gap: 4 }}>\n <H3 id=\"modal-title\">{title}</H3>\n {subtitle}\n </Stack>\n <IconButton\n aria-label={closeAriaLabel}\n onClick={handleModalClose}\n sx={{ minHeight: 24, position: 'absolute', right: 8, top: 18 }}\n >\n <Icon name=\"close\" sx={{ color: 'action.active' }} />\n </IconButton>\n </Stack>\n <Stack sx={{ gap: 24, px: 24 }}>\n <P variant=\"subtitle1\">{content}</P>\n {inputLabel && (\n <TextField\n autoFocus={true}\n error={!!errorText}\n helperText={errorText}\n inputMode=\"decimal\"\n label={inputLabel}\n onChange={({ target: { value } }) => {\n if (!/^\\d*\\.?\\d*$/.test(value)) return\n\n handleInputChange?.(value)\n }}\n onClick={handleInputClick}\n slotProps={{\n input:\n unit === 'percent'\n ? { endAdornment: <InputAdornment position=\"end\">%</InputAdornment> }\n : { startAdornment: <InputAdornment position=\"start\">$</InputAdornment> },\n // Announce errors: focus is usually on the primary button when one appears.\n formHelperText: { role: 'alert' },\n htmlInput: {\n 'aria-label': inputLabel,\n noValidate: true,\n pattern: '[0-9]*\\\\.?[0-9]*',\n },\n }}\n type=\"text\"\n value={inputValue}\n />\n )}\n </Stack>\n <DialogActions\n sx={{\n justifyContent: 'flex-end',\n gap: 16,\n p: 24,\n '>:not(style)~:not(style)': { ml: 0 },\n }}\n >\n {secondaryText && (\n <Button\n aria-label={secondaryText}\n color={secondaryColor}\n onClick={handleSecondaryAction}\n >\n {secondaryText}\n </Button>\n )}\n <Button\n aria-label={primaryText}\n color={primaryColor}\n disabled={isPrimaryBlocked}\n onClick={handlePrimaryAction}\n variant=\"contained\"\n >\n {primaryText}\n </Button>\n </DialogActions>\n </form>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CurrencyDialog\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAM,IAAA,CAAkB,EACtB,gBAAA,GACA,SAAA,GACA,WAAA,GACA,YAAA,GACA,YAAA,GACA,QAAA,GACA,mBAAA,IAAoB,IACpB,m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,YACH,4BAA4B,EAAE,IAAI,EAAE;AAAA,UACtC;AAAA,UANF,UAAA,CAQG,KACC,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,SAAS;AAAA,YAER,UAAA;AAAA,UACK,CAAA,GAEV,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,UAAU;AAAA,YACV,SAAS;AAAA,YACT,SAAQ;AAAA,YAEP,UAAA;AAAA,UACK,CAAA,CACK;AAAA;MACX;AAAA,IACO,CAAA,EAAA,CAAA;AAAA,EACT,CAAA;AAEZ"}
|
|
@@ -177,6 +177,10 @@ export interface TransactionHistoryBlock {
|
|
|
177
177
|
}
|
|
178
178
|
export interface TransactionListBlockCopy {
|
|
179
179
|
deposit_history_drawer_title?: string;
|
|
180
|
+
/** Credit Card Close to Limit's Spending list (`credit_limit_header`): its title, the limit's label and `_1{percentage}` utilization. */
|
|
181
|
+
credit_limit_header_drawer_title?: string;
|
|
182
|
+
credit_limit_header_credit_limit?: string;
|
|
183
|
+
credit_limit_header_utilization?: string;
|
|
180
184
|
/** The Subscriptions drawer's title (Monthly Subscription Aggregate V2). */
|
|
181
185
|
subscriptions_drawer_title?: string;
|
|
182
186
|
/** `_1{month}`: the count tile's caption, e.g. "Subscriptions in October". */
|
|
@@ -351,8 +355,12 @@ export interface AmountInputModalVariantCopy {
|
|
|
351
355
|
export interface AmountInputModalCopy {
|
|
352
356
|
low_balance_threshold: AmountInputModalVariantCopy;
|
|
353
357
|
safety_net: AmountInputModalVariantCopy;
|
|
358
|
+
/** Credit Card Close to Limit's alert percentage; optional until the host serves mrs_content >= 5.7.71. */
|
|
359
|
+
credit_limit_percentage?: AmountInputModalVariantCopy;
|
|
354
360
|
/** Validation message for anything but a positive whole-dollar amount. */
|
|
355
361
|
whole_number_error: string;
|
|
362
|
+
/** Validation message for anything but a whole number from 1 to 100 (credit_limit_percentage). */
|
|
363
|
+
percentage_error?: string;
|
|
356
364
|
/** Shown in the dialog when the save request fails; the value stays so Save can be retried. */
|
|
357
365
|
save_error: string;
|
|
358
366
|
}
|
|
@@ -414,9 +422,6 @@ export interface OverdraftCopy {
|
|
|
414
422
|
export interface CreditUtilizationCopy {
|
|
415
423
|
/** Drawer title. */
|
|
416
424
|
title: string;
|
|
417
|
-
total_credit_utilized: string;
|
|
418
|
-
/** Spoken donut summary: `_1{amount}` utilized, `_2{total}` limit, `_3{ratio}` percent. */
|
|
419
|
-
total_credit_utilized_aria: string;
|
|
420
425
|
what_does_this_mean: string;
|
|
421
426
|
excellent: string;
|
|
422
427
|
good: string;
|
|
@@ -425,9 +430,13 @@ export interface CreditUtilizationCopy {
|
|
|
425
430
|
ratio_explanation: string;
|
|
426
431
|
recommendation: string;
|
|
427
432
|
per_card_header: string;
|
|
428
|
-
credit_utilized: string;
|
|
429
|
-
credit_utilization_ratio: string;
|
|
430
433
|
credit_limit_not_shared: string;
|
|
434
|
+
ratio_term?: string;
|
|
435
|
+
ratio_definition?: string;
|
|
436
|
+
utilization_term?: string;
|
|
437
|
+
utilization_definition?: string;
|
|
438
|
+
tip?: string;
|
|
439
|
+
your_cards?: string;
|
|
431
440
|
}
|
|
432
441
|
/** The credit card payoff calculator drawer (`payoff_calculator_block`). */
|
|
433
442
|
export interface PayoffCalculatorCopy {
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { useAccountStore as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { useAccountStore as a } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import c from "../../../common/components/Loader.es.js";
|
|
3
|
+
import l from "../../../trends/components/TrendsChart.es.js";
|
|
4
|
+
import { BlockErrorMessage as p } from "../BlockErrorMessage.es.js";
|
|
5
|
+
import A from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
6
|
+
import { resolveAccount as b } from "./layout.es.js";
|
|
7
|
+
import g from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
8
|
+
import { useEffect as S } from "react";
|
|
8
9
|
import { observer as k } from "mobx-react-lite";
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as e, jsxs as L } from "react/jsx-runtime";
|
|
10
|
+
import x from "@mui/material/Stack";
|
|
11
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
12
12
|
var w = k(function({ beat: i }) {
|
|
13
|
-
const {
|
|
14
|
-
return
|
|
15
|
-
|
|
13
|
+
const { accounts: n, accountsLoaded: m, institutionsLoaded: u, members: r, membersLoaded: s, uiStore: o } = a(), t = b(i, n), d = !!t && o.selectedAccount.guid === t.guid;
|
|
14
|
+
return S(() => {
|
|
15
|
+
t && (o.setSelectedAccount(t), o.setSelectedMember(r.find((f) => f.guid === t.member_guid) ?? {}));
|
|
16
16
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]),
|
|
17
|
+
t,
|
|
18
|
+
r,
|
|
19
|
+
o
|
|
20
|
+
]), t ? !d || !s || !u ? /* @__PURE__ */ e(c, {}) : /* @__PURE__ */ C(x, {
|
|
21
21
|
sx: { bgcolor: "background.default" },
|
|
22
|
-
children: [/* @__PURE__ */ e(
|
|
23
|
-
}) :
|
|
24
|
-
sx: { p: 24 },
|
|
25
|
-
children: /* @__PURE__ */ e(D, { children: s.error_message })
|
|
26
|
-
}) : /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ e(r, {});
|
|
22
|
+
children: [/* @__PURE__ */ e(A, { ChartComponent: l }), /* @__PURE__ */ e(g, {})]
|
|
23
|
+
}) : m ? /* @__PURE__ */ e(p, {}) : /* @__PURE__ */ e(c, {});
|
|
27
24
|
});
|
|
28
25
|
export {
|
|
29
26
|
w as AccountDetailsBlock
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport {
|
|
1
|
+
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport { Loader, useAccountStore } from '../../../common'\nimport type { Member } from '../../../core'\nimport TrendsChart from '../../../trends/components/TrendsChart'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport { resolveAccount } from './layout'\n\n/**\n * Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,\n * name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,\n * actions) for the beat's account. Those components read the account store's selection, so the\n * beat's account is selected here first and nothing renders until the selection matches and the\n * members and institutions are in (the connection section reads the member's status): a guid the\n * store cannot resolve shows the error message, never the previously selected account.\n */\nexport const AccountDetailsBlock = observer(function AccountDetailsBlock({\n beat,\n}: ActionBlockProps) {\n const { accounts, accountsLoaded, institutionsLoaded, members, membersLoaded, uiStore } =\n useAccountStore()\n const account = resolveAccount(beat, accounts)\n const isSelected = !!account && uiStore.selectedAccount.guid === account.guid\n\n useEffect(() => {\n if (!account) return\n\n uiStore.setSelectedAccount(account)\n uiStore.setSelectedMember(\n members.find((member) => member.guid === account.member_guid) ?? ({} as Member),\n )\n }, [account, members, uiStore])\n\n if (!account) {\n if (!accountsLoaded) return <Loader />\n\n return <BlockErrorMessage />\n }\n\n if (!isSelected || !membersLoaded || !institutionsLoaded) return <Loader />\n\n return (\n <Stack sx={{ bgcolor: 'background.default' }}>\n <AccountDetailsHeader ChartComponent={TrendsChart} />\n <AccountDetailsContent />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,IAAsB,EAAS,SAA6B,EACvE,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,UAAA,GAAU,gBAAA,GAAgB,oBAAA,GAAoB,SAAA,GAAS,eAAA,GAAe,SAAA,EAAA,IAC5E,EAAgB,GACZ,IAAU,EAAe,GAAM,CAAQ,GACvC,IAAa,CAAC,CAAC,KAAW,EAAQ,gBAAgB,SAAS,EAAQ;AAWzE,SATA,EAAA,MAAgB;AACd,IAAK,MAEL,EAAQ,mBAAmB,CAAO,GAClC,EAAQ,kBACN,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAQ,WAAW,KAAM,CAAC,CACrE;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAS;AAAA,IAAS;AAAA,EAAO,CAAC,GAEzB,IAMD,CAAC,KAAc,CAAC,KAAiB,CAAC,IAA2B,gBAAA,EAAC,GAAD,CAAS,CAAA,IAGxE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,SAAS,qBAAqB;AAAA,IAA3C,UAAA,CACE,gBAAA,EAAC,GAAD,EAAsB,gBAAgB,EAAc,CAAA,GACpD,gBAAA,EAAC,GAAD,CAAwB,CAAA,CACnB;AAAA,OAXF,IAEE,gBAAA,EAAC,GAAD,CAAoB,CAAA,IAFC,gBAAA,EAAC,GAAD,CAAS,CAAA;AAazC,CAAC"}
|
|
@@ -1,85 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccountStore as
|
|
3
|
-
import { getFrequencyLabel as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
children: /* @__PURE__ */ o(nt, { children: v?.error_message ?? "Something went wrong." })
|
|
24
|
-
});
|
|
25
|
-
if (!b) return /* @__PURE__ */ o(_, {});
|
|
26
|
-
const y = tt(n, d, x), F = y.filter(G), $ = y.filter((t) => !G(t)), a = B.display_available_balance_in_accounts, N = [S("checking", e.checking, F, a), S("savings", e.savings, $, a)].filter((t) => t.rows.length > 0), O = f ? [...D.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
|
|
27
|
-
const c = d.find(({ guid: u }) => u === t.accountGuid), A = R.find(({ guid: u }) => u === t.repeatingTransactionGuid);
|
|
1
|
+
import O from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
|
+
import { useAccountStore as $, useAppConfig as j, useCashflowStore as q, useGlobalCopyStore as z, useRecurringTransactionsStore as I } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { getFrequencyLabel as M } from "../../../core/utils/RecurringTransactionsUtil.es.js";
|
|
4
|
+
import _ from "../../../common/components/drawer/Drawer.es.js";
|
|
5
|
+
import H from "../../../common/components/Loader.es.js";
|
|
6
|
+
import { BlockErrorMessage as J } from "../BlockErrorMessage.es.js";
|
|
7
|
+
import K from "../../components/CategoryTile.es.js";
|
|
8
|
+
import { useOpenedCta as P } from "../useOpenedCta.es.js";
|
|
9
|
+
import { useRecurringExpensesLoadState as Q } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
10
|
+
import { RecurringTransactionBlock as U } from "../RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
11
|
+
import { AccountDetailsBlock as V } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
|
|
12
|
+
import W from "./AccountListContent.es.js";
|
|
13
|
+
import { buildSummary as X, isCheckingAccount as h, resolveBeatAccounts as Y, toAccountSection as k } from "./layout.es.js";
|
|
14
|
+
import { useState as G } from "react";
|
|
15
|
+
import { observer as Z } from "mobx-react-lite";
|
|
16
|
+
import { Fragment as tt, jsx as o, jsxs as ot } from "react/jsx-runtime";
|
|
17
|
+
var _t = Z(function({ beat: n }) {
|
|
18
|
+
const [i, l] = G(null), [s, m] = G(null), { accounts: p, insights_feed: T, recurring: r } = z(), { accountsLoaded: v, cashAccounts: L, visibleAccounts: d } = $(), S = P(n), { uiStore: b } = q(), { detailedRepeatingTransactions: x } = I(), { config: D } = j(), { failed: g, ready: f, retry: R } = Q(), e = T?.account_list;
|
|
19
|
+
if (!e) return /* @__PURE__ */ o(J, {});
|
|
20
|
+
if (!v) return /* @__PURE__ */ o(H, {});
|
|
21
|
+
const y = Y(n, d, L), B = y.filter(h), E = y.filter((t) => !h(t)), a = D.display_available_balance_in_accounts, w = [k("checking", e.checking, B, a), k("savings", e.savings, E, a)].filter((t) => t.rows.length > 0), F = f ? [...b.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
|
|
22
|
+
const c = d.find(({ guid: u }) => u === t.accountGuid), C = x.find(({ guid: u }) => u === t.repeatingTransactionGuid);
|
|
28
23
|
return {
|
|
29
24
|
account: {
|
|
30
25
|
institutionGuid: t.institutionGuid,
|
|
31
|
-
name: c ?
|
|
26
|
+
name: c ? O(c) : t.institutionName
|
|
32
27
|
},
|
|
33
28
|
amount: t.amount,
|
|
34
|
-
frequency:
|
|
29
|
+
frequency: C && M(r, C, !1),
|
|
35
30
|
key: `${t.repeatingTransactionGuid}-${t.expectedDate.getTime()}`,
|
|
36
|
-
leading: /* @__PURE__ */ o(
|
|
31
|
+
leading: /* @__PURE__ */ o(K, {
|
|
37
32
|
categoryGuid: t.categoryGuid,
|
|
38
33
|
size: 32
|
|
39
34
|
}),
|
|
40
35
|
name: t.name,
|
|
41
36
|
onClick: () => l(t)
|
|
42
37
|
};
|
|
43
|
-
}) : [],
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ o(
|
|
38
|
+
}) : [], A = () => l(null), N = () => m(null);
|
|
39
|
+
return /* @__PURE__ */ ot(tt, { children: [
|
|
40
|
+
/* @__PURE__ */ o(W, {
|
|
46
41
|
copy: e,
|
|
47
|
-
expenses:
|
|
42
|
+
expenses: F,
|
|
48
43
|
expensesLoading: !f && !g,
|
|
49
44
|
onAccountClick: m,
|
|
50
|
-
onRetryExpenses: g ?
|
|
51
|
-
sections:
|
|
45
|
+
onRetryExpenses: g ? R : void 0,
|
|
46
|
+
sections: w,
|
|
52
47
|
showAvailable: a,
|
|
53
|
-
summary:
|
|
48
|
+
summary: X(S, e)
|
|
54
49
|
}),
|
|
55
|
-
/* @__PURE__ */ o(
|
|
56
|
-
ariaLabelClose:
|
|
50
|
+
/* @__PURE__ */ o(_, {
|
|
51
|
+
ariaLabelClose: r.close_drawer_aria,
|
|
57
52
|
isOpen: i !== null,
|
|
58
|
-
onClose:
|
|
59
|
-
title:
|
|
60
|
-
children: i && /* @__PURE__ */ o(
|
|
53
|
+
onClose: A,
|
|
54
|
+
title: r.expense_details,
|
|
55
|
+
children: i && /* @__PURE__ */ o(U, {
|
|
61
56
|
beat: n,
|
|
62
57
|
layout: "insights",
|
|
63
|
-
onDeleted:
|
|
58
|
+
onDeleted: A,
|
|
64
59
|
repeatingTransactionGuid: i.repeatingTransactionGuid,
|
|
65
60
|
selectedRecurrence: i
|
|
66
61
|
})
|
|
67
62
|
}),
|
|
68
|
-
/* @__PURE__ */ o(
|
|
63
|
+
/* @__PURE__ */ o(_, {
|
|
69
64
|
ariaLabelClose: p?.close_account_details_aria,
|
|
70
|
-
isOpen:
|
|
71
|
-
onClose:
|
|
65
|
+
isOpen: s !== null,
|
|
66
|
+
onClose: N,
|
|
72
67
|
title: p?.account_details,
|
|
73
|
-
children:
|
|
68
|
+
children: s && /* @__PURE__ */ o(V, { beat: {
|
|
74
69
|
...n,
|
|
75
70
|
primary_account: void 0,
|
|
76
|
-
primary_account_guid:
|
|
71
|
+
primary_account_guid: s
|
|
77
72
|
} })
|
|
78
73
|
})
|
|
79
74
|
] });
|
|
80
75
|
});
|
|
81
76
|
export {
|
|
82
|
-
|
|
77
|
+
_t as AccountListBlock
|
|
83
78
|
};
|
|
84
79
|
|
|
85
80
|
//# sourceMappingURL=AccountListBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport
|
|
1
|
+
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Recurrence } from '../../../core'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\nimport CategoryTile from '../../components/CategoryTile'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\nimport {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\n/**\n * Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.\n * A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared\n * AccountDetailsBlock), each in a nested drawer.\n */\nexport const AccountListBlock = observer(function AccountListBlock({ beat }: ActionBlockProps) {\n const [tappedExpense, setTappedExpense] = useState<Recurrence | null>(null)\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const {\n accounts: accountsCopy,\n insights_feed: insightsFeedCopy,\n recurring: recurringCopy,\n } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const cta = useOpenedCta(beat)\n const { uiStore } = useCashflowStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n const { config } = useAppConfig()\n const { failed: expensesFailed, ready: expensesReady, retry } = useRecurringExpensesLoadState()\n const copy = insightsFeedCopy?.account_list\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n if (!accountsLoaded) return <Loader />\n\n const listed = resolveBeatAccounts(beat, visibleAccounts, cashAccounts)\n const checking = listed.filter(isCheckingAccount)\n const savings = listed.filter((account) => !isCheckingAccount(account))\n const showAvailable = config.display_available_balance_in_accounts\n const sections = [\n toAccountSection('checking', copy.checking, checking, showAvailable),\n toAccountSection('savings', copy.savings, savings, showAvailable),\n ].filter((section) => section.rows.length > 0)\n\n // Every upcoming expense as its own row, largest first (Figma); no \"Other\" fold, so each opens its details.\n const expenses: ExpenseRow[] = expensesReady\n ? [...uiStore.expensesTilNextIncome]\n .sort((a, b) => b.amount - a.amount)\n .map((expense) => {\n const account = visibleAccounts.find(({ guid }) => guid === expense.accountGuid)\n const repeating = detailedRepeatingTransactions.find(\n ({ guid }) => guid === expense.repeatingTransactionGuid,\n )\n\n return {\n account: {\n institutionGuid: expense.institutionGuid,\n name: account ? getAccountDisplayName(account) : expense.institutionName,\n },\n amount: expense.amount,\n frequency: repeating && getFrequencyLabel(recurringCopy, repeating, false),\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n onClick: () => setTappedExpense(expense),\n }\n })\n : []\n\n const closeExpenseDetails = () => setTappedExpense(null)\n const closeAccountDetails = () => setTappedAccountGuid(null)\n\n return (\n <>\n <AccountListContent\n copy={copy}\n expenses={expenses}\n expensesLoading={!expensesReady && !expensesFailed}\n onAccountClick={setTappedAccountGuid}\n onRetryExpenses={expensesFailed ? retry : undefined}\n sections={sections}\n showAvailable={showAvailable}\n summary={buildSummary(cta, copy)}\n />\n <Drawer\n ariaLabelClose={recurringCopy.close_drawer_aria}\n isOpen={tappedExpense !== null}\n onClose={closeExpenseDetails}\n title={recurringCopy.expense_details}\n >\n {tappedExpense && (\n <RecurringTransactionBlock\n beat={beat}\n layout=\"insights\"\n onDeleted={closeExpenseDetails}\n repeatingTransactionGuid={tappedExpense.repeatingTransactionGuid}\n selectedRecurrence={tappedExpense}\n />\n )}\n </Drawer>\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={closeAccountDetails}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n // The shared block shows the beat's account, so hand it the tapped one instead.\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,IAAa,KAAmB,EAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,CAAC,GAAe,CAAA,IAAoB,EAA4B,IAAI,GACpE,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EACJ,UAAU,GACV,eAAe,GACf,WAAW,EAAA,IACT,EAAmB,GACjB,EAAE,gBAAA,GAAgB,cAAA,GAAc,iBAAA,EAAA,IAAoB,EAAgB,GACpE,IAAM,EAAa,CAAI,GACvB,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,+BAAA,EAAA,IAAkC,EAA8B,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,QAAQ,GAAgB,OAAO,GAAe,OAAA,EAAA,IAAU,EAA8B,GACxF,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,MAAI,CAAC,EAAgB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