@mx-cartographer/experiences 9.7.174 → 9.7.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +20 -0
- package/dist/core/types/localization/index.d.ts +1 -1
- package/dist/goals/components/actions/AmountToSaveAction.es.js +20 -19
- package/dist/goals/components/actions/AmountToSaveAction.es.js.map +1 -1
- package/dist/goals/components/actions/ContributionAction.es.js +20 -19
- package/dist/goals/components/actions/ContributionAction.es.js.map +1 -1
- package/dist/goals/components/actions/MonthlyPaymentAction.es.js +3 -2
- package/dist/goals/components/actions/MonthlyPaymentAction.es.js.map +1 -1
- package/dist/goals/components/actions/OriginalBalanceAction.es.js +4 -3
- package/dist/goals/components/actions/OriginalBalanceAction.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +11 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +164 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/index.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.d.ts +46 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.es.js +58 -0
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +72 -56
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.d.ts +7 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +84 -82
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +169 -133
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +148 -140
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.7.176] - 11-17-2026
|
|
2
|
+
|
|
3
|
+
- Disable contribution Save when amount exceeds the maximum (WELL-178)
|
|
4
|
+
|
|
5
|
+
## [9.7.175] - 11-17-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - Monthly Top Merchant Spending Top Merchants drawer: the month's 10 ranked merchants, each opening its Merchant History (WEC-2331)
|
|
8
|
+
|
|
1
9
|
## [9.7.174] - 11-17-2026
|
|
2
10
|
|
|
3
11
|
- **ADDED** - Monthly Top Transacted Merchant V2: the mini card draws the stars illustration (`svg_image_block` variant `quiz`) above the quiz description, the micro card the "?" tile with "Learn More"; Storybook gains quiz, results and zero state fixtures for full, mini and micro (WEC-2284)
|
|
@@ -436,6 +436,24 @@ export interface CreditUtilizationCopy {
|
|
|
436
436
|
tip?: string;
|
|
437
437
|
your_cards?: string;
|
|
438
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Monthly Top Merchant Spending's Top Merchants drawer (`top_merchants_block`) and the Merchant
|
|
441
|
+
* History drawer a row opens (`transaction_history_block`, `top_merchant` variant).
|
|
442
|
+
*/
|
|
443
|
+
export interface TopMerchantsCopy {
|
|
444
|
+
/** Drawer title, e.g. "Top Merchants". */
|
|
445
|
+
title: string;
|
|
446
|
+
/** Under the summary amount, e.g. "Total Top Merchant Spending". */
|
|
447
|
+
total_spending: string;
|
|
448
|
+
/** A row's title: `_1{rank}` and `_2{merchant}`, e.g. "_1{rank} - _2{merchant}". */
|
|
449
|
+
rank_merchant: string;
|
|
450
|
+
/** The nested drawer's title, e.g. "Merchant History". */
|
|
451
|
+
merchant_history_title: string;
|
|
452
|
+
/** Merchant History heading: `_1{merchant}`, e.g. "_1{merchant} Spending". */
|
|
453
|
+
merchant_spending: string;
|
|
454
|
+
/** Merchant History sub-heading: `_1{rank}` and `_2{month}`, e.g. "#_1{rank} top merchant (_2{month})". */
|
|
455
|
+
most_visited_merchant: string;
|
|
456
|
+
}
|
|
439
457
|
/** The credit card payoff calculator drawer (`payoff_calculator_block`). */
|
|
440
458
|
export interface PayoffCalculatorCopy {
|
|
441
459
|
/** Drawer title, e.g. "Interest Charges". */
|
|
@@ -556,6 +574,8 @@ export interface InsightsFeedCopy {
|
|
|
556
574
|
credit_utilization?: CreditUtilizationCopy;
|
|
557
575
|
account_list?: AccountListCopy;
|
|
558
576
|
payoff_calculator?: PayoffCalculatorCopy;
|
|
577
|
+
/** Optional until the localized-content service ships the namespace. */
|
|
578
|
+
top_merchants?: TopMerchantsCopy;
|
|
559
579
|
budget_details?: BudgetDetailsCopy;
|
|
560
580
|
upcoming_subscription_block?: UpcomingSubscriptionBlockCopy;
|
|
561
581
|
/** Optional until the localized-content service ships the namespace. */
|
|
@@ -13,7 +13,7 @@ export type { DebtsCopy } from './DebtsCopy';
|
|
|
13
13
|
export type { FinstrongCopy } from './FinstrongCopy';
|
|
14
14
|
export type { GoalsCopy } from './GoalsCopy';
|
|
15
15
|
export type { HelpCopy, HelpByCategoryList } from './HelpCopy';
|
|
16
|
-
export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
|
|
16
|
+
export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, TopMerchantsCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, } from './InsightsFeedCopy';
|
|
17
17
|
export type { InvestmentsCopy } from './InvestmentsCopy';
|
|
18
18
|
export type { MicroInsightsCopy } from './MicroInsightsCopy';
|
|
19
19
|
export type { NetWorthCopy } from './NetWorthCopy';
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { TrackType as
|
|
3
|
-
import
|
|
4
|
-
import A from "../../../
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as T, useGoalStore as f } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { TrackType as a } from "../../../core/types/Goal.es.js";
|
|
3
|
+
import "../../../core/constants/Numbers.es.js";
|
|
4
|
+
import { formatCurrency as A } from "../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import S from "../../../common/components/CurrencyInput.es.js";
|
|
6
|
+
import { ListItemAction as N } from "../../../common/components/ListItemAction.es.js";
|
|
7
|
+
import b from "react";
|
|
8
|
+
import { observer as v } from "mobx-react-lite";
|
|
8
9
|
import { jsx as i } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
const { goals:
|
|
10
|
+
var K = v(({ goal: t }) => {
|
|
11
|
+
const { goals: r } = T(), { setAlert: u, setSelectedGoal: c, updateGoal: p, updateRetirementGoal: d } = f(), [e, n] = b.useState(t.amount), m = !t.guid, s = e < 0 || e > 9999999999e-2, _ = t.track_type === a.SAVINGS_TRACK && t.has_been_spent || t.track_type !== a.SAVINGS_TRACK && t.is_complete, l = async () => {
|
|
11
12
|
const o = {
|
|
12
13
|
...t,
|
|
13
14
|
amount: e
|
|
14
15
|
};
|
|
15
|
-
t.amount = e,
|
|
16
|
+
t.amount = e, m ? c(o) : (t.track_type !== a.RETIREMENT_TRACK ? await p(o) : await d(o), u(r.alert_goal_updated_amount));
|
|
16
17
|
}, y = () => {
|
|
17
18
|
setTimeout(() => {
|
|
18
19
|
n(t.amount);
|
|
19
20
|
}, 250);
|
|
20
21
|
};
|
|
21
|
-
return /* @__PURE__ */ i(
|
|
22
|
+
return /* @__PURE__ */ i(N, {
|
|
22
23
|
isDisabled: _,
|
|
23
|
-
isSaveDisabled:
|
|
24
|
-
label:
|
|
24
|
+
isSaveDisabled: s,
|
|
25
|
+
label: r.details_amount_to_save,
|
|
25
26
|
onCancel: y,
|
|
26
27
|
onSave: l,
|
|
27
|
-
primaryText:
|
|
28
|
-
secondaryText:
|
|
29
|
-
zeroStateText:
|
|
30
|
-
children: /* @__PURE__ */ i(
|
|
28
|
+
primaryText: r.details_amount_to_save,
|
|
29
|
+
secondaryText: A(t.amount, "0,0"),
|
|
30
|
+
zeroStateText: m && t.amount === 0 ? r.add_amount : void 0,
|
|
31
|
+
children: /* @__PURE__ */ i(S, {
|
|
31
32
|
amount: e,
|
|
32
33
|
autoFocus: !0,
|
|
33
|
-
error:
|
|
34
|
+
error: s,
|
|
34
35
|
fullWidth: !0,
|
|
35
36
|
minAmount: 0,
|
|
36
37
|
setAmount: (o) => n(isNaN(Number(o)) ? e : Number(o)),
|
|
@@ -39,7 +40,7 @@ var E = C(({ goal: t }) => {
|
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
K as AmountToSaveAction
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
//# sourceMappingURL=AmountToSaveAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountToSaveAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/AmountToSaveAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal, TrackType } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface AmountToSaveActionProps {\n goal: Goal\n}\n\nexport const AmountToSaveAction = observer(({ goal }: AmountToSaveActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal, updateRetirementGoal } = useGoalStore()\n\n const [amount, setAmount] = React.useState<number>(goal.amount)\n\n const isNew = !goal.guid\n const isInvalid = amount < 0 || amount >
|
|
1
|
+
{"version":3,"file":"AmountToSaveAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/AmountToSaveAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal, TrackType } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface AmountToSaveActionProps {\n goal: Goal\n}\n\nexport const AmountToSaveAction = observer(({ goal }: AmountToSaveActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal, updateRetirementGoal } = useGoalStore()\n\n const [amount, setAmount] = React.useState<number>(goal.amount)\n\n const isNew = !goal.guid\n const isInvalid = amount < 0 || amount > MAX_MONEY_INPUT\n const isDisabled =\n (goal.track_type === TrackType.SAVINGS_TRACK && goal.has_been_spent) ||\n (goal.track_type !== TrackType.SAVINGS_TRACK && goal.is_complete)\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, amount }\n goal.amount = amount\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n if (goal.track_type !== TrackType.RETIREMENT_TRACK) {\n await updateGoal(updatedGoal)\n } else {\n await updateRetirementGoal(updatedGoal)\n }\n\n setAlert(copy.alert_goal_updated_amount)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setAmount(goal.amount)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={isDisabled}\n isSaveDisabled={isInvalid}\n label={copy.details_amount_to_save}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_amount_to_save}\n secondaryText={formatCurrency(goal.amount, '0,0')}\n zeroStateText={isNew && goal.amount === 0 ? copy.add_amount : undefined}\n >\n <CurrencyInput\n amount={amount}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setAmount(!isNaN(Number(v)) ? Number(v) : amount)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;;AAYA,IAAa,IAAqB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAoC;AAChF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,GAAY,sBAAA,EAAA,IAAyB,EAAa,GAE/E,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAiB,EAAK,MAAM,GAExD,IAAQ,CAAC,EAAK,MACd,IAAY,IAAS,KAAK,IAAA,eAC1B,IACH,EAAK,eAAe,EAAU,iBAAiB,EAAK,kBACpD,EAAK,eAAe,EAAU,iBAAiB,EAAK,aAEjD,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,QAAA;AAAA,IAAO;AACtC,IAAA,EAAK,SAAS,GACV,IACF,EAAgB,CAAW,KAEvB,EAAK,eAAe,EAAU,mBAChC,MAAM,EAAW,CAAW,IAE5B,MAAM,EAAqB,CAAW,GAGxC,EAAS,EAAK,yBAAyB;AAAA,EAE3C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAU,EAAK,MAAM;AAAA,IACvB,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACc,YAAA;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,QAAQ,KAAK;AAAA,IAChD,eAAe,KAAS,EAAK,WAAW,IAAI,EAAK,aAAa;AAAA,IAE9D,UAAA,gBAAA,EAAC,GAAD;AAAA,MACU,QAAA;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAW,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAU;AAAA,MAClE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { useGlobalCopyStore as d, useGoalStore as
|
|
1
|
+
import { useGlobalCopyStore as d, useGoalStore as p } from "../../../common/context/hooks.es.js";
|
|
2
2
|
import { TrackType as a } from "../../../core/types/Goal.es.js";
|
|
3
|
-
import
|
|
3
|
+
import "../../../core/constants/Numbers.es.js";
|
|
4
|
+
import { formatCurrency as b } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
5
|
import A from "../../../common/components/CurrencyInput.es.js";
|
|
5
6
|
import { ListItemAction as C } from "../../../common/components/ListItemAction.es.js";
|
|
6
7
|
import s from "react";
|
|
7
|
-
import { observer as
|
|
8
|
-
import
|
|
8
|
+
import { observer as T } from "mobx-react-lite";
|
|
9
|
+
import g from "@mui/material/Stack";
|
|
9
10
|
import { jsx as m } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
11
|
-
const { goals:
|
|
11
|
+
var G = T(({ trackType: e }) => {
|
|
12
|
+
const { goals: i } = d(), { setAlert: _, monthlyCashFlowProfile: r, updateMonthlyCashFlowProfile: f } = p(), n = s.useMemo(() => {
|
|
12
13
|
let o = 0;
|
|
13
14
|
return e === a.SAVINGS_TRACK ? o = r?.amount_allocated_for_savings_goals || 0 : e === a.DEBT_TRACK ? o = r?.amount_allocated_for_debt_goals || 0 : e === a.RETIREMENT_TRACK && (o = r?.amount_allocated_for_retirement_goals || 0), o;
|
|
14
15
|
}, [r]);
|
|
15
16
|
s.useEffect(() => {
|
|
16
|
-
|
|
17
|
+
l(n);
|
|
17
18
|
}, [n]);
|
|
18
|
-
const [t,
|
|
19
|
+
const [t, l] = s.useState(n), u = t < 0 || t > 9999999999e-2, c = async () => {
|
|
19
20
|
if (r) {
|
|
20
21
|
const o = { ...r };
|
|
21
|
-
e === a.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = t : e === a.DEBT_TRACK ? o.amount_allocated_for_debt_goals = t : e === a.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = t), await
|
|
22
|
+
e === a.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = t : e === a.DEBT_TRACK ? o.amount_allocated_for_debt_goals = t : e === a.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = t), await f(o), _(i.alert_contribution_updated);
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
return /* @__PURE__ */ m(
|
|
25
|
+
return /* @__PURE__ */ m(g, {
|
|
25
26
|
bgcolor: "background.paper",
|
|
26
27
|
children: /* @__PURE__ */ m(C, {
|
|
27
|
-
isSaveDisabled: !t || isNaN(t),
|
|
28
|
-
label:
|
|
29
|
-
onCancel: () =>
|
|
30
|
-
onSave:
|
|
31
|
-
primaryText:
|
|
32
|
-
secondaryText:
|
|
28
|
+
isSaveDisabled: !t || isNaN(t) || u,
|
|
29
|
+
label: i.contribution_label,
|
|
30
|
+
onCancel: () => l(n),
|
|
31
|
+
onSave: c,
|
|
32
|
+
primaryText: i.contribution_label,
|
|
33
|
+
secondaryText: b(n, "0,0.00"),
|
|
33
34
|
children: /* @__PURE__ */ m(A, {
|
|
34
35
|
amount: t,
|
|
35
36
|
autoFocus: !0,
|
|
36
|
-
error:
|
|
37
|
+
error: u,
|
|
37
38
|
fullWidth: !0,
|
|
38
39
|
minAmount: 0,
|
|
39
|
-
setAmount: (o) =>
|
|
40
|
+
setAmount: (o) => l(isNaN(Number(o)) ? t : Number(o)),
|
|
40
41
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
41
42
|
})
|
|
42
43
|
})
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
G as ContributionAction
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
//# sourceMappingURL=ContributionAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributionAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/ContributionAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { TrackType } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface ContributionActionProps {\n trackType: TrackType\n}\n\nexport const ContributionAction = observer(({ trackType }: ContributionActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, monthlyCashFlowProfile, updateMonthlyCashFlowProfile } = useGoalStore()\n\n const contribution = React.useMemo(() => {\n let amount = 0\n if (trackType === TrackType.SAVINGS_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_savings_goals || 0\n } else if (trackType === TrackType.DEBT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_debt_goals || 0\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_retirement_goals || 0\n }\n return amount\n }, [monthlyCashFlowProfile])\n\n React.useEffect(() => {\n setAmount(contribution)\n }, [contribution])\n\n const [amount, setAmount] = React.useState<number>(contribution)\n\n const isInvalid = amount < 0 || amount >
|
|
1
|
+
{"version":3,"file":"ContributionAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/ContributionAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { TrackType } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface ContributionActionProps {\n trackType: TrackType\n}\n\nexport const ContributionAction = observer(({ trackType }: ContributionActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, monthlyCashFlowProfile, updateMonthlyCashFlowProfile } = useGoalStore()\n\n const contribution = React.useMemo(() => {\n let amount = 0\n if (trackType === TrackType.SAVINGS_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_savings_goals || 0\n } else if (trackType === TrackType.DEBT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_debt_goals || 0\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_retirement_goals || 0\n }\n return amount\n }, [monthlyCashFlowProfile])\n\n React.useEffect(() => {\n setAmount(contribution)\n }, [contribution])\n\n const [amount, setAmount] = React.useState<number>(contribution)\n\n const isInvalid = amount < 0 || amount > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n if (monthlyCashFlowProfile) {\n const updatedProfile = { ...monthlyCashFlowProfile }\n if (trackType === TrackType.SAVINGS_TRACK) {\n updatedProfile.amount_allocated_for_savings_goals = amount\n } else if (trackType === TrackType.DEBT_TRACK) {\n updatedProfile.amount_allocated_for_debt_goals = amount\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n updatedProfile.amount_allocated_for_retirement_goals = amount\n }\n\n await updateMonthlyCashFlowProfile(updatedProfile)\n setAlert(copy.alert_contribution_updated)\n }\n }\n\n return (\n <Stack bgcolor=\"background.paper\">\n <ListItemAction\n isSaveDisabled={!amount || isNaN(amount) || isInvalid}\n label={copy.contribution_label}\n onCancel={() => setAmount(contribution)}\n onSave={handleSave}\n primaryText={copy.contribution_label}\n secondaryText={formatCurrency(contribution, '0,0.00')}\n >\n <CurrencyInput\n amount={amount}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(value) => setAmount(!isNaN(Number(value)) ? Number(value) : amount)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;AAcA,IAAa,IAAqB,EAAA,CAAU,EAAE,WAAA,EAAA,MAAyC;AACrF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,wBAAA,GAAwB,8BAAA,EAAA,IAAiC,EAAa,GAElF,IAAe,EAAM,QAAA,MAAc;AACvC,QAAI,IAAS;AACb,WAAI,MAAc,EAAU,gBAC1B,IAAS,GAAwB,sCAAsC,IAC9D,MAAc,EAAU,aACjC,IAAS,GAAwB,mCAAmC,IAC3D,MAAc,EAAU,qBACjC,IAAS,GAAwB,yCAAyC,IAErE;AAAA,EACT,GAAG,CAAC,CAAsB,CAAC;AAE3B,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAU,CAAY;AAAA,EACxB,GAAG,CAAC,CAAY,CAAC;AAEjB,QAAM,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAiB,CAAY,GAEzD,IAAY,IAAS,KAAK,IAAA,eAE1B,IAAa,YAAY;AAC7B,QAAI,GAAwB;AAC1B,YAAM,IAAiB,EAAE,GAAG,EAAuB;AACnD,MAAI,MAAc,EAAU,gBAC1B,EAAe,qCAAqC,IAC3C,MAAc,EAAU,aACjC,EAAe,kCAAkC,IACxC,MAAc,EAAU,qBACjC,EAAe,wCAAwC,IAGzD,MAAM,EAA6B,CAAc,GACjD,EAAS,EAAK,0BAA0B;AAAA,IAC1C;AAAA,EACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,SAAQ;AAAA,IACb,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,CAAC,KAAU,MAAM,CAAM,KAAK;AAAA,MAC5C,OAAO,EAAK;AAAA,MACZ,UAAA,MAAgB,EAAU,CAAY;AAAA,MACtC,QAAQ;AAAA,MACR,aAAa,EAAK;AAAA,MAClB,eAAe,EAAe,GAAc,QAAQ;AAAA,MAEpD,UAAA,gBAAA,EAAC,GAAD;AAAA,QACU,QAAA;AAAA,QACR,WAAW;AAAA,QACX,OAAO;AAAA,QACP,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAA,CAAY,MAAU,EAAW,MAAM,OAAO,CAAK,CAAC,IAAoB,IAAhB,OAAO,CAAK,CAAU;AAAA,QAC9E,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,MACxC,CAAA;AAAA,IACa,CAAA;AAAA,EACX,CAAA;AAEX,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useGlobalCopyStore as c, useGoalStore as d } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import "../../../core/constants/Numbers.es.js";
|
|
2
3
|
import { formatCurrency as _ } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
4
|
import h from "../../../common/components/CurrencyInput.es.js";
|
|
4
5
|
import { ListItemAction as f } from "../../../common/components/ListItemAction.es.js";
|
|
5
6
|
import b from "react";
|
|
6
7
|
import { observer as S } from "mobx-react-lite";
|
|
7
8
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
+
var P = S(({ goal: t }) => {
|
|
9
10
|
const { goals: o } = c(), { setAlert: s, setSelectedGoal: y, updateGoal: i } = d(), [e, m] = b.useState(t.monthly_payment ?? 0), p = !t.guid, a = e < 0 || e > 9999999999e-2, l = async () => {
|
|
10
11
|
const n = {
|
|
11
12
|
...t,
|
|
@@ -41,7 +42,7 @@ var I = S(({ goal: t }) => {
|
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
P as MonthlyPaymentAction
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=MonthlyPaymentAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthlyPaymentAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/MonthlyPaymentAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface MonthlyPaymentActionProps {\n goal: Goal\n}\n\nexport const MonthlyPaymentAction = observer(({ goal }: MonthlyPaymentActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [payment, setPayment] = React.useState<number>(goal.monthly_payment ?? 0)\n\n const isNew = !goal.guid\n const isInvalid = payment < 0 || payment >
|
|
1
|
+
{"version":3,"file":"MonthlyPaymentAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/MonthlyPaymentAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface MonthlyPaymentActionProps {\n goal: Goal\n}\n\nexport const MonthlyPaymentAction = observer(({ goal }: MonthlyPaymentActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [payment, setPayment] = React.useState<number>(goal.monthly_payment ?? 0)\n\n const isNew = !goal.guid\n const isInvalid = payment < 0 || payment > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, monthly_payment: payment }\n goal.monthly_payment = payment\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n await updateGoal({ ...goal, monthly_payment: payment })\n setAlert(copy.alert_goal_updated_payment)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setPayment(goal.monthly_payment || 0)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={goal.is_complete}\n isSaveDisabled={isInvalid}\n label={copy.details_monthly_payment}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_monthly_payment}\n secondaryText={formatCurrency(goal.monthly_payment, '0,0')}\n zeroStateText={!goal.monthly_payment ? copy.add_monthly_payment : undefined}\n >\n <CurrencyInput\n amount={payment}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setPayment(!isNaN(Number(v)) ? Number(v) : payment)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;AAYA,IAAa,IAAuB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAsC;AACpF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,EAAA,IAAe,EAAa,GAEzD,CAAC,GAAS,CAAA,IAAc,EAAM,SAAiB,EAAK,mBAAmB,CAAC,GAExE,IAAQ,CAAC,EAAK,MACd,IAAY,IAAU,KAAK,IAAA,eAE3B,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,IAAQ;AACxD,IAAA,EAAK,kBAAkB,GACnB,IACF,EAAgB,CAAW,KAE3B,MAAM,EAAW;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,IAAQ,CAAC,GACtD,EAAS,EAAK,0BAA0B;AAAA,EAE5C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAW,EAAK,mBAAmB,CAAC;AAAA,IACtC,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,EAAK;AAAA,IACjB,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,iBAAiB,KAAK;AAAA,IACzD,eAAgB,EAAK,kBAA6C,SAA3B,EAAK;AAAA,IAE5C,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAY,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAW;AAAA,MACpE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useGlobalCopyStore as p, useGoalStore as _ } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import "../../../core/constants/Numbers.es.js";
|
|
2
3
|
import { formatCurrency as b } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
4
|
import f from "../../../common/components/CurrencyInput.es.js";
|
|
4
5
|
import { ListItemAction as y } from "../../../common/components/ListItemAction.es.js";
|
|
5
6
|
import S from "react";
|
|
6
|
-
import { observer as
|
|
7
|
+
import { observer as N } from "mobx-react-lite";
|
|
7
8
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
+
var w = N(({ goal: t }) => {
|
|
9
10
|
const { goals: a } = p(), { setAlert: l, setSelectedGoal: s, updateGoal: m } = _(), [e, o] = S.useState(t.initial_amount), c = !t.guid, n = e < 0 || e > 9999999999e-2, u = async () => {
|
|
10
11
|
const i = {
|
|
11
12
|
...t,
|
|
@@ -41,7 +42,7 @@ var I = v(({ goal: t }) => {
|
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
w as OriginalBalanceAction
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=OriginalBalanceAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OriginalBalanceAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/OriginalBalanceAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface OriginalBalanceActionProps {\n goal: Goal\n}\n\nexport const OriginalBalanceAction = observer(({ goal }: OriginalBalanceActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [balance, setBalance] = React.useState<number>(goal.initial_amount)\n\n const isNew = !goal.guid\n const
|
|
1
|
+
{"version":3,"file":"OriginalBalanceAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/OriginalBalanceAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface OriginalBalanceActionProps {\n goal: Goal\n}\n\nexport const OriginalBalanceAction = observer(({ goal }: OriginalBalanceActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [balance, setBalance] = React.useState<number>(goal.initial_amount)\n\n const isNew = !goal.guid\n const isInvalid = balance < 0 || balance > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, initial_amount: balance }\n goal.initial_amount = balance\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n await updateGoal({ ...goal, initial_amount: balance })\n setAlert(copy.alert_goal_updated_balance)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setBalance(goal.initial_amount)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={goal.is_complete}\n isSaveDisabled={isInvalid}\n label={copy.details_original_balance}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_original_balance}\n secondaryText={formatCurrency(goal.initial_amount, '0,0')}\n zeroStateText={\n !goal.initial_amount && !goal.is_complete ? copy.add_original_balance : undefined\n }\n >\n <CurrencyInput\n amount={balance}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setBalance(!isNaN(Number(v)) ? Number(v) : balance)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;AAYA,IAAa,IAAwB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAuC;AACtF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,EAAA,IAAe,EAAa,GAEzD,CAAC,GAAS,CAAA,IAAc,EAAM,SAAiB,EAAK,cAAc,GAElE,IAAQ,CAAC,EAAK,MACd,IAAY,IAAU,KAAK,IAAA,eAE3B,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,gBAAgB;AAAA,IAAQ;AACvD,IAAA,EAAK,iBAAiB,GAClB,IACF,EAAgB,CAAW,KAE3B,MAAM,EAAW;AAAA,MAAE,GAAG;AAAA,MAAM,gBAAgB;AAAA,IAAQ,CAAC,GACrD,EAAS,EAAK,0BAA0B;AAAA,EAE5C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAW,EAAK,cAAc;AAAA,IAChC,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,EAAK;AAAA,IACjB,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,gBAAgB,KAAK;AAAA,IACxD,eACE,CAAC,EAAK,kBAAkB,CAAC,EAAK,cAAc,EAAK,uBAAuB;AAAA,IAG1E,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAY,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAW;AAAA,MACpE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GlobalCopy, TopMerchantsCopy } from '../../../core';
|
|
2
|
+
import { ActionBlockProps } from '../../mappings/blocks';
|
|
3
|
+
export declare const selectTopMerchantsCopy: (copy: GlobalCopy) => TopMerchantsCopy | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over
|
|
6
|
+
* up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,
|
|
7
|
+
* `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TopMerchantsBlock: (({ beat }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { buildDynamicCopy as w, buildPluralCopy as B } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { useGlobalCopyStore as R, useTransactionStore as A } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { CURRENCY_FORMAT as _, formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import E from "../../../common/components/drawer/Drawer.es.js";
|
|
5
|
+
import F from "../../components/LogoMark.es.js";
|
|
6
|
+
import { ELEVATION_SHADOW as N } from "../../components/shared/elevation.es.js";
|
|
7
|
+
import { useOpenedCta as G } from "../useOpenedCta.es.js";
|
|
8
|
+
import { useRequiredCopy as H } from "../useRequiredCopy.es.js";
|
|
9
|
+
import { TransactionHistoryBlock as L } from "../TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
10
|
+
import { TransactionListHeaderIconTile as D } from "../TransactionListBlock/TransactionListHeaderIconTile.es.js";
|
|
11
|
+
import { merchantHistoryCta as I, readTopMerchants as U } from "./layout.es.js";
|
|
12
|
+
import d from "react";
|
|
13
|
+
import { observer as j } from "mobx-react-lite";
|
|
14
|
+
import m from "@mui/material/Stack";
|
|
15
|
+
import { Text as i } from "@mxenabled/mxui";
|
|
16
|
+
import { Icon as P } from "@mxenabled/mx-icons";
|
|
17
|
+
import { Fragment as W, jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
18
|
+
import f from "@mui/material/Box";
|
|
19
|
+
import Y from "@mui/material/ButtonBase";
|
|
20
|
+
var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V = "_1{count} transaction", q = ({ copy: c, countCopy: n, merchant: t, onClick: p }) => {
|
|
21
|
+
const s = w(c.rank_merchant, String(t.rank), t.merchantName), u = B(n.one, n.many, t.transactionCount, String(t.transactionCount));
|
|
22
|
+
return /* @__PURE__ */ a(Y, {
|
|
23
|
+
onClick: () => p(t),
|
|
24
|
+
sx: {
|
|
25
|
+
borderBottom: 1,
|
|
26
|
+
borderColor: "divider",
|
|
27
|
+
gap: 12,
|
|
28
|
+
justifyContent: "flex-start",
|
|
29
|
+
minHeight: 64,
|
|
30
|
+
px: 16,
|
|
31
|
+
py: 12,
|
|
32
|
+
textAlign: "left",
|
|
33
|
+
width: "100%",
|
|
34
|
+
"&.Mui-focusVisible": { bgcolor: "action.focus" }
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ o(f, {
|
|
38
|
+
"aria-hidden": !0,
|
|
39
|
+
sx: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexShrink: 0
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ o(F, {
|
|
44
|
+
logo: {
|
|
45
|
+
category_guid: t.categoryGuid,
|
|
46
|
+
merchant_guid: t.merchantGuid,
|
|
47
|
+
merchant_name: t.merchantName
|
|
48
|
+
},
|
|
49
|
+
size: 32
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ a(m, {
|
|
53
|
+
sx: {
|
|
54
|
+
flexGrow: 1,
|
|
55
|
+
minWidth: 0
|
|
56
|
+
},
|
|
57
|
+
children: [/* @__PURE__ */ o(i, {
|
|
58
|
+
bold: !0,
|
|
59
|
+
component: "span",
|
|
60
|
+
truncate: !0,
|
|
61
|
+
variant: "body1",
|
|
62
|
+
children: s
|
|
63
|
+
}), /* @__PURE__ */ o(i, {
|
|
64
|
+
component: "span",
|
|
65
|
+
variant: "caption",
|
|
66
|
+
children: u
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ o(i, {
|
|
70
|
+
component: "span",
|
|
71
|
+
sx: { flexShrink: 0 },
|
|
72
|
+
variant: "body1",
|
|
73
|
+
children: x(t.total, _.cents)
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ o(P, {
|
|
76
|
+
"aria-hidden": !0,
|
|
77
|
+
name: "chevron_right",
|
|
78
|
+
size: 20,
|
|
79
|
+
sx: { flexShrink: 0 }
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}, fo = j(function({ beat: n }) {
|
|
84
|
+
const t = H($), { common: p, insights_feed: s } = R(), u = G(n), l = A(), r = d.useRef(null), [h, g] = d.useState(), [C, y] = d.useState(), { describedMonth: b, merchants: k, merchantHistory: S, totalAmount: v } = U(u?.drilldown_data ?? n.insights_payload?.drilldown_data), T = {
|
|
85
|
+
many: s?.general?.transaction_count ?? z,
|
|
86
|
+
one: s?.general?.transaction_count_one ?? V
|
|
87
|
+
}, O = (e) => {
|
|
88
|
+
r.current = { ...l.filter }, g(e), y(I(e, S, b));
|
|
89
|
+
}, M = () => {
|
|
90
|
+
g(void 0), y(void 0), r.current !== null && (l.setFilter(r.current), r.current = null);
|
|
91
|
+
};
|
|
92
|
+
return d.useEffect(() => () => {
|
|
93
|
+
r.current !== null && (l.setFilter(r.current), r.current = null);
|
|
94
|
+
}, [l]), /* @__PURE__ */ a(W, { children: [
|
|
95
|
+
/* @__PURE__ */ o(f, {
|
|
96
|
+
sx: {
|
|
97
|
+
bgcolor: "background.default",
|
|
98
|
+
p: 24
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */ a(m, {
|
|
101
|
+
direction: "row",
|
|
102
|
+
sx: {
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
bgcolor: "background.paper",
|
|
105
|
+
borderRadius: "8px",
|
|
106
|
+
boxShadow: N[1],
|
|
107
|
+
gap: 12,
|
|
108
|
+
p: 16
|
|
109
|
+
},
|
|
110
|
+
children: [/* @__PURE__ */ o(D, { name: "payments" }), /* @__PURE__ */ a(m, {
|
|
111
|
+
sx: {
|
|
112
|
+
gap: 4,
|
|
113
|
+
minWidth: 0
|
|
114
|
+
},
|
|
115
|
+
children: [/* @__PURE__ */ o(i, {
|
|
116
|
+
bold: !0,
|
|
117
|
+
component: "p",
|
|
118
|
+
variant: "h2",
|
|
119
|
+
children: x(v, _.cents)
|
|
120
|
+
}), /* @__PURE__ */ o(i, {
|
|
121
|
+
color: "text.secondary",
|
|
122
|
+
component: "p",
|
|
123
|
+
variant: "body2",
|
|
124
|
+
children: t.total_spending
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ o(m, {
|
|
130
|
+
component: "ul",
|
|
131
|
+
sx: {
|
|
132
|
+
bgcolor: "background.paper",
|
|
133
|
+
listStyle: "none",
|
|
134
|
+
m: 0,
|
|
135
|
+
p: 0
|
|
136
|
+
},
|
|
137
|
+
children: k.map((e) => /* @__PURE__ */ o(f, {
|
|
138
|
+
component: "li",
|
|
139
|
+
children: /* @__PURE__ */ o(q, {
|
|
140
|
+
copy: t,
|
|
141
|
+
countCopy: T,
|
|
142
|
+
merchant: e,
|
|
143
|
+
onClick: O
|
|
144
|
+
})
|
|
145
|
+
}, e.merchantGuid))
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ o(E, {
|
|
148
|
+
ariaLabelClose: p.close_aria,
|
|
149
|
+
isOpen: !!h,
|
|
150
|
+
onClose: M,
|
|
151
|
+
title: t.merchant_history_title,
|
|
152
|
+
children: h && C && /* @__PURE__ */ o(L, {
|
|
153
|
+
beat: n,
|
|
154
|
+
cta: C
|
|
155
|
+
}, h.merchantGuid)
|
|
156
|
+
})
|
|
157
|
+
] });
|
|
158
|
+
});
|
|
159
|
+
export {
|
|
160
|
+
fo as TopMerchantsBlock,
|
|
161
|
+
$ as selectTopMerchantsCopy
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=TopMerchantsBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopMerchantsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Drawer, useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { GlobalCopy, PrimaryCTA, TopMerchantsCopy } from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport LogoMark from '../../components/LogoMark'\nimport { ELEVATION_SHADOW } from '../../components/shared/elevation'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { TransactionHistoryBlock } from '../TransactionHistoryBlock/TransactionHistoryBlock'\nimport { TransactionListHeaderIconTile } from '../TransactionListBlock/TransactionListHeaderIconTile'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport { merchantHistoryCta, readTopMerchants, type TopMerchant } from './layout'\n\nexport const selectTopMerchantsCopy = (copy: GlobalCopy) => copy.insights_feed?.top_merchants\n\n// English defaults until the localized-content service ships the pill copy in every locale, as the\n// Transaction List summary card does.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\ninterface MerchantRowProps {\n copy: TopMerchantsCopy\n countCopy: { many: string; one: string }\n merchant: TopMerchant\n onClick: (merchant: TopMerchant) => void\n}\n\n/** Figma `<ListItem> | Utility Row`: logo, \"{rank} - {merchant}\" over its count, total, chevron. */\nconst MerchantRow = ({ copy, countCopy, merchant, onClick }: MerchantRowProps) => {\n const title = buildDynamicCopy(\n copy.rank_merchant,\n String(merchant.rank),\n merchant.merchantName,\n ) as string\n const count = buildPluralCopy(\n countCopy.one,\n countCopy.many,\n merchant.transactionCount,\n String(merchant.transactionCount),\n ) as string\n\n return (\n <ButtonBase\n onClick={() => onClick(merchant)}\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n gap: 12,\n justifyContent: 'flex-start',\n minHeight: 64,\n px: 16,\n py: 12,\n textAlign: 'left',\n width: '100%',\n '&.Mui-focusVisible': { bgcolor: 'action.focus' },\n }}\n >\n <Box aria-hidden={true} sx={{ display: 'flex', flexShrink: 0 }}>\n <LogoMark\n logo={{\n category_guid: merchant.categoryGuid,\n merchant_guid: merchant.merchantGuid,\n merchant_name: merchant.merchantName,\n }}\n size={32}\n />\n </Box>\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text bold={true} component=\"span\" truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text component=\"span\" variant=\"caption\">\n {count}\n </Text>\n </Stack>\n <Text component=\"span\" sx={{ flexShrink: 0 }} variant=\"body1\">\n {formatCurrency(merchant.total, CURRENCY_FORMAT.cents)}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={20} sx={{ flexShrink: 0 }} />\n </ButtonBase>\n )\n}\n\n/**\n * Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over\n * up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,\n * `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.\n */\nexport const TopMerchantsBlock = observer(function TopMerchantsBlock({ beat }: ActionBlockProps) {\n const copy = useRequiredCopy(selectTopMerchantsCopy)\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const openedCta = useOpenedCta(beat)\n const transactionStore = useTransactionStore()\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n const [selected, setSelected] = React.useState<TopMerchant>()\n const [selectedCta, setSelectedCta] = React.useState<PrimaryCTA>()\n\n const { describedMonth, merchants, merchantHistory, totalAmount } = readTopMerchants(\n openedCta?.drilldown_data ?? beat.insights_payload?.drilldown_data,\n )\n const countCopy = {\n many: insightsCopy?.general?.transaction_count ?? DEFAULT_COUNT_COPY,\n one: insightsCopy?.general?.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n }\n\n const handleMerchantClick = (merchant: TopMerchant) => {\n filterBeforeOpen.current = { ...transactionStore.filter }\n setSelected(merchant)\n setSelectedCta(merchantHistoryCta(merchant, merchantHistory, describedMonth))\n }\n\n const handleClose = () => {\n setSelected(undefined)\n setSelectedCta(undefined)\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n }\n\n React.useEffect(\n () => () => {\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n },\n [transactionStore],\n )\n\n return (\n <>\n <Box sx={{ bgcolor: 'background.default', p: 24 }}>\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"payments\" />\n <Stack sx={{ gap: 4, minWidth: 0 }}>\n <Text bold={true} component=\"p\" variant=\"h2\">\n {formatCurrency(totalAmount, CURRENCY_FORMAT.cents)}\n </Text>\n <Text color=\"text.secondary\" component=\"p\" variant=\"body2\">\n {copy.total_spending}\n </Text>\n </Stack>\n </Stack>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {merchants.map((merchant) => (\n <Box component=\"li\" key={merchant.merchantGuid}>\n <MerchantRow\n copy={copy}\n countCopy={countCopy}\n merchant={merchant}\n onClick={handleMerchantClick}\n />\n </Box>\n ))}\n </Stack>\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={!!selected}\n onClose={handleClose}\n title={copy.merchant_history_title}\n >\n {selected && selectedCta && (\n <TransactionHistoryBlock beat={beat} cta={selectedCta} key={selected.merchantGuid} />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TopMerchantsBlock, selectTopMerchantsCopy } from './TopMerchantsBlock';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DataSeries, DrilldownData, PrimaryCTA } from '../../../core';
|
|
2
|
+
/** The drawer lists at most this many merchants (Figma: "Top 10 list"). */
|
|
3
|
+
export declare const TOP_MERCHANTS_MAX = 10;
|
|
4
|
+
/** One ranked merchant in the Top Merchants drawer. */
|
|
5
|
+
export interface TopMerchant {
|
|
6
|
+
/** 1-based place in the month's ranking. */
|
|
7
|
+
rank: number;
|
|
8
|
+
merchantGuid: string;
|
|
9
|
+
merchantName: string;
|
|
10
|
+
categoryGuid?: string;
|
|
11
|
+
total: number;
|
|
12
|
+
transactionCount: number;
|
|
13
|
+
averageAmount?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface TopMerchantsData {
|
|
16
|
+
/** The month the ranking covers, `YYYY-MM-DD`. */
|
|
17
|
+
describedMonth?: string;
|
|
18
|
+
/** The headline amount: the payload's total, else the sum of the listed merchants. */
|
|
19
|
+
totalAmount: number;
|
|
20
|
+
merchants: TopMerchant[];
|
|
21
|
+
/** Six months of spend, one column per merchant guid (`names: ['date', ...guids]`). */
|
|
22
|
+
merchantHistory?: DataSeries;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The Top Merchants drawer's facts, from the drilldown_data of the CTA that opened it (proposed
|
|
26
|
+
* contract, pending tupac/ditto):
|
|
27
|
+
*
|
|
28
|
+
* ```
|
|
29
|
+
* {
|
|
30
|
+
* total_amount: 2350,
|
|
31
|
+
* described_month: '2026-06-01',
|
|
32
|
+
* merchants: [{ merchant_guid, merchant_name, category_guid, total, transaction_count, average_amount }],
|
|
33
|
+
* merchant_history: { names: ['date', 'MCH-…', …], types: ['date', 'currency', …], data: [['2026-01-01', 12.5, …], …] },
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Merchants are ranked by total, highest first, and capped at ten.
|
|
38
|
+
*/
|
|
39
|
+
export declare const readTopMerchants: (data?: DrilldownData) => TopMerchantsData;
|
|
40
|
+
/** One merchant's column of the shared history, as the two-column series a bar chart reads. */
|
|
41
|
+
export declare const merchantSeries: (history: DataSeries | undefined, merchantGuid: string) => DataSeries | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The CTA a row hands the nested Merchant History drawer: Transaction History's `top_merchant`
|
|
44
|
+
* variant, fed the merchant's own six months, average, category, rank, and the described month.
|
|
45
|
+
*/
|
|
46
|
+
export declare const merchantHistoryCta: (merchant: TopMerchant, history: DataSeries | undefined, describedMonth?: string) => PrimaryCTA;
|