@mx-cartographer/experiences 9.7.130 → 9.7.132
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 +9 -0
- package/dist/core/utils/NumberFormatting.d.ts +6 -0
- package/dist/core/utils/NumberFormatting.es.js +20 -16
- package/dist/core/utils/NumberFormatting.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +38 -38
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +17 -17
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js +13 -12
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +38 -38
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js +14 -14
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -26
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.es.js +22 -22
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +78 -108
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +14 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +59 -13
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +18 -18
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +22 -21
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +57 -56
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +50 -50
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +52 -51
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +17 -17
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +20 -20
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +25 -25
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +17 -16
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js +34 -34
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleProgressBarBlock/ProgressBar.es.js +7 -7
- package/dist/insights-v2/blocks/ChartBlocks/DoubleProgressBarBlock/ProgressBar.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js +13 -13
- package/dist/insights-v2/blocks/ChartBlocks/StepChartBlock/variants/WithText.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +39 -39
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +20 -20
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +44 -44
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +14 -14
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +22 -28
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js +25 -25
- package/dist/insights-v2/blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +39 -46
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js +18 -18
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js +19 -19
- package/dist/insights-v2/blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js +9 -9
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +12 -12
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +58 -57
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js +18 -18
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +10 -10
- package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js +13 -13
- package/dist/insights-v2/blocks/ImageBlocks/ImageBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/slotReaders.d.ts +3 -1
- package/dist/insights-v2/blocks/slotReaders.es.js +17 -6
- package/dist/insights-v2/blocks/slotReaders.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +44 -43
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/SaveAnExtraCard.es.js +6 -6
- package/dist/insights-v2/components/SaveAnExtraCard.es.js.map +1 -1
- package/dist/insights-v2/components/WithdrawalCard.es.js +20 -20
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -1
- package/dist/insights-v2/components/celebrationGradients.d.ts +15 -1
- package/dist/insights-v2/components/celebrationGradients.es.js +16 -7
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +2 -0
- package/dist/insights-v2/components/shared/elevation.es.js +3 -2
- package/dist/insights-v2/components/shared/elevation.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant — `h2` for milestones, `h3` for deposits. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n interest_charges_summary: {\n logo_color: 'text.primary',\n logo_bGcolor: alpha(theme.palette.categories?.feesCharges || '', 0.25),\n logo_border_color: 'categories.feesCharges',\n background
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.ts"],"sourcesContent":["import { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport {\n CELEBRATION_GRADIENT,\n ERROR_WASH_GRADIENT,\n FEES_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\n /** Corner radius of the icon tile (`icon_name` or an `ICO-` logo). Defaults to 6px. */\n logo_border_radius?: string\n /** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard\n * icon tile (default `TILE_ICON_SIZE`). */\n logo_icon_size?: number\n /** mx-icons glyph shown before `sub_text` (e.g. a warning icon on overdraft_warning). */\n sub_logo?: string\n /** mx-icons glyph badged on the logo's corner (e.g. `error` on Low Account Balance's V2 tile). */\n badge?: string\n /** When true, AccountBlock renders the confetti-backed celebration card using the fields below. */\n isConfetti?: boolean\n /** Gradient wash layered over `background.paper` for the confetti card. */\n gradient?: string\n /** Which illustration sits left of the text. `logo` is the data-driven merchant/institution logo. */\n graphic?: 'paidOffCard' | 'savings' | 'logo'\n /** Amount typography variant — `h2` for milestones, `h3` for deposits. */\n amountVariant?: 'h2' | 'h3'\n /** Prefix prepended to the formatted amount, e.g. `+` for deposits. */\n amountPrefix?: string\n /** Render the colored category strip (`header_text`) at the top of the card. */\n categoryStrip?: boolean\n /** Raise the strip and body together with elevation/1. */\n cardShadow?: boolean\n /** Layout overrides for the graphic+text row (padding, gap). */\n rowSx?: SxProps\n /** Which payload field feeds the secondary line beside the amount. */\n secondarySource?: 'merchant' | 'label'\n /** Whether the secondary line sits above or below the amount. */\n secondaryPosition?: 'above' | 'below'\n /** Typography variant for the secondary line. */\n secondaryVariant?: 'body2' | 'caption'\n /** Theme color path for the secondary line. */\n secondaryColor?: string\n}\n\n/** Glyph size in px on the standard icon tile (IconComponent). */\nexport const TILE_ICON_SIZE = 30\n\n// Low Account Balance's red tile, shared by its legacy (`low_balance_alert`) and V2 (`low_balance`)\n// variant names.\nconst LOW_BALANCE_TILE: BlockLayoutConfig = {\n background: ERROR_WASH_GRADIENT,\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n return {\n overdraft_warning: {\n background: theme.palette.warning.light,\n sub_logo: 'error',\n },\n low_balance_alert: LOW_BALANCE_TILE,\n // V2 name for the same tile: content from `instance_slot.data`, the logo badged with `badge`.\n low_balance: { ...LOW_BALANCE_TILE, badge: 'error' },\n // Shared on/off-track status pair — used by Monthly Obligations Status and\n // Payday Cash Left Over Status (identical designs, different copy).\n status_off_track: {\n logo_color: 'background.paper',\n logo_bGcolor: 'error.main',\n // Figma 9936:39145: the money icon's tile has 4px corners.\n logo_border_radius: '4px',\n // Figma draws the money glyph at 24px in both status tiles (9936:39156).\n logo_icon_size: 24,\n background: ERROR_WASH_GRADIENT,\n },\n interest_charges_summary: {\n logo_color: 'text.primary',\n logo_bGcolor: alpha(theme.palette.categories?.feesCharges || '', 0.25),\n logo_border_color: 'categories.feesCharges',\n background: FEES_WASH_GRADIENT,\n },\n // Shared deposit-celebration card — used by both the standard deposit and the emergency-fund\n // deposit beats (identical design, different copy), so one design-named variant serves both.\n deposit_received: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n // Figma: the hero amount is h2 (23px), consistent with the other confetti tiles. Design sign-off:\n // https://mxenabled.slack.com/archives/C0C0F6V8TAQ/p1793864013010539\n amountVariant: 'h2',\n amountPrefix: '+',\n categoryStrip: true,\n cardShadow: true,\n rowSx: { gap: 12, p: 12 },\n secondarySource: 'merchant',\n secondaryPosition: 'below',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n status_on_track: {\n isConfetti: true,\n gradient: WARM_LIME_ACCENT_GRADIENT,\n graphic: 'logo',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n payoff_celebration: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'paidOffCard',\n amountVariant: 'h2',\n rowSx: { gap: 16, px: 24, py: 16 },\n secondarySource: 'label',\n secondaryPosition: 'below',\n secondaryVariant: 'caption',\n secondaryColor: 'text.secondary',\n },\n savings_deposit: {\n isConfetti: true,\n gradient: CELEBRATION_GRADIENT,\n graphic: 'savings',\n amountVariant: 'h2',\n rowSx: { gap: 16, p: 16 },\n secondarySource: 'label',\n secondaryPosition: 'above',\n secondaryVariant: 'body2',\n secondaryColor: 'text.primary',\n },\n // Neutral fallback for an unknown/unmatched variant: renders the plain standard card (no\n // confetti, no special background). `resolveVariantConfig` warns before falling back here.\n default: {},\n }\n}\n"],"mappings":";;AAsDA,IAAM,IAAsC,EAC1C,YAAY,EACd,GAEa,IAAA,CAAmB,OACvB;AAAA,EACL,mBAAmB;AAAA,IACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,IAClC,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,EAEnB,aAAa;AAAA,IAAE,GAAG;AAAA,IAAkB,OAAO;AAAA,EAAQ;AAAA,EAGnD,kBAAkB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IAEd,oBAAoB;AAAA,IAEpB,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EACA,0BAA0B;A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,38 +1,38 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { buildDynamicCopy as l } from "../../../../core/utils/Localization.es.js";
|
|
2
|
+
import { CURRENCY_FORMAT as e, formatCurrency as r } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import y from "../../../components/CategoryTile.es.js";
|
|
4
|
+
import C from "../../../components/LogoMark.es.js";
|
|
5
5
|
import x from "../../../components/ComponentBlocks/StatusIndicator.es.js";
|
|
6
|
-
import { getColorByBudgetTier as
|
|
7
|
-
import { Text as
|
|
8
|
-
import { jsx as
|
|
9
|
-
var
|
|
10
|
-
const { budget_percent:
|
|
6
|
+
import { getColorByBudgetTier as h } from "./util.es.js";
|
|
7
|
+
import { Text as T } from "@mxenabled/mxui";
|
|
8
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
9
|
+
var j = ({ payload: i }) => {
|
|
10
|
+
const { budget_percent: c, amount: n, budget_tier: m, category_guid: t, merchant_guid: s, spent_amount: u, budgeted_amount: d, localized_payload: o } = i.instance_slot_data, p = h(m), _ = t ? /* @__PURE__ */ a(y, {
|
|
11
11
|
categoryGuid: t,
|
|
12
12
|
size: 44,
|
|
13
13
|
tint: 0.25
|
|
14
|
-
}) : /* @__PURE__ */
|
|
15
|
-
logo: { merchant_guid:
|
|
14
|
+
}) : /* @__PURE__ */ a(C, {
|
|
15
|
+
logo: { merchant_guid: s },
|
|
16
16
|
size: 44
|
|
17
|
-
}),
|
|
17
|
+
}), g = l(o?.spent_label || "", r(u, e.cents)), b = l(o?.budgeted_label || "", r(d, e.cents)), f = /* @__PURE__ */ a(T, {
|
|
18
18
|
bold: !0,
|
|
19
19
|
variant: "h2",
|
|
20
|
-
children: t && t !== null ?
|
|
20
|
+
children: t && t !== null ? l(o?.amount_left_label || "", r(n, e.cents)) : r(n, e.cents)
|
|
21
21
|
});
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
amount:
|
|
22
|
+
return /* @__PURE__ */ a(x, {
|
|
23
|
+
amount: f,
|
|
24
24
|
borderRadius: "12px",
|
|
25
25
|
completeColor: p,
|
|
26
|
-
icon:
|
|
26
|
+
icon: _,
|
|
27
27
|
label: o?.primary_text || "",
|
|
28
|
-
leftLabel:
|
|
29
|
-
percentComplete:
|
|
30
|
-
rightLabel:
|
|
28
|
+
leftLabel: g,
|
|
29
|
+
percentComplete: c,
|
|
30
|
+
rightLabel: b,
|
|
31
31
|
sx: { "& .details-container": { gap: 12 } }
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
j as BudgetBlock
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
//# sourceMappingURL=BudgetBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BudgetBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.tsx"],"sourcesContent":["import { Text } from '@mxenabled/mxui'\n\nimport { buildDynamicCopy
|
|
1
|
+
{"version":3,"file":"BudgetBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.tsx"],"sourcesContent":["import { Text } from '@mxenabled/mxui'\n\nimport { buildDynamicCopy } from '../../../../common'\nimport type { BudgetBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport CategoryTile from '../../../components/CategoryTile'\nimport StatusIndicator from '../../../components/ComponentBlocks/StatusIndicator'\nimport LogoMark from '../../../components/LogoMark'\n\nimport type { BlockProps } from '../../types'\n\nimport { getColorByBudgetTier } from './util'\n\nexport const BudgetBlock = ({ payload }: BlockProps<BudgetBlockData>) => {\n const {\n budget_percent,\n amount,\n budget_tier,\n category_guid,\n merchant_guid,\n spent_amount,\n budgeted_amount,\n localized_payload,\n } = payload.instance_slot_data\n\n const color = getColorByBudgetTier(budget_tier)\n\n // Precomputed as a JSX element (not a component defined during render) so it\n // isn't remounted on every re-render.\n const icon = category_guid ? (\n <CategoryTile categoryGuid={category_guid} size={44} tint={0.25} />\n ) : (\n <LogoMark logo={{ merchant_guid }} size={44} />\n )\n\n const block_left_footer = buildDynamicCopy(\n localized_payload?.spent_label || '',\n formatCurrency(spent_amount, CURRENCY_FORMAT.cents),\n ) as string\n\n const block_right_footer = buildDynamicCopy(\n localized_payload?.budgeted_label || '',\n formatCurrency(budgeted_amount, CURRENCY_FORMAT.cents),\n ) as string\n\n const amountToDisplay = (\n <Text bold={true} variant=\"h2\">\n {category_guid && category_guid !== null\n ? (buildDynamicCopy(\n localized_payload?.amount_left_label || '',\n formatCurrency(amount, CURRENCY_FORMAT.cents),\n ) as string)\n : formatCurrency(amount, CURRENCY_FORMAT.cents)}\n </Text>\n )\n\n return (\n <StatusIndicator\n amount={amountToDisplay}\n borderRadius=\"12px\"\n completeColor={color}\n icon={icon}\n label={localized_payload?.primary_text || ''}\n leftLabel={block_left_footer}\n percentComplete={budget_percent}\n rightLabel={block_right_footer}\n sx={{ '& .details-container': { gap: 12 } }}\n />\n )\n}\n"],"mappings":";;;;;;;;AAcA,IAAa,IAAA,CAAe,EAAE,SAAA,EAAA,MAA2C;AACvE,QAAM,EACJ,gBAAA,GACA,QAAA,GACA,aAAA,GACA,eAAA,GACA,eAAA,GACA,cAAA,GACA,iBAAA,GACA,mBAAA,EAAA,IACE,EAAQ,oBAEN,IAAQ,EAAqB,CAAW,GAIxC,IAAO,IACX,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc;AAAA,IAAe,MAAM;AAAA,IAAI,MAAM;AAAA,EAAO,CAAA,IAElE,gBAAA,EAAC,GAAD;AAAA,IAAU,MAAM,EAAE,eAAA,EAAc;AAAA,IAAG,MAAM;AAAA,EAAK,CAAA,GAG1C,IAAoB,EACxB,GAAmB,eAAe,IAClC,EAAe,GAAc,EAAgB,KAAK,CACpD,GAEM,IAAqB,EACzB,GAAmB,kBAAkB,IACrC,EAAe,GAAiB,EAAgB,KAAK,CACvD,GAEM,IACJ,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,SAAQ;AAAA,IACvB,UAAA,KAAiB,MAAkB,OAC/B,EACC,GAAmB,qBAAqB,IACxC,EAAe,GAAQ,EAAgB,KAAK,CAC9C,IACA,EAAe,GAAQ,EAAgB,KAAK;AAAA,EAC5C,CAAA;AAGR,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,QAAQ;AAAA,IACR,cAAa;AAAA,IACb,eAAe;AAAA,IACT,MAAA;AAAA,IACN,OAAO,GAAmB,gBAAgB;AAAA,IAC1C,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,IAAI,EAAE,wBAAwB,EAAE,KAAK,GAAG,EAAE;AAAA,EAC3C,CAAA;AAEL"}
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
2
|
-
import { useGlobalCopyStore as
|
|
3
|
-
import { slot as
|
|
4
|
-
import {
|
|
5
|
-
import { resolveVariantConfig as
|
|
1
|
+
import { DATE_FORMATS_INTL as F, formatDate as N } from "../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { useGlobalCopyStore as k } from "../../../../common/context/hooks.es.js";
|
|
3
|
+
import { slot as u } from "../../../../core/types/Insights.es.js";
|
|
4
|
+
import { CURRENCY_FORMAT as i, formatCurrency as s, formatPercentage as P } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import { resolveVariantConfig as Y } from "../../resolveVariantConfig.es.js";
|
|
6
6
|
import B from "../../../components/LogoFromGuid.es.js";
|
|
7
|
-
import { DepositLogo as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { parseDueDate as
|
|
11
|
-
import { DEBTS_LAYOUT as H, debtsBlockVariant as
|
|
7
|
+
import { DepositLogo as G } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
8
|
+
import j from "../../../components/DebtPayoffCard.es.js";
|
|
9
|
+
import I from "../../../components/TransactionListCard.es.js";
|
|
10
|
+
import { parseDueDate as M } from "../RepeatingTransactionBlock/weekStrip.es.js";
|
|
11
|
+
import { DEBTS_LAYOUT as H, debtsBlockVariant as U } from "./layout.es.js";
|
|
12
12
|
import V from "react";
|
|
13
13
|
import { jsx as l } from "react/jsx-runtime";
|
|
14
14
|
import { useTheme as z } from "@mui/material/styles";
|
|
15
|
-
var
|
|
15
|
+
var W = 32, Z = /* @__PURE__ */ new Set([
|
|
16
16
|
"credit card",
|
|
17
17
|
"credit_card",
|
|
18
18
|
"creditcard"
|
|
19
|
-
]),
|
|
20
|
-
const
|
|
19
|
+
]), $ = (t) => Z.has((t ?? "").trim().toLowerCase()) ? "credit_card" : "account_balance", q = (t) => typeof t == "object" && t !== null && typeof t.primary_text == "string", J = (t) => !!t?.balance_label && !!t.payoff_date_label && !!t.monthly_payment_label && !!t.interest_rate_label, ft = ({ payload: t }) => {
|
|
20
|
+
const C = z(), o = k().insights_feed?.debts_block, { instance_slot: _ } = t, { data: m, variant: R } = _, p = Y(H, R, U.ProjectedPayoff, "DebtsBlock"), b = p.card === "summary", e = J(o) ? o : void 0, c = o?.total_balance_label, d = b ? !!c : !!e;
|
|
21
21
|
if (V.useEffect(() => {
|
|
22
|
-
|
|
23
|
-
}, [o,
|
|
24
|
-
const r =
|
|
25
|
-
amount: typeof a.amount == "number" ?
|
|
22
|
+
d || console.warn(`debts_block: ${o ? "copy incomplete" : "copy namespace missing"}; rendering without its labelled figures`);
|
|
23
|
+
}, [o, d]), b) {
|
|
24
|
+
const r = u(m, "series"), x = (Array.isArray(r) ? r : []).filter(q).map((a) => ({
|
|
25
|
+
amount: typeof a.amount == "number" ? s(a.amount, i.cents) : "",
|
|
26
26
|
leading: /* @__PURE__ */ l(B, {
|
|
27
27
|
logo: a.logo,
|
|
28
|
-
size:
|
|
28
|
+
size: W
|
|
29
29
|
}),
|
|
30
30
|
subtitle: typeof a.secondary_text == "string" ? a.secondary_text : "",
|
|
31
31
|
title: a.primary_text
|
|
32
|
-
})), L =
|
|
33
|
-
return /* @__PURE__ */ l(
|
|
34
|
-
background:
|
|
35
|
-
footer:
|
|
36
|
-
amount:
|
|
37
|
-
label:
|
|
32
|
+
})), L = u(m, "header_text"), f = u(m, "amount");
|
|
33
|
+
return /* @__PURE__ */ l(I, {
|
|
34
|
+
background: C.palette.primary.lighter,
|
|
35
|
+
footer: c && typeof f == "number" && Number.isFinite(f) ? {
|
|
36
|
+
amount: s(f, i.cents),
|
|
37
|
+
label: c
|
|
38
38
|
} : void 0,
|
|
39
39
|
header: typeof L == "string" ? L : void 0,
|
|
40
|
-
rows:
|
|
40
|
+
rows: x
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
const { account_name:
|
|
43
|
+
const { account_name: A, account_type: y, amount: g, institution_guid: E, institution_name: O, interest_rate: h, monthly_payment: v, payoff_date: T, status_text: S } = _, n = [];
|
|
44
44
|
if (e) {
|
|
45
|
-
const r =
|
|
45
|
+
const r = T ? M(T) : null;
|
|
46
46
|
r && n.push({
|
|
47
47
|
label: e.payoff_date_label,
|
|
48
|
-
value:
|
|
49
|
-
}),
|
|
48
|
+
value: N(r, F.MONTH_SHORT_YEAR)
|
|
49
|
+
}), v != null && n.push({
|
|
50
50
|
label: e.monthly_payment_label,
|
|
51
|
-
value:
|
|
52
|
-
}),
|
|
51
|
+
value: s(v, i.cents)
|
|
52
|
+
}), h != null && n.push({
|
|
53
53
|
label: e.interest_rate_label,
|
|
54
|
-
value:
|
|
54
|
+
value: P(h / 100)
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
const D = e !== void 0 &&
|
|
58
|
-
return /* @__PURE__ */ l(
|
|
59
|
-
...
|
|
60
|
-
balance: D ?
|
|
57
|
+
const D = e !== void 0 && g != null;
|
|
58
|
+
return /* @__PURE__ */ l(j, {
|
|
59
|
+
...p.style,
|
|
60
|
+
balance: D ? s(g, i.cents) : void 0,
|
|
61
61
|
balanceLabel: D ? e.balance_label : void 0,
|
|
62
|
-
logo: /* @__PURE__ */ l(
|
|
63
|
-
iconName:
|
|
64
|
-
institutionGuid:
|
|
65
|
-
institutionName:
|
|
62
|
+
logo: /* @__PURE__ */ l(G, {
|
|
63
|
+
iconName: $(y),
|
|
64
|
+
institutionGuid: E ?? "",
|
|
65
|
+
institutionName: O ?? ""
|
|
66
66
|
}),
|
|
67
|
-
name:
|
|
67
|
+
name: A,
|
|
68
68
|
stats: n,
|
|
69
|
-
statusLabel:
|
|
70
|
-
subtitle:
|
|
69
|
+
statusLabel: S,
|
|
70
|
+
subtitle: y
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
ft as default
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
//# sourceMappingURL=DebtsBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type InstanceSlotRow } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { DebtsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport {
|
|
1
|
+
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type InstanceSlotRow } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { DebtsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport {\n CURRENCY_FORMAT,\n formatCurrency,\n formatPercentage,\n} from '../../../../core/utils/NumberFormatting'\n\nimport DepositLogo from '../../../components/ComponentBlocks/DepositLogo'\nimport DebtPayoffCard, { type DebtPayoffStat } from '../../../components/DebtPayoffCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { parseDueDate } from '../RepeatingTransactionBlock/weekStrip'\n\nimport { DEBTS_LAYOUT, debtsBlockVariant } from './layout'\n\n// The card story reads the block's look from here.\nexport { PAYOFF_STYLE } from './layout'\n\ninterface DebtsBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n\n/** Account types drawn with the card glyph when there is no institution logo; the rest get the bank. */\nconst CREDIT_CARD_TYPES = new Set(['credit card', 'credit_card', 'creditcard'])\n\nconst iconFor = (accountType?: string) =>\n CREDIT_CARD_TYPES.has((accountType ?? '').trim().toLowerCase())\n ? 'credit_card'\n : 'account_balance'\n\n/** A summary row ditto can draw: an object with a name. Anything else in `series` is skipped. */\nconst isNamedRow = (row: unknown): row is InstanceSlotRow & { primary_text: string } =>\n typeof row === 'object' &&\n row !== null &&\n typeof (row as InstanceSlotRow).primary_text === 'string'\n\n/** Every label the payoff card renders; a partial namespace counts as missing. */\nconst hasAllLabels = (copy?: DebtsBlockCopy): copy is DebtsBlockCopy =>\n !!copy?.balance_label &&\n !!copy.payoff_date_label &&\n !!copy.monthly_payment_label &&\n !!copy.interest_rate_label\n\n/**\n * Debts component block — the content card for the Debt Payoff Strategies beat.\n * `instance_slot.variant` picks the card from `./layout.ts` through `resolveVariantConfig`, as\n * `AccountBlock` does:\n *\n * - `projected_payoff` — one account on the `DebtPayoffCard`. Its facts arrive flat on\n * `instance_slot` (the shape it shipped with): the balance (`amount`), `payoff_date`,\n * `monthly_payment`, `interest_rate`, plus the shared account/institution fields.\n * - `debt_summary` — the beat's several debt accounts on a `TransactionListCard`, read from\n * `instance_slot.data`: one row per account from `series` (pre-localized `logo`, `primary_text`\n * name, `secondary_text` rate, `amount` balance, in the order sent), an optional `header_text`,\n * and the total owed (`amount`) as the footer. With no rows there is nothing to summarize and the\n * block renders nothing.\n *\n * Captions and payoff row labels come from `insights_feed.debts_block` copy, which ships\n * separately. Each variant needs only its own keys: until they have shipped, the card shows what\n * needs no copy (the account row, the summary rows) but never an unlabelled figure, and warns once\n * per mount so the rollout gap is traceable. A row with no value (or an unparseable date) is\n * dropped rather than rendered blank.\n */\nconst DebtsBlock = ({ payload }: DebtsBlockProps) => {\n const theme = useTheme()\n const copy = useGlobalCopyStore().insights_feed?.debts_block\n const { instance_slot } = payload\n const { data, variant } = instance_slot\n\n const layout = resolveVariantConfig(\n DEBTS_LAYOUT,\n variant,\n debtsBlockVariant.ProjectedPayoff,\n 'DebtsBlock',\n )\n const isSummary = layout.card === 'summary'\n\n const labels = hasAllLabels(copy) ? copy : undefined\n const totalLabel = copy?.total_balance_label\n const hasCopy = isSummary ? !!totalLabel : !!labels\n\n React.useEffect(() => {\n if (hasCopy) return\n console.warn(\n `debts_block: ${copy ? 'copy incomplete' : 'copy namespace missing'}; rendering without its labelled figures`,\n )\n }, [copy, hasCopy])\n\n if (isSummary) {\n // `slot()` is an unchecked cast over backend data, so every value is narrowed before use.\n const series = slot<unknown[]>(data, 'series')\n const rows = (Array.isArray(series) ? series : []).filter(isNamedRow).map((row) => ({\n amount:\n typeof row.amount === 'number' ? formatCurrency(row.amount, CURRENCY_FORMAT.cents) : '',\n leading: <LogoFromGuid logo={row.logo} size={ROW_LOGO_SIZE} />,\n subtitle: typeof row.secondary_text === 'string' ? row.secondary_text : '',\n title: row.primary_text,\n }))\n const header = slot<unknown>(data, 'header_text')\n const total = slot<unknown>(data, 'amount')\n\n return (\n <TransactionListCard\n background={theme.palette.primary.lighter}\n footer={\n totalLabel && typeof total === 'number' && Number.isFinite(total)\n ? { amount: formatCurrency(total, CURRENCY_FORMAT.cents), label: totalLabel }\n : undefined\n }\n header={typeof header === 'string' ? header : undefined}\n rows={rows}\n />\n )\n }\n\n const {\n account_name,\n account_type,\n amount,\n institution_guid,\n institution_name,\n interest_rate,\n monthly_payment,\n payoff_date,\n status_text,\n } = instance_slot\n\n const stats: DebtPayoffStat[] = []\n if (labels) {\n const payoffDate = payoff_date ? parseDueDate(payoff_date) : null\n if (payoffDate) {\n stats.push({\n label: labels.payoff_date_label,\n value: formatDate(payoffDate, DATE_FORMATS_INTL.MONTH_SHORT_YEAR),\n })\n }\n if (monthly_payment != null) {\n stats.push({\n label: labels.monthly_payment_label,\n value: formatCurrency(monthly_payment, CURRENCY_FORMAT.cents),\n })\n }\n if (interest_rate != null) {\n // `interest_rate` arrives as a percentage (19.99); Intl's percent style expects a fraction.\n stats.push({\n label: labels.interest_rate_label,\n value: formatPercentage(interest_rate / 100),\n })\n }\n }\n\n const hasBalance = labels !== undefined && amount != null\n\n return (\n <DebtPayoffCard\n {...layout.style}\n balance={hasBalance ? formatCurrency(amount, CURRENCY_FORMAT.cents) : undefined}\n balanceLabel={hasBalance ? labels.balance_label : undefined}\n logo={\n <DepositLogo\n iconName={iconFor(account_type)}\n institutionGuid={institution_guid ?? ''}\n institutionName={institution_name ?? ''}\n />\n }\n name={account_name}\n stats={stats}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n}\n\nexport default DebtsBlock\n"],"mappings":";;;;;;;;;;;;;;AA+BA,IAAM,IAAgB,IAGhB,IAAoB,oBAAI,IAAI;AAAA,EAAC;AAAA,EAAe;AAAA,EAAe;AAAY,CAAC,GAExE,IAAA,CAAW,MACf,EAAkB,KAAK,KAAe,IAAI,KAAK,EAAE,YAAY,CAAC,IAC1D,gBACA,mBAGA,IAAA,CAAc,MAClB,OAAO,KAAQ,YACf,MAAQ,QACR,OAAQ,EAAwB,gBAAiB,UAG7C,IAAA,CAAgB,MACpB,CAAC,CAAC,GAAM,iBACR,CAAC,CAAC,EAAK,qBACP,CAAC,CAAC,E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EN,QAAQ,OAAO,KAAW,WAAW,IAAS;AAAA,MACxC,MAAA;AAAA,IACP,CAAA;AAAA,EAEL;AAEA,QAAM,EACJ,cAAA,GACA,cAAA,GACA,QAAA,GACA,kBAAA,GACA,kBAAA,GACA,eAAA,GACA,iBAAA,GACA,aAAA,GACA,aAAA,EAAA,IACE,GAEE,IAA0B,CAAC;AACjC,MAAI,GAAQ;AACV,UAAM,IAAa,IAAc,EAAa,CAAW,IAAI;AAC7D,IAAI,KACF,EAAM,KAAK;AAAA,MACT,OAAO,EAAO;AAAA,MACd,OAAO,EAAW,GAAY,EAAkB,gBAAgB;AAAA,IAClE,CAAC,GAEC,KAAmB,QACrB,EAAM,KAAK;AAAA,MACT,OAAO,EAAO;AAAA,MACd,OAAO,EAAe,GAAiB,EAAgB,KAAK;AAAA,IAC9D,CAAC,GAEC,KAAiB,QAEnB,EAAM,KAAK;AAAA,MACT,OAAO,EAAO;AAAA,MACd,OAAO,EAAiB,IAAgB,GAAG;AAAA,IAC7C,CAAC;AAAA,EAEL;AAEA,QAAM,IAAa,MAAW,UAAa,KAAU;AAErD,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI,EAAO;AAAA,IACX,SAAS,IAAa,EAAe,GAAQ,EAAgB,KAAK,IAAI;AAAA,IACtE,cAAc,IAAa,EAAO,gBAAgB;AAAA,IAClD,MACE,gBAAA,EAAC,GAAD;AAAA,MACE,UAAU,EAAQ,CAAY;AAAA,MAC9B,iBAAiB,KAAoB;AAAA,MACrC,iBAAiB,KAAoB;AAAA,IACtC,CAAA;AAAA,IAEH,MAAM;AAAA,IACC,OAAA;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,EACX,CAAA;AAEL"}
|
package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
1
|
+
import { buildDynamicCopy as m } from "../../../../core/utils/Localization.es.js";
|
|
2
2
|
import { GlobalDataContext as l } from "../../../../common/context/GlobalDataProvider.es.js";
|
|
3
3
|
import { slot as u } from "../../../../core/types/Insights.es.js";
|
|
4
4
|
import { resolveVariantConfig as c } from "../../resolveVariantConfig.es.js";
|
|
5
|
-
import {
|
|
5
|
+
import { asLogoRef as g, asText as f, slotOrFlat as p } from "../../slotReaders.es.js";
|
|
6
6
|
import d from "../../../components/LogoFromGuid.es.js";
|
|
7
|
-
import
|
|
8
|
-
import { detailedAccountVariant as
|
|
9
|
-
import { useContext as
|
|
10
|
-
import { jsx as
|
|
7
|
+
import _ from "../../../components/DirectDepositCard.es.js";
|
|
8
|
+
import { detailedAccountVariant as v, getLayoutConfig as y } from "./layout.es.js";
|
|
9
|
+
import { useContext as L } from "react";
|
|
10
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
11
11
|
import { useTheme as x } from "@mui/material/styles";
|
|
12
|
-
var n = (t, a) =>
|
|
13
|
-
const o = u(t.data, "logo"), e = n(t, "institution_guid"), r = o?.alt ?? n(t, "institution_name"), i = o ?? (e ? {
|
|
12
|
+
var n = (t, a) => f(p(t, a)), C = (t, a) => {
|
|
13
|
+
const o = g(u(t.data, "logo")), e = n(t, "institution_guid"), r = o?.alt ?? n(t, "institution_name"), i = o ?? (e ? {
|
|
14
14
|
guid: e,
|
|
15
15
|
alt: r ?? e
|
|
16
16
|
} : void 0);
|
|
17
17
|
return !i || !r ? i : {
|
|
18
18
|
...i,
|
|
19
|
-
alt: a ?
|
|
19
|
+
alt: a ? m(a, r) : r
|
|
20
20
|
};
|
|
21
|
-
},
|
|
22
|
-
const a = x(), { instance_slot: o } = t, e =
|
|
23
|
-
return /* @__PURE__ */
|
|
21
|
+
}, z = ({ payload: t }) => {
|
|
22
|
+
const a = x(), { instance_slot: o } = t, e = L(l)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, r = C(o, e), i = c(y(a), o.variant, v.Neutral, "DetailedAccountBlock");
|
|
23
|
+
return /* @__PURE__ */ s(_, {
|
|
24
24
|
...i,
|
|
25
|
-
logo: r?.guid ? /* @__PURE__ */
|
|
25
|
+
logo: r?.guid ? /* @__PURE__ */ s(d, {
|
|
26
26
|
logo: r,
|
|
27
27
|
size: 48
|
|
28
28
|
}) : null,
|
|
@@ -32,7 +32,7 @@ var n = (t, a) => g(p(t, a)), C = (t, a) => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
z as default
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
//# sourceMappingURL=DetailedAccountBlock.es.js.map
|
package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asText, slotOrFlat, type FlatSlotKey } from '../../slotReaders'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\nconst readFact = (instanceSlot: InstanceSlot, name: FlatSlotKey): string | undefined =>\n asText(slotOrFlat(instanceSlot, name))\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = slot
|
|
1
|
+
{"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asText, slotOrFlat, type FlatSlotKey } from '../../slotReaders'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\nconst readFact = (instanceSlot: InstanceSlot, name: FlatSlotKey): string | undefined =>\n asText(slotOrFlat(instanceSlot, name))\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = asLogoRef(slot(instanceSlot.data, 'logo'))\n const guid = readFact(instanceSlot, 'institution_guid')\n const name = dataLogo?.alt ?? readFact(instanceSlot, 'institution_name')\n\n const logo = dataLogo ?? (guid ? { guid, alt: name ?? guid } : undefined)\n if (!logo || !name) return logo\n\n return { ...logo, alt: altCopy ? (buildDynamicCopy(altCopy, name) as string) : name }\n}\n\nconst DetailedAccountBlock = ({ payload }: DetailedAccountBlockProps) => {\n const theme = useTheme()\n const { instance_slot } = payload\n // Optional: the micro widget renders this block without a GlobalDataProvider.\n const altCopy =\n useContext(GlobalDataContext)?.globalStore.copyStore.copy.insights_feed?.general\n ?.institution_Logo\n const logo = resolveLogo(instance_slot, altCopy)\n const layout = resolveVariantConfig(\n getLayoutConfig(theme),\n instance_slot.variant,\n detailedAccountVariant.Neutral,\n 'DetailedAccountBlock',\n )\n\n return (\n <DirectDepositCard\n {...layout}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={readFact(instance_slot, 'account_name')}\n statusLabel={readFact(instance_slot, 'status_text')}\n subtitle={readFact(instance_slot, 'account_type')}\n />\n )\n}\n\nexport default DetailedAccountBlock\n"],"mappings":";;;;;;;;;;;AAqBA,IAAM,IAAA,CAAY,GAA4B,MAC5C,EAAO,EAAW,GAAc,CAAI,CAAC,GAGjC,IAAA,CAAe,GAA4B,MAA0C;AACzF,QAAM,IAAW,EAAU,EAAK,EAAa,MAAM,MAAM,CAAC,GACpD,IAAO,EAAS,GAAc,kBAAkB,GAChD,IAAO,GAAU,OAAO,EAAS,GAAc,kBAAkB,GAEjE,IAAO,MAAa,IAAO;AAAA,IAAE,MAAA;AAAA,IAAM,KAAK,KAAQ;AAAA,EAAK,IAAI;AAC/D,SAAI,CAAC,KAAQ,CAAC,IAAa,IAEpB;AAAA,IAAE,GAAG;AAAA,IAAM,KAAK,IAAW,EAAiB,GAAS,CAAI,IAAe;AAAA,EAAK;AACtF,GAEM,IAAA,CAAwB,EAAE,SAAA,EAAA,MAAyC;AACvE,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,EAAA,IAAkB,GAEpB,IACJ,EAAW,CAAiB,GAAG,YAAY,UAAU,KAAK,eAAe,SACrE,kBACA,IAAO,EAAY,GAAe,CAAO,GACzC,IAAS,EACb,EAAgB,CAAK,GACrB,EAAc,SACd,EAAuB,SACvB,sBACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,IAAI;AAAA,IAC5D,MAAM,EAAS,GAAe,cAAc;AAAA,IAC5C,aAAa,EAAS,GAAe,aAAa;AAAA,IAClD,UAAU,EAAS,GAAe,cAAc;AAAA,EACjD,CAAA;AAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PRIMARY_TILE_GRADIENTS as n, SUCCESS_TILE_GRADIENTS as d, WARM_LIME_ACCENT_GRADIENT as p } from "../../../components/celebrationGradients.es.js";
|
|
2
2
|
var t = {
|
|
3
3
|
Neutral: "detailed_neutral",
|
|
4
4
|
Primary: "detailed_primary",
|
|
@@ -9,67 +9,61 @@ var t = {
|
|
|
9
9
|
DirectDepositComplete: "direct_deposit_complete",
|
|
10
10
|
MissingInterestRate: "missing_interest_rate",
|
|
11
11
|
InterestRateAdded: "interest_rate_added"
|
|
12
|
-
},
|
|
13
|
-
light: "linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)",
|
|
14
|
-
dark: "linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)"
|
|
15
|
-
}, p = {
|
|
16
|
-
light: "linear-gradient(180deg, #94C9B7 0%, #12875E 100%)",
|
|
17
|
-
dark: "linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)"
|
|
18
|
-
}, b = (e) => {
|
|
12
|
+
}, b = /* @__PURE__ */ new Set([...Object.values(t), ...Object.values(a)]), _ = (e) => e != null && b.has(e), u = (e) => {
|
|
19
13
|
const r = e === "dark" ? "grey.800" : "grey.100";
|
|
20
14
|
return {
|
|
21
15
|
bgcolor: r,
|
|
22
16
|
borderColor: r,
|
|
23
17
|
labelColor: "text.primary"
|
|
24
18
|
};
|
|
25
|
-
},
|
|
19
|
+
}, g = {
|
|
26
20
|
bgcolor: "primary.lighter",
|
|
27
21
|
borderColor: "primary.lighter",
|
|
28
22
|
labelColor: "text.primary"
|
|
29
|
-
},
|
|
23
|
+
}, s = {
|
|
30
24
|
bgcolor: "success.main",
|
|
31
25
|
borderColor: "success.main",
|
|
32
26
|
labelColor: "success.contrastText"
|
|
33
|
-
},
|
|
34
|
-
const r = e.palette.mode,
|
|
27
|
+
}, I = (e) => {
|
|
28
|
+
const r = e.palette.mode, o = {
|
|
35
29
|
bgcolor: "primary.lighter",
|
|
36
30
|
nameVariant: "body2",
|
|
37
|
-
pill:
|
|
38
|
-
},
|
|
39
|
-
backgroundImage:
|
|
31
|
+
pill: u(r)
|
|
32
|
+
}, i = {
|
|
33
|
+
backgroundImage: n[r],
|
|
40
34
|
bgcolor: "background.paper",
|
|
41
35
|
nameVariant: "body1",
|
|
42
|
-
pill:
|
|
36
|
+
pill: g
|
|
43
37
|
}, l = {
|
|
44
|
-
backgroundImage:
|
|
38
|
+
backgroundImage: d[r],
|
|
45
39
|
bgcolor: "background.paper",
|
|
46
40
|
nameVariant: "body1",
|
|
47
|
-
pill:
|
|
48
|
-
},
|
|
49
|
-
backgroundImage:
|
|
41
|
+
pill: s
|
|
42
|
+
}, c = {
|
|
43
|
+
backgroundImage: p,
|
|
50
44
|
bgcolor: "background.paper",
|
|
51
45
|
nameVariant: "body2",
|
|
52
46
|
pill: {
|
|
53
|
-
...
|
|
47
|
+
...s,
|
|
54
48
|
icon: "check_circle"
|
|
55
49
|
},
|
|
56
50
|
showConfetti: !0
|
|
57
51
|
};
|
|
58
52
|
return {
|
|
59
|
-
[t.Neutral]:
|
|
60
|
-
[t.Primary]:
|
|
53
|
+
[t.Neutral]: o,
|
|
54
|
+
[t.Primary]: i,
|
|
61
55
|
[t.Success]: l,
|
|
62
|
-
[t.Celebration]:
|
|
63
|
-
[a.SetUpDirectDeposit]:
|
|
64
|
-
[a.MissingInterestRate]:
|
|
56
|
+
[t.Celebration]: c,
|
|
57
|
+
[a.SetUpDirectDeposit]: o,
|
|
58
|
+
[a.MissingInterestRate]: i,
|
|
65
59
|
[a.InterestRateAdded]: l,
|
|
66
|
-
[a.DirectDepositComplete]:
|
|
60
|
+
[a.DirectDepositComplete]: c
|
|
67
61
|
};
|
|
68
62
|
};
|
|
69
63
|
export {
|
|
70
64
|
t as detailedAccountVariant,
|
|
71
65
|
a as directDepositVariant,
|
|
72
|
-
|
|
66
|
+
I as getLayoutConfig,
|
|
73
67
|
_ as isDetailedAccountVariant
|
|
74
68
|
};
|
|
75
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n PRIMARY_TILE_GRADIENTS,\n SUCCESS_TILE_GRADIENTS,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type {\n DirectDepositCardStyleProps,\n DirectDepositPillConfig,\n} from '../../../components/DirectDepositCard'\n\nexport const detailedAccountVariant = {\n Neutral: 'detailed_neutral',\n Primary: 'detailed_primary',\n Success: 'detailed_success',\n Celebration: 'detailed_celebration',\n} as const\n\nexport type DetailedAccountVariant =\n (typeof detailedAccountVariant)[keyof typeof detailedAccountVariant]\n\nexport const directDepositVariant = {\n SetUpDirectDeposit: 'set_up_direct_deposit',\n DirectDepositComplete: 'direct_deposit_complete',\n MissingInterestRate: 'missing_interest_rate',\n InterestRateAdded: 'interest_rate_added',\n} as const\n\nexport type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant]\n\nconst VARIANTS = new Set<string>([\n ...Object.values(detailedAccountVariant),\n ...Object.values(directDepositVariant),\n])\n\nexport const isDetailedAccountVariant = (\n variant?: string | null,\n): variant is DetailedAccountVariant | DirectDepositVariant =>\n variant != null && VARIANTS.has(variant)\n\n// Grey tokens don't change with the mode, so pick the one `text.primary` reads on.\nconst neutralPill = (mode: Theme['palette']['mode']): DirectDepositPillConfig => {\n const bgcolor = mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return { bgcolor, borderColor: bgcolor, labelColor: 'text.primary' }\n}\n\nconst PRIMARY_TINT_PILL: DirectDepositPillConfig = {\n bgcolor: 'primary.lighter',\n borderColor: 'primary.lighter',\n labelColor: 'text.primary',\n}\n\nconst SUCCESS_PILL: DirectDepositPillConfig = {\n bgcolor: 'success.main',\n borderColor: 'success.main',\n labelColor: 'success.contrastText',\n}\n\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<DetailedAccountVariant | DirectDepositVariant, DirectDepositCardStyleProps> => {\n const mode = theme.palette.mode\n const neutral: DirectDepositCardStyleProps = {\n bgcolor: 'primary.lighter',\n nameVariant: 'body2',\n pill: neutralPill(mode),\n }\n const primary: DirectDepositCardStyleProps = {\n backgroundImage: PRIMARY_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: PRIMARY_TINT_PILL,\n }\n const success: DirectDepositCardStyleProps = {\n backgroundImage: SUCCESS_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: SUCCESS_PILL,\n }\n const celebration: DirectDepositCardStyleProps = {\n backgroundImage: WARM_LIME_ACCENT_GRADIENT,\n bgcolor: 'background.paper',\n nameVariant: 'body2',\n pill: { ...SUCCESS_PILL, icon: 'check_circle' },\n showConfetti: true,\n }\n\n return {\n [detailedAccountVariant.Neutral]: neutral,\n [detailedAccountVariant.Primary]: primary,\n [detailedAccountVariant.Success]: success,\n [detailedAccountVariant.Celebration]: celebration,\n [directDepositVariant.SetUpDirectDeposit]: neutral,\n [directDepositVariant.MissingInterestRate]: primary,\n [directDepositVariant.InterestRateAdded]: success,\n [directDepositVariant.DirectDepositComplete]: celebration,\n }\n}\n"],"mappings":";AAYA,IAAa,IAAyB;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf,GAKa,IAAuB;AAAA,EAClC,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAIM,IAAW,oBAAI,IAAY,CAC/B,GAAG,OAAO,O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qB,qBAAA,GAAwB;AAAA,EAChD;AACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { buildPluralCopy as m } from "../../../../core/utils/Localization.es.js";
|
|
2
2
|
import { useGlobalCopyStore as u } from "../../../../common/context/hooks.es.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CURRENCY_FORMAT as f, formatCurrency as g } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
4
|
import { asNumber as _, slotOrFlat as s } from "../../slotReaders.es.js";
|
|
5
|
-
import
|
|
5
|
+
import h from "./GasGraphic.es.js";
|
|
6
6
|
import o from "@mui/material/Stack";
|
|
7
7
|
import { Text as a } from "@mxenabled/mxui";
|
|
8
8
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
9
|
+
var x = "_1{count} Fill-ups", v = "_1{count} Fill-up", b = "spent on gas", A = ({ payload: c }) => {
|
|
10
10
|
const t = u().insights_feed?.general, { instance_slot: i = {}, widget_type: d } = c, n = d === "mini", e = _(s(i, "total_fill_up_visits")), p = _(s(i, "total_spend") ?? s(i, "total_debt_for_fill_up_visits_in_prev_month"));
|
|
11
11
|
return e === void 0 || p === void 0 ? null : /* @__PURE__ */ l(o, {
|
|
12
12
|
direction: "row",
|
|
@@ -17,7 +17,7 @@ var h = "_1{count} Fill-ups", x = "_1{count} Fill-up", v = "spent on gas", P = (
|
|
|
17
17
|
py: n ? 12 : 16,
|
|
18
18
|
width: "100%"
|
|
19
19
|
},
|
|
20
|
-
children: [/* @__PURE__ */ r(
|
|
20
|
+
children: [/* @__PURE__ */ r(h, {
|
|
21
21
|
height: n ? 94 : 130,
|
|
22
22
|
label: t?.gas_pump
|
|
23
23
|
}), /* @__PURE__ */ l(o, {
|
|
@@ -38,7 +38,7 @@ var h = "_1{count} Fill-ups", x = "_1{count} Fill-up", v = "spent on gas", P = (
|
|
|
38
38
|
color: "primary.dark",
|
|
39
39
|
sx: { fontWeight: 700 },
|
|
40
40
|
variant: "caption",
|
|
41
|
-
children: m(t?.gas_fill_ups_count_one ??
|
|
41
|
+
children: m(t?.gas_fill_ups_count_one ?? v, t?.gas_fill_ups_count ?? x, e, String(e))
|
|
42
42
|
})
|
|
43
43
|
}), /* @__PURE__ */ l(o, {
|
|
44
44
|
sx: {
|
|
@@ -50,18 +50,18 @@ var h = "_1{count} Fill-ups", x = "_1{count} Fill-up", v = "spent on gas", P = (
|
|
|
50
50
|
children: [/* @__PURE__ */ r(a, {
|
|
51
51
|
component: "span",
|
|
52
52
|
variant: "h3",
|
|
53
|
-
children:
|
|
53
|
+
children: g(p, f.whole)
|
|
54
54
|
}), /* @__PURE__ */ r(a, {
|
|
55
55
|
color: "text.secondary",
|
|
56
56
|
variant: "caption",
|
|
57
|
-
children: t?.gas_spent_on_gas ??
|
|
57
|
+
children: t?.gas_spent_on_gas ?? b
|
|
58
58
|
})]
|
|
59
59
|
})]
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
A as default
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
//# sourceMappingURL=GasPurchaseBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GasPurchaseBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { buildPluralCopy, useGlobalCopyStore } from '../../../../common'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { asNumber, slotOrFlat } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\nimport GasGraphic from './GasGraphic'\n\nconst DEFAULT_FILL_UPS = '_1{count} Fill-ups'\nconst DEFAULT_FILL_UPS_ONE = '_1{count} Fill-up'\nconst DEFAULT_SPENT_ON_GAS = 'spent on gas'\n\nconst GasPurchaseBlock = ({ payload }: BlockProps) => {\n const generalCopy = useGlobalCopyStore().insights_feed?.general\n\n const { instance_slot = {}, widget_type } = payload\n const isMini = widget_type === 'mini'\n const visits = asNumber(slotOrFlat(instance_slot, 'total_fill_up_visits'))\n const spend = asNumber(\n slotOrFlat(instance_slot, 'total_spend') ??\n slotOrFlat(instance_slot, 'total_debt_for_fill_up_visits_in_prev_month'),\n )\n\n if (visits === undefined || spend === undefined) return null\n\n return (\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n gap: isMini ? 12 : 16,\n px: 16,\n py: isMini ? 12 : 16,\n width: '100%',\n }}\n >\n <GasGraphic height={isMini ? 94 : 130} label={generalCopy?.gas_pump} />\n <Stack sx={{ flex: 1, justifyContent: 'center', minWidth: 0, pb: 12 }}>\n <Stack sx={{ bgcolor: 'primary.lighter', borderRadius: '4px 4px 0 0', px: 10, py: 4 }}>\n <Text color=\"primary.dark\" sx={{ fontWeight: 700 }} variant=\"caption\">\n {\n buildPluralCopy(\n generalCopy?.gas_fill_ups_count_one ?? DEFAULT_FILL_UPS_ONE,\n generalCopy?.gas_fill_ups_count ?? DEFAULT_FILL_UPS,\n visits,\n String(visits),\n ) as string\n }\n </Text>\n </Stack>\n <Stack sx={{ bgcolor: 'background.default', borderRadius: '0 0 4px 4px', gap: 2, p: 8 }}>\n <Text component=\"span\" variant=\"h3\">\n {formatCurrency(spend,
|
|
1
|
+
{"version":3,"file":"GasPurchaseBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { buildPluralCopy, useGlobalCopyStore } from '../../../../common'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { asNumber, slotOrFlat } from '../../slotReaders'\nimport type { BlockProps } from '../../types'\n\nimport GasGraphic from './GasGraphic'\n\nconst DEFAULT_FILL_UPS = '_1{count} Fill-ups'\nconst DEFAULT_FILL_UPS_ONE = '_1{count} Fill-up'\nconst DEFAULT_SPENT_ON_GAS = 'spent on gas'\n\nconst GasPurchaseBlock = ({ payload }: BlockProps) => {\n const generalCopy = useGlobalCopyStore().insights_feed?.general\n\n const { instance_slot = {}, widget_type } = payload\n const isMini = widget_type === 'mini'\n const visits = asNumber(slotOrFlat(instance_slot, 'total_fill_up_visits'))\n const spend = asNumber(\n slotOrFlat(instance_slot, 'total_spend') ??\n slotOrFlat(instance_slot, 'total_debt_for_fill_up_visits_in_prev_month'),\n )\n\n if (visits === undefined || spend === undefined) return null\n\n return (\n <Stack\n direction=\"row\"\n sx={{\n alignItems: 'center',\n gap: isMini ? 12 : 16,\n px: 16,\n py: isMini ? 12 : 16,\n width: '100%',\n }}\n >\n <GasGraphic height={isMini ? 94 : 130} label={generalCopy?.gas_pump} />\n <Stack sx={{ flex: 1, justifyContent: 'center', minWidth: 0, pb: 12 }}>\n <Stack sx={{ bgcolor: 'primary.lighter', borderRadius: '4px 4px 0 0', px: 10, py: 4 }}>\n <Text color=\"primary.dark\" sx={{ fontWeight: 700 }} variant=\"caption\">\n {\n buildPluralCopy(\n generalCopy?.gas_fill_ups_count_one ?? DEFAULT_FILL_UPS_ONE,\n generalCopy?.gas_fill_ups_count ?? DEFAULT_FILL_UPS,\n visits,\n String(visits),\n ) as string\n }\n </Text>\n </Stack>\n <Stack sx={{ bgcolor: 'background.default', borderRadius: '0 0 4px 4px', gap: 2, p: 8 }}>\n <Text component=\"span\" variant=\"h3\">\n {formatCurrency(spend, CURRENCY_FORMAT.whole)}\n </Text>\n <Text color=\"text.secondary\" variant=\"caption\">\n {generalCopy?.gas_spent_on_gas ?? DEFAULT_SPENT_ON_GAS}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default GasPurchaseBlock\n"],"mappings":";;;;;;;;AAWA,IAAM,IAAmB,sBACnB,IAAuB,qBACvB,IAAuB,gBAEvB,IAAA,CAAoB,EAAE,SAAA,EAAA,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