@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
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export interface TransactionListHeaderIconTileProps {
|
|
2
2
|
/** An mx-icons name. */
|
|
3
3
|
name: string;
|
|
4
|
+
/** Glyph size in px, inside the fixed 56px tile. Default 24. */
|
|
5
|
+
size?: 24 | 32;
|
|
6
|
+
/** Glyph color. Default `primary.main`. */
|
|
7
|
+
color?: 'primary.main' | 'primary.dark';
|
|
8
|
+
outlined?: boolean;
|
|
4
9
|
}
|
|
5
10
|
/** The icon tile that leads the Transaction List header cards. */
|
|
6
|
-
export declare const TransactionListHeaderIconTile: ({ name }: TransactionListHeaderIconTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const TransactionListHeaderIconTile: ({ name, size, color, outlined, }: TransactionListHeaderIconTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
12
|
export default TransactionListHeaderIconTile;
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { alpha as
|
|
4
|
-
import
|
|
5
|
-
var
|
|
1
|
+
import { Icon as n } from "@mxenabled/mx-icons";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { alpha as l } from "@mui/material/styles";
|
|
4
|
+
import m from "@mui/material/Box";
|
|
5
|
+
var c = ({ name: r, size: a = 24, color: t = "primary.main", outlined: e = !1 }) => /* @__PURE__ */ i(m, {
|
|
6
6
|
sx: {
|
|
7
7
|
alignItems: "center",
|
|
8
|
-
bgcolor: (
|
|
8
|
+
bgcolor: (o) => l(o.palette.primary.main, 0.15),
|
|
9
9
|
borderRadius: "4px",
|
|
10
|
-
color:
|
|
10
|
+
color: t,
|
|
11
11
|
display: "flex",
|
|
12
12
|
height: 56,
|
|
13
13
|
justifyContent: "center",
|
|
14
14
|
width: 56
|
|
15
15
|
},
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ i(n, {
|
|
17
17
|
"aria-hidden": !0,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
"data-icon": r,
|
|
19
|
+
fill: !e,
|
|
20
|
+
name: r,
|
|
21
|
+
size: a
|
|
21
22
|
})
|
|
22
23
|
});
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
c as TransactionListHeaderIconTile,
|
|
26
|
+
c as default
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
//# sourceMappingURL=TransactionListHeaderIconTile.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListHeaderIconTile.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nexport interface TransactionListHeaderIconTileProps {\n /** An mx-icons name. */\n name: string\n}\n\n/** The icon tile that leads the Transaction List header cards. */\nexport const TransactionListHeaderIconTile = ({
|
|
1
|
+
{"version":3,"file":"TransactionListHeaderIconTile.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nexport interface TransactionListHeaderIconTileProps {\n /** An mx-icons name. */\n name: string\n /** Glyph size in px, inside the fixed 56px tile. Default 24. */\n size?: 24 | 32\n /** Glyph color. Default `primary.main`. */\n color?: 'primary.main' | 'primary.dark'\n outlined?: boolean\n}\n\n/** The icon tile that leads the Transaction List header cards. */\nexport const TransactionListHeaderIconTile = ({\n name,\n size = 24,\n color = 'primary.main',\n outlined = false,\n}: TransactionListHeaderIconTileProps) => (\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.15),\n borderRadius: '4px',\n color,\n display: 'flex',\n height: 56,\n justifyContent: 'center',\n width: 56,\n }}\n >\n <Icon aria-hidden={true} data-icon={name} fill={!outlined} name={name} size={size} />\n </Box>\n)\n\nexport default TransactionListHeaderIconTile\n"],"mappings":";;;;AAgBA,IAAa,IAAA,CAAiC,EAC5C,MAAA,GACA,MAAA,IAAO,IACP,OAAA,IAAQ,gBACR,UAAA,IAAW,GAAA,MAEX,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAAA,CAAU,MAAU,EAAM,EAAM,QAAQ,QAAQ,MAAM,IAAI;AAAA,IAC1D,cAAc;AAAA,IACd,OAAA;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,OAAO;AAAA,EACT;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,eAAa;AAAA,IAAM,aAAW;AAAA,IAAM,MAAM,CAAC;AAAA,IAAgB,MAAA;AAAA,IAAY,MAAA;AAAA,EAAO,CAAA;AACjF,CAAA"}
|
|
@@ -6,14 +6,15 @@ export interface TransactionListSummaryCardProps {
|
|
|
6
6
|
count: number;
|
|
7
7
|
/** Only the two pill-copy keys the card reads. */
|
|
8
8
|
copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>;
|
|
9
|
+
outlinedIcon?: boolean;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Summary header for the Transaction List drawer: a white card with a themed icon tile, the date
|
|
12
13
|
* range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary
|
|
13
14
|
* figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.
|
|
14
15
|
*
|
|
15
|
-
* Figma: Drilldown | Replenish Savings ("Savings Withdrawal")
|
|
16
|
-
*
|
|
16
|
+
* Figma: Drilldown | Replenish Savings ("Savings Withdrawal"), Weekly Small Purchases Summary. The
|
|
17
|
+
* tile is the summary's own icon (`drilldown_data.logo`), else Replenish Savings' `savings`.
|
|
17
18
|
*/
|
|
18
|
-
export declare const TransactionListSummaryCard: ({ summary, count, copy, }: TransactionListSummaryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const TransactionListSummaryCard: ({ summary, count, copy, outlinedIcon, }: TransactionListSummaryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export default TransactionListSummaryCard;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { buildPluralCopy as
|
|
2
|
-
import { DATE_FORMATS_INTL as s, formatDate as
|
|
3
|
-
import { CURRENCY_FORMAT as
|
|
4
|
-
import { getLogoElevation as
|
|
5
|
-
import { TransactionListHeaderIconTile as
|
|
1
|
+
import { buildPluralCopy as d } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { DATE_FORMATS_INTL as s, formatDate as f } from "../../../core/constants/DateFormats.es.js";
|
|
3
|
+
import { CURRENCY_FORMAT as x, formatCurrency as _ } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { getLogoElevation as g } from "../../components/logoShadow.es.js";
|
|
5
|
+
import { TransactionListHeaderIconTile as T } from "./TransactionListHeaderIconTile.es.js";
|
|
6
6
|
import n from "@mui/material/Stack";
|
|
7
7
|
import { Text as i } from "@mxenabled/mxui";
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { alpha as
|
|
8
|
+
import { jsx as a, jsxs as e } from "react/jsx-runtime";
|
|
9
|
+
import { alpha as h } from "@mui/material/styles";
|
|
10
10
|
import p from "@mui/material/Box";
|
|
11
|
-
var u = "_1{count} transactions",
|
|
12
|
-
const c =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var u = "_1{count} transactions", v = "_1{count} transaction", C = (r, t) => [r, t].filter((o) => o !== void 0).map((o) => f(o, s.MONTH_DAY)).join(" – "), U = ({ summary: r, count: t, copy: o, outlinedIcon: m }) => {
|
|
12
|
+
const c = C(r.startDate, r.endDate);
|
|
13
|
+
return /* @__PURE__ */ a(p, {
|
|
14
14
|
sx: {
|
|
15
15
|
px: 24,
|
|
16
16
|
pt: 24,
|
|
@@ -20,7 +20,7 @@ var u = "_1{count} transactions", h = "_1{count} transaction", v = (t, a) => [t,
|
|
|
20
20
|
sx: {
|
|
21
21
|
bgcolor: "background.paper",
|
|
22
22
|
borderRadius: "8px",
|
|
23
|
-
boxShadow:
|
|
23
|
+
boxShadow: g,
|
|
24
24
|
gap: 11,
|
|
25
25
|
p: 16
|
|
26
26
|
},
|
|
@@ -30,37 +30,40 @@ var u = "_1{count} transactions", h = "_1{count} transaction", v = (t, a) => [t,
|
|
|
30
30
|
flexDirection: "row",
|
|
31
31
|
gap: 12
|
|
32
32
|
},
|
|
33
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ a(T, {
|
|
34
|
+
color: "primary.dark",
|
|
35
|
+
name: r.icon ?? "savings",
|
|
36
|
+
outlined: m
|
|
37
|
+
}), /* @__PURE__ */ e(n, { children: [c && /* @__PURE__ */ a(i, {
|
|
34
38
|
color: "text.secondary",
|
|
35
39
|
variant: "caption",
|
|
36
40
|
children: c
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
-
bold: !0,
|
|
41
|
+
}), /* @__PURE__ */ a(i, {
|
|
39
42
|
component: "p",
|
|
40
43
|
variant: "h1",
|
|
41
|
-
children:
|
|
44
|
+
children: _(r.amount, x.cents)
|
|
42
45
|
})] })]
|
|
43
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ a(p, {
|
|
44
47
|
sx: {
|
|
45
48
|
alignItems: "center",
|
|
46
|
-
bgcolor: (
|
|
49
|
+
bgcolor: (l) => h(l.palette.primary.main, 0.15),
|
|
47
50
|
borderRadius: "999px",
|
|
48
51
|
display: "flex",
|
|
49
52
|
px: 12,
|
|
50
53
|
py: 2
|
|
51
54
|
},
|
|
52
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ a(i, {
|
|
53
56
|
color: "primary.dark",
|
|
54
57
|
variant: "caption",
|
|
55
|
-
children:
|
|
58
|
+
children: d(o.transaction_count_one ?? v, o.transaction_count ?? u, t, String(t))
|
|
56
59
|
})
|
|
57
60
|
})]
|
|
58
61
|
})
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
64
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
U as TransactionListSummaryCard,
|
|
66
|
+
U as default
|
|
64
67
|
};
|
|
65
68
|
|
|
66
69
|
//# sourceMappingURL=TransactionListSummaryCard.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListSummaryCard.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { TransactionListSummary } from './layout'\n\nexport interface TransactionListSummaryCardProps {\n summary: TransactionListSummary\n /** Pill count: the CTA's `drilldown_data.count`, else the number of guids the beat names. */\n count: number\n /** Only the two pill-copy keys the card reads. */\n copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>\n}\n\n// English default until the localized-content service ships the pill copy in every locale.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\n// Endpoints are already validated `Date`s from `readSummary` (invalid/junk omitted there).\nconst formatRange = (start?: Date, end?: Date): string =>\n [start, end]\n .filter((d): d is Date => d !== undefined)\n .map((d) => formatDate(d, DATE_FORMATS_INTL.MONTH_DAY))\n .join(' – ')\n\n/**\n * Summary header for the Transaction List drawer: a white card with a themed icon tile, the date\n * range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary\n * figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.\n *\n * Figma: Drilldown | Replenish Savings (\"Savings Withdrawal\")
|
|
1
|
+
{"version":3,"file":"TransactionListSummaryCard.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { TransactionListSummary } from './layout'\n\nexport interface TransactionListSummaryCardProps {\n summary: TransactionListSummary\n /** Pill count: the CTA's `drilldown_data.count`, else the number of guids the beat names. */\n count: number\n /** Only the two pill-copy keys the card reads. */\n copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>\n outlinedIcon?: boolean\n}\n\n// English default until the localized-content service ships the pill copy in every locale.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\n// Endpoints are already validated `Date`s from `readSummary` (invalid/junk omitted there).\nconst formatRange = (start?: Date, end?: Date): string =>\n [start, end]\n .filter((d): d is Date => d !== undefined)\n .map((d) => formatDate(d, DATE_FORMATS_INTL.MONTH_DAY))\n .join(' – ')\n\n/**\n * Summary header for the Transaction List drawer: a white card with a themed icon tile, the date\n * range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary\n * figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.\n *\n * Figma: Drilldown | Replenish Savings (\"Savings Withdrawal\"), Weekly Small Purchases Summary. The\n * tile is the summary's own icon (`drilldown_data.logo`), else Replenish Savings' `savings`.\n */\nexport const TransactionListSummaryCard = ({\n summary,\n count,\n copy,\n outlinedIcon,\n}: TransactionListSummaryCardProps) => {\n const dateRange = formatRange(summary.startDate, summary.endDate)\n\n return (\n <Box sx={{ px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 11,\n p: 16,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <TransactionListHeaderIconTile\n color=\"primary.dark\"\n name={summary.icon ?? 'savings'}\n outlined={outlinedIcon}\n />\n <Stack>\n {dateRange && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateRange}\n </Text>\n )}\n {/* No `bold`: mxui's bold is 600, under the h1's 700. */}\n <Text component=\"p\" variant=\"h1\">\n {formatCurrency(summary.amount, CURRENCY_FORMAT.cents)}\n </Text>\n </Stack>\n </Stack>\n\n {/* Figma Tag: a 20px pill. As a flex container the inline caption becomes a flex item, so its own\n 16px line box (not the pill's inherited line height) sets 2 + 16 + 2, centered. */}\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.15),\n borderRadius: '999px',\n display: 'flex',\n px: 12,\n py: 2,\n }}\n >\n <Text color=\"primary.dark\" variant=\"caption\">\n {\n buildPluralCopy(\n copy.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n copy.transaction_count ?? DEFAULT_COUNT_COPY,\n count,\n String(count),\n ) as string\n }\n </Text>\n </Box>\n </Stack>\n </Box>\n )\n}\n\nexport default TransactionListSummaryCard\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,IAAqB,0BACrB,IAAyB,yBAGzB,IAAA,CAAe,GAAc,MACjC,CAAC,GAAO,CAAG,EACR,OAAA,CAAQ,MAAiB,MAAM,MAAS,EACxC,IAAA,CAAK,MAAM,EAAW,GAAG,EAAkB,SAAS,CAAC,EACrD,KAAK,KAAK,GAUF,IAAA,CAA8B,EACzC,SAAA,GACA,OAAA,GACA,MAAA,GACA,cAAA,EAAA,MACqC;AACrC,QAAM,IAAY,EAAY,EAAQ,WAAW,EAAQ,OAAO;AAEhE,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAChC,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;AAAA,QACX,KAAK;AAAA,QACL,GAAG;AAAA,MACL;AAAA,MAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,YAAY;AAAA,UAAU,eAAe;AAAA,UAAO,KAAK;AAAA,QAAG;AAAA,QAAjE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UACE,OAAM;AAAA,UACN,MAAM,EAAQ,QAAQ;AAAA,UACtB,UAAU;AAAA,QACX,CAAA,GACD,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA;AAAA,QACG,CAAA,GAGR,gBAAA,EAAC,GAAD;AAAA,UAAM,WAAU;AAAA,UAAI,SAAQ;AAAA,UACzB,UAAA,EAAe,EAAQ,QAAQ,EAAgB,KAAK;AAAA,QACjD,CAAA,CACD,EAAA,CAAA,CACF;AAAA,MAIP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAA,CAAU,MAAU,EAAM,EAAM,QAAQ,QAAQ,MAAM,IAAI;AAAA,UAC1D,cAAc;AAAA,UACd,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAe,SAAQ;AAAA,UAE/B,UAAA,EACE,EAAK,yBAAyB,GAC9B,EAAK,qBAAqB,GAC1B,GACA,OAAO,CAAK,CACd;AAAA,QAEE,CAAA;AAAA,MACH,CAAA,CACA;AAAA;EACJ,CAAA;AAET"}
|
|
@@ -13,6 +13,10 @@ export declare const TRANSACTION_LIST_VARIANTS: {
|
|
|
13
13
|
readonly CREDIT_LIMIT_HEADER: "credit_limit_header";
|
|
14
14
|
/** Opens Monthly Subscription Aggregate's Subscriptions list under a count tile and a tip. */
|
|
15
15
|
readonly SUBSCRIPTION_LIST: "subscription_list";
|
|
16
|
+
/** The summary_header card over plain rows that keep the category subline (Weekly Small Purchases Summary). */
|
|
17
|
+
readonly SUMMARY_LIST: "summary_list";
|
|
18
|
+
/** A plain list titled "Transaction History" (HSA Deposit's multiple deposits). */
|
|
19
|
+
readonly TRANSACTION_HISTORY: "transaction_history";
|
|
16
20
|
};
|
|
17
21
|
export declare const HELP_HEADER_VARIANT: "help_header";
|
|
18
22
|
interface TransactionListLayout {
|
|
@@ -20,6 +24,10 @@ interface TransactionListLayout {
|
|
|
20
24
|
title?: (copy: GlobalCopy) => string | undefined;
|
|
21
25
|
/** Rows are subtitled with the account (institution logo and name), not the category. */
|
|
22
26
|
accountSubline?: boolean;
|
|
27
|
+
/** The list opens under the summary card (total, date range, count pill). */
|
|
28
|
+
summary?: boolean;
|
|
29
|
+
/** The summary card's tile icon is outlined, not filled. */
|
|
30
|
+
outlinedIcon?: boolean;
|
|
23
31
|
}
|
|
24
32
|
export declare const transactionListLayout: (variant: string | null | undefined) => TransactionListLayout;
|
|
25
33
|
/** Drawer title: the variant's title when it has one, otherwise the beat's own title. */
|
|
@@ -47,17 +55,19 @@ export interface TransactionListSummary {
|
|
|
47
55
|
endDate?: Date;
|
|
48
56
|
/** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */
|
|
49
57
|
count?: number;
|
|
58
|
+
/** The tile's mx-icons name, from `drilldown_data.logo` (`ICO-<name>`); absent: the card's default. */
|
|
59
|
+
icon?: string;
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
52
62
|
* Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend
|
|
53
|
-
* hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only
|
|
54
|
-
*
|
|
55
|
-
*
|
|
63
|
+
* hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only a summary
|
|
64
|
+
* variant renders a header (so figures from a different CTA that `getDynamicCta…` fell back to can't
|
|
65
|
+
* be misattributed), then without a finite `amount` there is still no header, and
|
|
56
66
|
* each date is validated to a real `Date` or dropped — an unparseable value never reaches
|
|
57
67
|
* `formatDate` (which throws on an Invalid Date).
|
|
58
68
|
*
|
|
59
69
|
* `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),
|
|
60
|
-
* `count` (number of transactions).
|
|
70
|
+
* `count` (number of transactions), `logo` (the tile, `{ guid: 'ICO-<name>' }`).
|
|
61
71
|
*/
|
|
62
72
|
export declare const readSummary: (cta: DrilldownCta | undefined) => TransactionListSummary | undefined;
|
|
63
73
|
export interface CreditLimitHeader {
|
|
@@ -1,54 +1,65 @@
|
|
|
1
|
-
import { asNonEmptyText as s, asNumber as _ } from "../../blocks/slotReaders.es.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { asLogoRef as S, asNonEmptyText as s, asNumber as _ } from "../../blocks/slotReaders.es.js";
|
|
2
|
+
import { logoFromEntityGuid as E } from "../../components/shared/EntityLogo.es.js";
|
|
3
|
+
import { readHelp as h } from "../HelpBlock/layout.es.js";
|
|
4
|
+
import { parseISO as y } from "date-fns/parseISO";
|
|
5
|
+
var o = {
|
|
5
6
|
SUMMARY_HEADER: "summary_header",
|
|
6
7
|
GENERIC_LIST: "generic_list",
|
|
7
8
|
HELP_HEADER: "help_header",
|
|
8
9
|
DEPOSIT_HISTORY: "deposit_history",
|
|
9
10
|
CREDIT_LIMIT_HEADER: "credit_limit_header",
|
|
10
|
-
SUBSCRIPTION_LIST: "subscription_list"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
SUBSCRIPTION_LIST: "subscription_list",
|
|
12
|
+
SUMMARY_LIST: "summary_list",
|
|
13
|
+
TRANSACTION_HISTORY: "transaction_history"
|
|
14
|
+
}, R = o.HELP_HEADER, m = (t) => t.transactions?.transactions_title, T = {
|
|
15
|
+
[o.SUMMARY_HEADER]: {
|
|
16
|
+
accountSubline: !0,
|
|
17
|
+
summary: !0
|
|
18
|
+
},
|
|
19
|
+
[o.GENERIC_LIST]: { title: m },
|
|
20
|
+
[o.HELP_HEADER]: { title: m },
|
|
21
|
+
[o.DEPOSIT_HISTORY]: { title: (t) => t.insights_feed?.transaction_list_block?.deposit_history_drawer_title },
|
|
22
|
+
[o.CREDIT_LIMIT_HEADER]: { title: (t) => t.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title },
|
|
23
|
+
[o.SUBSCRIPTION_LIST]: {
|
|
18
24
|
title: (t) => t.insights_feed?.transaction_list_block?.subscriptions_drawer_title,
|
|
19
25
|
accountSubline: !0
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
},
|
|
27
|
+
[o.SUMMARY_LIST]: {
|
|
28
|
+
summary: !0,
|
|
29
|
+
outlinedIcon: !0
|
|
30
|
+
},
|
|
31
|
+
[o.TRANSACTION_HISTORY]: { title: (t) => t.insights_feed?.general?.transaction_history_title }
|
|
32
|
+
}, I = (t) => t != null && Object.hasOwn(T, t) ? T[t] : {}, O = (t, e, r) => {
|
|
33
|
+
const { title: i } = I(t);
|
|
34
|
+
return (i ? i(e) : r?.insights_payload?.title) ?? "";
|
|
35
|
+
}, w = (t, e) => {
|
|
36
|
+
if (t?.variant !== R) return;
|
|
37
|
+
const r = s(e?.help_label), i = h(e);
|
|
27
38
|
return {
|
|
28
39
|
descriptionHtml: s(e?.description_html),
|
|
29
|
-
...r &&
|
|
30
|
-
...
|
|
40
|
+
...r && i && { learnMore: {
|
|
41
|
+
...i,
|
|
31
42
|
label: r
|
|
32
43
|
} }
|
|
33
44
|
};
|
|
34
|
-
}, p = (t) => typeof t == "number" && Number.isInteger(t) && t > 0 ? t : void 0,
|
|
35
|
-
const r =
|
|
36
|
-
r.has(e) || (
|
|
45
|
+
}, p = (t) => typeof t == "number" && Number.isInteger(t) && t > 0 ? t : void 0, v = Date.UTC(2e3, 0, 1), b = Date.UTC(2100, 0, 1), f = /* @__PURE__ */ new WeakMap(), c = (t, e) => {
|
|
46
|
+
const r = f.get(t) ?? /* @__PURE__ */ new Set();
|
|
47
|
+
r.has(e) || (f.set(t, r.add(e)), console.warn(e));
|
|
37
48
|
}, l = (t, e, r) => {
|
|
38
49
|
if (t == null || t === "") return;
|
|
39
|
-
let
|
|
40
|
-
if (typeof t == "number" && Number.isFinite(t))
|
|
50
|
+
let i;
|
|
51
|
+
if (typeof t == "number" && Number.isFinite(t)) i = t < 1e12 ? t * 1e3 : t;
|
|
41
52
|
else if (typeof t == "string") {
|
|
42
|
-
const
|
|
43
|
-
|
|
53
|
+
const n = y(t).getTime();
|
|
54
|
+
i = Number.isNaN(n) ? void 0 : n;
|
|
44
55
|
}
|
|
45
|
-
if (
|
|
56
|
+
if (i === void 0 || i < v || i > b) {
|
|
46
57
|
c(r, `[TransactionListBlock] drilldown_data.${e} is unparseable or out of range (${typeof t})`);
|
|
47
58
|
return;
|
|
48
59
|
}
|
|
49
|
-
return new Date(
|
|
50
|
-
},
|
|
51
|
-
if (t?.variant
|
|
60
|
+
return new Date(i);
|
|
61
|
+
}, C = (t) => {
|
|
62
|
+
if (!I(t?.variant).summary) return;
|
|
52
63
|
const e = t?.drilldown_data;
|
|
53
64
|
if (!e) return;
|
|
54
65
|
const r = _(e.amount);
|
|
@@ -60,42 +71,43 @@ var a = {
|
|
|
60
71
|
amount: r,
|
|
61
72
|
startDate: l(e.start_date, "start_date", e),
|
|
62
73
|
endDate: l(e.end_date, "end_date", e),
|
|
63
|
-
count: p(e.count)
|
|
74
|
+
count: p(e.count),
|
|
75
|
+
icon: E(S(e.logo)?.guid)?.logo_name
|
|
64
76
|
};
|
|
65
|
-
},
|
|
66
|
-
if (t?.variant !==
|
|
67
|
-
const e = t.drilldown_data, r = _(e?.current_balance),
|
|
68
|
-
if (r === void 0 ||
|
|
69
|
-
const
|
|
77
|
+
}, M = (t) => {
|
|
78
|
+
if (t?.variant !== o.CREDIT_LIMIT_HEADER) return;
|
|
79
|
+
const e = t.drilldown_data, r = _(e?.current_balance), i = _(e?.credit_limit);
|
|
80
|
+
if (r === void 0 || i === void 0 || i <= 0) return;
|
|
81
|
+
const n = s(e?.institution_guid), a = s(e?.institution_name), d = s(e?.account_name);
|
|
70
82
|
return {
|
|
71
83
|
balance: r,
|
|
72
|
-
limit:
|
|
73
|
-
utilization: Math.max(0, Math.round(r /
|
|
74
|
-
...
|
|
75
|
-
...
|
|
84
|
+
limit: i,
|
|
85
|
+
utilization: Math.max(0, Math.round(r / i * 100)),
|
|
86
|
+
...n && { institutionGuid: n },
|
|
87
|
+
...a && { institutionName: a },
|
|
76
88
|
...d && { accountName: d }
|
|
77
89
|
};
|
|
78
|
-
},
|
|
79
|
-
const r = typeof t == "string" ?
|
|
80
|
-
if (r &&
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
if (t?.variant !==
|
|
90
|
+
}, A = /^(\d{4})-(\d{2})-\d{2}$/, L = (t, e) => {
|
|
91
|
+
const r = typeof t == "string" ? A.exec(t) : null, i = r ? Number(r[2]) : 0;
|
|
92
|
+
if (r && i >= 1 && i <= 12) return new Date(Number(r[1]), i - 1, 1);
|
|
93
|
+
const n = l(t, "date", e);
|
|
94
|
+
return n && new Date(n.getUTCFullYear(), n.getUTCMonth(), 1);
|
|
95
|
+
}, P = (t) => {
|
|
96
|
+
if (t?.variant !== o.SUBSCRIPTION_LIST) return;
|
|
85
97
|
const e = t.drilldown_data, r = e?.transaction_frequencies;
|
|
86
98
|
if (r == null) return;
|
|
87
99
|
if (!Array.isArray(r)) {
|
|
88
100
|
c(e, "[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.");
|
|
89
101
|
return;
|
|
90
102
|
}
|
|
91
|
-
const
|
|
92
|
-
let
|
|
93
|
-
return r.forEach((
|
|
94
|
-
const d = typeof
|
|
95
|
-
d && u !== void 0 ?
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
if (t?.variant !==
|
|
103
|
+
const i = /* @__PURE__ */ new Map();
|
|
104
|
+
let n = 0;
|
|
105
|
+
return r.forEach((a) => {
|
|
106
|
+
const d = typeof a == "object" && a !== null ? s(a.transaction_guid) : void 0, u = typeof a == "object" && a !== null ? _(a.recurrence_type) : void 0;
|
|
107
|
+
d && u !== void 0 ? i.set(d, u) : n += 1;
|
|
108
|
+
}), n > 0 && c(e, `[TransactionListBlock] dropped ${n} malformed drilldown_data.transaction_frequencies row(s).`), i.size > 0 ? i : void 0;
|
|
109
|
+
}, U = (t) => {
|
|
110
|
+
if (t?.variant !== o.SUBSCRIPTION_LIST) return;
|
|
99
111
|
const e = t.drilldown_data;
|
|
100
112
|
if (!e) return;
|
|
101
113
|
const r = p(e.count);
|
|
@@ -105,19 +117,19 @@ var a = {
|
|
|
105
117
|
}
|
|
106
118
|
return {
|
|
107
119
|
count: r,
|
|
108
|
-
month:
|
|
120
|
+
month: L(e.date, e)
|
|
109
121
|
};
|
|
110
122
|
};
|
|
111
123
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
R as HELP_HEADER_VARIANT,
|
|
125
|
+
o as TRANSACTION_LIST_VARIANTS,
|
|
126
|
+
O as getTransactionListDrawerTitle,
|
|
127
|
+
M as readCreditLimitHeader,
|
|
128
|
+
w as readHelpHeader,
|
|
129
|
+
U as readSubscriptionHeader,
|
|
130
|
+
C as readSummary,
|
|
131
|
+
P as readTransactionFrequencies,
|
|
132
|
+
I as transactionListLayout
|
|
121
133
|
};
|
|
122
134
|
|
|
123
135
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {\n Beat,\n DrilldownData,\n GlobalCopy,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../../core'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport { readHelp, type HelpContent } from '../HelpBlock/layout'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The transaction_list_block CTA variants. */\nexport const TRANSACTION_LIST_VARIANTS = {\n SUMMARY_HEADER: 'summary_header',\n GENERIC_LIST: 'generic_list',\n /** Opens the list under the beat's title, description and \"Learn More\". */\n HELP_HEADER: 'help_header',\n /** Opens Micro Deposits' Deposit History list. */\n DEPOSIT_HISTORY: 'deposit_history',\n /** Opens Credit Card Close to Limit's Spending list under the card's credit-limit header. */\n CREDIT_LIMIT_HEADER: 'credit_limit_header',\n /** Opens Monthly Subscription Aggregate's Subscriptions list under a count tile and a tip. */\n SUBSCRIPTION_LIST: 'subscription_list',\n} as const\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\ninterface TransactionListLayout {\n /** The drawer title; absent: the beat's own title. */\n title?: (copy: GlobalCopy) => string | undefined\n /** Rows are subtitled with the account (institution logo and name), not the category. */\n accountSubline?: boolean\n}\n\nconst transactionsTitle = (copy: GlobalCopy) => copy.transactions?.transactions_title\n\n/** Per-variant drawer layout. Add new variants here. */\nconst LAYOUT: Record<string, TransactionListLayout> = {\n [TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER]: { accountSubline: true },\n [TRANSACTION_LIST_VARIANTS.GENERIC_LIST]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.HELP_HEADER]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.DEPOSIT_HISTORY]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.deposit_history_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.subscriptions_drawer_title,\n accountSubline: true,\n },\n}\n\n// `Object.hasOwn`, as in resolveVariantConfig: the variant is backend-controlled.\nexport const transactionListLayout = (variant: string | null | undefined): TransactionListLayout =>\n variant != null && Object.hasOwn(LAYOUT, variant) ? LAYOUT[variant] : {}\n\n/** Drawer title: the variant's title when it has one, otherwise the beat's own title. */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n const { title } = transactionListLayout(variant)\n\n return (title ? title(copy) : beat?.insights_payload?.title) ?? ''\n}\n\nexport interface HelpHeaderContent {\n /** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */\n descriptionHtml?: string\n /** The \"Learn More\" link and the help drawer it opens; absent when the beat carries no help. */\n learnMore?: HelpContent & { label: string }\n}\n\n/**\n * The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA\n * of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that\n * `readHelp` reads. Only the `help_header` variant renders the block.\n */\nexport const readHelpHeader = (\n cta: DrilldownCta | undefined,\n drilldown: DrilldownData | undefined,\n): HelpHeaderContent | undefined => {\n if (cta?.variant !== HELP_HEADER_VARIANT) return undefined\n\n const label = asNonEmptyText(drilldown?.help_label)\n const help = readHelp(drilldown)\n\n return {\n descriptionHtml: asNonEmptyText(drilldown?.description_html),\n ...(label && help && { learnMore: { ...help, label } }),\n }\n}\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */\n count?: number\n}\n\n// `> 0`: the card only shows with >= 1 guid, so a `count` of 0 is dropped and falls back to the\n// guid count rather than rendering \"0 transactions\".\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n// The readers run on every observer re-render, so each distinct warning fires once per payload object.\nconst warnedPayloads = new WeakMap<object, Set<string>>()\nconst warnOncePerPayload = (source: object, message: string): void => {\n const warned = warnedPayloads.get(source) ?? new Set<string>()\n if (warned.has(message)) return\n warnedPayloads.set(source, warned.add(message))\n console.warn(message)\n}\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toDate = (value: unknown, field: string, source: object): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n warnOncePerPayload(\n source,\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only the\n * `summary_header` variant renders a header (so figures from a different CTA that `getDynamicCta…`\n * fell back to can't be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number of transactions).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary-header variant shows the card.\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = asNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date', source),\n endDate: toDate(source.end_date, 'end_date', source),\n count: toCount(source.count),\n }\n}\n\nexport interface CreditLimitHeader {\n balance: number\n limit: number\n /** Whole percent of the limit used; over 100 when the card is over its limit. */\n utilization: number\n institutionGuid?: string\n institutionName?: string\n accountName?: string\n}\n\n/** The credit-limit header from the clicked CTA's `drilldown_data`; only `credit_limit_header`, with a positive limit. */\nexport const readCreditLimitHeader = (\n cta: DrilldownCta | undefined,\n): CreditLimitHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER) return undefined\n\n const source = cta.drilldown_data\n const balance = asNumber(source?.current_balance)\n const limit = asNumber(source?.credit_limit)\n if (balance === undefined || limit === undefined || limit <= 0) return undefined\n\n const institutionGuid = asNonEmptyText(source?.institution_guid)\n const institutionName = asNonEmptyText(source?.institution_name)\n const accountName = asNonEmptyText(source?.account_name)\n\n return {\n balance,\n limit,\n utilization: Math.max(0, Math.round((balance / limit) * 100)),\n ...(institutionGuid && { institutionGuid }),\n ...(institutionName && { institutionName }),\n ...(accountName && { accountName }),\n }\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-\\d{2}$/\n\n/** The month a drilldown date names, as local midnight on the 1st. A date-only string already names its month. */\nconst toMonthStart = (value: unknown, source: object): Date | undefined => {\n const dateOnly = typeof value === 'string' ? DATE_ONLY.exec(value) : null\n const month = dateOnly ? Number(dateOnly[2]) : 0\n if (dateOnly && month >= 1 && month <= 12) return new Date(Number(dateOnly[1]), month - 1, 1)\n\n // An epoch or a timestamp is an instant: its UTC month is the one tupac meant.\n const date = toDate(value, 'date', source)\n return date && new Date(date.getUTCFullYear(), date.getUTCMonth(), 1)\n}\n\n/** Each listed transaction's schedule, from `drilldown_data.transaction_frequencies`; malformed rows are dropped. */\nexport const readTransactionFrequencies = (\n cta: DrilldownCta | undefined,\n): Map<string, number> | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n const rows = source?.transaction_frequencies\n if (rows === undefined || rows === null) return undefined\n\n if (!Array.isArray(rows)) {\n warnOncePerPayload(\n source as object,\n '[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.',\n )\n return undefined\n }\n\n const byGuid = new Map<string, number>()\n let dropped = 0\n rows.forEach((row) => {\n const guid =\n typeof row === 'object' && row !== null ? asNonEmptyText(row.transaction_guid) : undefined\n const type = typeof row === 'object' && row !== null ? asNumber(row.recurrence_type) : undefined\n\n if (guid && type !== undefined) byGuid.set(guid, type)\n else dropped += 1\n })\n\n if (dropped > 0) {\n warnOncePerPayload(\n source as object,\n `[TransactionListBlock] dropped ${dropped} malformed drilldown_data.transaction_frequencies row(s).`,\n )\n }\n\n return byGuid.size > 0 ? byGuid : undefined\n}\n\nexport interface SubscriptionListHeader {\n /** Subscriptions paid in the month, from the CTA's `drilldown_data.count`. */\n count: number\n /** The month paid in, as local midnight on the 1st; omitted when missing or unparseable. */\n month?: Date\n}\n\n/** The count tile's figures; only for `subscription_list` with a positive integer `count`. */\nexport const readSubscriptionHeader = (\n cta: DrilldownCta | undefined,\n): SubscriptionListHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n if (!source) return undefined\n\n const count = toCount(source.count)\n if (count === undefined) {\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.',\n )\n }\n return undefined\n }\n\n return {\n count,\n month: toMonthStart(source.date, source),\n }\n}\n"],"mappings":";;;AAgBA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AAAA,EAEb,iBAAiB;AAAA,EAEjB,qBAAqB;AAAA,EAErB,mBAAmB;AACrB,GAEa,IAAsB,EAA0B,aASvD,IAAA,CAAqB,MAAqB,EAAK,cAAc,oBAG7D,IAAgD;AAAA,EACnD,CAAA,EAA0B,cAAA,GAAiB,EAAE,gBAAgB,GAAK;AAAA,EAClE,CAAA,EAA0B,YAAA,GAAe,EAAE,OAAO,EAAkB;AAAA,EACpE,CAAA,EAA0B,WAAA,GAAc,EAAE,OAAO,EAAkB;AAAA,EACnE,CAAA,EAA0B,eAAA,GAAkB,EAC3C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB,6BAC/D;AAAA,EACC,CAAA,EAA0B,mBAAA,GAAsB,EAC/C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB,iCAC/D;AAAA,EACC,CAAA,EAA0B,iBAAA,GAAoB;AAAA,IAC7C,OAAA,CAAQ,MAAS,EAAK,eAAe,wBAAwB;AAAA,IAC7D,gBAAgB;AAAA,EAClB;AACF,GAGa,IAAA,CAAyB,MACpC,KAAW,QAAQ,OAAO,OAAO,GAAQ,CAAO,IAAI,EAAO,CAAA,IAAW,CAAC,GAG5D,IAAA,CACX,GACA,GACA,MACW;AACX,QAAM,EAAE,OAAA,EAAA,IAAU,EAAsB,CAAO;AAE/C,UAAQ,IAAQ,EAAM,CAAI,IAAI,GAAM,kBAAkB,UAAU;AAClE,GAca,IAAA,CACX,GACA,MACkC;AAClC,MAAI,GAAK,YAAY,EAAqB;AAE1C,QAAM,IAAQ,EAAe,GAAW,UAAU,GAC5C,IA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AAG,CAAC;AACtE,GAGa,IAAA,CACX,MACoC;AACpC,MAAI,GAAK,YAAY,EAA0B,kBAAmB;AAElE,QAAM,IAAS,EAAI,gBACb,IAAO,GAAQ;AACrB,MAA0B,KAAS,KAAM;AAEzC,MAAI,CAAC,MAAM,QAAQ,CAAI,GAAG;AACxB,IAAA,EACE,GACA,mGACF;AACA;AAAA,EACF;AAEA,QAAM,IAAS,oBAAI,IAAoB;AACvC,MAAI,IAAU;AACd,SAAA,EAAK,QAAA,CAAS,MAAQ;AACpB,UAAM,IACJ,OAAO,KAAQ,YAAY,MAAQ,OAAO,EAAe,EAAI,gBAAgB,IAAI,QAC7E,IAAO,OAAO,KAAQ,YAAY,MAAQ,OAAO,EAAS,EAAI,eAAe,IAAI;AAEvF,IAAI,KAAQ,MAAS,SAAW,EAAO,IAAI,GAAM,CAAI,IAChD,KAAW;AAAA,EAClB,CAAC,GAEG,IAAU,KACZ,EACE,GACA,kCAAkC,CAAA,2DACpC,GAGK,EAAO,OAAO,IAAI,IAAS;AACpC,GAUa,IAAA,CACX,MACuC;AACvC,MAAI,GAAK,YAAY,EAA0B,kBAAmB;AAElE,QAAM,IAAS,EAAI;AACnB,MAAI,CAAC,EAAQ;AAEb,QAAM,IAAQ,EAAQ,EAAO,KAAK;AAClC,MAAI,MAAU,QAAW;AACvB,IAAI,OAAO,KAAK,CAAM,EAAE,SAAS,KAC/B,EACE,GACA,iGACF;AAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAO,EAAa,EAAO,MAAM,CAAM;AAAA,EACzC;AACF"}
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {\n Beat,\n DrilldownData,\n GlobalCopy,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../../core'\nimport { asLogoRef, asNonEmptyText, asNumber } from '../../blocks/slotReaders'\nimport { logoFromEntityGuid } from '../../components/shared/EntityLogo'\nimport { readHelp, type HelpContent } from '../HelpBlock/layout'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The transaction_list_block CTA variants. */\nexport const TRANSACTION_LIST_VARIANTS = {\n SUMMARY_HEADER: 'summary_header',\n GENERIC_LIST: 'generic_list',\n /** Opens the list under the beat's title, description and \"Learn More\". */\n HELP_HEADER: 'help_header',\n /** Opens Micro Deposits' Deposit History list. */\n DEPOSIT_HISTORY: 'deposit_history',\n /** Opens Credit Card Close to Limit's Spending list under the card's credit-limit header. */\n CREDIT_LIMIT_HEADER: 'credit_limit_header',\n /** Opens Monthly Subscription Aggregate's Subscriptions list under a count tile and a tip. */\n SUBSCRIPTION_LIST: 'subscription_list',\n /** The summary_header card over plain rows that keep the category subline (Weekly Small Purchases Summary). */\n SUMMARY_LIST: 'summary_list',\n /** A plain list titled \"Transaction History\" (HSA Deposit's multiple deposits). */\n TRANSACTION_HISTORY: 'transaction_history',\n} as const\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\ninterface TransactionListLayout {\n /** The drawer title; absent: the beat's own title. */\n title?: (copy: GlobalCopy) => string | undefined\n /** Rows are subtitled with the account (institution logo and name), not the category. */\n accountSubline?: boolean\n /** The list opens under the summary card (total, date range, count pill). */\n summary?: boolean\n /** The summary card's tile icon is outlined, not filled. */\n outlinedIcon?: boolean\n}\n\nconst transactionsTitle = (copy: GlobalCopy) => copy.transactions?.transactions_title\n\n/** Per-variant drawer layout. Add new variants here. */\nconst LAYOUT: Record<string, TransactionListLayout> = {\n [TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER]: { accountSubline: true, summary: true },\n [TRANSACTION_LIST_VARIANTS.GENERIC_LIST]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.HELP_HEADER]: { title: transactionsTitle },\n [TRANSACTION_LIST_VARIANTS.DEPOSIT_HISTORY]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.deposit_history_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.credit_limit_header_drawer_title,\n },\n [TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST]: {\n title: (copy) => copy.insights_feed?.transaction_list_block?.subscriptions_drawer_title,\n accountSubline: true,\n },\n [TRANSACTION_LIST_VARIANTS.SUMMARY_LIST]: { summary: true, outlinedIcon: true },\n [TRANSACTION_LIST_VARIANTS.TRANSACTION_HISTORY]: {\n title: (copy) => copy.insights_feed?.general?.transaction_history_title,\n },\n}\n\n// `Object.hasOwn`, as in resolveVariantConfig: the variant is backend-controlled.\nexport const transactionListLayout = (variant: string | null | undefined): TransactionListLayout =>\n variant != null && Object.hasOwn(LAYOUT, variant) ? LAYOUT[variant] : {}\n\n/** Drawer title: the variant's title when it has one, otherwise the beat's own title. */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n const { title } = transactionListLayout(variant)\n\n return (title ? title(copy) : beat?.insights_payload?.title) ?? ''\n}\n\nexport interface HelpHeaderContent {\n /** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */\n descriptionHtml?: string\n /** The \"Learn More\" link and the help drawer it opens; absent when the beat carries no help. */\n learnMore?: HelpContent & { label: string }\n}\n\n/**\n * The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA\n * of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that\n * `readHelp` reads. Only the `help_header` variant renders the block.\n */\nexport const readHelpHeader = (\n cta: DrilldownCta | undefined,\n drilldown: DrilldownData | undefined,\n): HelpHeaderContent | undefined => {\n if (cta?.variant !== HELP_HEADER_VARIANT) return undefined\n\n const label = asNonEmptyText(drilldown?.help_label)\n const help = readHelp(drilldown)\n\n return {\n descriptionHtml: asNonEmptyText(drilldown?.description_html),\n ...(label && help && { learnMore: { ...help, label } }),\n }\n}\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */\n count?: number\n /** The tile's mx-icons name, from `drilldown_data.logo` (`ICO-<name>`); absent: the card's default. */\n icon?: string\n}\n\n// `> 0`: the card only shows with >= 1 guid, so a `count` of 0 is dropped and falls back to the\n// guid count rather than rendering \"0 transactions\".\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n// The readers run on every observer re-render, so each distinct warning fires once per payload object.\nconst warnedPayloads = new WeakMap<object, Set<string>>()\nconst warnOncePerPayload = (source: object, message: string): void => {\n const warned = warnedPayloads.get(source) ?? new Set<string>()\n if (warned.has(message)) return\n warnedPayloads.set(source, warned.add(message))\n console.warn(message)\n}\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toDate = (value: unknown, field: string, source: object): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n warnOncePerPayload(\n source,\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only a summary\n * variant renders a header (so figures from a different CTA that `getDynamicCta…` fell back to can't\n * be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number of transactions), `logo` (the tile, `{ guid: 'ICO-<name>' }`).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary variants show the card.\n if (!transactionListLayout(cta?.variant).summary) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = asNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date', source),\n endDate: toDate(source.end_date, 'end_date', source),\n count: toCount(source.count),\n icon: logoFromEntityGuid(asLogoRef(source.logo)?.guid)?.logo_name,\n }\n}\n\nexport interface CreditLimitHeader {\n balance: number\n limit: number\n /** Whole percent of the limit used; over 100 when the card is over its limit. */\n utilization: number\n institutionGuid?: string\n institutionName?: string\n accountName?: string\n}\n\n/** The credit-limit header from the clicked CTA's `drilldown_data`; only `credit_limit_header`, with a positive limit. */\nexport const readCreditLimitHeader = (\n cta: DrilldownCta | undefined,\n): CreditLimitHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.CREDIT_LIMIT_HEADER) return undefined\n\n const source = cta.drilldown_data\n const balance = asNumber(source?.current_balance)\n const limit = asNumber(source?.credit_limit)\n if (balance === undefined || limit === undefined || limit <= 0) return undefined\n\n const institutionGuid = asNonEmptyText(source?.institution_guid)\n const institutionName = asNonEmptyText(source?.institution_name)\n const accountName = asNonEmptyText(source?.account_name)\n\n return {\n balance,\n limit,\n utilization: Math.max(0, Math.round((balance / limit) * 100)),\n ...(institutionGuid && { institutionGuid }),\n ...(institutionName && { institutionName }),\n ...(accountName && { accountName }),\n }\n}\n\nconst DATE_ONLY = /^(\\d{4})-(\\d{2})-\\d{2}$/\n\n/** The month a drilldown date names, as local midnight on the 1st. A date-only string already names its month. */\nconst toMonthStart = (value: unknown, source: object): Date | undefined => {\n const dateOnly = typeof value === 'string' ? DATE_ONLY.exec(value) : null\n const month = dateOnly ? Number(dateOnly[2]) : 0\n if (dateOnly && month >= 1 && month <= 12) return new Date(Number(dateOnly[1]), month - 1, 1)\n\n // An epoch or a timestamp is an instant: its UTC month is the one tupac meant.\n const date = toDate(value, 'date', source)\n return date && new Date(date.getUTCFullYear(), date.getUTCMonth(), 1)\n}\n\n/** Each listed transaction's schedule, from `drilldown_data.transaction_frequencies`; malformed rows are dropped. */\nexport const readTransactionFrequencies = (\n cta: DrilldownCta | undefined,\n): Map<string, number> | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n const rows = source?.transaction_frequencies\n if (rows === undefined || rows === null) return undefined\n\n if (!Array.isArray(rows)) {\n warnOncePerPayload(\n source as object,\n '[TransactionListBlock] drilldown_data.transaction_frequencies is not a list — captioning no rows.',\n )\n return undefined\n }\n\n const byGuid = new Map<string, number>()\n let dropped = 0\n rows.forEach((row) => {\n const guid =\n typeof row === 'object' && row !== null ? asNonEmptyText(row.transaction_guid) : undefined\n const type = typeof row === 'object' && row !== null ? asNumber(row.recurrence_type) : undefined\n\n if (guid && type !== undefined) byGuid.set(guid, type)\n else dropped += 1\n })\n\n if (dropped > 0) {\n warnOncePerPayload(\n source as object,\n `[TransactionListBlock] dropped ${dropped} malformed drilldown_data.transaction_frequencies row(s).`,\n )\n }\n\n return byGuid.size > 0 ? byGuid : undefined\n}\n\nexport interface SubscriptionListHeader {\n /** Subscriptions paid in the month, from the CTA's `drilldown_data.count`. */\n count: number\n /** The month paid in, as local midnight on the 1st; omitted when missing or unparseable. */\n month?: Date\n}\n\n/** The count tile's figures; only for `subscription_list` with a positive integer `count`. */\nexport const readSubscriptionHeader = (\n cta: DrilldownCta | undefined,\n): SubscriptionListHeader | undefined => {\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUBSCRIPTION_LIST) return undefined\n\n const source = cta.drilldown_data\n if (!source) return undefined\n\n const count = toCount(source.count)\n if (count === undefined) {\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no positive integer `count` — no subscription header.',\n )\n }\n return undefined\n }\n\n return {\n count,\n month: toMonthStart(source.date, source),\n }\n}\n"],"mappings":";;;;AAiBA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AAAA,EAEb,iBAAiB;AAAA,EAEjB,qBAAqB;AAAA,EAErB,mBAAmB;AAAA,EAEnB,cAAc;AAAA,EAEd,qBAAqB;AACvB,GAEa,IAAsB,EAA0B,aAavD,IAAA,CAAqB,MAAqB,EAAK,cAAc,oBAG7D,IAAgD;AAAA,EACnD,CAAA,EAA0B,cAAA,GAAiB;AAAA,IAAE,gBAAgB;AAAA,IAAM,SAAS;AAAA,EAAK;AAAA,EACjF,CAAA,EAA0B,YAAA,GAAe,EAAE,OAAO,EAAkB;AAAA,EACpE,CAAA,EAA0B,WAAA,GAAc,EAAE,OAAO,EAAkB;AAAA,EACnE,CAAA,EAA0B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AAO,KAAQ,YAAY,MAAQ,OAAO,EAAe,EAAI,gBAAgB,IAAI,QAC7E,IAAO,OAAO,KAAQ,YAAY,MAAQ,OAAO,EAAS,EAAI,eAAe,IAAI;AAEvF,IAAI,KAAQ,MAAS,SAAW,EAAO,IAAI,GAAM,CAAI,IAChD,KAAW;AAAA,EAClB,CAAC,GAEG,IAAU,KACZ,EACE,GACA,kCAAkC,CAAA,2DACpC,GAGK,EAAO,OAAO,IAAI,IAAS;AACpC,GAUa,IAAA,CACX,MACuC;AACvC,MAAI,GAAK,YAAY,EAA0B,kBAAmB;AAElE,QAAM,IAAS,EAAI;AACnB,MAAI,CAAC,EAAQ;AAEb,QAAM,IAAQ,EAAQ,EAAO,KAAK;AAClC,MAAI,MAAU,QAAW;AACvB,IAAI,OAAO,KAAK,CAAM,EAAE,SAAS,KAC/B,EACE,GACA,iGACF;AAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAO,EAAa,EAAO,MAAM,CAAM;AAAA,EACzC;AACF"}
|
|
@@ -8,8 +8,10 @@ interface DonutChartV2Props {
|
|
|
8
8
|
data: DonutSegment[];
|
|
9
9
|
centerLabel?: string;
|
|
10
10
|
centerValue: string;
|
|
11
|
+
/** The full amount for screen readers when `centerValue` is abbreviated ($2.5K); the short form is then hidden. */
|
|
12
|
+
centerValueLabel?: string;
|
|
11
13
|
/** The embedded card's donut: exactly the chart's box, with no padding around it. */
|
|
12
14
|
compact?: boolean;
|
|
13
15
|
}
|
|
14
|
-
declare const DonutChartV2: ({ data, centerLabel, centerValue, compact }: DonutChartV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const DonutChartV2: ({ data, centerLabel, centerValue, centerValueLabel, compact, }: DonutChartV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export default DonutChartV2;
|