@mx-cartographer/experiences 9.6.0 → 9.6.2
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 +18 -0
- package/dist/common/components/ConnectDrawer.es.js +17 -44
- package/dist/common/components/ConnectDrawer.es.js.map +1 -1
- package/dist/common/components/ConnectWidgetPanel.d.ts +8 -0
- package/dist/common/components/ConnectWidgetPanel.es.js +44 -0
- package/dist/common/components/ConnectWidgetPanel.es.js.map +1 -0
- package/dist/common/components/dialog/Dialog.d.ts +2 -0
- package/dist/common/components/dialog/Dialog.es.js +30 -30
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/common/components/index.d.ts +1 -0
- package/dist/common/index.es.js +67 -65
- package/dist/core/types/InsightsInstanceSlotData.d.ts +0 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +87 -0
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +19 -19
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.d.ts +21 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js +16 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js +25 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.d.ts +17 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js +39 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.d.ts +16 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +47 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -0
- package/dist/insights-v2/beatActions.d.ts +2 -2
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.d.ts +2 -4
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +24 -33
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.d.ts +36 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js +40 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.d.ts +8 -18
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +43 -42
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/index.d.ts +2 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +30 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +29 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/resolveVariantConfig.d.ts +10 -0
- package/dist/insights-v2/blocks/resolveVariantConfig.es.js +6 -0
- package/dist/insights-v2/blocks/resolveVariantConfig.es.js.map +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +14 -14
- package/dist/insights-v2/components/ConnectionDetailDrillDown.d.ts +32 -0
- package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js +148 -0
- package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js.map +1 -0
- package/dist/insights-v2/components/FeedbackDialog.d.ts +3 -1
- package/dist/insights-v2/components/FeedbackDialog.es.js +80 -72
- package/dist/insights-v2/components/FeedbackDialog.es.js.map +1 -1
- package/dist/insights-v2/components/FeedbackModal.d.ts +60 -0
- package/dist/insights-v2/components/FeedbackModal.es.js +61 -0
- package/dist/insights-v2/components/FeedbackModal.es.js.map +1 -0
- package/dist/insights-v2/components/SurveyModal.d.ts +65 -0
- package/dist/insights-v2/components/SurveyModal.es.js +138 -0
- package/dist/insights-v2/components/SurveyModal.es.js.map +1 -0
- package/dist/insights-v2/components/celebrationGradients.d.ts +19 -7
- package/dist/insights-v2/components/celebrationGradients.es.js +7 -4
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +28 -0
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +19 -0
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -0
- package/dist/insights-v2/index.d.ts +4 -0
- package/dist/insights-v2/index.es.js +78 -69
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +4 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +4 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +79 -56
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ACCOUNT_CONNECTED_GRADIENT as r, getPrimaryWashGradient as e } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var o = {
|
|
3
|
+
AccountConnect: "account_connect",
|
|
4
|
+
AccountConnected: "account_connected",
|
|
5
|
+
SwitchDirectDeposit: "switch_direct_deposit"
|
|
6
|
+
}, a = (t) => ({
|
|
7
|
+
[o.AccountConnect]: {
|
|
8
|
+
backgroundImage: e(t),
|
|
9
|
+
bgcolor: "background.paper",
|
|
10
|
+
badgeBgColor: "text.secondary",
|
|
11
|
+
badgeIcon: "link",
|
|
12
|
+
badgeIconColor: "primary.contrastText",
|
|
13
|
+
dotColor: "text.secondary",
|
|
14
|
+
hasBigDots: !0
|
|
15
|
+
},
|
|
16
|
+
[o.AccountConnected]: {
|
|
17
|
+
backgroundImage: r,
|
|
18
|
+
bgcolor: "background.paper",
|
|
19
|
+
badgeBgColor: "success.main",
|
|
20
|
+
badgeIcon: "check",
|
|
21
|
+
badgeIconColor: "common.white",
|
|
22
|
+
dotColor: "text.secondary",
|
|
23
|
+
hasBigDots: !0,
|
|
24
|
+
showConfetti: !0
|
|
25
|
+
},
|
|
26
|
+
[o.SwitchDirectDeposit]: {
|
|
27
|
+
bgcolor: "primary.lighter",
|
|
28
|
+
badgeBgColor: "neutral.darker",
|
|
29
|
+
badgeIcon: "arrow_forward",
|
|
30
|
+
badgeIconColor: "neutral.lighter",
|
|
31
|
+
dotColor: "neutral.darker",
|
|
32
|
+
hasBigDots: !1
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
o as accountSwitchVariant,
|
|
37
|
+
a as getLayoutConfig
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n ACCOUNT_CONNECTED_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Account Switch block variants, keyed by the backend `instance_slot.variant`. All share\n * `TransferLogoCard`; only the slot surface, center badge and connector dots differ.\n *\n * - `AccountConnect` — Discovered Accounts pending: blue gradient, link badge.\n * - `AccountConnected` — Discovered Accounts success: pink wash, confetti, check badge.\n * - `SwitchDirectDeposit` — Switch Direct Deposit pending: flat tinted slot, arrow badge.\n * Its complete state is a different layout, served by `direct_deposit_block`.\n */\nexport const accountSwitchVariant = {\n AccountConnect: 'account_connect',\n AccountConnected: 'account_connected',\n SwitchDirectDeposit: 'switch_direct_deposit',\n} as const\n\nexport type AccountSwitchVariant = (typeof accountSwitchVariant)[keyof typeof accountSwitchVariant]\n\nexport interface AccountSwitchLayoutConfig {\n /** Slot surface color token. */\n bgcolor: string\n /** Optional gradient layered over `bgcolor`. */\n backgroundImage?: string\n /** Center badge background color token. */\n badgeBgColor: string\n /** mx-icons glyph rendered in the center badge. */\n badgeIcon: string\n /** Color token for the badge glyph. */\n badgeIconColor: string\n /** Connector-dot color token. */\n dotColor: string\n /** Enlarge the inner connector dots (6px vs 4px). */\n hasBigDots: boolean\n /** Confetti burst filling the slot (success states). */\n showConfetti?: boolean\n}\n\n/** Per-variant `TransferLogoCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<AccountSwitchVariant, AccountSwitchLayoutConfig> => {\n return {\n [accountSwitchVariant.AccountConnect]: {\n backgroundImage: getPrimaryWashGradient(theme),\n bgcolor: 'background.paper',\n badgeBgColor: 'text.secondary',\n badgeIcon: 'link',\n badgeIconColor: 'primary.contrastText',\n dotColor: 'text.secondary',\n hasBigDots: true,\n },\n [accountSwitchVariant.AccountConnected]: {\n backgroundImage: ACCOUNT_CONNECTED_GRADIENT,\n bgcolor: 'background.paper',\n badgeBgColor: 'success.main',\n // Figma \"Common/Check\": a bare check on the solid success badge (not `check_circle`).\n badgeIcon: 'check',\n badgeIconColor: 'common.white',\n dotColor: 'text.secondary',\n hasBigDots: true,\n showConfetti: true,\n },\n [accountSwitchVariant.SwitchDirectDeposit]: {\n bgcolor: 'primary.lighter',\n badgeBgColor: 'neutral.darker',\n badgeIcon: 'arrow_forward',\n badgeIconColor: 'neutral.lighter',\n dotColor: 'neutral.darker',\n hasBigDots: false,\n },\n }\n}\n"],"mappings":";AAgBA,IAAa,IAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,qBAAqB;AACvB,GAwBa,IAAA,CACX,OAEO;AAAA,EACJ,CAAA,EAAqB,cAAA,GAAiB;AAAA,IACrC,iBAAiB,EAAuB,CAAK;AAAA,IAC7C,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACC,CAAA,EAAqB,gBAAA,GAAmB;AAAA,IACvC,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,cAAc;AAAA,IAEd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACC,CAAA,EAAqB,mBAAA,GAAsB;AAAA,IAC1C,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF"}
|
|
@@ -4,28 +4,18 @@ interface TransactionBlockProps {
|
|
|
4
4
|
beatGuid?: string;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
export declare const TransactionBlockVariant: {
|
|
12
|
-
readonly WithHeader: "with_header";
|
|
13
|
-
readonly NoHeader: "no_header";
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The `transaction_block` (ditto `blocks.name` for LargeTransactionV2).
|
|
17
|
-
*
|
|
18
|
-
* Renders rows the backend already localized and carried inline on `instance_slot.data.series`
|
|
19
|
-
* (`logo`, `primary_text`, `secondary_text`, `amount`). Only the amount is formatted here,
|
|
20
|
-
* because the contract sends it as a number.
|
|
7
|
+
* The `transaction_block`: rows the backend already localized, carried inline on
|
|
8
|
+
* `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the
|
|
9
|
+
* amount is formatted here, because the contract sends it as a number. `instance_slot.variant`
|
|
10
|
+
* picks the header and slot treatment from `./layout.ts`.
|
|
21
11
|
*
|
|
22
12
|
* This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo
|
|
23
13
|
* alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.
|
|
24
14
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* card a row's `secondary_text` is the category, so reading it here
|
|
28
|
-
* and dropped the date entirely.
|
|
15
|
+
* A header, when the variant shows one, comes from `instance_slot.data.header_text` (the
|
|
16
|
+
* transaction date, or "{count} transactions"). It deliberately does *not* come from the first
|
|
17
|
+
* row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here
|
|
18
|
+
* rendered the category twice and dropped the date entirely.
|
|
29
19
|
*/
|
|
30
20
|
export declare const TransactionBlock: (({ payload }: TransactionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
31
21
|
displayName: string;
|
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
1
|
+
import { useCategoryStore as p } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { slot as c } from "../../../../core/types/Insights.es.js";
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { logoFromRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const t =
|
|
3
|
+
import { formatCurrency as _ } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { logoFromRef as y } from "../../../components/shared/EntityLogo.es.js";
|
|
5
|
+
import { resolveVariantConfig as h } from "../../resolveVariantConfig.es.js";
|
|
6
|
+
import x from "../../../components/TransactionListCard.es.js";
|
|
7
|
+
import { getLayoutConfig as v, transactionBlockVariant as C } from "./layout.es.js";
|
|
8
|
+
import { observer as I } from "mobx-react-lite";
|
|
9
|
+
import { CategoryIcon as G, InstitutionLogo as L, MerchantLogo as O } from "@mxenabled/mxui";
|
|
10
|
+
import { Icon as T } from "@mxenabled/mx-icons";
|
|
11
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
12
|
+
import { useTheme as b } from "@mui/material/styles";
|
|
13
|
+
import u from "@mui/material/Box";
|
|
14
|
+
var r = 32, k = Math.round(r * 0.625), z = (n, a) => {
|
|
15
|
+
const t = y(n.logo, n.primary_text);
|
|
16
16
|
if (t) {
|
|
17
|
-
if (t.logo_name) return /* @__PURE__ */
|
|
17
|
+
if (t.logo_name) return /* @__PURE__ */ o(u, {
|
|
18
18
|
sx: {
|
|
19
19
|
alignItems: "center",
|
|
20
20
|
display: "flex",
|
|
21
|
-
height:
|
|
21
|
+
height: r,
|
|
22
22
|
justifyContent: "center",
|
|
23
|
-
width:
|
|
23
|
+
width: r
|
|
24
24
|
},
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ o(T, {
|
|
26
26
|
name: t.logo_name,
|
|
27
|
-
size:
|
|
27
|
+
size: k,
|
|
28
28
|
sx: { color: t.logo_color }
|
|
29
29
|
})
|
|
30
30
|
});
|
|
31
|
-
if (t.merchant_guid) return /* @__PURE__ */
|
|
31
|
+
if (t.merchant_guid) return /* @__PURE__ */ o(O, {
|
|
32
32
|
alt: t.merchant_name ?? "",
|
|
33
|
-
categoryGuid: t.category_guid ?
|
|
33
|
+
categoryGuid: t.category_guid ? a(t.category_guid) : "",
|
|
34
34
|
merchantGuid: t.merchant_guid,
|
|
35
|
-
size:
|
|
35
|
+
size: r
|
|
36
36
|
});
|
|
37
|
-
if (t.institution_guid) return /* @__PURE__ */
|
|
37
|
+
if (t.institution_guid) return /* @__PURE__ */ o(L, {
|
|
38
38
|
alt: t.institution_name ?? "",
|
|
39
39
|
institutionGuid: t.institution_guid,
|
|
40
|
-
size:
|
|
40
|
+
size: r
|
|
41
41
|
});
|
|
42
42
|
if (t.category_guid) {
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
"data-testid": `category-icon-${
|
|
43
|
+
const e = a(t.category_guid);
|
|
44
|
+
return /* @__PURE__ */ o(u, {
|
|
45
|
+
"data-testid": `category-icon-${e}`,
|
|
46
46
|
sx: { display: "flex" },
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
categoryGuid:
|
|
49
|
-
size:
|
|
47
|
+
children: /* @__PURE__ */ o(G, {
|
|
48
|
+
categoryGuid: e,
|
|
49
|
+
size: r
|
|
50
50
|
})
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
},
|
|
55
|
-
const { getTopLevelCategoryGuid:
|
|
54
|
+
}, F = I(({ payload: n }) => {
|
|
55
|
+
const a = b(), { getTopLevelCategoryGuid: t } = p(), { data: e, variant: d } = n.instance_slot, s = c(e, "series"), m = c(e, "header_text");
|
|
56
56
|
if (!Array.isArray(s) || !s.length) return null;
|
|
57
|
-
const
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
const { background: g, cardVariant: l, showHeader: f } = h(v(a), d, C.NoHeader, "TransactionBlock");
|
|
58
|
+
return /* @__PURE__ */ o(x, {
|
|
59
|
+
background: g,
|
|
60
|
+
header: f && typeof m == "string" ? m : void 0,
|
|
61
|
+
variant: l,
|
|
62
|
+
rows: s.map((i) => ({
|
|
63
|
+
amount: typeof i.amount == "number" ? _(i.amount, "0,0.00") : "",
|
|
64
|
+
leading: z(i, t),
|
|
65
|
+
subtitle: i.secondary_text ?? "",
|
|
66
|
+
title: i.primary_text ?? ""
|
|
65
67
|
}))
|
|
66
68
|
});
|
|
67
69
|
});
|
|
68
70
|
export {
|
|
69
|
-
|
|
70
|
-
I as TransactionBlockVariant
|
|
71
|
+
F as TransactionBlock
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
//# sourceMappingURL=TransactionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\
|
|
1
|
+
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const { data, variant } = payload.instance_slot\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const { background, cardVariant, showHeader } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n return (\n <TransactionListCard\n background={background}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;AAwBA,IAAM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAahD,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAK;AAAA,QA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;AAAA,IAMvE,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,SAAS,EAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { TransactionBlock
|
|
1
|
+
export { TransactionBlock } from './TransactionBlock';
|
|
2
|
+
export { transactionBlockVariant } from './layout';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
|
+
/**
|
|
3
|
+
* Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same
|
|
4
|
+
* pre-localized rows through `TransactionListCard`; only the header and the slot differ.
|
|
5
|
+
*
|
|
6
|
+
* - `WithHeader` — row under a date header (Fee Detected, Large Transaction).
|
|
7
|
+
* - `NoHeader` — the row alone (Large Transaction without a merchant).
|
|
8
|
+
* - `UncategorizedTransaction` — filled primary header ("{count} transactions").
|
|
9
|
+
* - `SubscriptionDetected` — borderless row on the blue slot wash.
|
|
10
|
+
* - `UnexpectedSubscriptionPayment` — borderless row on the warning slot wash. Its flag badge and
|
|
11
|
+
* subscribed / not-subscribed status row are not drawn yet.
|
|
12
|
+
*/
|
|
13
|
+
export declare const transactionBlockVariant: {
|
|
14
|
+
readonly WithHeader: "with_header";
|
|
15
|
+
readonly NoHeader: "no_header";
|
|
16
|
+
readonly UncategorizedTransaction: "uncategorized_transaction";
|
|
17
|
+
readonly SubscriptionDetected: "subscription_detected";
|
|
18
|
+
readonly UnexpectedSubscriptionPayment: "unexpected_subscription_payment";
|
|
19
|
+
};
|
|
20
|
+
export type TransactionBlockVariant = (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant];
|
|
21
|
+
export interface TransactionLayoutConfig {
|
|
22
|
+
/** Show `instance_slot.data.header_text` above the rows. */
|
|
23
|
+
showHeader: boolean;
|
|
24
|
+
/** `TransactionListCard` style: grey utility header, or filled primary header. */
|
|
25
|
+
cardVariant?: 'default' | 'primary';
|
|
26
|
+
/** CSS background for the slot behind the card; the card then renders borderless on paper. */
|
|
27
|
+
background?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Per-variant `TransactionListCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */
|
|
30
|
+
export declare const getLayoutConfig: (theme: Theme) => Record<TransactionBlockVariant, TransactionLayoutConfig>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { WARNING_WASH_GRADIENT as r, getPrimaryWashGradient as t } from "../../../components/celebrationGradients.es.js";
|
|
2
|
+
var e = {
|
|
3
|
+
WithHeader: "with_header",
|
|
4
|
+
NoHeader: "no_header",
|
|
5
|
+
UncategorizedTransaction: "uncategorized_transaction",
|
|
6
|
+
SubscriptionDetected: "subscription_detected",
|
|
7
|
+
UnexpectedSubscriptionPayment: "unexpected_subscription_payment"
|
|
8
|
+
}, i = (a) => ({
|
|
9
|
+
[e.WithHeader]: { showHeader: !0 },
|
|
10
|
+
[e.NoHeader]: { showHeader: !1 },
|
|
11
|
+
[e.UncategorizedTransaction]: {
|
|
12
|
+
showHeader: !0,
|
|
13
|
+
cardVariant: "primary"
|
|
14
|
+
},
|
|
15
|
+
[e.SubscriptionDetected]: {
|
|
16
|
+
showHeader: !1,
|
|
17
|
+
background: t(a)
|
|
18
|
+
},
|
|
19
|
+
[e.UnexpectedSubscriptionPayment]: {
|
|
20
|
+
showHeader: !1,
|
|
21
|
+
background: r
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
i as getLayoutConfig,
|
|
26
|
+
e as transactionBlockVariant
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `SubscriptionDetected` — borderless row on the blue slot wash.\n * - `UnexpectedSubscriptionPayment` — borderless row on the warning slot wash. Its flag badge and\n * subscribed / not-subscribed status row are not drawn yet.\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n SubscriptionDetected: 'subscription_detected',\n UnexpectedSubscriptionPayment: 'unexpected_subscription_payment',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.SubscriptionDetected]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n },\n [transactionBlockVariant.UnexpectedSubscriptionPayment]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n})\n"],"mappings":";AAkBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,sBAAsB;AAAA,EACtB,+BAA+B;AACjC,GAea,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,oBAAA,GAAuB;AAAA,IAC9C,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,EAC1C;AAAA,EACC,CAAA,EAAwB,6BAAA,GAAgC;AAAA,IACvD,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picks a block's per-variant config from its `layout.ts` table by the backend
|
|
3
|
+
* `instance_slot.variant`, falling back to `fallback` for anything the table does not own.
|
|
4
|
+
*
|
|
5
|
+
* `Object.hasOwn` rather than a bare index: the key is backend-controlled, and an inherited
|
|
6
|
+
* name like `constructor` would otherwise return a truthy non-config that `??` lets through.
|
|
7
|
+
* Unknown variants warn, like `createVariantBlock`, so a backend typo or a new server variant
|
|
8
|
+
* is visible instead of silently degrading.
|
|
9
|
+
*/
|
|
10
|
+
export declare const resolveVariantConfig: <K extends string, C>(table: Record<K, C>, variant: string | null | undefined, fallback: K, blockName: string) => C;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var u = (o, n, r, e) => n != null && Object.hasOwn(o, n) ? o[n] : (n != null && console.warn(`[${e}] Unknown variant "${n}" — rendering "${r}". Add it to layout.ts.`), o[r]);
|
|
2
|
+
export {
|
|
3
|
+
u as resolveVariantConfig
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=resolveVariantConfig.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveVariantConfig.es.js","names":[],"sources":["../../../src/insights-v2/blocks/resolveVariantConfig.ts"],"sourcesContent":["/**\n * Picks a block's per-variant config from its `layout.ts` table by the backend\n * `instance_slot.variant`, falling back to `fallback` for anything the table does not own.\n *\n * `Object.hasOwn` rather than a bare index: the key is backend-controlled, and an inherited\n * name like `constructor` would otherwise return a truthy non-config that `??` lets through.\n * Unknown variants warn, like `createVariantBlock`, so a backend typo or a new server variant\n * is visible instead of silently degrading.\n */\nexport const resolveVariantConfig = <K extends string, C>(\n table: Record<K, C>,\n variant: string | null | undefined,\n fallback: K,\n blockName: string,\n): C => {\n if (variant != null && Object.hasOwn(table, variant)) return table[variant as K]\n\n if (variant != null) {\n console.warn(\n `[${blockName}] Unknown variant \"${variant}\" — rendering \"${fallback}\". Add it to layout.ts.`,\n )\n }\n\n return table[fallback]\n}\n"],"mappings":"AASA,IAAa,IAAA,CACX,GACA,GACA,GACA,MAEI,KAAW,QAAQ,OAAO,OAAO,GAAO,CAAO,IAAU,EAAM,CAAA,KAE/D,KAAW,QACb,QAAQ,KACN,IAAI,CAAA,sBAA+B,CAAA,kBAAyB,CAAA,yBAC9D,GAGK,EAAM,CAAA"}
|
|
@@ -3,13 +3,13 @@ import { BeatActionsProvider as R } from "../beatActions.es.js";
|
|
|
3
3
|
import { isContactSupportCtaDisabled as H } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
4
4
|
import { logoFromRef as M } from "./shared/EntityLogo.es.js";
|
|
5
5
|
import { actionBlocksKey as P } from "../mappings/actionBlocksKey.es.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import G from "
|
|
10
|
-
import K from "./
|
|
11
|
-
import
|
|
12
|
-
import V from "./
|
|
6
|
+
import U from "./FeedbackDialog.es.js";
|
|
7
|
+
import { ErrorCard as j } from "./ErrorCard.es.js";
|
|
8
|
+
import { useBeatCtaActions as z } from "../ctaActions/useCtaAction.es.js";
|
|
9
|
+
import { blocks as G } from "../mappings/blocks.es.js";
|
|
10
|
+
import K from "./Footer.es.js";
|
|
11
|
+
import X from "./Header.es.js";
|
|
12
|
+
import { FeedbackBar as V } from "./FeedbackBar.es.js";
|
|
13
13
|
import { DismissInsightDialog as W } from "./DismissInsightDialog.es.js";
|
|
14
14
|
import { HiddenConfirmationCard as Y } from "./HiddenConfirmationCard.es.js";
|
|
15
15
|
import { LoadingCard as q } from "./LoadingCard.es.js";
|
|
@@ -42,8 +42,8 @@ var so = {}, no = {
|
|
|
42
42
|
px: 2,
|
|
43
43
|
textTransform: "none"
|
|
44
44
|
}, Ro = $(({ beat: t, beatActions: s = so, obsolete: c, isLoading: x = !1, isError: _ = !1 }) => {
|
|
45
|
-
const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } =
|
|
46
|
-
if (_) return /* @__PURE__ */ i(
|
|
45
|
+
const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } = z(t, s, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta);
|
|
46
|
+
if (_) return /* @__PURE__ */ i(j, {});
|
|
47
47
|
const e = t.insights_payload;
|
|
48
48
|
if (!e || o.cardState === "dismissed") return null;
|
|
49
49
|
const { instance_slot: B, primary_cta: r, secondary_cta: n, sub_title: O, title: D, widget_type: L, guid: I, dismissed_at: F } = e, { block: A } = B, w = O ?? (e.subtitle ? {
|
|
@@ -57,7 +57,7 @@ var so = {}, no = {
|
|
|
57
57
|
}
|
|
58
58
|
await T(f, u);
|
|
59
59
|
}
|
|
60
|
-
}, k =
|
|
60
|
+
}, k = G[A], d = L === "mini", m = v.insights_feed?.general, p = c?.state === "not_refreshable" && !F && !!m;
|
|
61
61
|
return /* @__PURE__ */ i(R, {
|
|
62
62
|
value: o.wrappedActions,
|
|
63
63
|
children: /* @__PURE__ */ a(b, {
|
|
@@ -79,7 +79,7 @@ var so = {}, no = {
|
|
|
79
79
|
} },
|
|
80
80
|
children: [
|
|
81
81
|
p && /* @__PURE__ */ i(ro, { sx: no }),
|
|
82
|
-
/* @__PURE__ */ i(
|
|
82
|
+
/* @__PURE__ */ i(X, {
|
|
83
83
|
isMini: d,
|
|
84
84
|
subtitle: w,
|
|
85
85
|
title: D ?? ""
|
|
@@ -136,7 +136,7 @@ var so = {}, no = {
|
|
|
136
136
|
children: n.label
|
|
137
137
|
})]
|
|
138
138
|
}),
|
|
139
|
-
/* @__PURE__ */ i(
|
|
139
|
+
/* @__PURE__ */ i(V, {
|
|
140
140
|
onTellUsMore: o.openRatingSurvey,
|
|
141
141
|
show: o.isFeedbackBarShown
|
|
142
142
|
})
|
|
@@ -148,7 +148,7 @@ var so = {}, no = {
|
|
|
148
148
|
onClose: o.closeDismissDialog,
|
|
149
149
|
onDismiss: o.confirmDismiss
|
|
150
150
|
}),
|
|
151
|
-
o.isSurveyOpen && /* @__PURE__ */ i(
|
|
151
|
+
o.isSurveyOpen && /* @__PURE__ */ i(U, {
|
|
152
152
|
characterLimitLabel: o.survey.characterLimitLabel,
|
|
153
153
|
closeAriaLabel: o.survey.closeAriaLabel,
|
|
154
154
|
isOpen: !0,
|
|
@@ -161,7 +161,7 @@ var so = {}, no = {
|
|
|
161
161
|
secondaryText: o.survey.backText,
|
|
162
162
|
title: o.survey.title
|
|
163
163
|
}),
|
|
164
|
-
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(
|
|
164
|
+
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(K, { footer: e.footer })
|
|
165
165
|
]
|
|
166
166
|
})
|
|
167
167
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ConnectionDetailItem {
|
|
2
|
+
content: string;
|
|
3
|
+
icon_name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
}
|
|
6
|
+
/** Resolved strings the drilldown renders (see ConnectionDetailActionBlock). */
|
|
7
|
+
export interface ConnectionDetailContent {
|
|
8
|
+
aria_label_thumbs_down: string;
|
|
9
|
+
aria_label_thumbs_up: string;
|
|
10
|
+
benefits: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
footer_title: string;
|
|
13
|
+
header_text: string;
|
|
14
|
+
shared_info_description: string;
|
|
15
|
+
shared_info_header_text: string;
|
|
16
|
+
shared_info_items: ConnectionDetailItem[];
|
|
17
|
+
}
|
|
18
|
+
interface ConnectionDetailDrillDownProps {
|
|
19
|
+
copy: ConnectionDetailContent;
|
|
20
|
+
/** Thumbs response — `'yes'` (up) / `'no'` (down). */
|
|
21
|
+
onRespond?: (response: 'yes' | 'no') => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Insights-v2 copy of the V1 `insights/components/shared/ConnectionDetailDrillDown`:
|
|
25
|
+
* the connection-details education panel (benefits, shared-info cards, and a
|
|
26
|
+
* thumbs was-this-helpful footer).
|
|
27
|
+
*
|
|
28
|
+
* Unlike V1, this is drawer CONTENT only — the `connection_detail_block`
|
|
29
|
+
* registry entry supplies the drawer and its title via ActionBlockLayer.
|
|
30
|
+
*/
|
|
31
|
+
declare const ConnectionDetailDrillDown: ({ copy, onRespond }: ConnectionDetailDrillDownProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export default ConnectionDetailDrillDown;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import i from "@mui/material/Stack";
|
|
2
|
+
import { P as a, Text as s } from "@mxenabled/mxui";
|
|
3
|
+
import { Icon as l } from "@mxenabled/mx-icons";
|
|
4
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
5
|
+
import d from "@mui/material/IconButton";
|
|
6
|
+
import h from "@mui/material/Card";
|
|
7
|
+
import x from "@mui/material/CardContent";
|
|
8
|
+
var m = ({ icon: r, title: o, description: n }) => /* @__PURE__ */ e(h, {
|
|
9
|
+
variant: "outlined",
|
|
10
|
+
children: /* @__PURE__ */ t(x, {
|
|
11
|
+
sx: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
gap: 12,
|
|
14
|
+
"&:last-child": { pb: 16 }
|
|
15
|
+
},
|
|
16
|
+
children: [r, /* @__PURE__ */ t(i, {
|
|
17
|
+
sx: { gap: 4 },
|
|
18
|
+
children: [/* @__PURE__ */ e(s, {
|
|
19
|
+
bold: !0,
|
|
20
|
+
variant: "body1",
|
|
21
|
+
children: o
|
|
22
|
+
}), /* @__PURE__ */ e(a, {
|
|
23
|
+
sx: {
|
|
24
|
+
color: "text.secondary",
|
|
25
|
+
fontWeight: 400
|
|
26
|
+
},
|
|
27
|
+
variant: "subtitle2",
|
|
28
|
+
children: n
|
|
29
|
+
})]
|
|
30
|
+
})]
|
|
31
|
+
})
|
|
32
|
+
}), I = ({ copy: r, onRespond: o }) => /* @__PURE__ */ t(i, {
|
|
33
|
+
sx: {
|
|
34
|
+
p: 24,
|
|
35
|
+
bgcolor: "background.paper"
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ t(i, {
|
|
39
|
+
sx: {
|
|
40
|
+
gap: 16,
|
|
41
|
+
pb: 16
|
|
42
|
+
},
|
|
43
|
+
children: [/* @__PURE__ */ t(i, {
|
|
44
|
+
sx: { gap: 4 },
|
|
45
|
+
children: [/* @__PURE__ */ e(a, {
|
|
46
|
+
variant: "h3",
|
|
47
|
+
children: r.header_text
|
|
48
|
+
}), /* @__PURE__ */ e(a, {
|
|
49
|
+
sx: {
|
|
50
|
+
fontWeight: 400,
|
|
51
|
+
color: "text.secondary"
|
|
52
|
+
},
|
|
53
|
+
variant: "subtitle2",
|
|
54
|
+
children: r.description
|
|
55
|
+
})]
|
|
56
|
+
}), /* @__PURE__ */ e(i, {
|
|
57
|
+
sx: { gap: 12 },
|
|
58
|
+
children: r.benefits.map((n, c) => /* @__PURE__ */ t(i, {
|
|
59
|
+
sx: {
|
|
60
|
+
flexDirection: "row",
|
|
61
|
+
gap: 8
|
|
62
|
+
},
|
|
63
|
+
children: [/* @__PURE__ */ e(l, {
|
|
64
|
+
color: "success",
|
|
65
|
+
name: "check_circle",
|
|
66
|
+
size: 16
|
|
67
|
+
}), /* @__PURE__ */ e(a, {
|
|
68
|
+
sx: { fontWeight: 400 },
|
|
69
|
+
variant: "subtitle2",
|
|
70
|
+
children: n
|
|
71
|
+
})]
|
|
72
|
+
}, c))
|
|
73
|
+
})]
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ t(i, {
|
|
76
|
+
sx: {
|
|
77
|
+
gap: 4,
|
|
78
|
+
py: 12
|
|
79
|
+
},
|
|
80
|
+
children: [/* @__PURE__ */ e(s, {
|
|
81
|
+
sx: { fontWeight: 600 },
|
|
82
|
+
variant: "body1",
|
|
83
|
+
children: r.shared_info_header_text
|
|
84
|
+
}), /* @__PURE__ */ e(a, {
|
|
85
|
+
sx: {
|
|
86
|
+
color: "text.secondary",
|
|
87
|
+
lineHeight: "20px"
|
|
88
|
+
},
|
|
89
|
+
variant: "body2",
|
|
90
|
+
children: r.shared_info_description
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ e(i, {
|
|
94
|
+
sx: {
|
|
95
|
+
py: 16,
|
|
96
|
+
gap: 24
|
|
97
|
+
},
|
|
98
|
+
children: r.shared_info_items.map((n, c) => /* @__PURE__ */ e(m, {
|
|
99
|
+
description: n.content,
|
|
100
|
+
icon: /* @__PURE__ */ e(l, {
|
|
101
|
+
name: n.icon_name,
|
|
102
|
+
size: 24,
|
|
103
|
+
sx: { color: "text.primary" }
|
|
104
|
+
}),
|
|
105
|
+
title: n.title
|
|
106
|
+
}, c))
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ t(i, {
|
|
109
|
+
sx: {
|
|
110
|
+
py: 16,
|
|
111
|
+
gap: 12,
|
|
112
|
+
alignItems: "center"
|
|
113
|
+
},
|
|
114
|
+
children: [/* @__PURE__ */ e(s, {
|
|
115
|
+
bold: !0,
|
|
116
|
+
children: r.footer_title
|
|
117
|
+
}), /* @__PURE__ */ t(i, {
|
|
118
|
+
sx: {
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
gap: 24
|
|
122
|
+
},
|
|
123
|
+
children: [/* @__PURE__ */ e(d, {
|
|
124
|
+
"aria-label": r.aria_label_thumbs_down,
|
|
125
|
+
onClick: () => o?.("no"),
|
|
126
|
+
children: /* @__PURE__ */ e(l, {
|
|
127
|
+
color: "secondary",
|
|
128
|
+
name: "thumb_down",
|
|
129
|
+
size: 24
|
|
130
|
+
})
|
|
131
|
+
}), /* @__PURE__ */ e(d, {
|
|
132
|
+
"aria-label": r.aria_label_thumbs_up,
|
|
133
|
+
onClick: () => o?.("yes"),
|
|
134
|
+
children: /* @__PURE__ */ e(l, {
|
|
135
|
+
color: "secondary",
|
|
136
|
+
name: "thumb_up",
|
|
137
|
+
size: 24
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
I as default
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
//# sourceMappingURL=ConnectionDetailDrillDown.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionDetailDrillDown.es.js","names":[],"sources":["../../../src/insights-v2/components/ConnectionDetailDrillDown.tsx"],"sourcesContent":["import Card from '@mui/material/Card'\nimport CardContent from '@mui/material/CardContent'\nimport IconButton from '@mui/material/IconButton'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { P, Text } from '@mxenabled/mxui'\n\ninterface InfoItemProps {\n icon: React.ReactNode\n title: string\n description: string\n}\n\nexport interface ConnectionDetailItem {\n content: string\n icon_name: string\n title: string\n}\n\n/** Resolved strings the drilldown renders (see ConnectionDetailActionBlock). */\nexport interface ConnectionDetailContent {\n aria_label_thumbs_down: string\n aria_label_thumbs_up: string\n benefits: string[]\n description: string\n footer_title: string\n header_text: string\n shared_info_description: string\n shared_info_header_text: string\n shared_info_items: ConnectionDetailItem[]\n}\n\ninterface ConnectionDetailDrillDownProps {\n copy: ConnectionDetailContent\n /** Thumbs response — `'yes'` (up) / `'no'` (down). */\n onRespond?: (response: 'yes' | 'no') => void\n}\n\nconst InfoItem = ({ icon, title, description }: InfoItemProps) => (\n <Card variant=\"outlined\">\n <CardContent sx={{ display: 'flex', gap: 12, '&:last-child': { pb: 16 } }}>\n {icon}\n <Stack sx={{ gap: 4 }}>\n <Text bold={true} variant=\"body1\">\n {title}\n </Text>\n <P sx={{ color: 'text.secondary', fontWeight: 400 }} variant=\"subtitle2\">\n {description}\n </P>\n </Stack>\n </CardContent>\n </Card>\n)\n\n/**\n * Insights-v2 copy of the V1 `insights/components/shared/ConnectionDetailDrillDown`:\n * the connection-details education panel (benefits, shared-info cards, and a\n * thumbs was-this-helpful footer).\n *\n * Unlike V1, this is drawer CONTENT only — the `connection_detail_block`\n * registry entry supplies the drawer and its title via ActionBlockLayer.\n */\nconst ConnectionDetailDrillDown = ({ copy, onRespond }: ConnectionDetailDrillDownProps) => (\n <Stack sx={{ p: 24, bgcolor: 'background.paper' }}>\n <Stack sx={{ gap: 16, pb: 16 }}>\n <Stack sx={{ gap: 4 }}>\n <P variant=\"h3\">{copy.header_text}</P>\n\n <P sx={{ fontWeight: 400, color: 'text.secondary' }} variant=\"subtitle2\">\n {copy.description}\n </P>\n </Stack>\n\n {/* Bullet points */}\n <Stack sx={{ gap: 12 }}>\n {copy.benefits.map((text, i) => (\n <Stack key={i} sx={{ flexDirection: 'row', gap: 8 }}>\n <Icon color=\"success\" name=\"check_circle\" size={16} />\n <P sx={{ fontWeight: 400 }} variant=\"subtitle2\">\n {text}\n </P>\n </Stack>\n ))}\n </Stack>\n </Stack>\n\n {/* Info section */}\n <Stack sx={{ gap: 4, py: 12 }}>\n <Text sx={{ fontWeight: 600 }} variant=\"body1\">\n {copy.shared_info_header_text}\n </Text>\n\n <P sx={{ color: 'text.secondary', lineHeight: '20px' }} variant=\"body2\">\n {copy.shared_info_description}\n </P>\n </Stack>\n\n {/* Cards */}\n <Stack sx={{ py: 16, gap: 24 }}>\n {copy.shared_info_items.map((item, index) => (\n <InfoItem\n description={item.content}\n icon={<Icon name={item.icon_name} size={24} sx={{ color: 'text.primary' }} />}\n key={index}\n title={item.title}\n />\n ))}\n </Stack>\n\n <Stack sx={{ py: 16, gap: 12, alignItems: 'center' }}>\n <Text bold={true}>{copy.footer_title}</Text>\n <Stack sx={{ flexDirection: 'row', alignItems: 'center', gap: 24 }}>\n <IconButton aria-label={copy.aria_label_thumbs_down} onClick={() => onRespond?.('no')}>\n <Icon color=\"secondary\" name=\"thumb_down\" size={24} />\n </IconButton>\n <IconButton aria-label={copy.aria_label_thumbs_up} onClick={() => onRespond?.('yes')}>\n <Icon color=\"secondary\" name=\"thumb_up\" size={24} />\n </IconButton>\n </Stack>\n </Stack>\n </Stack>\n)\n\nexport default ConnectionDetailDrillDown\n"],"mappings":";;;;;;;AAuCA,IAAM,IAAA,CAAY,EAAE,MAAA,GAAM,OAAA,GAAO,aAAA,EAAA,MAC/B,gBAAA,EAAC,GAAD;AAAA,EAAM,SAAQ;AAAA,EACZ,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAa,IAAI;AAAA,MAAE,SAAS;AAAA,MAAQ,KAAK;AAAA,MAAI,gBAAgB,EAAE,IAAI,GAAG;AAAA,IAAE;AAAA,IAAxE,UAAA,CACG,GACD,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,KAAK,EAAE;AAAA,MAApB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,SAAQ;AAAA,QACvB,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAG,IAAI;AAAA,UAAE,OAAO;AAAA,UAAkB,YAAY;AAAA,QAAI;AAAA,QAAG,SAAQ;AAAA,QAC1D,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