@mx-cartographer/experiences 9.7.153 → 9.7.155
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/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +42 -42
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +37 -37
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +52 -52
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +87 -87
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -12
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +18 -18
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +23 -22
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +44 -44
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +24 -24
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +20 -20
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js +3 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +75 -75
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +28 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +14 -33
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -41
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/useOpenedCta.d.ts +9 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js +11 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/util.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +18 -15
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +7 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +21 -11
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/AmountPill.d.ts +4 -2
- package/dist/insights-v2/components/AmountPill.es.js +6 -5
- package/dist/insights-v2/components/AmountPill.es.js.map +1 -1
- package/dist/insights-v2/components/MerchantHighlightCard.d.ts +6 -1
- package/dist/insights-v2/components/MerchantHighlightCard.es.js +26 -22
- package/dist/insights-v2/components/MerchantHighlightCard.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -1
- package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
- package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -1
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +49 -44
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WARM_LIME_ACCENT_GRADIENT as
|
|
2
|
-
var
|
|
1
|
+
import { WARM_LIME_ACCENT_GRADIENT as t, celebrateGradient as e } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var r = {
|
|
3
3
|
Highlight: "highlight",
|
|
4
4
|
SingleStandard: "single_standard",
|
|
5
5
|
SingleSuccess: "single_success",
|
|
@@ -9,9 +9,9 @@ var n = {
|
|
|
9
9
|
MultipleSubscription: "multiple_subscription",
|
|
10
10
|
MultipleBadged: "multiple_badged"
|
|
11
11
|
}, l = { bgcolor: "secondary.lighter" }, a = {
|
|
12
|
-
background:
|
|
12
|
+
background: t,
|
|
13
13
|
status: !0
|
|
14
|
-
},
|
|
14
|
+
}, i = {
|
|
15
15
|
kind: "single",
|
|
16
16
|
amountVariant: "pill",
|
|
17
17
|
fullBleed: !0,
|
|
@@ -30,16 +30,26 @@ var n = {
|
|
|
30
30
|
borderColor: "warning.light"
|
|
31
31
|
},
|
|
32
32
|
single_standard: {
|
|
33
|
-
...
|
|
33
|
+
...i,
|
|
34
34
|
...l
|
|
35
35
|
},
|
|
36
36
|
single_success: {
|
|
37
|
-
...
|
|
37
|
+
...i,
|
|
38
38
|
...a
|
|
39
39
|
},
|
|
40
40
|
single_subscription: {
|
|
41
|
-
...
|
|
42
|
-
|
|
41
|
+
...i,
|
|
42
|
+
amountPill: {
|
|
43
|
+
px: 10,
|
|
44
|
+
fontWeight: 400
|
|
45
|
+
},
|
|
46
|
+
background: e(232.03),
|
|
47
|
+
gap: 12,
|
|
48
|
+
logo: {
|
|
49
|
+
...i.logo,
|
|
50
|
+
size: 64
|
|
51
|
+
},
|
|
52
|
+
nameVariant: "h3"
|
|
43
53
|
},
|
|
44
54
|
multiple_standard: {
|
|
45
55
|
kind: "cascade",
|
|
@@ -51,16 +61,16 @@ var n = {
|
|
|
51
61
|
},
|
|
52
62
|
multiple_subscription: {
|
|
53
63
|
kind: "cascade",
|
|
54
|
-
background:
|
|
64
|
+
background: e(200.73)
|
|
55
65
|
},
|
|
56
66
|
multiple_badged: {
|
|
57
67
|
kind: "ranked",
|
|
58
|
-
background:
|
|
68
|
+
background: e(242.46)
|
|
59
69
|
}
|
|
60
70
|
};
|
|
61
71
|
export {
|
|
62
72
|
s as MERCHANT_LAYOUT,
|
|
63
|
-
|
|
73
|
+
r as merchantBlockVariant
|
|
64
74
|
};
|
|
65
75
|
|
|
66
76
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n single_subscription: {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import {\n celebrateGradient,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { AmountPillProps } from '../../../components/AmountPill'\n\n/** ditto declares only `highlight` today. */\nexport const merchantBlockVariant = {\n Highlight: 'highlight',\n SingleStandard: 'single_standard',\n SingleSuccess: 'single_success',\n SingleSubscription: 'single_subscription',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleSubscription: 'multiple_subscription',\n MultipleBadged: 'multiple_badged',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport interface MerchantBlockLayoutConfig {\n /** Merchant card, logo cascade, or ranked logos. */\n kind: 'single' | 'cascade' | 'ranked'\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight. */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. */\n gap?: number\n /** The merchant name's type; the card defaults to h2 beside a pill. */\n nameVariant?: 'h2' | 'h3'\n /** A wash; replaces `bgcolor`. */\n background?: string\n bgcolor?: string\n borderColor?: string\n fullBleed?: boolean\n hideDate?: boolean\n logo?: { size?: number; shadow?: 'offset' | 'elevation'; borderColor?: string; radius?: number }\n /** Draw `status_text` in a success pill. */\n status?: boolean\n}\n\nconst STANDARD = { bgcolor: 'secondary.lighter' }\nconst SUCCESS = { background: WARM_LIME_ACCENT_GRADIENT, status: true }\n\n// Figma 14633:139111\nconst SINGLE: MerchantBlockLayoutConfig = {\n kind: 'single',\n amountVariant: 'pill',\n fullBleed: true,\n hideDate: true,\n logo: { size: 72, shadow: 'elevation', borderColor: 'divider', radius: 8 },\n}\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n highlight: {\n kind: 'single',\n amountVariant: 'text',\n bgcolor: 'warning.lighter',\n borderColor: 'warning.light',\n },\n single_standard: { ...SINGLE, ...STANDARD },\n single_success: { ...SINGLE, ...SUCCESS },\n // Figma 1268:54330 (Single): 64 logo, 12 gap, h3 name, pill 2/10 at 400.\n single_subscription: {\n ...SINGLE,\n amountPill: { px: 10, fontWeight: 400 },\n background: celebrateGradient(232.03),\n gap: 12,\n logo: { ...SINGLE.logo, size: 64 },\n nameVariant: 'h3',\n },\n multiple_standard: { kind: 'cascade', ...STANDARD },\n multiple_success: { kind: 'cascade', ...SUCCESS },\n multiple_subscription: { kind: 'cascade', background: celebrateGradient(200.73) },\n multiple_badged: { kind: 'ranked', background: celebrateGradient(242.46) },\n}\n"],"mappings":";AAOA,IAAa,IAAuB;AAAA,EAClC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAClB,GAyBM,IAAW,EAAE,SAAS,oBAAoB,GAC1C,IAAU;AAAA,EAAE,YAAY;AAAA,EAA2B,QAAQ;AAAK,GAGhE,IAAoC;AAAA,EACxC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,IAAE,MAAM;AAAA,IAAI,QAAQ;AAAA,IAAa,aAAa;AAAA,IAAW,QAAQ;AAAA,EAAE;AAC3E,GAEa,IAA2E;AAAA,EACtF,WAAW;AAAA,IACT,MAAM;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,iBAAiB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAS;AAAA,EAC1C,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAQ,GAAG;AAAA,EAAQ;AAAA,EAExC,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,YAAY;AAAA,MAAE,IAAI;AAAA,MAAI,YAAY;AAAA,IAAI;AAAA,IACtC,YAAY,EAAkB,MAAM;AAAA,IACpC,KAAK;AAAA,IACL,MAAM;AAAA,MAAE,GAAG,EAAO;AAAA,MAAM,MAAM;AAAA,IAAG;AAAA,IACjC,aAAa;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAS;AAAA,EAClD,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAW,GAAG;AAAA,EAAQ;AAAA,EAChD,uBAAuB;AAAA,IAAE,MAAM;AAAA,IAAW,YAAY,EAAkB,MAAM;AAAA,EAAE;AAAA,EAChF,iBAAiB;AAAA,IAAE,MAAM;AAAA,IAAU,YAAY,EAAkB,MAAM;AAAA,EAAE;AAC3E"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SxProps } from '@mui/material/styles';
|
|
3
|
-
interface AmountPillProps {
|
|
3
|
+
export interface AmountPillProps {
|
|
4
4
|
/** Pill content (amount / price string). */
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
/** Horizontal padding in px (Figma varies: 16 inline, 10 in the hero). */
|
|
7
7
|
px?: number;
|
|
8
|
+
/** Text weight; defaults to `subtitle2`'s 500. */
|
|
9
|
+
fontWeight?: number;
|
|
8
10
|
sx?: SxProps;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
@@ -12,5 +14,5 @@ interface AmountPillProps {
|
|
|
12
14
|
* `primary.contrastText` `subtitle2` text. Shared by MerchantHighlightCard and
|
|
13
15
|
* SubscriptionHeroCard.
|
|
14
16
|
*/
|
|
15
|
-
declare const AmountPill: ({ children, px, sx }: AmountPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const AmountPill: ({ children, fontWeight, px, sx }: AmountPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export default AmountPill;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Text as
|
|
1
|
+
import { Text as i } from "@mxenabled/mxui";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
var p = ({ children: r, px: a = 16, sx: o }) => /* @__PURE__ */ t(
|
|
3
|
+
import e from "@mui/material/Box";
|
|
4
|
+
var p = ({ children: l, fontWeight: r, px: a = 16, sx: o }) => /* @__PURE__ */ t(e, {
|
|
5
5
|
"data-testid": "amount-pill",
|
|
6
6
|
sx: {
|
|
7
7
|
alignItems: "center",
|
|
@@ -13,10 +13,11 @@ var p = ({ children: r, px: a = 16, sx: o }) => /* @__PURE__ */ t(i, {
|
|
|
13
13
|
py: 2,
|
|
14
14
|
...o
|
|
15
15
|
},
|
|
16
|
-
children: /* @__PURE__ */ t(
|
|
16
|
+
children: /* @__PURE__ */ t(i, {
|
|
17
17
|
color: "primary.contrastText",
|
|
18
|
+
sx: r != null ? { fontWeight: r } : void 0,
|
|
18
19
|
variant: "subtitle2",
|
|
19
|
-
children:
|
|
20
|
+
children: l
|
|
20
21
|
})
|
|
21
22
|
});
|
|
22
23
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountPill.es.js","names":[],"sources":["../../../src/insights-v2/components/AmountPill.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\
|
|
1
|
+
{"version":3,"file":"AmountPill.es.js","names":[],"sources":["../../../src/insights-v2/components/AmountPill.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface AmountPillProps {\n /** Pill content (amount / price string). */\n children: ReactNode\n /** Horizontal padding in px (Figma varies: 16 inline, 10 in the hero). */\n px?: number\n /** Text weight; defaults to `subtitle2`'s 500. */\n fontWeight?: number\n sx?: SxProps\n}\n\n/**\n * A dark rounded amount/price pill: `text.primary` surface with\n * `primary.contrastText` `subtitle2` text. Shared by MerchantHighlightCard and\n * SubscriptionHeroCard.\n */\nconst AmountPill = ({ children, fontWeight, px = 16, sx }: AmountPillProps) => (\n <Box\n data-testid=\"amount-pill\"\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor: 'text.primary',\n borderRadius: 999,\n display: 'flex',\n px,\n py: 2,\n ...sx,\n }}\n >\n <Text\n color=\"primary.contrastText\"\n sx={fontWeight != null ? { fontWeight } : undefined}\n variant=\"subtitle2\"\n >\n {children}\n </Text>\n </Box>\n)\n\nexport default AmountPill\n"],"mappings":";;;AAsBA,IAAM,IAAA,CAAc,EAAE,UAAA,GAAU,YAAA,GAAY,IAAA,IAAK,IAAI,IAAA,EAAA,MACnD,gBAAA,EAAC,GAAD;AAAA,EACE,eAAY;AAAA,EACZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,IACT,cAAc;AAAA,IACd,SAAS;AAAA,IACT,IAAA;AAAA,IACA,IAAI;AAAA,IACJ,GAAG;AAAA,EACL;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IACE,OAAM;AAAA,IACN,IAAI,KAAc,OAAO,EAAE,YAAA,EAAW,IAAI;AAAA,IAC1C,SAAQ;AAAA,IAEP,UAAA;AAAA,EACG,CAAA;AACH,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SxProps } from '@mui/material/styles';
|
|
3
|
+
import { AmountPillProps } from './AmountPill';
|
|
3
4
|
interface MerchantHighlightCardProps {
|
|
4
5
|
/** Brand/merchant logo visual (rendered inside a `LogoTile`). */
|
|
5
6
|
logo: ReactNode;
|
|
@@ -11,6 +12,10 @@ interface MerchantHighlightCardProps {
|
|
|
11
12
|
amount?: ReactNode;
|
|
12
13
|
/** How to render the amount. */
|
|
13
14
|
amountVariant?: 'pill' | 'text';
|
|
15
|
+
/** The amount pill's horizontal padding and text weight (see `AmountPill`). */
|
|
16
|
+
amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>;
|
|
17
|
+
/** Gap between the logo and the text column. Default 16. */
|
|
18
|
+
gap?: number;
|
|
14
19
|
/** Typography variant for the name. Defaults to `h2` for `pill`, else `h3`. */
|
|
15
20
|
nameVariant?: 'h2' | 'h3';
|
|
16
21
|
/** Trailing element beneath the name (e.g. a `<StatusPill>`); replaces `amount`. */
|
|
@@ -35,5 +40,5 @@ interface MerchantHighlightCardProps {
|
|
|
35
40
|
* eyebrow, name, amount/trailing). Shared by Peer-to-Peer Categorization, New
|
|
36
41
|
* Merchant, and Monthly Subscription Aggregate V2's Visual state.
|
|
37
42
|
*/
|
|
38
|
-
declare const MerchantHighlightCard: ({ amount, amountVariant, background, bgcolor, borderColor, eyebrow, fullBleed, logo, logoBorderColor, logoRadius, logoShadow, logoSize, name, nameVariant, trailing, sx, }: MerchantHighlightCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare const MerchantHighlightCard: ({ amount, amountPill, amountVariant, background, bgcolor, borderColor, eyebrow, fullBleed, gap, logo, logoBorderColor, logoRadius, logoShadow, logoSize, name, nameVariant, trailing, sx, }: MerchantHighlightCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
44
|
export default MerchantHighlightCard;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import N from "./LogoTile.es.js";
|
|
2
|
+
import R from "./AmountPill.es.js";
|
|
3
3
|
import i from "@mui/material/Stack";
|
|
4
4
|
import { Text as o } from "@mxenabled/mxui";
|
|
5
5
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
let e =
|
|
9
|
-
return e == null && t != null && (e = l === "pill" ? /* @__PURE__ */ r(
|
|
6
|
+
var H = ({ amount: t, amountPill: n, amountVariant: l = "text", background: d, bgcolor: x = "grey.200", borderColor: a, eyebrow: h, fullBleed: c = !1, gap: p = 16, logo: f, logoBorderColor: m, logoRadius: g, logoShadow: u = !0, logoSize: v, name: W, nameVariant: w, trailing: y, sx: b }) => {
|
|
7
|
+
const j = w ?? (l === "pill" ? "h2" : "h3");
|
|
8
|
+
let e = y;
|
|
9
|
+
return e == null && t != null && (e = l === "pill" ? /* @__PURE__ */ r(R, {
|
|
10
|
+
fontWeight: n?.fontWeight,
|
|
11
|
+
px: n?.px,
|
|
12
|
+
children: t
|
|
13
|
+
}) : /* @__PURE__ */ r(o, {
|
|
10
14
|
color: "text.secondary",
|
|
11
15
|
variant: "body1",
|
|
12
16
|
children: t
|
|
@@ -14,45 +18,45 @@ var C = ({ amount: t, amountVariant: l = "text", background: n, bgcolor: h = "gr
|
|
|
14
18
|
sx: {
|
|
15
19
|
px: c ? 0 : 16,
|
|
16
20
|
width: "100%",
|
|
17
|
-
...
|
|
21
|
+
...b
|
|
18
22
|
},
|
|
19
23
|
children: /* @__PURE__ */ s(i, {
|
|
20
24
|
sx: {
|
|
21
25
|
alignItems: "center",
|
|
22
|
-
...
|
|
23
|
-
...
|
|
26
|
+
...d ? { background: d } : { bgcolor: x },
|
|
27
|
+
...a && {
|
|
24
28
|
border: "1px solid",
|
|
25
|
-
borderColor:
|
|
29
|
+
borderColor: a
|
|
26
30
|
},
|
|
27
31
|
borderRadius: c ? 0 : "8px",
|
|
28
32
|
flexDirection: "row",
|
|
29
|
-
gap:
|
|
33
|
+
gap: p,
|
|
30
34
|
p: 16,
|
|
31
35
|
width: "100%"
|
|
32
36
|
},
|
|
33
|
-
children: [/* @__PURE__ */ r(
|
|
34
|
-
borderColor:
|
|
35
|
-
borderRadius:
|
|
36
|
-
shadow:
|
|
37
|
-
size:
|
|
38
|
-
children:
|
|
37
|
+
children: [/* @__PURE__ */ r(N, {
|
|
38
|
+
borderColor: m,
|
|
39
|
+
borderRadius: g,
|
|
40
|
+
shadow: u,
|
|
41
|
+
size: v,
|
|
42
|
+
children: f
|
|
39
43
|
}), /* @__PURE__ */ s(i, {
|
|
40
44
|
sx: {
|
|
41
45
|
gap: 2,
|
|
42
46
|
minWidth: 0
|
|
43
47
|
},
|
|
44
48
|
children: [
|
|
45
|
-
|
|
49
|
+
h && /* @__PURE__ */ r(o, {
|
|
46
50
|
color: "text.secondary",
|
|
47
51
|
truncate: !0,
|
|
48
52
|
variant: "caption",
|
|
49
|
-
children:
|
|
53
|
+
children: h
|
|
50
54
|
}),
|
|
51
55
|
/* @__PURE__ */ r(o, {
|
|
52
56
|
sx: { fontWeight: 700 },
|
|
53
57
|
truncate: !0,
|
|
54
|
-
variant:
|
|
55
|
-
children:
|
|
58
|
+
variant: j,
|
|
59
|
+
children: W
|
|
56
60
|
}),
|
|
57
61
|
e
|
|
58
62
|
]
|
|
@@ -61,7 +65,7 @@ var C = ({ amount: t, amountVariant: l = "text", background: n, bgcolor: h = "gr
|
|
|
61
65
|
});
|
|
62
66
|
};
|
|
63
67
|
export {
|
|
64
|
-
|
|
68
|
+
H as default
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
//# sourceMappingURL=MerchantHighlightCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MerchantHighlightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/MerchantHighlightCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport AmountPill from './AmountPill'\nimport LogoTile from './LogoTile'\n\ninterface MerchantHighlightCardProps {\n /** Brand/merchant logo visual (rendered inside a `LogoTile`). */\n logo: ReactNode\n /** Merchant/payee name. */\n name: ReactNode\n /** Optional label above the name (e.g. \"{Date}\"). */\n eyebrow?: ReactNode\n /** Amount. Rendered as a dark pill when `amountVariant='pill'`, else plain. */\n amount?: ReactNode\n /** How to render the amount. */\n amountVariant?: 'pill' | 'text'\n /** Typography variant for the name. Defaults to `h2` for `pill`, else `h3`. */\n nameVariant?: 'h2' | 'h3'\n /** Trailing element beneath the name (e.g. a `<StatusPill>`); replaces `amount`. */\n trailing?: ReactNode\n /** Card surface color token. */\n bgcolor?: string\n /** CSS background (e.g. a gradient) for the card surface; overrides `bgcolor`. */\n background?: string\n /** Card border color token (e.g. New Merchant's tinted card). */\n borderColor?: string\n /** Logo tile shadow (see `LogoTile`). Default offset. */\n logoShadow?: boolean | 'offset' | 'elevation'\n logoSize?: number\n logoBorderColor?: string | null\n logoRadius?: number\n /** Edge to edge: no side inset, square corners. */\n fullBleed?: boolean\n sx?: SxProps\n}\n\n/**\n * A merchant/brand highlight card: a `LogoTile` beside a text column (optional\n * eyebrow, name, amount/trailing). Shared by Peer-to-Peer Categorization, New\n * Merchant, and Monthly Subscription Aggregate V2's Visual state.\n */\nconst MerchantHighlightCard = ({\n amount,\n amountVariant = 'text',\n background,\n bgcolor = 'grey.200',\n borderColor,\n eyebrow,\n fullBleed = false,\n logo,\n logoBorderColor,\n logoRadius,\n logoShadow = true,\n logoSize,\n name,\n nameVariant,\n trailing,\n sx,\n}: MerchantHighlightCardProps) => {\n const resolvedNameVariant = nameVariant ?? (amountVariant === 'pill' ? 'h2' : 'h3')\n\n // `trailing` (e.g. a StatusPill) takes the amount's slot when provided;\n // otherwise render the amount as a dark pill or plain text.\n let amountNode: ReactNode = trailing\n if (amountNode == null && amount != null) {\n amountNode =\n amountVariant === 'pill' ? (\n <AmountPill
|
|
1
|
+
{"version":3,"file":"MerchantHighlightCard.es.js","names":[],"sources":["../../../src/insights-v2/components/MerchantHighlightCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport AmountPill from './AmountPill'\nimport LogoTile from './LogoTile'\nimport type { AmountPillProps } from './AmountPill'\n\ninterface MerchantHighlightCardProps {\n /** Brand/merchant logo visual (rendered inside a `LogoTile`). */\n logo: ReactNode\n /** Merchant/payee name. */\n name: ReactNode\n /** Optional label above the name (e.g. \"{Date}\"). */\n eyebrow?: ReactNode\n /** Amount. Rendered as a dark pill when `amountVariant='pill'`, else plain. */\n amount?: ReactNode\n /** How to render the amount. */\n amountVariant?: 'pill' | 'text'\n /** The amount pill's horizontal padding and text weight (see `AmountPill`). */\n amountPill?: Pick<AmountPillProps, 'px' | 'fontWeight'>\n /** Gap between the logo and the text column. Default 16. */\n gap?: number\n /** Typography variant for the name. Defaults to `h2` for `pill`, else `h3`. */\n nameVariant?: 'h2' | 'h3'\n /** Trailing element beneath the name (e.g. a `<StatusPill>`); replaces `amount`. */\n trailing?: ReactNode\n /** Card surface color token. */\n bgcolor?: string\n /** CSS background (e.g. a gradient) for the card surface; overrides `bgcolor`. */\n background?: string\n /** Card border color token (e.g. New Merchant's tinted card). */\n borderColor?: string\n /** Logo tile shadow (see `LogoTile`). Default offset. */\n logoShadow?: boolean | 'offset' | 'elevation'\n logoSize?: number\n logoBorderColor?: string | null\n logoRadius?: number\n /** Edge to edge: no side inset, square corners. */\n fullBleed?: boolean\n sx?: SxProps\n}\n\n/**\n * A merchant/brand highlight card: a `LogoTile` beside a text column (optional\n * eyebrow, name, amount/trailing). Shared by Peer-to-Peer Categorization, New\n * Merchant, and Monthly Subscription Aggregate V2's Visual state.\n */\nconst MerchantHighlightCard = ({\n amount,\n amountPill,\n amountVariant = 'text',\n background,\n bgcolor = 'grey.200',\n borderColor,\n eyebrow,\n fullBleed = false,\n gap = 16,\n logo,\n logoBorderColor,\n logoRadius,\n logoShadow = true,\n logoSize,\n name,\n nameVariant,\n trailing,\n sx,\n}: MerchantHighlightCardProps) => {\n const resolvedNameVariant = nameVariant ?? (amountVariant === 'pill' ? 'h2' : 'h3')\n\n // `trailing` (e.g. a StatusPill) takes the amount's slot when provided;\n // otherwise render the amount as a dark pill or plain text.\n let amountNode: ReactNode = trailing\n if (amountNode == null && amount != null) {\n amountNode =\n amountVariant === 'pill' ? (\n <AmountPill fontWeight={amountPill?.fontWeight} px={amountPill?.px}>\n {amount}\n </AmountPill>\n ) : (\n <Text color=\"text.secondary\" variant=\"body1\">\n {amount}\n </Text>\n )\n }\n\n return (\n <Stack sx={{ px: fullBleed ? 0 : 16, width: '100%', ...sx }}>\n <Stack\n sx={{\n alignItems: 'center',\n ...(background ? { background } : { bgcolor }),\n ...(borderColor && { border: '1px solid', borderColor }),\n borderRadius: fullBleed ? 0 : '8px',\n flexDirection: 'row',\n gap,\n p: 16,\n width: '100%',\n }}\n >\n <LogoTile\n borderColor={logoBorderColor}\n borderRadius={logoRadius}\n shadow={logoShadow}\n size={logoSize}\n >\n {logo}\n </LogoTile>\n <Stack sx={{ gap: 2, minWidth: 0 }}>\n {eyebrow && (\n <Text color=\"text.secondary\" truncate={true} variant=\"caption\">\n {eyebrow}\n </Text>\n )}\n {/* mxui's `bold` forces 600. */}\n <Text sx={{ fontWeight: 700 }} truncate={true} variant={resolvedNameVariant}>\n {name}\n </Text>\n {amountNode}\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default MerchantHighlightCard\n"],"mappings":";;;;;AAmDA,IAAM,IAAA,CAAyB,EAC7B,QAAA,GACA,YAAA,GACA,eAAA,IAAgB,QAChB,YAAA,GACA,SAAA,IAAU,YACV,aAAA,GACA,SAAA,GACA,WAAA,IAAY,IACZ,KAAA,IAAM,IACN,MAAA,GACA,iBAAA,GACA,YAAA,GACA,YAAA,IAAa,IACb,UAAA,GACA,MAAA,GACA,aAAA,GACA,UAAA,GACA,IAAA,EAAA,MACgC;AAChC,QAAM,IAAsB,MAAgB,MAAkB,SAAS,OAAO;AAI9E,MAAI,IAAwB;AAC5B,SAAI,KAAc,QAAQ,KAAU,SAClC,IACE,MAAkB,SAChB,gBAAA,EAAC,GAAD;AAAA,IAAY,YAAY,GAAY;AAAA,IAAY,IAAI,GAAY;AAAA,IAC7D,UAAA;AAAA,EACS,CAAA,IAEZ,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,SAAQ;AAAA,IAClC,UAAA;AAAA,EACG,CAAA,IAKV,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,IAAI,IAAY,IAAI;AAAA,MAAI,OAAO;AAAA,MAAQ,GAAG;AAAA,IAAG;AAAA,IACxD,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,GAAI,IAAa,EAAE,YAAA,EAAW,IAAI,EAAE,SAAA,EAAQ;AAAA,QAC5C,GAAI,KAAe;AAAA,UAAE,QAAQ;AAAA,UAAa,aAAA;AAAA,QAAY;AAAA,QACtD,cAAc,IAAY,IAAI;AAAA,QAC9B,eAAe;AAAA,QACf,KAAA;AAAA,QACA,GAAG;AAAA,QACH,OAAO;AAAA,MACT;AAAA,MAVF,UAAA,CAYE,gBAAA,EAAC,GAAD;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,MAAM;AAAA,QAEL,UAAA;AAAA,MACO,CAAA,GACV,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,KAAK;AAAA,UAAG,UAAU;AAAA,QAAE;AAAA,QAAjC,UAAA;AAAA,UACG,KACC,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,UAAU;AAAA,YAAM,SAAQ;AAAA,YAClD,UAAA;AAAA,UACG,CAAA;AAAA,UAGR,gBAAA,EAAC,GAAD;AAAA,YAAM,IAAI,EAAE,YAAY,IAAI;AAAA,YAAG,UAAU;AAAA,YAAM,SAAS;AAAA,YACrD,UAAA;AAAA,UACG,CAAA;AAAA,UACL;AAAA,QACI;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA;AAEX"}
|
|
@@ -11,7 +11,7 @@ export interface TransactionListProps {
|
|
|
11
11
|
isRowDisabled?: (t: Transaction) => boolean;
|
|
12
12
|
loader?: React.JSX.Element;
|
|
13
13
|
onClick?: (guid: string) => void;
|
|
14
|
-
/**
|
|
14
|
+
/** An opt-in trailing caption on each row's subline (see TransactionRow). */
|
|
15
15
|
renderAmountCaption?: (transaction: Transaction) => React.ReactNode;
|
|
16
16
|
/** Replaces each row's category subline (see TransactionRow); omitted, rows show the category. */
|
|
17
17
|
renderSecondaryText?: (transaction: Transaction) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionList.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionList.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { useVirtualizer } from '@tanstack/react-virtual'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useEvent,\n useGlobalCopyStore,\n VISUALLY_HIDDEN_SX,\n ZeroState,\n} from '../../../common'\nimport { type Transaction } from '../../../core'\n\nimport { useTransactionsUiStore } from '../../context/hooks'\nimport { useTransactionStore } from '../../../common'\n\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport TransactionRow from './transactionlist/TransactionRow'\n\nimport { hasInsetBorder, shouldShowDate } from '../../utils/Transactions'\nimport { fromUnixUTCToDayOfWeekAndDate } from '../../../core/utils/DateUtil'\n\nconst ROW_HEIGHT = 65\nconst DATE_ROW_HEIGHT = 32\n\nconst findScrollParent = (node: HTMLElement | null): HTMLElement | null => {\n for (let el = node?.parentElement; el; el = el.parentElement) {\n if (/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return el\n }\n return null\n}\n\nexport interface TransactionListProps {\n bgcolor?: string\n filter?: (t: Transaction) => boolean\n height?: number | string\n /**\n * Marks rows that stay in the list but cannot be acted on. Disabled rows are rendered greyed\n * out and inert instead of being removed, so list membership and ordering are unaffected.\n */\n isRowDisabled?: (t: Transaction) => boolean\n loader?: React.JSX.Element\n onClick?: (guid: string) => void\n /** A caption under each row's amount (see TransactionRow); omitted, the amount stands alone. */\n renderAmountCaption?: (transaction: Transaction) => React.ReactNode\n /** Replaces each row's category subline (see TransactionRow); omitted, rows show the category. */\n renderSecondaryText?: (transaction: Transaction) => React.ReactNode\n /** Virtualize against the nearest scrolling ancestor instead of an own fixed-height scroll box. */\n scrollsWithParent?: boolean\n /** Rendered above the rows; stays at the top of the scroll area when used with scrollsWithParent. */\n stickyHeader?: React.ReactNode\n showInsights?: boolean\n showLoader?: boolean\n showUnviewedIndicator?: boolean\n transaction?: Transaction[]\n width?: number | string\n zeroState?: React.JSX.Element\n}\n\nconst TransactionList: React.FC<TransactionListProps> = ({\n bgcolor,\n filter,\n height = 'calc(100dvh - 36px)',\n isRowDisabled,\n loader = <Loader label=\"Loading\" size={40} />,\n onClick,\n renderAmountCaption,\n renderSecondaryText,\n scrollsWithParent = false,\n showInsights = false,\n showLoader = false,\n showUnviewedIndicator = false,\n stickyHeader,\n transaction,\n width = '100%',\n zeroState = <ZeroState />,\n}) => {\n const { isLoading, sortedTransactions: allTransactions } = useTransactionStore()\n const transactions = React.useMemo(() => {\n const updatedTransactions = filter ? allTransactions.filter(filter) : allTransactions\n return transaction ?? updatedTransactions\n }, [allTransactions, filter, transaction])\n\n const { clearExpandedSplits, setShowInsights, toggleSplit } = useTransactionsUiStore()\n const { onEvent } = useEvent()\n const { common: commonCopy } = useGlobalCopyStore()\n const [pendingFocus, setPendingFocus] = React.useState<{ index: number; from: number } | null>(\n null,\n )\n\n const handleClick = (guid: string) => {\n const transaction = transactions.find((t) => t.guid === guid)\n\n if (transaction?.has_been_split) {\n toggleSplit(transaction.guid)\n return\n }\n\n onEvent(ANALYTICS_EVENTS.ACCOUNT_DETAILS_CLICK_TRANSACTION, {\n account_guid: transaction?.account_guid,\n transaction_guid: guid,\n })\n onClick?.(guid)\n }\n\n const parentRef = React.useRef<HTMLDivElement>(null)\n const hasStickyHeader = Boolean(stickyHeader)\n const [scrollParent, setScrollParent] = React.useState<HTMLElement | null>(null)\n const [scrollMargin, setScrollMargin] = React.useState(0)\n const headerRef = React.useRef<HTMLDivElement>(null)\n const [headerHeight, setHeaderHeight] = React.useState(0)\n\n React.useLayoutEffect(() => {\n if (!scrollsWithParent) return\n const list = parentRef.current\n if (!list) return\n // With no scrolling ancestor the list itself is the viewport, so every row renders.\n const scroller = findScrollParent(list) ?? list\n\n const measureOffset = () => {\n setScrollMargin(\n list.getBoundingClientRect().top -\n scroller.getBoundingClientRect().top +\n scroller.scrollTop,\n )\n setHeaderHeight(headerRef.current?.offsetHeight ?? 0)\n }\n\n setScrollParent(scroller)\n measureOffset()\n const observer = new ResizeObserver(measureOffset)\n observer.observe(scroller.firstElementChild ?? scroller)\n if (headerRef.current) observer.observe(headerRef.current)\n return () => observer.disconnect()\n }, [scrollsWithParent, hasStickyHeader])\n\n const rowVirtualizer = useVirtualizer({\n count: transactions.length,\n getScrollElement: () => (scrollsWithParent ? scrollParent : parentRef.current),\n estimateSize: (i) => ROW_HEIGHT + (shouldShowDate(i, transactions) ? DATE_ROW_HEIGHT : 0),\n overscan: 5,\n scrollMargin,\n scrollPaddingStart: headerHeight,\n })\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n const lastRenderedIndex = virtualItems.at(-1)?.index ?? -1\n const unrenderedCount = transactions.length - (lastRenderedIndex + 1)\n const isSettled = !isLoading && !showLoader\n const showRows = isSettled && virtualItems.length > 0\n // The total size comes from the row count, so a content-sized list has height before any row\n // is drawn. It is 0 only with no transactions, where the zero state needs 'auto'.\n const rowBoxHeight = rowVirtualizer.getTotalSize() || 'auto'\n\n // Screen reader reading modes do not scroll the list, so rows past the rendered window\n // are unreachable without this control.\n const showNextRows = () => {\n const nextIndex = lastRenderedIndex + 1\n rowVirtualizer.scrollToIndex(nextIndex, { align: 'start' })\n setPendingFocus({ index: nextIndex, from: lastRenderedIndex })\n }\n\n React.useEffect(() => {\n if (!pendingFocus) return\n const row = parentRef.current?.querySelector<HTMLElement>(\n `[data-index=\"${pendingFocus.index}\"]`,\n )\n row?.focus()\n // Give up once the window moves, so a missed row cannot take focus later.\n if (row || lastRenderedIndex !== pendingFocus.from) setPendingFocus(null)\n }, [pendingFocus, lastRenderedIndex])\n\n React.useEffect(() => rowVirtualizer.measure(), [transactions, scrollParent])\n React.useEffect(() => setShowInsights(showInsights), [showInsights])\n\n React.useEffect(() => {\n return () => clearExpandedSplits()\n }, [])\n\n return (\n <>\n {stickyHeader && (\n <Box\n ref={headerRef}\n sx={{\n bgcolor: 'background.paper',\n position: scrollsWithParent ? 'sticky' : undefined,\n top: 0,\n width,\n zIndex: 1,\n }}\n >\n {stickyHeader}\n </Box>\n )}\n <List component=\"div\" role=\"list\" sx={{ width: width }}>\n <Box\n height={scrollsWithParent ? undefined : height}\n overflow={scrollsWithParent ? undefined : 'auto'}\n ref={parentRef}\n role=\"presentation\"\n width={width}\n >\n <Box height={rowBoxHeight} position=\"relative\" role=\"presentation\" width=\"100%\">\n {!isSettled && loader}\n {isSettled && transactions.length === 0 && zeroState}\n {showRows &&\n virtualItems.map((row) => {\n const transaction = transactions[row.index]\n const showDate = shouldShowDate(row.index, transactions)\n const isInset = hasInsetBorder(row.index, transactions)\n const rowHeight = ROW_HEIGHT + (showDate ? DATE_ROW_HEIGHT : 0)\n\n return (\n <Box\n aria-posinset={row.index + 1}\n aria-setsize={transactions.length}\n data-index={row.index}\n key={transaction.guid}\n role=\"listitem\"\n tabIndex={-1}\n sx={{\n height: rowHeight,\n position: 'absolute',\n // Keeps a focused row from scrolling under the sticky header.\n scrollMarginTop: headerHeight,\n transform: `translateY(${row.start - scrollMargin}px)`,\n width: '100%',\n bgcolor: 'background.paper',\n }}\n >\n {showDate && (\n <SubheaderRow bgcolor={bgcolor}>\n {fromUnixUTCToDayOfWeekAndDate(transaction.date)}\n </SubheaderRow>\n )}\n <TransactionRow\n component=\"div\"\n disabled={isRowDisabled?.(transaction)}\n {...(onClick && { onClick: handleClick })}\n renderAmountCaption={renderAmountCaption}\n renderSecondaryText={renderSecondaryText}\n showUnviewedIndicator={showUnviewedIndicator}\n transaction={transaction}\n />\n <Divider sx={{ ml: isInset ? 68 : 0 }} />\n </Box>\n )\n })}\n </Box>\n </Box>\n </List>\n {showRows && unrenderedCount > 0 && (\n <Box\n component=\"button\"\n onClick={showNextRows}\n sx={VISUALLY_HIDDEN_SX}\n tabIndex={-1}\n type=\"button\"\n >\n {`${commonCopy.view_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AAA;AAAA,IACL,KAAY,IAAkB,KAC7B,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,MAAK;AAAA,MAEJ,UAAA,GAAG,EAAW,SAAA,KAAc,CAAA;AAAA,IAC1B,CAAA;AAAA,EAEP,EAAA,CAAA;AAEN,GAEA,KAAe,GAAS,EAAe"}
|
|
1
|
+
{"version":3,"file":"TransactionList.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionList.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { useVirtualizer } from '@tanstack/react-virtual'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useEvent,\n useGlobalCopyStore,\n VISUALLY_HIDDEN_SX,\n ZeroState,\n} from '../../../common'\nimport { type Transaction } from '../../../core'\n\nimport { useTransactionsUiStore } from '../../context/hooks'\nimport { useTransactionStore } from '../../../common'\n\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport TransactionRow from './transactionlist/TransactionRow'\n\nimport { hasInsetBorder, shouldShowDate } from '../../utils/Transactions'\nimport { fromUnixUTCToDayOfWeekAndDate } from '../../../core/utils/DateUtil'\n\nconst ROW_HEIGHT = 65\nconst DATE_ROW_HEIGHT = 32\n\nconst findScrollParent = (node: HTMLElement | null): HTMLElement | null => {\n for (let el = node?.parentElement; el; el = el.parentElement) {\n if (/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return el\n }\n return null\n}\n\nexport interface TransactionListProps {\n bgcolor?: string\n filter?: (t: Transaction) => boolean\n height?: number | string\n /**\n * Marks rows that stay in the list but cannot be acted on. Disabled rows are rendered greyed\n * out and inert instead of being removed, so list membership and ordering are unaffected.\n */\n isRowDisabled?: (t: Transaction) => boolean\n loader?: React.JSX.Element\n onClick?: (guid: string) => void\n /** An opt-in trailing caption on each row's subline (see TransactionRow). */\n renderAmountCaption?: (transaction: Transaction) => React.ReactNode\n /** Replaces each row's category subline (see TransactionRow); omitted, rows show the category. */\n renderSecondaryText?: (transaction: Transaction) => React.ReactNode\n /** Virtualize against the nearest scrolling ancestor instead of an own fixed-height scroll box. */\n scrollsWithParent?: boolean\n /** Rendered above the rows; stays at the top of the scroll area when used with scrollsWithParent. */\n stickyHeader?: React.ReactNode\n showInsights?: boolean\n showLoader?: boolean\n showUnviewedIndicator?: boolean\n transaction?: Transaction[]\n width?: number | string\n zeroState?: React.JSX.Element\n}\n\nconst TransactionList: React.FC<TransactionListProps> = ({\n bgcolor,\n filter,\n height = 'calc(100dvh - 36px)',\n isRowDisabled,\n loader = <Loader label=\"Loading\" size={40} />,\n onClick,\n renderAmountCaption,\n renderSecondaryText,\n scrollsWithParent = false,\n showInsights = false,\n showLoader = false,\n showUnviewedIndicator = false,\n stickyHeader,\n transaction,\n width = '100%',\n zeroState = <ZeroState />,\n}) => {\n const { isLoading, sortedTransactions: allTransactions } = useTransactionStore()\n const transactions = React.useMemo(() => {\n const updatedTransactions = filter ? allTransactions.filter(filter) : allTransactions\n return transaction ?? updatedTransactions\n }, [allTransactions, filter, transaction])\n\n const { clearExpandedSplits, setShowInsights, toggleSplit } = useTransactionsUiStore()\n const { onEvent } = useEvent()\n const { common: commonCopy } = useGlobalCopyStore()\n const [pendingFocus, setPendingFocus] = React.useState<{ index: number; from: number } | null>(\n null,\n )\n\n const handleClick = (guid: string) => {\n const transaction = transactions.find((t) => t.guid === guid)\n\n if (transaction?.has_been_split) {\n toggleSplit(transaction.guid)\n return\n }\n\n onEvent(ANALYTICS_EVENTS.ACCOUNT_DETAILS_CLICK_TRANSACTION, {\n account_guid: transaction?.account_guid,\n transaction_guid: guid,\n })\n onClick?.(guid)\n }\n\n const parentRef = React.useRef<HTMLDivElement>(null)\n const hasStickyHeader = Boolean(stickyHeader)\n const [scrollParent, setScrollParent] = React.useState<HTMLElement | null>(null)\n const [scrollMargin, setScrollMargin] = React.useState(0)\n const headerRef = React.useRef<HTMLDivElement>(null)\n const [headerHeight, setHeaderHeight] = React.useState(0)\n\n React.useLayoutEffect(() => {\n if (!scrollsWithParent) return\n const list = parentRef.current\n if (!list) return\n // With no scrolling ancestor the list itself is the viewport, so every row renders.\n const scroller = findScrollParent(list) ?? list\n\n const measureOffset = () => {\n setScrollMargin(\n list.getBoundingClientRect().top -\n scroller.getBoundingClientRect().top +\n scroller.scrollTop,\n )\n setHeaderHeight(headerRef.current?.offsetHeight ?? 0)\n }\n\n setScrollParent(scroller)\n measureOffset()\n const observer = new ResizeObserver(measureOffset)\n observer.observe(scroller.firstElementChild ?? scroller)\n if (headerRef.current) observer.observe(headerRef.current)\n return () => observer.disconnect()\n }, [scrollsWithParent, hasStickyHeader])\n\n const rowVirtualizer = useVirtualizer({\n count: transactions.length,\n getScrollElement: () => (scrollsWithParent ? scrollParent : parentRef.current),\n estimateSize: (i) => ROW_HEIGHT + (shouldShowDate(i, transactions) ? DATE_ROW_HEIGHT : 0),\n overscan: 5,\n scrollMargin,\n scrollPaddingStart: headerHeight,\n })\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n const lastRenderedIndex = virtualItems.at(-1)?.index ?? -1\n const unrenderedCount = transactions.length - (lastRenderedIndex + 1)\n const isSettled = !isLoading && !showLoader\n const showRows = isSettled && virtualItems.length > 0\n // The total size comes from the row count, so a content-sized list has height before any row\n // is drawn. It is 0 only with no transactions, where the zero state needs 'auto'.\n const rowBoxHeight = rowVirtualizer.getTotalSize() || 'auto'\n\n // Screen reader reading modes do not scroll the list, so rows past the rendered window\n // are unreachable without this control.\n const showNextRows = () => {\n const nextIndex = lastRenderedIndex + 1\n rowVirtualizer.scrollToIndex(nextIndex, { align: 'start' })\n setPendingFocus({ index: nextIndex, from: lastRenderedIndex })\n }\n\n React.useEffect(() => {\n if (!pendingFocus) return\n const row = parentRef.current?.querySelector<HTMLElement>(\n `[data-index=\"${pendingFocus.index}\"]`,\n )\n row?.focus()\n // Give up once the window moves, so a missed row cannot take focus later.\n if (row || lastRenderedIndex !== pendingFocus.from) setPendingFocus(null)\n }, [pendingFocus, lastRenderedIndex])\n\n React.useEffect(() => rowVirtualizer.measure(), [transactions, scrollParent])\n React.useEffect(() => setShowInsights(showInsights), [showInsights])\n\n React.useEffect(() => {\n return () => clearExpandedSplits()\n }, [])\n\n return (\n <>\n {stickyHeader && (\n <Box\n ref={headerRef}\n sx={{\n bgcolor: 'background.paper',\n position: scrollsWithParent ? 'sticky' : undefined,\n top: 0,\n width,\n zIndex: 1,\n }}\n >\n {stickyHeader}\n </Box>\n )}\n <List component=\"div\" role=\"list\" sx={{ width: width }}>\n <Box\n height={scrollsWithParent ? undefined : height}\n overflow={scrollsWithParent ? undefined : 'auto'}\n ref={parentRef}\n role=\"presentation\"\n width={width}\n >\n <Box height={rowBoxHeight} position=\"relative\" role=\"presentation\" width=\"100%\">\n {!isSettled && loader}\n {isSettled && transactions.length === 0 && zeroState}\n {showRows &&\n virtualItems.map((row) => {\n const transaction = transactions[row.index]\n const showDate = shouldShowDate(row.index, transactions)\n const isInset = hasInsetBorder(row.index, transactions)\n const rowHeight = ROW_HEIGHT + (showDate ? DATE_ROW_HEIGHT : 0)\n\n return (\n <Box\n aria-posinset={row.index + 1}\n aria-setsize={transactions.length}\n data-index={row.index}\n key={transaction.guid}\n role=\"listitem\"\n tabIndex={-1}\n sx={{\n height: rowHeight,\n position: 'absolute',\n // Keeps a focused row from scrolling under the sticky header.\n scrollMarginTop: headerHeight,\n transform: `translateY(${row.start - scrollMargin}px)`,\n width: '100%',\n bgcolor: 'background.paper',\n }}\n >\n {showDate && (\n <SubheaderRow bgcolor={bgcolor}>\n {fromUnixUTCToDayOfWeekAndDate(transaction.date)}\n </SubheaderRow>\n )}\n <TransactionRow\n component=\"div\"\n disabled={isRowDisabled?.(transaction)}\n {...(onClick && { onClick: handleClick })}\n renderAmountCaption={renderAmountCaption}\n renderSecondaryText={renderSecondaryText}\n showUnviewedIndicator={showUnviewedIndicator}\n transaction={transaction}\n />\n <Divider sx={{ ml: isInset ? 68 : 0 }} />\n </Box>\n )\n })}\n </Box>\n </Box>\n </List>\n {showRows && unrenderedCount > 0 && (\n <Box\n component=\"button\"\n onClick={showNextRows}\n sx={VISUALLY_HIDDEN_SX}\n tabIndex={-1}\n type=\"button\"\n >\n {`${commonCopy.view_more} (${unrenderedCount})`}\n </Box>\n )}\n </>\n )\n}\n\nexport default observer(TransactionList)\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,IAAa,IACb,IAAkB,IAElB,KAAA,CAAoB,MAAiD;AACzE,WAAS,IAAK,GAAM,eAAe,GAAI,IAAK,EAAG,cAC7C,KAAI,gBAAgB,KAAK,iBAAiB,CAAE,EAAE,SAAS,EAAG,QAAO;AAEnE,SAAO;AACT,GA6BM,KAAA,CAAmD,EACvD,SAAA,GACA,QAAA,GACA,QAAA,IAAS,uBACT,eAAA,GACA,QAAA,IAAS,gBAAA,EAAC,IAAD;AAAA,EAAQ,OAAM;AAAA,EAAU,MAAM;AAAK,CAAA,GAC5C,SAAA,GACA,qBAAA,GACA,qBAAA,GACA,mBAAA,IAAoB,IACpB,cAAA,IAAe,IACf,YAAA,IAAa,IACb,uBAAA,IAAwB,IACxB,cAAA,GACA,aAAA,GACA,OAAA,IAAQ,QACR,WAAA,IAAY,gBAAA,EAAC,IAAD,CAAY,CAAA,EAAA,MACpB;AACJ,QAAM,EAAE,WAAA,GAAW,oBAAoB,EAAA,IAAoB,GAAoB,GACzE,IAAe,EAAM,QAAA,MAAc;AACvC,UAAM,IAAsB,IAAS,EAAgB,OAAO,CAAM,IAAI;AACtE,WAAO,KAAe;AAAA,EACxB,GAAG;AAAA,IAAC;AAAA,IAAiB;AAAA,IAAQ;AAAA,EAAW,CAAC,GAEnC,EAAE,qBAAA,GAAqB,iBAAA,GAAiB,aAAA,EAAA,IAAgB,GAAuB,GAC/E,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,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BAAA;AAAA,oBACV,aAAA;AAAA,kBACd,CAAA;AAAA,kBACD,gBAAA,EAAC,IAAD,EAAS,IAAI,EAAE,IAAI,IAAU,KAAK,EAAE,EAAI,CAAA;AAAA,gBACrC;AAAA,cA5BE,GAAA,EAAY,IA4Bd;AAAA,YAET,CAAC;AAAA,UACA;AAAA;MACF,CAAA;AAAA,IACD,CAAA;AAAA,IACL,KAAY,IAAkB,KAC7B,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,MAAK;AAAA,MAEJ,UAAA,GAAG,EAAW,SAAA,KAAc,CAAA;AAAA,IAC1B,CAAA;AAAA,EAEP,EAAA,CAAA;AAEN,GAEA,KAAe,GAAS,EAAe"}
|
|
@@ -5,7 +5,7 @@ interface TransactionRowProps {
|
|
|
5
5
|
/** Shows the row greyed out and inert (see {@link ListItemWrapper}). */
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
onClick?: (guid: string) => void;
|
|
8
|
-
/** An opt-in caption
|
|
8
|
+
/** An opt-in trailing caption on the subline (a subscription's frequency); other lists pass none. */
|
|
9
9
|
renderAmountCaption?: (transaction: Transaction) => React.ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* Replaces the category subline (the status icons and insight tag stay). Opt-in for one drawer's
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useGlobalCopyStore as N, useTransactionStore as
|
|
2
|
-
import { TransactionType as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { isTransferTransaction as
|
|
5
|
-
import { ListItemWrapper as
|
|
6
|
-
import { useTransactionsUiStore as
|
|
7
|
-
import { ON_CLICK_EVENTS as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { observer as
|
|
1
|
+
import { useGlobalCopyStore as N, useTransactionStore as L } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { TransactionType as E } from "../../../../core/types/Transaction.es.js";
|
|
3
|
+
import { formatCurrency as R } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { isTransferTransaction as j, isUnviewedTransaction as M } from "../../../../core/utils/TransactionUtils.es.js";
|
|
5
|
+
import { ListItemWrapper as z } from "../../../../common/components/ListItemWrapper.es.js";
|
|
6
|
+
import { useTransactionsUiStore as _ } from "../../../context/hooks.es.js";
|
|
7
|
+
import { ON_CLICK_EVENTS as A } from "../../../constants/OnClickEvents.es.js";
|
|
8
|
+
import G from "../TransactionInsightTag.es.js";
|
|
9
|
+
import O from "../UnviewedIndicator.es.js";
|
|
10
|
+
import T from "react";
|
|
11
|
+
import { observer as U } from "mobx-react-lite";
|
|
12
12
|
import n from "@mui/material/Stack";
|
|
13
|
-
import { Icon as d, MerchantLogo as
|
|
13
|
+
import { Icon as d, MerchantLogo as B, Text as m } from "@mxenabled/mxui";
|
|
14
14
|
import { jsx as i, jsxs as t } from "react/jsx-runtime";
|
|
15
|
-
import { useTheme as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
var F = ({ transaction: e, disabled:
|
|
19
|
-
const
|
|
15
|
+
import { useTheme as D } from "@mui/material/styles";
|
|
16
|
+
import K from "@mui/material/ListItemAvatar";
|
|
17
|
+
import W from "@mui/material/ListItemText";
|
|
18
|
+
var F = ({ transaction: e, disabled: y = !1, onClick: l, component: c, renderSecondaryText: p, renderAmountCaption: x, showUnviewedIndicator: I = !1 }) => {
|
|
19
|
+
const b = D().palette.mode === "dark", { associatedBeats: u } = L(), { expandedSplits: v } = _(), { transactions: w } = N(), { showInsights: f } = _(), g = e.transaction_type === E.CREDIT, h = x?.(e), C = j(e) && !!e.institutionName, a = T.useMemo(() => u.find((r) => r.associated_transaction_guid === e.guid), [u, e]), S = (r, s) => {
|
|
20
20
|
const o = [];
|
|
21
21
|
return r.is_flagged && o.push(/* @__PURE__ */ i(d, {
|
|
22
22
|
fill: !0,
|
|
@@ -29,21 +29,21 @@ var F = ({ transaction: e, disabled: h = !1, onClick: m, component: l, renderSec
|
|
|
29
29
|
}, "hidden")), r.has_been_split && o.push(/* @__PURE__ */ i(d, {
|
|
30
30
|
name: "call_split",
|
|
31
31
|
size: 16
|
|
32
|
-
}, "split")),
|
|
33
|
-
},
|
|
34
|
-
return /* @__PURE__ */ t(
|
|
35
|
-
clickEventName:
|
|
36
|
-
...
|
|
37
|
-
disabled:
|
|
38
|
-
onClick:
|
|
32
|
+
}, "split")), I && M(r) && o.push(/* @__PURE__ */ i(O, {}, "unviewed")), o;
|
|
33
|
+
}, k = (r, s) => r.is_hidden ? s.is_excluded : r.has_been_split ? s.split_transaction_category_label : r.category || "";
|
|
34
|
+
return /* @__PURE__ */ t(z, {
|
|
35
|
+
clickEventName: A.ON_TRANSACTION_LIST_ITEM_CLICK,
|
|
36
|
+
...c && { component: c },
|
|
37
|
+
disabled: y,
|
|
38
|
+
onClick: l ? () => l(e.guid) : void 0,
|
|
39
39
|
sx: e.is_hidden ? {
|
|
40
40
|
backgroundColor: "grey.50",
|
|
41
41
|
color: "text.secondary"
|
|
42
42
|
} : void 0,
|
|
43
|
-
children: [/* @__PURE__ */ i(
|
|
43
|
+
children: [/* @__PURE__ */ i(K, { children: e.parent_guid && v.includes(e.parent_guid) ? /* @__PURE__ */ i(T.Fragment, {}) : /* @__PURE__ */ i(B, {
|
|
44
44
|
categoryGuid: e.top_level_category_guid || "",
|
|
45
45
|
merchantGuid: e.merchant_guid || ""
|
|
46
|
-
}) }), /* @__PURE__ */ i(
|
|
46
|
+
}) }), /* @__PURE__ */ i(W, {
|
|
47
47
|
disableTypography: !0,
|
|
48
48
|
secondary: /* @__PURE__ */ t(n, {
|
|
49
49
|
direction: "row",
|
|
@@ -52,40 +52,45 @@ var F = ({ transaction: e, disabled: h = !1, onClick: m, component: l, renderSec
|
|
|
52
52
|
alignItems: "center",
|
|
53
53
|
direction: "row",
|
|
54
54
|
gap: 4,
|
|
55
|
-
|
|
55
|
+
sx: { minWidth: 0 },
|
|
56
|
+
children: [S(e, b), p ? p(e) : /* @__PURE__ */ i(m, {
|
|
56
57
|
truncate: !0,
|
|
57
58
|
variant: "caption",
|
|
58
|
-
children:
|
|
59
|
+
children: k(e, w)
|
|
59
60
|
})]
|
|
60
|
-
}),
|
|
61
|
+
}), (a && f || h != null) && /* @__PURE__ */ t(n, {
|
|
62
|
+
direction: "row",
|
|
63
|
+
sx: {
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
flexShrink: 0,
|
|
66
|
+
gap: 8,
|
|
67
|
+
pl: 8
|
|
68
|
+
},
|
|
69
|
+
children: [a && f && /* @__PURE__ */ i(G, { beat: a }), h]
|
|
70
|
+
})]
|
|
61
71
|
}),
|
|
62
72
|
children: /* @__PURE__ */ t(n, {
|
|
63
73
|
direction: "row",
|
|
64
74
|
justifyContent: "space-between",
|
|
65
75
|
sx: { gap: 8 },
|
|
66
|
-
children: [/* @__PURE__ */ i(
|
|
76
|
+
children: [/* @__PURE__ */ i(m, {
|
|
67
77
|
bold: !0,
|
|
68
78
|
truncate: !0,
|
|
69
79
|
variant: "body1",
|
|
70
|
-
children:
|
|
71
|
-
}), /* @__PURE__ */ t(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
children: [
|
|
77
|
-
bold: !0,
|
|
78
|
-
color: u ? "success.main" : "text.primary",
|
|
79
|
-
variant: "body1",
|
|
80
|
-
children: [u ? "+" : "", E(e.amount, "0,0.00")]
|
|
81
|
-
}), T?.(e)]
|
|
80
|
+
children: C ? e.institutionName : e.payee || e.description || e.feed_description
|
|
81
|
+
}), /* @__PURE__ */ t(m, {
|
|
82
|
+
bold: !0,
|
|
83
|
+
color: g ? "success.main" : "text.primary",
|
|
84
|
+
sx: { flexShrink: 0 },
|
|
85
|
+
variant: "body1",
|
|
86
|
+
children: [g ? "+" : "", R(e.amount, "0,0.00")]
|
|
82
87
|
})]
|
|
83
88
|
})
|
|
84
89
|
})]
|
|
85
90
|
});
|
|
86
|
-
},
|
|
91
|
+
}, ae = U(F);
|
|
87
92
|
export {
|
|
88
|
-
|
|
93
|
+
ae as default
|
|
89
94
|
};
|
|
90
95
|
|
|
91
96
|
//# sourceMappingURL=TransactionRow.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionRow.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactionlist/TransactionRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Icon, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { ListItemWrapper, useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { Transaction, TransactionType } from '../../../../core'\nimport {\n isTransferTransaction,\n isUnviewedTransaction,\n} from '../../../../core/utils/TransactionUtils'\n\nimport TransactionInsightTag from '../TransactionInsightTag'\nimport UnviewedIndicator from '../UnviewedIndicator'\n\nimport { ON_CLICK_EVENTS } from '../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../context/hooks'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\ninterface TransactionRowProps {\n component?: React.ElementType\n /** Shows the row greyed out and inert (see {@link ListItemWrapper}). */\n disabled?: boolean\n onClick?: (guid: string) => void\n /** An opt-in caption
|
|
1
|
+
{"version":3,"file":"TransactionRow.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactionlist/TransactionRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Icon, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { ListItemWrapper, useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { Transaction, TransactionType } from '../../../../core'\nimport {\n isTransferTransaction,\n isUnviewedTransaction,\n} from '../../../../core/utils/TransactionUtils'\n\nimport TransactionInsightTag from '../TransactionInsightTag'\nimport UnviewedIndicator from '../UnviewedIndicator'\n\nimport { ON_CLICK_EVENTS } from '../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../context/hooks'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\ninterface TransactionRowProps {\n component?: React.ElementType\n /** Shows the row greyed out and inert (see {@link ListItemWrapper}). */\n disabled?: boolean\n onClick?: (guid: string) => void\n /** An opt-in trailing caption on the subline (a subscription's frequency); other lists pass none. */\n renderAmountCaption?: (transaction: Transaction) => React.ReactNode\n /**\n * Replaces the category subline (the status icons and insight tag stay). Opt-in for one drawer's\n * rows, e.g. the Insights 2.0 summary-header drawer's account subline; every other list keeps the category.\n */\n renderSecondaryText?: (transaction: Transaction) => React.ReactNode\n /** Only the Transactions widget marks a transaction viewed, so other widgets leave this off. */\n showUnviewedIndicator?: boolean\n transaction: Transaction\n}\n\nconst TransactionRow: React.FC<TransactionRowProps> = ({\n transaction,\n disabled = false,\n onClick,\n component,\n renderSecondaryText,\n renderAmountCaption,\n showUnviewedIndicator = false,\n}) => {\n const theme = useTheme()\n const isDarkMode = theme.palette.mode === 'dark'\n\n const { associatedBeats } = useTransactionStore()\n const { expandedSplits } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n const { showInsights } = useTransactionsUiStore()\n\n const isCredit = transaction.transaction_type === TransactionType.CREDIT\n const amountCaption = renderAmountCaption?.(transaction)\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n const getTransactionStatusIcons = (\n transaction: Transaction,\n isDarkMode: boolean,\n ): React.ReactNode[] => {\n const icons: React.ReactNode[] = []\n\n if (transaction.is_flagged) {\n icons.push(\n <Icon\n fill={true}\n key=\"flag\"\n name=\"flag\"\n size={16}\n sx={{ color: isDarkMode ? 'primary.main' : 'warning.dark' }}\n />,\n )\n }\n\n if (transaction.is_hidden) {\n icons.push(<Icon key=\"hidden\" name=\"visibility_off\" size={16} />)\n }\n\n if (transaction.has_been_split) {\n icons.push(<Icon key=\"split\" name=\"call_split\" size={16} />)\n }\n\n if (showUnviewedIndicator && isUnviewedTransaction(transaction)) {\n icons.push(<UnviewedIndicator key=\"unviewed\" />)\n }\n\n return icons\n }\n\n const getTransactionCategoryText = (transaction: Transaction, copy: any): string => {\n if (transaction.is_hidden) {\n return copy.is_excluded\n }\n\n if (transaction.has_been_split) {\n return copy.split_transaction_category_label\n }\n\n return transaction.category || ''\n }\n\n return (\n //TODO: implement common/components/ListItemRow.tsx\n <ListItemWrapper\n clickEventName={ON_CLICK_EVENTS.ON_TRANSACTION_LIST_ITEM_CLICK}\n {...(component && { component })}\n disabled={disabled}\n onClick={onClick ? () => onClick(transaction.guid) : undefined}\n sx={\n transaction.is_hidden ? { backgroundColor: 'grey.50', color: 'text.secondary' } : undefined\n }\n >\n <ListItemAvatar>\n {transaction.parent_guid && expandedSplits.includes(transaction.parent_guid) ? (\n <React.Fragment />\n ) : (\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n />\n )}\n </ListItemAvatar>\n <ListItemText\n disableTypography={true}\n secondary={\n <Stack direction=\"row\" justifyContent=\"space-between\">\n <Stack alignItems=\"center\" direction=\"row\" gap={4} sx={{ minWidth: 0 }}>\n {getTransactionStatusIcons(transaction, isDarkMode)}\n {renderSecondaryText ? (\n renderSecondaryText(transaction)\n ) : (\n <Text truncate={true} variant=\"caption\">\n {getTransactionCategoryText(transaction, copy)}\n </Text>\n )}\n </Stack>\n {((beat && showInsights) || amountCaption != null) && (\n <Stack direction=\"row\" sx={{ alignItems: 'center', flexShrink: 0, gap: 8, pl: 8 }}>\n {beat && showInsights && <TransactionInsightTag beat={beat} />}\n {amountCaption}\n </Stack>\n )}\n </Stack>\n }\n >\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ gap: 8 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {showInstitution\n ? transaction.institutionName\n : transaction.payee || transaction.description || transaction.feed_description}\n </Text>\n <Text\n bold={true}\n color={isCredit ? 'success.main' : 'text.primary'}\n sx={{ flexShrink: 0 }}\n variant=\"body1\"\n >\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </Text>\n </Stack>\n </ListItemText>\n </ListItemWrapper>\n )\n}\n\nexport default observer(TransactionRow)\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,IAAM,IAAA,CAAiD,EACrD,aAAA,GACA,UAAA,IAAW,IACX,SAAA,GACA,WAAA,GACA,qBAAA,GACA,qBAAA,GACA,uBAAA,IAAwB,GAAA,MACpB;AAEJ,QAAM,IADQ,EACK,EAAM,QAAQ,SAAS,QAEpC,EAAE,iBAAA,EAAA,IAAoB,EAAoB,GAC1C,EAAE,gBAAA,EAAA,IAAmB,EAAuB,GAC5C,EAAE,cAAc,EAAA,IAAS,EAAmB,GAC5C,EAAE,cAAA,EAAA,IAAiB,EAAuB,GAE1C,IAAW,EAAY,qBAAqB,EAAgB,QAC5D,IAAgB,IAAsB,CAAW,GAEjD,IAAkB,EAAsB,CAAW,KAAK,EAAQ,EAAY,iBAE5E,IAAO,EAAM,QAAA,MACV,EAAgB,KAAA,CAAM,MAAS,EAAK,gCAAgC,EAAY,IAAI,GAC1F,CAAC,GAAiB,CAAW,CAAC,GAE3B,IAAA,CACJ,GACA,MACsB;AACtB,UAAM,IAA2B,CAAC;AAElC,WAAI,EAAY,cACd,EAAM,KACJ,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MAEN,MAAK;AAAA,MACL,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,IAAa,iBAAiB,eAAe;AAAA,IAC3D,GAJK,MAIL,CACH,GAGE,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