@mx-cartographer/experiences 9.7.66-alpha-harini-sov2-1 → 9.7.66-alpha-harini-sov2-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 +4 -0
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js +11 -15
- package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js.map +1 -1
- package/dist/insights-v2/components/SavingsOpportunityCard.es.js +6 -5
- package/dist/insights-v2/components/SavingsOpportunityCard.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [9.7.68] - 10-30-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Savings Opportunity V2 coupon tile (`SavingsOpportunityCard`) now matches the design (WEC-1866), per design QA against Figma `Insights-V2-Development` node `1276:45964`: (1) the "Save an extra" caption is 11px/**400** in Figma but MXUI's `caption` variant renders 700, so set `sx={{ fontWeight: 400 }}` (keeps `text.secondary` — Figma caption is black @0.6); (2) the right half of the coupon used a **12px** corner radius but Figma specifies **8px** (`radii [0,8,8,0]`), so `borderTopRightRadius` / `borderBottomRightRadius` are now `8px`. The amount (`h1` = 31/700/40, text.primary) already matches Figma; no change.
|
|
4
|
+
|
|
1
5
|
## [9.7.67] - 10-29-2026
|
|
2
6
|
|
|
3
7
|
- **CHANGED** - Savings Opportunity V2 card now renders from the backend contract (WEC-1866): `SavingsOpportunityBlock` is a plain component registered under `savings_amount_block` that reads its slots off `instance_slot.data` (`primary_text`, `amount`), matching what tupac and ditto emit — it was `savings_opportunity_block` reading flat `instance_slot` fields with six speculative safety-net variants, so the card would not have rendered. ditto declares one `save_amount` variant with identical visuals, so the `createVariantBlock` dispatch and `layout.ts` are removed (as with `SaveExtraBlock` / `NoSpendDaysBlock`); the dead `instance_slot.slot` type field is dropped; `BlockType` key renamed `SavingsAmountBlock`; mock fixture, stories and block tests collapsed to the single card. The block guards its unchecked `slot()` reads — a payload without a numeric amount / string caption renders nothing rather than a fabricated `$0.00` coupon. Still to do on this story: the "Confirm Your Safety Net" drawer and the make_transfer / open_savings CTA action blocks (net-new UI, need Figma + the firefly endpoint)
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { slot as
|
|
2
|
-
import { formatCurrency as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
amount: m(o, "0,0.00"),
|
|
12
|
-
label: i,
|
|
13
|
-
slot: !0
|
|
14
|
-
})
|
|
1
|
+
import { slot as i } from "../../../../core/types/Insights.es.js";
|
|
2
|
+
import { formatCurrency as a } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import m from "../../../components/SavingsOpportunityCard.es.js";
|
|
4
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
+
var s = (t) => typeof t == "number" && Number.isFinite(t), y = ({ payload: t }) => {
|
|
6
|
+
const r = t.instance_slot?.data, o = i(r, "amount"), n = i(r, "primary_text");
|
|
7
|
+
return !s(o) || typeof n != "string" ? null : /* @__PURE__ */ e(m, {
|
|
8
|
+
amount: a(o, "0,0.00"),
|
|
9
|
+
label: n,
|
|
10
|
+
slot: !0
|
|
15
11
|
});
|
|
16
12
|
};
|
|
17
13
|
export {
|
|
18
|
-
|
|
14
|
+
y as default
|
|
19
15
|
};
|
|
20
16
|
|
|
21
17
|
//# sourceMappingURL=SavingsOpportunityBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavingsOpportunityBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"SavingsOpportunityBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.tsx"],"sourcesContent":["import { slot as readSlot, type InsightsPayload } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport SavingsOpportunityCard from '../../../components/SavingsOpportunityCard'\n\nconst isFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value)\n\n/**\n * Savings Opportunity V2 coupon (ditto `savings_amount_block`, single `save_amount` variant): reads\n * `primary_text` and `amount` off `instance_slot.data`. `slot()` is an unchecked cast, so a payload\n * that omits the amount or sends a non-number / non-string renders nothing rather than a fabricated\n * `$0.00` card (same guard as `SaveExtraBlock`).\n */\nconst SavingsOpportunityBlock = ({ payload }: { payload: InsightsPayload }) => {\n const data = payload.instance_slot?.data\n const amount = readSlot<unknown>(data, 'amount')\n const primaryText = readSlot<unknown>(data, 'primary_text')\n\n if (!isFiniteNumber(amount) || typeof primaryText !== 'string') return null\n\n return <SavingsOpportunityCard amount={formatCurrency(amount, '0,0.00')} label={primaryText} slot />\n}\n\nexport default SavingsOpportunityBlock\n"],"mappings":";;;;AAKA,IAAM,IAAA,CAAkB,MACtB,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,GAQ9C,IAAA,CAA2B,EAAE,SAAA,EAAA,MAA4C;AAC7E,QAAM,IAAO,EAAQ,eAAe,MAC9B,IAAS,EAAkB,GAAM,QAAQ,GACzC,IAAc,EAAkB,GAAM,cAAc;AAE1D,SAAI,CAAC,EAAe,CAAM,KAAK,OAAO,KAAgB,WAAiB,OAEhE,gBAAA,EAAC,GAAD;AAAA,IAAwB,QAAQ,EAAe,GAAQ,QAAQ;AAAA,IAAG,OAAO;AAAA,IAAa,MAAA;AAAA,EAAM,CAAA;AACrG"}
|
|
@@ -6,14 +6,14 @@ import { Text as i } from "@mxenabled/mxui";
|
|
|
6
6
|
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
7
7
|
import { alpha as o, useTheme as f } from "@mui/material/styles";
|
|
8
8
|
import g from "@mui/material/Box";
|
|
9
|
-
var p = 0.75, j = ({ amount: d, label:
|
|
9
|
+
var p = 0.75, j = ({ amount: d, label: s, slot: a = !0, sx: c }) => {
|
|
10
10
|
const e = f(), l = `linear-gradient(90deg, ${o(e.palette.success.main, p)}, ${o(e.palette.success.light, p)})`;
|
|
11
11
|
return /* @__PURE__ */ r(g, {
|
|
12
12
|
sx: {
|
|
13
13
|
backgroundImage: a ? l : void 0,
|
|
14
14
|
bgcolor: a ? "background.paper" : "transparent",
|
|
15
15
|
p: 16,
|
|
16
|
-
...
|
|
16
|
+
...c
|
|
17
17
|
},
|
|
18
18
|
children: /* @__PURE__ */ n(t, {
|
|
19
19
|
sx: {
|
|
@@ -44,8 +44,8 @@ var p = 0.75, j = ({ amount: d, label: c, slot: a = !0, sx: s }) => {
|
|
|
44
44
|
/* @__PURE__ */ n(t, {
|
|
45
45
|
sx: {
|
|
46
46
|
bgcolor: "background.paper",
|
|
47
|
-
borderBottomRightRadius: "
|
|
48
|
-
borderTopRightRadius: "
|
|
47
|
+
borderBottomRightRadius: "8px",
|
|
48
|
+
borderTopRightRadius: "8px",
|
|
49
49
|
height: 74,
|
|
50
50
|
justifyContent: "center",
|
|
51
51
|
px: 12,
|
|
@@ -53,8 +53,9 @@ var p = 0.75, j = ({ amount: d, label: c, slot: a = !0, sx: s }) => {
|
|
|
53
53
|
},
|
|
54
54
|
children: [/* @__PURE__ */ r(i, {
|
|
55
55
|
color: "text.secondary",
|
|
56
|
+
sx: { fontWeight: 400 },
|
|
56
57
|
variant: "caption",
|
|
57
|
-
children:
|
|
58
|
+
children: s
|
|
58
59
|
}), /* @__PURE__ */ r(i, {
|
|
59
60
|
variant: "h1",
|
|
60
61
|
children: d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavingsOpportunityCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SavingsOpportunityCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha, type SxProps, type Theme, useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Left } from './shared/images/SavingsOpportunityLeft.svg'\nimport { ReactComponent as LeftDark } from './shared/images/SavingsOpportunityLeftDark.svg'\nimport { ReactComponent as Perforation } from './shared/images/SavingsOpportunityPerforation.svg'\n\n/**\n * Figma slot: a white base layered with a `success.main → success.light` linear\n * gradient at 75% opacity (a green wash left-to-right). Both tokens are\n * theme-aware so the tint flips for dark mode. Matches the \"backgroundImage over\n * bgcolor\" pattern used across the insights-v2 Content components.\n */\nconst SLOT_GRADIENT_OPACITY = 0.75\n\ninterface SavingsOpportunityCardProps {\n amount: string\n label: string\n /** Whether to render the green gradient slot behind the coupon. Default true. */\n slot?: boolean\n sx?: SxProps<Theme>\n}\n\n/**\n * Savings Opportunity V2 content: a coupon (green wallet tile + perforation +\n * amount) on a green gradient slot. Ported from the v1 `Coupon` component\n * (`src/insights/components/shared/Coupon.tsx`) and adapted to the v2 theme.\n *\n * Figma: Savings Opportunity V2 Content (Full variant, coupon-style).\n * Scope is the Content section only.\n */\nconst SavingsOpportunityCard = ({\n amount,\n label,\n slot = true,\n sx,\n}: SavingsOpportunityCardProps) => {\n const theme = useTheme()\n const slotBackground = `linear-gradient(90deg, ${alpha(\n theme.palette.success.main,\n SLOT_GRADIENT_OPACITY,\n )}, ${alpha(theme.palette.success.light, SLOT_GRADIENT_OPACITY)})`\n\n return (\n <Box\n sx={{\n backgroundImage: slot ? slotBackground : undefined,\n bgcolor: slot ? 'background.paper' : 'transparent',\n p: 16,\n ...sx,\n }}\n >\n <Stack sx={{ flexDirection: 'row', justifyContent: 'center' }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderBottomLeftRadius: '8px',\n borderTopLeftRadius: '8px',\n p: 4,\n pr: 2,\n }}\n >\n {theme.palette.mode === 'dark' ? (\n <LeftDark aria-hidden={true} />\n ) : (\n <Left aria-hidden={true} />\n )}\n </Stack>\n <Stack\n sx={{\n svg: {\n path: {\n '&:not([stroke])': {\n fill: theme.palette.background.paper,\n },\n '&[stroke]': {\n stroke: alpha(theme.palette.divider, 0.24),\n },\n },\n rect: {\n fill: theme.palette.background.paper,\n },\n },\n }}\n >\n <Perforation aria-hidden={true} />\n </Stack>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderBottomRightRadius: '
|
|
1
|
+
{"version":3,"file":"SavingsOpportunityCard.es.js","names":[],"sources":["../../../src/insights-v2/components/SavingsOpportunityCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha, type SxProps, type Theme, useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { ReactComponent as Left } from './shared/images/SavingsOpportunityLeft.svg'\nimport { ReactComponent as LeftDark } from './shared/images/SavingsOpportunityLeftDark.svg'\nimport { ReactComponent as Perforation } from './shared/images/SavingsOpportunityPerforation.svg'\n\n/**\n * Figma slot: a white base layered with a `success.main → success.light` linear\n * gradient at 75% opacity (a green wash left-to-right). Both tokens are\n * theme-aware so the tint flips for dark mode. Matches the \"backgroundImage over\n * bgcolor\" pattern used across the insights-v2 Content components.\n */\nconst SLOT_GRADIENT_OPACITY = 0.75\n\ninterface SavingsOpportunityCardProps {\n amount: string\n label: string\n /** Whether to render the green gradient slot behind the coupon. Default true. */\n slot?: boolean\n sx?: SxProps<Theme>\n}\n\n/**\n * Savings Opportunity V2 content: a coupon (green wallet tile + perforation +\n * amount) on a green gradient slot. Ported from the v1 `Coupon` component\n * (`src/insights/components/shared/Coupon.tsx`) and adapted to the v2 theme.\n *\n * Figma: Savings Opportunity V2 Content (Full variant, coupon-style).\n * Scope is the Content section only.\n */\nconst SavingsOpportunityCard = ({\n amount,\n label,\n slot = true,\n sx,\n}: SavingsOpportunityCardProps) => {\n const theme = useTheme()\n const slotBackground = `linear-gradient(90deg, ${alpha(\n theme.palette.success.main,\n SLOT_GRADIENT_OPACITY,\n )}, ${alpha(theme.palette.success.light, SLOT_GRADIENT_OPACITY)})`\n\n return (\n <Box\n sx={{\n backgroundImage: slot ? slotBackground : undefined,\n bgcolor: slot ? 'background.paper' : 'transparent',\n p: 16,\n ...sx,\n }}\n >\n <Stack sx={{ flexDirection: 'row', justifyContent: 'center' }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderBottomLeftRadius: '8px',\n borderTopLeftRadius: '8px',\n p: 4,\n pr: 2,\n }}\n >\n {theme.palette.mode === 'dark' ? (\n <LeftDark aria-hidden={true} />\n ) : (\n <Left aria-hidden={true} />\n )}\n </Stack>\n <Stack\n sx={{\n svg: {\n path: {\n '&:not([stroke])': {\n fill: theme.palette.background.paper,\n },\n '&[stroke]': {\n stroke: alpha(theme.palette.divider, 0.24),\n },\n },\n rect: {\n fill: theme.palette.background.paper,\n },\n },\n }}\n >\n <Perforation aria-hidden={true} />\n </Stack>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderBottomRightRadius: '8px',\n borderTopRightRadius: '8px',\n height: 74,\n justifyContent: 'center',\n px: 12,\n width: 216,\n }}\n >\n {/* Figma: \"Save an extra\" caption is 11px/400 at text.secondary (black\n @0.6). MXUI's `caption` variant renders 700, so set fontWeight\n explicitly (same pattern as AccountHeroCard/AmountBreakdownCard). */}\n <Text color=\"text.secondary\" sx={{ fontWeight: 400 }} variant=\"caption\">\n {label}\n </Text>\n <Text variant=\"h1\">{amount}</Text>\n </Stack>\n </Stack>\n </Box>\n )\n}\n\nexport default SavingsOpportunityCard\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAAwB,MAkBxB,IAAA,CAA0B,EAC9B,QAAA,GACA,OAAA,GACA,MAAA,IAAO,IACP,IAAA,EAAA,MACiC;AACjC,QAAM,IAAQ,EAAS,GACjB,IAAiB,0BAA0B,EAC/C,EAAM,QAAQ,QAAQ,MACtB,CACF,CAAA,KAAM,EAAM,EAAM,QAAQ,QAAQ,OAAO,CAAqB,CAAA;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