@mx-cartographer/experiences 9.7.200 → 9.7.202
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/types/Insights.d.ts +1 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +75 -73
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +5 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +27 -8
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.d.ts +12 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +131 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -1
- package/dist/insights-v2/index.es.js +39 -39
- package/dist/insights-v2/mappings/blocks.es.js +24 -24
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.d.ts +0 -8
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js +0 -88
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [9.7.202] - 11-23-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Deposit 529 account block variant (WELL-221)
|
|
4
|
+
- **CHANGED** - Deposit received card shows the + only for amounts above 0 (WELL-221)
|
|
5
|
+
|
|
6
|
+
## [9.7.201] - 11-23-2026
|
|
7
|
+
|
|
8
|
+
- **CHANGED** - Green Statement Fee block matches Figma and is renamed `fee_charged_block`, reading all its content from the slot (WELL-222)
|
|
9
|
+
|
|
1
10
|
## [9.7.200] - 11-23-2026
|
|
2
11
|
|
|
3
12
|
- **ADDED** - Account Discoverability Change sample cards, story and contract test (WELL-223)
|
|
@@ -284,7 +284,7 @@ export declare const BlockType: {
|
|
|
284
284
|
readonly UpcomingSubscriptionBlock: "upcoming_subscription_block";
|
|
285
285
|
readonly WeeklySmallPurchasesBlock: "weekly_small_purchases_block";
|
|
286
286
|
readonly WithdrawalBlock: "withdrawal_block";
|
|
287
|
-
readonly
|
|
287
|
+
readonly FeeChargedBlock: "fee_charged_block";
|
|
288
288
|
};
|
|
289
289
|
export type BlockType = (typeof BlockType)[keyof typeof BlockType];
|
|
290
290
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuarterlySummaryBlock: 'quarterly_summary_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n GreenStatementFeeBlock: 'green_statement_fee_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AAyVA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport type { DataSeries } from './Beat'\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/** A row in a drilldown list fact (e.g. the Subscriptions drawer's per-transaction schedule). */\nexport type DrilldownRow = Record<string, string | number | boolean | null>\n\n/**\n * V2: facts a drilldown shows that the card does not. On the payload: what every CTA of the card\n * shares (e.g. the account number for the Transaction Details drawer, or the guid list a list drawer\n * shows, `transaction_guids`). On a CTA: the figures that CTA's own drilldown renders (the Transaction\n * List summary header's `amount`, `start_date` / `end_date` and `count`, see `readSummary`). Scalars,\n * string lists, a `data_series` (the months a history drawer charts), or rows of scalars\n * (`transaction_frequencies`), omitted when the insight has none. Never carries copy or user actions\n * (memo, tags, hide, flag come from the transaction store). Values come from the server, so a reader\n * still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<\n string,\n string | number | boolean | null | string[] | DataSeries | DrilldownRow[]\n>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n /** tupac's flat host message for the link (`action` plus fields), e.g. Switch's op_1. */\n post_message_metadata?: ({ action?: string | null } & Record<string, unknown>) | null\n /** Figures this CTA's drilldown renders (e.g. a summary header's amount/dates/count). */\n drilldown_data?: DrilldownData\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n MerchantBlock: 'merchant_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n GasPurchaseBlock: 'gas_purchase_block',\n GoalsBlock: 'goals_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n QuarterlySummaryBlock: 'quarterly_summary_block',\n QuizBlock: 'quiz_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsAmountBlock: 'savings_amount_block',\n SavingsSummaryBlock: 'savings_summary_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WeeklySmallPurchasesBlock: 'weekly_small_purchases_block',\n WithdrawalBlock: 'withdrawal_block',\n FeeChargedBlock: 'fee_charged_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), UpcomingSubscriptionBlock (price per cadence).\n // (SavingsOpportunityBlock now reads `amount` off `instance_slot.data`, not this flat field.)\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Account block (confetti tile): V1 flat fallback for the label line when `instance_slot.data` is\n // absent — `AccountBlock` reads `data.sub_text` first, then this. (The Savings Opportunity coupon\n // now reads `primary_text`/`amount` off `data`, so it no longer reads this flat field.)\n /** Caption/label line for the confetti tile (V1 fallback). */\n label?: string\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n start_date?: string\n no_spend_days?: string[]\n /** First day of the month a monthly summary covers, in ISO form (e.g. `2026-09-01`). */\n date?: string\n /** Number of gas station visits in the month. */\n total_fill_up_visits?: number\n /** Amount spent at gas stations in the month, unformatted. */\n total_spend?: number\n /** V1 name for `total_spend`, read when `total_spend` is absent. */\n total_debt_for_fill_up_visits_in_prev_month?: number\n /** Total available balance across the user's accounts, unformatted. */\n available_balance?: number\n /** Average monthly spend, unformatted. */\n avg_monthly_spend?: number\n /** How long the balance lasts, e.g. \"2 months, 11 days\". */\n time_period?: string\n /** One row per unique merchant in the period, in the order sent. */\n data_series?: InstanceSlotRow[]\n}\n"],"mappings":"AAyVA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { slot as
|
|
1
|
+
import { slot as s } from "../../../../core/types/Insights.es.js";
|
|
2
2
|
import { CURRENCY_FORMAT as T, formatCurrency as k } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
3
|
import { resolveVariantConfig as j } from "../../resolveVariantConfig.es.js";
|
|
4
|
-
import { asLogoRef as
|
|
4
|
+
import { asLogoRef as S, asNumber as N, asText as g } from "../../slotReaders.es.js";
|
|
5
5
|
import { useContainerDimensions as O } from "../../../hooks/useContainerDimensions.es.js";
|
|
6
|
-
import P from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { ReactComponent as G } from "../../../components/shared/images/
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import M from "../DetailedAccountBlock/
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
6
|
+
import { LinedCardZeroState as P } from "../../../../insights/components/shared/ZeroState/LinedCardZeroState.es.js";
|
|
7
|
+
import W from "../../../components/LogoFromGuid.es.js";
|
|
8
|
+
import { Confetti as E } from "../../../components/shared/Confetti.es.js";
|
|
9
|
+
import { ReactComponent as G } from "../../../components/shared/images/PaidOffCard.es.js";
|
|
10
|
+
import { ReactComponent as H } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
|
|
11
|
+
import { statusIconName as K } from "../../../components/statusIcon.es.js";
|
|
12
|
+
import { isDetailedAccountVariant as M } from "../DetailedAccountBlock/layout.es.js";
|
|
13
|
+
import U from "../DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
14
|
+
import { HeaderComponent as Y } from "./HeaderComponent.es.js";
|
|
15
|
+
import { getLayoutConfig as Z } from "./layout.es.js";
|
|
15
16
|
import { IconComponent as q } from "./IconComponent.es.js";
|
|
16
17
|
import { useRef as J } from "react";
|
|
17
18
|
import r from "@mui/material/Stack";
|
|
18
|
-
import { Text as
|
|
19
|
-
import { Icon as
|
|
20
|
-
import { jsx as
|
|
19
|
+
import { Text as m } from "@mxenabled/mxui";
|
|
20
|
+
import { Icon as I } from "@mxenabled/mx-icons";
|
|
21
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
21
22
|
import { useTheme as Q } from "@mui/material/styles";
|
|
22
|
-
import
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const { data: i } = n,
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
import c from "@mui/material/Box";
|
|
24
|
+
var yo = ({ payload: h }) => {
|
|
25
|
+
const p = Q(), b = J(null), { height: w, width: _ } = O(b), { instance_slot: n } = h, { variant: f, institution_guid: z, institution_name: L, icon_name: D, merchant_name: A } = n;
|
|
26
|
+
if (M(f)) return /* @__PURE__ */ e(U, { payload: h });
|
|
27
|
+
const { data: i } = n, u = i !== void 0, a = u ? N(s(i, "amount")) : n.amount, R = g(s(i, "sub_text")), v = u ? R : n.sub_text, V = u ? R : n.label, d = u ? g(s(i, "header_text")) : n.header_text, l = S(s(i, "logo")) ?? S(s(i, "icon")), o = j(Z(p), f, "default", "AccountBlock");
|
|
28
|
+
if (o.zero_state_when_no_amount && (a == null || h.is_zero_state)) return /* @__PURE__ */ e(P, {});
|
|
29
|
+
if (o?.isConfetti) {
|
|
30
|
+
const x = K(l?.guid), B = {
|
|
31
|
+
paidOffCard: /* @__PURE__ */ e(c, {
|
|
30
32
|
sx: {
|
|
31
33
|
flexShrink: 0,
|
|
32
34
|
height: 32,
|
|
33
35
|
position: "relative",
|
|
34
36
|
width: 48
|
|
35
37
|
},
|
|
36
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ e(G, {
|
|
37
39
|
"aria-hidden": !0,
|
|
38
40
|
role: "presentation",
|
|
39
41
|
style: {
|
|
@@ -43,22 +45,22 @@ var vo = ({ payload: g }) => {
|
|
|
43
45
|
}
|
|
44
46
|
})
|
|
45
47
|
}),
|
|
46
|
-
savings: /* @__PURE__ */
|
|
48
|
+
savings: /* @__PURE__ */ e(H, {
|
|
47
49
|
"aria-hidden": !0,
|
|
48
50
|
height: 55,
|
|
49
51
|
role: "presentation",
|
|
50
52
|
width: 55
|
|
51
53
|
}),
|
|
52
|
-
logo: /* @__PURE__ */
|
|
54
|
+
logo: /* @__PURE__ */ e(c, {
|
|
53
55
|
sx: {
|
|
54
|
-
borderRadius: "4px",
|
|
56
|
+
borderRadius: o.logo_border_radius ?? "4px",
|
|
55
57
|
flexShrink: 0,
|
|
56
58
|
height: 48,
|
|
57
59
|
overflow: "hidden",
|
|
58
60
|
width: 48
|
|
59
61
|
},
|
|
60
|
-
children:
|
|
61
|
-
"data-icon":
|
|
62
|
+
children: x ? /* @__PURE__ */ e(r, {
|
|
63
|
+
"data-icon": x,
|
|
62
64
|
sx: {
|
|
63
65
|
alignItems: "center",
|
|
64
66
|
bgcolor: "success.main",
|
|
@@ -66,69 +68,69 @@ var vo = ({ payload: g }) => {
|
|
|
66
68
|
justifyContent: "center",
|
|
67
69
|
width: "100%"
|
|
68
70
|
},
|
|
69
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ e(I, {
|
|
70
72
|
"aria-hidden": !0,
|
|
71
|
-
name:
|
|
72
|
-
size:
|
|
73
|
+
name: x,
|
|
74
|
+
size: o.logo_icon_size ?? 24,
|
|
73
75
|
sx: { color: "success.contrastText" }
|
|
74
76
|
})
|
|
75
|
-
}) :
|
|
76
|
-
logo:
|
|
77
|
+
}) : l?.guid ? /* @__PURE__ */ e(W, {
|
|
78
|
+
logo: l,
|
|
77
79
|
size: 48
|
|
78
80
|
}) : null
|
|
79
81
|
})
|
|
80
|
-
}[
|
|
81
|
-
color:
|
|
82
|
-
noWrap:
|
|
83
|
-
variant:
|
|
84
|
-
children:
|
|
85
|
-
}) : null, $ =
|
|
86
|
-
bold: !
|
|
82
|
+
}[o.graphic ?? "logo"], F = g(s(i, "secondary_text")) || (A ?? L), y = o.secondarySource === "merchant" ? F : V, C = y ? /* @__PURE__ */ e(m, {
|
|
83
|
+
color: o.secondaryColor,
|
|
84
|
+
noWrap: o.secondaryOneLine,
|
|
85
|
+
variant: o.secondaryVariant,
|
|
86
|
+
children: y
|
|
87
|
+
}) : null, $ = a != null ? /* @__PURE__ */ e(m, {
|
|
88
|
+
bold: !o.amountKeepsVariantWeight,
|
|
87
89
|
color: "success.dark",
|
|
88
|
-
variant:
|
|
89
|
-
children: `${
|
|
90
|
+
variant: o.amountVariant,
|
|
91
|
+
children: `${a > 0 ? o.amountPrefix ?? "" : ""}${k(a, T.cents)}`
|
|
90
92
|
}) : null;
|
|
91
|
-
return /* @__PURE__ */ t(
|
|
93
|
+
return /* @__PURE__ */ t(c, {
|
|
92
94
|
ref: b,
|
|
93
95
|
sx: {
|
|
94
|
-
backgroundImage:
|
|
96
|
+
backgroundImage: o.gradient,
|
|
95
97
|
bgcolor: "background.paper",
|
|
96
98
|
overflow: "hidden",
|
|
97
99
|
position: "relative",
|
|
98
100
|
p: 16,
|
|
99
101
|
width: "100%"
|
|
100
102
|
},
|
|
101
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ e(c, {
|
|
102
104
|
sx: {
|
|
103
105
|
inset: 0,
|
|
104
106
|
pointerEvents: "none",
|
|
105
107
|
position: "absolute",
|
|
106
108
|
zIndex: 1
|
|
107
109
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ e(E, {
|
|
109
111
|
height: w,
|
|
110
|
-
shouldRun: w > 0 &&
|
|
111
|
-
width:
|
|
112
|
+
shouldRun: w > 0 && _ > 0,
|
|
113
|
+
width: _
|
|
112
114
|
})
|
|
113
115
|
}), /* @__PURE__ */ t(r, {
|
|
114
116
|
sx: {
|
|
115
117
|
borderRadius: "8px",
|
|
116
|
-
...
|
|
118
|
+
...o.cardShadow && { boxShadow: p.shadows[1] },
|
|
117
119
|
overflow: "hidden",
|
|
118
120
|
position: "relative",
|
|
119
121
|
width: "100%",
|
|
120
122
|
zIndex: 2
|
|
121
123
|
},
|
|
122
|
-
children: [
|
|
124
|
+
children: [o.categoryStrip && d && /* @__PURE__ */ e(c, {
|
|
123
125
|
sx: {
|
|
124
126
|
bgcolor: "success.main",
|
|
125
127
|
px: 12,
|
|
126
128
|
py: 4
|
|
127
129
|
},
|
|
128
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ e(m, {
|
|
129
131
|
color: "success.contrastText",
|
|
130
132
|
variant: "caption",
|
|
131
|
-
children:
|
|
133
|
+
children: d
|
|
132
134
|
})
|
|
133
135
|
}), /* @__PURE__ */ t(r, {
|
|
134
136
|
sx: {
|
|
@@ -137,15 +139,15 @@ var vo = ({ payload: g }) => {
|
|
|
137
139
|
border: "1px solid",
|
|
138
140
|
borderColor: "success.main",
|
|
139
141
|
borderRadius: "8px",
|
|
140
|
-
...
|
|
142
|
+
...o.categoryStrip && {
|
|
141
143
|
borderTopLeftRadius: 0,
|
|
142
144
|
borderTopRightRadius: 0,
|
|
143
145
|
borderTop: 0
|
|
144
146
|
},
|
|
145
147
|
flexDirection: "row",
|
|
146
|
-
...
|
|
148
|
+
...o.rowSx
|
|
147
149
|
},
|
|
148
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ e(c, {
|
|
149
151
|
sx: {
|
|
150
152
|
display: "flex",
|
|
151
153
|
flexShrink: 0
|
|
@@ -157,27 +159,27 @@ var vo = ({ payload: g }) => {
|
|
|
157
159
|
minWidth: 0
|
|
158
160
|
},
|
|
159
161
|
children: [
|
|
160
|
-
|
|
162
|
+
o.secondaryPosition === "above" && C,
|
|
161
163
|
$,
|
|
162
|
-
|
|
164
|
+
o.secondaryPosition === "below" && C
|
|
163
165
|
]
|
|
164
166
|
})]
|
|
165
167
|
})]
|
|
166
168
|
})]
|
|
167
169
|
});
|
|
168
170
|
}
|
|
169
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ e(r, {
|
|
170
172
|
sx: {
|
|
171
|
-
background:
|
|
173
|
+
background: o.background,
|
|
172
174
|
p: 16
|
|
173
175
|
},
|
|
174
176
|
children: /* @__PURE__ */ t(r, {
|
|
175
177
|
sx: {
|
|
176
178
|
borderRadius: "8px",
|
|
177
|
-
boxShadow:
|
|
179
|
+
boxShadow: p.shadows[1],
|
|
178
180
|
width: "100%"
|
|
179
181
|
},
|
|
180
|
-
children: [
|
|
182
|
+
children: [d && /* @__PURE__ */ e(Y, { headerText: d }), /* @__PURE__ */ t(r, {
|
|
181
183
|
sx: {
|
|
182
184
|
alignItems: "center",
|
|
183
185
|
bgcolor: "background.paper",
|
|
@@ -185,34 +187,34 @@ var vo = ({ payload: g }) => {
|
|
|
185
187
|
gap: 16,
|
|
186
188
|
p: 16,
|
|
187
189
|
width: "100%",
|
|
188
|
-
...
|
|
190
|
+
...d && {
|
|
189
191
|
borderTopLeftRadius: "0",
|
|
190
192
|
borderTopRightRadius: "0"
|
|
191
193
|
},
|
|
192
|
-
...(z ||
|
|
194
|
+
...(z || D || l?.guid) && { flexDirection: "row" }
|
|
193
195
|
},
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
-
logo:
|
|
196
|
+
children: [/* @__PURE__ */ e(q, {
|
|
197
|
+
logo: l,
|
|
196
198
|
slot: n,
|
|
197
|
-
variant:
|
|
198
|
-
}), /* @__PURE__ */ t(r, { children: [
|
|
199
|
+
variant: f
|
|
200
|
+
}), /* @__PURE__ */ t(r, { children: [a != null && /* @__PURE__ */ e(m, {
|
|
199
201
|
variant: "h2",
|
|
200
|
-
children: k(
|
|
202
|
+
children: k(a, T.cents)
|
|
201
203
|
}), /* @__PURE__ */ t(r, {
|
|
202
204
|
sx: {
|
|
203
205
|
gap: 8,
|
|
204
206
|
flexDirection: "row",
|
|
205
207
|
alignItems: "center"
|
|
206
208
|
},
|
|
207
|
-
children: [
|
|
209
|
+
children: [o.sub_logo && /* @__PURE__ */ e(I, {
|
|
208
210
|
color: "warning",
|
|
209
211
|
fill: !0,
|
|
210
|
-
name:
|
|
212
|
+
name: o.sub_logo,
|
|
211
213
|
size: 20
|
|
212
|
-
}),
|
|
214
|
+
}), v && /* @__PURE__ */ e(m, {
|
|
213
215
|
color: "text.secondary",
|
|
214
216
|
variant: "caption",
|
|
215
|
-
children:
|
|
217
|
+
children: v
|
|
216
218
|
})]
|
|
217
219
|
})] })]
|
|
218
220
|
})]
|
|
@@ -220,7 +222,7 @@ var vo = ({ payload: g }) => {
|
|
|
220
222
|
});
|
|
221
223
|
};
|
|
222
224
|
export {
|
|
223
|
-
|
|
225
|
+
yo as default
|
|
224
226
|
};
|
|
225
227
|
|
|
226
228
|
//# sourceMappingURL=AccountBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { statusIconName } from '../../../components/statusIcon'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText } from '../../slotReaders'\nimport { DetailedAccountBlock, isDetailedAccountVariant } from '../DetailedAccountBlock'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const { variant, institution_guid, institution_name, icon_name, merchant_name } = instance_slot\n\n if (isDetailedAccountVariant(variant)) return <DetailedAccountBlock payload={payload} />\n\n // V1 beats send no `data`. V2 reads only `data` (no `slotOrFlat`): its stale flat fields must never show.\n const { data } = instance_slot\n const v2 = data !== undefined\n const amount = v2 ? asNumber(slot(data, 'amount')) : instance_slot.amount\n // One V2 slot; V1 named it `sub_text` on the standard tile and `label` on the confetti one.\n const v2SubText = asText(slot(data, 'sub_text'))\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const header_text = v2 ? asText(slot(data, 'header_text')) : instance_slot.header_text\n // `icon` carries the tile glyph when the beat's `logo` is kept for its compact card (charges_summary).\n const logo = asLogoRef(slot(data, 'logo')) ?? asLogoRef(slot(data, 'icon'))\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // The 58x46 SVG's card sits 14px down (its check badge overflows top-right); box it to the\n // 48x32 frame so it lines up with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 48 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n {/* An ICO- icon keeps the tile's look: an outlined glyph in success.contrastText on\n the success.main square. It is drawn with Icon, as IconComponent does, because\n LogoFromGuid fills every ICO- glyph. Any other guid renders via LogoFromGuid. */}\n {confettiIcon ? (\n <Stack\n data-icon={confettiIcon}\n sx={{\n alignItems: 'center',\n bgcolor: 'success.main',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Icon\n aria-hidden={true}\n name={confettiIcon}\n size={layoutConfig.logo_icon_size ?? 24}\n sx={{ color: 'success.contrastText' }}\n />\n </Stack>\n ) : logo?.guid ? (\n <LogoFromGuid logo={logo} size={48} />\n ) : null}\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // The payer: V2's `secondary_text`, else the merchant, else the institution.\n const payer = asText(slot(data, 'secondary_text')) || (merchant_name ?? institution_name)\n const secondaryText = layoutConfig.secondarySource === 'merchant' ? payer : label\n const secondary = secondaryText ? (\n <Text\n color={layoutConfig.secondaryColor}\n noWrap={layoutConfig.secondaryOneLine}\n variant={layoutConfig.secondaryVariant}\n >\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text\n bold={!layoutConfig.amountKeepsVariantWeight}\n color=\"success.dark\"\n variant={layoutConfig.amountVariant}\n >\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, CURRENCY_FORMAT.cents)}`}\n </Text>\n ) : null\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n ...(layoutConfig.cardShadow && { boxShadow: theme.shadows[1] }),\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n // Figma's standard tile: 16px on every side, 80px tall in the 112px slot.\n p: 16,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n ...((institution_guid || icon_name || logo?.guid) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent logo={logo} slot={instance_slot} variant={variant} />\n\n <Stack>\n {amount != null && (\n <Text variant=\"h2\">{formatCurrency(amount, CURRENCY_FORMAT.cents)}</Text>\n )}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACvD,EAAE,eAAA,EAAA,IAAkB,GACpB,EAAE,SAAA,GAAS,kBAAA,GAAkB,kBAAA,GAAkB,WAAA,GAAW,eAAA,EAAA,IAAkB;AAElF,MAAI,EAAyB,CAAO,EAAG,QAAO,gBAAA,EAAC,GAAD,EAA+B,SAAA,EAAU,CAAA;AAGvF,QAAM,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAS,IAAK,EAAS,EAAK,GAAM,QAAQ,CAAC,IAAI,EAAc,QAE7D,IAAY,EAAO,EAAK,GAAM,UAAU,CAAC,GACzC,IAAW,IAAK,IAAY,EAAc,UAC1C,IAAQ,IAAK,IAAY,EAAc,OAC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ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload } from '../../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { LinedCardZeroState } from '../../../../insights/components/shared/ZeroState/LinedCardZeroState'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { statusIconName } from '../../../components/statusIcon'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { asLogoRef, asNumber, asText } from '../../slotReaders'\nimport { DetailedAccountBlock, isDetailedAccountVariant } from '../DetailedAccountBlock'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const { variant, institution_guid, institution_name, icon_name, merchant_name } = instance_slot\n\n if (isDetailedAccountVariant(variant)) return <DetailedAccountBlock payload={payload} />\n\n // V1 beats send no `data`. V2 reads only `data` (no `slotOrFlat`): its stale flat fields must never show.\n const { data } = instance_slot\n const v2 = data !== undefined\n const amount = v2 ? asNumber(slot(data, 'amount')) : instance_slot.amount\n // One V2 slot; V1 named it `sub_text` on the standard tile and `label` on the confetti one.\n const v2SubText = asText(slot(data, 'sub_text'))\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const header_text = v2 ? asText(slot(data, 'header_text')) : instance_slot.header_text\n // `icon` carries the tile glyph when the beat's `logo` is kept for its compact card (charges_summary).\n const logo = asLogoRef(slot(data, 'logo')) ?? asLogoRef(slot(data, 'icon'))\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n if (layoutConfig.zero_state_when_no_amount && (amount == null || payload.is_zero_state)) {\n return <LinedCardZeroState />\n }\n\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // The 58x46 SVG's card sits 14px down (its check badge overflows top-right); box it to the\n // 48x32 frame so it lines up with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 48 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: layoutConfig.logo_border_radius ?? '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n {/* An ICO- icon keeps the tile's look: an outlined glyph in success.contrastText on\n the success.main square. It is drawn with Icon, as IconComponent does, because\n LogoFromGuid fills every ICO- glyph. Any other guid renders via LogoFromGuid. */}\n {confettiIcon ? (\n <Stack\n data-icon={confettiIcon}\n sx={{\n alignItems: 'center',\n bgcolor: 'success.main',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Icon\n aria-hidden={true}\n name={confettiIcon}\n size={layoutConfig.logo_icon_size ?? 24}\n sx={{ color: 'success.contrastText' }}\n />\n </Stack>\n ) : logo?.guid ? (\n <LogoFromGuid logo={logo} size={48} />\n ) : null}\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // The payer: V2's `secondary_text`, else the merchant, else the institution.\n const payer = asText(slot(data, 'secondary_text')) || (merchant_name ?? institution_name)\n const secondaryText = layoutConfig.secondarySource === 'merchant' ? payer : label\n const secondary = secondaryText ? (\n <Text\n color={layoutConfig.secondaryColor}\n noWrap={layoutConfig.secondaryOneLine}\n variant={layoutConfig.secondaryVariant}\n >\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text\n bold={!layoutConfig.amountKeepsVariantWeight}\n color=\"success.dark\"\n variant={layoutConfig.amountVariant}\n >\n {`${amount > 0 ? (layoutConfig.amountPrefix ?? '') : ''}${formatCurrency(amount, CURRENCY_FORMAT.cents)}`}\n </Text>\n ) : null\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n ...(layoutConfig.cardShadow && { boxShadow: theme.shadows[1] }),\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n // Figma's standard tile: 16px on every side, 80px tall in the 112px slot.\n p: 16,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n ...((institution_guid || icon_name || logo?.guid) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent logo={logo} slot={instance_slot} variant={variant} />\n\n <Stack>\n {amount != null && (\n <Text variant=\"h2\">{formatCurrency(amount, CURRENCY_FORMAT.cents)}</Text>\n )}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACvD,EAAE,eAAA,EAAA,IAAkB,GACpB,EAAE,SAAA,GAAS,kBAAA,GAAkB,kBAAA,GAAkB,WAAA,GAAW,eA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AA,YAAO,YAAY;AAAA,UAAS;AAAA,UAAhE,UAAA,CACG,EAAa,YACZ,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAU,MAAM;AAAA,YAAM,MAAM,EAAa;AAAA,YAAU,MAAM;AAAA,UAAK,CAAA,GAE3E,KACC,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,SAAQ;AAAA,YAClC,UAAA;AAAA,UACG,CAAA,CAEH;AAAA,QACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA;AAEX"}
|
|
@@ -8,7 +8,7 @@ export interface BlockLayoutConfig {
|
|
|
8
8
|
logo_color?: string;
|
|
9
9
|
logo_bGcolor?: string;
|
|
10
10
|
logo_border_color?: string;
|
|
11
|
-
/** Corner radius of the icon tile (`icon_name` or an `ICO-` logo)
|
|
11
|
+
/** Corner radius of the icon tile (`icon_name` or an `ICO-` logo; 6px default) or the confetti logo (4px default). */
|
|
12
12
|
logo_border_radius?: string;
|
|
13
13
|
/** Glyph size in px for an `ICO-` logo: on the confetti tile (default 24) and on the standard
|
|
14
14
|
* icon tile (default `TILE_ICON_SIZE`). */
|
|
@@ -25,7 +25,7 @@ export interface BlockLayoutConfig {
|
|
|
25
25
|
graphic?: 'paidOffCard' | 'savings' | 'logo';
|
|
26
26
|
/** Amount typography variant. */
|
|
27
27
|
amountVariant?: 'h2' | 'h3';
|
|
28
|
-
/** Prefix prepended to
|
|
28
|
+
/** Prefix prepended to a positive formatted amount, e.g. `+` for deposits. */
|
|
29
29
|
amountPrefix?: string;
|
|
30
30
|
/** Keep the variant's own weight (h2 is 700) instead of the confetti tile's semi bold. */
|
|
31
31
|
amountKeepsVariantWeight?: boolean;
|
|
@@ -45,6 +45,9 @@ export interface BlockLayoutConfig {
|
|
|
45
45
|
secondaryColor?: string;
|
|
46
46
|
/** Truncate the secondary line to one line with an ellipsis. */
|
|
47
47
|
secondaryOneLine?: boolean;
|
|
48
|
+
/** Render the neutral lined-card zero state instead of the card when the slot has no amount or
|
|
49
|
+
* the beat is a zero state. */
|
|
50
|
+
zero_state_when_no_amount?: boolean;
|
|
48
51
|
}
|
|
49
52
|
/** Glyph size in px on the standard icon tile (IconComponent). */
|
|
50
53
|
export declare const TILE_ICON_SIZE = 30;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CELEBRATION_GRADIENT as o, DIRECT_DEPOSIT_COMPLETE_GRADIENT as
|
|
2
|
-
var
|
|
1
|
+
import { CELEBRATION_GRADIENT as o, DIRECT_DEPOSIT_COMPLETE_GRADIENT as r, ERROR_WASH_GRADIENT as e, FEES_WASH_GRADIENT as n, WARM_LIME_ACCENT_GRADIENT as i } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var a = { background: e }, d = (t) => ({
|
|
3
3
|
overdraft_warning: {
|
|
4
|
-
background:
|
|
4
|
+
background: t.palette.warning.light,
|
|
5
5
|
sub_logo: "error"
|
|
6
6
|
},
|
|
7
|
-
low_balance_alert:
|
|
7
|
+
low_balance_alert: a,
|
|
8
8
|
low_balance: {
|
|
9
|
-
...
|
|
9
|
+
...a,
|
|
10
10
|
badge: "error"
|
|
11
11
|
},
|
|
12
12
|
status_off_track: {
|
|
@@ -14,7 +14,7 @@ var r = { background: a }, s = (e) => ({
|
|
|
14
14
|
logo_bGcolor: "error.main",
|
|
15
15
|
logo_border_radius: "4px",
|
|
16
16
|
logo_icon_size: 24,
|
|
17
|
-
background:
|
|
17
|
+
background: e
|
|
18
18
|
},
|
|
19
19
|
charges_summary: {
|
|
20
20
|
category_tint: 0.25,
|
|
@@ -23,7 +23,7 @@ var r = { background: a }, s = (e) => ({
|
|
|
23
23
|
},
|
|
24
24
|
deposit_received: {
|
|
25
25
|
isConfetti: !0,
|
|
26
|
-
gradient:
|
|
26
|
+
gradient: r,
|
|
27
27
|
graphic: "logo",
|
|
28
28
|
amountVariant: "h2",
|
|
29
29
|
amountKeepsVariantWeight: !0,
|
|
@@ -40,6 +40,25 @@ var r = { background: a }, s = (e) => ({
|
|
|
40
40
|
secondaryColor: "text.secondary",
|
|
41
41
|
secondaryOneLine: !0
|
|
42
42
|
},
|
|
43
|
+
deposit_received_on_date: {
|
|
44
|
+
isConfetti: !0,
|
|
45
|
+
gradient: r,
|
|
46
|
+
graphic: "logo",
|
|
47
|
+
logo_border_radius: "8px",
|
|
48
|
+
amountVariant: "h2",
|
|
49
|
+
amountKeepsVariantWeight: !0,
|
|
50
|
+
amountPrefix: "+",
|
|
51
|
+
cardShadow: !0,
|
|
52
|
+
rowSx: {
|
|
53
|
+
gap: 16,
|
|
54
|
+
p: 16
|
|
55
|
+
},
|
|
56
|
+
secondarySource: "label",
|
|
57
|
+
secondaryPosition: "below",
|
|
58
|
+
secondaryVariant: "caption",
|
|
59
|
+
secondaryColor: "text.secondary",
|
|
60
|
+
zero_state_when_no_amount: !0
|
|
61
|
+
},
|
|
43
62
|
status_on_track: {
|
|
44
63
|
isConfetti: !0,
|
|
45
64
|
gradient: i,
|
|
@@ -87,7 +106,7 @@ var r = { background: a }, s = (e) => ({
|
|
|
87
106
|
default: {}
|
|
88
107
|
});
|
|
89
108
|
export {
|
|
90
|
-
|
|
109
|
+
d as getLayoutConfig
|
|
91
110
|
};
|
|
92
111
|
|
|
93
112
|
//# sourceMappingURL=layout.es.js.map
|