@mx-cartographer/experiences 9.7.7 → 9.7.8
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/DebtsBlock/DebtsBlock.es.js +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.d.ts +6 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js +37 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/weekStrip.d.ts +25 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/weekStrip.es.js +35 -0
- package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/weekStrip.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -1
- package/dist/insights-v2/components/UpcomingBillCard.d.ts +1 -10
- package/dist/insights-v2/components/UpcomingBillCard.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +26 -25
- package/dist/insights-v2/mappings/blocks.es.js +30 -29
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.d.ts +0 -53
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js +0 -79
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/index.d.ts +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/layout.d.ts +0 -13
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/layout.es.js +0 -6
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/layout.es.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [9.7.8] - 10-20-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - `repeating_transaction_block` component block (`scheduled` variant): the Upcoming Bill card (week strip, merchant row, amount) read from `instance_slot.data`, falling back to the flat slot (WEC-1299)
|
|
4
|
+
- **CHANGED** - `upcoming_bill_block` is now an alias of `repeating_transaction_block`; the `UpcomingBillBlock` wrapper, fixtures and story are removed and its exports remain as `@deprecated` aliases (WEC-1299)
|
|
5
|
+
|
|
1
6
|
## [9.7.6] - 10-20-2026
|
|
2
7
|
|
|
3
8
|
- **CHANGED** - `account_block` standard cards restyled to the [Insights V2 design](https://www.figma.com/design/zHeKCtAYZl4NoOb6NgqKwb/Insights-V2-Development?node-id=13428-17654): `h2` amount, `caption` / `text.secondary` sub_text, `px: 16 / py: 12` body, `py: 4` header strip, a 30px icon glyph in the 48px tile, and the `theme.shadows[1]` elevation around the header and card together. Every standard variant; confetti cards unchanged (MEW2-3317)
|
|
@@ -247,6 +247,7 @@ export declare const BlockType: {
|
|
|
247
247
|
readonly DoubleBarChartBlock: "double_bar_chart_block";
|
|
248
248
|
readonly DoubleProgressBarBlock: "double_progress_bar_block";
|
|
249
249
|
readonly DebtsBlock: "debts_block";
|
|
250
|
+
readonly RepeatingTransactionBlock: "repeating_transaction_block";
|
|
250
251
|
readonly SaveExtraBlock: "save_extra_block";
|
|
251
252
|
readonly SavingsOpportunityBlock: "savings_opportunity_block";
|
|
252
253
|
readonly StepChartBlock: "step_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 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
|
+
{"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 RepeatingTransactionBlock: 'repeating_transaction_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":"AAyTA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { resolveVariantConfig as B } from "../../resolveVariantConfig.es.js";
|
|
|
7
7
|
import Y from "../../../components/LogoFromGuid.es.js";
|
|
8
8
|
import G from "../../../components/DebtPayoffCard.es.js";
|
|
9
9
|
import j from "../../../components/TransactionListCard.es.js";
|
|
10
|
-
import { parseDueDate as I } from "../
|
|
10
|
+
import { parseDueDate as I } from "../RepeatingTransactionBlock/weekStrip.es.js";
|
|
11
11
|
import { DEBTS_LAYOUT as H, debtsBlockVariant as M } from "./layout.es.js";
|
|
12
12
|
import V from "react";
|
|
13
13
|
import { jsx as l } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type InstanceSlotRow } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { DebtsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\n\nimport DepositLogo from '../../../components/ComponentBlocks/DepositLogo'\nimport DebtPayoffCard, { type DebtPayoffStat } from '../../../components/DebtPayoffCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { parseDueDate } from '../
|
|
1
|
+
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type InstanceSlotRow } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { DebtsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\n\nimport DepositLogo from '../../../components/ComponentBlocks/DepositLogo'\nimport DebtPayoffCard, { type DebtPayoffStat } from '../../../components/DebtPayoffCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { parseDueDate } from '../RepeatingTransactionBlock/weekStrip'\n\nimport { DEBTS_LAYOUT, debtsBlockVariant } from './layout'\n\n// The card story reads the block's look from here.\nexport { PAYOFF_STYLE } from './layout'\n\ninterface DebtsBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n\n/** Account types drawn with the card glyph when there is no institution logo; the rest get the bank. */\nconst CREDIT_CARD_TYPES = new Set(['credit card', 'credit_card', 'creditcard'])\n\nconst iconFor = (accountType?: string) =>\n CREDIT_CARD_TYPES.has((accountType ?? '').trim().toLowerCase())\n ? 'credit_card'\n : 'account_balance'\n\n/** A summary row ditto can draw: an object with a name. Anything else in `series` is skipped. */\nconst isNamedRow = (row: unknown): row is InstanceSlotRow & { primary_text: string } =>\n typeof row === 'object' &&\n row !== null &&\n typeof (row as InstanceSlotRow).primary_text === 'string'\n\n/** Every label the payoff card renders; a partial namespace counts as missing. */\nconst hasAllLabels = (copy?: DebtsBlockCopy): copy is DebtsBlockCopy =>\n !!copy?.balance_label &&\n !!copy.payoff_date_label &&\n !!copy.monthly_payment_label &&\n !!copy.interest_rate_label\n\n/**\n * Debts component block — the content card for the Debt Payoff Strategies beat.\n * `instance_slot.variant` picks the card from `./layout.ts` through `resolveVariantConfig`, as\n * `AccountBlock` does:\n *\n * - `projected_payoff` — one account on the `DebtPayoffCard`. Its facts arrive flat on\n * `instance_slot` (the shape it shipped with): the balance (`amount`), `payoff_date`,\n * `monthly_payment`, `interest_rate`, plus the shared account/institution fields.\n * - `debt_summary` — the beat's several debt accounts on a `TransactionListCard`, read from\n * `instance_slot.data`: one row per account from `series` (pre-localized `logo`, `primary_text`\n * name, `secondary_text` rate, `amount` balance, in the order sent), an optional `header_text`,\n * and the total owed (`amount`) as the footer. With no rows there is nothing to summarize and the\n * block renders nothing.\n *\n * Captions and payoff row labels come from `insights_feed.debts_block` copy, which ships\n * separately. Each variant needs only its own keys: until they have shipped, the card shows what\n * needs no copy (the account row, the summary rows) but never an unlabelled figure, and warns once\n * per mount so the rollout gap is traceable. A row with no value (or an unparseable date) is\n * dropped rather than rendered blank.\n */\nconst DebtsBlock = ({ payload }: DebtsBlockProps) => {\n const theme = useTheme()\n const copy = useGlobalCopyStore().insights_feed?.debts_block\n const { instance_slot } = payload\n const { data, variant } = instance_slot\n\n const layout = resolveVariantConfig(\n DEBTS_LAYOUT,\n variant,\n debtsBlockVariant.ProjectedPayoff,\n 'DebtsBlock',\n )\n const isSummary = layout.card === 'summary'\n\n const labels = hasAllLabels(copy) ? copy : undefined\n const totalLabel = copy?.total_balance_label\n const hasCopy = isSummary ? !!totalLabel : !!labels\n\n React.useEffect(() => {\n if (hasCopy) return\n console.warn(\n `debts_block: ${copy ? 'copy incomplete' : 'copy namespace missing'}; rendering without its labelled figures`,\n )\n }, [copy, hasCopy])\n\n if (isSummary) {\n // `slot()` is an unchecked cast over backend data, so every value is narrowed before use.\n const series = slot<unknown[]>(data, 'series')\n const rows = (Array.isArray(series) ? series : []).filter(isNamedRow).map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: <LogoFromGuid logo={row.logo} size={ROW_LOGO_SIZE} />,\n subtitle: typeof row.secondary_text === 'string' ? row.secondary_text : '',\n title: row.primary_text,\n }))\n const header = slot<unknown>(data, 'header_text')\n const total = slot<unknown>(data, 'amount')\n\n return (\n <TransactionListCard\n background={theme.palette.primary.lighter}\n footer={\n totalLabel && typeof total === 'number' && Number.isFinite(total)\n ? { amount: formatCurrency(total, '0,0.00'), label: totalLabel }\n : undefined\n }\n header={typeof header === 'string' ? header : undefined}\n rows={rows}\n />\n )\n }\n\n const {\n account_name,\n account_type,\n amount,\n institution_guid,\n institution_name,\n interest_rate,\n monthly_payment,\n payoff_date,\n status_text,\n } = instance_slot\n\n const stats: DebtPayoffStat[] = []\n if (labels) {\n const payoffDate = payoff_date ? parseDueDate(payoff_date) : null\n if (payoffDate) {\n stats.push({\n label: labels.payoff_date_label,\n value: formatDate(payoffDate, DATE_FORMATS_INTL.MONTH_SHORT_YEAR),\n })\n }\n if (monthly_payment != null) {\n stats.push({\n label: labels.monthly_payment_label,\n value: formatCurrency(monthly_payment, '0,0.00'),\n })\n }\n if (interest_rate != null) {\n // `interest_rate` arrives as a percentage (19.99); Intl's percent style expects a fraction.\n stats.push({\n label: labels.interest_rate_label,\n value: formatPercentage(interest_rate / 100),\n })\n }\n }\n\n const hasBalance = labels !== undefined && amount != null\n\n return (\n <DebtPayoffCard\n {...layout.style}\n balance={hasBalance ? formatCurrency(amount, '0,0.00') : undefined}\n balanceLabel={hasBalance ? labels.balance_label : undefined}\n logo={\n <DepositLogo\n iconName={iconFor(account_type)}\n institutionGuid={institution_guid ?? ''}\n institutionName={institution_name ?? ''}\n />\n }\n name={account_name}\n stats={stats}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n}\n\nexport default DebtsBlock\n"],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InsightsPayload } from '../../../../core';
|
|
2
|
+
interface RepeatingTransactionBlockProps {
|
|
3
|
+
payload: InsightsPayload;
|
|
4
|
+
}
|
|
5
|
+
declare const RepeatingTransactionBlock: ({ payload }: RepeatingTransactionBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default RepeatingTransactionBlock;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { slot as s } from "../../../../core/types/Insights.es.js";
|
|
2
|
+
import { formatCurrency as g } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import p, { isLogoGuid as f } from "../../../components/LogoFromGuid.es.js";
|
|
4
|
+
import { buildUnhighlightedCurrentWeek as h, buildWeekStrip as _, parseDueDate as x } from "./weekStrip.es.js";
|
|
5
|
+
import b from "../../../components/UpcomingBillCard.es.js";
|
|
6
|
+
import k from "@mui/material/Stack";
|
|
7
|
+
import { Icon as y } from "@mxenabled/mx-icons";
|
|
8
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
9
|
+
var U = ({ payload: u }) => {
|
|
10
|
+
const { instance_slot: o } = u, { data: e } = o, r = (d) => s(e, d) ?? o[d], a = r("merchant_name") ?? "", i = r("amount"), n = r("due_date"), m = s(e, "logo") ?? (o.merchant_guid ? {
|
|
11
|
+
alt: a,
|
|
12
|
+
fallback_guid: o.category_guid,
|
|
13
|
+
guid: o.merchant_guid
|
|
14
|
+
} : void 0), c = n ? x(n) : null, l = c ? _(c) : h();
|
|
15
|
+
return /* @__PURE__ */ t(k, {
|
|
16
|
+
sx: { px: 16 },
|
|
17
|
+
children: /* @__PURE__ */ t(b, {
|
|
18
|
+
amount: typeof i == "number" ? g(i, "0,0.00") : "",
|
|
19
|
+
days: l,
|
|
20
|
+
logo: f(m?.guid) ? /* @__PURE__ */ t(p, {
|
|
21
|
+
logo: m,
|
|
22
|
+
size: 24
|
|
23
|
+
}) : /* @__PURE__ */ t(y, {
|
|
24
|
+
"aria-hidden": !0,
|
|
25
|
+
name: "receipt_long",
|
|
26
|
+
size: 24,
|
|
27
|
+
sx: { color: "text.secondary" }
|
|
28
|
+
}),
|
|
29
|
+
merchantName: a
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
U as default
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=RepeatingTransactionBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepeatingTransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type InstanceSlot, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoFromGuid, { isLogoGuid } from '../../../components/LogoFromGuid'\nimport UpcomingBillCard from '../../../components/UpcomingBillCard'\n\nimport { buildUnhighlightedCurrentWeek, buildWeekStrip, parseDueDate } from './weekStrip'\n\ninterface RepeatingTransactionBlockProps {\n payload: InsightsPayload\n}\n\nconst RepeatingTransactionBlock = ({ payload }: RepeatingTransactionBlockProps) => {\n const { instance_slot } = payload\n const { data } = instance_slot\n const field = <K extends keyof InstanceSlot>(key: K) =>\n slot<InstanceSlot[K]>(data, key) ?? instance_slot[key]\n\n const merchantName = field('merchant_name') ?? ''\n const amount = field('amount')\n const dueDate = field('due_date')\n const logo =\n slot<LogoRef>(data, 'logo') ??\n (instance_slot.merchant_guid\n ? {\n alt: merchantName,\n fallback_guid: instance_slot.category_guid,\n guid: instance_slot.merchant_guid,\n }\n : undefined)\n\n const parsed = dueDate ? parseDueDate(dueDate) : null\n const days = parsed ? buildWeekStrip(parsed) : buildUnhighlightedCurrentWeek()\n\n return (\n <Stack sx={{ px: 16 }}>\n <UpcomingBillCard\n amount={typeof amount === 'number' ? formatCurrency(amount, '0,0.00') : ''}\n days={days}\n logo={\n isLogoGuid(logo?.guid) ? (\n <LogoFromGuid logo={logo} size={24} />\n ) : (\n <Icon\n aria-hidden={true}\n name=\"receipt_long\"\n size={24}\n sx={{ color: 'text.secondary' }}\n />\n )\n }\n merchantName={merchantName}\n />\n </Stack>\n )\n}\n\nexport default RepeatingTransactionBlock\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAAA,CAA6B,EAAE,SAAA,EAAA,MAA8C;AACjF,QAAM,EAAE,eAAA,EAAA,IAAkB,GACpB,EAAE,MAAA,EAAA,IAAS,GACX,IAAA,CAAuC,MAC3C,EAAsB,GAAM,CAAG,KAAK,EAAc,CAAA,GAE9C,IAAe,EAAM,eAAe,KAAK,IACzC,IAAS,EAAM,QAAQ,GACvB,IAAU,EAAM,UAAU,GAC1B,IACJ,EAAc,GAAM,MAAM,MACzB,EAAc,gBACX;AAAA,IACE,KAAK;AAAA,IACL,eAAe,EAAc;AAAA,IAC7B,MAAM,EAAc;AAAA,EACtB,IACA,SAEA,IAAS,IAAU,EAAa,CAAO,IAAI,MAC3C,IAAO,IAAS,EAAe,CAAM,IAAI,EAA8B;AAE7E,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,OAAO,KAAW,WAAW,EAAe,GAAQ,QAAQ,IAAI;AAAA,MAClE,MAAA;AAAA,MACN,MACE,EAAW,GAAM,IAAI,IACnB,gBAAA,EAAC,GAAD;AAAA,QAAoB,MAAA;AAAA,QAAM,MAAM;AAAA,MAAK,CAAA,IAErC,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,MAAK;AAAA,QACL,MAAM;AAAA,QACN,IAAI,EAAE,OAAO,iBAAiB;AAAA,MAC/B,CAAA;AAAA,MAGS,cAAA;AAAA,IACf,CAAA;AAAA,EACI,CAAA;AAEX"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UpcomingBillDay } from '../../../components/UpcomingBillCard';
|
|
2
|
+
/**
|
|
3
|
+
* Parse an ISO `YYYY-MM-DD` into a local-time Date, dodging the UTC-midnight parse
|
|
4
|
+
* that `new Date('2025-10-30')` performs (which drifts a day in negative offsets).
|
|
5
|
+
* Any other string shape (full ISO datetime) falls through to the native parser.
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` for anything that doesn't resolve to a valid Date — including a
|
|
8
|
+
* `YYYY-MM-DD`-shaped string whose year/month/day segments produce `Invalid Date`
|
|
9
|
+
* (e.g. `'2026-13-40'`) and arbitrary strings the native parser rejects. Callers
|
|
10
|
+
* must handle `null` so a bad backend value cannot propagate `NaN` into the UI
|
|
11
|
+
* via `getDay()` and render `NaN` day numbers.
|
|
12
|
+
*/
|
|
13
|
+
export declare const parseDueDate: (iso: string) => Date | null;
|
|
14
|
+
/**
|
|
15
|
+
* Build the Sun→Sat week around a due date with the due day marked `highlighted`.
|
|
16
|
+
* Column index is the local day-of-week (0=Sun..6=Sat) so the strip always lines up
|
|
17
|
+
* under the weekday labels regardless of which weekday the bill lands on.
|
|
18
|
+
*/
|
|
19
|
+
export declare const buildWeekStrip: (dueDate: Date) => UpcomingBillDay[];
|
|
20
|
+
/**
|
|
21
|
+
* Build the current Sun→Sat week with NO cell highlighted. Used as the degraded
|
|
22
|
+
* strip when `due_date` is missing or unparseable — the card still renders
|
|
23
|
+
* (merchant row with name + amount) but the strip has no "due day" callout.
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildUnhighlightedCurrentWeek: () => UpcomingBillDay[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var l = [
|
|
2
|
+
"Sun",
|
|
3
|
+
"Mon",
|
|
4
|
+
"Tue",
|
|
5
|
+
"Wed",
|
|
6
|
+
"Thu",
|
|
7
|
+
"Fri",
|
|
8
|
+
"Sat"
|
|
9
|
+
], s = (e) => {
|
|
10
|
+
const r = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
11
|
+
if (r) {
|
|
12
|
+
const [a, D, n] = r.slice(1).map(Number), t = new Date(a, D - 1, n);
|
|
13
|
+
return t.getFullYear() === a && t.getMonth() === D - 1 && t.getDate() === n ? t : null;
|
|
14
|
+
}
|
|
15
|
+
const u = new Date(e);
|
|
16
|
+
return Number.isNaN(u.getTime()) ? null : u;
|
|
17
|
+
}, g = (e, r) => {
|
|
18
|
+
const u = e.getDay(), a = new Date(e);
|
|
19
|
+
return a.setDate(e.getDate() - u), l.map((D, n) => {
|
|
20
|
+
const t = new Date(a);
|
|
21
|
+
t.setDate(a.getDate() + n);
|
|
22
|
+
const d = {
|
|
23
|
+
label: D,
|
|
24
|
+
date: String(t.getDate())
|
|
25
|
+
};
|
|
26
|
+
return n === r && (d.highlighted = !0), d;
|
|
27
|
+
});
|
|
28
|
+
}, i = (e) => g(e, e.getDay()), c = () => g(/* @__PURE__ */ new Date());
|
|
29
|
+
export {
|
|
30
|
+
c as buildUnhighlightedCurrentWeek,
|
|
31
|
+
i as buildWeekStrip,
|
|
32
|
+
s as parseDueDate
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=weekStrip.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weekStrip.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/weekStrip.ts"],"sourcesContent":["import type { UpcomingBillDay } from '../../../components/UpcomingBillCard'\n\nconst DAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] as const\n\n/**\n * Parse an ISO `YYYY-MM-DD` into a local-time Date, dodging the UTC-midnight parse\n * that `new Date('2025-10-30')` performs (which drifts a day in negative offsets).\n * Any other string shape (full ISO datetime) falls through to the native parser.\n *\n * Returns `null` for anything that doesn't resolve to a valid Date — including a\n * `YYYY-MM-DD`-shaped string whose year/month/day segments produce `Invalid Date`\n * (e.g. `'2026-13-40'`) and arbitrary strings the native parser rejects. Callers\n * must handle `null` so a bad backend value cannot propagate `NaN` into the UI\n * via `getDay()` and render `NaN` day numbers.\n */\nexport const parseDueDate = (iso: string): Date | null => {\n const dateOnly = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso)\n if (dateOnly) {\n const [y, m, d] = dateOnly.slice(1).map(Number)\n const parsed = new Date(y, m - 1, d)\n const roundTrips =\n parsed.getFullYear() === y && parsed.getMonth() === m - 1 && parsed.getDate() === d\n return roundTrips ? parsed : null\n }\n const parsed = new Date(iso)\n return Number.isNaN(parsed.getTime()) ? null : parsed\n}\n\nconst weekOf = (base: Date, highlightedIndex?: number): UpcomingBillDay[] => {\n const dow = base.getDay()\n const sunday = new Date(base)\n sunday.setDate(base.getDate() - dow)\n\n return DAY_LABELS.map((label, idx): UpcomingBillDay => {\n const cell = new Date(sunday)\n cell.setDate(sunday.getDate() + idx)\n const day: UpcomingBillDay = { label, date: String(cell.getDate()) }\n if (idx === highlightedIndex) day.highlighted = true\n return day\n })\n}\n\n/**\n * Build the Sun→Sat week around a due date with the due day marked `highlighted`.\n * Column index is the local day-of-week (0=Sun..6=Sat) so the strip always lines up\n * under the weekday labels regardless of which weekday the bill lands on.\n */\nexport const buildWeekStrip = (dueDate: Date): UpcomingBillDay[] =>\n weekOf(dueDate, dueDate.getDay())\n\n/**\n * Build the current Sun→Sat week with NO cell highlighted. Used as the degraded\n * strip when `due_date` is missing or unparseable — the card still renders\n * (merchant row with name + amount) but the strip has no \"due day\" callout.\n */\nexport const buildUnhighlightedCurrentWeek = (): UpcomingBillDay[] => weekOf(new Date())\n"],"mappings":"AAEA,IAAM,IAAa;AAAA,EAAC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAK,GAatD,IAAA,CAAgB,MAA6B;AACxD,QAAM,IAAW,4BAA4B,KAAK,CAAG;AACrD,MAAI,GAAU;AACZ,UAAM,CAAC,GAAG,GAAG,CAAA,IAAK,EAAS,MAAM,CAAC,EAAE,IAAI,MAAM,GACxC,IAAS,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC;AAGnC,WADE,EAAO,YAAY,MAAM,KAAK,EAAO,SAAS,MAAM,IAAI,KAAK,EAAO,QAAQ,MAAM,IAChE,IAAS;AAAA,EAC/B;AACA,QAAM,IAAS,IAAI,KAAK,CAAG;AAC3B,SAAO,OAAO,MAAM,EAAO,QAAQ,CAAC,IAAI,OAAO;AACjD,GAEM,IAAA,CAAU,GAAY,MAAiD;AAC3E,QAAM,IAAM,EAAK,OAAO,GAClB,IAAS,IAAI,KAAK,CAAI;AAC5B,SAAA,EAAO,QAAQ,EAAK,QAAQ,IAAI,CAAG,GAE5B,EAAW,IAAA,CAAK,GAAO,MAAyB;AACrD,UAAM,IAAO,IAAI,KAAK,CAAM;AAC5B,IAAA,EAAK,QAAQ,EAAO,QAAQ,IAAI,CAAG;AACnC,UAAM,IAAuB;AAAA,MAAE,OAAA;AAAA,MAAO,MAAM,OAAO,EAAK,QAAQ,CAAC;AAAA,IAAE;AACnE,WAAI,MAAQ,MAAkB,EAAI,cAAc,KACzC;AAAA,EACT,CAAC;AACH,GAOa,IAAA,CAAkB,MAC7B,EAAO,GAAS,EAAQ,OAAO,CAAC,GAOrB,IAAA,MAAyD,EAAO,oBAAI,KAAK,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatCurrency as m } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
|
-
import
|
|
3
|
-
import l from "
|
|
2
|
+
import p from "../../../components/SavingsOpportunityCard.es.js";
|
|
3
|
+
import { createVariantBlock as l } from "../../createVariantBlock.es.js";
|
|
4
4
|
import { savingsOpportunityVariant as c } from "./layout.es.js";
|
|
5
5
|
import v from "@mui/material/Stack";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -8,7 +8,7 @@ var u = (r) => {
|
|
|
8
8
|
const { instance_slot: t } = r, { amount: a, label: i, slot: s } = t, e = s ?? !0;
|
|
9
9
|
return /* @__PURE__ */ o(v, {
|
|
10
10
|
sx: { px: 16 },
|
|
11
|
-
children: /* @__PURE__ */ o(
|
|
11
|
+
children: /* @__PURE__ */ o(p, {
|
|
12
12
|
amount: m(a ?? 0, "0,0.00"),
|
|
13
13
|
label: i ?? "",
|
|
14
14
|
slot: e
|
|
@@ -21,7 +21,7 @@ var u = (r) => {
|
|
|
21
21
|
payload: r,
|
|
22
22
|
variant: a
|
|
23
23
|
});
|
|
24
|
-
}, f =
|
|
24
|
+
}, f = l({
|
|
25
25
|
variants: Object.fromEntries(Object.values(c).map((r) => [r, n])),
|
|
26
26
|
fallback: n,
|
|
27
27
|
name: "SavingsOpportunityBlock"
|
|
@@ -3,9 +3,9 @@ export * from './AccountSwitchBlock';
|
|
|
3
3
|
export * from './DirectDepositBlock';
|
|
4
4
|
export * from './BudgetBlock';
|
|
5
5
|
export * from './DebtsBlock';
|
|
6
|
+
export * from './RepeatingTransactionBlock';
|
|
6
7
|
export * from './SaveExtraBlock';
|
|
7
8
|
export * from './SavingsOpportunityBlock';
|
|
8
9
|
export * from './TransactionBlock';
|
|
9
|
-
export * from './UpcomingBillBlock';
|
|
10
10
|
export * from './UpcomingSubscriptionBlock';
|
|
11
11
|
export * from './WithdrawalBlock';
|
|
@@ -9,16 +9,7 @@ export interface UpcomingBillDay {
|
|
|
9
9
|
highlighted?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface UpcomingBillCardProps {
|
|
12
|
-
|
|
13
|
-
days: [
|
|
14
|
-
UpcomingBillDay,
|
|
15
|
-
UpcomingBillDay,
|
|
16
|
-
UpcomingBillDay,
|
|
17
|
-
UpcomingBillDay,
|
|
18
|
-
UpcomingBillDay,
|
|
19
|
-
UpcomingBillDay,
|
|
20
|
-
UpcomingBillDay
|
|
21
|
-
];
|
|
12
|
+
days: UpcomingBillDay[];
|
|
22
13
|
/** Merchant logo/icon (24x24), rendered left of the merchant name. */
|
|
23
14
|
logo: ReactNode;
|
|
24
15
|
/** Merchant name, e.g. "Power Plus". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpcomingBillCard.es.js","names":[],"sources":["../../../src/insights-v2/components/UpcomingBillCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface UpcomingBillDay {\n /** Day-of-week label, e.g. \"Sun\". */\n label: string\n /** Day-of-month number, e.g. \"26\". */\n date: string\n /** Whether this is the highlighted due day (blue label + filled date cell). */\n highlighted?: boolean\n}\n\nexport interface UpcomingBillCardProps {\n
|
|
1
|
+
{"version":3,"file":"UpcomingBillCard.es.js","names":[],"sources":["../../../src/insights-v2/components/UpcomingBillCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface UpcomingBillDay {\n /** Day-of-week label, e.g. \"Sun\". */\n label: string\n /** Day-of-month number, e.g. \"26\". */\n date: string\n /** Whether this is the highlighted due day (blue label + filled date cell). */\n highlighted?: boolean\n}\n\nexport interface UpcomingBillCardProps {\n days: UpcomingBillDay[]\n /** Merchant logo/icon (24x24), rendered left of the merchant name. */\n logo: ReactNode\n /** Merchant name, e.g. \"Power Plus\". */\n merchantName: string\n /** Bill amount, formatted (e.g. \"$75.00\"). */\n amount: string\n /** Custom aria-label for the highlighted due date cell (accessibility). Pass a localized string from copy/GlobalCopyStore; defaults to English \"bill due\" if not provided. */\n highlightedAriaLabel?: string\n sx?: SxProps<Theme>\n}\n\n/**\n * Upcoming Bill content: a seven-day week strip with the due day highlighted\n * (blue label + filled blue date cell) above a tinted bill row (merchant logo,\n * name, and amount).\n *\n * Figma: Upcoming Bill Content (Full variant). Scope is the Content section\n * only.\n */\nconst UpcomingBillCard = ({\n amount,\n days,\n highlightedAriaLabel,\n logo,\n merchantName,\n sx,\n}: UpcomingBillCardProps) => {\n return (\n <Box\n sx={{\n bgcolor: 'background.paper',\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: 2,\n p: 12,\n ...sx,\n }}\n >\n <Stack sx={{ gap: 12 }}>\n {/* Week strip: labels row + date-cells row, aligned into 7 columns */}\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: 'repeat(7, 1fr)',\n rowGap: '2px',\n }}\n >\n {days.map((day) => (\n <Text\n bold={day.highlighted === true}\n color={day.highlighted === true ? 'primary.main' : 'text.secondary'}\n key={`label-${day.label}-${day.date}`}\n sx={{ textAlign: 'center' }}\n variant=\"caption\"\n >\n {day.label}\n </Text>\n ))}\n {days.map((day) => (\n <Box\n aria-current={day.highlighted === true ? 'date' : undefined}\n aria-label={\n day.highlighted === true\n ? (highlightedAriaLabel ?? `${day.label} ${day.date}, bill due`)\n : undefined\n }\n key={`date-${day.label}-${day.date}`}\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: 36,\n justifyContent: 'center',\n justifySelf: 'center',\n width: 36,\n ...(day.highlighted === true && {\n bgcolor: 'primary.main',\n borderRadius: '4px',\n }),\n }}\n >\n <Text\n color={day.highlighted === true ? 'primary.contrastText' : 'text.secondary'}\n variant=\"body1\"\n >\n {day.date}\n </Text>\n </Box>\n ))}\n </Box>\n\n {/* Bill row */}\n <Stack\n sx={{\n alignItems: 'center',\n // Figma fill: primary.main at 15% opacity (a translucent overlay),\n // with a solid primary.main 1px border.\n backgroundColor: (theme) => alpha(theme.palette.primary.main, 0.15),\n border: '1px solid',\n borderColor: 'primary.main',\n borderRadius: '4px',\n flexDirection: 'row',\n gap: 12,\n justifyContent: 'space-between',\n px: 12,\n py: 10,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8, minWidth: 0 }}>\n <Box sx={{ flexShrink: 0, height: 24, width: 24 }}>{logo}</Box>\n <Text color=\"text.primary\" truncate={true} variant=\"subtitle2\">\n {merchantName}\n </Text>\n </Stack>\n <Text color=\"text.primary\" sx={{ flexShrink: 0, fontWeight: 600 }} variant=\"subtitle2\">\n {amount}\n </Text>\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default UpcomingBillCard\n"],"mappings":";;;;;AAsCA,IAAM,IAAA,CAAoB,EACxB,QAAA,GACA,MAAA,GACA,sBAAA,GACA,MAAA,GACA,cAAA,GACA,IAAA,EAAA,MAGE,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,KAAK,GAAG;AAAA,IAArB,UAAA,CAEE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,qBAAqB;AAAA,QACrB,QAAQ;AAAA,MACV;AAAA,MALF,UAAA,CAOG,EAAK,IAAA,CAAK,MACT,gBAAA,EAAC,GAAD;AAAA,QACE,MAAM,EAAI,gBAAgB;AAAA,QAC1B,OAAO,EAAI,gBAAgB,KAAO,iBAAiB;AAAA,QAEnD,IAAI,EAAE,WAAW,SAAS;AAAA,QAC1B,SAAQ;AAAA,QAEP,UAAA,EAAI;AAAA,MACD,GALC,SAAS,EAAI,KAAA,IAAS,EAAI,IAAA,EAK3B,CACP,GACA,EAAK,IAAA,CAAK,MACT,gBAAA,EAAC,GAAD;AAAA,QACE,gBAAc,EAAI,gBAAgB,KAAO,SAAS;AAAA,QAClD,cACE,EAAI,gBAAgB,KACf,KAAwB,GAAG,EAAI,KAAA,IAAS,EAAI,IAAA,eAC7C;AAAA,QAGN,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,gBAAgB;AAAA,UAChB,aAAa;AAAA,UACb,OAAO;AAAA,UACP,GAAI,EAAI,gBAAgB,MAAQ;AAAA,YAC9B,SAAS;AAAA,YACT,cAAc;AAAA,UAChB;AAAA,QACF;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,OAAO,EAAI,gBAAgB,KAAO,yBAAyB;AAAA,UAC3D,SAAQ;AAAA,UAEP,UAAA,EAAI;AAAA,QACD,CAAA;AAAA,MACH,GApBE,QAAQ,EAAI,KAAA,IAAS,EAAI,IAAA,EAoB3B,CACN,CACE;AAAA,IAGL,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QAGZ,iBAAA,CAAkB,MAAU,EAAM,EAAM,QAAQ,QAAQ,MAAM,IAAI;AAAA,QAClE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,cAAc;AAAA,QACd,eAAe;AAAA,QACf,KAAK;AAAA,QACL,gBAAgB;AAAA,QAChB,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MAdF,UAAA,CAgBE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,YAAY;AAAA,UAAU,eAAe;AAAA,UAAO,KAAK;AAAA,UAAG,UAAU;AAAA,QAAE;AAAA,QAA7E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UAAK,IAAI;AAAA,YAAE,YAAY;AAAA,YAAG,QAAQ;AAAA,YAAI,OAAO;AAAA,UAAG;AAAA,UAAI,UAAA;AAAA,QAAU,CAAA,GAC9D,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAe,UAAU;AAAA,UAAM,SAAQ;AAAA,UAChD,UAAA;AAAA,QACG,CAAA,CACD;AAAA,MACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAe,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,YAAY;AAAA,QAAI;AAAA,QAAG,SAAQ;AAAA,QACxE,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA;AACJ,CAAA"}
|
|
@@ -3,14 +3,14 @@ import { resolveInsightRender as m } from "./resolveInsightRender.es.js";
|
|
|
3
3
|
import { useBeatActions as a } from "./beatActions.es.js";
|
|
4
4
|
import { BAR_ARIA_LABEL as f, BAR_CHART_VARIANTS as e, barChartVariant as n, buildChartData as c, buildDataSeries as l } from "./blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
5
5
|
import { HOST_ACTIONS as d } from "./ctaActions/hostActions.es.js";
|
|
6
|
-
import { useBeatCtaActions as
|
|
6
|
+
import { useBeatCtaActions as g, useCtaHandler as C } from "./ctaActions/useCtaAction.es.js";
|
|
7
7
|
import { BarchartBlock as k } from "./blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
8
8
|
import { DoubleBarChartBlock as h } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
9
9
|
import A from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
10
10
|
import L from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import I from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
12
|
+
import R from "./components/AccountHeroCard.es.js";
|
|
13
|
+
import O from "./components/DirectDepositCard.es.js";
|
|
14
14
|
import y, { isLogoGuid as E } from "./components/LogoFromGuid.es.js";
|
|
15
15
|
import P from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
16
16
|
import F from "./components/TransferLogoCard.es.js";
|
|
@@ -20,23 +20,23 @@ import { BudgetBlock as W } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlo
|
|
|
20
20
|
import q from "./components/DebtPayoffCard.es.js";
|
|
21
21
|
import J from "./components/InsightTransactionRow.es.js";
|
|
22
22
|
import Q from "./components/TransactionListCard.es.js";
|
|
23
|
-
import Y from "./
|
|
24
|
-
import $ from "./
|
|
25
|
-
import ro from "./blocks/ComponentBlocks/
|
|
23
|
+
import Y from "./blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
24
|
+
import $ from "./components/UpcomingBillCard.es.js";
|
|
25
|
+
import ro from "./blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
26
26
|
import mo from "./components/SaveAnExtraCard.es.js";
|
|
27
27
|
import ao from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
28
28
|
import fo from "./components/SavingsOpportunityCard.es.js";
|
|
29
29
|
import no from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
30
30
|
import { transactionBlockVariant as lo } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
|
|
31
31
|
import { TransactionBlock as Bo } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
32
|
-
import
|
|
32
|
+
import Co from "./components/AmountPill.es.js";
|
|
33
33
|
import ko from "./components/SubscriptionHeroCard.es.js";
|
|
34
34
|
import ho from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
35
35
|
import Ao from "./components/WithdrawalCard.es.js";
|
|
36
36
|
import Lo from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
37
|
-
import { SVGImageBlock as
|
|
38
|
-
import
|
|
39
|
-
import
|
|
37
|
+
import { SVGImageBlock as Io } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
38
|
+
import Ro from "./components/shared/StatusSnackbar.es.js";
|
|
39
|
+
import Oo from "./components/FeedbackDialog.es.js";
|
|
40
40
|
import yo from "./components/FeedbackModal.es.js";
|
|
41
41
|
import Mo from "./components/ConnectionDetailDrillDown.es.js";
|
|
42
42
|
import _o from "./components/SurveyModal.es.js";
|
|
@@ -56,14 +56,14 @@ import { ObsolesceBanner as er } from "./components/ObsolesceBanner.es.js";
|
|
|
56
56
|
import cr from "./components/BaseLayout.es.js";
|
|
57
57
|
import sr from "./components/StatusMessageCard.es.js";
|
|
58
58
|
import Br from "./components/LogoTile.es.js";
|
|
59
|
-
import
|
|
59
|
+
import Cr 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
63
|
P as AccountBlock,
|
|
64
|
-
|
|
64
|
+
R as AccountHeroCard,
|
|
65
65
|
x as AccountSwitchBlock,
|
|
66
|
-
|
|
66
|
+
Co as AmountPill,
|
|
67
67
|
f as BAR_ARIA_LABEL,
|
|
68
68
|
e as BAR_CHART_VARIANTS,
|
|
69
69
|
No as BadgedTile,
|
|
@@ -73,17 +73,17 @@ export {
|
|
|
73
73
|
Xo as CompactInsightCard,
|
|
74
74
|
Mo as ConnectionDetailDrillDown,
|
|
75
75
|
q as DebtPayoffCard,
|
|
76
|
-
|
|
76
|
+
Y as DebtsBlock,
|
|
77
77
|
Zo as DesignateEmergencySavingsCard,
|
|
78
78
|
U as DirectDepositBlock,
|
|
79
|
-
|
|
79
|
+
O as DirectDepositCard,
|
|
80
80
|
tr as DismissInsightDialog,
|
|
81
81
|
L as DonutChartBlock,
|
|
82
82
|
h as DoubleBarChartBlock,
|
|
83
|
-
|
|
83
|
+
I as DoubleProgressBarBlock,
|
|
84
84
|
Go as ErrorCard,
|
|
85
85
|
or as FeedbackBar,
|
|
86
|
-
|
|
86
|
+
Oo as FeedbackDialog,
|
|
87
87
|
yo as FeedbackModal,
|
|
88
88
|
d as HOST_ACTIONS,
|
|
89
89
|
ir as HiddenConfirmationCard,
|
|
@@ -91,14 +91,15 @@ export {
|
|
|
91
91
|
zo as InsightOptionsMenu,
|
|
92
92
|
J as InsightTransactionRow,
|
|
93
93
|
pr as LoadingCard,
|
|
94
|
-
|
|
94
|
+
Cr as LogoClusterCard,
|
|
95
95
|
y as LogoFromGuid,
|
|
96
96
|
Br as LogoTile,
|
|
97
97
|
kr as MerchantHighlightCard,
|
|
98
98
|
er as ObsolesceBanner,
|
|
99
99
|
jo as OverflowMenu,
|
|
100
100
|
hr as P2PLogoStack,
|
|
101
|
-
|
|
101
|
+
ro as RepeatingTransactionBlock,
|
|
102
|
+
Io as SVGImageBlock,
|
|
102
103
|
mo as SaveAnExtraCard,
|
|
103
104
|
ao as SaveExtraBlock,
|
|
104
105
|
no as SavingsOpportunityBlock,
|
|
@@ -106,15 +107,15 @@ export {
|
|
|
106
107
|
Ko as StatusBadge,
|
|
107
108
|
sr as StatusMessageCard,
|
|
108
109
|
r as StatusPill,
|
|
109
|
-
|
|
110
|
+
Ro as StatusSnackbar,
|
|
110
111
|
A as StepChartBlock,
|
|
111
112
|
ko as SubscriptionHeroCard,
|
|
112
113
|
_o as SurveyModal,
|
|
113
114
|
Bo as TransactionBlock,
|
|
114
115
|
Q as TransactionListCard,
|
|
115
116
|
F as TransferLogoCard,
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
ro as UpcomingBillBlock,
|
|
118
|
+
$ as UpcomingBillCard,
|
|
118
119
|
ho as UpcomingSubscriptionBlock,
|
|
119
120
|
Lo as WithdrawalBlock,
|
|
120
121
|
Ao as WithdrawalCard,
|
|
@@ -125,6 +126,6 @@ export {
|
|
|
125
126
|
m as resolveInsightRender,
|
|
126
127
|
lo as transactionBlockVariant,
|
|
127
128
|
a as useBeatActions,
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
g as useBeatCtaActions,
|
|
130
|
+
C as useCtaHandler
|
|
130
131
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ContactSupportActionBlock as
|
|
1
|
+
import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
2
2
|
import { hasDrawerBlock as W } from "./hasDrawerBlock.es.js";
|
|
3
3
|
import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
|
|
4
|
-
import { BarchartBlock as
|
|
5
|
-
import { DoubleBarChartBlock as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { BudgetBlock as
|
|
13
|
-
import A from "../blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js";
|
|
4
|
+
import { BarchartBlock as l } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
5
|
+
import { DoubleBarChartBlock as _ } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
6
|
+
import s from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
7
|
+
import C from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
8
|
+
import k from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
9
|
+
import B from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
10
|
+
import u from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
11
|
+
import T from "../blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js";
|
|
12
|
+
import { BudgetBlock as A } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
14
13
|
import O from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
14
|
+
import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
15
15
|
import f from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
16
16
|
import b from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
17
17
|
import { TransactionBlock as N } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
@@ -28,9 +28,9 @@ import { getMakeTransferDrawerTitle as E } from "../actionBlocks/MakeTransferAct
|
|
|
28
28
|
import { MakeTransferActionBlockLayer as K } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
29
29
|
import { getDrawerHeaderTitle as v } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
30
30
|
import { TransactionDetailsBlock as M } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
31
|
-
import { useTransactionDetailsPrepare as
|
|
31
|
+
import { useTransactionDetailsPrepare as a } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
32
32
|
import { TransactionHistoryBlock as w } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
33
|
-
import { useRecurringTransactionPrepare as
|
|
33
|
+
import { useRecurringTransactionPrepare as c } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
34
34
|
import { RecurringTransactionBlock as y } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
35
35
|
import { TransactionListBlock as U } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
|
|
36
36
|
import { RemainingCashBlock as H } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
|
|
@@ -67,21 +67,21 @@ var e = (t) => {
|
|
|
67
67
|
})),
|
|
68
68
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
69
69
|
Component: M,
|
|
70
|
-
usePrepare:
|
|
70
|
+
usePrepare: a,
|
|
71
71
|
title: () => "Transaction Details"
|
|
72
72
|
})),
|
|
73
73
|
[o.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
|
|
74
74
|
Component: y,
|
|
75
|
-
usePrepare:
|
|
75
|
+
usePrepare: c,
|
|
76
76
|
title: (t, i) => i.recurring?.expense_details ?? ""
|
|
77
77
|
})),
|
|
78
78
|
[o.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
|
|
79
79
|
Component: H,
|
|
80
|
-
usePrepare:
|
|
80
|
+
usePrepare: c,
|
|
81
81
|
title: (t, i) => i.insights_feed?.remaining_cash?.title ?? ""
|
|
82
82
|
})),
|
|
83
83
|
[o.CONTACT_SUPPORT_ACTION_BLOCK]: r(() => ({
|
|
84
|
-
Component:
|
|
84
|
+
Component: p,
|
|
85
85
|
usePrepare: e,
|
|
86
86
|
title: (t, i) => i.help?.request_support ?? ""
|
|
87
87
|
})),
|
|
@@ -106,8 +106,8 @@ var e = (t) => {
|
|
|
106
106
|
})),
|
|
107
107
|
[o.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
|
|
108
108
|
Component: U,
|
|
109
|
-
usePrepare:
|
|
110
|
-
title: (t, i,
|
|
109
|
+
usePrepare: a,
|
|
110
|
+
title: (t, i, m) => m?.insights_payload?.title ?? ""
|
|
111
111
|
})),
|
|
112
112
|
[o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
|
|
113
113
|
Component: x,
|
|
@@ -115,21 +115,22 @@ var e = (t) => {
|
|
|
115
115
|
usePrepare: e
|
|
116
116
|
}))
|
|
117
117
|
}, Po = {
|
|
118
|
-
account_block:
|
|
119
|
-
account_switch_block:
|
|
120
|
-
direct_deposit_block:
|
|
121
|
-
bar_chart_block:
|
|
122
|
-
budget_block:
|
|
118
|
+
account_block: B,
|
|
119
|
+
account_switch_block: u,
|
|
120
|
+
direct_deposit_block: T,
|
|
121
|
+
bar_chart_block: l,
|
|
122
|
+
budget_block: A,
|
|
123
123
|
debts_block: O,
|
|
124
|
-
donut_chart_block:
|
|
125
|
-
double_bar_chart_block:
|
|
126
|
-
double_progress_bar_block:
|
|
124
|
+
donut_chart_block: C,
|
|
125
|
+
double_bar_chart_block: _,
|
|
126
|
+
double_progress_bar_block: k,
|
|
127
127
|
image_block: d,
|
|
128
|
+
repeating_transaction_block: n,
|
|
128
129
|
save_extra_block: f,
|
|
129
130
|
savings_opportunity_block: b,
|
|
130
|
-
step_chart_block:
|
|
131
|
+
step_chart_block: s,
|
|
131
132
|
svg_image_block: L,
|
|
132
|
-
upcoming_bill_block:
|
|
133
|
+
upcoming_bill_block: n,
|
|
133
134
|
upcoming_subscription_block: g,
|
|
134
135
|
withdrawal_block: I,
|
|
135
136
|
transaction_block: N
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n DirectDepositBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingBillBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DirectDepositBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: UpcomingBillBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n DirectDepositBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DirectDepositBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { InsightsPayload } from '../../../../core';
|
|
2
|
-
import { UpcomingBillDay } from '../../../components/UpcomingBillCard';
|
|
3
|
-
interface UpcomingBillBlockProps {
|
|
4
|
-
payload: InsightsPayload;
|
|
5
|
-
beatGuid?: string;
|
|
6
|
-
}
|
|
7
|
-
type SevenDays = [
|
|
8
|
-
UpcomingBillDay,
|
|
9
|
-
UpcomingBillDay,
|
|
10
|
-
UpcomingBillDay,
|
|
11
|
-
UpcomingBillDay,
|
|
12
|
-
UpcomingBillDay,
|
|
13
|
-
UpcomingBillDay,
|
|
14
|
-
UpcomingBillDay
|
|
15
|
-
];
|
|
16
|
-
/**
|
|
17
|
-
* Parse an ISO `YYYY-MM-DD` into a local-time Date, dodging the UTC-midnight parse
|
|
18
|
-
* that `new Date('2025-10-30')` performs (which drifts a day in negative offsets).
|
|
19
|
-
* Any other string shape (full ISO datetime) falls through to the native parser.
|
|
20
|
-
*
|
|
21
|
-
* Returns `null` for anything that doesn't resolve to a valid Date — including a
|
|
22
|
-
* `YYYY-MM-DD`-shaped string whose year/month/day segments produce `Invalid Date`
|
|
23
|
-
* (e.g. `'2026-13-40'`) and arbitrary strings the native parser rejects. Callers
|
|
24
|
-
* must handle `null` so a bad backend value cannot propagate `NaN` into the UI
|
|
25
|
-
* via `getDay()` and render `NaN` day numbers.
|
|
26
|
-
*/
|
|
27
|
-
export declare const parseDueDate: (iso: string) => Date | null;
|
|
28
|
-
/**
|
|
29
|
-
* Build the Sun→Sat week around a due date with the due day marked `highlighted`.
|
|
30
|
-
* Column index is the local day-of-week (0=Sun..6=Sat) so the strip always lines up
|
|
31
|
-
* under the weekday labels regardless of which weekday the bill lands on.
|
|
32
|
-
*/
|
|
33
|
-
export declare const buildWeekStrip: (dueDate: Date) => SevenDays;
|
|
34
|
-
/**
|
|
35
|
-
* Upcoming Bill component block (Figma: "Full | Upcoming Bill"). Reads `due_date`,
|
|
36
|
-
* `amount` and merchant facts off `instance_slot` (V2 flat shape — no
|
|
37
|
-
* `instance_slot_data`), derives the Sun→Sat week around the due date, and renders
|
|
38
|
-
* the shared `UpcomingBillCard`.
|
|
39
|
-
*
|
|
40
|
-
* Wrapped in `createVariantBlock` from day one so an added design branch is a new
|
|
41
|
-
* registry entry, not a rewrite of dispatch logic. Today only
|
|
42
|
-
* `projected_bill_payment` is defined; an unknown variant degrades to it.
|
|
43
|
-
*
|
|
44
|
-
* Degraded-date rendering: if `due_date` is missing or doesn't parse to a valid
|
|
45
|
-
* Date (e.g. `'2026-13-40'`, `''`, an unparseable arbitrary string), the card
|
|
46
|
-
* still renders — merchant row + amount — but with a neutral current-week strip
|
|
47
|
-
* (no highlighted cell). `UpcomingBillCard` requires a 7-tuple `days` prop so we
|
|
48
|
-
* cannot omit the strip without modifying the shared component; the "no highlighted
|
|
49
|
-
* cell" fallback keeps the useful info visible without pretending today is the
|
|
50
|
-
* due day.
|
|
51
|
-
*/
|
|
52
|
-
declare const UpcomingBillBlock: ({ payload, beatGuid }: UpcomingBillBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
export default UpcomingBillBlock;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { formatCurrency as u } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
|
-
import d from "../../../components/LogoFromGuid.es.js";
|
|
3
|
-
import g from "../../../components/UpcomingBillCard.es.js";
|
|
4
|
-
import { createVariantBlock as D } from "../../createVariantBlock.es.js";
|
|
5
|
-
import { upcomingBillVariant as p } from "./layout.es.js";
|
|
6
|
-
import f from "@mui/material/Stack";
|
|
7
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
8
|
-
var s = [
|
|
9
|
-
"Sun",
|
|
10
|
-
"Mon",
|
|
11
|
-
"Tue",
|
|
12
|
-
"Wed",
|
|
13
|
-
"Thu",
|
|
14
|
-
"Fri",
|
|
15
|
-
"Sat"
|
|
16
|
-
], h = (t) => {
|
|
17
|
-
const a = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
|
|
18
|
-
if (a) {
|
|
19
|
-
const [, o, n, r] = a, i = new Date(Number(o), Number(n) - 1, Number(r));
|
|
20
|
-
return Number.isNaN(i.getTime()) ? null : i;
|
|
21
|
-
}
|
|
22
|
-
const e = new Date(t);
|
|
23
|
-
return Number.isNaN(e.getTime()) ? null : e;
|
|
24
|
-
}, v = (t) => {
|
|
25
|
-
const a = t.getDay(), e = new Date(t);
|
|
26
|
-
return e.setDate(t.getDate() - a), s.map((o, n) => {
|
|
27
|
-
const r = new Date(e);
|
|
28
|
-
r.setDate(e.getDate() + n);
|
|
29
|
-
const i = {
|
|
30
|
-
label: o,
|
|
31
|
-
date: String(r.getDate())
|
|
32
|
-
};
|
|
33
|
-
return n === a && (i.highlighted = !0), i;
|
|
34
|
-
});
|
|
35
|
-
}, y = () => {
|
|
36
|
-
const t = /* @__PURE__ */ new Date(), a = t.getDay(), e = new Date(t);
|
|
37
|
-
return e.setDate(t.getDate() - a), s.map((o, n) => {
|
|
38
|
-
const r = new Date(e);
|
|
39
|
-
return r.setDate(e.getDate() + n), {
|
|
40
|
-
label: o,
|
|
41
|
-
date: String(r.getDate())
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
}, m = ({ payload: t }) => {
|
|
45
|
-
const { instance_slot: a } = t, { amount: e, due_date: o, merchant_guid: n, merchant_name: r } = a, i = o ? h(o) : null, c = i ? v(i) : y();
|
|
46
|
-
return /* @__PURE__ */ l(f, {
|
|
47
|
-
sx: { px: 16 },
|
|
48
|
-
children: /* @__PURE__ */ l(g, {
|
|
49
|
-
amount: u(e ?? 0, "0,0.00"),
|
|
50
|
-
days: c,
|
|
51
|
-
logo: n ? /* @__PURE__ */ l(d, {
|
|
52
|
-
logo: {
|
|
53
|
-
alt: r ?? "",
|
|
54
|
-
guid: n
|
|
55
|
-
},
|
|
56
|
-
size: 24
|
|
57
|
-
}) : null,
|
|
58
|
-
merchantName: r ?? ""
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
}, P = ({ payload: t, beatGuid: a }) => {
|
|
62
|
-
const e = t.instance_slot.variant ?? void 0;
|
|
63
|
-
return /* @__PURE__ */ l(B, {
|
|
64
|
-
beatGuid: a,
|
|
65
|
-
payload: t,
|
|
66
|
-
variant: e
|
|
67
|
-
});
|
|
68
|
-
}, B = D({
|
|
69
|
-
variants: { [p.ProjectedBillPayment]: m },
|
|
70
|
-
fallback: m,
|
|
71
|
-
name: "UpcomingBillBlock"
|
|
72
|
-
});
|
|
73
|
-
export {
|
|
74
|
-
v as buildWeekStrip,
|
|
75
|
-
P as default,
|
|
76
|
-
h as parseDueDate
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=UpcomingBillBlock.es.js.map
|
package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpcomingBillBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport type { InsightsPayload } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport UpcomingBillCard, { type UpcomingBillDay } from '../../../components/UpcomingBillCard'\nimport { createVariantBlock } from '../../createVariantBlock'\n\nimport { upcomingBillVariant } from './layout'\n\ninterface UpcomingBillBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst DAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] as const\ntype SevenDays = [\n UpcomingBillDay,\n UpcomingBillDay,\n UpcomingBillDay,\n UpcomingBillDay,\n UpcomingBillDay,\n UpcomingBillDay,\n UpcomingBillDay,\n]\n\n/**\n * Parse an ISO `YYYY-MM-DD` into a local-time Date, dodging the UTC-midnight parse\n * that `new Date('2025-10-30')` performs (which drifts a day in negative offsets).\n * Any other string shape (full ISO datetime) falls through to the native parser.\n *\n * Returns `null` for anything that doesn't resolve to a valid Date — including a\n * `YYYY-MM-DD`-shaped string whose year/month/day segments produce `Invalid Date`\n * (e.g. `'2026-13-40'`) and arbitrary strings the native parser rejects. Callers\n * must handle `null` so a bad backend value cannot propagate `NaN` into the UI\n * via `getDay()` and render `NaN` day numbers.\n */\nexport const parseDueDate = (iso: string): Date | null => {\n const dateOnly = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso)\n if (dateOnly) {\n const [, y, m, d] = dateOnly\n const parsed = new Date(Number(y), Number(m) - 1, Number(d))\n return Number.isNaN(parsed.getTime()) ? null : parsed\n }\n const parsed = new Date(iso)\n return Number.isNaN(parsed.getTime()) ? null : parsed\n}\n\n/**\n * Build the Sun→Sat week around a due date with the due day marked `highlighted`.\n * Column index is the local day-of-week (0=Sun..6=Sat) so the strip always lines up\n * under the weekday labels regardless of which weekday the bill lands on.\n */\nexport const buildWeekStrip = (dueDate: Date): SevenDays => {\n const dow = dueDate.getDay()\n const sunday = new Date(dueDate)\n sunday.setDate(dueDate.getDate() - dow)\n\n const days = DAY_LABELS.map((label, idx): UpcomingBillDay => {\n const cell = new Date(sunday)\n cell.setDate(sunday.getDate() + idx)\n const day: UpcomingBillDay = { label, date: String(cell.getDate()) }\n if (idx === dow) day.highlighted = true\n return day\n })\n\n return days as unknown as SevenDays\n}\n\n/**\n * Build the current Sun→Sat week with NO cell highlighted. Used as the degraded\n * strip when `due_date` is missing or unparseable — the card still renders\n * (merchant row with name + amount) but the strip has no \"due day\" callout.\n */\nconst buildUnhighlightedCurrentWeek = (): SevenDays => {\n const base = new Date()\n const dow = base.getDay()\n const sunday = new Date(base)\n sunday.setDate(base.getDate() - dow)\n\n const days = DAY_LABELS.map((label, idx): UpcomingBillDay => {\n const cell = new Date(sunday)\n cell.setDate(sunday.getDate() + idx)\n return { label, date: String(cell.getDate()) }\n })\n\n return days as unknown as SevenDays\n}\n\nconst ProjectedBillPaymentVariant = ({ payload }: UpcomingBillBlockProps) => {\n const { instance_slot } = payload\n const { amount, due_date, merchant_guid, merchant_name } = instance_slot\n\n // Both missing and malformed `due_date` degrade to the same \"no highlighted cell\" case —\n // we never want to silently show today's week as if it were due today. UpcomingBillCard\n // requires a 7-tuple, so we still render a neutral current-week strip so the merchant row\n // (name + amount) stays visible. Returning null would hide the whole insight for just a\n // bad date, which costs the user more information than it saves.\n const parsed = due_date ? parseDueDate(due_date) : null\n const days = parsed ? buildWeekStrip(parsed) : buildUnhighlightedCurrentWeek()\n\n return (\n <Stack sx={{ px: 16 }}>\n <UpcomingBillCard\n amount={formatCurrency(amount ?? 0, '0,0.00')}\n days={days}\n logo={\n merchant_guid ? (\n <LogoFromGuid logo={{ alt: merchant_name ?? '', guid: merchant_guid }} size={24} />\n ) : null\n }\n merchantName={merchant_name ?? ''}\n />\n </Stack>\n )\n}\n\n/**\n * Upcoming Bill component block (Figma: \"Full | Upcoming Bill\"). Reads `due_date`,\n * `amount` and merchant facts off `instance_slot` (V2 flat shape — no\n * `instance_slot_data`), derives the Sun→Sat week around the due date, and renders\n * the shared `UpcomingBillCard`.\n *\n * Wrapped in `createVariantBlock` from day one so an added design branch is a new\n * registry entry, not a rewrite of dispatch logic. Today only\n * `projected_bill_payment` is defined; an unknown variant degrades to it.\n *\n * Degraded-date rendering: if `due_date` is missing or doesn't parse to a valid\n * Date (e.g. `'2026-13-40'`, `''`, an unparseable arbitrary string), the card\n * still renders — merchant row + amount — but with a neutral current-week strip\n * (no highlighted cell). `UpcomingBillCard` requires a 7-tuple `days` prop so we\n * cannot omit the strip without modifying the shared component; the \"no highlighted\n * cell\" fallback keeps the useful info visible without pretending today is the\n * due day.\n */\nconst UpcomingBillBlock = ({ payload, beatGuid }: UpcomingBillBlockProps) => {\n const variant = payload.instance_slot.variant ?? undefined\n return <Variants beatGuid={beatGuid} payload={payload} variant={variant} />\n}\n\nconst Variants = createVariantBlock<UpcomingBillBlockProps>({\n variants: {\n [upcomingBillVariant.ProjectedBillPayment]: ProjectedBillPaymentVariant,\n },\n fallback: ProjectedBillPaymentVariant,\n name: 'UpcomingBillBlock',\n})\n\nexport default UpcomingBillBlock\n"],"mappings":";;;;;;;AAgBA,IAAM,IAAa;AAAA,EAAC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAK,GAsBtD,IAAA,CAAgB,MAA6B;AACxD,QAAM,IAAW,4BAA4B,KAAK,CAAG;AACrD,MAAI,GAAU;AACZ,UAAM,CAAA,EAAG,GAAG,GAAG,CAAA,IAAK,GACd,IAAS,IAAI,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;AAC3D,WAAO,OAAO,MAAM,EAAO,QAAQ,CAAC,IAAI,OAAO;AAAA,EACjD;AACA,QAAM,IAAS,IAAI,KAAK,CAAG;AAC3B,SAAO,OAAO,MAAM,EAAO,QAAQ,CAAC,IAAI,OAAO;AACjD,GAOa,IAAA,CAAkB,MAA6B;AAC1D,QAAM,IAAM,EAAQ,OAAO,GACrB,IAAS,IAAI,KAAK,CAAO;AAC/B,SAAA,EAAO,QAAQ,EAAQ,QAAQ,IAAI,CAAG,GAEzB,EAAW,IAAA,CAAK,GAAO,MAAyB;AAC3D,UAAM,IAAO,IAAI,KAAK,CAAM;AAC5B,IAAA,EAAK,QAAQ,EAAO,QAAQ,IAAI,CAAG;AACnC,UAAM,IAAuB;AAAA,MAAE,OAAA;AAAA,MAAO,MAAM,OAAO,EAAK,QAAQ,CAAC;AAAA,IAAE;AACnE,WAAI,MAAQ,MAAK,EAAI,cAAc,KAC5B;AAAA,EACT,CAEO;AACT,GAOM,IAAA,MAAiD;AACrD,QAAM,IAAO,oBAAI,KAAK,GAChB,IAAM,EAAK,OAAO,GAClB,IAAS,IAAI,KAAK,CAAI;AAC5B,SAAA,EAAO,QAAQ,EAAK,QAAQ,IAAI,CAAG,GAEtB,EAAW,IAAA,CAAK,GAAO,MAAyB;AAC3D,UAAM,IAAO,IAAI,KAAK,CAAM;AAC5B,WAAA,EAAK,QAAQ,EAAO,QAAQ,IAAI,CAAG,GAC5B;AAAA,MAAE,OAAA;AAAA,MAAO,MAAM,OAAO,EAAK,QAAQ,CAAC;AAAA,IAAE;AAAA,EAC/C,CAEO;AACT,GAEM,IAAA,CAA+B,EAAE,SAAA,EAAA,MAAsC;AAC3E,QAAM,EAAE,eAAA,EAAA,IAAkB,GACpB,EAAE,QAAA,GAAQ,UAAA,GAAU,eAAA,GAAe,eAAA,EAAA,IAAkB,GAOrD,IAAS,IAAW,EAAa,CAAQ,IAAI,MAC7C,IAAO,IAAS,EAAe,CAAM,IAAI,EAA8B;AAE7E,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,EAAe,KAAU,GAAG,QAAQ;AAAA,MACtC,MAAA;AAAA,MACN,MACE,IACE,gBAAA,EAAC,GAAD;AAAA,QAAc,MAAM;AAAA,UAAE,KAAK,KAAiB;AAAA,UAAI,MAAM;AAAA,QAAc;AAAA,QAAG,MAAM;AAAA,MAAK,CAAA,IAChF;AAAA,MAEN,cAAc,KAAiB;AAAA,IAChC,CAAA;AAAA,EACI,CAAA;AAEX,GAoBM,IAAA,CAAqB,EAAE,SAAA,GAAS,UAAA,EAAA,MAAuC;AAC3E,QAAM,IAAU,EAAQ,cAAc,WAAW;AACjD,SAAO,gBAAA,EAAC,GAAD;AAAA,IAAoB,UAAA;AAAA,IAAmB,SAAA;AAAA,IAAkB,SAAA;AAAA,EAAU,CAAA;AAC5E,GAEM,IAAW,EAA2C;AAAA,EAC1D,UAAU,EAAA,CACP,EAAoB,oBAAA,GAAuB,EAC9C;AAAA,EACA,UAAU;AAAA,EACV,MAAM;AACR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as UpcomingBillBlock } from './UpcomingBillBlock';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Design branches of the Upcoming Bill component block.
|
|
3
|
-
*
|
|
4
|
-
* - `ProjectedBillPayment` — the only variant today (Figma: "Full | Upcoming Bill"):
|
|
5
|
-
* week strip + merchant row + amount.
|
|
6
|
-
*
|
|
7
|
-
* Scaffolded through `createVariantBlock` so adding a future design branch is a new
|
|
8
|
-
* registry entry rather than editing dispatch logic.
|
|
9
|
-
*/
|
|
10
|
-
export declare const upcomingBillVariant: {
|
|
11
|
-
readonly ProjectedBillPayment: "projected_bill_payment";
|
|
12
|
-
};
|
|
13
|
-
export type UpcomingBillVariant = (typeof upcomingBillVariant)[keyof typeof upcomingBillVariant];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/layout.ts"],"sourcesContent":["/**\n * Design branches of the Upcoming Bill component block.\n *\n * - `ProjectedBillPayment` — the only variant today (Figma: \"Full | Upcoming Bill\"):\n * week strip + merchant row + amount.\n *\n * Scaffolded through `createVariantBlock` so adding a future design branch is a new\n * registry entry rather than editing dispatch logic.\n */\nexport const upcomingBillVariant = {\n ProjectedBillPayment: 'projected_bill_payment',\n} as const\n\nexport type UpcomingBillVariant = (typeof upcomingBillVariant)[keyof typeof upcomingBillVariant]\n"],"mappings":"AASA,IAAa,IAAsB,EACjC,sBAAsB,yBACxB"}
|