@mx-cartographer/experiences 9.7.127 → 9.7.129
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/types/localization/InsightsFeedCopy.d.ts +11 -15
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +5 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +77 -30
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.d.ts +26 -13
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js +107 -136
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.d.ts +21 -7
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js +34 -17
- package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js +10 -8
- package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +101 -105
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.d.ts +10 -12
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js +20 -19
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.d.ts +3 -12
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js +8 -8
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.d.ts +9 -0
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js +27 -10
- package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +1 -7
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +54 -63
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +29 -75
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js +18 -9
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +66 -65
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +24 -30
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +84 -101
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/components/AmountBreakdownCard.es.js +9 -8
- package/dist/insights-v2/components/AmountBreakdownCard.es.js.map +1 -1
- package/dist/insights-v2/components/CategoryTile.d.ts +14 -0
- package/dist/insights-v2/components/CategoryTile.es.js +28 -0
- package/dist/insights-v2/components/CategoryTile.es.js.map +1 -0
- package/dist/insights-v2/components/InsightListRow.d.ts +31 -0
- package/dist/insights-v2/components/InsightListRow.es.js +111 -0
- package/dist/insights-v2/components/InsightListRow.es.js.map +1 -0
- package/dist/insights-v2/components/LogoMark.d.ts +3 -3
- package/dist/insights-v2/components/LogoMark.es.js +11 -10
- package/dist/insights-v2/components/LogoMark.es.js.map +1 -1
- package/dist/insights-v2/components/SubTabs.d.ts +2 -1
- package/dist/insights-v2/components/SubTabs.es.js +10 -10
- package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +12 -12
- package/dist/insights-v2/mappings/blocks.es.js +21 -21
- package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -1
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +169 -120
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js.map +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +3 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +151 -118
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -6
- package/dist/transactions/components/shared/TransactionDetails.es.js +149 -199
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/Description.d.ts +2 -0
- package/dist/transactions/components/shared/transactiondetails/Description.es.js +59 -50
- package/dist/transactions/components/shared/transactiondetails/Description.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.d.ts +10 -0
- package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js +68 -0
- package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [9.7.129] - 11-10-2026
|
|
2
|
+
|
|
3
|
+
- **BREAKING** - Monthly Obligations Status drawer and the insights Expense Details match Figma: every recurring expense is its own row (no "Other" fold), a tapped account opens Account Details (the shared account details block) in a nested drawer, and list dividers start under the text; needs the new Account List copy first (publish mrs_content !500 and !505 (Accounts tab label), bump firefly, then release); the exported `AmountBreakdownCard` now has the grey `action.hover` total box and the soft logo elevation shadow (WEC-2115)
|
|
4
|
+
|
|
5
|
+
## [9.7.128] - 11-10-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - A budget for a sub-category shows its top-level category's icon and colour on the Insights V2 budget card and the Budget Details drawer instead of the Uncategorized ones, and the Transaction History header's merchant fallback tile does the same (WEC-2259)
|
|
8
|
+
- **FIXED** - A merchant budget card's logo is the size of a category budget's tile (44px), as Figma and the Budget Details drawer have it (WEC-2259)
|
|
9
|
+
- **FIXED** - An Insights V2 transaction row draws no icon, instead of an empty box, for an icon name mx-icons does not define (WEC-2259)
|
|
10
|
+
|
|
1
11
|
## [9.7.127] - 11-10-2026
|
|
2
12
|
|
|
3
13
|
- **FIXED** - An Insights V2 card's subtitle shows a sub-category as its top-level category icon instead of the Uncategorized glyph, and draws nothing instead of an empty box for an icon name mx-icons does not define (WEC-2259)
|
|
@@ -20,10 +20,7 @@ interface GeneralInsightsFeedCopy {
|
|
|
20
20
|
projected_amount?: string;
|
|
21
21
|
transaction_history_title: string;
|
|
22
22
|
transaction_details_title: string;
|
|
23
|
-
/**
|
|
24
|
-
* Transaction-count pill on the Transaction List summary header; `_1{count}` is the number.
|
|
25
|
-
* Optional until the localized-content service ships it; the card has an English default.
|
|
26
|
-
*/
|
|
23
|
+
/** Transaction-count pill (`_1{count}`); optional until mrs_content ships it. */
|
|
27
24
|
transaction_count?: string;
|
|
28
25
|
/** Singular form of `transaction_count` (count === 1). */
|
|
29
26
|
transaction_count_one?: string;
|
|
@@ -126,11 +123,7 @@ export interface TransactionHistoryBlock {
|
|
|
126
123
|
non_essential_category_summary_drawer_title: string;
|
|
127
124
|
monthly_deposit_summary_drawer_title: string;
|
|
128
125
|
monthly_subscription_aggregate_drawer_title: string;
|
|
129
|
-
/**
|
|
130
|
-
* The Upcoming Bill drawer's tip: `_1{tip}` the bold tip title, `_2{merchant}` the merchant and
|
|
131
|
-
* `_3{date}` the due date. Optional: until the localized-content service ships it (mrs_content
|
|
132
|
-
* 5.7.29), the drawer shows no tip.
|
|
133
|
-
*/
|
|
126
|
+
/** Upcoming Bill tip: `_1{tip}`, `_2{merchant}`, `_3{date}`; optional, no tip without it. */
|
|
134
127
|
upcoming_bill_tip_message?: string;
|
|
135
128
|
/**
|
|
136
129
|
* The Debt vs. Income drawer's tip: `_1{tip}` the bold tip title and `_2{limit}` the bold limit
|
|
@@ -418,11 +411,7 @@ export interface BudgetDetailsCopy {
|
|
|
418
411
|
remaining: string;
|
|
419
412
|
total_out_of_limit_aria: string;
|
|
420
413
|
}
|
|
421
|
-
/**
|
|
422
|
-
* The cadence words that end the Upcoming Subscription price pill ("$16.06 / month"), keyed by
|
|
423
|
-
* the stored recurrence type. Each is optional until the localized-content service ships it: a
|
|
424
|
-
* missing word shows the price alone.
|
|
425
|
-
*/
|
|
414
|
+
/** Cadence words ending the Upcoming Subscription price pill; a missing word shows the price alone. */
|
|
426
415
|
export interface UpcomingSubscriptionBlockCopy {
|
|
427
416
|
cadence_every_week?: string;
|
|
428
417
|
cadence_every_other_week?: string;
|
|
@@ -443,8 +432,15 @@ export interface AccountListCopy {
|
|
|
443
432
|
/** The emphasised "Total Remaining" row. */
|
|
444
433
|
remaining: string;
|
|
445
434
|
accounts_header: string;
|
|
446
|
-
|
|
435
|
+
/** Section headers for the Checking / Savings account groups. */
|
|
436
|
+
checking: string;
|
|
437
|
+
savings: string;
|
|
438
|
+
/** Row subtitle under each account name. */
|
|
439
|
+
available_balance: string;
|
|
447
440
|
no_accounts: string;
|
|
441
|
+
/** Recurring Expenses tab label and empty state. */
|
|
442
|
+
recurring_expenses: string;
|
|
443
|
+
no_recurring_expenses: string;
|
|
448
444
|
}
|
|
449
445
|
export interface InsightsFeedCopy {
|
|
450
446
|
general: GeneralInsightsFeedCopy;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ActionBlockProps } from '../../mappings/blocks';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.
|
|
4
|
+
* A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared
|
|
5
|
+
* AccountDetailsBlock), each in a nested drawer.
|
|
6
|
+
*/
|
|
3
7
|
export declare const AccountListBlock: (({ beat }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
8
|
displayName: string;
|
|
5
9
|
};
|
|
@@ -1,37 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccountStore as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { copyStore:
|
|
19
|
-
if (!
|
|
20
|
-
if (!
|
|
1
|
+
import J from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
|
+
import { useAccountStore as K, useAppConfig as M, useCashflowStore as P, useCategoryStore as Q, useGlobalCopyStore as U, useGlobalStore as W, useInsightsV2Store as X, useRecurringTransactionsStore as Y } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { getFrequencyLabel as Z } from "../../../core/utils/RecurringTransactionsUtil.es.js";
|
|
4
|
+
import C from "../../../common/components/drawer/Drawer.es.js";
|
|
5
|
+
import A from "../../../common/components/Loader.es.js";
|
|
6
|
+
import { getDynamicCtaBasedOnTriggers as tt } from "../util.es.js";
|
|
7
|
+
import { useRecurringExpensesLoadState as ot } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
8
|
+
import { RecurringTransactionBlock as et } from "../RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
9
|
+
import { AccountDetailsBlock as nt } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
|
|
10
|
+
import it from "./AccountListContent.es.js";
|
|
11
|
+
import { buildSummary as ct, isCheckingAccount as S, resolveBeatAccounts as rt, toAccountSection as G } from "./layout.es.js";
|
|
12
|
+
import { useState as T } from "react";
|
|
13
|
+
import { observer as st } from "mobx-react-lite";
|
|
14
|
+
import at from "@mui/material/Stack";
|
|
15
|
+
import { CategoryIcon as ut, Text as lt } from "@mxenabled/mxui";
|
|
16
|
+
import { Fragment as mt, jsx as o, jsxs as dt } from "react/jsx-runtime";
|
|
17
|
+
var wt = st(function({ beat: n }) {
|
|
18
|
+
const [i, l] = T(null), [r, m] = T(null), { copyStore: k } = W(), { accounts: d, common: v, insights_feed: L, recurring: s } = U(), { accountsLoaded: b, cashAccounts: x, visibleAccounts: p } = K(), { actionDrawer: D } = X(), { uiStore: w } = P(), { getTopLevelCategoryGuid: R } = Q(), { detailedRepeatingTransactions: B } = Y(), { config: E } = M(), { failed: g, ready: f, retry: F } = ot(), e = L?.account_list;
|
|
19
|
+
if (!k.isInitialized) return /* @__PURE__ */ o(A, {});
|
|
20
|
+
if (!e) return /* @__PURE__ */ o(at, {
|
|
21
21
|
sx: { p: 24 },
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
});
|
|
24
|
-
if (!m) return /* @__PURE__ */ t(s, {});
|
|
25
|
-
const { primary_cta: d, secondary_cta: f, in_description_cta: g } = i.insights_payload ?? {}, y = B(p, d, f, g), n = w(i, l, u);
|
|
26
|
-
return /* @__PURE__ */ t(v, {
|
|
27
|
-
accounts: n.map(G),
|
|
28
|
-
copy: r,
|
|
29
|
-
summary: C(y, r),
|
|
30
|
-
totalBalance: x(n)
|
|
22
|
+
children: /* @__PURE__ */ o(lt, { children: v?.error_message ?? "Something went wrong." })
|
|
31
23
|
});
|
|
24
|
+
if (!b) return /* @__PURE__ */ o(A, {});
|
|
25
|
+
const { primary_cta: I, secondary_cta: $, in_description_cta: N } = n.insights_payload ?? {}, O = tt(D, I, $, N), y = rt(n, p, x), j = y.filter(S), q = y.filter((t) => !S(t)), a = E.display_available_balance_in_accounts, z = [G("checking", e.checking, j, a), G("savings", e.savings, q, a)].filter((t) => t.rows.length > 0), V = f ? [...w.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
|
|
26
|
+
const c = p.find(({ guid: u }) => u === t.accountGuid), h = B.find(({ guid: u }) => u === t.repeatingTransactionGuid);
|
|
27
|
+
return {
|
|
28
|
+
account: {
|
|
29
|
+
institutionGuid: t.institutionGuid,
|
|
30
|
+
name: c ? J(c) : t.institutionName
|
|
31
|
+
},
|
|
32
|
+
amount: t.amount,
|
|
33
|
+
frequency: h && Z(s, h, !1),
|
|
34
|
+
key: `${t.repeatingTransactionGuid}-${t.expectedDate.getTime()}`,
|
|
35
|
+
leading: /* @__PURE__ */ o(ut, {
|
|
36
|
+
categoryGuid: R(t.categoryGuid),
|
|
37
|
+
size: 32
|
|
38
|
+
}),
|
|
39
|
+
name: t.name,
|
|
40
|
+
onClick: () => l(t)
|
|
41
|
+
};
|
|
42
|
+
}) : [], _ = () => l(null), H = () => m(null);
|
|
43
|
+
return /* @__PURE__ */ dt(mt, { children: [
|
|
44
|
+
/* @__PURE__ */ o(it, {
|
|
45
|
+
copy: e,
|
|
46
|
+
expenses: V,
|
|
47
|
+
expensesLoading: !f && !g,
|
|
48
|
+
onAccountClick: m,
|
|
49
|
+
onRetryExpenses: g ? F : void 0,
|
|
50
|
+
sections: z,
|
|
51
|
+
showAvailable: a,
|
|
52
|
+
summary: ct(O, e)
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ o(C, {
|
|
55
|
+
ariaLabelClose: s.close_drawer_aria,
|
|
56
|
+
isOpen: i !== null,
|
|
57
|
+
onClose: _,
|
|
58
|
+
title: s.expense_details,
|
|
59
|
+
children: i && /* @__PURE__ */ o(et, {
|
|
60
|
+
beat: n,
|
|
61
|
+
layout: "insights",
|
|
62
|
+
onDeleted: _,
|
|
63
|
+
repeatingTransactionGuid: i.repeatingTransactionGuid,
|
|
64
|
+
selectedRecurrence: i
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ o(C, {
|
|
68
|
+
ariaLabelClose: d?.close_account_details_aria,
|
|
69
|
+
isOpen: r !== null,
|
|
70
|
+
onClose: H,
|
|
71
|
+
title: d?.account_details,
|
|
72
|
+
children: r && /* @__PURE__ */ o(nt, { beat: {
|
|
73
|
+
...n,
|
|
74
|
+
primary_account: void 0,
|
|
75
|
+
primary_account_guid: r
|
|
76
|
+
} })
|
|
77
|
+
})
|
|
78
|
+
] });
|
|
32
79
|
});
|
|
33
80
|
export {
|
|
34
|
-
|
|
81
|
+
wt as AccountListBlock
|
|
35
82
|
};
|
|
36
83
|
|
|
37
84
|
//# 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 Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useAccountStore,\n useGlobalCopyStore,\n useGlobalStore,\n useInsightsV2Store,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type {
|
|
1
|
+
{"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CategoryIcon, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useCategoryStore,\n useGlobalCopyStore,\n useGlobalStore,\n useInsightsV2Store,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Recurrence } from '../../../core'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\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 { copyStore } = useGlobalStore()\n const {\n accounts: accountsCopy,\n common: commonCopy,\n insights_feed: insightsFeedCopy,\n recurring: recurringCopy,\n } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const { actionDrawer } = useInsightsV2Store()\n const { uiStore } = useCashflowStore()\n const { getTopLevelCategoryGuid } = useCategoryStore()\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 (!copyStore.isInitialized) return <Loader />\n\n // Copy loads once at app start, so a retry cannot clear a missing namespace: a plain message.\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message ?? 'Something went wrong.'}</Text>\n </Stack>\n )\n }\n\n if (!accountsLoaded) return <Loader />\n\n const { primary_cta, secondary_cta, in_description_cta } = beat.insights_payload ?? {}\n const cta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\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: (\n <CategoryIcon\n categoryGuid={getTopLevelCategoryGuid(expense.categoryGuid)}\n size={32}\n />\n ),\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":";;;;;;;;;;;;;;;;AAsCA,IAAa,KAAmB,GAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,CAAC,GAAe,CAAA,IAAoB,EAA4B,IAAI,GACpE,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EACJ,UAAU,GACV,QAAQ,GACR,eAAe,GACf,WAAW,EAAA,IACT,EAAmB,GACjB,EAAE,gBAAA,GAAgB,cAAA,GAAc,iBAAA,EAAA,IAAoB,EAAgB,GACpE,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,yBAAA,EAAA,IAA4B,EAAiB,GAC/C,EAAE,+BAAA,EAAA,IAAkC,EAA8B,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,QAAQ,GAAgB,OAAO,GAAe,OAAA,EAAA,IAAU,GAA8B,GACxF,IAAO,GAAkB;AAE/B,MAAI,CAAC,EAAU,cAAe,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAG9C,MAAI,CAAC,EACH,QACE,gBAAA,EAAC,IAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAA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AA,MACP,CAAA;AAAA,MAEH,MAAM,EAAQ;AAAA,MACd,SAAA,MAAe,EAAiB,CAAO;AAAA,IACzC;AAAA,EACF,CAAC,IACH,CAAC,GAEC,IAAA,MAA4B,EAAiB,IAAI,GACjD,IAAA,MAA4B,EAAqB,IAAI;AAE3D,SACE,gBAAA,GAAA,IAAA,EAAA,UAAA;AAAA,IACE,gBAAA,EAAC,IAAD;AAAA,MACQ,MAAA;AAAA,MACI,UAAA;AAAA,MACV,iBAAiB,CAAC,KAAiB,CAAC;AAAA,MACpC,gBAAgB;AAAA,MAChB,iBAAiB,IAAiB,IAAQ;AAAA,MAChC,UAAA;AAAA,MACK,eAAA;AAAA,MACf,SAAS,GAAa,GAAK,CAAI;AAAA,IAChC,CAAA;AAAA,IACD,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAc;AAAA,MAC9B,QAAQ,MAAkB;AAAA,MAC1B,SAAS;AAAA,MACT,OAAO,EAAc;AAAA,MAEpB,UAAA,KACC,gBAAA,EAAC,IAAD;AAAA,QACQ,MAAA;AAAA,QACN,QAAO;AAAA,QACP,WAAW;AAAA,QACX,0BAA0B,EAAc;AAAA,QACxC,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAEG,CAAA;AAAA,IACR,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,GAAc;AAAA,MAC9B,QAAQ,MAAsB;AAAA,MAC9B,SAAS;AAAA,MACT,OAAO,GAAc;AAAA,MAEpB,UAAA,KAEC,gBAAA,EAAC,IAAD,EACE,MAAM;AAAA,QAAE,GAAG;AAAA,QAAM,iBAAiB;AAAA,QAAW,sBAAsB;AAAA,MAAkB,EACtF,CAAA;AAAA,IAEG,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy';
|
|
2
|
-
import { AccountListSummary } from './layout';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { AccountListSummary, AccountSection } from './layout';
|
|
3
|
+
/** A Recurring Expenses row: one per upcoming expense (Figma lists every one; no "Other" fold). */
|
|
4
|
+
export interface ExpenseRow {
|
|
5
|
+
key: string;
|
|
5
6
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
amount: number;
|
|
8
|
+
leading: React.ReactNode;
|
|
9
|
+
account?: {
|
|
10
|
+
institutionGuid: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
frequency?: string;
|
|
14
|
+
onClick?: () => void;
|
|
11
15
|
}
|
|
12
16
|
export interface AccountListContentProps {
|
|
13
17
|
copy: AccountListCopy;
|
|
14
|
-
/** Omitted when the beat carries no calculation: the drawer is just the
|
|
18
|
+
/** Omitted when the beat carries no calculation: the drawer is just the tabs. */
|
|
15
19
|
summary?: AccountListSummary;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/** The accounts grouped into Checking / Savings sections. */
|
|
21
|
+
sections: AccountSection[];
|
|
22
|
+
/** Recurring-expense rows for the second tab, already ordered. */
|
|
23
|
+
expenses: ExpenseRow[];
|
|
24
|
+
/** The expenses load with the drawer, after the accounts; the tab shows a loader until they're in. */
|
|
25
|
+
expensesLoading: boolean;
|
|
26
|
+
/** The host's available-vs-current rule: the "Available Balance" subtitle only fits available balances. */
|
|
27
|
+
showAvailable: boolean;
|
|
28
|
+
/** Set when the expenses load failed: the tab shows the error card with this retry. */
|
|
29
|
+
onRetryExpenses?: () => void;
|
|
30
|
+
/** Tapping an account row opens its Account Details (Figma); rows are static without it. */
|
|
31
|
+
onAccountClick?: (accountGuid: string) => void;
|
|
19
32
|
}
|
|
20
33
|
/** Presentational body of the Account List drawer, minus the drawer header. */
|
|
21
|
-
declare const AccountListContent: ({
|
|
34
|
+
declare const AccountListContent: ({ copy, expenses, expensesLoading, onAccountClick, onRetryExpenses, sections, showAvailable, summary, }: AccountListContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
35
|
export default AccountListContent;
|
|
@@ -1,156 +1,127 @@
|
|
|
1
|
-
import { DEFAULT_INSTITUTION_LOGO_URL as
|
|
2
|
-
import { formatSignedCurrency as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { DEFAULT_INSTITUTION_LOGO_URL as L } from "../../../core/constants/InstitutionLogo.es.js";
|
|
2
|
+
import { formatSignedCurrency as k } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import I from "../../../common/components/Loader.es.js";
|
|
4
|
+
import { SubTabs as T, subTabPanelProps as _ } from "../../components/SubTabs.es.js";
|
|
5
|
+
import { ErrorCard as S } from "../../components/ErrorCard.es.js";
|
|
6
|
+
import p from "../../components/InsightListRow.es.js";
|
|
7
|
+
import C from "../../components/AmountBreakdownCard.es.js";
|
|
8
|
+
import { useState as w } from "react";
|
|
9
|
+
import i from "@mui/material/Stack";
|
|
10
|
+
import { InstitutionLogo as G, Text as u } from "@mxenabled/mxui";
|
|
11
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
12
|
+
import N from "@mui/material/Box";
|
|
13
|
+
var P = ({ summary: n }) => {
|
|
14
|
+
const o = n.rows.find((a) => a.bold), l = n.rows.filter((a) => !a.bold);
|
|
15
|
+
return o ? /* @__PURE__ */ t(i, {
|
|
16
|
+
"aria-label": n.heading,
|
|
17
|
+
component: "section",
|
|
18
|
+
sx: {
|
|
19
|
+
pb: 12,
|
|
20
|
+
pt: 24,
|
|
21
|
+
px: 24
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ t(C, {
|
|
24
|
+
rows: l.map((a) => ({
|
|
25
|
+
amount: a.value,
|
|
26
|
+
label: a.label
|
|
27
|
+
})),
|
|
28
|
+
total: {
|
|
29
|
+
amount: o.value,
|
|
30
|
+
label: o.label
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}) : null;
|
|
34
|
+
}, g = ({ children: n, label: o }) => /* @__PURE__ */ t(i, {
|
|
35
|
+
"aria-label": o,
|
|
36
|
+
component: "ul",
|
|
11
37
|
sx: {
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
bgcolor: "background.paper",
|
|
39
|
+
listStyle: "none",
|
|
40
|
+
m: 0,
|
|
41
|
+
p: 0
|
|
14
42
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}), u = ({ bold: o = !1, label: e, value: i }) => /* @__PURE__ */ t(n, {
|
|
43
|
+
children: n
|
|
44
|
+
}), U = ({ availableBalanceLabel: n, onAccountClick: o, sections: l }) => /* @__PURE__ */ t(i, { children: l.map((a) => /* @__PURE__ */ c(i, { children: [/* @__PURE__ */ c(i, {
|
|
18
45
|
sx: {
|
|
19
46
|
alignItems: "center",
|
|
20
47
|
flexDirection: "row",
|
|
21
48
|
gap: 16,
|
|
22
|
-
minHeight:
|
|
23
|
-
px: 16
|
|
24
|
-
},
|
|
25
|
-
children: [/* @__PURE__ */ r(l, {
|
|
26
|
-
bold: o,
|
|
27
|
-
sx: { flexGrow: 1 },
|
|
28
|
-
variant: "body1",
|
|
29
|
-
children: e
|
|
30
|
-
}), /* @__PURE__ */ r(p, { children: i })]
|
|
31
|
-
}), v = ({ summary: o }) => /* @__PURE__ */ t(n, {
|
|
32
|
-
sx: {
|
|
33
|
-
gap: 12,
|
|
34
|
-
pt: 24,
|
|
49
|
+
minHeight: 32,
|
|
35
50
|
px: 24
|
|
36
51
|
},
|
|
37
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ t(u, {
|
|
38
53
|
bold: !0,
|
|
39
54
|
component: "h3",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
overflow: "hidden"
|
|
49
|
-
},
|
|
50
|
-
children: o.rows.map((e, i) => /* @__PURE__ */ t(c, { children: [i > 0 && /* @__PURE__ */ r(m, {}), /* @__PURE__ */ r(u, {
|
|
51
|
-
bold: e.bold,
|
|
52
|
-
label: e.label,
|
|
53
|
-
value: e.value
|
|
54
|
-
})] }, e.key))
|
|
55
|
+
sx: { flexGrow: 1 },
|
|
56
|
+
variant: "caption",
|
|
57
|
+
children: a.header
|
|
58
|
+
}), /* @__PURE__ */ t(u, {
|
|
59
|
+
bold: !0,
|
|
60
|
+
sx: { fontVariantNumeric: "tabular-nums" },
|
|
61
|
+
variant: "caption",
|
|
62
|
+
children: k(a.total)
|
|
55
63
|
})]
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
}), /* @__PURE__ */ t(g, {
|
|
65
|
+
label: a.header,
|
|
66
|
+
children: a.rows.map((r, d) => /* @__PURE__ */ t(p, {
|
|
67
|
+
amount: r.balance,
|
|
68
|
+
amountVariant: "body2",
|
|
69
|
+
boldName: !0,
|
|
70
|
+
dividerInset: "text",
|
|
71
|
+
isLast: d === a.rows.length - 1,
|
|
72
|
+
leading: /* @__PURE__ */ t(G, {
|
|
73
|
+
alt: "",
|
|
74
|
+
institutionGuid: r.institutionGuid,
|
|
75
|
+
logoUrl: r.institutionGuid ? void 0 : L,
|
|
76
|
+
size: 32
|
|
77
|
+
}),
|
|
78
|
+
name: r.name,
|
|
79
|
+
onClick: o ? () => o(r.guid) : void 0,
|
|
80
|
+
subtitle: n
|
|
81
|
+
}, r.guid))
|
|
82
|
+
})] }, a.key)) }), H = ({ copy: n, expenses: o, expensesLoading: l, onAccountClick: a, onRetryExpenses: r, sections: d, showAvailable: f, summary: s }) => {
|
|
83
|
+
const [m, h] = w(0), b = (e) => /* @__PURE__ */ t(u, {
|
|
84
|
+
component: "p",
|
|
85
|
+
sx: { p: 24 },
|
|
86
|
+
children: e
|
|
87
|
+
}), v = r ? /* @__PURE__ */ t(S, { onRetry: r }) : l ? /* @__PURE__ */ t(I, {}) : o.length === 0 ? b(n.no_recurring_expenses) : /* @__PURE__ */ t(g, { children: o.map((e, x) => /* @__PURE__ */ t(p, {
|
|
88
|
+
account: e.account,
|
|
89
|
+
amount: e.amount,
|
|
90
|
+
boldName: !0,
|
|
91
|
+
caption: e.frequency,
|
|
92
|
+
dividerInset: "text",
|
|
93
|
+
isLast: x === o.length - 1,
|
|
94
|
+
leading: e.leading,
|
|
95
|
+
name: e.name,
|
|
96
|
+
onClick: e.onClick
|
|
97
|
+
}, e.key)) });
|
|
98
|
+
return /* @__PURE__ */ c(i, {
|
|
60
99
|
sx: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
gap: 12,
|
|
64
|
-
px: 24,
|
|
65
|
-
py: 12
|
|
100
|
+
bgcolor: "background.default",
|
|
101
|
+
pb: 24
|
|
66
102
|
},
|
|
67
103
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
104
|
+
s && /* @__PURE__ */ t(P, { summary: s }),
|
|
105
|
+
/* @__PURE__ */ t(T, {
|
|
106
|
+
id: "account-list",
|
|
107
|
+
isTypeFilter: !1,
|
|
108
|
+
onChange: h,
|
|
109
|
+
selectedIndex: m,
|
|
110
|
+
tabs: [{ label: n.accounts_header }, { label: n.recurring_expenses }]
|
|
73
111
|
}),
|
|
74
|
-
/* @__PURE__ */ t(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
variant: "body1",
|
|
82
|
-
children: d
|
|
83
|
-
}), a && /* @__PURE__ */ r(l, {
|
|
84
|
-
color: "text.secondary",
|
|
85
|
-
variant: "caption",
|
|
86
|
-
children: `•••• ${a}`
|
|
87
|
-
})]
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ r(p, { children: x(o) })
|
|
90
|
-
]
|
|
91
|
-
}), /* @__PURE__ */ r(m, { sx: {
|
|
92
|
-
bottom: 0,
|
|
93
|
-
left: i ? 0 : 24,
|
|
94
|
-
position: "absolute",
|
|
95
|
-
right: 0
|
|
96
|
-
} })]
|
|
97
|
-
}), R = ({ accounts: o, copy: e, summary: i, totalBalance: a }) => /* @__PURE__ */ t(n, {
|
|
98
|
-
sx: {
|
|
99
|
-
bgcolor: "background.default",
|
|
100
|
-
pb: 24
|
|
101
|
-
},
|
|
102
|
-
children: [i && /* @__PURE__ */ r(v, { summary: i }), o.length === 0 ? /* @__PURE__ */ r(l, {
|
|
103
|
-
component: "p",
|
|
104
|
-
sx: { p: 24 },
|
|
105
|
-
children: e.no_accounts
|
|
106
|
-
}) : /* @__PURE__ */ t(n, { children: [
|
|
107
|
-
/* @__PURE__ */ r(c, {
|
|
108
|
-
sx: {
|
|
109
|
-
pb: 4,
|
|
110
|
-
pt: 16,
|
|
111
|
-
px: 24
|
|
112
|
-
},
|
|
113
|
-
children: /* @__PURE__ */ r(l, {
|
|
114
|
-
bold: !0,
|
|
115
|
-
component: "h3",
|
|
116
|
-
variant: "body1",
|
|
117
|
-
children: e.accounts_header
|
|
112
|
+
/* @__PURE__ */ t(N, {
|
|
113
|
+
..._("account-list", m),
|
|
114
|
+
children: m === 1 ? v : d.length === 0 ? b(n.no_accounts) : /* @__PURE__ */ t(U, {
|
|
115
|
+
availableBalanceLabel: f ? n.available_balance : void 0,
|
|
116
|
+
onAccountClick: a,
|
|
117
|
+
sections: d
|
|
118
|
+
})
|
|
118
119
|
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
sx: {
|
|
123
|
-
bgcolor: "background.paper",
|
|
124
|
-
listStyle: "none",
|
|
125
|
-
m: 0,
|
|
126
|
-
p: 0
|
|
127
|
-
},
|
|
128
|
-
children: o.map(({ guid: d, ...h }, s) => /* @__PURE__ */ g(y, {
|
|
129
|
-
...h,
|
|
130
|
-
isLast: s === o.length - 1,
|
|
131
|
-
key: d
|
|
132
|
-
}))
|
|
133
|
-
}),
|
|
134
|
-
/* @__PURE__ */ t(n, {
|
|
135
|
-
sx: {
|
|
136
|
-
alignItems: "center",
|
|
137
|
-
bgcolor: "background.paper",
|
|
138
|
-
flexDirection: "row",
|
|
139
|
-
gap: 16,
|
|
140
|
-
px: 24,
|
|
141
|
-
py: 14
|
|
142
|
-
},
|
|
143
|
-
children: [/* @__PURE__ */ r(l, {
|
|
144
|
-
bold: !0,
|
|
145
|
-
sx: { flexGrow: 1 },
|
|
146
|
-
variant: "body1",
|
|
147
|
-
children: e.total_balance
|
|
148
|
-
}), /* @__PURE__ */ r(p, { children: x(a) })]
|
|
149
|
-
})
|
|
150
|
-
] })]
|
|
151
|
-
});
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
152
123
|
export {
|
|
153
|
-
|
|
124
|
+
H as default
|
|
154
125
|
};
|
|
155
126
|
|
|
156
127
|
//# sourceMappingURL=AccountListContent.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountListContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListContent.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\n\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport type { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\n\nimport type { AccountListSummary } from './layout'\n\nexport interface AccountListRow {\n guid: string\n name: string\n /** The last digits of the account number, shown masked; empty when unknown. */\n lastFour: string\n /** Empty when no institution is known: the default logo is shown. */\n institutionGuid: string\n balance: number\n}\n\nexport interface AccountListContentProps {\n copy: AccountListCopy\n /** Omitted when the beat carries no calculation: the drawer is just the list. */\n summary?: AccountListSummary\n /** Already ordered. */\n accounts: AccountListRow[]\n totalBalance: number\n}\n\nconst Amount = ({ children }: { children: string }) => (\n <Text bold={true} sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {children}\n </Text>\n)\n\nconst BreakdownRow = ({\n bold = false,\n label,\n value,\n}: {\n bold?: boolean\n label: string\n value: string\n}) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 16 }}>\n <Text bold={bold} sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Amount>{value}</Amount>\n </Stack>\n)\n\n/** The calculation box: a heading and the block-built rows, the last one emphasised. */\nconst Summary = ({ summary }: { summary: AccountListSummary }) => (\n <Stack sx={{ gap: 12, pt: 24, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {summary.heading}\n </Text>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n {summary.rows.map((row, index) => (\n <Box key={row.key}>\n {index > 0 && <Divider />}\n <BreakdownRow bold={row.bold} label={row.label} value={row.value} />\n </Box>\n ))}\n </Stack>\n </Stack>\n)\n\n/** One row. The last row's divider runs full width; the rest are inset to the text. */\nconst RowItem = ({\n balance,\n institutionGuid,\n isLast,\n lastFour,\n name,\n}: Omit<AccountListRow, 'guid'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12, px: 24, py: 12 }}>\n <InstitutionLogo\n alt=\"\"\n institutionGuid={institutionGuid}\n logoUrl={institutionGuid ? undefined : DEFAULT_INSTITUTION_LOGO_URL}\n size={32}\n />\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text truncate={true} variant=\"body1\">\n {name}\n </Text>\n {lastFour && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {`•••• ${lastFour}`}\n </Text>\n )}\n </Stack>\n <Amount>{formatSignedCurrency(balance)}</Amount>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 24, position: 'absolute', right: 0 }} />\n </Box>\n)\n\n/** Presentational body of the Account List drawer, minus the drawer header. */\nconst AccountListContent = ({ accounts, copy, summary, totalBalance }: AccountListContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n {summary && <Summary summary={summary} />}\n {accounts.length === 0 ? (\n <Text component=\"p\" sx={{ p: 24 }}>\n {copy.no_accounts}\n </Text>\n ) : (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {copy.accounts_header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {accounts.map(({ guid, ...row }, index) => (\n <RowItem {...row} isLast={index === accounts.length - 1} key={guid} />\n ))}\n </Stack>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n flexDirection: 'row',\n gap: 16,\n px: 24,\n py: 14,\n }}\n >\n <Text bold={true} sx={{ flexGrow: 1 }} variant=\"body1\">\n {copy.total_balance}\n </Text>\n <Amount>{formatSignedCurrency(totalBalance)}</Amount>\n </Stack>\n </Stack>\n )}\n </Stack>\n)\n\nexport default AccountListContent\n"],"mappings":";;;;;;;;AA+BA,IAAM,IAAA,CAAU,EAAE,UAAA,EAAA,MAChB,gBAAA,EAAC,GAAD;AAAA,EAAM,MAAM;AAAA,EAAM,IAAI;AAAA,IAAE,YAAY;AAAA,IAAG,oBAAoB;AAAA,EAAe;AAAA,EAAG,SAAQ;AAAA,EAClF,UAAA;AACG,CAAA,GAGF,IAAA,CAAgB,EACpB,MAAA,IAAO,IACP,OAAA,GACA,OAAA,EAAA,MAMA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,eAAe;AAAA,IAAO,KAAK;AAAA,IAAI,WAAW;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAAxF,U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;AAAA,QAAG,IAAI;AAAA,QAAI,IAAI;AAAA,MAAG;AAAA,MAC/B,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,WAAU;AAAA,QAAK,SAAQ;AAAA,QACtC,UAAA,EAAK;AAAA,MACF,CAAA;AAAA,IACH,CAAA;AAAA,IACL,gBAAA,EAAC,GAAD;AAAA,MAAO,WAAU;AAAA,MAAK,IAAI;AAAA,QAAE,SAAS;AAAA,QAAoB,WAAW;AAAA,QAAQ,GAAG;AAAA,QAAG,GAAG;AAAA,MAAE;AAAA,MACpF,UAAA,EAAS,IAAA,CAAK,EAAE,MAAA,GAAM,GAAG,EAAA,GAAO,MAC/B,gBAAA,EAAC,GAAD;AAAA,QAAS,GAAI;AAAA,QAAK,QAAQ,MAAU,EAAS,SAAS;AAAA,QAAG,KAAK;AAAA,MAAO,CAAA,CACtE;AAAA,IACI,CAAA;AAAA,IACP,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,eAAe;AAAA,QACf,KAAK;AAAA,QACL,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MARF,UAAA,CAUE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,UAAU,EAAE;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA,EAAK;AAAA,MACF,CAAA,GACN,gBAAA,EAAC,GAAD,EAAA,UAAS,EAAqB,CAAY,EAAU,CAAA,CAC/C;AAAA;EACF,EAAA,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"AccountListContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListContent.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\n\nimport { Loader } from '../../../common'\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport type { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport AmountBreakdownCard from '../../components/AmountBreakdownCard'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport InsightListRow from '../../components/InsightListRow'\nimport { SubTabs, subTabPanelProps } from '../../components/SubTabs'\n\nimport type { AccountListSummary, AccountSection } from './layout'\n\n/** A Recurring Expenses row: one per upcoming expense (Figma lists every one; no \"Other\" fold). */\nexport interface ExpenseRow {\n key: string\n name: string\n amount: number\n leading: React.ReactNode\n account?: { institutionGuid: string; name: string }\n frequency?: string\n onClick?: () => void\n}\n\nexport interface AccountListContentProps {\n copy: AccountListCopy\n /** Omitted when the beat carries no calculation: the drawer is just the tabs. */\n summary?: AccountListSummary\n /** The accounts grouped into Checking / Savings sections. */\n sections: AccountSection[]\n /** Recurring-expense rows for the second tab, already ordered. */\n expenses: ExpenseRow[]\n /** The expenses load with the drawer, after the accounts; the tab shows a loader until they're in. */\n expensesLoading: boolean\n /** The host's available-vs-current rule: the \"Available Balance\" subtitle only fits available balances. */\n showAvailable: boolean\n /** Set when the expenses load failed: the tab shows the error card with this retry. */\n onRetryExpenses?: () => void\n /** Tapping an account row opens its Account Details (Figma); rows are static without it. */\n onAccountClick?: (accountGuid: string) => void\n}\n\n/** The calculation card (Figma, as RemainingCash's): the breakdown rows, then the emphasised total. */\nconst Summary = ({ summary }: { summary: AccountListSummary }) => {\n const total = summary.rows.find((row) => row.bold)\n const breakdown = summary.rows.filter((row) => !row.bold)\n\n if (!total) return null\n\n return (\n <Stack aria-label={summary.heading} component=\"section\" sx={{ pb: 12, pt: 24, px: 24 }}>\n <AmountBreakdownCard\n rows={breakdown.map((row) => ({ amount: row.value, label: row.label }))}\n total={{ amount: total.value, label: total.label }}\n />\n </Stack>\n )\n}\n\n/** One section's (or the expenses tab's) rows as a real list, named by its section header. */\nconst RowList = ({ children, label }: { children: React.ReactNode; label?: string }) => (\n <Stack\n aria-label={label}\n component=\"ul\"\n sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}\n >\n {children}\n </Stack>\n)\n\n/** The Accounts tab: each Checking / Savings section under a 32px header row with its subtotal (Figma). */\nconst AccountsPanel = ({\n availableBalanceLabel,\n onAccountClick,\n sections,\n}: {\n /** Omitted when the host shows current balances: \"Available Balance\" would mislabel them. */\n availableBalanceLabel?: string\n onAccountClick?: (accountGuid: string) => void\n sections: AccountSection[]\n}) => (\n <Stack>\n {sections.map((section) => (\n <Stack key={section.key}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 32, px: 24 }}>\n <Text bold={true} component=\"h3\" sx={{ flexGrow: 1 }} variant=\"caption\">\n {section.header}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"caption\">\n {formatSignedCurrency(section.total)}\n </Text>\n </Stack>\n <RowList label={section.header}>\n {section.rows.map((row, index) => (\n <InsightListRow\n amount={row.balance}\n amountVariant=\"body2\"\n boldName={true}\n dividerInset=\"text\"\n isLast={index === section.rows.length - 1}\n key={row.guid}\n leading={\n <InstitutionLogo\n alt=\"\"\n institutionGuid={row.institutionGuid}\n logoUrl={row.institutionGuid ? undefined : DEFAULT_INSTITUTION_LOGO_URL}\n size={32}\n />\n }\n name={row.name}\n onClick={onAccountClick ? () => onAccountClick(row.guid) : undefined}\n subtitle={availableBalanceLabel}\n />\n ))}\n </RowList>\n </Stack>\n ))}\n </Stack>\n)\n\n/** Presentational body of the Account List drawer, minus the drawer header. */\nconst AccountListContent = ({\n copy,\n expenses,\n expensesLoading,\n onAccountClick,\n onRetryExpenses,\n sections,\n showAvailable,\n summary,\n}: AccountListContentProps) => {\n const [tab, setTab] = useState(0)\n const emptyState = (text: string) => (\n <Text component=\"p\" sx={{ p: 24 }}>\n {text}\n </Text>\n )\n\n // Each tab owns its empty state, so expenses still loading never hide the tabs.\n const expensesPanel = onRetryExpenses ? (\n <ErrorCard onRetry={onRetryExpenses} />\n ) : expensesLoading ? (\n <Loader />\n ) : expenses.length === 0 ? (\n emptyState(copy.no_recurring_expenses)\n ) : (\n <RowList>\n {expenses.map((expense, index) => (\n <InsightListRow\n account={expense.account}\n amount={expense.amount}\n boldName={true}\n caption={expense.frequency}\n dividerInset=\"text\"\n isLast={index === expenses.length - 1}\n key={expense.key}\n leading={expense.leading}\n name={expense.name}\n onClick={expense.onClick}\n />\n ))}\n </RowList>\n )\n\n return (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n {summary && <Summary summary={summary} />}\n <SubTabs\n id=\"account-list\"\n isTypeFilter={false}\n onChange={setTab}\n selectedIndex={tab}\n tabs={[{ label: copy.accounts_header }, { label: copy.recurring_expenses }]}\n />\n <Box {...subTabPanelProps('account-list', tab)}>\n {tab === 1 ? (\n expensesPanel\n ) : sections.length === 0 ? (\n emptyState(copy.no_accounts)\n ) : (\n <AccountsPanel\n availableBalanceLabel={showAvailable ? copy.available_balance : undefined}\n onAccountClick={onAccountClick}\n sections={sections}\n />\n )}\n </Box>\n </Stack>\n )\n}\n\nexport default AccountListContent\n"],"mappings":";;;;;;;;;;;;AAgDA,IAAM,IAAA,CAAW,EAAE,SAAA,EAAA,MAA+C;AAChE,QAAM,IAAQ,EAAQ,KAAK,KAAA,CAAM,MAAQ,EAAI,IAAI,GAC3C,IAAY,EAAQ,KAAK,OAAA,CAAQ,MAAQ,CAAC,EAAI,IAAI;AAExD,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IAAO,cAAY,EAAQ;AAAA,IAAS,WAAU;AAAA,IAAU,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IACnF,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM,EAAU,IAAA,CAAK,OAAS;AAAA,QAAE,QAAQ,EAAI;AAAA,QAAO,OAAO,EAAI;AAAA,MAAM,EAAE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AI;AAAA,MAAE,SAAS;AAAA,MAAsB,IAAI;AAAA,IAAG;AAAA,IAAnD,UAAA;AAAA,MACG,KAAW,gBAAA,EAAC,GAAD,EAAkB,SAAA,EAAU,CAAA;AAAA,MACxC,gBAAA,EAAC,GAAD;AAAA,QACE,IAAG;AAAA,QACH,cAAc;AAAA,QACd,UAAU;AAAA,QACV,eAAe;AAAA,QACf,MAAM,CAAC,EAAE,OAAO,EAAK,gBAAgB,GAAG,EAAE,OAAO,EAAK,mBAAmB,CAAC;AAAA,MAC3E,CAAA;AAAA,MACD,gBAAA,EAAC,GAAD;AAAA,QAAK,GAAI,EAAiB,gBAAgB,CAAG;AAAA,QAC1C,UAAA,MAAQ,IACP,IACE,EAAS,WAAW,IACtB,EAAW,EAAK,WAAW,IAE3B,gBAAA,EAAC,GAAD;AAAA,UACE,uBAAuB,IAAgB,EAAK,oBAAoB;AAAA,UAChD,gBAAA;AAAA,UACN,UAAA;AAAA,QACX,CAAA;AAAA,MAEA,CAAA;AAAA,IACA;AAAA;AAEX"}
|
|
@@ -2,9 +2,26 @@ import { Account, Beat, DrilldownData } from '../../../core';
|
|
|
2
2
|
import { AccountListCopy } from '../../../core/types/localization/InsightsFeedCopy';
|
|
3
3
|
/** The beat's `account_guids` among visible accounts (or every cash account when it names none), largest first. */
|
|
4
4
|
export declare const resolveBeatAccounts: (beat: Beat, visibleAccounts: Account[], cashAccounts: Account[]) => Account[];
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export declare const isCheckingAccount: (account: Account) => boolean;
|
|
6
|
+
export interface AccountListRow {
|
|
7
|
+
guid: string;
|
|
8
|
+
name: string;
|
|
9
|
+
/** Empty when no institution is known: the default logo is shown. */
|
|
10
|
+
institutionGuid: string;
|
|
11
|
+
balance: number;
|
|
12
|
+
}
|
|
13
|
+
/** A group of accounts (Checking or Savings) with its own balance subtotal. */
|
|
14
|
+
export interface AccountSection {
|
|
15
|
+
key: string;
|
|
16
|
+
header: string;
|
|
17
|
+
total: number;
|
|
18
|
+
/** Already ordered, largest balance first. */
|
|
19
|
+
rows: AccountListRow[];
|
|
20
|
+
}
|
|
21
|
+
/** One account as a row, its balance by the host's available-vs-current rule (as RemainingCashBlock). */
|
|
22
|
+
export declare const toAccountRow: (account: Account, showAvailable: boolean) => AccountListRow;
|
|
23
|
+
/** Rows largest displayed balance first, with the section subtotal. */
|
|
24
|
+
export declare const toAccountSection: (key: string, header: string, accounts: Account[], showAvailable: boolean) => AccountSection;
|
|
8
25
|
/** A generic breakdown row: a label and its already-formatted display value. */
|
|
9
26
|
export interface SummaryRow {
|
|
10
27
|
key: string;
|
|
@@ -18,10 +35,7 @@ export interface AccountListSummary {
|
|
|
18
35
|
heading: string;
|
|
19
36
|
rows: SummaryRow[];
|
|
20
37
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Builds the drawer breakdown from whichever CTA opened it, keyed by the CTA's `variant` (ditto's
|
|
23
|
-
* `*_cta_variant`). Unknown/absent variants fall back to Monthly Obligations and warn.
|
|
24
|
-
*/
|
|
38
|
+
/** The drawer breakdown for the opening CTA's `variant`; unknown variants warn and fall back. */
|
|
25
39
|
export declare const buildSummary: (cta: {
|
|
26
40
|
variant?: string | null;
|
|
27
41
|
drilldown_data?: DrilldownData;
|