@mx-cartographer/experiences 9.7.77 → 9.7.79
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 +17 -0
- package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
- package/dist/core/stores/GlobalCopyStore.es.js +14 -8
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +161 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +20 -20
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +89 -60
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/BaseLayout.es.js +106 -105
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +5 -1
- package/dist/insights-v2/components/CtaStatus.es.js +25 -22
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +5 -4
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/StatusMessageCard.d.ts +8 -3
- package/dist/insights-v2/components/StatusMessageCard.es.js +16 -15
- package/dist/insights-v2/components/StatusMessageCard.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +61 -45
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +35 -14
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +9 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +62 -57
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/types.d.ts +10 -2
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +5 -2
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +45 -37
- package/dist/insights-v2/ctaActions/useCtaAction.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 +82 -76
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +92 -83
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js +50 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
- package/dist/microinsights/stores/CopyStore.d.ts +10 -1
- package/dist/microinsights/stores/CopyStore.es.js +20 -11
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [9.7.79] - 11-03-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Unexpected Subscription Payment on the shared subscription status CTA (WEC-2126): `confirm_subscription_status` registers `subscriptionEntryStep({ statusLabels: { positive: 'subscribed', negative: 'not_subscribed' } })`, so the card follows the live repeating transaction as pulse did (none / `USER_RESPONSE_UNKNOWN` → Confirm Status, `CONFIRMED` → "Subscribed | Undo", any other answer → "Not subscribed | Undo"). New `subscription_status_modal_block`, a centred modal every widget's "Confirm Status" opens: the row from the opening CTA's `drilldown_data` with the live frequency, "I'm Subscribed" / "I'm Not Subscribed", then the three reasons; it saves through `answerSubscription`, reports the "No" press, and shows a success snackbar or an error one with Try Again. Words from the new optional `insights_feed.subscription_status_modal` copy (`SubscriptionStatusModalCopy`); a missing word renders nothing
|
|
4
|
+
- **ADDED** - `transaction_block` / `warning_wash` follows the beat's live repeating transaction: the frequency word under the amount (`showFrequency`, shared with `info_wash`) and, with `followsSubscription`, a status badge over the row (`TransactionListCard` `badge`: `data.icon` flag, `data.reviewed_icon` tick once subscribed) and the answered wash. It only reads the store
|
|
5
|
+
- **ADDED** - `CtaStep.compactStatus`: mini and micro mirror the step's status when their `in_description_cta` names it (USP opts in; Subscription Detected keeps its link). Micro resolves it through `MicroCtaStatusGate`: answered, it shows the opening block's `answeredTitle` (USP: "Unexpected Charge Reviewed"), `data.reviewed_icon` and the presenter's "Undo", and a tap goes to the host instead of re-opening the block; with missing data it shows no action
|
|
6
|
+
- **CHANGED** - Subscription Status dialogs: fixed `xs` width, white paper, 4px radius, full-bleed wash; reasons as 44px rows with inset dividers. `CtaStatus` gains `sx` and `CTA_STATUS_CONTENT_CLASS`; USP's white "Not subscribed" bar (paper fill, 50% black border, 70% icon) is its own step config (`subscriptionEntryStep` `negativeSx`), so the shared neutral tone is unchanged. The `warning_wash` badge is a 32px palette disc with a `contrastText` glyph; `TransactionListCard` gains `elevated`
|
|
7
|
+
- **CHANGED** - `useBeatCtaActions` returns `linkPresentation`, the state of the `linkCta`
|
|
8
|
+
(`in_description_cta`) step when it sets `compactStatus`; mini reads its label and answered title from it
|
|
9
|
+
- **FIXED** - The Subscription Status modal saves once per tap (in-flight guard) and clears the old notice on Try Again; an answered USP micro card's tap to the host keeps its `clicked_insight` analytics
|
|
10
|
+
|
|
11
|
+
## [9.7.78] - 11-02-2026
|
|
12
|
+
|
|
13
|
+
- **FIXED** - Save an Extra $100 amount spacing and the Uncategorized Transactions V2 "All Categorized!" banner now match Figma (WEC-2153, WEC-2155)
|
|
14
|
+
- **CHANGED** - `StatusMessageCard` now always draws the elevation/1 shadow, as in Figma (WEC-2155)
|
|
15
|
+
- **FIXED** - `StatusMessageCard` message is readable in dark mode: the banner uses `success.lighter` and `text.primary`, as in Figma (WEC-2155)
|
|
16
|
+
- **FIXED** - Payday Cash Left Over Status money icon is 24px on both the on-track and off-track tiles and the Remaining Cash drawer rows are 64px tall, matching Figma; the tiles and drawer are shared, so Monthly Obligations Status changes too (WEC-2156)
|
|
17
|
+
|
|
1
18
|
## [9.7.77] - 11-02-2026
|
|
2
19
|
|
|
3
20
|
- **FIXED** - The Net Worth monthly table now shows the full number of months for the 6M and 9M timeframe selections; it previously dropped one month in certain calendar months (MEW-4195)
|
|
@@ -10,5 +10,11 @@ export declare class GlobalCopyStore {
|
|
|
10
10
|
constructor(globalStore: GlobalStore);
|
|
11
11
|
loadCopy: () => Promise<void>;
|
|
12
12
|
getCopy: (namespace: string, translationKey?: string) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Merges an already-loaded section into `copy` (no request), for a host that did not load the
|
|
15
|
+
* copy, e.g. the micro widget handing over the insights_feed it loaded with its own copy. A
|
|
16
|
+
* section the store already has is kept.
|
|
17
|
+
*/
|
|
18
|
+
setSection: <K extends keyof GlobalCopy>(key: K, section: GlobalCopy[K] | undefined) => void;
|
|
13
19
|
private captureError;
|
|
14
20
|
}
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import { GlobalCopyApi as
|
|
2
|
-
import { makeAutoObservable as a, runInAction as
|
|
3
|
-
var
|
|
1
|
+
import { GlobalCopyApi as i } from "../api/GlobalCopyApi.es.js";
|
|
2
|
+
import { makeAutoObservable as a, runInAction as r } from "mobx";
|
|
3
|
+
var c = class {
|
|
4
4
|
globalStore;
|
|
5
|
-
api = new
|
|
5
|
+
api = new i("/", "");
|
|
6
6
|
copy = {};
|
|
7
7
|
featureNamespace = "experiences";
|
|
8
8
|
isInitialized = !1;
|
|
9
9
|
constructor(t) {
|
|
10
|
-
this.globalStore = t, this.api = new
|
|
10
|
+
this.globalStore = t, this.api = new i(t.endpoint, t.sessionToken, t.onError), a(this);
|
|
11
11
|
}
|
|
12
12
|
loadCopy = async () => {
|
|
13
|
-
await this.getCopy(this.featureNamespace),
|
|
13
|
+
await this.getCopy(this.featureNamespace), r(() => {
|
|
14
14
|
this.isInitialized = !0;
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
getCopy = async (t, o = "") => {
|
|
18
18
|
try {
|
|
19
19
|
const e = await this.api.getGlobalCopy(t, o);
|
|
20
|
-
|
|
20
|
+
r(() => {
|
|
21
21
|
this.copy = e[t];
|
|
22
22
|
});
|
|
23
23
|
} catch (e) {
|
|
24
24
|
this.captureError("getCopy", e);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
+
setSection = (t, o) => {
|
|
28
|
+
!o || this.copy?.[t] || (this.copy = {
|
|
29
|
+
...this.copy,
|
|
30
|
+
[t]: o
|
|
31
|
+
});
|
|
32
|
+
};
|
|
27
33
|
captureError = (t, o) => this.globalStore.captureException(o, {
|
|
28
34
|
store: "GlobalCopyStore",
|
|
29
35
|
action: t
|
|
30
36
|
});
|
|
31
37
|
};
|
|
32
38
|
export {
|
|
33
|
-
|
|
39
|
+
c as GlobalCopyStore
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
//# sourceMappingURL=GlobalCopyStore.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalCopyStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalCopyStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { GlobalCopyApi } from '../api'\nimport { GlobalCopy } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class GlobalCopyStore {\n globalStore: GlobalStore\n api: GlobalCopyApi = new GlobalCopyApi('/', '')\n\n copy: GlobalCopy = {} as GlobalCopy\n featureNamespace = 'experiences'\n\n isInitialized = false\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new GlobalCopyApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n loadCopy = async () => {\n await this.getCopy(this.featureNamespace)\n\n runInAction(() => {\n this.isInitialized = true\n })\n }\n\n getCopy = async (namespace: string, translationKey: string = '') => {\n try {\n const newCopy = await this.api.getGlobalCopy(namespace, translationKey)\n\n runInAction(() => {\n this.copy = newCopy[namespace]\n })\n } catch (error) {\n this.captureError('getCopy', error)\n }\n }\n\n private captureError = (action: string, error: unknown) =>\n this.globalStore.captureException(error, { store: 'GlobalCopyStore', action })\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAA6B;AAAA,EAC3B;AAAA,EACA,MAAqB,IAAI,EAAc,KAAK,EAAE;AAAA,EAE9C,OAAmB,CAAC;AAAA,EACpB,mBAAmB;AAAA,EAEnB,gBAAgB;AAAA,EAEhB,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EACb,EAAY,UACZ,EAAY,cACZ,EAAY,OACd,GAEA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,WAAW,YAAY;AACrB,UAAM,KAAK,QAAQ,KAAK,gBAAgB,GAExC,EAAA,MAAkB;AAChB,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,OAAO,GAAmB,IAAyB,OAAO;AAClE,QAAI;AACF,YAAM,IAAU,MAAM,KAAK,IAAI,cAAc,GAAW,CAAc;AAEtE,MAAA,EAAA,MAAkB;AAChB,aAAK,OAAO,EAAQ,CAAA;AAAA,MACtB,CAAC;AAAA,IACH,SAAS,GAAO;AACd,WAAK,aAAa,WAAW,CAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,eAAA,CAAwB,GAAgB,MACtC,KAAK,YAAY,iBAAiB,GAAO;AAAA,IAAE,OAAO;AAAA,IAAmB,QAAA;AAAA,EAAO,CAAC;AACjF"}
|
|
1
|
+
{"version":3,"file":"GlobalCopyStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalCopyStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { GlobalCopyApi } from '../api'\nimport { GlobalCopy } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class GlobalCopyStore {\n globalStore: GlobalStore\n api: GlobalCopyApi = new GlobalCopyApi('/', '')\n\n copy: GlobalCopy = {} as GlobalCopy\n featureNamespace = 'experiences'\n\n isInitialized = false\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new GlobalCopyApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n loadCopy = async () => {\n await this.getCopy(this.featureNamespace)\n\n runInAction(() => {\n this.isInitialized = true\n })\n }\n\n getCopy = async (namespace: string, translationKey: string = '') => {\n try {\n const newCopy = await this.api.getGlobalCopy(namespace, translationKey)\n\n runInAction(() => {\n this.copy = newCopy[namespace]\n })\n } catch (error) {\n this.captureError('getCopy', error)\n }\n }\n\n /**\n * Merges an already-loaded section into `copy` (no request), for a host that did not load the\n * copy, e.g. the micro widget handing over the insights_feed it loaded with its own copy. A\n * section the store already has is kept.\n */\n setSection = <K extends keyof GlobalCopy>(key: K, section: GlobalCopy[K] | undefined) => {\n if (!section || this.copy?.[key]) return\n\n this.copy = { ...this.copy, [key]: section }\n }\n\n private captureError = (action: string, error: unknown) =>\n this.globalStore.captureException(error, { store: 'GlobalCopyStore', action })\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAA6B;AAAA,EAC3B;AAAA,EACA,MAAqB,IAAI,EAAc,KAAK,EAAE;AAAA,EAE9C,OAAmB,CAAC;AAAA,EACpB,mBAAmB;AAAA,EAEnB,gBAAgB;AAAA,EAEhB,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EACb,EAAY,UACZ,EAAY,cACZ,EAAY,OACd,GAEA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,WAAW,YAAY;AACrB,UAAM,KAAK,QAAQ,KAAK,gBAAgB,GAExC,EAAA,MAAkB;AAChB,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,OAAO,GAAmB,IAAyB,OAAO;AAClE,QAAI;AACF,YAAM,IAAU,MAAM,KAAK,IAAI,cAAc,GAAW,CAAc;AAEtE,MAAA,EAAA,MAAkB;AAChB,aAAK,OAAO,EAAQ,CAAA;AAAA,MACtB,CAAC;AAAA,IACH,SAAS,GAAO;AACd,WAAK,aAAa,WAAW,CAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAOA,aAAA,CAA0C,GAAQ,MAAuC;AACvF,IAAI,CAAC,KAAW,KAAK,OAAO,CAAA,MAE5B,KAAK,OAAO;AAAA,MAAE,GAAG,KAAK;AAAA,MAAO,CAAA,CAAA,GAAM;AAAA,IAAQ;AAAA,EAC7C;AAAA,EAEA,eAAA,CAAwB,GAAgB,MACtC,KAAK,YAAY,iBAAiB,GAAO;AAAA,IAAE,OAAO;AAAA,IAAmB,QAAA;AAAA,EAAO,CAAC;AACjF"}
|
|
@@ -194,6 +194,28 @@ export interface SurveyModalCopy {
|
|
|
194
194
|
/** ARIA label for the snackbar close button. */
|
|
195
195
|
toast_close_aria: string;
|
|
196
196
|
}
|
|
197
|
+
/** Subscription Status modal words. */
|
|
198
|
+
export interface SubscriptionStatusModalCopy {
|
|
199
|
+
/** Dialog title. */
|
|
200
|
+
title: string;
|
|
201
|
+
/** Positive answer. */
|
|
202
|
+
subscribed_answer: string;
|
|
203
|
+
/** Negative answer; opens the reasons. */
|
|
204
|
+
not_subscribed_answer: string;
|
|
205
|
+
/** Reasons. */
|
|
206
|
+
never_subscribed: string;
|
|
207
|
+
cancelled: string;
|
|
208
|
+
one_time_purchase: string;
|
|
209
|
+
/** Micro title once answered. */
|
|
210
|
+
reviewed_title: string;
|
|
211
|
+
/** Snackbar words. */
|
|
212
|
+
success_message: string;
|
|
213
|
+
error_message: string;
|
|
214
|
+
try_again: string;
|
|
215
|
+
/** Close labels. */
|
|
216
|
+
close_aria: string;
|
|
217
|
+
toast_close_aria: string;
|
|
218
|
+
}
|
|
197
219
|
/** Connection-details education drilldown (`connection_detail_block`). */
|
|
198
220
|
export interface ConnectionDetailsCopy {
|
|
199
221
|
aria_label_thumbs_down: string;
|
|
@@ -423,6 +445,8 @@ export interface InsightsFeedCopy {
|
|
|
423
445
|
connection_details?: ConnectionDetailsCopy;
|
|
424
446
|
/** Optional: every caller already null-guards (`copyStore.insights_feed?.survey_modal`). */
|
|
425
447
|
survey_modal?: SurveyModalCopy;
|
|
448
|
+
/** Subscription Status modal words. */
|
|
449
|
+
subscription_status_modal?: SubscriptionStatusModalCopy;
|
|
426
450
|
feedback_bar: FeedbackBarCopy;
|
|
427
451
|
dismiss: DismissInsightCopy;
|
|
428
452
|
/** Optional until the localized-content service ships the namespace. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n/** One 64px row. The last row's divider runs full width; the rest are inset 24px (Figma). */\nconst RowItem = ({\n amount,\n isLast,\n leading,\n name,\n}: Omit<RemainingCashRow, 'key'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, px: 24, py:
|
|
1
|
+
{"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n/** One 64px row. The last row's divider runs full width; the rest are inset 24px (Figma). */\nconst RowItem = ({\n amount,\n isLast,\n leading,\n name,\n}: Omit<RemainingCashRow, 'key'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n {/* 64px as in Figma: 16px above and below the 32px logo, the row's tallest item. */}\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, px: 24, py: 16 }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n <Box sx={{ display: 'flex', flexShrink: 0, height: 32, width: 32 }}>{leading}</Box>\n <Text truncate={true} variant=\"body1\">\n {name}\n </Text>\n </Stack>\n <Text bold={true} sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {formatSignedCurrency(amount)}\n </Text>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 24, position: 'absolute', right: 0 }} />\n </Box>\n)\n\n// The drawer title is the h2, so section headers are h3 and each section is a real list.\nconst Section = ({ header, rows }: RemainingCashSectionProps) => (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {rows.map(({ key, ...row }, index) => (\n <RowItem {...row} isLast={index === rows.length - 1} key={key} />\n ))}\n </Stack>\n </Stack>\n)\n\n/** Presentational body of the Remaining Cash drawer (Figma 9936:39163, minus the drawer header). */\nconst RemainingCashContent = ({ accounts, expenses, summary }: RemainingCashContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n <Summary {...summary} />\n {accounts.rows.length > 0 && <Section {...accounts} />}\n {expenses.rows.length > 0 && <Section {...expenses} />}\n </Stack>\n)\n\nexport default RemainingCashContent\n"],"mappings":";;;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GAAU,SAAA,EAAA,MAClD,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,SAAS;AAAA,IAAsB,IAAI;AAAA,EAAG;AAAA,EAAnD,UAAA;AAAA,IACE,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAU,CAAA;AAAA,IACtB,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,IACpD,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,EAChD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionBlockProps } from '../mappings/blocks';
|
|
2
|
+
/** Unexpected Subscription Payment's Subscription Status modal. */
|
|
3
|
+
export declare const SubscriptionStatusModalBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default SubscriptionStatusModalBlock;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useGlobalCopyStore as V, useGlobalStore as X, useInsightsV2Store as $ } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as d } from "../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as q } from "../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import R from "../../common/components/dialog/Dialog.es.js";
|
|
5
|
+
import { useBeatActions as Z } from "../beatActions.es.js";
|
|
6
|
+
import { USER_RESPONSE as f, answerSubscription as J, repeatingTransactionOf as K, reportSubscriptionMarkedIncorrect as Q } from "../ctaActions/subscriptionAnswer.es.js";
|
|
7
|
+
import Y from "../components/LogoFromGuid.es.js";
|
|
8
|
+
import "../components/celebrationGradients.es.js";
|
|
9
|
+
import rr from "../components/TransactionListCard.es.js";
|
|
10
|
+
import { subscriptionFrequency as tr } from "../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
11
|
+
import er from "../components/shared/StatusSnackbar.es.js";
|
|
12
|
+
import { getDynamicCtaBasedOnTriggers as or } from "./util.es.js";
|
|
13
|
+
import { useEffect as sr, useRef as M, useState as T } from "react";
|
|
14
|
+
import { observer as nr } from "mobx-react-lite";
|
|
15
|
+
import B from "@mui/material/Stack";
|
|
16
|
+
import { Text as ir } from "@mxenabled/mxui";
|
|
17
|
+
import { Icon as ar } from "@mxenabled/mx-icons";
|
|
18
|
+
import { Fragment as cr, jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
19
|
+
import lr from "@mui/material/Divider";
|
|
20
|
+
import ur from "@mui/material/ButtonBase";
|
|
21
|
+
var mr = 32, G = {
|
|
22
|
+
backgroundColor: "background.paper",
|
|
23
|
+
borderRadius: 1
|
|
24
|
+
}, L = {
|
|
25
|
+
"& .MuiDialog-paper": G,
|
|
26
|
+
"& .MuiDialogContent-root": { p: 0 }
|
|
27
|
+
}, pr = [
|
|
28
|
+
["never_subscribed", f.NEVER_SUBSCRIBED],
|
|
29
|
+
["cancelled", f.CANCELLED],
|
|
30
|
+
["one_time_purchase", f.ONE_TIME_PURCHASE]
|
|
31
|
+
], t = (i) => typeof i == "string" && i.trim() ? i : void 0, Tr = nr(function({ beat: x }) {
|
|
32
|
+
const P = X(), { insights_feed: _, recurring: F } = V(), { actionDrawer: W, closeActionDrawer: g } = $(), U = Z(), [E, b] = T("answers"), [o, a] = T(null), c = M(!1), y = M(!1), r = _?.subscription_status_modal, l = x.insights_payload, S = pr.flatMap(([s, m]) => {
|
|
33
|
+
const p = t(r?.[s]);
|
|
34
|
+
return p ? [{
|
|
35
|
+
label: p,
|
|
36
|
+
userResponse: m
|
|
37
|
+
}] : [];
|
|
38
|
+
}), D = !!t(r?.title) && !!t(r?.subscribed_answer) && !!t(r?.not_subscribed_answer) && S.length > 0, I = !!_ && !D;
|
|
39
|
+
if (sr(() => {
|
|
40
|
+
I && (console.warn("[SubscriptionStatusModalBlock] subscription_status_modal is missing its title, answers or reasons; closing."), g());
|
|
41
|
+
}, [I, g]), !l || !r || !D) return null;
|
|
42
|
+
const h = t(r.close_aria) ?? t(r.toast_close_aria) ?? t(_?.settings_menu?.close) ?? "", O = o && t(o.severity === "success" ? r.success_message : r.error_message), v = {
|
|
43
|
+
beat: x,
|
|
44
|
+
stores: P,
|
|
45
|
+
hostActions: U
|
|
46
|
+
}, u = or(W, l.primary_cta, l.secondary_cta, l.in_description_cta)?.drilldown_data ?? {}, k = d(u, "logo"), w = d(u, "primary_text"), N = d(u, "amount"), A = async (s) => {
|
|
47
|
+
if (!y.current) {
|
|
48
|
+
y.current = !0, a(null), b("saving");
|
|
49
|
+
try {
|
|
50
|
+
await J(v, s), t(r.success_message) ? a({ severity: "success" }) : n();
|
|
51
|
+
} catch {
|
|
52
|
+
t(r.error_message) ? a({
|
|
53
|
+
severity: "error",
|
|
54
|
+
retry: s
|
|
55
|
+
}) : n();
|
|
56
|
+
} finally {
|
|
57
|
+
y.current = !1;
|
|
58
|
+
}
|
|
59
|
+
b("done");
|
|
60
|
+
}
|
|
61
|
+
}, n = () => {
|
|
62
|
+
a(null), g();
|
|
63
|
+
}, j = () => {
|
|
64
|
+
c.current = !0, Q(v), b("reasons");
|
|
65
|
+
}, H = () => {
|
|
66
|
+
c.current = !0, A(f.CONFIRMED);
|
|
67
|
+
}, z = () => {
|
|
68
|
+
if (c.current) {
|
|
69
|
+
c.current = !1;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
n();
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ C(cr, { children: [
|
|
75
|
+
/* @__PURE__ */ e(R, {
|
|
76
|
+
copy: {
|
|
77
|
+
title: r.title,
|
|
78
|
+
close_aria: h
|
|
79
|
+
},
|
|
80
|
+
fullWidth: !0,
|
|
81
|
+
isOpen: E === "answers",
|
|
82
|
+
onClose: z,
|
|
83
|
+
onPrimaryAction: H,
|
|
84
|
+
onSecondaryAction: j,
|
|
85
|
+
primaryText: r.subscribed_answer,
|
|
86
|
+
secondaryText: r.not_subscribed_answer,
|
|
87
|
+
sx: L,
|
|
88
|
+
children: typeof w == "string" && w && /* @__PURE__ */ e(rr, {
|
|
89
|
+
background: "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)",
|
|
90
|
+
elevated: !0,
|
|
91
|
+
rows: [{
|
|
92
|
+
amount: typeof N == "number" ? q(N, "0,0.00") : "",
|
|
93
|
+
amountCaption: tr(F, K(v)),
|
|
94
|
+
leading: k ? /* @__PURE__ */ e(Y, {
|
|
95
|
+
logo: k,
|
|
96
|
+
size: mr
|
|
97
|
+
}) : void 0,
|
|
98
|
+
subtitle: d(u, "secondary_text") ?? "",
|
|
99
|
+
title: w
|
|
100
|
+
}]
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ e(R, {
|
|
104
|
+
copy: {
|
|
105
|
+
title: r.title,
|
|
106
|
+
close_aria: h
|
|
107
|
+
},
|
|
108
|
+
fullWidth: !0,
|
|
109
|
+
isOpen: E === "reasons",
|
|
110
|
+
onClose: n,
|
|
111
|
+
showActions: !1,
|
|
112
|
+
sx: {
|
|
113
|
+
...L,
|
|
114
|
+
"& .MuiDialog-paper": {
|
|
115
|
+
...G,
|
|
116
|
+
pb: 16
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
children: /* @__PURE__ */ e(B, { children: S.map(({ label: s, userResponse: m }, p) => /* @__PURE__ */ C(B, { children: [/* @__PURE__ */ C(ur, {
|
|
120
|
+
onClick: () => {
|
|
121
|
+
A(m);
|
|
122
|
+
},
|
|
123
|
+
sx: {
|
|
124
|
+
gap: 12,
|
|
125
|
+
justifyContent: "space-between",
|
|
126
|
+
minHeight: 44,
|
|
127
|
+
px: 24,
|
|
128
|
+
py: 8,
|
|
129
|
+
textAlign: "left",
|
|
130
|
+
width: "100%"
|
|
131
|
+
},
|
|
132
|
+
children: [/* @__PURE__ */ e(ir, {
|
|
133
|
+
variant: "body1",
|
|
134
|
+
children: s
|
|
135
|
+
}), /* @__PURE__ */ e(ar, {
|
|
136
|
+
"aria-hidden": !0,
|
|
137
|
+
name: "chevron_right",
|
|
138
|
+
size: 24,
|
|
139
|
+
sx: { color: "action.active" }
|
|
140
|
+
})]
|
|
141
|
+
}), p < S.length - 1 && /* @__PURE__ */ e(lr, { sx: { ml: 24 } })] }, m)) })
|
|
142
|
+
}),
|
|
143
|
+
o && O && /* @__PURE__ */ e(er, {
|
|
144
|
+
actionText: o.retry ? t(r.try_again) : void 0,
|
|
145
|
+
closeAriaLabel: t(r.toast_close_aria) ?? h,
|
|
146
|
+
message: O,
|
|
147
|
+
onActionClick: o.retry ? () => {
|
|
148
|
+
A(o.retry);
|
|
149
|
+
} : void 0,
|
|
150
|
+
onClose: n,
|
|
151
|
+
open: !0,
|
|
152
|
+
severity: o.severity
|
|
153
|
+
})
|
|
154
|
+
] });
|
|
155
|
+
});
|
|
156
|
+
export {
|
|
157
|
+
Tr as SubscriptionStatusModalBlock,
|
|
158
|
+
Tr as default
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=SubscriptionStatusModalBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionStatusModalBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/SubscriptionStatusModalBlock.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport { Dialog, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { slot } from '../../core'\nimport type { LogoRef } from '../../core'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\nimport { useBeatActions } from '../beatActions'\nimport { WARNING_WASH_GRADIENT } from '../components/celebrationGradients'\nimport LogoFromGuid from '../components/LogoFromGuid'\nimport StatusSnackbar from '../components/shared/StatusSnackbar'\nimport { subscriptionFrequency } from '../components/SubscriptionStatus/subscriptionFrequency'\nimport TransactionListCard from '../components/TransactionListCard'\nimport {\n answerSubscription,\n repeatingTransactionOf,\n reportSubscriptionMarkedIncorrect,\n USER_RESPONSE,\n} from '../ctaActions/subscriptionAnswer'\nimport type { ActionBlockProps } from '../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from './util'\n\nconst ROW_LOGO_SIZE = 32\n\n// White paper, full-bleed content, 4px radius.\nconst DIALOG_PAPER_SX = { backgroundColor: 'background.paper', borderRadius: 1 }\nconst SUBSCRIPTION_DIALOG_SX = {\n '& .MuiDialog-paper': DIALOG_PAPER_SX,\n '& .MuiDialogContent-root': { p: 0 },\n}\n\n// The reasons in Figma order; a reason with no word drops its row.\nconst REASONS = [\n ['never_subscribed', USER_RESPONSE.NEVER_SUBSCRIBED],\n ['cancelled', USER_RESPONSE.CANCELLED],\n ['one_time_purchase', USER_RESPONSE.ONE_TIME_PURCHASE],\n] as const\n\n/** A non-empty word, or undefined. */\nconst word = (value?: string): string | undefined =>\n typeof value === 'string' && value.trim() ? value : undefined\n\ntype Phase = 'answers' | 'reasons' | 'saving' | 'done'\ninterface Notice {\n severity: 'success' | 'error'\n retry?: string\n}\n\n/** Unexpected Subscription Payment's Subscription Status modal. */\nexport const SubscriptionStatusModalBlock = observer(function SubscriptionStatusModalBlock({\n beat,\n}: ActionBlockProps) {\n const stores = useGlobalStore()\n const { insights_feed, recurring } = useGlobalCopyStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n const beatActions = useBeatActions()\n const [phase, setPhase] = useState<Phase>('answers')\n const [notice, setNotice] = useState<Notice | null>(null)\n // The Dialog calls onClose after its actions; keep the flow open.\n const actionTaken = useRef(false)\n // One save at a time: a double tap (a closing dialog is still clickable) or Try Again sends one PUT.\n const saving = useRef(false)\n\n const copy = insights_feed?.subscription_status_modal\n const payload = beat.insights_payload\n // Only the words needed to answer: the title, both answers and at least one reason. The rest\n // (snackbar words, close labels, reviewed_title, a key added later) never block the modal.\n const reasons = REASONS.flatMap(([key, userResponse]) => {\n const label = word(copy?.[key])\n\n return label ? [{ label, userResponse }] : []\n })\n const ready =\n !!word(copy?.title) &&\n !!word(copy?.subscribed_answer) &&\n !!word(copy?.not_subscribed_answer) &&\n reasons.length > 0\n // Copy loaded (insights_feed is there) but incomplete: say so and close, not a silent open drawer.\n const incomplete = !!insights_feed && !ready\n\n useEffect(() => {\n if (!incomplete) return\n console.warn(\n '[SubscriptionStatusModalBlock] subscription_status_modal is missing its title, answers or reasons; closing.',\n )\n closeActionDrawer()\n }, [incomplete, closeActionDrawer])\n\n if (!payload || !copy || !ready) return null\n\n const closeLabel =\n word(copy.close_aria) ??\n word(copy.toast_close_aria) ??\n word(insights_feed?.settings_menu?.close) ??\n ''\n const noticeMessage =\n notice && word(notice.severity === 'success' ? copy.success_message : copy.error_message)\n\n const ctx = { beat, stores, hostActions: beatActions }\n const cta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n payload.primary_cta,\n payload.secondary_cta,\n payload.in_description_cta,\n )\n const row = cta?.drilldown_data ?? {}\n const logo = slot<LogoRef>(row, 'logo')\n const title = slot<string>(row, 'primary_text')\n const amount = slot<number>(row, 'amount')\n\n const save = async (userResponse: string) => {\n if (saving.current) return\n saving.current = true\n setNotice(null)\n setPhase('saving')\n try {\n await answerSubscription(ctx, userResponse)\n // No snackbar word: the save stands, the flow just ends without the snackbar.\n if (word(copy.success_message)) setNotice({ severity: 'success' })\n else finish()\n } catch {\n if (word(copy.error_message)) setNotice({ severity: 'error', retry: userResponse })\n else finish()\n } finally {\n saving.current = false\n }\n setPhase('done')\n }\n\n const finish = () => {\n setNotice(null)\n closeActionDrawer()\n }\n\n const chooseNotSubscribed = () => {\n actionTaken.current = true\n reportSubscriptionMarkedIncorrect(ctx)\n setPhase('reasons')\n }\n\n const chooseSubscribed = () => {\n actionTaken.current = true\n void save(USER_RESPONSE.CONFIRMED)\n }\n\n const closeAnswers = () => {\n if (actionTaken.current) {\n actionTaken.current = false\n return\n }\n finish()\n }\n\n return (\n <>\n <Dialog\n copy={{ title: copy.title, close_aria: closeLabel }}\n fullWidth={true}\n isOpen={phase === 'answers'}\n onClose={closeAnswers}\n onPrimaryAction={chooseSubscribed}\n onSecondaryAction={chooseNotSubscribed}\n primaryText={copy.subscribed_answer}\n secondaryText={copy.not_subscribed_answer}\n // Full-bleed wash between title and actions.\n sx={SUBSCRIPTION_DIALOG_SX}\n >\n {typeof title === 'string' && title && (\n <TransactionListCard\n background={WARNING_WASH_GRADIENT}\n elevated={true}\n rows={[\n {\n amount: typeof amount === 'number' ? formatCurrency(amount, '0,0.00') : '',\n amountCaption: subscriptionFrequency(recurring, repeatingTransactionOf(ctx)),\n leading: logo ? <LogoFromGuid logo={logo} size={ROW_LOGO_SIZE} /> : undefined,\n subtitle: slot<string>(row, 'secondary_text') ?? '',\n title,\n },\n ]}\n />\n )}\n </Dialog>\n\n <Dialog\n copy={{ title: copy.title, close_aria: closeLabel }}\n fullWidth={true}\n isOpen={phase === 'reasons'}\n onClose={finish}\n showActions={false}\n // Space under the list.\n sx={{ ...SUBSCRIPTION_DIALOG_SX, '& .MuiDialog-paper': { ...DIALOG_PAPER_SX, pb: 16 } }}\n >\n <Stack>\n {reasons.map(({ label, userResponse }, index) => (\n <Stack key={userResponse}>\n <ButtonBase\n onClick={() => void save(userResponse)}\n sx={{\n gap: 12,\n justifyContent: 'space-between',\n minHeight: 44,\n px: 24,\n py: 8,\n textAlign: 'left',\n width: '100%',\n }}\n >\n <Text variant=\"body1\">{label}</Text>\n <Icon\n aria-hidden={true}\n name=\"chevron_right\"\n size={24}\n sx={{ color: 'action.active' }}\n />\n </ButtonBase>\n {/* Between rows only. */}\n {index < reasons.length - 1 && <Divider sx={{ ml: 24 }} />}\n </Stack>\n ))}\n </Stack>\n </Dialog>\n\n {notice && noticeMessage && (\n <StatusSnackbar\n actionText={notice.retry ? word(copy.try_again) : undefined}\n closeAriaLabel={word(copy.toast_close_aria) ?? closeLabel}\n message={noticeMessage}\n onActionClick={notice.retry ? () => void save(notice.retry as string) : undefined}\n onClose={finish}\n open={true}\n severity={notice.severity}\n />\n )}\n </>\n )\n})\n\nexport default SubscriptionStatusModalBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,IAAM,KAAgB,IAGhB,IAAkB;AAAA,EAAE,iBAAiB;AAAA,EAAoB,cAAc;AAAE,GACzE,IAAyB;AAAA,EAC7B,sBAAsB;AAAA,EACtB,4BAA4B,EAAE,GAAG,EAAE;AACrC,GAGM,KAAU;AAAA,EACd,CAAC,oBAAoB,EAAc,gBAAgB;AAAA,EACnD,CAAC,aAAa,EAAc,SAAS;AAAA,EACrC,CAAC,qBAAqB,EAAc,iBAAiB;AACvD,GAGM,IAAA,CAAQ,MACZ,OAAO,KAAU,YAAY,EAAM,KAAK,IAAI,IAAQ,QASzC,KAA+B,GAAS,SAAsC,EACzF,MAAA,EAAA,GACmB;AACnB,QAAM,IAAS,EAAe,GACxB,EAAE,eAAA,GAAe,WAAA,EAAA,IAAc,EAAmB,GAClD,EAAE,cAAA,GAAc,mBAAA,EAAA,IAAsB,EAAmB,GACzD,IAAc,EAAe,GAC7B,CAAC,GAAO,CAAA,IAAY,EAAgB,SAAS,GAC7C,CAAC,GAAQ,CAAA,IAAa,EAAwB,IAAI,GAElD,IAAc,EAAO,EAAK,GAE1B,IAAS,EAAO,EAAK,GAErB,IAAO,GAAe,2BACtB,IAAU,EAAK,kBAGf,IAAU,GAAQ,QAAA,CAAS,CAAC,GAAK,CAAA,MAAkB;AACvD,UAAM,IAAQ,EAAK,IAAO,CAAA,CAAI;AAE9B,WAAO,IAAQ,CAAC;AAAA,MAAE,OAAA;AAAA,MAAO,cAAA;AAAA,IAAa,CAAC,IAAI,CAAC;AAAA,EAC9C,CAAC,GACK,IACJ,CAAC,CAAC,EAAK,GAAM,KAAK,KAClB,CAAC,CAAC,EAAK,GAA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@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "../../../../common/components/IconBacking.es.js";
|
|
2
2
|
import u from "../../../components/LogoFromGuid.es.js";
|
|
3
|
-
import { statusIconName as
|
|
3
|
+
import { statusIconName as l } from "../../../components/statusIcon.es.js";
|
|
4
4
|
import { resolveVariantConfig as g } from "../../resolveVariantConfig.es.js";
|
|
5
5
|
import { getLayoutConfig as f } from "./layout.es.js";
|
|
6
6
|
import { InstitutionLogo as p } from "@mxenabled/mxui";
|
|
7
7
|
import { Icon as n } from "@mxenabled/mx-icons";
|
|
8
|
-
import { jsx as
|
|
8
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
import { useTheme as b } from "@mui/material/styles";
|
|
10
|
-
import { Stack as
|
|
11
|
-
var y = ({ slot:
|
|
12
|
-
const m = b(), o = g(f(m),
|
|
13
|
-
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */
|
|
10
|
+
import { Stack as c } from "@mui/material";
|
|
11
|
+
var y = ({ slot: r, variant: d, logo: e }) => {
|
|
12
|
+
const m = b(), o = g(f(m), d, "default", "AccountBlock");
|
|
13
|
+
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */ s(c, {
|
|
14
14
|
sx: {
|
|
15
15
|
alignItems: "center",
|
|
16
16
|
flexDirection: "row",
|
|
17
17
|
position: "relative"
|
|
18
18
|
},
|
|
19
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ i(u, {
|
|
20
20
|
logo: e,
|
|
21
21
|
size: 48
|
|
22
|
-
}), o.badge && /* @__PURE__ */
|
|
22
|
+
}), o.badge && /* @__PURE__ */ i(a, {
|
|
23
23
|
size: 20,
|
|
24
24
|
sx: {
|
|
25
25
|
position: "absolute",
|
|
26
26
|
right: -8,
|
|
27
27
|
top: -8
|
|
28
28
|
},
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ i(n, {
|
|
30
30
|
"aria-hidden": !0,
|
|
31
31
|
color: "error",
|
|
32
32
|
"data-testid": "account-block-error-badge",
|
|
@@ -41,24 +41,24 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
41
41
|
})
|
|
42
42
|
})]
|
|
43
43
|
});
|
|
44
|
-
if (
|
|
44
|
+
if (r.institution_guid) return /* @__PURE__ */ s(c, {
|
|
45
45
|
sx: {
|
|
46
46
|
alignItems: "center",
|
|
47
47
|
flexDirection: "row",
|
|
48
48
|
position: "relative"
|
|
49
49
|
},
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
alt: `${
|
|
52
|
-
institutionGuid: `${
|
|
50
|
+
children: [/* @__PURE__ */ i(p, {
|
|
51
|
+
alt: `${r.institution_name}`,
|
|
52
|
+
institutionGuid: `${r.institution_guid}`,
|
|
53
53
|
size: 48
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ i(a, {
|
|
55
55
|
size: 20,
|
|
56
56
|
sx: {
|
|
57
57
|
position: "absolute",
|
|
58
58
|
right: -8,
|
|
59
59
|
top: -8
|
|
60
60
|
},
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ i(n, {
|
|
62
62
|
color: "error",
|
|
63
63
|
fill: !0,
|
|
64
64
|
name: "error",
|
|
@@ -71,8 +71,8 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
71
71
|
})
|
|
72
72
|
})]
|
|
73
73
|
});
|
|
74
|
-
const t =
|
|
75
|
-
return t ? /* @__PURE__ */
|
|
74
|
+
const t = l(r.icon_name && `ICO-${r.icon_name}`) ?? (o.logo_bGcolor ? l(e?.guid) : void 0);
|
|
75
|
+
return t ? /* @__PURE__ */ i(c, {
|
|
76
76
|
"data-icon": t,
|
|
77
77
|
"data-testid": "account-block-icon-tile",
|
|
78
78
|
sx: {
|
|
@@ -89,10 +89,10 @@ var y = ({ slot: i, variant: s, logo: e }) => {
|
|
|
89
89
|
borderWidth: 1.5
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ i(n, {
|
|
93
93
|
"aria-hidden": !0,
|
|
94
94
|
name: t,
|
|
95
|
-
size: 30,
|
|
95
|
+
size: o.logo_icon_size ?? 30,
|
|
96
96
|
sx: { color: o.logo_color }
|
|
97
97
|
})
|
|
98
98
|
}) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n /** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */\n logo?: LogoRef\n}\n\nexport const IconComponent = ({ slot, variant, logo }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // V2 slot logo: an institution guid only; anything else falls through to the legacy fields.\n if (/^INS-[A-Za-z0-9-]+$/.test(logo?.guid ?? '')) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <LogoFromGuid logo={logo} size={48} />\n {layoutConfig.badge && (\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n aria-hidden={true}\n color=\"error\"\n data-testid=\"account-block-error-badge\"\n fill={true}\n name={layoutConfig.badge}\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n )}\n </Stack>\n )\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAAA,CAAiB,EAAE,MAAA,GAAM,SAAA,GAAS,MAAA,EAAA,MAA+B;AAC5E,QAAM,IAAQ,EAAS,GACjB,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,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,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CACR;AAAA;AAOX,QAAM,IACJ,EAAe,EAAK,aAAa,OAAO,EAAK,SAAA,EAAW,MACvD,EAAa,eAAe,EAAe,GAAM,IAAI,IAAI;AAC5D,SAAI,IAEA,gBAAA,EAAC,GAAD;AAAA,IACE,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc,EAAa,sBAAsB;AAAA,MACjD,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,GAAI,EAAa,qBAAqB;AAAA,QACpC,aAAa,EAAa;AAAA,QAC1B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,MAAM;AAAA,MACN,
|
|
1
|
+
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, TILE_ICON_SIZE } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InstanceSlot, LogoRef } from '../../../../core'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { statusIconName } from '../../../components/statusIcon'\n\ninterface IconComponentProps {\n slot: InstanceSlot\n variant?: string | null\n /** V2: the slot's logo object (`instance_slot.data.logo`), badged with the layout's `badge`. */\n logo?: LogoRef\n}\n\nexport const IconComponent = ({ slot, variant, logo }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // V2 slot logo: an institution guid only; anything else falls through to the legacy fields.\n if (/^INS-[A-Za-z0-9-]+$/.test(logo?.guid ?? '')) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <LogoFromGuid logo={logo} size={48} />\n {layoutConfig.badge && (\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n aria-hidden={true}\n color=\"error\"\n data-testid=\"account-block-error-badge\"\n fill={true}\n name={layoutConfig.badge}\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n )}\n </Stack>\n )\n }\n\n if (slot.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${slot.institution_name}`}\n institutionGuid={`${slot.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n // The flat `icon_name`, else a V2 `ICO-` logo, both through statusIconName's mx-icons allowlist so\n // an unknown name draws nothing. Drawn here rather than through LogoFromGuid, which fills every\n // `ICO-` glyph. An `ICO-` logo needs a variant that styles the tile, or it would be a bare glyph.\n const iconName =\n statusIconName(slot.icon_name && `ICO-${slot.icon_name}`) ??\n (layoutConfig.logo_bGcolor ? statusIconName(logo?.guid) : undefined)\n if (iconName) {\n return (\n <Stack\n data-icon={iconName}\n data-testid=\"account-block-icon-tile\"\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: layoutConfig.logo_border_radius ?? '6px',\n flexShrink: 0,\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n aria-hidden={true}\n name={iconName}\n size={layoutConfig.logo_icon_size ?? TILE_ICON_SIZE}\n sx={{ color: layoutConfig.logo_color }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAAA,CAAiB,EAAE,MAAA,GAAM,SAAA,GAAS,MAAA,EAAA,MAA+B;AAC5E,QAAM,IAAQ,EAAS,GACjB,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAGA,MAAI,sBAAsB,KAAK,GAAM,QAAQ,EAAE,EAC7C,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,GACpC,EAAa,SACZ,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,OAAM;AAAA,QACN,eAAY;AAAA,QACZ,MAAM;AAAA,QACN,MAAM,EAAa;AAAA,QACnB,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CAEV;AAAA;AAIX,MAAI,EAAK,iBACP,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,GAAG,EAAK,gBAAA;AAAA,MACb,iBAAiB,GAAG,EAAK,gBAAA;AAAA,MACzB,MAAM;AAAA,IACP,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,OAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAK;AAAA,QACL,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CACR;AAAA;AAOX,QAAM,IACJ,EAAe,EAAK,aAAa,OAAO,EAAK,SAAA,EAAW,MACvD,EAAa,eAAe,EAAe,GAAM,IAAI,IAAI;AAC5D,SAAI,IAEA,gBAAA,EAAC,GAAD;AAAA,IACE,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc,EAAa,sBAAsB;AAAA,MACjD,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,GAAI,EAAa,qBAAqB;AAAA,QACpC,aAAa,EAAa;AAAA,QAC1B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,eAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAa,kBAAA;AAAA,MACnB,IAAI,EAAE,OAAO,EAAa,WAAW;AAAA,IACtC,CAAA;AAAA,EACI,CAAA,IAIJ;AACT"}
|
|
@@ -6,8 +6,8 @@ export interface BlockLayoutConfig {
|
|
|
6
6
|
logo_border_color?: string;
|
|
7
7
|
/** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */
|
|
8
8
|
logo_border_radius?: string;
|
|
9
|
-
/** Glyph size in px for an `ICO-` logo on
|
|
10
|
-
*
|
|
9
|
+
/** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard
|
|
10
|
+
* icon tile (default `TILE_ICON_SIZE`). */
|
|
11
11
|
logo_icon_size?: number;
|
|
12
12
|
/** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */
|
|
13
13
|
sub_logo?: string;
|
|
@@ -14,6 +14,7 @@ var e = { background: t }, s = (o) => ({
|
|
|
14
14
|
logo_color: "background.paper",
|
|
15
15
|
logo_bGcolor: "error.main",
|
|
16
16
|
logo_border_radius: "4px",
|
|
17
|
+
logo_icon_size: 24,
|
|
17
18
|
background: t
|
|
18
19
|
},
|
|
19
20
|
interest_charges_summary: {
|
|
@@ -43,7 +44,6 @@ var e = { background: t }, s = (o) => ({
|
|
|
43
44
|
isConfetti: !0,
|
|
44
45
|
gradient: a,
|
|
45
46
|
graphic: "logo",
|
|
46
|
-
logo_icon_size: 30,
|
|
47
47
|
amountVariant: "h2",
|
|
48
48
|
rowSx: {
|
|
49
49
|
gap: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo on
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant — `h2` for milestones, `h3` for deposits. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n interest_charges_summary: {\n logo_color: 'text.primary',\n logo_bGcolor: alpha(theme.palette.categories?.feesCharges || '', 0.25),\n logo_border_color: 'categories.feesCharges',\n background:\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)',\n },\n // Shared deposit-celebration card — used by both the standard deposit and the emergency-fund\n // deposit beats (identical design, different copy), so one design-named variant serves both.\n deposit_received: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h3',\n amountPrefix: '+',\n categoryStrip: true,\n cardShadow: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 24, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'savings',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'above',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n // Neutral fallback for an unknown/unmatched variant: renders the plain standard card (no\n // confetti, no special background). `resolveVariantConfig` warns before falling back here.\n default: {},\n }\n}\n"],"mappings":";;AAqDA,IAAM,IAAsC,EAC1C,YAAY,EACd,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IAEd,oBAAoB;AAAA,IAEpB,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EACA,0BAA0B;AAAA,IACxB,YAAY;AAAA,IACZ,cAAc,EAAM,EAAM,QAAQ,YAAY,eAAe,IAAI,IAAI;AAAA,IACrE,mBAAmB;AAAA,IACnB,YACE;AAAA,EACJ;AAAA,EAGA,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,OAAO;AAAA,MAAE,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IACxB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAAA,EACA,iBAAi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