@mx-cartographer/experiences 9.7.206 → 10.0.0
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 +5 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +2 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js +39 -23
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js.map +1 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +3 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js +37 -33
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js.map +1 -1
- package/dist/accounts/utils/AccountFields.d.ts +3 -1
- package/dist/accounts/utils/AccountFields.es.js +39 -39
- package/dist/accounts/utils/AccountFields.es.js.map +1 -1
- package/dist/common/components/charts/LineChart.d.ts +4 -0
- package/dist/common/components/charts/LineChart.es.js +114 -112
- package/dist/common/components/charts/LineChart.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomLegend.es.js +24 -21
- package/dist/common/components/charts/linechart/CustomLegend.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +9 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +42 -0
- package/dist/core/types/localization/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.d.ts +7 -1
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +39 -20
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js +42 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js +54 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +10 -10
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +24 -23
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +75 -73
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.d.ts +5 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +21 -21
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +11 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +65 -58
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js +17 -17
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsV2.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js +9 -10
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/BalanceStepper.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js +21 -22
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/SaveEnoughToLiveOnBottomSection.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +35 -35
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +44 -49
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +19 -16
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.d.ts +2 -2
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +212 -166
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js +24 -0
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.d.ts +6 -5
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js +38 -38
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +1 -1
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.d.ts +1 -5
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js +37 -36
- package/dist/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.d.ts +9 -11
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js +12 -6
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +46 -40
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +141 -126
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +8 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +243 -200
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +54 -53
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +6 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +14 -13
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.d.ts +4 -3
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -21
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +14 -4
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +79 -67
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.d.ts +3 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +48 -32
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +19 -14
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +4 -0
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +19 -15
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +26 -19
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -0
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +17 -21
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.d.ts +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js +11 -11
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js +15 -11
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.d.ts +20 -0
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js +21 -0
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.d.ts +2 -4
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js +78 -82
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/MilestoneProgress.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.d.ts +10 -2
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js +115 -54
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +37 -36
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +27 -22
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.d.ts +7 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js +46 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/CompactDirectDepositBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.d.ts +13 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js +22 -0
- package/dist/insights-v2/blocks/ComponentBlocks/CompactDirectDepositBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +29 -21
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.d.ts +0 -2
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +17 -21
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +5 -6
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.d.ts +3 -7
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js +120 -306
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.d.ts +17 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js +93 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/RatingScale.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.d.ts +5 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js +21 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/StepBar.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.d.ts +18 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js +71 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/SurveyResult.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.d.ts +82 -8
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js +66 -15
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +46 -63
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +44 -53
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +30 -31
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js +25 -20
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.d.ts +22 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js +24 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.d.ts +7 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js +89 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/StrategiesBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.d.ts +43 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js +28 -0
- package/dist/insights-v2/blocks/ComponentBlocks/StrategiesBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +54 -53
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +7 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +20 -11
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +29 -28
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +2 -0
- package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js +6 -5
- package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js +117 -71
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/FederalBankHoliday.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +10 -7
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/AccountHeroCard.d.ts +3 -1
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.d.ts +3 -1
- package/dist/insights-v2/components/BaseLayout.es.js +134 -119
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactDirectDepositCard.d.ts +28 -0
- package/dist/insights-v2/components/CompactDirectDepositCard.es.js +78 -0
- package/dist/insights-v2/components/CompactDirectDepositCard.es.js.map +1 -0
- package/dist/insights-v2/components/CompactInsightCard.es.js +122 -118
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/DirectDepositCard.d.ts +6 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +24 -22
- package/dist/insights-v2/components/DirectDepositCard.es.js.map +1 -1
- package/dist/insights-v2/components/LoadingCard.es.js +13 -9
- package/dist/insights-v2/components/LoadingCard.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +1 -1
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
- package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
- package/dist/insights-v2/components/SaveAnExtraCard.d.ts +4 -1
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +32 -20
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/SubTabs.d.ts +2 -1
- package/dist/insights-v2/components/SubTabs.es.js +29 -24
- package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.d.ts +3 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +39 -37
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/TransferLogoCard.es.js +1 -0
- package/dist/insights-v2/components/TransferLogoCard.es.js.map +1 -1
- package/dist/insights-v2/components/UpcomingBillCard.es.js +39 -35
- package/dist/insights-v2/components/UpcomingBillCard.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +17 -8
- 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/components/chartblocks/ChartLegend.es.js +16 -10
- package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +10 -4
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +62 -61
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +13 -6
- package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js.map +1 -1
- package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js +2 -3
- package/dist/insights-v2/components/shared/images/DesignateEmergencySavings.es.js.map +1 -1
- package/dist/insights-v2/components/statusIcon.d.ts +2 -1
- package/dist/insights-v2/components/statusIcon.es.js +10 -8
- package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +19 -17
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaHandlers.d.ts +5 -1
- package/dist/insights-v2/ctaActions/ctaHandlers.es.js +71 -54
- package/dist/insights-v2/ctaActions/ctaHandlers.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaPostMessages.es.js +41 -24
- package/dist/insights-v2/ctaActions/ctaPostMessages.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/feedbackSurvey.d.ts +9 -0
- package/dist/insights-v2/ctaActions/feedbackSurvey.es.js +51 -0
- package/dist/insights-v2/ctaActions/feedbackSurvey.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +36 -35
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/types.d.ts +7 -0
- package/dist/insights-v2/index.es.js +126 -120
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +126 -122
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +53 -53
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/index.d.ts +0 -13
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js +0 -296
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/images/DesignateEmergencySavingsAccount.es.js.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import o from "@mui/material/SvgIcon";
|
|
3
|
+
var a = {
|
|
4
|
+
cash: ["M26 28H20C19.4333 28 18.95 28.2 18.55 28.6C18.1833 28.9666 18 29.4334 18 30C18 30.5666 18.1833 31.05 18.55 31.45C18.95 31.8166 19.4333 32 20 32H22C22 32.5666 22.1834 33.05 22.55 33.45C22.95 33.8166 23.4334 34 24 34C24.5666 34 25.0334 33.8166 25.4 33.45C25.8 33.05 26 32.5666 26 32H28C28.5666 32 29.0334 31.8166 29.4 31.45C29.8 31.05 30 30.5666 30 30V24C30 23.4334 29.8 22.9666 29.4 22.6C29.0334 22.2 28.5666 22 28 22H22V20H28C28.5666 20 29.0334 19.8167 29.4 19.45C29.8 19.05 30 18.5667 30 18C30 17.4333 29.8 16.9667 29.4 16.6C29.0334 16.2 28.5666 16 28 16H26C26 15.4333 25.8 14.9667 25.4 14.6C25.0334 14.2 24.5666 14 24 14C23.4334 14 22.95 14.2 22.55 14.6C22.1834 14.9667 22 15.4333 22 16H20C19.4333 16 18.95 16.2 18.55 16.6C18.1833 16.9667 18 17.4333 18 18V24C18 24.5666 18.1833 25.05 18.55 25.45C18.95 25.8166 19.4333 26 20 26H26V28ZM8 40C6.9 40 5.95 39.6166 5.15 38.85C4.38334 38.05 4 37.1 4 36V12C4 10.9 4.38334 9.96666 5.15 9.2C5.95 8.4 6.9 8 8 8H40C41.1 8 42.0334 8.4 42.8 9.2C43.6 9.96666 44 10.9 44 12V36C44 37.1 43.6 38.05 42.8 38.85C42.0334 39.6166 41.1 40 40 40H8ZM8 36H40V12H8V36Z"],
|
|
5
|
+
payments: ["M28 26C26.3334 26 24.9166 25.4166 23.75 24.25C22.5834 23.0834 22 21.6666 22 20C22 18.3333 22.5834 16.9167 23.75 15.75C24.9166 14.5833 26.3334 14 28 14C29.6666 14 31.0834 14.5833 32.25 15.75C33.4166 16.9167 34 18.3333 34 20C34 21.6666 33.4166 23.0834 32.25 24.25C31.0834 25.4166 29.6666 26 28 26ZM14 32C12.9 32 11.95 31.6166 11.15 30.85C10.3833 30.05 10 29.1 10 28V12C10 10.9 10.3833 9.96666 11.15 9.2C11.95 8.4 12.9 8 14 8H42C43.1 8 44.0334 8.4 44.8 9.2C45.6 9.96666 46 10.9 46 12V28C46 29.1 45.6 30.05 44.8 30.85C44.0334 31.6166 43.1 32 42 32H14ZM18 28H38C38 26.9 38.3834 25.9666 39.15 25.2C39.95 24.4 40.9 24 42 24V16C40.9 16 39.95 15.6167 39.15 14.85C38.3834 14.05 38 13.1 38 12H18C18 13.1 17.6 14.05 16.8 14.85C16.0333 15.6167 15.1 16 14 16V24C15.1 24 16.0333 24.4 16.8 25.2C17.6 25.9666 18 26.9 18 28ZM38 40H6C4.9 40 3.95 39.6166 3.15 38.85C2.38334 38.05 2 37.1 2 36V16C2 15.4333 2.18334 14.9667 2.55 14.6C2.95 14.2 3.43334 14 4 14C4.56666 14 5.03334 14.2 5.4 14.6C5.8 14.9667 6 15.4333 6 16V36H38C38.5666 36 39.0334 36.2 39.4 36.6C39.8 36.9666 40 37.4334 40 38C40 38.5666 39.8 39.05 39.4 39.45C39.0334 39.8166 38.5666 40 38 40Z"],
|
|
6
|
+
send_payment: [
|
|
7
|
+
"M36.5938 24.6406C37.37 23.7743 38.63 23.7743 39.4062 24.6406L46 32L39.4258 39.3379C38.6408 40.214 37.3659 40.208 36.5879 39.3242C35.8196 38.4514 35.8244 37.0507 36.5996 36.1855L38.3496 34.2324H28C26.8954 34.2324 26 33.2327 26 32C26.0004 30.7677 26.8957 29.7695 28 29.7695H38.25L36.584 27.9707C36.1686 27.5225 35.9802 26.9263 36.0176 26.3438C35.9846 25.7321 36.1753 25.1076 36.5938 24.6406Z",
|
|
8
|
+
"M36 10C37.1 10 38.0342 10.3992 38.8008 11.1992C39.6008 11.9659 40 12.9 40 14V20.498C38.7076 20.0122 37.2924 20.0122 36 20.498V18C34.9 18 33.9504 17.6163 33.1504 16.8496C32.3838 16.0496 32 15.1 32 14H12C12 15.0997 11.6004 16.0497 10.8008 16.8496C10.0341 17.6163 9.1 18 8 18V26C9.09999 26 10.0341 26.3992 10.8008 27.1992C11.6008 27.9658 12 28.9 12 30H22.3066C22.1107 30.6294 22.0001 31.3008 22 32C22 32.6987 22.1091 33.3709 22.3047 34H8C6.9 34 5.95039 33.6162 5.15039 32.8496C4.38374 32.0496 4 31.1 4 30V14C4 12.9 4.38373 11.9659 5.15039 11.1992C5.95027 10.3996 6.90027 10 8 10H36Z",
|
|
9
|
+
"M22 16C23.6666 16 25.0834 16.5833 26.25 17.75C27.4166 18.9167 28 20.3333 28 22C28 22.1915 27.9901 22.3796 27.9746 22.5645C27.9678 22.646 27.9551 22.7263 27.9453 22.8066C27.9325 22.9112 27.9202 23.0148 27.9023 23.1172C27.8875 23.2022 27.8679 23.2856 27.8496 23.3691C27.828 23.4671 27.8057 23.5642 27.7793 23.6602C27.7582 23.7371 27.7352 23.813 27.7109 23.8887C27.6822 23.9781 27.6522 24.0667 27.6191 24.1543C27.5876 24.2381 27.5531 24.3203 27.5176 24.4023C27.478 24.4935 27.4351 24.5828 27.3906 24.6719C27.3527 24.7479 27.3149 24.8239 27.2734 24.8984C27.2335 24.97 27.1897 25.0392 27.1465 25.1094C26.8993 25.5113 26.6055 25.8945 26.25 26.25C25.1987 27.3013 23.9437 27.8727 22.4863 27.9766C22.3267 27.9891 22.1648 28 22 28C20.3334 28 18.9166 27.4166 17.75 26.25C16.5834 25.0834 16 23.6666 16 22C16 20.3333 16.5834 18.9167 17.75 17.75C18.9166 16.5833 20.3334 16 22 16Z"
|
|
10
|
+
]
|
|
11
|
+
}, t = ({ icon: V }) => /* @__PURE__ */ H(o, {
|
|
12
|
+
"aria-hidden": !0,
|
|
13
|
+
sx: {
|
|
14
|
+
color: "action.active",
|
|
15
|
+
fontSize: 48
|
|
16
|
+
},
|
|
17
|
+
viewBox: "0 0 48 48",
|
|
18
|
+
children: a[V].map((C) => /* @__PURE__ */ H("path", { d: C }, C))
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
t as StepIcon
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=StepIcon.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepIcon.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffStrategiesBlock/StepIcon.tsx"],"sourcesContent":["import SvgIcon from '@mui/material/SvgIcon'\n\nimport type { PayoffStepIcon } from './layout'\n\n// Figma 1943:219418's step glyphs (Account Type/Cash, Common/Payments, Common/Send Payment), 48px, action.active.\n// mx-icons has no cash or send-payment glyph, so the paths are Figma's own.\nconst PATHS: Record<PayoffStepIcon, string[]> = {\n cash: [\n 'M26 28H20C19.4333 28 18.95 28.2 18.55 28.6C18.1833 28.9666 18 29.4334 18 30C18 30.5666 18.1833 31.05 18.55 31.45C18.95 31.8166 19.4333 32 20 32H22C22 32.5666 22.1834 33.05 22.55 33.45C22.95 33.8166 23.4334 34 24 34C24.5666 34 25.0334 33.8166 25.4 33.45C25.8 33.05 26 32.5666 26 32H28C28.5666 32 29.0334 31.8166 29.4 31.45C29.8 31.05 30 30.5666 30 30V24C30 23.4334 29.8 22.9666 29.4 22.6C29.0334 22.2 28.5666 22 28 22H22V20H28C28.5666 20 29.0334 19.8167 29.4 19.45C29.8 19.05 30 18.5667 30 18C30 17.4333 29.8 16.9667 29.4 16.6C29.0334 16.2 28.5666 16 28 16H26C26 15.4333 25.8 14.9667 25.4 14.6C25.0334 14.2 24.5666 14 24 14C23.4334 14 22.95 14.2 22.55 14.6C22.1834 14.9667 22 15.4333 22 16H20C19.4333 16 18.95 16.2 18.55 16.6C18.1833 16.9667 18 17.4333 18 18V24C18 24.5666 18.1833 25.05 18.55 25.45C18.95 25.8166 19.4333 26 20 26H26V28ZM8 40C6.9 40 5.95 39.6166 5.15 38.85C4.38334 38.05 4 37.1 4 36V12C4 10.9 4.38334 9.96666 5.15 9.2C5.95 8.4 6.9 8 8 8H40C41.1 8 42.0334 8.4 42.8 9.2C43.6 9.96666 44 10.9 44 12V36C44 37.1 43.6 38.05 42.8 38.85C42.0334 39.6166 41.1 40 40 40H8ZM8 36H40V12H8V36Z',\n ],\n payments: [\n 'M28 26C26.3334 26 24.9166 25.4166 23.75 24.25C22.5834 23.0834 22 21.6666 22 20C22 18.3333 22.5834 16.9167 23.75 15.75C24.9166 14.5833 26.3334 14 28 14C29.6666 14 31.0834 14.5833 32.25 15.75C33.4166 16.9167 34 18.3333 34 20C34 21.6666 33.4166 23.0834 32.25 24.25C31.0834 25.4166 29.6666 26 28 26ZM14 32C12.9 32 11.95 31.6166 11.15 30.85C10.3833 30.05 10 29.1 10 28V12C10 10.9 10.3833 9.96666 11.15 9.2C11.95 8.4 12.9 8 14 8H42C43.1 8 44.0334 8.4 44.8 9.2C45.6 9.96666 46 10.9 46 12V28C46 29.1 45.6 30.05 44.8 30.85C44.0334 31.6166 43.1 32 42 32H14ZM18 28H38C38 26.9 38.3834 25.9666 39.15 25.2C39.95 24.4 40.9 24 42 24V16C40.9 16 39.95 15.6167 39.15 14.85C38.3834 14.05 38 13.1 38 12H18C18 13.1 17.6 14.05 16.8 14.85C16.0333 15.6167 15.1 16 14 16V24C15.1 24 16.0333 24.4 16.8 25.2C17.6 25.9666 18 26.9 18 28ZM38 40H6C4.9 40 3.95 39.6166 3.15 38.85C2.38334 38.05 2 37.1 2 36V16C2 15.4333 2.18334 14.9667 2.55 14.6C2.95 14.2 3.43334 14 4 14C4.56666 14 5.03334 14.2 5.4 14.6C5.8 14.9667 6 15.4333 6 16V36H38C38.5666 36 39.0334 36.2 39.4 36.6C39.8 36.9666 40 37.4334 40 38C40 38.5666 39.8 39.05 39.4 39.45C39.0334 39.8166 38.5666 40 38 40Z',\n ],\n send_payment: [\n 'M36.5938 24.6406C37.37 23.7743 38.63 23.7743 39.4062 24.6406L46 32L39.4258 39.3379C38.6408 40.214 37.3659 40.208 36.5879 39.3242C35.8196 38.4514 35.8244 37.0507 36.5996 36.1855L38.3496 34.2324H28C26.8954 34.2324 26 33.2327 26 32C26.0004 30.7677 26.8957 29.7695 28 29.7695H38.25L36.584 27.9707C36.1686 27.5225 35.9802 26.9263 36.0176 26.3438C35.9846 25.7321 36.1753 25.1076 36.5938 24.6406Z',\n 'M36 10C37.1 10 38.0342 10.3992 38.8008 11.1992C39.6008 11.9659 40 12.9 40 14V20.498C38.7076 20.0122 37.2924 20.0122 36 20.498V18C34.9 18 33.9504 17.6163 33.1504 16.8496C32.3838 16.0496 32 15.1 32 14H12C12 15.0997 11.6004 16.0497 10.8008 16.8496C10.0341 17.6163 9.1 18 8 18V26C9.09999 26 10.0341 26.3992 10.8008 27.1992C11.6008 27.9658 12 28.9 12 30H22.3066C22.1107 30.6294 22.0001 31.3008 22 32C22 32.6987 22.1091 33.3709 22.3047 34H8C6.9 34 5.95039 33.6162 5.15039 32.8496C4.38374 32.0496 4 31.1 4 30V14C4 12.9 4.38373 11.9659 5.15039 11.1992C5.95027 10.3996 6.90027 10 8 10H36Z',\n 'M22 16C23.6666 16 25.0834 16.5833 26.25 17.75C27.4166 18.9167 28 20.3333 28 22C28 22.1915 27.9901 22.3796 27.9746 22.5645C27.9678 22.646 27.9551 22.7263 27.9453 22.8066C27.9325 22.9112 27.9202 23.0148 27.9023 23.1172C27.8875 23.2022 27.8679 23.2856 27.8496 23.3691C27.828 23.4671 27.8057 23.5642 27.7793 23.6602C27.7582 23.7371 27.7352 23.813 27.7109 23.8887C27.6822 23.9781 27.6522 24.0667 27.6191 24.1543C27.5876 24.2381 27.5531 24.3203 27.5176 24.4023C27.478 24.4935 27.4351 24.5828 27.3906 24.6719C27.3527 24.7479 27.3149 24.8239 27.2734 24.8984C27.2335 24.97 27.1897 25.0392 27.1465 25.1094C26.8993 25.5113 26.6055 25.8945 26.25 26.25C25.1987 27.3013 23.9437 27.8727 22.4863 27.9766C22.3267 27.9891 22.1648 28 22 28C20.3334 28 18.9166 27.4166 17.75 26.25C16.5834 25.0834 16 23.6666 16 22C16 20.3333 16.5834 18.9167 17.75 17.75C18.9166 16.5833 20.3334 16 22 16Z',\n ],\n}\n\nexport const StepIcon = ({ icon }: { icon: PayoffStepIcon }) => (\n <SvgIcon aria-hidden={true} sx={{ color: 'action.active', fontSize: 48 }} viewBox=\"0 0 48 48\">\n {PATHS[icon].map((d) => (\n <path d={d} key={d} />\n ))}\n </SvgIcon>\n)\n"],"mappings":";;AAMA,IAAM,IAA0C;AAAA,EAC9C,MAAM,CACJ,skCACF;AAAA,EACA,UAAU,CACR,+mCACF;AAAA,EACA,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF,GAEa,IAAA,CAAY,EAAE,MAAA,EAAA,MACzB,gBAAA,EAAC,GAAD;AAAA,EAAS,eAAa;AAAA,EAAM,IAAI;AAAA,IAAE,OAAO;AAAA,IAAiB,UAAU;AAAA,EAAG;AAAA,EAAG,SAAQ;AAAA,EAC/E,UAAA,EAAM,CAAA,EAAM,IAAA,CAAK,MAChB,gBAAA,EAAC,QAAD,EAAS,GAAA,EAAY,GAAJ,CAAI,CACtB;AACM,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Account, Beat } from '../../../core';
|
|
2
|
-
import {
|
|
2
|
+
import { PayoffStrategiesCopy } from '../../../core/types/localization/InsightsFeedCopy';
|
|
3
3
|
export type PayoffStrategyKey = 'avalanche' | 'snowball';
|
|
4
4
|
/** Which figure a strategy orders by; it is also the row's first label / value line. */
|
|
5
5
|
export type PayoffSortKey = 'rate' | 'balance';
|
|
6
|
+
/** Figma 1943:219418's step glyphs, in step order. */
|
|
7
|
+
export type PayoffStepIcon = 'cash' | 'payments' | 'send_payment';
|
|
6
8
|
export interface PayoffStep {
|
|
7
9
|
caption: string;
|
|
8
10
|
text: string;
|
|
9
|
-
|
|
10
|
-
icon: string;
|
|
11
|
+
icon: PayoffStepIcon;
|
|
11
12
|
}
|
|
12
13
|
export interface PayoffStrategy {
|
|
13
14
|
key: PayoffStrategyKey;
|
|
@@ -20,8 +21,8 @@ export interface PayoffStrategy {
|
|
|
20
21
|
orderHeader: string;
|
|
21
22
|
sortKey: PayoffSortKey;
|
|
22
23
|
}
|
|
23
|
-
/** The two strategies
|
|
24
|
-
export declare const buildStrategies: (copy:
|
|
24
|
+
/** The two strategies in Figma 1943:219418's words, all from mrs_content's `insights_feed.payoff_strategies`. */
|
|
25
|
+
export declare const buildStrategies: (copy: PayoffStrategiesCopy) => PayoffStrategy[];
|
|
25
26
|
export interface PayoffAccountRow {
|
|
26
27
|
guid: string;
|
|
27
28
|
name: string;
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
2
|
var o = [
|
|
3
|
-
"
|
|
3
|
+
"cash",
|
|
4
4
|
"payments",
|
|
5
|
-
"
|
|
6
|
-
],
|
|
5
|
+
"send_payment"
|
|
6
|
+
], l = (e, t) => [
|
|
7
7
|
e.step_one,
|
|
8
8
|
e.step_two,
|
|
9
9
|
e.step_three
|
|
10
|
-
].map((
|
|
11
|
-
caption:
|
|
12
|
-
icon: o[
|
|
13
|
-
text: t[
|
|
14
|
-
}))
|
|
15
|
-
cons:
|
|
16
|
-
description: e.
|
|
10
|
+
].map((a, n) => ({
|
|
11
|
+
caption: a,
|
|
12
|
+
icon: o[n],
|
|
13
|
+
text: t[n]
|
|
14
|
+
})), w = (e) => [{
|
|
15
|
+
cons: [e.avalanche_con_one, e.avalanche_con_two],
|
|
16
|
+
description: e.avalanche_strategy,
|
|
17
17
|
key: "avalanche",
|
|
18
|
-
label: e.avalanche
|
|
19
|
-
orderHeader: e.highest_to_lowest_rate
|
|
20
|
-
pros:
|
|
18
|
+
label: e.avalanche,
|
|
19
|
+
orderHeader: e.highest_to_lowest_rate,
|
|
20
|
+
pros: [e.avalanche_pro_one, e.avalanche_pro_two],
|
|
21
21
|
sortKey: "rate",
|
|
22
|
-
steps:
|
|
23
|
-
e.
|
|
24
|
-
e.
|
|
25
|
-
e.
|
|
22
|
+
steps: l(e, [
|
|
23
|
+
e.step_one_text,
|
|
24
|
+
e.avalanche_step_two_text,
|
|
25
|
+
e.avalanche_step_three_text
|
|
26
26
|
])
|
|
27
27
|
}, {
|
|
28
|
-
cons:
|
|
29
|
-
description: e.
|
|
28
|
+
cons: [e.snowball_con_one, e.snowball_con_two],
|
|
29
|
+
description: e.snowball_strategy,
|
|
30
30
|
key: "snowball",
|
|
31
|
-
label: e.snowball
|
|
32
|
-
orderHeader: e.
|
|
33
|
-
pros:
|
|
31
|
+
label: e.snowball,
|
|
32
|
+
orderHeader: e.highest_to_lowest_rate,
|
|
33
|
+
pros: [e.snowball_pro_one, e.snowball_pro_two],
|
|
34
34
|
sortKey: "balance",
|
|
35
|
-
steps:
|
|
36
|
-
e.
|
|
37
|
-
e.
|
|
38
|
-
e.
|
|
35
|
+
steps: l(e, [
|
|
36
|
+
e.step_one_text,
|
|
37
|
+
e.snowball_step_two_text,
|
|
38
|
+
e.snowball_step_three_text
|
|
39
39
|
])
|
|
40
|
-
}],
|
|
40
|
+
}], i = "0000", u = (e) => {
|
|
41
41
|
const t = e.account_number?.trim();
|
|
42
|
-
return t ? t.slice(-4) :
|
|
43
|
-
}, b = (e, t) => (e.account_guids ?? []).map((
|
|
42
|
+
return t ? t.slice(-4) : i;
|
|
43
|
+
}, b = (e, t) => (e.account_guids ?? []).map((a) => t.find((n) => n.guid === a)).filter((a) => a !== void 0), d = (e) => ({
|
|
44
44
|
balance: e.balance ?? null,
|
|
45
45
|
guid: e.guid,
|
|
46
46
|
institutionGuid: e.institution_guid ?? "",
|
|
47
47
|
interestRate: e.interest_rate ?? null,
|
|
48
|
-
name: `${
|
|
49
|
-
}),
|
|
50
|
-
const [s,
|
|
51
|
-
return s === null ||
|
|
48
|
+
name: `${_(e)} *${u(e)}`
|
|
49
|
+
}), h = (e, t) => [...e].sort((a, n) => {
|
|
50
|
+
const [s, r] = t === "rate" ? [a.interestRate, n.interestRate] : [a.balance, n.balance];
|
|
51
|
+
return s === null || r === null ? s === null ? r === null ? 0 : 1 : -1 : t === "rate" ? r - s : s - r;
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
w as buildStrategies,
|
|
55
|
+
u as maskedNumber,
|
|
56
|
+
h as orderAccounts,
|
|
57
57
|
b as resolveStrategyAccounts,
|
|
58
|
-
|
|
58
|
+
d as toPayoffAccountRow
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.ts"],"sourcesContent":["import getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account, Beat } from '../../../core'\nimport type {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffStrategiesBlock/layout.ts"],"sourcesContent":["import getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account, Beat } from '../../../core'\nimport type { PayoffStrategiesCopy } from '../../../core/types/localization/InsightsFeedCopy'\n\nexport type PayoffStrategyKey = 'avalanche' | 'snowball'\n\n/** Which figure a strategy orders by; it is also the row's first label / value line. */\nexport type PayoffSortKey = 'rate' | 'balance'\n\n/** Figma 1943:219418's step glyphs, in step order. */\nexport type PayoffStepIcon = 'cash' | 'payments' | 'send_payment'\n\nexport interface PayoffStep {\n caption: string\n text: string\n icon: PayoffStepIcon\n}\n\nexport interface PayoffStrategy {\n key: PayoffStrategyKey\n label: string\n description: string\n pros: string[]\n cons: string[]\n steps: PayoffStep[]\n /** The header above the ordered accounts (\"Highest to lowest rate\"). */\n orderHeader: string\n sortKey: PayoffSortKey\n}\n\nconst STEP_ICONS: PayoffStepIcon[] = ['cash', 'payments', 'send_payment']\n\nconst steps = (copy: PayoffStrategiesCopy, texts: [string, string, string]): PayoffStep[] =>\n [copy.step_one, copy.step_two, copy.step_three].map((caption, index) => ({\n caption,\n icon: STEP_ICONS[index],\n text: texts[index],\n }))\n\n/** The two strategies in Figma 1943:219418's words, all from mrs_content's `insights_feed.payoff_strategies`. */\nexport const buildStrategies = (copy: PayoffStrategiesCopy): PayoffStrategy[] => [\n {\n cons: [copy.avalanche_con_one, copy.avalanche_con_two],\n description: copy.avalanche_strategy,\n key: 'avalanche',\n label: copy.avalanche,\n orderHeader: copy.highest_to_lowest_rate,\n pros: [copy.avalanche_pro_one, copy.avalanche_pro_two],\n sortKey: 'rate',\n steps: steps(copy, [\n copy.step_one_text,\n copy.avalanche_step_two_text,\n copy.avalanche_step_three_text,\n ]),\n },\n {\n cons: [copy.snowball_con_one, copy.snowball_con_two],\n description: copy.snowball_strategy,\n key: 'snowball',\n label: copy.snowball,\n // NEEDS-CALL: Figma 1943:219418 heads the Snowball list \"Highest to Lowest Rate\" too, though it orders by balance.\n orderHeader: copy.highest_to_lowest_rate,\n pros: [copy.snowball_pro_one, copy.snowball_pro_two],\n sortKey: 'balance',\n steps: steps(copy, [\n copy.step_one_text,\n copy.snowball_step_two_text,\n copy.snowball_step_three_text,\n ]),\n },\n]\n\nexport interface PayoffAccountRow {\n guid: string\n name: string\n /** Empty when no institution is known: the default logo is shown. */\n institutionGuid: string\n /** `null` when the account carries no balance: shown as a dash and sorted last. */\n balance: number | null\n /** `null` when the account carries no interest rate: shown as a dash and sorted last. */\n interestRate: number | null\n}\n\nconst FALLBACK_NUMBER = '0000'\n\n/** The last four digits of the account number, or `0000` when the account has none (WEC-1471). */\nexport const maskedNumber = (account: Pick<Account, 'account_number'>): string => {\n const digits = account.account_number?.trim()\n\n return digits ? digits.slice(-4) : FALLBACK_NUMBER\n}\n\n/** The beat's `account_guids` among the visible accounts, in the beat's order; an unknown, hidden or closed guid is skipped. */\nexport const resolveStrategyAccounts = (beat: Beat, visibleAccounts: Account[]): Account[] =>\n (beat.account_guids ?? [])\n .map((guid) => visibleAccounts.find((account) => account.guid === guid))\n .filter((account): account is Account => account !== undefined)\n\nexport const toPayoffAccountRow = (account: Account): PayoffAccountRow => ({\n balance: account.balance ?? null,\n guid: account.guid,\n institutionGuid: account.institution_guid ?? '',\n interestRate: account.interest_rate ?? null,\n name: `${getAccountDisplayName(account)} *${maskedNumber(account)}`,\n})\n\n/** Avalanche: interest rate, highest first. Snowball: balance, lowest first. A missing value sorts last. A new array; the input is untouched. */\nexport const orderAccounts = (\n rows: PayoffAccountRow[],\n sortKey: PayoffSortKey,\n): PayoffAccountRow[] =>\n [...rows].sort((a, b) => {\n const [x, y] = sortKey === 'rate' ? [a.interestRate, b.interestRate] : [a.balance, b.balance]\n\n if (x === null || y === null) return x === null ? (y === null ? 0 : 1) : -1\n\n return sortKey === 'rate' ? y - x : x - y\n })\n"],"mappings":";AA8BA,IAAM,IAA+B;AAAA,EAAC;AAAA,EAAQ;AAAA,EAAY;AAAc,GAElE,IAAA,CAAS,GAA4B,MACzC;AAAA,EAAC,EAAK;AAAA,EAAU,EAAK;AAAA,EAAU,EAAK;AAAU,EAAE,IAAA,CAAK,GAAS,OAAW;AAAA,EACvE,SAAA;AAAA,EACA,MAAM,EAAW,CAAA;AAAA,EACjB,MAAM,EAAM,CAAA;AACd,EAAE,GAGS,IAAA,CAAmB,MA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AM,GAAG,MAAM;AACvB,QAAM,CAAC,GAAG,CAAA,IAAK,MAAY,SAAS,CAAC,EAAE,cAAc,EAAE,YAAY,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO;AAE5F,SAAI,MAAM,QAAQ,MAAM,OAAa,MAAM,OAAQ,MAAM,OAAO,IAAI,IAAK,KAElE,MAAY,SAAS,IAAI,IAAI,IAAI;AAC1C,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { useBeatActions as Z } from "../beatActions.es.js";
|
|
|
6
6
|
import { asLogoRef as J } from "../blocks/slotReaders.es.js";
|
|
7
7
|
import { USER_RESPONSE as d, answerSubscription as K, repeatingTransactionOf as Q, reportSubscriptionMarkedIncorrect as tt } from "../ctaActions/subscriptionAnswer.es.js";
|
|
8
8
|
import { ELEVATION_SHADOW as ot } from "../components/shared/elevation.es.js";
|
|
9
|
-
import rt from "../components/LogoFromGuid.es.js";
|
|
10
9
|
import "../components/celebrationGradients.es.js";
|
|
10
|
+
import rt from "../components/LogoFromGuid.es.js";
|
|
11
11
|
import et from "../components/TransactionListCard.es.js";
|
|
12
12
|
import { subscriptionFrequency as st } from "../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
13
13
|
import nt from "../components/shared/StatusSnackbar.es.js";
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { GlobalCopy, TopMerchantsCopy } from '../../../core';
|
|
2
2
|
import { ActionBlockProps } from '../../mappings/blocks';
|
|
3
3
|
export declare const selectTopMerchantsCopy: (copy: GlobalCopy) => TopMerchantsCopy | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over
|
|
6
|
-
* up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,
|
|
7
|
-
* `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.
|
|
8
|
-
*/
|
|
4
|
+
/** Top Merchants drawer: the month's total over the ranked merchants; a row opens its Merchant History. */
|
|
9
5
|
export declare const TopMerchantsBlock: (({ beat }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
6
|
displayName: string;
|
|
11
7
|
};
|
|
@@ -3,23 +3,23 @@ import { useGlobalCopyStore as R, useTransactionStore as A } from "../../../comm
|
|
|
3
3
|
import { CURRENCY_FORMAT as _, formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
4
|
import E from "../../../common/components/drawer/Drawer.es.js";
|
|
5
5
|
import { ELEVATION_SHADOW as F } from "../../components/shared/elevation.es.js";
|
|
6
|
-
import
|
|
7
|
-
import { useOpenedCta as
|
|
8
|
-
import { useRequiredCopy as
|
|
6
|
+
import H from "../../components/LogoMark.es.js";
|
|
7
|
+
import { useOpenedCta as N } from "../useOpenedCta.es.js";
|
|
8
|
+
import { useRequiredCopy as G } from "../useRequiredCopy.es.js";
|
|
9
9
|
import { TransactionHistoryBlock as L } from "../TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
10
10
|
import { TransactionListHeaderIconTile as D } from "../TransactionListBlock/TransactionListHeaderIconTile.es.js";
|
|
11
11
|
import { merchantHistoryCta as I, readTopMerchants as U } from "./layout.es.js";
|
|
12
|
-
import
|
|
12
|
+
import l from "react";
|
|
13
13
|
import { observer as j } from "mobx-react-lite";
|
|
14
|
-
import
|
|
15
|
-
import { Text as
|
|
14
|
+
import d from "@mui/material/Stack";
|
|
15
|
+
import { H2 as z, Text as m } from "@mxenabled/mxui";
|
|
16
16
|
import { Icon as P } from "@mxenabled/mx-icons";
|
|
17
|
-
import { Fragment as W, jsx as o, jsxs as
|
|
17
|
+
import { Fragment as W, jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
18
18
|
import f from "@mui/material/Box";
|
|
19
19
|
import Y from "@mui/material/ButtonBase";
|
|
20
|
-
var $ = (
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
var $ = (a) => a.insights_feed?.top_merchants, V = "_1{count} transactions", q = "_1{count} transaction", J = ({ copy: a, countCopy: n, merchant: t, onClick: p }) => {
|
|
21
|
+
const c = w(a.rank_merchant, String(t.rank), t.merchantName), u = B(n.one, n.many, t.transactionCount, String(t.transactionCount));
|
|
22
|
+
return /* @__PURE__ */ i(Y, {
|
|
23
23
|
onClick: () => p(t),
|
|
24
24
|
sx: {
|
|
25
25
|
borderBottom: 1,
|
|
@@ -40,7 +40,7 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
40
40
|
display: "flex",
|
|
41
41
|
flexShrink: 0
|
|
42
42
|
},
|
|
43
|
-
children: /* @__PURE__ */ o(
|
|
43
|
+
children: /* @__PURE__ */ o(H, {
|
|
44
44
|
logo: {
|
|
45
45
|
category_guid: t.categoryGuid,
|
|
46
46
|
merchant_guid: t.merchantGuid,
|
|
@@ -49,24 +49,24 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
49
49
|
size: 32
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ i(d, {
|
|
53
53
|
sx: {
|
|
54
54
|
flexGrow: 1,
|
|
55
55
|
minWidth: 0
|
|
56
56
|
},
|
|
57
|
-
children: [/* @__PURE__ */ o(
|
|
57
|
+
children: [/* @__PURE__ */ o(m, {
|
|
58
58
|
bold: !0,
|
|
59
59
|
component: "span",
|
|
60
60
|
truncate: !0,
|
|
61
61
|
variant: "body1",
|
|
62
|
-
children:
|
|
63
|
-
}), /* @__PURE__ */ o(
|
|
62
|
+
children: c
|
|
63
|
+
}), /* @__PURE__ */ o(m, {
|
|
64
64
|
component: "span",
|
|
65
65
|
variant: "caption",
|
|
66
66
|
children: u
|
|
67
67
|
})]
|
|
68
68
|
}),
|
|
69
|
-
/* @__PURE__ */ o(
|
|
69
|
+
/* @__PURE__ */ o(m, {
|
|
70
70
|
component: "span",
|
|
71
71
|
sx: { flexShrink: 0 },
|
|
72
72
|
variant: "body1",
|
|
@@ -80,24 +80,24 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
80
80
|
})
|
|
81
81
|
]
|
|
82
82
|
});
|
|
83
|
-
},
|
|
84
|
-
const t =
|
|
85
|
-
many:
|
|
86
|
-
one:
|
|
83
|
+
}, go = j(function({ beat: n }) {
|
|
84
|
+
const t = G($), { common: p, insights_feed: c } = R(), u = N(n), s = A(), r = l.useRef(null), [h, g] = l.useState(), [C, y] = l.useState(), { describedMonth: b, merchants: k, merchantHistory: S, totalAmount: T } = U(u?.drilldown_data ?? n.insights_payload?.drilldown_data), v = {
|
|
85
|
+
many: c?.general?.transaction_count ?? V,
|
|
86
|
+
one: c?.general?.transaction_count_one ?? q
|
|
87
87
|
}, O = (e) => {
|
|
88
|
-
r.current = { ...
|
|
88
|
+
r.current = { ...s.filter }, g(e), y(I(e, S, b));
|
|
89
89
|
}, M = () => {
|
|
90
|
-
g(void 0), y(void 0), r.current !== null && (
|
|
90
|
+
g(void 0), y(void 0), r.current !== null && (s.setFilter(r.current), r.current = null);
|
|
91
91
|
};
|
|
92
|
-
return
|
|
93
|
-
r.current !== null && (
|
|
94
|
-
}, [
|
|
92
|
+
return l.useEffect(() => () => {
|
|
93
|
+
r.current !== null && (s.setFilter(r.current), r.current = null);
|
|
94
|
+
}, [s]), /* @__PURE__ */ i(W, { children: [
|
|
95
95
|
/* @__PURE__ */ o(f, {
|
|
96
96
|
sx: {
|
|
97
97
|
bgcolor: "background.default",
|
|
98
98
|
p: 24
|
|
99
99
|
},
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ i(d, {
|
|
101
101
|
direction: "row",
|
|
102
102
|
sx: {
|
|
103
103
|
alignItems: "center",
|
|
@@ -107,17 +107,18 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
107
107
|
gap: 12,
|
|
108
108
|
p: 16
|
|
109
109
|
},
|
|
110
|
-
children: [/* @__PURE__ */ o(D, {
|
|
110
|
+
children: [/* @__PURE__ */ o(D, {
|
|
111
|
+
name: "payments",
|
|
112
|
+
size: 32
|
|
113
|
+
}), /* @__PURE__ */ i(d, {
|
|
111
114
|
sx: {
|
|
112
115
|
gap: 4,
|
|
113
116
|
minWidth: 0
|
|
114
117
|
},
|
|
115
|
-
children: [/* @__PURE__ */ o(
|
|
116
|
-
bold: !0,
|
|
118
|
+
children: [/* @__PURE__ */ o(z, {
|
|
117
119
|
component: "p",
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}), /* @__PURE__ */ o(i, {
|
|
120
|
+
children: x(T, _.cents)
|
|
121
|
+
}), /* @__PURE__ */ o(m, {
|
|
121
122
|
color: "text.secondary",
|
|
122
123
|
component: "p",
|
|
123
124
|
variant: "body2",
|
|
@@ -126,7 +127,7 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
126
127
|
})]
|
|
127
128
|
})
|
|
128
129
|
}),
|
|
129
|
-
/* @__PURE__ */ o(
|
|
130
|
+
/* @__PURE__ */ o(d, {
|
|
130
131
|
component: "ul",
|
|
131
132
|
sx: {
|
|
132
133
|
bgcolor: "background.paper",
|
|
@@ -136,9 +137,9 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
136
137
|
},
|
|
137
138
|
children: k.map((e) => /* @__PURE__ */ o(f, {
|
|
138
139
|
component: "li",
|
|
139
|
-
children: /* @__PURE__ */ o(
|
|
140
|
+
children: /* @__PURE__ */ o(J, {
|
|
140
141
|
copy: t,
|
|
141
|
-
countCopy:
|
|
142
|
+
countCopy: v,
|
|
142
143
|
merchant: e,
|
|
143
144
|
onClick: O
|
|
144
145
|
})
|
|
@@ -157,7 +158,7 @@ var $ = (c) => c.insights_feed?.top_merchants, z = "_1{count} transactions", V =
|
|
|
157
158
|
] });
|
|
158
159
|
});
|
|
159
160
|
export {
|
|
160
|
-
|
|
161
|
+
go as TopMerchantsBlock,
|
|
161
162
|
$ as selectTopMerchantsCopy
|
|
162
163
|
};
|
|
163
164
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopMerchantsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Drawer, useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { GlobalCopy, PrimaryCTA, TopMerchantsCopy } from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport LogoMark from '../../components/LogoMark'\nimport { ELEVATION_SHADOW } from '../../components/shared/elevation'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { TransactionHistoryBlock } from '../TransactionHistoryBlock/TransactionHistoryBlock'\nimport { TransactionListHeaderIconTile } from '../TransactionListBlock/TransactionListHeaderIconTile'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport { merchantHistoryCta, readTopMerchants, type TopMerchant } from './layout'\n\nexport const selectTopMerchantsCopy = (copy: GlobalCopy) => copy.insights_feed?.top_merchants\n\n// English defaults until the localized-content service ships the pill copy in every locale, as the\n// Transaction List summary card does.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\ninterface MerchantRowProps {\n copy: TopMerchantsCopy\n countCopy: { many: string; one: string }\n merchant: TopMerchant\n onClick: (merchant: TopMerchant) => void\n}\n\n/** Figma `<ListItem> | Utility Row`: logo, \"{rank} - {merchant}\" over its count, total, chevron. */\nconst MerchantRow = ({ copy, countCopy, merchant, onClick }: MerchantRowProps) => {\n const title = buildDynamicCopy(\n copy.rank_merchant,\n String(merchant.rank),\n merchant.merchantName,\n ) as string\n const count = buildPluralCopy(\n countCopy.one,\n countCopy.many,\n merchant.transactionCount,\n String(merchant.transactionCount),\n ) as string\n\n return (\n <ButtonBase\n onClick={() => onClick(merchant)}\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n gap: 12,\n justifyContent: 'flex-start',\n minHeight: 64,\n px: 16,\n py: 12,\n textAlign: 'left',\n width: '100%',\n '&.Mui-focusVisible': { bgcolor: 'action.focus' },\n }}\n >\n <Box aria-hidden={true} sx={{ display: 'flex', flexShrink: 0 }}>\n <LogoMark\n logo={{\n category_guid: merchant.categoryGuid,\n merchant_guid: merchant.merchantGuid,\n merchant_name: merchant.merchantName,\n }}\n size={32}\n />\n </Box>\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text bold={true} component=\"span\" truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text component=\"span\" variant=\"caption\">\n {count}\n </Text>\n </Stack>\n <Text component=\"span\" sx={{ flexShrink: 0 }} variant=\"body1\">\n {formatCurrency(merchant.total, CURRENCY_FORMAT.cents)}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={20} sx={{ flexShrink: 0 }} />\n </ButtonBase>\n )\n}\n\n/**\n * Monthly Top Merchant Spending's Top Merchants drawer (Figma 1273:34553): the month's total over\n * up to ten ranked merchants. A row opens that merchant's Merchant History (Transaction History,\n * `top_merchant` variant) in a nested drawer, whose rows open Transaction Details.\n */\nexport const TopMerchantsBlock = observer(function TopMerchantsBlock({ beat }: ActionBlockProps) {\n const copy = useRequiredCopy(selectTopMerchantsCopy)\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const openedCta = useOpenedCta(beat)\n const transactionStore = useTransactionStore()\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n const [selected, setSelected] = React.useState<TopMerchant>()\n const [selectedCta, setSelectedCta] = React.useState<PrimaryCTA>()\n\n const { describedMonth, merchants, merchantHistory, totalAmount } = readTopMerchants(\n openedCta?.drilldown_data ?? beat.insights_payload?.drilldown_data,\n )\n const countCopy = {\n many: insightsCopy?.general?.transaction_count ?? DEFAULT_COUNT_COPY,\n one: insightsCopy?.general?.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n }\n\n const handleMerchantClick = (merchant: TopMerchant) => {\n filterBeforeOpen.current = { ...transactionStore.filter }\n setSelected(merchant)\n setSelectedCta(merchantHistoryCta(merchant, merchantHistory, describedMonth))\n }\n\n const handleClose = () => {\n setSelected(undefined)\n setSelectedCta(undefined)\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n }\n\n React.useEffect(\n () => () => {\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n },\n [transactionStore],\n )\n\n return (\n <>\n <Box sx={{ bgcolor: 'background.default', p: 24 }}>\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"payments\" />\n <Stack sx={{ gap: 4, minWidth: 0 }}>\n <Text bold={true} component=\"p\" variant=\"h2\">\n {formatCurrency(totalAmount, CURRENCY_FORMAT.cents)}\n </Text>\n <Text color=\"text.secondary\" component=\"p\" variant=\"body2\">\n {copy.total_spending}\n </Text>\n </Stack>\n </Stack>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {merchants.map((merchant) => (\n <Box component=\"li\" key={merchant.merchantGuid}>\n <MerchantRow\n copy={copy}\n countCopy={countCopy}\n merchant={merchant}\n onClick={handleMerchantClick}\n />\n </Box>\n ))}\n </Stack>\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={!!selected}\n onClose={handleClose}\n title={copy.merchant_history_title}\n >\n {selected && selectedCta && (\n <TransactionHistoryBlock beat={beat} cta={selectedCta} key={selected.merchantGuid} />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAa,IAAA,CAA0B,MAAqB,EAAK,eAAe,eAI1E,IAAqB,0BACrB,IAAyB,yBAUzB,IAAA,CAAe,EAAE,MAAA,GAAM,WAAA,GAAW,UAAA,GAAU,SAAA,EAAA,MAAgC;AAChF,QAAM,IAAQ,EACZ,EAAK,eACL,OAAO,EAAS,IAAI,GACpB,EAAS,YACX,GACM,IAAQ,EACZ,EAAU,KACV,EAAU,MACV,EAAS,kBACT,OAAO,EAAS,gBAAgB,CAClC;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAA,MAAe,EAAQ,CAAQ;AAAA,IAC/B,IAAI;AAAA,MACF,cAAc;AAAA,MACd,aAAa;AAAA,MACb,KAAK;AAAA,MACL,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,MACP,sBAAsB,EAAE,SAAS,eAAe;AAAA,IAClD;AAAA,IAbF,UAAA;AAAA,MAeE,gBAAA,EAAC,GAAD;AAAA,QAAK,eAAa;AAAA,QAAM,IAAI;AAAA,UAAE,SAAS;AAAA,UAAQ,YAAY;AAAA,QAAE;AAAA,QAC3D,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,MAAM;AAAA,YACJ,eAAe,EAAS;AAAA,YACxB,eAAe,EAAS;AAAA,YACxB,eAAe,EAAS;AAAA,UAC1B;AAAA,UACA,MAAM;AAAA,QACP,CAAA;AAAA,MACE,CAAA;AAAA,MACL,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,UAAU;AAAA,UAAG,UAAU;AAAA,QAAE;AAAA,QAAtC,UAA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WAAW;AAAA,QAAQ,GAAG;AAAA,QAAG,GAAG;AAAA,MAAE;AAAA,MACpF,UAAA,EAAU,IAAA,CAAK,MACd,gBAAA,EAAC,GAAD;AAAA,QAAK,WAAU;AAAA,QACb,UAAA,gBAAA,EAAC,GAAD;AAAA,UACQ,MAAA;AAAA,UACK,WAAA;AAAA,UACD,UAAA;AAAA,UACV,SAAS;AAAA,QACV,CAAA;AAAA,MACE,GAPoB,EAAS,YAO7B,CACN;AAAA,IACI,CAAA;AAAA,IACP,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAW;AAAA,MAC3B,QAAQ,CAAC,CAAC;AAAA,MACV,SAAS;AAAA,MACT,OAAO,EAAK;AAAA,MAEX,UAAA,KAAY,KACX,gBAAA,EAAC,GAAD;AAAA,QAA+B,MAAA;AAAA,QAAM,KAAK;AAAA,MAA0C,GAAxB,EAAS,YAAe;AAAA,IAEhF,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
|
|
1
|
+
{"version":3,"file":"TopMerchantsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TopMerchantsBlock/TopMerchantsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H2, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Drawer, useGlobalCopyStore, useTransactionStore } from '../../../common'\nimport type { GlobalCopy, PrimaryCTA, TopMerchantsCopy } from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport LogoMark from '../../components/LogoMark'\nimport { ELEVATION_SHADOW } from '../../components/shared/elevation'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { TransactionHistoryBlock } from '../TransactionHistoryBlock/TransactionHistoryBlock'\nimport { TransactionListHeaderIconTile } from '../TransactionListBlock/TransactionListHeaderIconTile'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport { merchantHistoryCta, readTopMerchants, type TopMerchant } from './layout'\n\nexport const selectTopMerchantsCopy = (copy: GlobalCopy) => copy.insights_feed?.top_merchants\n\n// English defaults until the localized-content service ships the pill copy in every locale, as the\n// Transaction List summary card does.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\ninterface MerchantRowProps {\n copy: TopMerchantsCopy\n countCopy: { many: string; one: string }\n merchant: TopMerchant\n onClick: (merchant: TopMerchant) => void\n}\n\n/** Figma `<ListItem> | Utility Row`: logo, \"{rank} - {merchant}\" over its count, total, chevron. */\nconst MerchantRow = ({ copy, countCopy, merchant, onClick }: MerchantRowProps) => {\n const title = buildDynamicCopy(\n copy.rank_merchant,\n String(merchant.rank),\n merchant.merchantName,\n ) as string\n const count = buildPluralCopy(\n countCopy.one,\n countCopy.many,\n merchant.transactionCount,\n String(merchant.transactionCount),\n ) as string\n\n return (\n <ButtonBase\n onClick={() => onClick(merchant)}\n sx={{\n borderBottom: 1,\n borderColor: 'divider',\n gap: 12,\n justifyContent: 'flex-start',\n minHeight: 64,\n px: 16,\n py: 12,\n textAlign: 'left',\n width: '100%',\n '&.Mui-focusVisible': { bgcolor: 'action.focus' },\n }}\n >\n <Box aria-hidden={true} sx={{ display: 'flex', flexShrink: 0 }}>\n <LogoMark\n logo={{\n category_guid: merchant.categoryGuid,\n merchant_guid: merchant.merchantGuid,\n merchant_name: merchant.merchantName,\n }}\n size={32}\n />\n </Box>\n <Stack sx={{ flexGrow: 1, minWidth: 0 }}>\n <Text bold={true} component=\"span\" truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text component=\"span\" variant=\"caption\">\n {count}\n </Text>\n </Stack>\n <Text component=\"span\" sx={{ flexShrink: 0 }} variant=\"body1\">\n {formatCurrency(merchant.total, CURRENCY_FORMAT.cents)}\n </Text>\n <Icon aria-hidden={true} name=\"chevron_right\" size={20} sx={{ flexShrink: 0 }} />\n </ButtonBase>\n )\n}\n\n/** Top Merchants drawer: the month's total over the ranked merchants; a row opens its Merchant History. */\nexport const TopMerchantsBlock = observer(function TopMerchantsBlock({ beat }: ActionBlockProps) {\n const copy = useRequiredCopy(selectTopMerchantsCopy)\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const openedCta = useOpenedCta(beat)\n const transactionStore = useTransactionStore()\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n const [selected, setSelected] = React.useState<TopMerchant>()\n const [selectedCta, setSelectedCta] = React.useState<PrimaryCTA>()\n\n const { describedMonth, merchants, merchantHistory, totalAmount } = readTopMerchants(\n openedCta?.drilldown_data ?? beat.insights_payload?.drilldown_data,\n )\n const countCopy = {\n many: insightsCopy?.general?.transaction_count ?? DEFAULT_COUNT_COPY,\n one: insightsCopy?.general?.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n }\n\n const handleMerchantClick = (merchant: TopMerchant) => {\n filterBeforeOpen.current = { ...transactionStore.filter }\n setSelected(merchant)\n setSelectedCta(merchantHistoryCta(merchant, merchantHistory, describedMonth))\n }\n\n const handleClose = () => {\n setSelected(undefined)\n setSelectedCta(undefined)\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n }\n\n React.useEffect(\n () => () => {\n if (filterBeforeOpen.current !== null) {\n transactionStore.setFilter(filterBeforeOpen.current)\n filterBeforeOpen.current = null\n }\n },\n [transactionStore],\n )\n\n return (\n <>\n <Box sx={{ bgcolor: 'background.default', p: 24 }}>\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: ELEVATION_SHADOW[1],\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"payments\" size={32} />\n <Stack sx={{ gap: 4, minWidth: 0 }}>\n <H2 component=\"p\">{formatCurrency(totalAmount, CURRENCY_FORMAT.cents)}</H2>\n <Text color=\"text.secondary\" component=\"p\" variant=\"body2\">\n {copy.total_spending}\n </Text>\n </Stack>\n </Stack>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {merchants.map((merchant) => (\n <Box component=\"li\" key={merchant.merchantGuid}>\n <MerchantRow\n copy={copy}\n countCopy={countCopy}\n merchant={merchant}\n onClick={handleMerchantClick}\n />\n </Box>\n ))}\n </Stack>\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={!!selected}\n onClose={handleClose}\n title={copy.merchant_history_title}\n >\n {selected && selectedCta && (\n <TransactionHistoryBlock beat={beat} cta={selectedCta} key={selected.merchantGuid} />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAa,IAAA,CAA0B,MAAqB,EAAK,eAAe,eAI1E,IAAqB,0BACrB,IAAyB,yBAUzB,IAAA,CAAe,EAAE,MAAA,GAAM,WAAA,GAAW,UAAA,GAAU,SAAA,EAAA,MAAgC;AAChF,QAAM,IAAQ,EACZ,EAAK,eACL,OAAO,EAAS,IAAI,GACpB,EAAS,YACX,GACM,IAAQ,EACZ,EAAU,KACV,EAAU,MACV,EAAS,kBACT,OAAO,EAAS,gBAAgB,CAClC;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAA,MAAe,EAAQ,CAAQ;AAAA,IAC/B,IAAI;AAAA,MACF,cAAc;AAAA,MACd,aAAa;AAAA,MACb,KAAK;AAAA,MACL,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,MACP,sBAAsB,EAAE,SAAS,eAAe;AAA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AAI;AAAA,YAAE,KAAK;AAAA,YAAG,UAAU;AAAA,UAAE;AAAA,UAAjC,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YAAI,WAAU;AAAA,YAAK,UAAA,EAAe,GAAa,EAAgB,KAAK;AAAA,UAAM,CAAA,GAC1E,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,WAAU;AAAA,YAAI,SAAQ;AAAA,YAChD,UAAA,EAAK;AAAA,UACF,CAAA,CACD;AAAA,QACF,CAAA,CAAA;AAAA;IACJ,CAAA;AAAA,IACL,gBAAA,EAAC,GAAD;AAAA,MAAO,WAAU;AAAA,MAAK,IAAI;AAAA,QAAE,SAAS;AAAA,QAAoB,WAAW;AAAA,QAAQ,GAAG;AAAA,QAAG,GAAG;AAAA,MAAE;AAAA,MACpF,UAAA,EAAU,IAAA,CAAK,MACd,gBAAA,EAAC,GAAD;AAAA,QAAK,WAAU;AAAA,QACb,UAAA,gBAAA,EAAC,GAAD;AAAA,UACQ,MAAA;AAAA,UACK,WAAA;AAAA,UACD,UAAA;AAAA,UACV,SAAS;AAAA,QACV,CAAA;AAAA,MACE,GAPoB,EAAS,YAO7B,CACN;AAAA,IACI,CAAA;AAAA,IACP,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAW;AAAA,MAC3B,QAAQ,CAAC,CAAC;AAAA,MACV,SAAS;AAAA,MACT,OAAO,EAAK;AAAA,MAEX,UAAA,KAAY,KACX,gBAAA,EAAC,GAAD;AAAA,QAA+B,MAAA;AAAA,QAAM,KAAK;AAAA,MAA0C,GAAxB,EAAS,YAAe;AAAA,IAEhF,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
+
import { GlobalCopy } from '../../../core';
|
|
1
2
|
import { BottomActions } from '../../../transactions/constants/Actions';
|
|
2
3
|
export interface TransactionDetailsLayoutConfig {
|
|
3
4
|
/** Bottom action rows rendered in the drawer. */
|
|
4
5
|
bottomActions: BottomActions[];
|
|
6
|
+
/** The drawer title; absent or blank falls back to the Transaction Details copy. */
|
|
7
|
+
title?: (copy: GlobalCopy) => string | undefined;
|
|
5
8
|
}
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* does). Names describe the behavior, not the originating beat, so any beat whose CTA wants the same
|
|
10
|
-
* drilldown reuses the value. Extend `TransactionDetailsLayoutConfig` (styles, top actions, …) as
|
|
11
|
-
* variants need to differ, rather than branching on the variant string across the block.
|
|
10
|
+
* Transaction Details drawer variations, keyed by the opening CTA's `variant` and named by behaviour.
|
|
11
|
+
* Add a field to `TransactionDetailsLayoutConfig` when variants differ, rather than branching on the string.
|
|
12
12
|
*
|
|
13
13
|
* - `MerchantBudget` — shows the "Add a Merchant Budget" row.
|
|
14
14
|
* - `NoMerchantBudget` — drops the "Add a Merchant Budget" row.
|
|
15
|
+
* - `DepositDetails` — the merchant-budget set, titled "Deposit Details".
|
|
15
16
|
*/
|
|
16
17
|
export declare const transactionDetailsVariant: {
|
|
17
18
|
readonly MerchantBudget: "merchant_budget";
|
|
18
19
|
readonly NoMerchantBudget: "no_merchant_budget";
|
|
20
|
+
readonly DepositDetails: "deposit_details";
|
|
19
21
|
};
|
|
20
22
|
export type TransactionDetailsVariant = (typeof transactionDetailsVariant)[keyof typeof transactionDetailsVariant];
|
|
21
|
-
/**
|
|
22
|
-
* Resolve a CTA variant's drawer config. Any variant without its own entry — including `null` and
|
|
23
|
-
* unknown values — falls back to the full action set (merchant budget included). That default is the
|
|
24
|
-
* common case, not a misconfiguration, so this does not warn. `Object.hasOwn` avoids inherited keys
|
|
25
|
-
* (e.g. `constructor`) resolving to a non-config.
|
|
26
|
-
*/
|
|
23
|
+
/** A variant without its own row (null or unknown) gets the full action set; that's the common case, so no warning. */
|
|
27
24
|
export declare const resolveLayoutConfig: (variant: string | null | undefined) => TransactionDetailsLayoutConfig;
|
|
25
|
+
export declare const getTransactionDetailsDrawerTitle: (variant: string | null | undefined, copy: GlobalCopy) => string;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { BottomActions as
|
|
2
|
-
var a = { bottomActions: [
|
|
1
|
+
import { BottomActions as r, DEFAULT_BOTTOM_ACTIONS as n } from "../../../transactions/constants/Actions.es.js";
|
|
2
|
+
var a = { bottomActions: [r.MerchantBudget, ...n] }, s = { bottomActions: n }, e = {
|
|
3
3
|
MerchantBudget: "merchant_budget",
|
|
4
|
-
NoMerchantBudget: "no_merchant_budget"
|
|
4
|
+
NoMerchantBudget: "no_merchant_budget",
|
|
5
|
+
DepositDetails: "deposit_details"
|
|
5
6
|
}, o = {
|
|
6
7
|
[e.MerchantBudget]: a,
|
|
7
|
-
[e.NoMerchantBudget]:
|
|
8
|
-
|
|
8
|
+
[e.NoMerchantBudget]: s,
|
|
9
|
+
[e.DepositDetails]: {
|
|
10
|
+
...a,
|
|
11
|
+
title: (t) => t.insights_feed?.general?.deposit_details_title
|
|
12
|
+
}
|
|
13
|
+
}, l = (t) => t != null && Object.hasOwn(o, t) ? o[t] : a, d = (t, i) => l(t).title?.(i) || i.insights_feed?.general?.transaction_details_title || "";
|
|
9
14
|
export {
|
|
10
|
-
|
|
15
|
+
d as getTransactionDetailsDrawerTitle,
|
|
16
|
+
l as resolveLayoutConfig,
|
|
11
17
|
e as transactionDetailsVariant
|
|
12
18
|
};
|
|
13
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/layout.ts"],"sourcesContent":["import { BottomActions, DEFAULT_BOTTOM_ACTIONS } from '../../../transactions/constants/Actions'\n\nexport interface TransactionDetailsLayoutConfig {\n /** Bottom action rows rendered in the drawer. */\n bottomActions: BottomActions[]\n}\n\n// Reusable configs named by intent, not by any one beat, so any CTA variant can point at them.\nconst WITH_MERCHANT_BUDGET: TransactionDetailsLayoutConfig = {\n bottomActions: [BottomActions.MerchantBudget, ...DEFAULT_BOTTOM_ACTIONS],\n}\nconst WITHOUT_MERCHANT_BUDGET: TransactionDetailsLayoutConfig = {\n bottomActions: DEFAULT_BOTTOM_ACTIONS,\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/layout.ts"],"sourcesContent":["import type { GlobalCopy } from '../../../core'\nimport { BottomActions, DEFAULT_BOTTOM_ACTIONS } from '../../../transactions/constants/Actions'\n\nexport interface TransactionDetailsLayoutConfig {\n /** Bottom action rows rendered in the drawer. */\n bottomActions: BottomActions[]\n /** The drawer title; absent or blank falls back to the Transaction Details copy. */\n title?: (copy: GlobalCopy) => string | undefined\n}\n\n// Reusable configs named by intent, not by any one beat, so any CTA variant can point at them.\nconst WITH_MERCHANT_BUDGET: TransactionDetailsLayoutConfig = {\n bottomActions: [BottomActions.MerchantBudget, ...DEFAULT_BOTTOM_ACTIONS],\n}\nconst WITHOUT_MERCHANT_BUDGET: TransactionDetailsLayoutConfig = {\n bottomActions: DEFAULT_BOTTOM_ACTIONS,\n}\n\n/**\n * Transaction Details drawer variations, keyed by the opening CTA's `variant` and named by behaviour.\n * Add a field to `TransactionDetailsLayoutConfig` when variants differ, rather than branching on the string.\n *\n * - `MerchantBudget` — shows the \"Add a Merchant Budget\" row.\n * - `NoMerchantBudget` — drops the \"Add a Merchant Budget\" row.\n * - `DepositDetails` — the merchant-budget set, titled \"Deposit Details\".\n */\nexport const transactionDetailsVariant = {\n MerchantBudget: 'merchant_budget',\n NoMerchantBudget: 'no_merchant_budget',\n DepositDetails: 'deposit_details',\n} as const\n\nexport type TransactionDetailsVariant =\n (typeof transactionDetailsVariant)[keyof typeof transactionDetailsVariant]\n\nconst VARIANT_CONFIG: Record<string, TransactionDetailsLayoutConfig> = {\n [transactionDetailsVariant.MerchantBudget]: WITH_MERCHANT_BUDGET,\n [transactionDetailsVariant.NoMerchantBudget]: WITHOUT_MERCHANT_BUDGET,\n [transactionDetailsVariant.DepositDetails]: {\n ...WITH_MERCHANT_BUDGET,\n title: (copy) => copy.insights_feed?.general?.deposit_details_title,\n },\n}\n\n/** A variant without its own row (null or unknown) gets the full action set; that's the common case, so no warning. */\nexport const resolveLayoutConfig = (\n variant: string | null | undefined,\n): TransactionDetailsLayoutConfig =>\n variant != null && Object.hasOwn(VARIANT_CONFIG, variant)\n ? VARIANT_CONFIG[variant]\n : WITH_MERCHANT_BUDGET\n\nexport const getTransactionDetailsDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n): string =>\n resolveLayoutConfig(variant).title?.(copy) ||\n copy.insights_feed?.general?.transaction_details_title ||\n ''\n"],"mappings":";AAWA,IAAM,IAAuD,EAC3D,eAAe,CAAC,EAAc,gBAAgB,GAAG,CAAsB,EACzE,GACM,IAA0D,EAC9D,eAAe,EACjB,GAUa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAKM,IAAiE;AAAA,EACpE,CAAA,EAA0B,cAAA,GAAiB;AAAA,EAC3C,CAAA,EAA0B,gBAAA,GAAmB;AAAA,EAC7C,CAAA,EAA0B,cAAA,GAAiB;AAAA,IAC1C,GAAG;AAAA,IACH,OAAA,CAAQ,MAAS,EAAK,eAAe,SAAS;AAAA,EAChD;AACF,GAGa,IAAA,CACX,MAEA,KAAW,QAAQ,OAAO,OAAO,GAAgB,CAAO,IACpD,EAAe,CAAA,IACf,GAEO,IAAA,CACX,GACA,MAEA,EAAoB,CAAO,EAAE,QAAQ,CAAI,KACzC,EAAK,eAAe,SAAS,6BAC7B"}
|