@mx-cartographer/experiences 9.7.116 → 9.7.117

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +75 -72
  3. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  4. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +10 -8
  5. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +103 -80
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +2 -0
  8. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  9. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.d.ts +1 -7
  10. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +8 -10
  11. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
  12. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +13 -17
  13. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +16 -11
  14. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
  15. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.d.ts +6 -2
  16. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js +7 -6
  17. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js.map +1 -1
  18. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +12 -12
  19. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +4 -4
  20. package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +1 -1
  21. package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +4 -4
  22. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +4 -4
  23. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +4 -4
  24. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +8 -8
  25. package/package.json +1 -1
@@ -1,23 +1,21 @@
1
1
  import { formatValueByType as e } from "../../../CommonUtils.es.js";
2
2
  import v from "./DonutChart.es.js";
3
3
  import { getDonutChartColors as y } from "./utils.es.js";
4
- import { Fragment as f, jsx as i, jsxs as b } from "react/jsx-runtime";
4
+ import { Fragment as b, jsx as u, jsxs as f } from "react/jsx-runtime";
5
5
  import { useTheme as h } from "@mui/material/styles";
6
- var j = ({ payload: s }) => {
7
- const c = h(), { instance_slot: l, instance_slot_data: r } = s, { variant: m } = l, n = l.data, t = n?.main ? n : r ?? {}, _ = Array.isArray(t.legends) ? t.legends : [], { main: o } = t;
6
+ var j = ({ payload: i }) => {
7
+ const s = h(), { instance_slot: l, instance_slot_data: r } = i, { variant: c } = l, n = l.data, t = n?.main ? n : r ?? {}, m = Array.isArray(t.legends) ? t.legends : [], { main: o } = t;
8
8
  if (!o) return null;
9
- const u = y(m, {
9
+ const _ = y(c, {
10
10
  ...t,
11
11
  category_guid: t.category_guid ?? r?.category_guid
12
- }, c);
13
- if (!u) return null;
14
- const d = _.map((a, p) => ({
12
+ }, s), d = m.map((a, p) => ({
15
13
  value: a.value,
16
- color: u[p],
14
+ color: _[p],
17
15
  label: a.label,
18
- labelValue: /* @__PURE__ */ b(f, { children: [/* @__PURE__ */ i("b", { children: e(a.value, a.value_type ?? "amount", "0,0.00") }), a.additional_value && a.additional_value_type ? ` (${e(a.additional_value, a.additional_value_type, "0,0.00")})` : null] })
16
+ labelValue: /* @__PURE__ */ f(b, { children: [/* @__PURE__ */ u("b", { children: e(a.value, a.value_type ?? "amount", "0,0.00") }), a.additional_value && a.additional_value_type ? ` (${e(a.additional_value, a.additional_value_type, "0,0.00")})` : null] })
19
17
  }));
20
- return /* @__PURE__ */ i(v, {
18
+ return /* @__PURE__ */ u(v, {
21
19
  centerLabel: o.label,
22
20
  centerValue: e(Number(o.value), o.value_type, "0,0"),
23
21
  data: d
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport type { DonutChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { formatValueByType } from '../../../CommonUtils'\n\nimport type { BlockProps } from '../../types'\n\nimport DonutChartV2 from './DonutChart'\nimport { getDonutChartColors } from './utils'\n\n/**\n * `donut_chart_block`: a donut with a centre total and a two-row legend.\n *\n * Reads `main` and `legends` from `instance_slot.data` (the Insights 2.0 envelope; ditto variant\n * `deposit_summary` for Monthly Deposit Summary), falling back to the V1 `instance_slot_data` for\n * payloads that still carry the facts there. The palette comes from `./layout.ts` by variant.\n */\nconst DonutChartBlock = ({ payload }: BlockProps<Partial<DonutChartBlockData>>) => {\n const theme = useTheme()\n const { instance_slot, instance_slot_data } = payload\n const { variant } = instance_slot\n // V2 contract first (`instance_slot.data`), V1 `instance_slot_data` as the legacy alias.\n const slotData = instance_slot.data as Partial<DonutChartBlockData> | undefined\n const blockData: Partial<DonutChartBlockData> = slotData?.main\n ? slotData\n : (instance_slot_data ?? {})\n const legends = Array.isArray(blockData.legends) ? blockData.legends : []\n const { main } = blockData\n\n if (!main) return null\n\n const colors = getDonutChartColors(\n variant,\n { ...blockData, category_guid: blockData.category_guid ?? instance_slot_data?.category_guid },\n theme,\n )\n\n if (!colors) return null\n\n const data = legends.map((legend, index) => ({\n value: legend.value,\n color: colors[index],\n label: legend.label,\n labelValue: (\n <>\n <b>{formatValueByType(legend.value, legend.value_type ?? 'amount', '0,0.00')}</b>\n {legend.additional_value && legend.additional_value_type\n ? ` (${formatValueByType(legend.additional_value, legend.additional_value_type, '0,0.00')})`\n : null}\n </>\n ),\n }))\n\n return (\n <DonutChartV2\n centerLabel={main.label}\n centerValue={formatValueByType(Number(main.value), main.value_type, '0,0')}\n data={data}\n />\n )\n}\n\nexport default DonutChartBlock\n"],"mappings":";;;;;AAkBA,IAAM,IAAA,CAAmB,EAAE,SAAA,EAAA,MAAwD;AACjF,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,GAAe,oBAAA,EAAA,IAAuB,GACxC,EAAE,SAAA,EAAA,IAAY,GAEd,IAAW,EAAc,MACzB,IAA0C,GAAU,OACtD,IACC,KAAsB,CAAC,GACtB,IAAU,MAAM,QAAQ,EAAU,OAAO,IAAI,EAAU,UAAU,CAAC,GAClE,EAAE,MAAA,EAAA,IAAS;AAEjB,MAAI,CAAC,EAAM,QAAO;AAElB,QAAM,IAAS,EACb,GACA;AAAA,IAAE,GAAG;AAAA,IAAW,eAAe,EAAU,iBAAiB,GAAoB;AAAA,EAAc,GAC5F,CACF;AAEA,MAAI,CAAC,EAAQ,QAAO;AAEpB,QAAM,IAAO,EAAQ,IAAA,CAAK,GAAQ,OAAW;AAAA,IAC3C,OAAO,EAAO;AAAA,IACd,OAAO,EAAO,CAAA;AAAA,IACd,OAAO,EAAO;AAAA,IACd,YACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,KAAD,EAAA,UAAI,EAAkB,EAAO,OAAO,EAAO,cAAc,UAAU,QAAQ,EAAK,CAAA,GAC/E,EAAO,oBAAoB,EAAO,wBAC/B,KAAK,EAAkB,EAAO,kBAAkB,EAAO,uBAAuB,QAAQ,CAAA,MACtF,IACJ,EAAA,CAAA;AAAA,EAEN,EAAE;AAEF,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,aAAa,EAAK;AAAA,IAClB,aAAa,EAAkB,OAAO,EAAK,KAAK,GAAG,EAAK,YAAY,KAAK;AAAA,IACnE,MAAA;AAAA,EACP,CAAA;AAEL"}
1
+ {"version":3,"file":"DonutChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport type { DonutChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { formatValueByType } from '../../../CommonUtils'\n\nimport type { BlockProps } from '../../types'\n\nimport DonutChartV2 from './DonutChart'\nimport { getDonutChartColors } from './utils'\n\n/** `donut_chart_block`: a donut with a centre total and a two-row legend; V1 `instance_slot_data` is the fallback. */\nconst DonutChartBlock = ({ payload }: BlockProps<Partial<DonutChartBlockData>>) => {\n const theme = useTheme()\n const { instance_slot, instance_slot_data } = payload\n const { variant } = instance_slot\n // V2 contract first (`instance_slot.data`), V1 `instance_slot_data` as the legacy alias.\n const slotData = instance_slot.data as Partial<DonutChartBlockData> | undefined\n const blockData: Partial<DonutChartBlockData> = slotData?.main\n ? slotData\n : (instance_slot_data ?? {})\n const legends = Array.isArray(blockData.legends) ? blockData.legends : []\n const { main } = blockData\n\n if (!main) return null\n\n const colors = getDonutChartColors(\n variant,\n { ...blockData, category_guid: blockData.category_guid ?? instance_slot_data?.category_guid },\n theme,\n )\n\n const data = legends.map((legend, index) => ({\n value: legend.value,\n color: colors[index],\n label: legend.label,\n labelValue: (\n <>\n <b>{formatValueByType(legend.value, legend.value_type ?? 'amount', '0,0.00')}</b>\n {legend.additional_value && legend.additional_value_type\n ? ` (${formatValueByType(legend.additional_value, legend.additional_value_type, '0,0.00')})`\n : null}\n </>\n ),\n }))\n\n return (\n <DonutChartV2\n centerLabel={main.label}\n centerValue={formatValueByType(Number(main.value), main.value_type, '0,0')}\n data={data}\n />\n )\n}\n\nexport default DonutChartBlock\n"],"mappings":";;;;;AAYA,IAAM,IAAA,CAAmB,EAAE,SAAA,EAAA,MAAwD;AACjF,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,GAAe,oBAAA,EAAA,IAAuB,GACxC,EAAE,SAAA,EAAA,IAAY,GAEd,IAAW,EAAc,MACzB,IAA0C,GAAU,OACtD,IACC,KAAsB,CAAC,GACtB,IAAU,MAAM,QAAQ,EAAU,OAAO,IAAI,EAAU,UAAU,CAAC,GAClE,EAAE,MAAA,EAAA,IAAS;AAEjB,MAAI,CAAC,EAAM,QAAO;AAElB,QAAM,IAAS,EACb,GACA;AAAA,IAAE,GAAG;AAAA,IAAW,eAAe,EAAU,iBAAiB,GAAoB;AAAA,EAAc,GAC5F,CACF,GAEM,IAAO,EAAQ,IAAA,CAAK,GAAQ,OAAW;AAAA,IAC3C,OAAO,EAAO;AAAA,IACd,OAAO,EAAO,CAAA;AAAA,IACd,OAAO,EAAO;AAAA,IACd,YACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,KAAD,EAAA,UAAI,EAAkB,EAAO,OAAO,EAAO,cAAc,UAAU,QAAQ,EAAK,CAAA,GAC/E,EAAO,oBAAoB,EAAO,wBAC/B,KAAK,EAAkB,EAAO,kBAAkB,EAAO,uBAAuB,QAAQ,CAAA,MACtF,IACJ,EAAA,CAAA;AAAA,EAEN,EAAE;AAEF,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,aAAa,EAAK;AAAA,IAClB,aAAa,EAAkB,OAAO,EAAK,KAAK,GAAG,EAAK,YAAY,KAAK;AAAA,IACnE,MAAA;AAAA,EACP,CAAA;AAEL"}
@@ -1,19 +1,15 @@
1
1
  import { Theme } from '@mui/material/styles';
2
- export declare const getLayoutConfig: (theme: Theme) => {
3
- CostOfLivingToIncome: {
4
- secondaryColor: string;
5
- };
6
- MonthlyDepositSummaryV2: {
7
- colors: string[];
8
- };
9
- MonthlyNonEssentialCategorySummaryV2: {
10
- colors: (string | undefined)[];
11
- };
12
- CreditCardCloseToLimit: {
13
- colors: string[];
14
- };
15
- CreditUtilization: {
16
- dynamicPrimary: string;
17
- secondaryColor: string;
18
- };
2
+ /** Ditto's `donut_chart_block` variants; the template-name keys below are V1 aliases. */
3
+ export declare const donutChartVariant: {
4
+ readonly DepositSummary: "deposit_summary";
19
5
  };
6
+ export type DonutChartVariant = (typeof donutChartVariant)[keyof typeof donutChartVariant];
7
+ export type DonutChartLayoutConfig = {
8
+ colors: [string, string];
9
+ } | {
10
+ secondaryColor: string;
11
+ } | {
12
+ dynamicPrimary: 'creditUtilization';
13
+ secondaryColor: string;
14
+ };
15
+ export declare const getLayoutConfig: (theme: Theme) => Record<string, DonutChartLayoutConfig>;
@@ -1,15 +1,20 @@
1
- var t = (o) => ({
2
- CostOfLivingToIncome: { secondaryColor: o.palette.divider },
3
- MonthlyDepositSummaryV2: { colors: [o.palette.success.main, o.palette.success.light] },
4
- MonthlyNonEssentialCategorySummaryV2: { colors: [o.palette.chartMono.chartMono3, o.palette.chartMono.chartMono5] },
5
- CreditCardCloseToLimit: { colors: [o.palette.warning.main, o.palette.divider] },
6
- CreditUtilization: {
7
- dynamicPrimary: "creditUtilization",
8
- secondaryColor: o.palette.divider
9
- }
10
- });
1
+ var a = { DepositSummary: "deposit_summary" }, r = (t) => {
2
+ const o = { colors: [t.palette.success.main, t.palette.success.light] };
3
+ return {
4
+ [a.DepositSummary]: o,
5
+ CostOfLivingToIncome: { secondaryColor: t.palette.divider },
6
+ MonthlyDepositSummaryV2: o,
7
+ MonthlyNonEssentialCategorySummaryV2: { colors: [t.palette.chartMono.chartMono3 ?? t.palette.text.primary, t.palette.chartMono.chartMono5 ?? t.palette.divider] },
8
+ CreditCardCloseToLimit: { colors: [t.palette.warning.main, t.palette.divider] },
9
+ CreditUtilization: {
10
+ dynamicPrimary: "creditUtilization",
11
+ secondaryColor: t.palette.divider
12
+ }
13
+ };
14
+ };
11
15
  export {
12
- t as getLayoutConfig
16
+ a as donutChartVariant,
17
+ r as getLayoutConfig
13
18
  };
14
19
 
15
20
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\nexport const getLayoutConfig = (theme: Theme) => {\n return {\n CostOfLivingToIncome: {\n secondaryColor: theme.palette.divider,\n },\n MonthlyDepositSummaryV2: {\n colors: [theme.palette.success.main, theme.palette.success.light],\n },\n MonthlyNonEssentialCategorySummaryV2: {\n colors: [theme.palette.chartMono.chartMono3, theme.palette.chartMono.chartMono5],\n },\n CreditCardCloseToLimit: {\n colors: [theme.palette.warning.main, theme.palette.divider],\n },\n CreditUtilization: {\n dynamicPrimary: 'creditUtilization',\n secondaryColor: theme.palette.divider,\n },\n }\n}\n"],"mappings":"AACA,IAAa,IAAA,CAAmB,OACvB;AAAA,EACL,sBAAsB,EACpB,gBAAgB,EAAM,QAAQ,QAChC;AAAA,EACA,yBAAyB,EACvB,QAAQ,CAAC,EAAM,QAAQ,QAAQ,MAAM,EAAM,QAAQ,QAAQ,KAAK,EAClE;AAAA,EACA,sCAAsC,EACpC,QAAQ,CAAC,EAAM,QAAQ,UAAU,YAAY,EAAM,QAAQ,UAAU,UAAU,EACjF;AAAA,EACA,wBAAwB,EACtB,QAAQ,CAAC,EAAM,QAAQ,QAAQ,MAAM,EAAM,QAAQ,OAAO,EAC5D;AAAA,EACA,mBAAmB;AAAA,IACjB,gBAAgB;AAAA,IAChB,gBAAgB,EAAM,QAAQ;AAAA,EAChC;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\n\n/** Ditto's `donut_chart_block` variants; the template-name keys below are V1 aliases. */\nexport const donutChartVariant = {\n DepositSummary: 'deposit_summary',\n} as const\n\nexport type DonutChartVariant = (typeof donutChartVariant)[keyof typeof donutChartVariant]\n\nexport type DonutChartLayoutConfig =\n | { colors: [string, string] }\n | { secondaryColor: string }\n | { dynamicPrimary: 'creditUtilization'; secondaryColor: string }\n\nexport const getLayoutConfig = (theme: Theme): Record<string, DonutChartLayoutConfig> => {\n const depositSummary: DonutChartLayoutConfig = {\n colors: [theme.palette.success.main, theme.palette.success.light],\n }\n\n return {\n [donutChartVariant.DepositSummary]: depositSummary,\n\n // V1 aliases: the template name as the variant.\n CostOfLivingToIncome: {\n secondaryColor: theme.palette.divider,\n },\n MonthlyDepositSummaryV2: depositSummary,\n MonthlyNonEssentialCategorySummaryV2: {\n colors: [\n theme.palette.chartMono.chartMono3 ?? theme.palette.text.primary,\n theme.palette.chartMono.chartMono5 ?? theme.palette.divider,\n ],\n },\n CreditCardCloseToLimit: {\n colors: [theme.palette.warning.main, theme.palette.divider],\n },\n CreditUtilization: {\n dynamicPrimary: 'creditUtilization',\n secondaryColor: theme.palette.divider,\n },\n }\n}\n"],"mappings":"AAGA,IAAa,IAAoB,EAC/B,gBAAgB,kBAClB,GASa,IAAA,CAAmB,MAAyD;AACvF,QAAM,IAAyC,EAC7C,QAAQ,CAAC,EAAM,QAAQ,QAAQ,MAAM,EAAM,QAAQ,QAAQ,KAAK,EAClE;AAEA,SAAO;AAAA,IACJ,CAAA,EAAkB,cAAA,GAAiB;AAAA,IAGpC,sBAAsB,EACpB,gBAAgB,EAAM,QAAQ,QAChC;AAAA,IACA,yBAAyB;AAAA,IACzB,sCAAsC,EACpC,QAAQ,CACN,EAAM,QAAQ,UAAU,cAAc,EAAM,QAAQ,KAAK,SACzD,EAAM,QAAQ,UAAU,cAAc,EAAM,QAAQ,OACtD,EACF;AAAA,IACA,wBAAwB,EACtB,QAAQ,CAAC,EAAM,QAAQ,QAAQ,MAAM,EAAM,QAAQ,OAAO,EAC5D;AAAA,IACA,mBAAmB;AAAA,MACjB,gBAAgB;AAAA,MAChB,gBAAgB,EAAM,QAAQ;AAAA,IAChC;AAAA,EACF;AACF"}
@@ -1,3 +1,7 @@
1
1
  import { Theme } from '@mui/material/styles';
2
- import { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData';
3
- export declare const getDonutChartColors: (variant: string | null | undefined, blockData: InsightsInstanceSlotData, theme: Theme) => [string, string] | null;
2
+ import { DonutChartBlockData } from '../../../../core/types/InsightsInstanceSlotData';
3
+ /** The facts the palette may read: the centre value (credit utilization) and the category. */
4
+ export type DonutColorData = Partial<DonutChartBlockData> & {
5
+ category_guid?: string;
6
+ };
7
+ export declare const getDonutChartColors: (variant: string | null | undefined, blockData: DonutColorData, theme: Theme) => [string, string];
@@ -1,11 +1,12 @@
1
- import { getCategoryColor as a } from "../../../../core/utils/CategoryUtil.es.js";
2
- import { getLayoutConfig as t } from "./layout.es.js";
3
- var u = (n, i, o) => {
4
- const r = t(o)[n];
5
- return r ? "dynamicPrimary" in r && r.dynamicPrimary === "creditUtilization" ? [Number(i.main?.value ?? 0) > 30 ? o.palette.error.main : o.palette.warning.main, r.secondaryColor] : "secondaryColor" in r ? [a(i.category_guid ?? "", o), r.secondaryColor] : r.colors : null;
1
+ import { getCategoryColor as t } from "../../../../core/utils/CategoryUtil.es.js";
2
+ import { resolveVariantConfig as n } from "../../resolveVariantConfig.es.js";
3
+ import { donutChartVariant as e, getLayoutConfig as m } from "./layout.es.js";
4
+ var y = (i, a, o) => {
5
+ const r = n(m(o), i, e.DepositSummary, "DonutChartBlock");
6
+ return "dynamicPrimary" in r && r.dynamicPrimary === "creditUtilization" ? [Number(a.main?.value ?? 0) > 30 ? o.palette.error.main : o.palette.warning.main, r.secondaryColor] : "secondaryColor" in r ? [t(a.category_guid ?? "", o), r.secondaryColor] : r.colors;
6
7
  };
7
8
  export {
8
- u as getDonutChartColors
9
+ y as getDonutChartColors
9
10
  };
10
11
 
11
12
  //# sourceMappingURL=utils.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\nimport { getCategoryColor } from '../../../../core/utils/CategoryUtil'\nimport { getLayoutConfig } from './layout'\nimport type { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData'\n\nexport const getDonutChartColors = (\n variant: string | null | undefined,\n blockData: InsightsInstanceSlotData,\n theme: Theme,\n): [string, string] | null => {\n const layouts = getLayoutConfig(theme)\n const variantConfig = layouts[variant as keyof ReturnType<typeof getLayoutConfig>] as\n | { dynamicPrimary: string; secondaryColor: string }\n | { secondaryColor: string }\n | { colors: [string, string] }\n | undefined\n\n if (!variantConfig) return null\n\n if ('dynamicPrimary' in variantConfig && variantConfig.dynamicPrimary === 'creditUtilization') {\n const utilization = Number(blockData.main?.value ?? 0)\n const primaryColor = utilization > 30 ? theme.palette.error.main : theme.palette.warning.main\n return [primaryColor, variantConfig.secondaryColor]\n }\n\n if ('secondaryColor' in variantConfig) {\n const categoryColor = getCategoryColor(blockData.category_guid ?? '', theme)\n return [categoryColor, variantConfig.secondaryColor]\n }\n\n return variantConfig.colors\n}\n"],"mappings":";;AAKA,IAAa,IAAA,CACX,GACA,GACA,MAC4B;AAE5B,QAAM,IADU,EAAgB,CACV,EAAQ,CAAA;AAM9B,SAAK,IAED,oBAAoB,KAAiB,EAAc,mBAAmB,sBAGjE,CAFa,OAAO,EAAU,MAAM,SAAS,CAC/B,IAAc,KAAK,EAAM,QAAQ,MAAM,OAAO,EAAM,QAAQ,QAAQ,MACnE,EAAc,cAAc,IAGhD,oBAAoB,IAEf,CADe,EAAiB,EAAU,iBAAiB,IAAI,CAC9D,GAAe,EAAc,cAAc,IAG9C,EAAc,SAbM;AAc7B"}
1
+ {"version":3,"file":"utils.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\nimport { getCategoryColor } from '../../../../core/utils/CategoryUtil'\nimport type { DonutChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { donutChartVariant, getLayoutConfig } from './layout'\n\n/** The facts the palette may read: the centre value (credit utilization) and the category. */\nexport type DonutColorData = Partial<DonutChartBlockData> & { category_guid?: string }\n\nexport const getDonutChartColors = (\n variant: string | null | undefined,\n blockData: DonutColorData,\n theme: Theme,\n): [string, string] => {\n const variantConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n donutChartVariant.DepositSummary,\n 'DonutChartBlock',\n )\n\n if ('dynamicPrimary' in variantConfig && variantConfig.dynamicPrimary === 'creditUtilization') {\n const utilization = Number(blockData.main?.value ?? 0)\n const primaryColor = utilization > 30 ? theme.palette.error.main : theme.palette.warning.main\n return [primaryColor, variantConfig.secondaryColor]\n }\n\n if ('secondaryColor' in variantConfig) {\n const categoryColor = getCategoryColor(blockData.category_guid ?? '', theme)\n return [categoryColor, variantConfig.secondaryColor]\n }\n\n return variantConfig.colors\n}\n"],"mappings":";;;AASA,IAAa,IAAA,CACX,GACA,GACA,MACqB;AACrB,QAAM,IAAgB,EACpB,EAAgB,CAAK,GACrB,GACA,EAAkB,gBAClB,iBACF;AAEA,SAAI,oBAAoB,KAAiB,EAAc,mBAAmB,sBAGjE,CAFa,OAAO,EAAU,MAAM,SAAS,CAC/B,IAAc,KAAK,EAAM,QAAQ,MAAM,OAAO,EAAM,QAAQ,QAAQ,MACnE,EAAc,cAAc,IAGhD,oBAAoB,IAEf,CADe,EAAiB,EAAU,iBAAiB,IAAI,CAC9D,GAAe,EAAc,cAAc,IAG9C,EAAc;AACvB"}
@@ -1,12 +1,12 @@
1
1
  import { slot as d } from "../../../../core/types/Insights.es.js";
2
2
  import { formatCurrency as I } from "../../../../core/utils/NumberFormatting.es.js";
3
3
  import { useContainerDimensions as P } from "../../../hooks/useContainerDimensions.es.js";
4
- import H from "../../../components/LogoFromGuid.es.js";
5
- import { Confetti as N } from "../../../components/shared/Confetti.es.js";
6
- import { ReactComponent as E } from "../../../components/shared/images/PaidOffCard.es.js";
7
- import { ReactComponent as G } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
8
- import { statusIconName as O } from "../../../components/statusIcon.es.js";
9
- import { resolveVariantConfig as W } from "../../resolveVariantConfig.es.js";
4
+ import { resolveVariantConfig as H } from "../../resolveVariantConfig.es.js";
5
+ import N from "../../../components/LogoFromGuid.es.js";
6
+ import { Confetti as E } from "../../../components/shared/Confetti.es.js";
7
+ import { ReactComponent as G } from "../../../components/shared/images/PaidOffCard.es.js";
8
+ import { ReactComponent as O } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
9
+ import { statusIconName as W } from "../../../components/statusIcon.es.js";
10
10
  import { isDetailedAccountVariant as q } from "../DetailedAccountBlock/layout.es.js";
11
11
  import J from "../DetailedAccountBlock/DetailedAccountBlock.es.js";
12
12
  import { HeaderComponent as K } from "./HeaderComponent.es.js";
@@ -22,9 +22,9 @@ import a from "@mui/material/Box";
22
22
  var vo = ({ payload: g }) => {
23
23
  const h = X(), b = U(null), { height: w, width: v } = P(b), { instance_slot: n } = g, { variant: p, institution_guid: D, institution_name: A, icon_name: B, merchant_name: F } = n;
24
24
  if (q(p)) return /* @__PURE__ */ o(J, { payload: g });
25
- const { data: i } = n, m = i !== void 0, f = d(i, "amount"), u = m ? typeof f == "number" && Number.isFinite(f) ? f : void 0 : n.amount, y = d(i, "sub_text"), R = typeof y == "string" ? y : void 0, T = m ? R : n.sub_text, L = m ? R : n.label, _ = d(i, "header_text"), s = m ? typeof _ == "string" ? _ : void 0 : n.header_text, c = d(i, "logo"), t = W(M(h), p, "default", "AccountBlock");
25
+ const { data: i } = n, m = i !== void 0, f = d(i, "amount"), u = m ? typeof f == "number" && Number.isFinite(f) ? f : void 0 : n.amount, y = d(i, "sub_text"), R = typeof y == "string" ? y : void 0, T = m ? R : n.sub_text, L = m ? R : n.label, _ = d(i, "header_text"), s = m ? typeof _ == "string" ? _ : void 0 : n.header_text, c = d(i, "logo"), t = H(M(h), p, "default", "AccountBlock");
26
26
  if (t?.isConfetti) {
27
- const x = O(c?.guid), V = {
27
+ const x = W(c?.guid), V = {
28
28
  paidOffCard: /* @__PURE__ */ o(a, {
29
29
  sx: {
30
30
  flexShrink: 0,
@@ -32,7 +32,7 @@ var vo = ({ payload: g }) => {
32
32
  position: "relative",
33
33
  width: 48
34
34
  },
35
- children: /* @__PURE__ */ o(E, {
35
+ children: /* @__PURE__ */ o(G, {
36
36
  "aria-hidden": !0,
37
37
  role: "presentation",
38
38
  style: {
@@ -42,7 +42,7 @@ var vo = ({ payload: g }) => {
42
42
  }
43
43
  })
44
44
  }),
45
- savings: /* @__PURE__ */ o(G, {
45
+ savings: /* @__PURE__ */ o(O, {
46
46
  "aria-hidden": !0,
47
47
  height: 55,
48
48
  role: "presentation",
@@ -71,7 +71,7 @@ var vo = ({ payload: g }) => {
71
71
  size: t.logo_icon_size ?? 24,
72
72
  sx: { color: "success.contrastText" }
73
73
  })
74
- }) : c?.guid ? /* @__PURE__ */ o(H, {
74
+ }) : c?.guid ? /* @__PURE__ */ o(N, {
75
75
  logo: c,
76
76
  size: 48
77
77
  }) : null
@@ -103,7 +103,7 @@ var vo = ({ payload: g }) => {
103
103
  position: "absolute",
104
104
  zIndex: 1
105
105
  },
106
- children: /* @__PURE__ */ o(N, {
106
+ children: /* @__PURE__ */ o(E, {
107
107
  height: w,
108
108
  shouldRun: w > 0 && v > 0,
109
109
  width: v
@@ -1,7 +1,7 @@
1
1
  import a from "../../../../common/components/IconBacking.es.js";
2
- import u from "../../../components/LogoFromGuid.es.js";
2
+ import { resolveVariantConfig as u } from "../../resolveVariantConfig.es.js";
3
+ import g from "../../../components/LogoFromGuid.es.js";
3
4
  import { statusIconName as l } from "../../../components/statusIcon.es.js";
4
- import { resolveVariantConfig as g } from "../../resolveVariantConfig.es.js";
5
5
  import { getLayoutConfig as f } from "./layout.es.js";
6
6
  import { InstitutionLogo as p } from "@mxenabled/mxui";
7
7
  import { Icon as n } from "@mxenabled/mx-icons";
@@ -9,14 +9,14 @@ import { jsx as i, jsxs as s } from "react/jsx-runtime";
9
9
  import { useTheme as b } from "@mui/material/styles";
10
10
  import { Stack as c } from "@mui/material";
11
11
  var y = ({ slot: r, variant: d, logo: e }) => {
12
- const m = b(), o = g(f(m), d, "default", "AccountBlock");
12
+ const m = b(), o = u(f(m), d, "default", "AccountBlock");
13
13
  if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */ s(c, {
14
14
  sx: {
15
15
  alignItems: "center",
16
16
  flexDirection: "row",
17
17
  position: "relative"
18
18
  },
19
- children: [/* @__PURE__ */ i(u, {
19
+ children: [/* @__PURE__ */ i(g, {
20
20
  logo: e,
21
21
  size: 48
22
22
  }), o.badge && /* @__PURE__ */ i(a, {
@@ -1,5 +1,5 @@
1
- import r from "../../../components/LogoFromGuid.es.js";
2
1
  import { resolveVariantConfig as d } from "../../resolveVariantConfig.es.js";
2
+ import r from "../../../components/LogoFromGuid.es.js";
3
3
  import u from "../../../components/TransferLogoCard.es.js";
4
4
  import { accountSwitchVariant as p, getLayoutConfig as h } from "./layout.es.js";
5
5
  import { Icon as C } from "@mxenabled/mx-icons";
@@ -2,8 +2,8 @@ import { DATE_FORMATS_INTL as R, formatDate as k } from "../../../../core/consta
2
2
  import { useGlobalCopyStore as F } from "../../../../common/context/hooks.es.js";
3
3
  import { slot as f } from "../../../../core/types/Insights.es.js";
4
4
  import { formatCurrency as i, formatPercentage as N } from "../../../../core/utils/NumberFormatting.es.js";
5
- import P from "../../../components/LogoFromGuid.es.js";
6
- import { resolveVariantConfig as B } from "../../resolveVariantConfig.es.js";
5
+ import { resolveVariantConfig as P } from "../../resolveVariantConfig.es.js";
6
+ import B from "../../../components/LogoFromGuid.es.js";
7
7
  import { DepositLogo as Y } from "../../../components/ComponentBlocks/DepositLogo.es.js";
8
8
  import G from "../../../components/DebtPayoffCard.es.js";
9
9
  import j from "../../../components/TransactionListCard.es.js";
@@ -17,13 +17,13 @@ var U = 32, W = /* @__PURE__ */ new Set([
17
17
  "credit_card",
18
18
  "creditcard"
19
19
  ]), Z = (t) => W.has((t ?? "").trim().toLowerCase()) ? "credit_card" : "account_balance", $ = (t) => typeof t == "object" && t !== null && typeof t.primary_text == "string", q = (t) => !!t?.balance_label && !!t.payoff_date_label && !!t.monthly_payment_label && !!t.interest_rate_label, ct = ({ payload: t }) => {
20
- const T = z(), o = F().insights_feed?.debts_block, { instance_slot: u } = t, { data: s, variant: A } = u, _ = B(H, A, M.ProjectedPayoff, "DebtsBlock"), p = _.card === "summary", e = q(o) ? o : void 0, m = o?.total_balance_label, b = p ? !!m : !!e;
20
+ const T = z(), o = F().insights_feed?.debts_block, { instance_slot: u } = t, { data: s, variant: A } = u, _ = P(H, A, M.ProjectedPayoff, "DebtsBlock"), p = _.card === "summary", e = q(o) ? o : void 0, m = o?.total_balance_label, b = p ? !!m : !!e;
21
21
  if (V.useEffect(() => {
22
22
  b || console.warn(`debts_block: ${o ? "copy incomplete" : "copy namespace missing"}; rendering without its labelled figures`);
23
23
  }, [o, b]), p) {
24
24
  const r = f(s, "series"), O = (Array.isArray(r) ? r : []).filter($).map((a) => ({
25
25
  amount: typeof a.amount == "number" ? i(a.amount, "0,0.00") : "",
26
- leading: /* @__PURE__ */ l(P, {
26
+ leading: /* @__PURE__ */ l(B, {
27
27
  logo: a.logo,
28
28
  size: U
29
29
  }),
@@ -1,8 +1,8 @@
1
1
  import { buildDynamicCopy as l } from "../../../../core/utils/Localization.es.js";
2
2
  import { GlobalDataContext as u } from "../../../../common/context/GlobalDataProvider.es.js";
3
3
  import { slot as s } from "../../../../core/types/Insights.es.js";
4
- import c from "../../../components/LogoFromGuid.es.js";
5
- import { resolveVariantConfig as d } from "../../resolveVariantConfig.es.js";
4
+ import { resolveVariantConfig as c } from "../../resolveVariantConfig.es.js";
5
+ import d from "../../../components/LogoFromGuid.es.js";
6
6
  import g from "../../../components/DirectDepositCard.es.js";
7
7
  import { detailedAccountVariant as p, getLayoutConfig as f } from "./layout.es.js";
8
8
  import { useContext as _ } from "react";
@@ -18,10 +18,10 @@ var n = (o, r) => s(o.data, r) ?? o[r], y = (o, r) => {
18
18
  alt: r ? l(r, a) : a
19
19
  };
20
20
  }, G = ({ payload: o }) => {
21
- const r = v(), { instance_slot: t } = o, e = _(u)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, a = y(t, e), i = d(f(r), t.variant, p.Neutral, "DetailedAccountBlock");
21
+ const r = v(), { instance_slot: t } = o, e = _(u)?.globalStore.copyStore.copy.insights_feed?.general?.institution_Logo, a = y(t, e), i = c(f(r), t.variant, p.Neutral, "DetailedAccountBlock");
22
22
  return /* @__PURE__ */ m(g, {
23
23
  ...i,
24
- logo: a?.guid ? /* @__PURE__ */ m(c, {
24
+ logo: a?.guid ? /* @__PURE__ */ m(d, {
25
25
  logo: a,
26
26
  size: 48
27
27
  }) : null,
@@ -1,8 +1,8 @@
1
1
  import { slot as s } from "../../../../core/types/Insights.es.js";
2
2
  import { formatCurrency as A } from "../../../../core/utils/NumberFormatting.es.js";
3
3
  import L from "../../../components/StatusPill.es.js";
4
- import v, { isLogoGuid as S } from "../../../components/LogoFromGuid.es.js";
5
- import { resolveVariantConfig as x } from "../../resolveVariantConfig.es.js";
4
+ import { resolveVariantConfig as S } from "../../resolveVariantConfig.es.js";
5
+ import v, { isLogoGuid as x } from "../../../components/LogoFromGuid.es.js";
6
6
  import O from "../../../components/LogoClusterCard.es.js";
7
7
  import E from "../../../components/MerchantHighlightCard.es.js";
8
8
  import B from "../../../components/P2PLogoStack.es.js";
@@ -17,7 +17,7 @@ var u = 64, p = 6, z = 72, G = 3, M = [
17
17
  ], F = 32, i = (t) => typeof t == "string" ? t : void 0, g = (t) => {
18
18
  if (!t || typeof t != "object" || Array.isArray(t)) return;
19
19
  const { alt: a, color: r, fallback_guid: o, guid: n } = t;
20
- if (!(typeof n != "string" || !S(n)))
20
+ if (!(typeof n != "string" || !x(n)))
21
21
  return {
22
22
  alt: i(a),
23
23
  color: i(r),
@@ -39,7 +39,7 @@ var u = 64, p = 6, z = 72, G = 3, M = [
39
39
  logo: r,
40
40
  size: a
41
41
  }, r.guid)) : [y], J = ({ payload: t }) => {
42
- const { instance_slot: a } = t, { data: r } = a, o = x(N, a.variant, R.SingleStandard, "MerchantBlock"), n = (l) => s(r, l) ?? a[l], m = i(n("status_text")), f = o.status && m ? /* @__PURE__ */ e(L, {
42
+ const { instance_slot: a } = t, { data: r } = a, o = S(N, a.variant, R.SingleStandard, "MerchantBlock"), n = (l) => s(r, l) ?? a[l], m = i(n("status_text")), f = o.status && m ? /* @__PURE__ */ e(L, {
43
43
  icon: /* @__PURE__ */ e(_, {
44
44
  "aria-hidden": !0,
45
45
  "data-icon": "check_circle",
@@ -4,10 +4,10 @@ import { formatCurrency as C } from "../../../../core/utils/NumberFormatting.es.
4
4
  import { getCategoryColor as I } from "../../../../core/utils/CategoryUtil.es.js";
5
5
  import { useBeatActions as U } from "../../../beatActions.es.js";
6
6
  import { USER_RESPONSE as W, repeatingTransactionOf as Y } from "../../../ctaActions/subscriptionAnswer.es.js";
7
- import { logoFromRef as J } from "../../../components/shared/EntityLogo.es.js";
8
- import K from "../../../components/LogoFromGuid.es.js";
9
- import { statusIconName as Q, statusIconPalette as S } from "../../../components/statusIcon.es.js";
10
- import { resolveVariantConfig as X } from "../../resolveVariantConfig.es.js";
7
+ import { resolveVariantConfig as J } from "../../resolveVariantConfig.es.js";
8
+ import { logoFromRef as K } from "../../../components/shared/EntityLogo.es.js";
9
+ import Q from "../../../components/LogoFromGuid.es.js";
10
+ import { statusIconName as X, statusIconPalette as S } from "../../../components/statusIcon.es.js";
11
11
  import oo from "../../../components/TransactionListCard.es.js";
12
12
  import to from "../../../components/StatusMessageCard.es.js";
13
13
  import { subscriptionFrequency as ro } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
@@ -19,7 +19,7 @@ import { jsx as r } from "react/jsx-runtime";
19
19
  import { alpha as G, useTheme as uo } from "@mui/material/styles";
20
20
  import d from "@mui/material/Box";
21
21
  var u = 32, mo = Math.round(u * 0.625), lo = 24, T = 32, go = 20, fo = ({ icon: a }) => {
22
- const n = Q(a?.guid);
22
+ const n = X(a?.guid);
23
23
  return n ? /* @__PURE__ */ r(d, {
24
24
  "aria-hidden": !0,
25
25
  "data-icon": n,
@@ -41,7 +41,7 @@ var u = 32, mo = Math.round(u * 0.625), lo = 24, T = 32, go = 20, fo = ({ icon:
41
41
  })
42
42
  }) : null;
43
43
  }, po = (a, n, s, m) => {
44
- const o = J(a.logo, a.primary_text);
44
+ const o = K(a.logo, a.primary_text);
45
45
  if (o) {
46
46
  if (o.logo_name) {
47
47
  const i = !!o.logo_fill, e = o.logo_color ?? s.palette.chart.chart2 ?? s.palette.primary.main;
@@ -93,7 +93,7 @@ var u = 32, mo = Math.round(u * 0.625), lo = 24, T = 32, go = 20, fo = ({ icon:
93
93
  }
94
94
  }
95
95
  }, Fo = no(({ payload: a }) => {
96
- const n = uo(), { getTopLevelCategoryGuid: s } = H(), m = V(), { recurring: o } = P(), { beat: i } = U(), { data: e, variant: B } = a.instance_slot, { answeredBackground: p, background: l, cardVariant: L, creditAmounts: R, elevated: k, followsSubscription: g, headerColor: O, raised: A, showFooter: $, showFrequency: y, showHeader: z, statusMessage: F, sx: N, tintedCategoryLogo: M } = X(eo(n), B, io.NoHeader, "TransactionBlock"), _ = (y || g) && i ? Y({
96
+ const n = uo(), { getTopLevelCategoryGuid: s } = H(), m = V(), { recurring: o } = P(), { beat: i } = U(), { data: e, variant: B } = a.instance_slot, { answeredBackground: p, background: l, cardVariant: L, creditAmounts: R, elevated: k, followsSubscription: g, headerColor: O, raised: A, showFooter: $, showFrequency: y, showHeader: z, statusMessage: F, sx: N, tintedCategoryLogo: M } = J(eo(n), B, io.NoHeader, "TransactionBlock"), _ = (y || g) && i ? Y({
97
97
  beat: i,
98
98
  stores: m
99
99
  }) : void 0, h = !!g && _?.user_response === W.CONFIRMED;
@@ -103,7 +103,7 @@ var u = 32, mo = Math.round(u * 0.625), lo = 24, T = 32, go = 20, fo = ({ icon:
103
103
  icon: /* @__PURE__ */ r(d, {
104
104
  "aria-hidden": "true",
105
105
  sx: { display: "flex" },
106
- children: /* @__PURE__ */ r(K, {
106
+ children: /* @__PURE__ */ r(Q, {
107
107
  logo: c(e, "icon"),
108
108
  size: lo
109
109
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.116",
3
+ "version": "9.7.117",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",