@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuarterlySummaryBlock: 'quarterly_summary_block',\n QuizBlock: 'quiz_block',\n FeedbackBlock: 'feedback_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n FeeChargedBlock: 'fee_charged_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AA0VA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[] | LogoRef\n>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** tupac's flat host message for the CTA (`action` plus fields); see `InDescriptionCTA`. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** tupac's flat host message for the CTA (`action` plus fields); see `InDescriptionCTA`. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuarterlySummaryBlock: 'quarterly_summary_block',\n QuizBlock: 'quiz_block',\n FeedbackBlock: 'feedback_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n FeeChargedBlock: 'fee_charged_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AA8VA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -6,6 +6,8 @@ export interface GeneralInsightsFeedCopy {
|
|
|
6
6
|
decreased_text: string;
|
|
7
7
|
/** "Deposit": the deposit summary drawer's bar legend. */
|
|
8
8
|
deposit?: string;
|
|
9
|
+
/** "Deposit Details": the transaction-details drawer title for the `deposit_details` variant. */
|
|
10
|
+
deposit_details_title?: string;
|
|
9
11
|
dismiss: string;
|
|
10
12
|
embedded_description: string;
|
|
11
13
|
error_heading: string;
|
|
@@ -151,6 +153,8 @@ export interface TransactionHistoryBlock {
|
|
|
151
153
|
account_balance_drawer_title: string;
|
|
152
154
|
upcoming_bill_drawer_title: string;
|
|
153
155
|
monthly_spend_to_income_drawer_title: string;
|
|
156
|
+
/** The Insights 2.0 Account Details chart title for a credit account (Figma 1943:219418). */
|
|
157
|
+
spend_vs_payment_title: string;
|
|
154
158
|
monthly_debt_to_income_drawer_title: string;
|
|
155
159
|
savings_to_income_drawer_title: string;
|
|
156
160
|
cost_living_to_income_drawer_title: string;
|
|
@@ -182,6 +186,8 @@ export interface TransactionHistoryBlock {
|
|
|
182
186
|
*/
|
|
183
187
|
savings_to_income_tip_message?: string;
|
|
184
188
|
savings_to_income_tip_percentage?: string;
|
|
189
|
+
/** Cost of Living drawer tip: `_1{tip}` title, `_2{category}` name, `_3{percentage}` threshold. Optional: no tip without it. */
|
|
190
|
+
cost_living_to_income_tip_message?: string;
|
|
185
191
|
}
|
|
186
192
|
export interface TransactionListBlockCopy {
|
|
187
193
|
deposit_history_drawer_title?: string;
|
|
@@ -574,12 +580,48 @@ export interface AccountListCopy {
|
|
|
574
580
|
recurring_expenses: string;
|
|
575
581
|
no_recurring_expenses: string;
|
|
576
582
|
}
|
|
583
|
+
/** `insights_feed.payoff_strategies`: the Debt Payoff Strategies drawer (`strategy_details_block`), worded as Figma 1943:219418. */
|
|
584
|
+
export interface PayoffStrategiesCopy {
|
|
585
|
+
title: string;
|
|
586
|
+
avalanche: string;
|
|
587
|
+
snowball: string;
|
|
588
|
+
strategy: string;
|
|
589
|
+
avalanche_strategy: string;
|
|
590
|
+
snowball_strategy: string;
|
|
591
|
+
pros: string;
|
|
592
|
+
cons: string;
|
|
593
|
+
avalanche_pro_one: string;
|
|
594
|
+
avalanche_pro_two: string;
|
|
595
|
+
avalanche_con_one: string;
|
|
596
|
+
avalanche_con_two: string;
|
|
597
|
+
snowball_pro_one: string;
|
|
598
|
+
snowball_pro_two: string;
|
|
599
|
+
snowball_con_one: string;
|
|
600
|
+
snowball_con_two: string;
|
|
601
|
+
how_to_get_started: string;
|
|
602
|
+
/** The steps carousel's arrow buttons (screen-reader names). */
|
|
603
|
+
previous_step_aria: string;
|
|
604
|
+
next_step_aria: string;
|
|
605
|
+
step_one: string;
|
|
606
|
+
step_two: string;
|
|
607
|
+
step_three: string;
|
|
608
|
+
step_one_text: string;
|
|
609
|
+
avalanche_step_two_text: string;
|
|
610
|
+
avalanche_step_three_text: string;
|
|
611
|
+
snowball_step_two_text: string;
|
|
612
|
+
snowball_step_three_text: string;
|
|
613
|
+
highest_to_lowest_rate: string;
|
|
614
|
+
interest_rate: string;
|
|
615
|
+
balance: string;
|
|
616
|
+
}
|
|
577
617
|
export interface InsightsFeedCopy {
|
|
578
618
|
general: GeneralInsightsFeedCopy;
|
|
579
619
|
settings_menu: SettingsMenuCopy;
|
|
580
620
|
make_transfer: MakeTransferCopy;
|
|
581
621
|
/** Optional until the localized-content service ships it; the drawer shows an error without it. */
|
|
582
622
|
remaining_cash?: RemainingCashCopy;
|
|
623
|
+
/** Optional until the localized-content service ships it; the drawer shows an error without it. */
|
|
624
|
+
payoff_strategies?: PayoffStrategiesCopy;
|
|
583
625
|
emergency_savings?: EmergencySavingsCopy;
|
|
584
626
|
overflow_menu: OverflowMenuCopy;
|
|
585
627
|
transaction_history_block: TransactionHistoryBlock;
|
|
@@ -13,7 +13,7 @@ export type { DebtsCopy } from './DebtsCopy';
|
|
|
13
13
|
export type { FinstrongCopy } from './FinstrongCopy';
|
|
14
14
|
export type { GoalsCopy } from './GoalsCopy';
|
|
15
15
|
export type { HelpCopy, HelpByCategoryList } from './HelpCopy';
|
|
16
|
-
export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, TopMerchantsCopy, TransactionHistoryBlock, QuarterlySummaryBlockCopy, } from './InsightsFeedCopy';
|
|
16
|
+
export type { AmountInputModalCopy, AmountInputModalVariantCopy, EmergencySavingsCopy, InsightsFeedCopy, MakeTransferCopy, PayoffCalculatorCopy, PayoffStrategiesCopy, RemainingCashCopy, OverdraftCopy, CreditUtilizationCopy, AccountListCopy, OverflowMenuCopy, DismissInsightCopy, DismissInsightOptionCopy, HiddenConfirmationCopy, HideFeedbackCopy, FeedbackCopy, FeedbackBarCopy, TopMerchantsCopy, TransactionHistoryBlock, QuarterlySummaryBlockCopy, } from './InsightsFeedCopy';
|
|
17
17
|
export type { InvestmentsCopy } from './InvestmentsCopy';
|
|
18
18
|
export type { MicroInsightsCopy } from './MicroInsightsCopy';
|
|
19
19
|
export type { NetWorthCopy } from './NetWorthCopy';
|
|
@@ -7,6 +7,12 @@ import { ActionBlockProps } from '../../mappings/blocks';
|
|
|
7
7
|
* members and institutions are in (the connection section reads the member's status): a guid the
|
|
8
8
|
* store cannot resolve shows the error message, never the previously selected account.
|
|
9
9
|
*/
|
|
10
|
-
export declare const AccountDetailsBlock: (({ beat, }: ActionBlockProps
|
|
10
|
+
export declare const AccountDetailsBlock: (({ beat, payoffStrategiesView, }: ActionBlockProps & {
|
|
11
|
+
/**
|
|
12
|
+
* The Debt Payoff Strategies drawer's Account Details (Figma 1943:219418): a credit card's Available credit under its
|
|
13
|
+
* balance and the Spend vs. Payment chart. Off for every other caller (Missing Interest Rate keeps its view).
|
|
14
|
+
*/
|
|
15
|
+
payoffStrategiesView?: boolean;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
11
17
|
displayName: string;
|
|
12
18
|
};
|
|
@@ -1,29 +1,48 @@
|
|
|
1
|
-
import { useAccountStore as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { useAccountStore as b, useGlobalCopyStore as y } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { INCOME_ACCOUNT_TYPES as g, PAYMENT_ACCOUNT_TYPES as E, SPENDING_ACCOUNT_TYPES as s } from "../../../common/constants/Account.es.js";
|
|
3
|
+
import i from "../../../common/components/Loader.es.js";
|
|
4
|
+
import T from "../../../trends/components/TrendsChart.es.js";
|
|
5
|
+
import { BlockErrorMessage as k } from "../BlockErrorMessage.es.js";
|
|
6
|
+
import a from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsChart.es.js";
|
|
7
|
+
import D from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
8
|
+
import { resolveAccount as N } from "./layout.es.js";
|
|
9
|
+
import { SpendVsIncomeChart as P } from "./SpendVsIncomeChart.es.js";
|
|
10
|
+
import { SpendVsPaymentChart as v } from "./SpendVsPaymentChart.es.js";
|
|
11
|
+
import x from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
12
|
+
import { useEffect as I } from "react";
|
|
13
|
+
import { observer as L } from "mobx-react-lite";
|
|
14
|
+
import M from "@mui/material/Stack";
|
|
15
|
+
import { jsx as e, jsxs as O } from "react/jsx-runtime";
|
|
16
|
+
var X = L(function({ beat: m, payoffStrategiesView: r = !1 }) {
|
|
17
|
+
const { accounts: d, accountsLoaded: u, institutionsLoaded: l, members: n, membersLoaded: p, uiStore: o } = b(), { accounts: f, insights_feed: c } = y(), t = N(m, d), _ = !!t && o.selectedAccount.guid === t.guid;
|
|
18
|
+
if (I(() => {
|
|
19
|
+
t && (o.setSelectedAccount(t), o.setSelectedMember(n.find((S) => S.guid === t.member_guid) ?? {}));
|
|
16
20
|
}, [
|
|
17
21
|
t,
|
|
18
|
-
|
|
22
|
+
n,
|
|
19
23
|
o
|
|
20
|
-
]), t
|
|
24
|
+
]), !t)
|
|
25
|
+
return u ? /* @__PURE__ */ e(k, {}) : /* @__PURE__ */ e(i, {});
|
|
26
|
+
if (!_ || !p || !l) return /* @__PURE__ */ e(i, {});
|
|
27
|
+
const C = g.includes(t.account_type) && s.includes(t.account_type), h = r && E.includes(t.account_type) && s.includes(t.account_type), A = C ? /* @__PURE__ */ e(a, {
|
|
28
|
+
ChartComponent: P,
|
|
29
|
+
header: c?.transaction_history_block?.monthly_spend_to_income_drawer_title ?? f.label_income_spend
|
|
30
|
+
}) : h ? /* @__PURE__ */ e(a, {
|
|
31
|
+
ChartComponent: v,
|
|
32
|
+
compactHeader: !0,
|
|
33
|
+
header: c?.transaction_history_block?.spend_vs_payment_title
|
|
34
|
+
}) : void 0;
|
|
35
|
+
return /* @__PURE__ */ O(M, {
|
|
21
36
|
sx: { bgcolor: "background.default" },
|
|
22
|
-
children: [/* @__PURE__ */ e(
|
|
23
|
-
|
|
37
|
+
children: [/* @__PURE__ */ e(D, {
|
|
38
|
+
ChartComponent: T,
|
|
39
|
+
customDetailsChart: A,
|
|
40
|
+
preferAvailableCredit: r
|
|
41
|
+
}), /* @__PURE__ */ e(x, {})]
|
|
42
|
+
});
|
|
24
43
|
});
|
|
25
44
|
export {
|
|
26
|
-
|
|
45
|
+
X as AccountDetailsBlock
|
|
27
46
|
};
|
|
28
47
|
|
|
29
48
|
//# sourceMappingURL=AccountDetailsBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport {
|
|
1
|
+
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsChart from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsChart'\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport {\n INCOME_ACCOUNT_TYPES,\n PAYMENT_ACCOUNT_TYPES,\n Loader,\n SPENDING_ACCOUNT_TYPES,\n useAccountStore,\n useGlobalCopyStore,\n} from '../../../common'\nimport type { Member } from '../../../core'\nimport TrendsChart from '../../../trends/components/TrendsChart'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport { resolveAccount } from './layout'\nimport { SpendVsIncomeChart } from './SpendVsIncomeChart'\nimport { SpendVsPaymentChart } from './SpendVsPaymentChart'\n\n/**\n * Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,\n * name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,\n * actions) for the beat's account. Those components read the account store's selection, so the\n * beat's account is selected here first and nothing renders until the selection matches and the\n * members and institutions are in (the connection section reads the member's status): a guid the\n * store cannot resolve shows the error message, never the previously selected account.\n */\nexport const AccountDetailsBlock = observer(function AccountDetailsBlock({\n beat,\n payoffStrategiesView = false,\n}: ActionBlockProps & {\n /**\n * The Debt Payoff Strategies drawer's Account Details (Figma 1943:219418): a credit card's Available credit under its\n * balance and the Spend vs. Payment chart. Off for every other caller (Missing Interest Rate keeps its view).\n */\n payoffStrategiesView?: boolean\n}) {\n const { accounts, accountsLoaded, institutionsLoaded, members, membersLoaded, uiStore } =\n useAccountStore()\n const { accounts: accountsCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const account = resolveAccount(beat, accounts)\n const isSelected = !!account && uiStore.selectedAccount.guid === account.guid\n\n useEffect(() => {\n if (!account) return\n\n uiStore.setSelectedAccount(account)\n uiStore.setSelectedMember(\n members.find((member) => member.guid === account.member_guid) ?? ({} as Member),\n )\n }, [account, members, uiStore])\n\n if (!account) {\n if (!accountsLoaded) return <Loader />\n\n return <BlockErrorMessage />\n }\n\n if (!isSelected || !membersLoaded || !institutionsLoaded) return <Loader />\n\n // Figma's Account Details charts: Spend vs. Income for income-and-spend accounts; in the payoff drawer, Spend vs.\n // Payment for credit (spending and payments) accounts; any other case keeps the accounts chart.\n const isIncomeAndSpend =\n INCOME_ACCOUNT_TYPES.includes(account.account_type) &&\n SPENDING_ACCOUNT_TYPES.includes(account.account_type)\n const isSpendAndPayment =\n payoffStrategiesView &&\n PAYMENT_ACCOUNT_TYPES.includes(account.account_type) &&\n SPENDING_ACCOUNT_TYPES.includes(account.account_type)\n const figmaChart = isIncomeAndSpend ? (\n <AccountDetailsChart\n ChartComponent={SpendVsIncomeChart}\n header={\n insightsCopy?.transaction_history_block?.monthly_spend_to_income_drawer_title ??\n accountsCopy.label_income_spend\n }\n />\n ) : isSpendAndPayment ? (\n <AccountDetailsChart\n ChartComponent={SpendVsPaymentChart}\n compactHeader={true}\n header={insightsCopy?.transaction_history_block?.spend_vs_payment_title}\n />\n ) : undefined\n\n return (\n <Stack sx={{ bgcolor: 'background.default' }}>\n <AccountDetailsHeader\n ChartComponent={TrendsChart}\n customDetailsChart={figmaChart}\n preferAvailableCredit={payoffStrategiesView}\n />\n <AccountDetailsContent />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,IAAa,IAAsB,EAAS,SAA6B,EACvE,MAAA,GACA,sBAAA,IAAuB,GAAA,GAOtB;AACD,QAAM,EAAE,UAAA,GAAU,gBAAA,GAAgB,oBAAA,GAAoB,SAAA,GAAS,eAAA,GAAe,SAAA,EAAA,IAC5E,EAAgB,GACZ,EAAE,UAAU,GAAc,eAAe,EAAA,IAAiB,EAAmB,GAC7E,IAAU,EAAe,GAAM,CAAQ,GACvC,IAAa,CAAC,CAAC,KAAW,EAAQ,gBAAgB,SAAS,EAAQ;AAWzE,MATA,EAAA,MAAgB;AACd,IAAK,MAEL,EAAQ,mBAAmB,CAAO,GAClC,EAAQ,kBACN,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAQ,WAAW,KAAM,CAAC,CACrE;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAS;AAAA,IAAS;AAAA,EAAO,CAAC,GAE1B,CAAC;AACH,WAAK,IAEE,gBAAA,EAAC,GAAD,CAAoB,CAAA,IAFC,gBAAA,EAAC,GAAD,CAAS,CAAA;AAKvC,MAAI,CAAC,KAAc,CAAC,KAAiB,CAAC,EAAoB,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAI1E,QAAM,IACJ,EAAqB,SAAS,EAAQ,YAAY,KAClD,EAAuB,SAAS,EAAQ,YAAY,GAChD,IACJ,KACA,EAAsB,SAAS,EAAQ,YAAY,KACnD,EAAuB,SAAS,EAAQ,YAAY,GAChD,IAAa,IACjB,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB;AAAA,IAChB,QACE,GAAc,2BAA2B,wCACzC,EAAa;AAAA,EAEhB,CAAA,IACC,IACF,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,QAAQ,GAAc,2BAA2B;AAAA,EAClD,CAAA,IACC;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,SAAS,qBAAqB;AAAA,IAA3C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB;AAAA,MAChB,oBAAoB;AAAA,MACpB,uBAAuB;AAAA,IACxB,CAAA,GACD,gBAAA,EAAC,GAAD,CAAwB,CAAA,CACnB;AAAA;AAEX,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCategoryStore as m, useGlobalCopyStore as c } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { LineChart as h } from "../../../common/components/charts/LineChart.es.js";
|
|
3
|
+
import { getIncomeTotals as l, getSpendingTotals as p } from "../../../trends/utils/SpendingData.es.js";
|
|
4
|
+
import { observer as u } from "mobx-react-lite";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as d } from "@mui/material/styles";
|
|
7
|
+
import g from "numeral";
|
|
8
|
+
var T = u(function() {
|
|
9
|
+
const t = d(), { monthlyCategoryTotals: e } = m(), { trends: o } = c(), r = p(e), a = l(e), s = { "& .MuiChartsAxis-tickLabel": { fontSize: t.typography.caption.fontSize } };
|
|
10
|
+
return /* @__PURE__ */ i("div", {
|
|
11
|
+
"data-testid": "SpendVsIncomeChart",
|
|
12
|
+
children: /* @__PURE__ */ i(h, {
|
|
13
|
+
colors: [t.palette.chart?.chart2, t.palette.chart?.chart1],
|
|
14
|
+
chartXaxisSx: s,
|
|
15
|
+
chartYaxisSx: s,
|
|
16
|
+
customLegendVariant: "caption",
|
|
17
|
+
datasets: [r, a],
|
|
18
|
+
height: 185,
|
|
19
|
+
labels: [{
|
|
20
|
+
label: o.spending_label,
|
|
21
|
+
amount: r.at(-1)?.y ?? 0
|
|
22
|
+
}, {
|
|
23
|
+
label: o.income_label,
|
|
24
|
+
amount: a.at(-1)?.y ?? 0
|
|
25
|
+
}],
|
|
26
|
+
showAxisHighlight: !0,
|
|
27
|
+
showLegend: !0,
|
|
28
|
+
showTooltip: !0,
|
|
29
|
+
showXAxis: !0,
|
|
30
|
+
showXAxisTicks: !0,
|
|
31
|
+
showYAxis: !0,
|
|
32
|
+
showYAxisTicks: !0,
|
|
33
|
+
valueFormatterString: "0,0",
|
|
34
|
+
yAxisValueFormatter: (n) => g(n).format("0a").toUpperCase()
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
T as SpendVsIncomeChart
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=SpendVsIncomeChart.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpendVsIncomeChart.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsIncomeChart.tsx"],"sourcesContent":["import numeral from 'numeral'\nimport { observer } from 'mobx-react-lite'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useCategoryStore, useGlobalCopyStore } from '../../../common'\nimport { LineChart } from '../../../common/components/charts/LineChart'\nimport { getIncomeTotals, getSpendingTotals } from '../../../trends/utils/SpendingData'\n\n/** Figma's Account Details chart: Spending then Income, compact \"1K\" y-axis, caption-sized text. */\nexport const SpendVsIncomeChart = observer(function SpendVsIncomeChart() {\n const theme = useTheme()\n const { monthlyCategoryTotals } = useCategoryStore()\n const { trends: trendsCopy } = useGlobalCopyStore()\n\n const spending = getSpendingTotals(monthlyCategoryTotals)\n const income = getIncomeTotals(monthlyCategoryTotals)\n const tickLabelSx = {\n '& .MuiChartsAxis-tickLabel': { fontSize: theme.typography.caption.fontSize },\n }\n\n return (\n <div data-testid=\"SpendVsIncomeChart\">\n <LineChart\n colors={[theme.palette.chart?.chart2, theme.palette.chart?.chart1]}\n chartXaxisSx={tickLabelSx}\n chartYaxisSx={tickLabelSx}\n customLegendVariant=\"caption\"\n datasets={[spending, income]}\n height={185}\n labels={[\n { label: trendsCopy.spending_label, amount: spending.at(-1)?.y ?? 0 },\n { label: trendsCopy.income_label, amount: income.at(-1)?.y ?? 0 },\n ]}\n showAxisHighlight={true}\n showLegend={true}\n showTooltip={true}\n showXAxis={true}\n showXAxisTicks={true}\n showYAxis={true}\n showYAxisTicks={true}\n valueFormatterString=\"0,0\"\n yAxisValueFormatter={(value) => numeral(value).format('0a').toUpperCase()}\n />\n </div>\n )\n})\n"],"mappings":";;;;;;;AAUA,IAAa,IAAqB,EAAS,WAA8B;AACvE,QAAM,IAAQ,EAAS,GACjB,EAAE,uBAAA,EAAA,IAA0B,EAAiB,GAC7C,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAE5C,IAAW,EAAkB,CAAqB,GAClD,IAAS,EAAgB,CAAqB,GAC9C,IAAc,EAClB,8BAA8B,EAAE,UAAU,EAAM,WAAW,QAAQ,SAAS,EAC9E;AAEA,SACE,gBAAA,EAAC,OAAD;AAAA,IAAK,eAAY;AAAA,IACf,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,CAAC,EAAM,QAAQ,OAAO,QAAQ,EAAM,QAAQ,OAAO,MAAM;AAAA,MACjE,cAAc;AAAA,MACd,cAAc;AAAA,MACd,qBAAoB;AAAA,MACpB,UAAU,CAAC,GAAU,CAAM;AAAA,MAC3B,QAAQ;AAAA,MACR,QAAQ,CACN;AAAA,QAAE,OAAO,EAAW;AAAA,QAAgB,QAAQ,EAAS,GAAG,EAAE,GAAG,KAAK;AAAA,MAAE,GACpE;AAAA,QAAE,OAAO,EAAW;AAAA,QAAc,QAAQ,EAAO,GAAG,EAAE,GAAG,KAAK;AAAA,MAAE,CAClE;AAAA,MACA,mBAAmB;AAAA,MACnB,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,sBAAqB;AAAA,MACrB,qBAAA,CAAsB,MAAU,EAAQ,CAAK,EAAE,OAAO,IAAI,EAAE,YAAY;AAAA,IACzE,CAAA;AAAA,EACE,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma's Credit Account Details chart (1943:219418): Spending (chart2, pink) then Payments (chart6, lavender), white
|
|
3
|
+
* dots ringed in the line colour, 10px square legend chips, 9px axis labels and a compact "1K" y-axis.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SpendVsPaymentChart: (() => import("react/jsx-runtime").JSX.Element) & {
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useCategoryStore as m, useGlobalCopyStore as p } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { LineChart as c } from "../../../common/components/charts/LineChart.es.js";
|
|
3
|
+
import { getPaymentTotals as h, getSpendingTotals as d } from "../../../trends/utils/SpendingData.es.js";
|
|
4
|
+
import { observer as u } from "mobx-react-lite";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as x } from "@mui/material/styles";
|
|
7
|
+
import g from "numeral";
|
|
8
|
+
var w = u(function() {
|
|
9
|
+
const t = x(), { monthlyCategoryTotals: e } = m(), { trends: a } = p(), o = d(e), r = h(e), n = [t.palette.chart?.chart2, t.palette.chart?.chart6], s = {
|
|
10
|
+
"& .MuiChartsAxis-tickLabel": { fill: t.palette.text.secondary },
|
|
11
|
+
"& .MuiChartsAxis-line, & .MuiChartsAxis-tick": { stroke: t.palette.divider }
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ i("div", {
|
|
14
|
+
"data-testid": "SpendVsPaymentChart",
|
|
15
|
+
children: /* @__PURE__ */ i(c, {
|
|
16
|
+
axisColor: t.palette.divider,
|
|
17
|
+
circleMarks: !0,
|
|
18
|
+
tickLabelFontSize: 9,
|
|
19
|
+
chartXaxisSx: s,
|
|
20
|
+
chartYaxisSx: s,
|
|
21
|
+
colors: n,
|
|
22
|
+
customLegendBoxSx: { borderRadius: "2px" },
|
|
23
|
+
customLegendSx: {
|
|
24
|
+
left: 24,
|
|
25
|
+
top: 4
|
|
26
|
+
},
|
|
27
|
+
customLegendVariant: "caption",
|
|
28
|
+
datasets: [o, r],
|
|
29
|
+
height: 160,
|
|
30
|
+
labels: [{
|
|
31
|
+
label: a.spending_label,
|
|
32
|
+
amount: o.at(-1)?.y ?? 0
|
|
33
|
+
}, {
|
|
34
|
+
label: a.payments_label,
|
|
35
|
+
amount: r.at(-1)?.y ?? 0
|
|
36
|
+
}],
|
|
37
|
+
margin: { top: 40 },
|
|
38
|
+
showAxisHighlight: !0,
|
|
39
|
+
showLegend: !0,
|
|
40
|
+
showTooltip: !0,
|
|
41
|
+
showXAxis: !0,
|
|
42
|
+
showXAxisTicks: !1,
|
|
43
|
+
showYAxis: !1,
|
|
44
|
+
showYAxisTicks: !1,
|
|
45
|
+
valueFormatterString: "0,0",
|
|
46
|
+
yAxisValueFormatter: (l) => g(l).format("0a").toUpperCase()
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
w as SpendVsPaymentChart
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=SpendVsPaymentChart.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpendVsPaymentChart.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/SpendVsPaymentChart.tsx"],"sourcesContent":["import numeral from 'numeral'\nimport { observer } from 'mobx-react-lite'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useCategoryStore, useGlobalCopyStore } from '../../../common'\nimport { LineChart } from '../../../common/components/charts/LineChart'\nimport { getPaymentTotals, getSpendingTotals } from '../../../trends/utils/SpendingData'\n\n/**\n * Figma's Credit Account Details chart (1943:219418): Spending (chart2, pink) then Payments (chart6, lavender), white\n * dots ringed in the line colour, 10px square legend chips, 9px axis labels and a compact \"1K\" y-axis.\n */\nexport const SpendVsPaymentChart = observer(function SpendVsPaymentChart() {\n const theme = useTheme()\n const { monthlyCategoryTotals } = useCategoryStore()\n const { trends: trendsCopy } = useGlobalCopyStore()\n\n const spending = getSpendingTotals(monthlyCategoryTotals)\n const payments = getPaymentTotals(monthlyCategoryTotals)\n const colors = [theme.palette.chart?.chart2, theme.palette.chart?.chart6]\n const tickLabelSx = {\n '& .MuiChartsAxis-tickLabel': { fill: theme.palette.text.secondary },\n '& .MuiChartsAxis-line, & .MuiChartsAxis-tick': { stroke: theme.palette.divider },\n }\n\n return (\n <div data-testid=\"SpendVsPaymentChart\">\n <LineChart\n axisColor={theme.palette.divider}\n circleMarks={true}\n // Figma's 9px axis labels (MXUI's tiny).\n tickLabelFontSize={9}\n chartXaxisSx={tickLabelSx}\n chartYaxisSx={tickLabelSx}\n colors={colors}\n customLegendBoxSx={{ borderRadius: '2px' }}\n customLegendSx={{ left: 24, top: 4 }}\n customLegendVariant=\"caption\"\n datasets={[spending, payments]}\n height={160}\n labels={[\n { label: trendsCopy.spending_label, amount: spending.at(-1)?.y ?? 0 },\n { label: trendsCopy.payments_label, amount: payments.at(-1)?.y ?? 0 },\n ]}\n margin={{ top: 40 }}\n showAxisHighlight={true}\n showLegend={true}\n showTooltip={true}\n showXAxis={true}\n showXAxisTicks={false}\n showYAxis={false}\n showYAxisTicks={false}\n valueFormatterString=\"0,0\"\n yAxisValueFormatter={(value) => numeral(value).format('0a').toUpperCase()}\n />\n </div>\n )\n})\n"],"mappings":";;;;;;;AAaA,IAAa,IAAsB,EAAS,WAA+B;AACzE,QAAM,IAAQ,EAAS,GACjB,EAAE,uBAAA,EAAA,IAA0B,EAAiB,GAC7C,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAE5C,IAAW,EAAkB,CAAqB,GAClD,IAAW,EAAiB,CAAqB,GACjD,IAAS,CAAC,EAAM,QAAQ,OAAO,QAAQ,EAAM,QAAQ,OAAO,MAAM,GAClE,IAAc;AAAA,IAClB,8BAA8B,EAAE,MAAM,EAAM,QAAQ,KAAK,UAAU;AAAA,IACnE,gDAAgD,EAAE,QAAQ,EAAM,QAAQ,QAAQ;AAAA,EAClF;AAEA,SACE,gBAAA,EAAC,OAAD;AAAA,IAAK,eAAY;AAAA,IACf,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,WAAW,EAAM,QAAQ;AAAA,MACzB,aAAa;AAAA,MAEb,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,cAAc;AAAA,MACN,QAAA;AAAA,MACR,mBAAmB,EAAE,cAAc,MAAM;AAAA,MACzC,gBAAgB;AAAA,QAAE,MAAM;AAAA,QAAI,KAAK;AAAA,MAAE;AAAA,MACnC,qBAAoB;AAAA,MACpB,UAAU,CAAC,GAAU,CAAQ;AAAA,MAC7B,QAAQ;AAAA,MACR,QAAQ,CACN;AAAA,QAAE,OAAO,EAAW;AAAA,QAAgB,QAAQ,EAAS,GAAG,EAAE,GAAG,KAAK;AAAA,MAAE,GACpE;AAAA,QAAE,OAAO,EAAW;AAAA,QAAgB,QAAQ,EAAS,GAAG,EAAE,GAAG,KAAK;AAAA,MAAE,CACtE;AAAA,MACA,QAAQ,EAAE,KAAK,GAAG;AAAA,MAClB,mBAAmB;AAAA,MACnB,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,sBAAqB;AAAA,MACrB,qBAAA,CAAsB,MAAU,EAAQ,CAAK,EAAE,OAAO,IAAI,EAAE,YAAY;AAAA,IACzE,CAAA;AAAA,EACE,CAAA;AAET,CAAC"}
|
|
@@ -6,10 +6,10 @@ import eo from "../../../common/components/CurrencyDialog.es.js";
|
|
|
6
6
|
import { useBeatActions as to } from "../../beatActions.es.js";
|
|
7
7
|
import { useCtaHandler as io } from "../../ctaActions/useCtaAction.es.js";
|
|
8
8
|
import { useAnalyticsEvent as no } from "../../analytics/useAnalyticsEvent.es.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { AMOUNT_SETTINGS as ro, CREATE_BUDGET_VARIANT as so, findLowBalanceProfile as ao, isAmountInputVariant as L, resolveAmountInputVariant as co, toInputValue as lo } from "./layout.es.js";
|
|
10
|
+
import { useOpenedCta as uo } from "../useOpenedCta.es.js";
|
|
11
|
+
import { useBlockSave as mo } from "../useBlockSave.es.js";
|
|
12
|
+
import { CreateBudgetDialog as po } from "./CreateBudgetDialog.es.js";
|
|
13
13
|
import c from "react";
|
|
14
14
|
import { observer as k } from "mobx-react-lite";
|
|
15
15
|
import N from "@mui/material/Stack";
|
|
@@ -55,10 +55,10 @@ var _ = ({ children: y, closeAriaLabel: i, heading: n, onClose: t }) => {
|
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}, Fo = k(function({ beat: i }) {
|
|
58
|
-
const { common: n } = w(), { closeActionDrawer: t } = B(), r = Y(), a =
|
|
58
|
+
const { common: n } = w(), { closeActionDrawer: t } = B(), r = Y(), a = uo(i), [l] = c.useState(() => co(a)), d = l === so;
|
|
59
59
|
return c.useEffect(() => {
|
|
60
60
|
d && !r.categoriesLoaded && r.loadCategories();
|
|
61
|
-
}, [r, d]), d ? r.categoriesLoaded ? /* @__PURE__ */ e(
|
|
61
|
+
}, [r, d]), d ? r.categoriesLoaded ? /* @__PURE__ */ e(po, { beat: i }) : /* @__PURE__ */ e(_, {
|
|
62
62
|
closeAriaLabel: n?.close_aria,
|
|
63
63
|
onClose: t,
|
|
64
64
|
children: /* @__PURE__ */ e(E, {})
|
|
@@ -67,16 +67,16 @@ var _ = ({ children: y, closeAriaLabel: i, heading: n, onClose: t }) => {
|
|
|
67
67
|
variant: l
|
|
68
68
|
});
|
|
69
69
|
}), _o = k(function({ beat: i, variant: n }) {
|
|
70
|
-
const { common: t, insights_feed: r } = w(), { closeActionDrawer: a } = B(), l = Z(), { userInsightProfile: d } = oo(), M = io(i, to()), C = no(), u = r?.amount_input_modal, o = L(n) ?
|
|
70
|
+
const { common: t, insights_feed: r } = w(), { closeActionDrawer: a } = B(), l = Z(), { userInsightProfile: d } = oo(), M = io(i, to()), C = no(), u = r?.amount_input_modal, o = L(n) ? ro[n] : void 0, m = !!o?.needsNotificationProfiles, g = {
|
|
71
71
|
insightProfile: d,
|
|
72
|
-
lowBalanceProfile: m ?
|
|
73
|
-
}, S = o?.read(g), [R, $] = c.useState(m), { isMounted: G, isSaving: F, save: H } =
|
|
72
|
+
lowBalanceProfile: m ? ao(l.notificationProfiles, i.primary_account_guid) : void 0
|
|
73
|
+
}, S = o?.read(g), [R, $] = c.useState(m), { isMounted: G, isSaving: F, save: H } = mo();
|
|
74
74
|
c.useEffect(() => {
|
|
75
75
|
m && l.loadNotificationProfiles().finally(() => {
|
|
76
76
|
G.current && $(!1);
|
|
77
77
|
});
|
|
78
78
|
}, [m, l]);
|
|
79
|
-
const [O, U] = c.useState(null), [j, h] = c.useState(!1), p = O ??
|
|
79
|
+
const [O, U] = c.useState(null), [j, h] = c.useState(!1), p = O ?? lo(S);
|
|
80
80
|
if (R) return /* @__PURE__ */ e(_, {
|
|
81
81
|
closeAriaLabel: t?.close_aria,
|
|
82
82
|
onClose: a,
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
1
|
+
import { buildDynamicCopy as _ } from "../../../core/utils/Localization.es.js";
|
|
2
2
|
import { useCategoryStore as F, useGlobalCopyStore as L, useInsightsV2Store as R } from "../../../common/context/hooks.es.js";
|
|
3
|
-
import { slot as
|
|
4
|
-
import { CURRENCY_FORMAT as w, formatCurrency as
|
|
5
|
-
import { getLocalizedCategoryName as
|
|
6
|
-
import
|
|
7
|
-
import { useBeatActions as
|
|
8
|
-
import {
|
|
3
|
+
import { slot as f } from "../../../core/types/Insights.es.js";
|
|
4
|
+
import { CURRENCY_FORMAT as w, formatCurrency as G } from "../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import { getLocalizedCategoryName as I } from "../../../core/utils/CategoryUtil.es.js";
|
|
6
|
+
import O from "../../../common/components/CurrencyDialog.es.js";
|
|
7
|
+
import { useBeatActions as P } from "../../beatActions.es.js";
|
|
8
|
+
import { asNonEmptyText as j } from "../../blocks/slotReaders.es.js";
|
|
9
|
+
import { isPositiveAmount as C, resolveBudgetFacts as E } from "../BudgetDetailsBlock/layout.es.js";
|
|
9
10
|
import { useCtaHandler as H } from "../../ctaActions/useCtaAction.es.js";
|
|
10
11
|
import M from "../../components/shared/StatusSnackbar.es.js";
|
|
11
12
|
import { useBlockSave as V } from "../useBlockSave.es.js";
|
|
12
13
|
import n from "react";
|
|
13
14
|
import { observer as z } from "mobx-react-lite";
|
|
14
|
-
import { jsx as l, jsxs as
|
|
15
|
-
var
|
|
16
|
-
const { budgets: t, categories:
|
|
17
|
-
if (!
|
|
18
|
-
const e = await
|
|
19
|
-
categoryGuid:
|
|
15
|
+
import { jsx as l, jsxs as U } from "react/jsx-runtime";
|
|
16
|
+
var ie = z(function({ beat: s }) {
|
|
17
|
+
const { budgets: t, categories: b, common: o, insights_feed: h } = L(), v = F(), { closeActionDrawer: i } = R(), S = H(s, P()), m = s.insights_payload, u = j(f(m?.instance_slot?.data, "budget_category_guid")) ?? E(s).categoryGuid ?? "", A = f(m?.instance_slot?.data, "average_amount") ?? 0, d = v.categories.find(({ guid: e }) => e === u), g = d ? I(d, b) : "", [r, x] = n.useState(""), [B, p] = n.useState(!0), [a, c] = n.useState(null), { isSaving: D, save: N } = V(), y = (e) => _(e, g), T = C(r) && !D, k = async () => {
|
|
18
|
+
if (!C(r)) return;
|
|
19
|
+
const e = await N(() => S("createBudget", {
|
|
20
|
+
categoryGuid: u,
|
|
20
21
|
amount: Number(r)
|
|
21
22
|
}, { onSuccess: ["refreshBeat"] }));
|
|
22
|
-
e !== void 0 && (
|
|
23
|
+
e !== void 0 && (p(!1), c(e ? "created" : "failed"));
|
|
23
24
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ U(n.Fragment, { children: [/* @__PURE__ */ l(O, {
|
|
25
26
|
closeAriaLabel: o.close_aria,
|
|
26
|
-
content:
|
|
27
|
-
handleInputChange:
|
|
27
|
+
content: _(t.create_budget_content, /* @__PURE__ */ l("strong", { children: g }, "category"), G(A, w.whole)),
|
|
28
|
+
handleInputChange: x,
|
|
28
29
|
handleModalClose: i,
|
|
29
30
|
handlePrimaryAction: () => {
|
|
30
31
|
k();
|
|
@@ -32,17 +33,17 @@ var ne = z(function({ beat: s }) {
|
|
|
32
33
|
handleSecondaryAction: i,
|
|
33
34
|
inputLabel: o.amount_text,
|
|
34
35
|
inputValue: r,
|
|
35
|
-
isOpen:
|
|
36
|
-
isPrimaryDisabled: !
|
|
36
|
+
isOpen: B,
|
|
37
|
+
isPrimaryDisabled: !T,
|
|
37
38
|
primaryText: t.dialog_primary_button_text,
|
|
38
39
|
secondaryText: o.cancel_button,
|
|
39
40
|
title: t.dialog_create_budget_title
|
|
40
41
|
}), /* @__PURE__ */ l(M, {
|
|
41
|
-
actionText: a === "failed" ?
|
|
42
|
+
actionText: a === "failed" ? h?.general?.try_again : void 0,
|
|
42
43
|
closeAriaLabel: o.close_aria,
|
|
43
|
-
message:
|
|
44
|
+
message: y(a === "created" ? t.alert_budget_created : t.alert_merchant_budget_not_created),
|
|
44
45
|
onActionClick: () => {
|
|
45
|
-
c(null),
|
|
46
|
+
c(null), p(!0);
|
|
46
47
|
},
|
|
47
48
|
onClose: () => {
|
|
48
49
|
c(null), i();
|
|
@@ -52,7 +53,7 @@ var ne = z(function({ beat: s }) {
|
|
|
52
53
|
})] });
|
|
53
54
|
});
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
ie as CreateBudgetDialog
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
//# sourceMappingURL=CreateBudgetDialog.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateBudgetDialog.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n CurrencyDialog,\n buildDynamicCopy,\n useCategoryStore,\n useGlobalCopyStore,\n useInsightsV2Store,\n} from '../../../common'\nimport { slot } from '../../../core/types/Insights'\nimport { getLocalizedCategoryName } from '../../../core/utils/CategoryUtil'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport StatusSnackbar from '../../components/shared/StatusSnackbar'\nimport { useBeatActions } from '../../beatActions'\nimport { useCtaHandler } from '../../ctaActions'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { isPositiveAmount, resolveBudgetFacts } from '../BudgetDetailsBlock/layout'\nimport { useBlockSave } from '../useBlockSave'\n\ntype Notice = 'created' | 'failed'\n\n/** The \"Create a Budget\" dialog (mounted once categories load): creates the budget, refreshes the beat, shows the result. */\nexport const CreateBudgetDialog = observer(function CreateBudgetDialog({ beat }: ActionBlockProps) {\n const {\n budgets: budgetsCopy,\n categories: categoriesCopy,\n common: commonCopy,\n insights_feed: insightsFeedCopy,\n } = useGlobalCopyStore()\n const categoryStore = useCategoryStore()\n const { closeActionDrawer } = useInsightsV2Store()\n const runHandler = useCtaHandler(beat, useBeatActions())\n\n const payload = beat.insights_payload\n const
|
|
1
|
+
{"version":3,"file":"CreateBudgetDialog.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n CurrencyDialog,\n buildDynamicCopy,\n useCategoryStore,\n useGlobalCopyStore,\n useInsightsV2Store,\n} from '../../../common'\nimport { slot } from '../../../core/types/Insights'\nimport { getLocalizedCategoryName } from '../../../core/utils/CategoryUtil'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport StatusSnackbar from '../../components/shared/StatusSnackbar'\nimport { useBeatActions } from '../../beatActions'\nimport { useCtaHandler } from '../../ctaActions'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { isPositiveAmount, resolveBudgetFacts } from '../BudgetDetailsBlock/layout'\nimport { asNonEmptyText } from '../../blocks/slotReaders'\nimport { useBlockSave } from '../useBlockSave'\n\ntype Notice = 'created' | 'failed'\n\n/** The \"Create a Budget\" dialog (mounted once categories load): creates the budget, refreshes the beat, shows the result. */\nexport const CreateBudgetDialog = observer(function CreateBudgetDialog({ beat }: ActionBlockProps) {\n const {\n budgets: budgetsCopy,\n categories: categoriesCopy,\n common: commonCopy,\n insights_feed: insightsFeedCopy,\n } = useGlobalCopyStore()\n const categoryStore = useCategoryStore()\n const { closeActionDrawer } = useInsightsV2Store()\n const runHandler = useCtaHandler(beat, useBeatActions())\n\n const payload = beat.insights_payload\n // A beat that colours by a parent category budgets its own (Cost of Living's budget_category_guid).\n const categoryGuid =\n asNonEmptyText(slot<string>(payload?.instance_slot?.data, 'budget_category_guid')) ??\n resolveBudgetFacts(beat).categoryGuid ??\n ''\n const averageAmount = slot<number>(payload?.instance_slot?.data, 'average_amount') ?? 0\n const category = categoryStore.categories.find(({ guid }) => guid === categoryGuid)\n const categoryName = category ? getLocalizedCategoryName(category, categoriesCopy) : ''\n\n const [amount, setAmount] = React.useState('')\n const [isOpen, setIsOpen] = React.useState(true)\n const [notice, setNotice] = React.useState<Notice | null>(null)\n const { isSaving, save } = useBlockSave()\n\n const named = (copy: string) => buildDynamicCopy(copy, categoryName) as string\n\n const canCreate = isPositiveAmount(amount) && !isSaving\n\n const handleCreate = async () => {\n if (!isPositiveAmount(amount)) return\n\n const ok = await save(() =>\n runHandler(\n 'createBudget',\n { categoryGuid, amount: Number(amount) },\n { onSuccess: ['refreshBeat'] },\n ),\n )\n if (ok === undefined) return\n\n setIsOpen(false)\n setNotice(ok ? 'created' : 'failed')\n }\n\n return (\n <React.Fragment>\n <CurrencyDialog\n closeAriaLabel={commonCopy.close_aria}\n content={\n buildDynamicCopy(\n budgetsCopy.create_budget_content,\n <strong key=\"category\">{categoryName}</strong>,\n formatCurrency(averageAmount, CURRENCY_FORMAT.whole),\n ) as React.ReactNode\n }\n handleInputChange={setAmount}\n handleModalClose={closeActionDrawer}\n handlePrimaryAction={() => void handleCreate()}\n handleSecondaryAction={closeActionDrawer}\n inputLabel={commonCopy.amount_text}\n inputValue={amount}\n isOpen={isOpen}\n isPrimaryDisabled={!canCreate}\n primaryText={budgetsCopy.dialog_primary_button_text}\n secondaryText={commonCopy.cancel_button}\n title={budgetsCopy.dialog_create_budget_title}\n />\n <StatusSnackbar\n actionText={notice === 'failed' ? insightsFeedCopy?.general?.try_again : undefined}\n closeAriaLabel={commonCopy.close_aria}\n message={\n notice === 'created'\n ? named(budgetsCopy.alert_budget_created)\n : named(budgetsCopy.alert_merchant_budget_not_created)\n }\n onActionClick={() => {\n setNotice(null)\n setIsOpen(true)\n }}\n onClose={() => {\n setNotice(null)\n closeActionDrawer()\n }}\n open={Boolean(notice)}\n severity={notice === 'created' ? 'success' : 'error'}\n />\n </React.Fragment>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,IAAa,KAAqB,EAAS,SAA4B,EAAE,MAAA,EAAA,GAA0B;AACjG,QAAM,EACJ,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,eAAe,EAAA,IACb,EAAmB,GACjB,IAAgB,EAAiB,GACjC,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,IAAa,EAAc,GAAM,EAAe,CAAC,GAEjD,IAAU,EAAK,kBAEf,IACJ,EAAe,EAAa,GAAS,eAAe,MAAM,sBAAsB,CAAC,KACjF,EAAmB,CAAI,EAAE,gBACzB,IACI,IAAgB,EAAa,GAAS,eAAe,MAAM,gBAAgB,KAAK,GAChF,IAAW,EAAc,WAAW,KAAA,CAAM,EAAE,MAAA,EAAA,MAAW,MAAS,CAAY,GAC5E,IAAe,IAAW,EAAyB,GAAU,CAAc,IAAI,IAE/E,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAE,GACvC,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAI,GACzC,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAwB,IAAI,GACxD,EAAE,UAAA,GAAU,MAAA,EAAA,IAAS,EAAa,GAElC,IAAA,CAAS,MAAiB,EAAiB,GAAM,CAAY,GAE7D,IAAY,EAAiB,CAAM,KAAK,CAAC,GAEzC,IAAe,YAAY;AAC/B,QAAI,CAAC,EAAiB,CAAM,EAAG;AAE/B,UAAM,IAAK,MAAM,EAAA,MACf,EACE,gBACA;AAAA,MAAE,cAAA;AAAA,MAAc,QAAQ,OAAO,CAAM;AAAA,IAAE,GACvC,EAAE,WAAW,CAAC,aAAa,EAAE,CAC/B,CACF;AACA,IAAI,MAAO,WAEX,EAAU,EAAK,GACf,EAAU,IAAK,YAAY,QAAQ;AAAA,EACrC;AAEA,SACE,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,SACE,EACE,EAAY,uBACZ,gBAAA,EAAC,UAAD,EAAA,UAAwB,EAAqB,GAAjC,UAAiC,GAC7C,EAAe,GAAe,EAAgB,KAAK,CACrD;AAAA,IAEF,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,qBAAA,MAAA;AAA2B,MAAK,EAAa;AAAA;AAAA,IAC7C,uBAAuB;AAAA,IACvB,YAAY,EAAW;AAAA,IACvB,YAAY;AAAA,IACJ,QAAA;AAAA,IACR,mBAAmB,CAAC;AAAA,IACpB,aAAa,EAAY;AAAA,IACzB,eAAe,EAAW;AAAA,IAC1B,OAAO,EAAY;AAAA,EACpB,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,MAAW,WAAW,GAAkB,SAAS,YAAY;AAAA,IACzE,gBAAgB,EAAW;AAAA,IAC3B,SAEM,EADJ,MAAW,YACD,EAAY,uBACZ,EAAY,iCADoB;AAAA,IAG5C,eAAA,MAAqB;AACnB,MAAA,EAAU,IAAI,GACd,EAAU,EAAI;AAAA,IAChB;AAAA,IACA,SAAA,MAAe;AACb,MAAA,EAAU,IAAI,GACd,EAAkB;AAAA,IACpB;AAAA,IACA,MAAM,EAAQ;AAAA,IACd,UAAU,MAAW,YAAY,YAAY;AAAA,EAC9C,CAAA,CACa,EAAA,CAAA;AAEpB,CAAC"}
|