@mx-cartographer/experiences 9.7.165 → 9.7.167
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 +13 -0
- package/dist/common/components/dialog/Dialog.es.js +26 -29
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -2
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +1 -5
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +53 -58
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +92 -99
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +72 -81
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +5 -6
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +16 -16
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +4 -32
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +59 -83
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +8 -7
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +4 -3
- package/dist/insights-v2/components/celebrationGradients.es.js +14 -14
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +0 -1
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +51 -49
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map +1 -1
- package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js +25 -23
- package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [9.7.167] - 11-16-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Shared dialog titles are read by screen readers and wrap instead of being cut off, and dialogs use the paper background (WELL-202)
|
|
4
|
+
|
|
5
|
+
## [9.7.166] - 11-16-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - Save Enough to Live On: 8px corners on the card table and the Make Transfer drawer's bottom card (WEC-2330)
|
|
8
|
+
- **CHANGED** - The Make Transfer drawer (Save Enough to Live On, Save an Extra $100) uses the default back arrow, not a close X (WEC-2330)
|
|
9
|
+
- **FIXED** - Switch Direct Deposit's default card wash is at Figma's 127° (WEC-2330)
|
|
10
|
+
- **FIXED** - Upcoming Bill's drawer tip has no close button (WEC-2330)
|
|
11
|
+
- **CHANGED** - Upcoming Bill's drawer shows only the paid bills and opens on the latest (WEC-2330)
|
|
12
|
+
- **REMOVED** - Upcoming Bill's projected-bill tab and its "Projected amount" row, and the unused `projected_amount` field of the insights feed copy type (WEC-2330)
|
|
13
|
+
|
|
1
14
|
## [9.7.165] - 11-16-2026
|
|
2
15
|
|
|
3
16
|
- **CHANGED** - Insights 2.0 action block registry entries declare the data their block waits for; the shared runner shows the loader and the error card with Try Again instead of each block checking its own (WEC-2262)
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import { useScreenSize as
|
|
2
|
-
import { useFocusReturn as
|
|
3
|
-
import
|
|
4
|
-
import { DialogFooter as
|
|
5
|
-
import { jsx as o, jsxs as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
var G = ({ className: l, copy:
|
|
9
|
-
const { sx: a, ...
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
t && t(),
|
|
1
|
+
import { useScreenSize as W } from "../../hooks/useScreenSize.es.js";
|
|
2
|
+
import { useFocusReturn as j } from "../../hooks/useFocusReturn.es.js";
|
|
3
|
+
import v from "react";
|
|
4
|
+
import { DialogFooter as z, DialogHeader as H } from "@mxenabled/mxui";
|
|
5
|
+
import { jsx as o, jsxs as I } from "react/jsx-runtime";
|
|
6
|
+
import _ from "@mui/material/Dialog";
|
|
7
|
+
import C from "@mui/material/DialogContent";
|
|
8
|
+
var G = ({ className: l, copy: r, disablePrimaryButton: n = !1, showActions: m = !0, isOpen: e = !1, onClose: i, onPrimaryAction: c, primaryColor: d = "primary", primaryText: f = "Confirm", returnFocusTo: p, onSecondaryAction: t, secondaryColor: x = "primary", secondaryText: u = "Cancel", children: g, ...h }) => {
|
|
9
|
+
const { sx: a, ...b } = h, y = r?.title ?? "", D = r?.close_aria ?? "Close", s = v.useId(), { isSmallMobile: S } = W(), { onExited: P, onFocus: A, rootRef: F } = j(e, p), R = () => {
|
|
10
|
+
c?.(), i();
|
|
11
|
+
}, M = () => {
|
|
12
|
+
t && t(), i();
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ o("div", {
|
|
15
15
|
className: `mx-cmn-dialog ${l}`,
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ I(_, {
|
|
17
17
|
"aria-labelledby": s,
|
|
18
18
|
maxWidth: "xs",
|
|
19
|
-
onClose:
|
|
19
|
+
onClose: i,
|
|
20
20
|
open: e,
|
|
21
21
|
sx: [{
|
|
22
|
-
"& .MuiDialog-paperScrollPaper": { backgroundColor: "background.default" },
|
|
23
22
|
...S && { "& .MuiDialog-paper": { minWidth: "100%" } },
|
|
24
23
|
height: "100%"
|
|
25
24
|
}, ...a ? [a] : []],
|
|
26
|
-
...
|
|
25
|
+
...b,
|
|
27
26
|
disableRestoreFocus: !0,
|
|
28
27
|
onFocus: A,
|
|
29
28
|
ref: F,
|
|
30
29
|
slotProps: { transition: { onExited: P } },
|
|
31
30
|
children: [
|
|
32
|
-
/* @__PURE__ */ o(
|
|
33
|
-
ariaHidden: !0,
|
|
31
|
+
/* @__PURE__ */ o(H, {
|
|
34
32
|
copy: {
|
|
35
|
-
title:
|
|
36
|
-
close_aria:
|
|
33
|
+
title: y,
|
|
34
|
+
close_aria: D
|
|
37
35
|
},
|
|
38
36
|
id: s,
|
|
39
|
-
onClose:
|
|
40
|
-
truncate: !0
|
|
37
|
+
onClose: i
|
|
41
38
|
}),
|
|
42
|
-
/* @__PURE__ */ o(
|
|
39
|
+
/* @__PURE__ */ o(C, {
|
|
43
40
|
sx: {
|
|
44
41
|
boxSizing: "border-box",
|
|
45
42
|
lineHeight: 1.5,
|
|
@@ -47,14 +44,14 @@ var G = ({ className: l, copy: i, disablePrimaryButton: n = !1, showActions: c =
|
|
|
47
44
|
},
|
|
48
45
|
children: g
|
|
49
46
|
}),
|
|
50
|
-
|
|
47
|
+
m && /* @__PURE__ */ o(z, {
|
|
51
48
|
isPrimaryDisabled: n,
|
|
52
|
-
onPrimaryAction:
|
|
53
|
-
onSecondaryAction:
|
|
49
|
+
onPrimaryAction: R,
|
|
50
|
+
onSecondaryAction: M,
|
|
54
51
|
primaryColor: d,
|
|
55
|
-
primaryText:
|
|
56
|
-
secondaryColor:
|
|
57
|
-
secondaryText:
|
|
52
|
+
primaryText: f,
|
|
53
|
+
secondaryColor: x,
|
|
54
|
+
secondaryText: u
|
|
58
55
|
})
|
|
59
56
|
]
|
|
60
57
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n
|
|
1
|
+
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen, returnFocusTo)\n\n const handlePrimaryAction = () => {\n onPrimaryAction?.()\n onClose()\n }\n\n const handleSecondaryAction = () => {\n if (onSecondaryAction) {\n onSecondaryAction()\n }\n onClose()\n }\n\n return (\n <div className={`mx-cmn-dialog ${className}`}>\n <MuiDialog\n aria-labelledby={titleId}\n maxWidth=\"xs\"\n onClose={onClose}\n open={isOpen}\n sx={\n [\n {\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n height: '100%',\n },\n ...(restSx ? [restSx] : []),\n ] as SxProps\n }\n {...restProps}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{ transition: { onExited } }}\n >\n {/* Do not aria-hide the heading: JAWS then reads no dialog name. */}\n <DialogHeader copy={{ title, close_aria: closeAria }} id={titleId} onClose={onClose} />\n\n <DialogContent sx={{ boxSizing: 'border-box', lineHeight: 1.5, maxWidth: '100%' }}>\n {children}\n </DialogContent>\n\n {showActions && (\n <DialogFooter\n isPrimaryDisabled={disablePrimaryButton}\n onPrimaryAction={handlePrimaryAction}\n onSecondaryAction={handleSecondaryAction}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </MuiDialog>\n </div>\n )\n}\n\nexport default Dialog\n"],"mappings":";;;;;;;AA2CA,IAAM,IAAA,CAA0D,EAC9D,WAAA,GACA,MAAA,GACA,sBAAA,IAAuB,IACvB,aAAA,IAAc,IACd,QAAA,IAAS,IACT,SAAA,GACA,iB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AK,UAAU;AAAA,UAAO;AAAA,UAC7E,UAAA;AAAA,QACY,CAAA;AAAA,QAEd,KACC,gBAAA,EAAC,GAAD;AAAA,UACE,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,UACjB,mBAAmB;AAAA,UACL,cAAA;AAAA,UACD,aAAA;AAAA,UACG,gBAAA;AAAA,UACD,eAAA;AAAA,QAChB,CAAA;AAAA,MAEM;AAAA;EACR,CAAA;AAET"}
|
|
@@ -16,8 +16,6 @@ export interface GeneralInsightsFeedCopy {
|
|
|
16
16
|
new_information_available: string;
|
|
17
17
|
tip_section_message: string;
|
|
18
18
|
tip_section_title: string;
|
|
19
|
-
/** Heads Upcoming Bill's projected-bill row in its drawer (legacy pulse's "PROJECTED AMOUNT"). */
|
|
20
|
-
projected_amount?: string;
|
|
21
19
|
transaction_history_title: string;
|
|
22
20
|
transaction_details_title: string;
|
|
23
21
|
/** Transaction-count pill (`_1{count}`); optional until mrs_content ships it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveEnoughToLiveOnBottomSection.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { type SxProps } from '@mui/material/styles'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Image } from '../../components/shared/images/SaveEnoughToLiveOnBottom.svg'\nimport { ThemedSVGImage } from '../../components/chartblocks/ThemedSVGImage'\n\nconst ROW_STYLES = {\n alignItems: 'center',\n flexDirection: 'row',\n height: 40,\n justifyContent: 'space-between',\n px: 16,\n py: 2,\n}\n\ninterface BalanceRowProps {\n label: string\n value: string\n withBorder?: boolean\n}\n\nconst BalanceRow = ({ label, value, withBorder = false }: BalanceRowProps) => (\n <Stack\n sx={{\n ...ROW_STYLES,\n ...(withBorder && {\n borderBottom: '1px solid',\n borderColor: 'divider',\n }),\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} variant=\"body2\">\n {value}\n </Text>\n </Stack>\n)\n\ninterface SaveEnoughToLiveOnBottomSectionProps {\n content: string\n leftLabel: string\n leftValue: string\n rightLabel: string\n rightValue: string\n sx?: SxProps\n}\n\nconst SaveEnoughToLiveOnBottomSection = ({\n content,\n leftLabel,\n leftValue,\n rightLabel,\n rightValue,\n sx,\n}: SaveEnoughToLiveOnBottomSectionProps) => (\n <Stack sx={{ alignItems: 'center', gap: 12 }}>\n <Box sx={{ display: 'grid', placeItems: 'center' }}>\n <ThemedSVGImage\n divProps={{ style: { height: 'auto', gridArea: '1 / 1', lineHeight: 0 } }}\n image={Image}\n />\n <H2 sx={{ color: 'neutral.contrastText', gridArea: '1 / 1', textAlign: 'center' }}>\n {content}\n </H2>\n </Box>\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius:
|
|
1
|
+
{"version":3,"file":"SaveEnoughToLiveOnBottomSection.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { type SxProps } from '@mui/material/styles'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Image } from '../../components/shared/images/SaveEnoughToLiveOnBottom.svg'\nimport { ThemedSVGImage } from '../../components/chartblocks/ThemedSVGImage'\n\nconst ROW_STYLES = {\n alignItems: 'center',\n flexDirection: 'row',\n height: 40,\n justifyContent: 'space-between',\n px: 16,\n py: 2,\n}\n\ninterface BalanceRowProps {\n label: string\n value: string\n withBorder?: boolean\n}\n\nconst BalanceRow = ({ label, value, withBorder = false }: BalanceRowProps) => (\n <Stack\n sx={{\n ...ROW_STYLES,\n ...(withBorder && {\n borderBottom: '1px solid',\n borderColor: 'divider',\n }),\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} variant=\"body2\">\n {value}\n </Text>\n </Stack>\n)\n\ninterface SaveEnoughToLiveOnBottomSectionProps {\n content: string\n leftLabel: string\n leftValue: string\n rightLabel: string\n rightValue: string\n sx?: SxProps\n}\n\nconst SaveEnoughToLiveOnBottomSection = ({\n content,\n leftLabel,\n leftValue,\n rightLabel,\n rightValue,\n sx,\n}: SaveEnoughToLiveOnBottomSectionProps) => (\n <Stack sx={{ alignItems: 'center', gap: 12 }}>\n <Box sx={{ display: 'grid', placeItems: 'center' }}>\n <ThemedSVGImage\n divProps={{ style: { height: 'auto', gridArea: '1 / 1', lineHeight: 0 } }}\n image={Image}\n />\n <H2 sx={{ color: 'neutral.contrastText', gridArea: '1 / 1', textAlign: 'center' }}>\n {content}\n </H2>\n </Box>\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: 2,\n width: 288,\n ...sx,\n }}\n >\n <BalanceRow label={leftLabel} value={leftValue} withBorder={true} />\n <BalanceRow label={rightLabel} value={rightValue} />\n </Stack>\n </Stack>\n)\n\nexport default SaveEnoughToLiveOnBottomSection\n"],"mappings":";;;;;;AAUA,IAAM,IAAa;AAAA,EACjB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GAQM,IAAA,CAAc,EAAE,OAAA,GAAO,OAAA,GAAO,YAAA,IAAa,GAAA,MAC/C,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,GAAG;AAAA,IACH,GAAI,KAAc;AAAA,MAChB,cAAc;AAAA,MACd,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,SAAQ;AAAA,IAClC,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,SAAQ;AAAA,IACvB,UAAA;AAAA,EACG,CAAA,CACD;IAYH,IAAA,CAAmC,EACvC,SAAA,GACA,WAAA,GACA,WAAA,GACA,YAAA,GACA,YAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,KAAK;AAAA,EAAG;AAAA,EAA3C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,SAAS;AAAA,MAAQ,YAAY;AAAA,IAAS;AAAA,IAAjD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,UAAU,EAAE,OAAO;AAAA,QAAE,QAAQ;AAAA,QAAQ,UAAU;AAAA,QAAS,YAAY;AAAA,MAAE,EAAE;AAAA,MACxE,OAAO;AAAA,IACR,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MAAI,IAAI;AAAA,QAAE,OAAO;AAAA,QAAwB,UAAU;AAAA,QAAS,WAAW;AAAA,MAAS;AAAA,MAC7E,UAAA;AAAA,IACC,CAAA,CACD;AAAA,EACL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,MAAY,OAAO;AAAA,MAAW,OAAO;AAAA,MAAW,YAAY;AAAA,IAAO,CAAA,GACnE,gBAAA,EAAC,GAAD;AAAA,MAAY,OAAO;AAAA,MAAY,OAAO;AAAA,IAAa,CAAA,CAC9C;AAAA,EACF,CAAA,CAAA"}
|
|
@@ -20,12 +20,8 @@ interface TransactionDrillDownProps {
|
|
|
20
20
|
transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean;
|
|
21
21
|
baseTransactions?: Transaction[];
|
|
22
22
|
subTabs?: Omit<SubTabsProps, 'id'>;
|
|
23
|
-
projectedRow?: {
|
|
24
|
-
heading: string;
|
|
25
|
-
transaction: Transaction;
|
|
26
|
-
};
|
|
27
23
|
}
|
|
28
|
-
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs,
|
|
24
|
+
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
29
25
|
displayName: string;
|
|
30
26
|
};
|
|
31
27
|
export default TransactionDrillDown;
|
|
@@ -1,64 +1,62 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { exportTransactionsToCSV as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { DRAWER_TIP_ICON as V } from "../../components/drawerTip.es.js";
|
|
8
|
-
import { SubTabs as q, subTabPanelProps as z } from "../../components/SubTabs.es.js";
|
|
1
|
+
import { useGlobalCopyStore as j, useTransactionStore as A } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { exportTransactionsToCSV as R } from "../../../core/utils/TransactionUtils.es.js";
|
|
3
|
+
import E from "../../../transactions/components/shared/TransactionList.es.js";
|
|
4
|
+
import { TipSection as N } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
5
|
+
import { DRAWER_TIP_ICON as G } from "../../components/drawerTip.es.js";
|
|
6
|
+
import { SubTabs as O, subTabPanelProps as U } from "../../components/SubTabs.es.js";
|
|
9
7
|
import "react";
|
|
10
|
-
import { observer as
|
|
11
|
-
import
|
|
12
|
-
import { H3 as
|
|
13
|
-
import
|
|
14
|
-
import { Icon as
|
|
8
|
+
import { observer as V } from "mobx-react-lite";
|
|
9
|
+
import m from "@mui/material/Stack";
|
|
10
|
+
import { H3 as q, Text as p } from "@mxenabled/mxui";
|
|
11
|
+
import z from "@mui/material/Button";
|
|
12
|
+
import { Icon as J } from "@mxenabled/mx-icons";
|
|
15
13
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
16
14
|
import t from "@mui/material/Box";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
var
|
|
20
|
-
const { transactions:
|
|
21
|
-
|
|
22
|
-
},
|
|
15
|
+
import K from "@mui/material/Tab";
|
|
16
|
+
import M from "@mui/material/Tabs";
|
|
17
|
+
var _ = "transaction-drill-down-panel", y = (b) => `transaction-details-tab-${b}`, C = "transaction-drill-down-series", mr = V(function({ ariaLabel: S, heading: e, subHeadingText: s, icon: D, tabs: f, selectedIndex: l, top: h, onSelectionChange: I, transactionFilter: x, tipSection: T, onEachRowClick: w, baseTransactions: B, subTabs: v }) {
|
|
18
|
+
const { transactions: c } = j(), { sortedTransactionsWithSplits: k, tags: P, detailedTransactions: W } = A(), d = !!f?.length, a = v?.tabs.length ? v : void 0, L = S ?? c.transactions_title, $ = (i, n) => {
|
|
19
|
+
I?.(n);
|
|
20
|
+
}, u = x ? (B ?? W).filter(x(l)) : void 0, g = u ?? k;
|
|
23
21
|
return /* @__PURE__ */ o(t, {
|
|
24
22
|
sx: {
|
|
25
23
|
bgcolor: "background.paper",
|
|
26
24
|
width: "100%"
|
|
27
25
|
},
|
|
28
|
-
children: [
|
|
29
|
-
"aria-label":
|
|
30
|
-
onChange:
|
|
26
|
+
children: [d && /* @__PURE__ */ r(M, {
|
|
27
|
+
"aria-label": L,
|
|
28
|
+
onChange: $,
|
|
31
29
|
sx: { mb: 0 },
|
|
32
30
|
value: l,
|
|
33
31
|
variant: "fullWidth",
|
|
34
|
-
children: f.map((
|
|
35
|
-
"aria-controls":
|
|
36
|
-
"aria-label":
|
|
37
|
-
id: y(
|
|
38
|
-
label:
|
|
32
|
+
children: f.map((i, n) => /* @__PURE__ */ r(K, {
|
|
33
|
+
"aria-controls": _,
|
|
34
|
+
"aria-label": i.ariaLabel,
|
|
35
|
+
id: y(n),
|
|
36
|
+
label: i.label,
|
|
39
37
|
sx: {
|
|
40
38
|
minWidth: "auto",
|
|
41
39
|
px: 0
|
|
42
40
|
}
|
|
43
|
-
}, `${
|
|
41
|
+
}, `${i.label}-${n}`))
|
|
44
42
|
}), /* @__PURE__ */ o(t, {
|
|
45
|
-
"aria-labelledby":
|
|
46
|
-
id:
|
|
47
|
-
role:
|
|
43
|
+
"aria-labelledby": d ? y(l) : void 0,
|
|
44
|
+
id: _,
|
|
45
|
+
role: d ? "tabpanel" : void 0,
|
|
48
46
|
children: [
|
|
49
|
-
(e || s) && /* @__PURE__ */ o(
|
|
47
|
+
(e || s) && /* @__PURE__ */ o(m, {
|
|
50
48
|
sx: {
|
|
51
49
|
gap: 4,
|
|
52
50
|
pt: 16,
|
|
53
51
|
px: 24
|
|
54
52
|
},
|
|
55
|
-
children: [e && /* @__PURE__ */ r(
|
|
53
|
+
children: [e && /* @__PURE__ */ r(q, { children: e }), s && /* @__PURE__ */ o(m, {
|
|
56
54
|
sx: {
|
|
57
55
|
alignItems: "center",
|
|
58
56
|
flexDirection: "row",
|
|
59
57
|
gap: 8
|
|
60
58
|
},
|
|
61
|
-
children: [
|
|
59
|
+
children: [D, /* @__PURE__ */ r(p, {
|
|
62
60
|
color: "text.secondary",
|
|
63
61
|
sx: { letterSpacing: "0.52px" },
|
|
64
62
|
textTransform: "uppercase",
|
|
@@ -67,24 +65,24 @@ var S = "transaction-drill-down-panel", y = (h) => `transaction-details-tab-${h}
|
|
|
67
65
|
})]
|
|
68
66
|
})]
|
|
69
67
|
}),
|
|
70
|
-
|
|
68
|
+
h && /* @__PURE__ */ r(t, {
|
|
71
69
|
sx: {
|
|
72
70
|
pb: 16,
|
|
73
71
|
pt: 16
|
|
74
72
|
},
|
|
75
|
-
children:
|
|
73
|
+
children: h
|
|
76
74
|
}),
|
|
77
|
-
|
|
78
|
-
icon:
|
|
79
|
-
...
|
|
75
|
+
T && /* @__PURE__ */ r(N, {
|
|
76
|
+
icon: G,
|
|
77
|
+
...T
|
|
80
78
|
}),
|
|
81
|
-
a && /* @__PURE__ */ r(
|
|
79
|
+
a && /* @__PURE__ */ r(O, {
|
|
82
80
|
...a,
|
|
83
81
|
id: C
|
|
84
82
|
}),
|
|
85
83
|
/* @__PURE__ */ o(t, {
|
|
86
|
-
...a &&
|
|
87
|
-
children: [/* @__PURE__ */ o(
|
|
84
|
+
...a && U(C, a.selectedIndex),
|
|
85
|
+
children: [/* @__PURE__ */ o(m, {
|
|
88
86
|
sx: {
|
|
89
87
|
alignItems: "center",
|
|
90
88
|
borderBottomColor: "divider",
|
|
@@ -96,30 +94,27 @@ var S = "transaction-drill-down-panel", y = (h) => `transaction-details-tab-${h}
|
|
|
96
94
|
pt: 16,
|
|
97
95
|
px: 24
|
|
98
96
|
},
|
|
99
|
-
children: [/* @__PURE__ */ r(
|
|
97
|
+
children: [/* @__PURE__ */ r(p, {
|
|
100
98
|
bold: !0,
|
|
101
99
|
variant: "body1",
|
|
102
|
-
children:
|
|
103
|
-
}),
|
|
100
|
+
children: c.transactions_title
|
|
101
|
+
}), g.length > 0 && /* @__PURE__ */ r(z, {
|
|
104
102
|
onClick: () => {
|
|
105
|
-
|
|
103
|
+
R(g, P);
|
|
106
104
|
},
|
|
107
|
-
startIcon: /* @__PURE__ */ r(
|
|
105
|
+
startIcon: /* @__PURE__ */ r(J, { name: "ios_share" }),
|
|
108
106
|
sx: { height: 28 },
|
|
109
|
-
children: /* @__PURE__ */ r(
|
|
107
|
+
children: /* @__PURE__ */ r(p, {
|
|
110
108
|
bold: !0,
|
|
111
109
|
variant: "body2",
|
|
112
|
-
children:
|
|
110
|
+
children: c.export_csv_btn
|
|
113
111
|
})
|
|
114
112
|
})]
|
|
115
|
-
}),
|
|
116
|
-
component: "div",
|
|
117
|
-
transaction: c.transaction
|
|
118
|
-
})] }) : /* @__PURE__ */ r(t, {
|
|
113
|
+
}), /* @__PURE__ */ r(t, {
|
|
119
114
|
sx: { bgcolor: "background.default" },
|
|
120
|
-
children: /* @__PURE__ */ r(
|
|
121
|
-
transaction:
|
|
122
|
-
onClick:
|
|
115
|
+
children: /* @__PURE__ */ r(E, {
|
|
116
|
+
transaction: u,
|
|
117
|
+
onClick: w
|
|
123
118
|
})
|
|
124
119
|
})]
|
|
125
120
|
})
|
|
@@ -128,8 +123,8 @@ var S = "transaction-drill-down-panel", y = (h) => `transaction-details-tab-${h}
|
|
|
128
123
|
});
|
|
129
124
|
});
|
|
130
125
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
mr as TransactionDrillDown,
|
|
127
|
+
mr as default
|
|
133
128
|
};
|
|
134
129
|
|
|
135
130
|
//# sourceMappingURL=TransactionDrillDown.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\nimport { TransactionList, TransactionRow } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n // Shown instead of the list: one inert row under its own heading (Upcoming Bill's projected bill,\n // headed \"Projected amount\", as legacy pulse shows it). Not exported to CSV.\n projectedRow?: { heading: string; transaction: Transaction }\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n projectedRow,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below; a drawer with no chart has no box. */}\n {top && <Box sx={{ pb: 16, pt: 16 }}>{top}</Box>}\n\n {/* Every Figma chart drawer puts the tip under the chart, above any sub-tabs. */}\n {tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n\n {projectedRow ? (\n <Box>\n <SubheaderRow>{projectedRow.heading}</SubheaderRow>\n <TransactionRow component=\"div\" transaction={projectedRow.transaction} />\n </Box>\n ) : (\n // The list's scroll box is taller than its rows; Figma fills the space below the last\n // row with background.default, and each row paints its own paper.\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCAuBP,KAAuB,EAAS,SAA8B,EACzE,WAAA,GACA,SAAA,GACA,gBAAA,GACA,MAAA,GACA,MAAA,GACA,eAAA,GACA,KAAA,GACA,mBAAA,GACA,mBAAA,GACA,YAAA,GACA,gBAAA,GACA,kBAAA,GACA,SAAA,GACA,cAAA,EAAA,GAC4B;AAC5B,QAAM,EAAE,cAAc,EAAA,IAAqB,EAAmB,GACxD,EAAE,8BAAA,GAA8B,MAAA,GAAM,sBAAA,EAAA,IAAyB,EAAoB,GAEnF,IAAU,CAAC,CAAC,GAAM,QAElB,IAAa,GAAS,KAAK,SAAS,IAAU,QAC9C,IAAe,KAAa,EAAiB,oBAE7C,IAAA,CAAuB,GAA8B,MAAqB;AAC9E,IAAA,IAAoB,CAAQ;AAAA,EAC9B,GAEM,IAAuB,KACxB,KAAoB,GAAsB,OAAO,EAAkB,CAAa,CAAC,IAClF,QAEE,IAAqB,KAAwB;AAEnD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,SAAS;AAAA,MAAoB,OAAO;AAAA,IAAO;AAAA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,EAAC,GAAD;AAAA,YAAK,IAAI,EAAE,SAAS,qBAAqB;AAAA,YACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,cAAiB,aAAa;AAAA,cAAsB,SAAS;AAAA,YAAiB,CAAA;AAAA,UAC3E,CAAA,CAEJ;AAAA;MACF;AAAA,IACF,CAAA,CAAA;AAAA;AAET,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\nimport { TransactionList } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below; a drawer with no chart has no box. */}\n {top && <Box sx={{ pb: 16, pt: 16 }}>{top}</Box>}\n\n {/* Every Figma chart drawer puts the tip under the chart, above any sub-tabs. */}\n {tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n\n {/* The list's scroll box is taller than its rows; Figma fills the space below the last row\n with background.default, and each row paints its own paper. */}\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,IAAM,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCAoBP,KAAuB,EAAS,SAA8B,EACzE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