@mx-cartographer/experiences 9.7.3 → 9.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +77 -65
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +8 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +93 -81
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/DirectDepositCard.es.js +4 -4
- package/dist/insights-v2/index.es.js +13 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [9.7.4] - 10-19-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - `AccountBlock` `detailed_primary` / `detailed_success` variants: the Insights UI Toolkit's "Detailed" account hero (overhanging institution logo, account name and type, status pill) addressed through `account_block`, where the Insights Architecture doc lists it. Renders the existing `DirectDepositCard` and reads its styling from the Direct Deposit block's layout table (blue slot gradient + primary-tinted pill, green slot gradient + solid success pill) so the two blocks cannot drift. Reads `account_name`, `account_type`, `status_text`, `institution_guid` and `institution_name` flat from `instance_slot`. Stories and tests (WEC-1316)
|
|
4
|
+
- **ADDED** - `BlockType.DirectDepositBlock` (`direct_deposit_block`), which the `blocks` registry already served but the type did not name (WEC-1316)
|
|
5
|
+
|
|
1
6
|
## [9.7.3] - 10-19-2026
|
|
2
7
|
|
|
3
8
|
- **ADDED** - Dashboard WelcomeDialog with a Terms & Conditions view and acceptance. The `shouldShowWelcomeDialog` gate is live (`display_terms_and_conditions && !has_accepted_terms`); the T&C view and acceptance now work the same for all clients (no Friends & Family distinction), with the agreement text sourced from the agreements table and acceptance persisting `has_accepted_terms`. Opening the T&C view fires the `welcome_dialog_view_terms` analytics event (MEW-3178 / MEW-3471 / MEW-3472 / MEW-3473)
|
|
@@ -240,6 +240,7 @@ export declare const BlockType: {
|
|
|
240
240
|
readonly AccountSwitchBlock: "account_switch_block";
|
|
241
241
|
readonly BarChartBlock: "bar_chart_block";
|
|
242
242
|
readonly BudgetBlock: "budget_block";
|
|
243
|
+
readonly DirectDepositBlock: "direct_deposit_block";
|
|
243
244
|
readonly ImageBlock: "image_block";
|
|
244
245
|
readonly TransactionBlock: "transaction_block";
|
|
245
246
|
readonly DonutChartBlock: "donut_chart_block";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\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/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer). A flat hash shared by every CTA of the card, omitted when the insight has none.\n * Never carries copy or user actions (memo, tags, hide, flag come from the transaction store).\n */\nexport type DrilldownData = Record<string, string | number | boolean | null>\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 /** V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`. */\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}\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}\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}\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 ImageBlock: 'image_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 SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_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), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\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 /** 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 // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\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 // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AAuTA,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 { 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/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer). A flat hash shared by every CTA of the card, omitted when the insight has none.\n * Never carries copy or user actions (memo, tags, hide, flag come from the transaction store).\n */\nexport type DrilldownData = Record<string, string | number | boolean | null>\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 /** V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`. */\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}\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}\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}\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 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 SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_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), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\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 /** 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 // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\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 // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AAwTA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
import { slot as
|
|
1
|
+
import { slot as f } from "../../../../core/types/Insights.es.js";
|
|
2
2
|
import { formatCurrency as k } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
-
import { useContainerDimensions as
|
|
4
|
-
import { DepositLogo as
|
|
5
|
-
import { Confetti as
|
|
6
|
-
import
|
|
7
|
-
import { ReactComponent as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { useContainerDimensions as V } from "../../../hooks/useContainerDimensions.es.js";
|
|
4
|
+
import { DepositLogo as I } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
5
|
+
import { Confetti as j } from "../../../components/shared/Confetti.es.js";
|
|
6
|
+
import E from "../../../components/DirectDepositCard.es.js";
|
|
7
|
+
import { ReactComponent as H } from "../../../components/shared/images/PaidOffCard.es.js";
|
|
8
|
+
import { ReactComponent as O } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
|
|
9
|
+
import { resolveVariantConfig as W } from "../../resolveVariantConfig.es.js";
|
|
10
|
+
import { HeaderComponent as q } from "./HeaderComponent.es.js";
|
|
11
|
+
import { getLayoutConfig as J } from "./layout.es.js";
|
|
12
|
+
import { IconComponent as K } from "./IconComponent.es.js";
|
|
13
|
+
import { useRef as M } from "react";
|
|
13
14
|
import r from "@mui/material/Stack";
|
|
14
15
|
import { Text as s } from "@mxenabled/mxui";
|
|
15
|
-
import { Icon as
|
|
16
|
-
import { jsx as o, jsxs as
|
|
17
|
-
import { useTheme as
|
|
16
|
+
import { Icon as Q } from "@mxenabled/mx-icons";
|
|
17
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
18
|
+
import { useTheme as U } from "@mui/material/styles";
|
|
18
19
|
import n from "@mui/material/Box";
|
|
19
|
-
var
|
|
20
|
+
var X = {
|
|
20
21
|
deposit_received: "payments",
|
|
21
22
|
status_on_track: "monetization_on"
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
23
|
+
}, bo = ({ payload: S }) => {
|
|
24
|
+
const D = U(), g = M(null), { height: x, width: b } = V(g), { instance_slot: i } = S, { variant: m, account_name: N, account_type: L, status_text: z, header_text: a, institution_guid: c, institution_name: u, icon_name: G, merchant_guid: $, merchant_name: v, category_guid: A } = i, { data: d } = i, p = d !== void 0, h = f(d, "amount"), l = p ? typeof h == "number" && Number.isFinite(h) ? h : void 0 : i.amount, y = f(d, "sub_text"), _ = typeof y == "string" ? y : void 0, w = p ? _ : i.sub_text, B = p ? _ : i.label, R = f(d, "logo"), t = W(J(D), m, "default", "AccountBlock");
|
|
25
|
+
if (t?.isDetailed) return /* @__PURE__ */ o(E, {
|
|
26
|
+
...t.detailed,
|
|
27
|
+
logo: /* @__PURE__ */ o(I, {
|
|
28
|
+
iconName: "account_balance",
|
|
29
|
+
institutionGuid: c ?? "",
|
|
30
|
+
institutionName: u ?? c ?? ""
|
|
31
|
+
}),
|
|
32
|
+
name: N,
|
|
33
|
+
statusLabel: z,
|
|
34
|
+
subtitle: L
|
|
35
|
+
});
|
|
36
|
+
if (t?.isConfetti) {
|
|
37
|
+
const F = {
|
|
26
38
|
paidOffCard: /* @__PURE__ */ o(n, {
|
|
27
39
|
sx: {
|
|
28
40
|
flexShrink: 0,
|
|
@@ -30,7 +42,7 @@ var K = {
|
|
|
30
42
|
position: "relative",
|
|
31
43
|
width: 44
|
|
32
44
|
},
|
|
33
|
-
children: /* @__PURE__ */ o(
|
|
45
|
+
children: /* @__PURE__ */ o(H, {
|
|
34
46
|
"aria-hidden": !0,
|
|
35
47
|
role: "presentation",
|
|
36
48
|
style: {
|
|
@@ -40,7 +52,7 @@ var K = {
|
|
|
40
52
|
}
|
|
41
53
|
})
|
|
42
54
|
}),
|
|
43
|
-
savings: /* @__PURE__ */ o(
|
|
55
|
+
savings: /* @__PURE__ */ o(O, {
|
|
44
56
|
"aria-hidden": !0,
|
|
45
57
|
height: 55,
|
|
46
58
|
role: "presentation",
|
|
@@ -54,29 +66,29 @@ var K = {
|
|
|
54
66
|
overflow: "hidden",
|
|
55
67
|
width: 48
|
|
56
68
|
},
|
|
57
|
-
children: /* @__PURE__ */ o(
|
|
58
|
-
categoryGuid:
|
|
59
|
-
iconName:
|
|
60
|
-
institutionGuid:
|
|
61
|
-
institutionName:
|
|
62
|
-
merchantGuid:
|
|
69
|
+
children: /* @__PURE__ */ o(I, {
|
|
70
|
+
categoryGuid: A,
|
|
71
|
+
iconName: X[m] ?? "payments",
|
|
72
|
+
institutionGuid: c,
|
|
73
|
+
institutionName: u,
|
|
74
|
+
merchantGuid: $,
|
|
63
75
|
merchantName: v
|
|
64
76
|
})
|
|
65
77
|
})
|
|
66
|
-
}[
|
|
67
|
-
color:
|
|
68
|
-
variant:
|
|
78
|
+
}[t.graphic ?? "logo"], C = t.secondarySource === "merchant" ? v ?? u : B, T = C ? /* @__PURE__ */ o(s, {
|
|
79
|
+
color: t.secondaryColor,
|
|
80
|
+
variant: t.secondaryVariant,
|
|
69
81
|
children: C
|
|
70
|
-
}) : null,
|
|
82
|
+
}) : null, P = l != null ? /* @__PURE__ */ o(s, {
|
|
71
83
|
bold: !0,
|
|
72
84
|
color: "success.dark",
|
|
73
|
-
variant:
|
|
74
|
-
children: `${
|
|
85
|
+
variant: t.amountVariant,
|
|
86
|
+
children: `${t.amountPrefix ?? ""}${k(l, "0,0.00")}`
|
|
75
87
|
}) : null;
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
ref:
|
|
88
|
+
return /* @__PURE__ */ e(n, {
|
|
89
|
+
ref: g,
|
|
78
90
|
sx: {
|
|
79
|
-
backgroundImage:
|
|
91
|
+
backgroundImage: t.gradient,
|
|
80
92
|
bgcolor: "background.paper",
|
|
81
93
|
overflow: "hidden",
|
|
82
94
|
position: "relative",
|
|
@@ -90,12 +102,12 @@ var K = {
|
|
|
90
102
|
position: "absolute",
|
|
91
103
|
zIndex: 1
|
|
92
104
|
},
|
|
93
|
-
children: /* @__PURE__ */ o(
|
|
94
|
-
height:
|
|
95
|
-
shouldRun:
|
|
96
|
-
width:
|
|
105
|
+
children: /* @__PURE__ */ o(j, {
|
|
106
|
+
height: x,
|
|
107
|
+
shouldRun: x > 0 && b > 0,
|
|
108
|
+
width: b
|
|
97
109
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
110
|
+
}), /* @__PURE__ */ e(r, {
|
|
99
111
|
sx: {
|
|
100
112
|
borderRadius: "8px",
|
|
101
113
|
overflow: "hidden",
|
|
@@ -103,7 +115,7 @@ var K = {
|
|
|
103
115
|
width: "100%",
|
|
104
116
|
zIndex: 2
|
|
105
117
|
},
|
|
106
|
-
children: [
|
|
118
|
+
children: [t.categoryStrip && a && /* @__PURE__ */ o(n, {
|
|
107
119
|
sx: {
|
|
108
120
|
bgcolor: "success.main",
|
|
109
121
|
px: 12,
|
|
@@ -114,48 +126,48 @@ var K = {
|
|
|
114
126
|
variant: "caption",
|
|
115
127
|
children: a
|
|
116
128
|
})
|
|
117
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ e(r, {
|
|
118
130
|
sx: {
|
|
119
131
|
alignItems: "center",
|
|
120
132
|
bgcolor: "success.lighter",
|
|
121
133
|
border: "1px solid",
|
|
122
134
|
borderColor: "success.main",
|
|
123
135
|
borderRadius: "8px",
|
|
124
|
-
...
|
|
136
|
+
...t.categoryStrip && {
|
|
125
137
|
borderTopLeftRadius: 0,
|
|
126
138
|
borderTopRightRadius: 0,
|
|
127
139
|
borderTop: 0
|
|
128
140
|
},
|
|
129
141
|
flexDirection: "row",
|
|
130
|
-
...
|
|
142
|
+
...t.rowSx
|
|
131
143
|
},
|
|
132
144
|
children: [/* @__PURE__ */ o(n, {
|
|
133
145
|
sx: {
|
|
134
146
|
display: "flex",
|
|
135
147
|
flexShrink: 0
|
|
136
148
|
},
|
|
137
|
-
children:
|
|
138
|
-
}), /* @__PURE__ */
|
|
149
|
+
children: F
|
|
150
|
+
}), /* @__PURE__ */ e(r, {
|
|
139
151
|
sx: {
|
|
140
152
|
flex: "1 0 0",
|
|
141
153
|
minWidth: 0
|
|
142
154
|
},
|
|
143
155
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
156
|
+
t.secondaryPosition === "above" && T,
|
|
157
|
+
P,
|
|
158
|
+
t.secondaryPosition === "below" && T
|
|
147
159
|
]
|
|
148
160
|
})]
|
|
149
161
|
})]
|
|
150
162
|
})]
|
|
151
163
|
});
|
|
152
164
|
}
|
|
153
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ e(r, {
|
|
154
166
|
sx: {
|
|
155
167
|
p: 16,
|
|
156
|
-
...
|
|
168
|
+
...t
|
|
157
169
|
},
|
|
158
|
-
children: [a && /* @__PURE__ */ o(
|
|
170
|
+
children: [a && /* @__PURE__ */ o(q, { headerText: a }), /* @__PURE__ */ e(r, {
|
|
159
171
|
sx: {
|
|
160
172
|
alignItems: "center",
|
|
161
173
|
bgcolor: "background.paper",
|
|
@@ -167,36 +179,36 @@ var K = {
|
|
|
167
179
|
gap: 16,
|
|
168
180
|
p: 16,
|
|
169
181
|
width: "100%",
|
|
170
|
-
...(
|
|
182
|
+
...(c || G || R?.guid) && { flexDirection: "row" }
|
|
171
183
|
},
|
|
172
|
-
children: [/* @__PURE__ */ o(
|
|
173
|
-
logo:
|
|
184
|
+
children: [/* @__PURE__ */ o(K, {
|
|
185
|
+
logo: R,
|
|
174
186
|
slot: i,
|
|
175
|
-
variant:
|
|
176
|
-
}), /* @__PURE__ */
|
|
187
|
+
variant: m
|
|
188
|
+
}), /* @__PURE__ */ e(r, { children: [l != null && /* @__PURE__ */ o(s, {
|
|
177
189
|
variant: "h1",
|
|
178
|
-
children: k(
|
|
179
|
-
}), /* @__PURE__ */
|
|
190
|
+
children: k(l, "0,0.00")
|
|
191
|
+
}), /* @__PURE__ */ e(r, {
|
|
180
192
|
sx: {
|
|
181
193
|
gap: 8,
|
|
182
194
|
flexDirection: "row",
|
|
183
195
|
alignItems: "center"
|
|
184
196
|
},
|
|
185
|
-
children: [
|
|
197
|
+
children: [t?.sub_logo && /* @__PURE__ */ o(Q, {
|
|
186
198
|
color: "warning",
|
|
187
199
|
fill: !0,
|
|
188
|
-
name:
|
|
200
|
+
name: t.sub_logo,
|
|
189
201
|
size: 20
|
|
190
|
-
}),
|
|
202
|
+
}), w && /* @__PURE__ */ o(s, {
|
|
191
203
|
variant: "body2",
|
|
192
|
-
children:
|
|
204
|
+
children: w
|
|
193
205
|
})]
|
|
194
206
|
})] })]
|
|
195
207
|
})]
|
|
196
208
|
});
|
|
197
209
|
};
|
|
198
210
|
export {
|
|
199
|
-
|
|
211
|
+
bo as default
|
|
200
212
|
};
|
|
201
213
|
|
|
202
214
|
//# 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, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { DepositLogo } from '../../../components/ComponentBlocks/DepositLogo'\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 { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\n/** Default generic-tile icon per deposit variant, used when no merchant/institution logo. */\nconst depositIcons: Record<string, string> = {\n deposit_received: 'payments',\n status_on_track: 'monetization_on',\n}\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 {\n variant,\n header_text,\n institution_guid,\n institution_name,\n icon_name,\n merchant_guid,\n merchant_name,\n category_guid,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\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 <DepositLogo\n categoryGuid={category_guid}\n iconName={depositIcons[variant as keyof typeof depositIcons] ?? 'payments'}\n institutionGuid={institution_guid}\n institutionName={institution_name}\n merchantGuid={merchant_guid}\n merchantName={merchant_name}\n />\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n const secondaryText =\n layoutConfig.secondarySource === 'merchant' ? (merchant_name ?? institution_name) : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\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 bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\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 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 p: 16,\n ...layoutConfig,\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n gap: 16,\n p: 16,\n width: '100%',\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 && <Text variant=\"h1\">{formatCurrency(amount, '0,0.00')}</Text>}\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 && <Text variant=\"body2\">{sub_text}</Text>}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAM,IAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,GAEM,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,EACJ,S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A,QACL,GAAG;AAAA,QACH,OAAO;AAAA,QACP,IAAK,KAAoB,KAAa,GAAM,SAAS,EACnD,eAAe,MACjB;AAAA,MACF;AAAA,MAfF,UAAA,CAiBE,gBAAA,EAAC,GAAD;AAAA,QAAqB,MAAA;AAAA,QAAM,MAAM;AAAA,QAAwB,SAAA;AAAA,MAAU,CAAA,GAEnE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,KAAU,QAAQ,gBAAA,EAAC,GAAD;AAAA,QAAM,SAAQ;AAAA,QAAM,UAAA,EAAe,GAAQ,QAAQ;AAAA,MAAQ,CAAA,GAC9E,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,KAAK;AAAA,UAAG,eAAe;AAAA,UAAO,YAAY;AAAA,QAAS;AAAA,QAAhE,UAAA,CACG,GAAc,YACb,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,MAAM;AAAA,UAAM,MAAM,EAAa;AAAA,UAAU,MAAM;AAAA,QAAK,CAAA,GAE3E,KAAY,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAS,UAAA;AAAA,QAAe,CAAA,CAC9C;AAAA,MACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
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, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { DepositLogo } from '../../../components/ComponentBlocks/DepositLogo'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\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 { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\n/** Default generic-tile icon per deposit variant, used when no merchant/institution logo. */\nconst depositIcons: Record<string, string> = {\n deposit_received: 'payments',\n status_on_track: 'monetization_on',\n}\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 {\n variant,\n account_name,\n account_type,\n status_text,\n header_text,\n institution_guid,\n institution_name,\n icon_name,\n merchant_guid,\n merchant_name,\n category_guid,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // \"Detailed\" hero variants — the logo-over-card account hero the Direct Deposit block also\n // renders, addressed through `account_block` per the architecture doc's Account block variants.\n // The account facts arrive flat on the slot (`account_name`, `account_type`, `status_text`).\n // The logo's accessible name is the institution name; a slot that sends only the guid falls\n // back to it rather than leaving the hero logo unnamed.\n if (layoutConfig?.isDetailed) {\n return (\n <DirectDepositCard\n {...layoutConfig.detailed}\n logo={\n <DepositLogo\n iconName=\"account_balance\"\n institutionGuid={institution_guid ?? ''}\n institutionName={institution_name ?? institution_guid ?? ''}\n />\n }\n name={account_name}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n }\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\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 <DepositLogo\n categoryGuid={category_guid}\n iconName={depositIcons[variant as keyof typeof depositIcons] ?? 'payments'}\n institutionGuid={institution_guid}\n institutionName={institution_name}\n merchantGuid={merchant_guid}\n merchantName={merchant_name}\n />\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n const secondaryText =\n layoutConfig.secondarySource === 'merchant' ? (merchant_name ?? institution_name) : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\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 bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\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 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 p: 16,\n ...layoutConfig,\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n gap: 16,\n p: 16,\n width: '100%',\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 && <Text variant=\"h1\">{formatCurrency(amount, '0,0.00')}</Text>}\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 && <Text variant=\"body2\">{sub_text}</Text>}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,IAAM,IAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,GAEM,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,EACJ,SAAA,GACA,cAAA,GACA,cAAA,GACA,aAAA,GACA,aAAA,GACA,kBAAA,GACA,kBAAA,GACA,WAAA,GACA,eAAA,GACA,eAAA,GACA,eAAA,EAAA,IACE,GAKE,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAa,EAAc,GAAM,QAAQ,GACzC,IAAS,IACX,OAAO,KAAe,YAAY,OAAO,SAAS,CAAU,IAC1D,IACA,SACF,EAAc,QAGZ,IAAc,EAAc,GAAM,UAAU,GAC5C,IAAY,OAAO,KAAgB,WAAW,IAAc,QAC5D,IAAW,IAAK,IAAY,EAAc,UAC1C,IAAQ,IAAK,IAAY,EAAc,OACvC,IAAO,EAAc,GAAM,MAAM,GACjC,IAAe,EACnB,EAA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AAA;AAAA,QAAM,MAAM;AAAA,QAAwB,SAAA;AAAA,MAAU,CAAA,GAEnE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,KAAU,QAAQ,gBAAA,EAAC,GAAD;AAAA,QAAM,SAAQ;AAAA,QAAM,UAAA,EAAe,GAAQ,QAAQ;AAAA,MAAQ,CAAA,GAC9E,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,KAAK;AAAA,UAAG,eAAe;AAAA,UAAO,YAAY;AAAA,QAAS;AAAA,QAAhE,UAAA,CACG,GAAc,YACb,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAU,MAAM;AAAA,UAAM,MAAM,EAAa;AAAA,UAAU,MAAM;AAAA,QAAK,CAAA,GAE3E,KAAY,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAS,UAAA;AAAA,QAAe,CAAA,CAC9C;AAAA,MACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,IACF,CAAA,CAAA;AAAA;AAEX"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
import { DirectDepositCardStyleProps } from '../../../components/DirectDepositCard';
|
|
2
3
|
export interface BlockLayoutConfig {
|
|
3
4
|
background?: string;
|
|
4
5
|
logo_color?: string;
|
|
@@ -30,5 +31,12 @@ export interface BlockLayoutConfig {
|
|
|
30
31
|
secondaryVariant?: 'body2' | 'caption';
|
|
31
32
|
/** Theme color path for the secondary line. */
|
|
32
33
|
secondaryColor?: string;
|
|
34
|
+
/**
|
|
35
|
+
* When true, AccountBlock renders the "Detailed" account hero (overhanging institution logo,
|
|
36
|
+
* account name + type, status pill) through `DirectDepositCard`, styled by `detailed`.
|
|
37
|
+
*/
|
|
38
|
+
isDetailed?: boolean;
|
|
39
|
+
/** Hero card style props for the detailed variants. */
|
|
40
|
+
detailed?: DirectDepositCardStyleProps;
|
|
33
41
|
}
|
|
34
42
|
export declare const getLayoutConfig: (theme: Theme) => Record<string, BlockLayoutConfig>;
|
|
@@ -1,89 +1,101 @@
|
|
|
1
|
-
import { CELEBRATION_GRADIENT as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...e,
|
|
11
|
-
badge: "error"
|
|
12
|
-
},
|
|
13
|
-
status_off_track: {
|
|
14
|
-
logo_color: "background.paper",
|
|
15
|
-
logo_bGcolor: "error.main",
|
|
16
|
-
background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)"
|
|
17
|
-
},
|
|
18
|
-
interest_charges_summary: {
|
|
19
|
-
logo_color: "text.primary",
|
|
20
|
-
logo_bGcolor: t(r.palette.categories?.feesCharges || "", 0.25),
|
|
21
|
-
logo_border_color: "categories.feesCharges",
|
|
22
|
-
background: "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)"
|
|
23
|
-
},
|
|
24
|
-
deposit_received: {
|
|
25
|
-
isConfetti: !0,
|
|
26
|
-
gradient: o,
|
|
27
|
-
graphic: "logo",
|
|
28
|
-
amountVariant: "h3",
|
|
29
|
-
amountPrefix: "+",
|
|
30
|
-
categoryStrip: !0,
|
|
31
|
-
rowSx: {
|
|
32
|
-
gap: 12,
|
|
33
|
-
p: 12
|
|
1
|
+
import { CELEBRATION_GRADIENT as o, WARM_LIME_ACCENT_GRADIENT as e } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
import { directDepositVariant as t, getLayoutConfig as n } from "../DirectDepositBlock/layout.es.js";
|
|
3
|
+
import { alpha as d } from "@mui/material/styles";
|
|
4
|
+
var i = { background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)" }, l = (r) => {
|
|
5
|
+
const a = n(r);
|
|
6
|
+
return {
|
|
7
|
+
overdraft_warning: {
|
|
8
|
+
background: r.palette.warning.light,
|
|
9
|
+
sub_logo: "error"
|
|
34
10
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
status_on_track: {
|
|
41
|
-
isConfetti: !0,
|
|
42
|
-
gradient: o,
|
|
43
|
-
graphic: "logo",
|
|
44
|
-
amountVariant: "h2",
|
|
45
|
-
rowSx: {
|
|
46
|
-
gap: 16,
|
|
47
|
-
p: 16
|
|
11
|
+
low_balance_alert: i,
|
|
12
|
+
low_balance: {
|
|
13
|
+
...i,
|
|
14
|
+
badge: "error"
|
|
48
15
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
payoff_celebration: {
|
|
55
|
-
isConfetti: !0,
|
|
56
|
-
gradient: a,
|
|
57
|
-
graphic: "paidOffCard",
|
|
58
|
-
amountVariant: "h2",
|
|
59
|
-
rowSx: {
|
|
60
|
-
gap: 24,
|
|
61
|
-
px: 24,
|
|
62
|
-
py: 16
|
|
16
|
+
status_off_track: {
|
|
17
|
+
logo_color: "background.paper",
|
|
18
|
+
logo_bGcolor: "error.main",
|
|
19
|
+
background: "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)"
|
|
63
20
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
savings_deposit: {
|
|
70
|
-
isConfetti: !0,
|
|
71
|
-
gradient: a,
|
|
72
|
-
graphic: "savings",
|
|
73
|
-
amountVariant: "h2",
|
|
74
|
-
rowSx: {
|
|
75
|
-
gap: 16,
|
|
76
|
-
p: 16
|
|
21
|
+
interest_charges_summary: {
|
|
22
|
+
logo_color: "text.primary",
|
|
23
|
+
logo_bGcolor: d(r.palette.categories?.feesCharges || "", 0.25),
|
|
24
|
+
logo_border_color: "categories.feesCharges",
|
|
25
|
+
background: "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)"
|
|
77
26
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
27
|
+
deposit_received: {
|
|
28
|
+
isConfetti: !0,
|
|
29
|
+
gradient: e,
|
|
30
|
+
graphic: "logo",
|
|
31
|
+
amountVariant: "h3",
|
|
32
|
+
amountPrefix: "+",
|
|
33
|
+
categoryStrip: !0,
|
|
34
|
+
rowSx: {
|
|
35
|
+
gap: 12,
|
|
36
|
+
p: 12
|
|
37
|
+
},
|
|
38
|
+
secondarySource: "merchant",
|
|
39
|
+
secondaryPosition: "below",
|
|
40
|
+
secondaryVariant: "body2",
|
|
41
|
+
secondaryColor: "text.primary"
|
|
42
|
+
},
|
|
43
|
+
status_on_track: {
|
|
44
|
+
isConfetti: !0,
|
|
45
|
+
gradient: e,
|
|
46
|
+
graphic: "logo",
|
|
47
|
+
amountVariant: "h2",
|
|
48
|
+
rowSx: {
|
|
49
|
+
gap: 16,
|
|
50
|
+
p: 16
|
|
51
|
+
},
|
|
52
|
+
secondarySource: "label",
|
|
53
|
+
secondaryPosition: "below",
|
|
54
|
+
secondaryVariant: "caption",
|
|
55
|
+
secondaryColor: "text.secondary"
|
|
56
|
+
},
|
|
57
|
+
payoff_celebration: {
|
|
58
|
+
isConfetti: !0,
|
|
59
|
+
gradient: o,
|
|
60
|
+
graphic: "paidOffCard",
|
|
61
|
+
amountVariant: "h2",
|
|
62
|
+
rowSx: {
|
|
63
|
+
gap: 24,
|
|
64
|
+
px: 24,
|
|
65
|
+
py: 16
|
|
66
|
+
},
|
|
67
|
+
secondarySource: "label",
|
|
68
|
+
secondaryPosition: "below",
|
|
69
|
+
secondaryVariant: "caption",
|
|
70
|
+
secondaryColor: "text.secondary"
|
|
71
|
+
},
|
|
72
|
+
savings_deposit: {
|
|
73
|
+
isConfetti: !0,
|
|
74
|
+
gradient: o,
|
|
75
|
+
graphic: "savings",
|
|
76
|
+
amountVariant: "h2",
|
|
77
|
+
rowSx: {
|
|
78
|
+
gap: 16,
|
|
79
|
+
p: 16
|
|
80
|
+
},
|
|
81
|
+
secondarySource: "label",
|
|
82
|
+
secondaryPosition: "above",
|
|
83
|
+
secondaryVariant: "body2",
|
|
84
|
+
secondaryColor: "text.primary"
|
|
85
|
+
},
|
|
86
|
+
detailed_primary: {
|
|
87
|
+
isDetailed: !0,
|
|
88
|
+
detailed: a[t.MissingInterestRate]
|
|
89
|
+
},
|
|
90
|
+
detailed_success: {
|
|
91
|
+
isDetailed: !0,
|
|
92
|
+
detailed: a[t.InterestRateAdded]
|
|
93
|
+
},
|
|
94
|
+
default: {}
|
|
95
|
+
};
|
|
96
|
+
};
|
|
85
97
|
export {
|
|
86
|
-
|
|
98
|
+
l as getLayoutConfig
|
|
87
99
|
};
|
|
88
100
|
|
|
89
101
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -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 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 /** 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 /** 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// 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:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\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 background:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\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:\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)',\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 amountVariant: 'h3',\n amountPrefix: '+',\n categoryStrip: 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: 24, 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":"
|
|
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 WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type { DirectDepositCardStyleProps } from '../../../components/DirectDepositCard'\n\nimport {\n directDepositVariant,\n getLayoutConfig as getDirectDepositLayoutConfig,\n} from '../DirectDepositBlock/layout'\n\nexport interface BlockLayoutConfig {\n background?: string\n logo_color?: string\n logo_bGcolor?: string\n logo_border_color?: string\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 /** 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 * When true, AccountBlock renders the \"Detailed\" account hero (overhanging institution logo,\n * account name + type, status pill) through `DirectDepositCard`, styled by `detailed`.\n */\n isDetailed?: boolean\n /** Hero card style props for the detailed variants. */\n detailed?: DirectDepositCardStyleProps\n}\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:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\n}\n\nexport const getLayoutConfig = (theme: Theme): Record<string, BlockLayoutConfig> => {\n const directDepositLayout = getDirectDepositLayoutConfig(theme)\n\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 background:\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)',\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:\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)',\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 amountVariant: 'h3',\n amountPrefix: '+',\n categoryStrip: 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: 24, 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 // \"Detailed\" hero pair from the Insights UI Toolkit (architecture doc: Account -> Detailed -\n // Primary / Detailed - Success). It is the same hero the Direct Deposit block renders for its\n // beats, so the styling is read from that block's table rather than duplicated here:\n // primary = blue slot gradient + primary-tinted pill, success = green slot gradient + solid\n // success pill.\n detailed_primary: {\n isDetailed: true,\n detailed: directDepositLayout[directDepositVariant.MissingInterestRate],\n },\n detailed_success: {\n isDetailed: true,\n detailed: directDepositLayout[directDepositVariant.InterestRateAdded],\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":";;;AAuDA,IAAM,IAAsC,EAC1C,YACE,0FACJ,GAEa,IAAA,CAAmB,MAAoD;AAClF,QAAM,IAAsB,EAA6B,CAAK;AAE9D,SAAO;AAAA,IACL,mBAAmB;AAAA,MACjB,YAAY,EAAM,QAAQ,QAAQ;AAAA,MAClC,UAAU;AAAA,IACZ;AAAA,IACA,mBAAmB;AAAA,IAEnB,aAAa;AAAA,MAAE,GAAG;AAAA,MAAkB,OAAO;AAAA,IAAQ;AAAA,IAGnD,kBAAkB;AAAA,MAChB,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YACE;AAAA,IACJ;AAAA,IACA,0BAA0B;AAAA,MACxB,YAAY;AAAA,MACZ,cAAc,EAAM,EAAM,QAAQ,YAAY,eAAe,IAAI,IAAI;AAAA,MACrE,mBAAmB;AAAA,MACnB,YACE;AAAA,IACJ;AAAA,IAGA,kBAAkB;AAAA,MAChB,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,cAAc;AAAA,MACd,eAAe;AAAA,MACf,OAAO;AAAA,QAAE,KAAK;AAAA,QAAI,GAAG;AAAA,MAAG;AAAA,MACxB,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB;AAAA,IACA,iBAAiB;AAAA,MACf,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,OAAO;AAAA,QAAE,KAAK;AAAA,QAAI,GAAG;AAAA,MAAG;AAAA,MACxB,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB;AAAA,IACA,oBAAoB;AAAA,MAClB,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,OAAO;AAAA,QAAE,KAAK;AAAA,QAAI,IAAI;AAAA,QAAI,IAAI;AAAA,MAAG;AAAA,MACjC,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB;AAAA,IACA,iBAAiB;AAAA,MACf,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS;AAAA,MACT,eAAe;AAAA,MACf,OAAO;AAAA,QAAE,KAAK;AAAA,QAAI,GAAG;AAAA,MAAG;AAAA,MACxB,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB;AAAA,IAMA,kBAAkB;AAAA,MAChB,YAAY;AAAA,MACZ,UAAU,EAAoB,EAAqB,mBAAA;AAAA,IACrD;AAAA,IACA,kBAAkB;AAAA,MAChB,YAAY;AAAA,MACZ,UAAU,EAAoB,EAAqB,iBAAA;AAAA,IACrD;AAAA,IAGA,SAAS,CAAC;AAAA,EACZ;AACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import n from "./StatusPill.es.js";
|
|
2
|
-
import
|
|
3
|
-
import f from "./
|
|
2
|
+
import b from "./AccountHeroCard.es.js";
|
|
3
|
+
import { ConfettiOverlay as f } from "./shared/ConfettiOverlay.es.js";
|
|
4
4
|
import { NEUTRAL_PILL as s } from "../blocks/ComponentBlocks/DirectDepositBlock/layout.es.js";
|
|
5
5
|
import { Icon as C } from "@mxenabled/mx-icons";
|
|
6
6
|
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
-
var h = ({ backgroundImage: t, bgcolor: i = "primary.lighter", logo: a, name: d, nameVariant: m = "body2", pill: o = s, showConfetti: l = !1, statusLabel: e, subtitle: c }) => /* @__PURE__ */ r(
|
|
8
|
-
backdrop: l ? /* @__PURE__ */ r(
|
|
7
|
+
var h = ({ backgroundImage: t, bgcolor: i = "primary.lighter", logo: a, name: d, nameVariant: m = "body2", pill: o = s, showConfetti: l = !1, statusLabel: e, subtitle: c }) => /* @__PURE__ */ r(b, {
|
|
8
|
+
backdrop: l ? /* @__PURE__ */ r(f, {}) : void 0,
|
|
9
9
|
backgroundImage: t,
|
|
10
10
|
bgcolor: i,
|
|
11
11
|
logo: a,
|
|
@@ -9,12 +9,12 @@ import { DoubleBarChartBlock as h } from "./blocks/ChartBlocks/DoubleBarChartBlo
|
|
|
9
9
|
import A from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
10
10
|
import L from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
11
11
|
import T from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
12
|
-
import H
|
|
13
|
-
import
|
|
14
|
-
import E from "./components/
|
|
15
|
-
import P from "./blocks/ComponentBlocks/
|
|
16
|
-
import F from "./components/
|
|
17
|
-
import x from "./
|
|
12
|
+
import H from "./components/AccountHeroCard.es.js";
|
|
13
|
+
import R from "./components/DirectDepositCard.es.js";
|
|
14
|
+
import y, { isLogoGuid as E } from "./components/LogoFromGuid.es.js";
|
|
15
|
+
import P from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
16
|
+
import F from "./components/TransferLogoCard.es.js";
|
|
17
|
+
import x from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
18
18
|
import U from "./blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js";
|
|
19
19
|
import { BudgetBlock as W } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
20
20
|
import q from "./components/DebtPayoffCard.es.js";
|
|
@@ -60,9 +60,9 @@ import gr from "./components/LogoClusterCard.es.js";
|
|
|
60
60
|
import kr from "./components/MerchantHighlightCard.es.js";
|
|
61
61
|
import hr from "./components/P2PLogoStack.es.js";
|
|
62
62
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
P as AccountBlock,
|
|
64
|
+
H as AccountHeroCard,
|
|
65
|
+
x as AccountSwitchBlock,
|
|
66
66
|
go as AmountPill,
|
|
67
67
|
f as BAR_ARIA_LABEL,
|
|
68
68
|
e as BAR_CHART_VARIANTS,
|
|
@@ -76,7 +76,7 @@ export {
|
|
|
76
76
|
ro as DebtsBlock,
|
|
77
77
|
Zo as DesignateEmergencySavingsCard,
|
|
78
78
|
U as DirectDepositBlock,
|
|
79
|
-
|
|
79
|
+
R as DirectDepositCard,
|
|
80
80
|
tr as DismissInsightDialog,
|
|
81
81
|
L as DonutChartBlock,
|
|
82
82
|
h as DoubleBarChartBlock,
|
|
@@ -92,7 +92,7 @@ export {
|
|
|
92
92
|
J as InsightTransactionRow,
|
|
93
93
|
pr as LoadingCard,
|
|
94
94
|
gr as LogoClusterCard,
|
|
95
|
-
|
|
95
|
+
y as LogoFromGuid,
|
|
96
96
|
Br as LogoTile,
|
|
97
97
|
kr as MerchantHighlightCard,
|
|
98
98
|
er as ObsolesceBanner,
|
|
@@ -112,7 +112,7 @@ export {
|
|
|
112
112
|
_o as SurveyModal,
|
|
113
113
|
Bo as TransactionBlock,
|
|
114
114
|
Q as TransactionListCard,
|
|
115
|
-
|
|
115
|
+
F as TransferLogoCard,
|
|
116
116
|
$ as UpcomingBillBlock,
|
|
117
117
|
Y as UpcomingBillCard,
|
|
118
118
|
ho as UpcomingSubscriptionBlock,
|
|
@@ -121,7 +121,7 @@ export {
|
|
|
121
121
|
n as barChartVariant,
|
|
122
122
|
c as buildChartData,
|
|
123
123
|
l as buildDataSeries,
|
|
124
|
-
|
|
124
|
+
E as isLogoGuid,
|
|
125
125
|
m as resolveInsightRender,
|
|
126
126
|
lo as transactionBlockVariant,
|
|
127
127
|
a as useBeatActions,
|