@mx-cartographer/experiences 9.7.69 → 9.7.71-alpha-ram-usp-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 +16 -0
- package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
- package/dist/core/stores/GlobalCopyStore.es.js +14 -8
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/stores/GoalStore.d.ts +1 -1
- package/dist/core/stores/GoalStore.es.js +1 -1
- package/dist/core/stores/GoalStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
- package/dist/goals/GoalsMiniWidget.d.ts +7 -0
- package/dist/goals/{GoalsMicroWidget.es.js → GoalsMiniWidget.es.js} +14 -14
- package/dist/goals/GoalsMiniWidget.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalMicroStatusCard.d.ts → mini/GoalMiniStatusCard.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalMicroStatusCard.es.js → mini/GoalMiniStatusCard.es.js} +2 -2
- package/dist/goals/components/mini/GoalMiniStatusCard.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalsMicroEmptyState.d.ts → mini/GoalsMiniEmptyState.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalsMicroEmptyState.es.js → mini/GoalsMiniEmptyState.es.js} +2 -2
- package/dist/goals/components/mini/GoalsMiniEmptyState.es.js.map +1 -0
- package/dist/goals/index.d.ts +1 -1
- package/dist/goals/index.es.js +4 -4
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +168 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +92 -59
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +9 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js +7 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +157 -138
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +14 -1
- package/dist/insights-v2/components/CtaStatus.es.js +76 -38
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +3 -1
- package/dist/insights-v2/components/InsightTransactionRow.es.js +36 -20
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/StatusPill.es.js +12 -11
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +4 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +10 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -0
- package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +69 -49
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +10 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +27 -11
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
- package/dist/insights-v2/components/shared/elevation.es.js +15 -0
- package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +23 -9
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +73 -62
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +10 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +115 -0
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/types.d.ts +5 -2
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +6 -0
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +32 -27
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +74 -68
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +21 -17
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +91 -86
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js +44 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
- package/dist/microinsights/stores/CopyStore.d.ts +4 -1
- package/dist/microinsights/stores/CopyStore.es.js +13 -10
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/goals/GoalsMicroWidget.d.ts +0 -7
- package/dist/goals/GoalsMicroWidget.es.js.map +0 -1
- package/dist/goals/components/micro/GoalMicroStatusCard.es.js.map +0 -1
- package/dist/goals/components/micro/GoalsMicroEmptyState.es.js.map +0 -1
|
@@ -1,67 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Text as
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { jsx as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import s from "@mui/material/Stack";
|
|
2
|
+
import { Text as x } from "@mxenabled/mxui";
|
|
3
|
+
import u from "@mui/material/Button";
|
|
4
|
+
import { Icon as f } from "@mxenabled/mx-icons";
|
|
5
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
6
|
+
import { alpha as c } from "@mui/material/styles";
|
|
7
|
+
var m = {
|
|
8
|
+
main: (e) => c(e.palette.text.primary, 0.5),
|
|
9
|
+
fill: "background.paper",
|
|
10
|
+
text: "text.primary",
|
|
11
|
+
icon: (e) => c(e.palette.text.primary, 0.7)
|
|
12
|
+
}, p = (e) => (i) => {
|
|
13
|
+
const r = i.palette[e];
|
|
14
|
+
return i.palette.mode === "dark" ? r[800] ?? r.darker ?? r.dark : r[50] ?? r.lighter ?? r.light;
|
|
15
|
+
}, g = {
|
|
16
|
+
tinted: {
|
|
17
|
+
success: {
|
|
18
|
+
main: "success.main",
|
|
19
|
+
fill: "success.lighter",
|
|
20
|
+
text: "success.dark"
|
|
21
|
+
},
|
|
22
|
+
neutral: m,
|
|
23
|
+
error: {
|
|
24
|
+
main: "error.main",
|
|
25
|
+
fill: "error.lighter",
|
|
26
|
+
text: "error.dark"
|
|
27
|
+
}
|
|
16
28
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
alert: {
|
|
30
|
+
success: {
|
|
31
|
+
main: "success.main",
|
|
32
|
+
fill: p("success"),
|
|
33
|
+
text: "text.primary",
|
|
34
|
+
icon: "success.main"
|
|
35
|
+
},
|
|
36
|
+
neutral: m,
|
|
37
|
+
error: {
|
|
38
|
+
main: "error.main",
|
|
39
|
+
fill: p("error"),
|
|
40
|
+
text: "text.primary",
|
|
41
|
+
icon: "error.main"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, h = {
|
|
45
|
+
tinted: {},
|
|
46
|
+
alert: {
|
|
47
|
+
fontSize: 13,
|
|
48
|
+
fontWeight: 600,
|
|
49
|
+
lineHeight: "16px",
|
|
50
|
+
minWidth: 0,
|
|
51
|
+
px: 8,
|
|
52
|
+
py: 4
|
|
21
53
|
}
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ s
|
|
54
|
+
}, C = "CtaStatus-content", N = ({ label: e, tone: i, variant: r = "tinted", icon: l, action: a, sx: d }) => {
|
|
55
|
+
const t = g[r][i];
|
|
56
|
+
return /* @__PURE__ */ n(s, {
|
|
25
57
|
alignItems: "center",
|
|
26
58
|
direction: "row",
|
|
27
59
|
gap: 8,
|
|
28
|
-
justifyContent:
|
|
60
|
+
justifyContent: a ? "space-between" : "center",
|
|
29
61
|
sx: {
|
|
30
|
-
bgcolor:
|
|
62
|
+
bgcolor: t.fill,
|
|
31
63
|
border: "1px solid",
|
|
32
|
-
borderColor:
|
|
64
|
+
borderColor: t.main,
|
|
33
65
|
borderRadius: 1,
|
|
34
66
|
minHeight: 44,
|
|
35
67
|
px: 16,
|
|
36
|
-
py: 8
|
|
68
|
+
py: 8,
|
|
69
|
+
...d
|
|
37
70
|
},
|
|
38
|
-
children: [/* @__PURE__ */ s
|
|
71
|
+
children: [/* @__PURE__ */ n(s, {
|
|
39
72
|
alignItems: "center",
|
|
73
|
+
className: C,
|
|
40
74
|
direction: "row",
|
|
41
75
|
gap: 8,
|
|
42
76
|
role: "status",
|
|
43
|
-
children: [
|
|
77
|
+
children: [l && /* @__PURE__ */ o(f, {
|
|
44
78
|
"aria-hidden": !0,
|
|
45
79
|
fill: !0,
|
|
46
|
-
name:
|
|
80
|
+
name: l,
|
|
47
81
|
size: 24,
|
|
48
|
-
sx: { color:
|
|
49
|
-
}), /* @__PURE__ */
|
|
82
|
+
sx: { color: t.icon ?? t.main }
|
|
83
|
+
}), /* @__PURE__ */ o(x, {
|
|
50
84
|
bold: !0,
|
|
51
|
-
sx: { color:
|
|
85
|
+
sx: { color: t.text },
|
|
52
86
|
variant: "body1",
|
|
53
|
-
children:
|
|
87
|
+
children: e
|
|
54
88
|
})]
|
|
55
|
-
}),
|
|
56
|
-
onClick:
|
|
89
|
+
}), a && /* @__PURE__ */ o(u, {
|
|
90
|
+
onClick: a.onPress,
|
|
57
91
|
size: "small",
|
|
58
|
-
sx: {
|
|
59
|
-
|
|
92
|
+
sx: {
|
|
93
|
+
color: t.text,
|
|
94
|
+
...h[r]
|
|
95
|
+
},
|
|
96
|
+
children: a.label
|
|
60
97
|
})]
|
|
61
98
|
});
|
|
62
99
|
};
|
|
63
100
|
export {
|
|
64
|
-
|
|
101
|
+
C as CTA_STATUS_CONTENT_CLASS,
|
|
102
|
+
N as CtaStatus
|
|
65
103
|
};
|
|
66
104
|
|
|
67
105
|
//# sourceMappingURL=CtaStatus.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nexport type CtaStatusTone = 'success' | 'neutral' | 'error'\n\nexport interface CtaStatusProps {\n /** The words, from the backend (copy or a slot) so they stay localized and customizable. */\n label: string\n /** Background, border, icon and text colours. */\n tone: CtaStatusTone\n /** mx-icons name, drawn filled and hidden from assistive technology. */\n icon?: string\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"). */\n action?: { label: string; onPress: () => void }\n}\n\n
|
|
1
|
+
{"version":3,"file":"CtaStatus.es.js","names":[],"sources":["../../../src/insights-v2/components/CtaStatus.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport { alpha, type SxProps, type Theme } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nexport type CtaStatusTone = 'success' | 'neutral' | 'error'\n\n/**\n * How the status is drawn. `tinted` (default): a toned fill with toned text (Designate's \"Account\n * Saved!\"). `alert`: Figma's `<Alert>`: the alert background, `text.primary` words and a small\n * 13/16 action (Subscription Status's \"Subscribed | Undo\"). A new design adds a variant here; a CTA\n * step picks one through its presenter.\n */\nexport type CtaStatusVariant = 'tinted' | 'alert'\n\nexport interface CtaStatusProps {\n /** The words, from the backend (copy or a slot) so they stay localized and customizable. */\n label: string\n /** Background, border, icon and text colours. */\n tone: CtaStatusTone\n /** Which status design to draw; defaults to `tinted`. */\n variant?: CtaStatusVariant\n /** mx-icons name, drawn filled and hidden from assistive technology. */\n icon?: string\n /** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */\n sx?: SxProps\n /** An inline button inside the status (e.g. Subscription Detected's \"Undo\"). */\n action?: { label: string; onPress: () => void }\n}\n\ntype ToneColor = string | ((theme: Theme) => string)\n\ninterface ToneColors {\n main: ToneColor\n fill: ToneColor\n text: ToneColor\n icon?: ToneColor\n}\n\n// Neutral in both variants: paper fill, a 50% / 70% `text.primary` border and icon, so it reads on\n// a light card (black) and a dark one (white).\nconst NEUTRAL: ToneColors = {\n main: (theme) => alpha(theme.palette.text.primary, 0.5),\n fill: 'background.paper',\n text: 'text.primary',\n icon: (theme) => alpha(theme.palette.text.primary, 0.7),\n}\n\n// The alert background per mode (Figma `_components/alert/<tone>/background`): the palette's 50 /\n// 800 steps, falling back to `lighter` / `darker` for a theme without the scale.\nconst alertFill =\n (tone: 'success' | 'error'): ToneColor =>\n (theme) => {\n const color = theme.palette[tone]\n\n return theme.palette.mode === 'dark'\n ? (color[800] ?? color.darker ?? color.dark)\n : (color[50] ?? color.lighter ?? color.light)\n }\n\nconst TONE_COLORS: Record<CtaStatusVariant, Record<CtaStatusTone, ToneColors>> = {\n tinted: {\n success: { main: 'success.main', fill: 'success.lighter', text: 'success.dark' },\n neutral: NEUTRAL,\n error: { main: 'error.main', fill: 'error.lighter', text: 'error.dark' },\n },\n alert: {\n success: {\n main: 'success.main',\n fill: alertFill('success'),\n text: 'text.primary',\n icon: 'success.main',\n },\n neutral: NEUTRAL,\n error: {\n main: 'error.main',\n fill: alertFill('error'),\n text: 'text.primary',\n icon: 'error.main',\n },\n },\n}\n\n// The inline action per variant. `alert`: Figma's 13/16 semibold button, padding 4/8.\nconst ACTION_SX: Record<CtaStatusVariant, SxProps<Theme>> = {\n tinted: {},\n alert: { fontSize: 13, fontWeight: 600, lineHeight: '16px', minWidth: 0, px: 8, py: 4 },\n}\n\n/**\n * A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a\n * control itself (`role=\"status\"`); only the optional inline `action` is pressable.\n */\n// Stable class on the inner (icon + label) row, so a caller's `sx` can target it:\n// `{ [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 } }`.\nexport const CTA_STATUS_CONTENT_CLASS = 'CtaStatus-content'\n\nexport const CtaStatus = ({\n label,\n tone,\n variant = 'tinted',\n icon,\n action,\n sx,\n}: CtaStatusProps) => {\n const colors = TONE_COLORS[variant][tone]\n\n return (\n <Stack\n alignItems=\"center\"\n direction=\"row\"\n gap={8}\n justifyContent={action ? 'space-between' : 'center'}\n sx={{\n bgcolor: colors.fill,\n border: '1px solid',\n borderColor: colors.main,\n borderRadius: 1,\n minHeight: 44,\n px: 16,\n py: 8,\n ...sx,\n }}\n >\n <Stack\n alignItems=\"center\"\n className={CTA_STATUS_CONTENT_CLASS}\n direction=\"row\"\n gap={8}\n role=\"status\"\n >\n {icon && (\n <Icon\n aria-hidden={true}\n fill={true}\n name={icon}\n size={24}\n sx={{ color: colors.icon ?? colors.main }}\n />\n )}\n <Text bold={true} sx={{ color: colors.text }} variant=\"body1\">\n {label}\n </Text>\n </Stack>\n {action && (\n <Button\n onClick={action.onPress}\n size=\"small\"\n sx={{ color: colors.text, ...ACTION_SX[variant] }}\n >\n {action.label}\n </Button>\n )}\n </Stack>\n )\n}\n"],"mappings":";;;;;;AA2CA,IAAM,IAAsB;AAAA,EAC1B,MAAA,CAAO,MAAU,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAA,CAAO,MAAU,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AACxD,GAIM,IAAA,CACH,MAAA,CACA,MAAU;AACT,QAAM,IAAQ,EAAM,QAAQ,CAAA;AAE5B,SAAO,EAAM,QAAQ,SAAS,SACzB,EAAM,GAAA,KAAQ,EAAM,UAAU,EAAM,OACpC,EAAM,EAAA,KAAO,EAAM,WAAW,EAAM;AAC3C,GAEI,IAA2E;AAAA,EAC/E,QAAQ;AAAA,IACN,SAAS;AAAA,MAAE,MAAM;AAAA,MAAgB,MAAM;AAAA,MAAmB,MAAM;AAAA,IAAe;AAAA,IAC/E,SAAS;AAAA,IACT,OAAO;AAAA,MAAE,MAAM;AAAA,MAAc,MAAM;AAAA,MAAiB,MAAM;AAAA,IAAa;AAAA,EACzE;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,MAAM,EAAU,SAAS;AAAA,MACzB,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,IACT,OAAO;AAAA,MACL,MAAM;AAAA,MACN,MAAM,EAAU,OAAO;AAAA,MACvB,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AACF,GAGM,IAAsD;AAAA,EAC1D,QAAQ,CAAC;AAAA,EACT,OAAO;AAAA,IAAE,UAAU;AAAA,IAAI,YAAY;AAAA,IAAK,YAAY;AAAA,IAAQ,UAAU;AAAA,IAAG,IAAI;AAAA,IAAG,IAAI;AAAA,EAAE;AACxF,GAQa,IAA2B,qBAE3B,IAAA,CAAa,EACxB,OAAA,GACA,MAAA,GACA,SAAA,IAAU,UACV,MAAA,GACA,QAAA,GACA,IAAA,EAAA,MACoB;AACpB,QAAM,IAAS,EAAY,CAAA,EAAS,CAAA;AAEpC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAW;AAAA,IACX,WAAU;AAAA,IACV,KAAK;AAAA,IACL,gBAAgB,IAAS,kBAAkB;AAAA,IAC3C,IAAI;AAAA,MACF,SAAS,EAAO;AAAA,MAChB,QAAQ;AAAA,MACR,aAAa,EAAO;AAAA,MACpB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,GAAG;AAAA,IACL;AAAA,IAdF,UAAA,CAgBE,gBAAA,EAAC,GAAD;AAAA,MACE,YAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAK;AAAA,MALP,UAAA,CAOG,KACC,gBAAA,EAAC,GAAD;AAAA,QACE,eAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,IAAI,EAAE,OAAO,EAAO,QAAQ,EAAO,KAAK;AAAA,MACzC,CAAA,GAEH,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,IAAI,EAAE,OAAO,EAAO,KAAK;AAAA,QAAG,SAAQ;AAAA,QACnD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,SAAS,EAAO;AAAA,MAChB,MAAK;AAAA,MACL,IAAI;AAAA,QAAE,OAAO,EAAO;AAAA,QAAM,GAAG,EAAU,CAAA;AAAA,MAAS;AAAA,MAE/C,UAAA,EAAO;AAAA,IACF,CAAA,CAEL;AAAA;AAEX"}
|
|
@@ -11,6 +11,8 @@ export interface InsightTransactionRowProps {
|
|
|
11
11
|
amount: ReactNode;
|
|
12
12
|
/** Theme token for the amount text (e.g. 'success.main' for credits). */
|
|
13
13
|
amountColor?: string;
|
|
14
|
+
/** Caption under the amount (e.g. frequency). */
|
|
15
|
+
amountCaption?: ReactNode;
|
|
14
16
|
sx?: SxProps;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
@@ -19,5 +21,5 @@ export interface InsightTransactionRowProps {
|
|
|
19
21
|
* `InsightTransactionRow` to avoid colliding with the transactions widget's
|
|
20
22
|
* public `TransactionRow` export.
|
|
21
23
|
*/
|
|
22
|
-
declare const InsightTransactionRow: ({ amount, amountColor, leading, subtitle, title, sx, }: InsightTransactionRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const InsightTransactionRow: ({ amount, amountCaption, amountColor, leading, subtitle, title, sx, }: InsightTransactionRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export default InsightTransactionRow;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import t from "@mui/material/Stack";
|
|
2
|
-
import { Text as
|
|
3
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { Text as e } from "@mxenabled/mxui";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import m from "@mui/material/Box";
|
|
5
|
-
var
|
|
5
|
+
var u = ({ amount: o, amountCaption: n, amountColor: l = "text.primary", leading: a, subtitle: c, title: x, sx: s }) => /* @__PURE__ */ i(t, {
|
|
6
6
|
sx: {
|
|
7
7
|
alignItems: "flex-start",
|
|
8
8
|
flexDirection: "row",
|
|
@@ -10,9 +10,9 @@ var f = ({ amount: o, amountColor: a = "text.primary", leading: n, subtitle: l,
|
|
|
10
10
|
px: 16,
|
|
11
11
|
py: 14,
|
|
12
12
|
width: "100%",
|
|
13
|
-
...
|
|
13
|
+
...s
|
|
14
14
|
},
|
|
15
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ i(t, {
|
|
16
16
|
sx: {
|
|
17
17
|
alignItems: "center",
|
|
18
18
|
flexDirection: "row",
|
|
@@ -20,37 +20,53 @@ var f = ({ amount: o, amountColor: a = "text.primary", leading: n, subtitle: l,
|
|
|
20
20
|
gap: 12,
|
|
21
21
|
minWidth: 0
|
|
22
22
|
},
|
|
23
|
-
children: [
|
|
23
|
+
children: [a && /* @__PURE__ */ r(m, {
|
|
24
24
|
sx: { flexShrink: 0 },
|
|
25
|
-
children:
|
|
26
|
-
}), /* @__PURE__ */
|
|
25
|
+
children: a
|
|
26
|
+
}), /* @__PURE__ */ i(t, {
|
|
27
27
|
sx: { minWidth: 0 },
|
|
28
|
-
children: [/* @__PURE__ */ r(
|
|
28
|
+
children: [/* @__PURE__ */ r(e, {
|
|
29
29
|
bold: !0,
|
|
30
30
|
truncate: !0,
|
|
31
31
|
variant: "body1",
|
|
32
32
|
children: x
|
|
33
|
-
}), /* @__PURE__ */ r(
|
|
33
|
+
}), /* @__PURE__ */ r(e, {
|
|
34
34
|
color: "text.primary",
|
|
35
35
|
truncate: !0,
|
|
36
36
|
variant: "caption",
|
|
37
|
-
children:
|
|
37
|
+
children: c
|
|
38
38
|
})]
|
|
39
39
|
})]
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
-
bold: !0,
|
|
42
|
-
color: a,
|
|
40
|
+
}), /* @__PURE__ */ i(t, {
|
|
43
41
|
sx: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
letterSpacing: "-0.15px"
|
|
42
|
+
alignItems: "flex-end",
|
|
43
|
+
flexShrink: 0
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
children: [/* @__PURE__ */ r(e, {
|
|
46
|
+
bold: !0,
|
|
47
|
+
color: l,
|
|
48
|
+
sx: {
|
|
49
|
+
fontVariantNumeric: "lining-nums tabular-nums",
|
|
50
|
+
letterSpacing: "-0.15px"
|
|
51
|
+
},
|
|
52
|
+
variant: "body1",
|
|
53
|
+
children: o
|
|
54
|
+
}), n && /* @__PURE__ */ r(e, {
|
|
55
|
+
color: "text.secondary",
|
|
56
|
+
sx: {
|
|
57
|
+
fontSize: 9,
|
|
58
|
+
fontWeight: 700,
|
|
59
|
+
letterSpacing: "0.03em",
|
|
60
|
+
lineHeight: "12px",
|
|
61
|
+
textTransform: "uppercase"
|
|
62
|
+
},
|
|
63
|
+
variant: "caption",
|
|
64
|
+
children: n
|
|
65
|
+
})]
|
|
50
66
|
})]
|
|
51
67
|
});
|
|
52
68
|
export {
|
|
53
|
-
|
|
69
|
+
u as default
|
|
54
70
|
};
|
|
55
71
|
|
|
56
72
|
//# sourceMappingURL=InsightTransactionRow.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightTransactionRow.es.js","names":[],"sources":["../../../src/insights-v2/components/InsightTransactionRow.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface InsightTransactionRowProps {\n /** Leading visual: merchant/institution logo, category icon, or date badge. */\n leading?: ReactNode\n /** Primary line (e.g. merchant, payee, transaction name). */\n title: ReactNode\n /** Secondary line beneath the title (e.g. category). */\n subtitle: ReactNode\n /** Trailing amount, pre-formatted by the caller. */\n amount: ReactNode\n /** Theme token for the amount text (e.g. 'success.main' for credits). */\n amountColor?: string\n sx?: SxProps\n}\n\n/**\n * A single transaction/list row for the insights-v2 transaction-list family:\n * leading visual + title/subtitle on the left, amount on the right. Named\n * `InsightTransactionRow` to avoid colliding with the transactions widget's\n * public `TransactionRow` export.\n */\nconst InsightTransactionRow = ({\n amount,\n amountColor = 'text.primary',\n leading,\n subtitle,\n title,\n sx,\n}: InsightTransactionRowProps) => (\n <Stack\n sx={{\n // The amount shares the title's top line while the subtitle sits below, so\n // the row is top-aligned and the inner left group is centered.\n alignItems: 'flex-start',\n flexDirection: 'row',\n gap: 16,\n px: 16,\n py: 14,\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n {leading && <Box sx={{ flexShrink: 0 }}>{leading}</Box>}\n <Stack sx={{ minWidth: 0 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text color=\"text.primary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n </Stack>\n </Stack>\n {/* Figma `typography/body1 (bold tabular)`: tabular figures so amounts align column-wise. */}\n <Text\n
|
|
1
|
+
{"version":3,"file":"InsightTransactionRow.es.js","names":[],"sources":["../../../src/insights-v2/components/InsightTransactionRow.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nexport interface InsightTransactionRowProps {\n /** Leading visual: merchant/institution logo, category icon, or date badge. */\n leading?: ReactNode\n /** Primary line (e.g. merchant, payee, transaction name). */\n title: ReactNode\n /** Secondary line beneath the title (e.g. category). */\n subtitle: ReactNode\n /** Trailing amount, pre-formatted by the caller. */\n amount: ReactNode\n /** Theme token for the amount text (e.g. 'success.main' for credits). */\n amountColor?: string\n /** Caption under the amount (e.g. frequency). */\n amountCaption?: ReactNode\n sx?: SxProps\n}\n\n/**\n * A single transaction/list row for the insights-v2 transaction-list family:\n * leading visual + title/subtitle on the left, amount on the right. Named\n * `InsightTransactionRow` to avoid colliding with the transactions widget's\n * public `TransactionRow` export.\n */\nconst InsightTransactionRow = ({\n amount,\n amountCaption,\n amountColor = 'text.primary',\n leading,\n subtitle,\n title,\n sx,\n}: InsightTransactionRowProps) => (\n <Stack\n sx={{\n // The amount shares the title's top line while the subtitle sits below, so\n // the row is top-aligned and the inner left group is centered.\n alignItems: 'flex-start',\n flexDirection: 'row',\n gap: 16,\n px: 16,\n py: 14,\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n {leading && <Box sx={{ flexShrink: 0 }}>{leading}</Box>}\n <Stack sx={{ minWidth: 0 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {title}\n </Text>\n <Text color=\"text.primary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n </Stack>\n </Stack>\n {/* Figma `typography/body1 (bold tabular)`: tabular figures so amounts align column-wise. */}\n <Stack sx={{ alignItems: 'flex-end', flexShrink: 0 }}>\n <Text\n bold={true}\n color={amountColor}\n sx={{\n fontVariantNumeric: 'lining-nums tabular-nums',\n letterSpacing: '-0.15px',\n }}\n variant=\"body1\"\n >\n {amount}\n </Text>\n {/* Frequency caption. */}\n {amountCaption && (\n <Text\n color=\"text.secondary\"\n sx={{\n fontSize: 9,\n fontWeight: 700,\n letterSpacing: '0.03em',\n lineHeight: '12px',\n textTransform: 'uppercase',\n }}\n variant=\"caption\"\n >\n {amountCaption}\n </Text>\n )}\n </Stack>\n </Stack>\n)\n\nexport default InsightTransactionRow\n"],"mappings":";;;;AA8BA,IAAM,IAAA,CAAyB,EAC7B,QAAA,GACA,eAAA,GACA,aAAA,IAAc,gBACd,SAAA,GACA,UAAA,GACA,OAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAGF,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,GAAG;AAAA,EACL;AAAA,EAXF,UAAA,CAaE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,MAAG,KAAK;AAAA,MAAI,UAAU;AAAA,IAAE;AAAA,IAA3F,UAAA,CACG,KAAW,gBAAA,EAAC,GAAD;AAAA,MAAK,IAAI,EAAE,YAAY,EAAE;AAAA,MAAI,UAAA;AAAA,IAAa,CAAA,GACtD,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,UAAU,EAAE;AAAA,MAAzB,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM;AAAA,QAAM,UAAU;AAAA,QAAM,SAAQ;AAAA,QACvC,UAAA;AAAA,MACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAe,UAAU;AAAA,QAAM,SAAQ;AAAA,QAChD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACF,CAAA,CAAA;AAAA,EAEP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAY,YAAY;AAAA,IAAE;AAAA,IAAnD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,OAAO;AAAA,MACP,IAAI;AAAA,QACF,oBAAoB;AAAA,QACpB,eAAe;AAAA,MACjB;AAAA,MACA,SAAQ;AAAA,MAEP,UAAA;AAAA,IACG,CAAA,GAEL,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,OAAM;AAAA,MACN,IAAI;AAAA,QACF,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,eAAe;AAAA,MACjB;AAAA,MACA,SAAQ;AAAA,MAEP,UAAA;AAAA,IACG,CAAA,CAEH;AAAA,EACF,CAAA,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { STATUS_SUCCESS_TOKENS as o } from "./statusTokens.es.js";
|
|
2
2
|
import u from "@mui/material/Stack";
|
|
3
3
|
import { Text as p } from "@mxenabled/mxui";
|
|
4
|
-
import { jsx as x, jsxs as
|
|
5
|
-
var
|
|
4
|
+
import { jsx as x, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
var c = ({ bgcolor: e = o.bgcolor, borderColor: i = o.borderColor, icon: a, label: l, labelColor: n = o.textColor, labelVariant: s = "subtitle2", onClick: r, sx: d, "data-testid": f }) => /* @__PURE__ */ g(u, {
|
|
6
6
|
"data-testid": f,
|
|
7
|
-
onClick:
|
|
8
|
-
onKeyDown:
|
|
9
|
-
|
|
7
|
+
onClick: r,
|
|
8
|
+
onKeyDown: r ? (t) => {
|
|
9
|
+
t.target === t.currentTarget && (t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), r?.(t)));
|
|
10
10
|
} : void 0,
|
|
11
|
-
role:
|
|
11
|
+
role: r ? "button" : void 0,
|
|
12
12
|
sx: {
|
|
13
13
|
alignItems: "center",
|
|
14
14
|
alignSelf: "flex-start",
|
|
@@ -21,22 +21,23 @@ var h = ({ bgcolor: e = o.bgcolor, borderColor: i = o.borderColor, icon: a, labe
|
|
|
21
21
|
minHeight: 24,
|
|
22
22
|
px: 16,
|
|
23
23
|
py: 2,
|
|
24
|
-
...
|
|
24
|
+
...r && { "&:focus-visible": {
|
|
25
25
|
outline: "2px solid",
|
|
26
26
|
outlineColor: "info.main",
|
|
27
27
|
outlineOffset: 2
|
|
28
28
|
} },
|
|
29
|
-
...
|
|
29
|
+
...d
|
|
30
30
|
},
|
|
31
|
-
tabIndex:
|
|
31
|
+
tabIndex: r ? 0 : void 0,
|
|
32
32
|
children: [a, /* @__PURE__ */ x(p, {
|
|
33
|
-
color:
|
|
33
|
+
color: n,
|
|
34
|
+
sx: { fontWeight: "fontWeightRegular" },
|
|
34
35
|
variant: s,
|
|
35
36
|
children: l
|
|
36
37
|
})]
|
|
37
38
|
});
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
c as default
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
//# sourceMappingURL=StatusPill.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusPill.es.js","names":[],"sources":["../../../src/insights-v2/components/StatusPill.tsx"],"sourcesContent":["import type { KeyboardEvent, ReactNode, SyntheticEvent } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { STATUS_SUCCESS_TOKENS } from './statusTokens'\n\ninterface StatusPillProps {\n /** Pill label. */\n label: ReactNode\n /** Optional leading icon (e.g. a check-circle). */\n icon?: ReactNode\n /** Pill background color token. */\n bgcolor?: string\n /** Pill border color token. */\n borderColor?: string\n /** Label color token. */\n labelColor?: string\n /** Label typography. Default `subtitle2`; the transaction-row pill uses `caption`. */\n labelVariant?: 'subtitle2' | 'caption'\n /**\n * Makes the pill tappable (the transaction-row pill posts the beat to the host). The pill then\n * exposes `role=\"button\"`, is focusable, and also fires on Enter and Space, so the handler gets a\n * mouse or a keyboard event.\n */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void\n 'data-testid'?: string\n sx?: SxProps\n}\n\n/**\n * A small rounded status pill: optional icon + label on a tinted, bordered\n * surface.\n *\n * Figma: the \"Categorized\" pill in Peer-to-Peer Categorization (`success.100`\n * bg, `success.main` border, radius 999, 24px tall, check icon + `success.darker`\n * `typography/subtitle2` label — regular weight, NOT bold). Reusable for any\n * inline status.\n */\nconst StatusPill = ({\n bgcolor = STATUS_SUCCESS_TOKENS.bgcolor,\n borderColor = STATUS_SUCCESS_TOKENS.borderColor,\n icon,\n label,\n labelColor = STATUS_SUCCESS_TOKENS.textColor,\n labelVariant = 'subtitle2',\n onClick,\n sx,\n 'data-testid': testId,\n}: StatusPillProps) => {\n // Only when the pill itself has focus: a key pressed inside it would be a child's own. Stopping\n // the event keeps a clickable row around the pill from also acting on the same keystroke.\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n if (event.key !== 'Enter' && event.key !== ' ') return\n\n event.preventDefault()\n event.stopPropagation()\n onClick?.(event)\n }\n\n return (\n <Stack\n data-testid={testId}\n onClick={onClick}\n onKeyDown={onClick ? handleKeyDown : undefined}\n role={onClick ? 'button' : undefined}\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor,\n border: '1px solid',\n borderColor,\n borderRadius: 999,\n flexDirection: 'row',\n gap: 6,\n minHeight: 24,\n px: 16,\n py: 2,\n // The same focus ring the theme's MuiButton draws.\n ...(onClick && {\n '&:focus-visible': { outline: '2px solid', outlineColor: 'info.main', outlineOffset: 2 },\n }),\n ...sx,\n }}\n tabIndex={onClick ? 0 : undefined}\n >\n {icon}\n <Text color={labelColor} variant={labelVariant}>\n {label}\n </Text>\n </Stack>\n )\n}\n\nexport default StatusPill\n"],"mappings":";;;;AAyCA,IAAM,IAAA,CAAc,EAClB,SAAA,IAAU,EAAsB,SAChC,aAAA,IAAc,EAAsB,aACpC,MAAA,GACA,OAAA,GACA,YAAA,IAAa,EAAsB,WACnC,cAAA,IAAe,aACf,SAAA,GACA,IAAA,GACA,eAAe,EAAA,MAcb,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACJ,SAAA;AAAA,EACT,WAAW,IAbT,CAAiB,MAAyC;AAC9D,IAAI,EAAM,WAAW,EAAM,kBACvB,EAAM,QAAQ,WAAW,EAAM,QAAQ,QAE3C,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,IAAU,CAAK;AAAA,EACjB,IAMyC;AAAA,EACrC,MAAM,IAAU,WAAW;AAAA,EAC3B,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAA;AAAA,IACA,QAAQ;AAAA,IACR,aAAA;AAAA,IACA,cAAc;AAAA,IACd,eAAe;AAAA,IACf,KAAK;AAAA,IACL,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,IAAI;AAAA,IAEJ,GAAI,KAAW,EACb,mBAAmB;AAAA,MAAE,SAAS;AAAA,MAAa,cAAc;AAAA,MAAa,eAAe;AAAA,IAAE,EACzF;AAAA,IACA,GAAG;AAAA,EACL;AAAA,EACA,UAAU,IAAU,IAAI;AAAA,EAvB1B,UAAA,CAyBG,
|
|
1
|
+
{"version":3,"file":"StatusPill.es.js","names":[],"sources":["../../../src/insights-v2/components/StatusPill.tsx"],"sourcesContent":["import type { KeyboardEvent, ReactNode, SyntheticEvent } from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { STATUS_SUCCESS_TOKENS } from './statusTokens'\n\ninterface StatusPillProps {\n /** Pill label. */\n label: ReactNode\n /** Optional leading icon (e.g. a check-circle). */\n icon?: ReactNode\n /** Pill background color token. */\n bgcolor?: string\n /** Pill border color token. */\n borderColor?: string\n /** Label color token. */\n labelColor?: string\n /** Label typography. Default `subtitle2`; the transaction-row pill uses `caption`. */\n labelVariant?: 'subtitle2' | 'caption'\n /**\n * Makes the pill tappable (the transaction-row pill posts the beat to the host). The pill then\n * exposes `role=\"button\"`, is focusable, and also fires on Enter and Space, so the handler gets a\n * mouse or a keyboard event.\n */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void\n 'data-testid'?: string\n sx?: SxProps\n}\n\n/**\n * A small rounded status pill: optional icon + label on a tinted, bordered\n * surface.\n *\n * Figma: the \"Categorized\" pill in Peer-to-Peer Categorization (`success.100`\n * bg, `success.main` border, radius 999, 24px tall, check icon + `success.darker`\n * `typography/subtitle2` label — regular weight, NOT bold). Reusable for any\n * inline status.\n */\nconst StatusPill = ({\n bgcolor = STATUS_SUCCESS_TOKENS.bgcolor,\n borderColor = STATUS_SUCCESS_TOKENS.borderColor,\n icon,\n label,\n labelColor = STATUS_SUCCESS_TOKENS.textColor,\n labelVariant = 'subtitle2',\n onClick,\n sx,\n 'data-testid': testId,\n}: StatusPillProps) => {\n // Only when the pill itself has focus: a key pressed inside it would be a child's own. Stopping\n // the event keeps a clickable row around the pill from also acting on the same keystroke.\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n if (event.key !== 'Enter' && event.key !== ' ') return\n\n event.preventDefault()\n event.stopPropagation()\n onClick?.(event)\n }\n\n return (\n <Stack\n data-testid={testId}\n onClick={onClick}\n onKeyDown={onClick ? handleKeyDown : undefined}\n role={onClick ? 'button' : undefined}\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor,\n border: '1px solid',\n borderColor,\n borderRadius: 999,\n flexDirection: 'row',\n gap: 6,\n minHeight: 24,\n px: 16,\n py: 2,\n // The same focus ring the theme's MuiButton draws.\n ...(onClick && {\n '&:focus-visible': { outline: '2px solid', outlineColor: 'info.main', outlineOffset: 2 },\n }),\n ...sx,\n }}\n tabIndex={onClick ? 0 : undefined}\n >\n {icon}\n {/* Figma: regular weight. MXUI `subtitle2` sets none, so the host page's 500 would show. */}\n <Text color={labelColor} sx={{ fontWeight: 'fontWeightRegular' }} variant={labelVariant}>\n {label}\n </Text>\n </Stack>\n )\n}\n\nexport default StatusPill\n"],"mappings":";;;;AAyCA,IAAM,IAAA,CAAc,EAClB,SAAA,IAAU,EAAsB,SAChC,aAAA,IAAc,EAAsB,aACpC,MAAA,GACA,OAAA,GACA,YAAA,IAAa,EAAsB,WACnC,cAAA,IAAe,aACf,SAAA,GACA,IAAA,GACA,eAAe,EAAA,MAcb,gBAAA,EAAC,GAAD;AAAA,EACE,eAAa;AAAA,EACJ,SAAA;AAAA,EACT,WAAW,IAbT,CAAiB,MAAyC;AAC9D,IAAI,EAAM,WAAW,EAAM,kBACvB,EAAM,QAAQ,WAAW,EAAM,QAAQ,QAE3C,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,IAAU,CAAK;AAAA,EACjB,IAMyC;AAAA,EACrC,MAAM,IAAU,WAAW;AAAA,EAC3B,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAA;AAAA,IACA,QAAQ;AAAA,IACR,aAAA;AAAA,IACA,cAAc;AAAA,IACd,eAAe;AAAA,IACf,KAAK;AAAA,IACL,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,IAAI;AAAA,IAEJ,GAAI,KAAW,EACb,mBAAmB;AAAA,MAAE,SAAS;AAAA,MAAa,cAAc;AAAA,MAAa,eAAe;AAAA,IAAE,EACzF;AAAA,IACA,GAAG;AAAA,EACL;AAAA,EACA,UAAU,IAAU,IAAI;AAAA,EAvB1B,UAAA,CAyBG,GAED,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAO;AAAA,IAAY,IAAI,EAAE,YAAY,oBAAoB;AAAA,IAAG,SAAS;AAAA,IACxE,UAAA;AAAA,EACG,CAAA,CACD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RepeatingTransaction } from '../../../core/types/RepeatingTransaction';
|
|
2
|
+
import { RecurringCopy } from '../../../core/types/localization/RecurringCopy';
|
|
3
|
+
/** Frequency word from `recurrence_type`; unknown → undefined. */
|
|
4
|
+
export declare const subscriptionFrequency: (copy: RecurringCopy | undefined, repeating: RepeatingTransaction | undefined) => string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getFrequencyLabel as u } from "../../../core/utils/RecurringTransactionsUtil.es.js";
|
|
2
|
+
var t = (e, r) => {
|
|
3
|
+
if (!(!e || !r || !r.recurrence_type))
|
|
4
|
+
return u(e, r, !1) || void 0;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
t as subscriptionFrequency
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=subscriptionFrequency.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptionFrequency.es.js","names":[],"sources":["../../../../src/insights-v2/components/SubscriptionStatus/subscriptionFrequency.ts"],"sourcesContent":["import type { RepeatingTransaction } from '../../../core/types/RepeatingTransaction'\nimport type { RecurringCopy } from '../../../core/types/localization/RecurringCopy'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\n\n/** Frequency word from `recurrence_type`; unknown → undefined. */\nexport const subscriptionFrequency = (\n copy: RecurringCopy | undefined,\n repeating: RepeatingTransaction | undefined,\n): string | undefined => {\n if (!copy || !repeating || !repeating.recurrence_type) return undefined\n\n return getFrequencyLabel(copy, repeating, false) || undefined\n}\n"],"mappings":";AAKA,IAAa,IAAA,CACX,GACA,MACuB;AACvB,MAAI,GAAC,KAAQ,CAAC,KAAa,CAAC,EAAU;AAEtC,WAAO,EAAkB,GAAM,GAAW,EAAK,KAAK;AACtD"}
|
|
@@ -32,6 +32,10 @@ interface TransactionListCardProps {
|
|
|
32
32
|
* on a white surface inside the padded Slot (Figma HSA Deposit).
|
|
33
33
|
*/
|
|
34
34
|
background?: string;
|
|
35
|
+
/** Status disc over the card's corner (needs `background`). */
|
|
36
|
+
badge?: ReactNode;
|
|
37
|
+
/** Card shadow on the wash. */
|
|
38
|
+
elevated?: boolean;
|
|
35
39
|
sx?: SxProps;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
@@ -41,5 +45,5 @@ interface TransactionListCardProps {
|
|
|
41
45
|
*
|
|
42
46
|
* Scope is the Content section only; Header/Description are out of scope.
|
|
43
47
|
*/
|
|
44
|
-
declare const TransactionListCard: ({ background, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
declare const TransactionListCard: ({ background, badge, elevated, footer, header, rows, variant, sx, }: TransactionListCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
45
49
|
export default TransactionListCard;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import R from "./InsightTransactionRow.es.js";
|
|
2
|
+
import { ELEVATION_SHADOW as k, elevationOverlay as I } from "./shared/elevation.es.js";
|
|
3
|
+
import { Fragment as T } from "react";
|
|
4
|
+
import i from "@mui/material/Stack";
|
|
5
|
+
import { Text as m } from "@mxenabled/mxui";
|
|
6
|
+
import { Fragment as b, jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import g from "@mui/material/Box";
|
|
8
|
+
import u from "@mui/material/Divider";
|
|
9
|
+
var S = (n) => n === "primary" ? {
|
|
9
10
|
radius: "8px",
|
|
10
11
|
borderColor: "primary.main",
|
|
11
12
|
headerBg: "primary.main",
|
|
@@ -29,91 +30,110 @@ var w = (n) => n === "primary" ? {
|
|
|
29
30
|
px: 16,
|
|
30
31
|
py: 2
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
const e =
|
|
33
|
+
}, V = ({ background: n, badge: c, elevated: B = !1, footer: l, header: d, rows: x, variant: y = "default", sx: v }) => {
|
|
34
|
+
if (x.length === 0) return null;
|
|
35
|
+
const e = S(y), o = !!n, t = o ? "8px" : e.radius, s = !!d && !o && e.headerInsideBorder, p = d ? /* @__PURE__ */ r(i, {
|
|
35
36
|
sx: {
|
|
36
37
|
bgcolor: e.headerBg,
|
|
37
38
|
justifyContent: "center",
|
|
38
39
|
...e.headerSx
|
|
39
40
|
},
|
|
40
|
-
children: /* @__PURE__ */ r(
|
|
41
|
+
children: /* @__PURE__ */ r(m, {
|
|
41
42
|
bold: e.headerBold,
|
|
42
43
|
color: e.headerColor,
|
|
43
44
|
variant: "caption",
|
|
44
45
|
children: d
|
|
45
46
|
})
|
|
46
|
-
}) : null,
|
|
47
|
+
}) : null, C = l ? /* @__PURE__ */ a(b, { children: [/* @__PURE__ */ r(u, {}), /* @__PURE__ */ a(i, {
|
|
47
48
|
sx: {
|
|
48
49
|
alignItems: "center",
|
|
49
|
-
bgcolor:
|
|
50
|
+
bgcolor: o ? "background.paper" : "background.default",
|
|
50
51
|
flexDirection: "row",
|
|
51
52
|
justifyContent: "space-between",
|
|
52
53
|
minHeight: 40,
|
|
53
54
|
px: 16,
|
|
54
55
|
py: 2
|
|
55
56
|
},
|
|
56
|
-
children: [/* @__PURE__ */ r(
|
|
57
|
+
children: [/* @__PURE__ */ r(m, {
|
|
57
58
|
color: "text.secondary",
|
|
58
59
|
variant: "caption",
|
|
59
60
|
children: l.label
|
|
60
|
-
}), /* @__PURE__ */ r(
|
|
61
|
+
}), /* @__PURE__ */ r(m, {
|
|
61
62
|
bold: !0,
|
|
62
63
|
color: l.amountColor ?? "text.primary",
|
|
63
64
|
variant: "body2",
|
|
64
65
|
children: l.amount
|
|
65
66
|
})]
|
|
66
|
-
})] }) : null,
|
|
67
|
+
})] }) : null, w = /* @__PURE__ */ r(i, {
|
|
67
68
|
role: "list",
|
|
68
69
|
sx: { width: "100%" },
|
|
69
|
-
children:
|
|
70
|
+
children: x.map((h, f) => /* @__PURE__ */ a(T, { children: [f > 0 && /* @__PURE__ */ r(u, { role: "presentation" }), /* @__PURE__ */ r(g, {
|
|
70
71
|
role: "listitem",
|
|
71
|
-
children: /* @__PURE__ */ r(
|
|
72
|
-
})] },
|
|
72
|
+
children: /* @__PURE__ */ r(R, { ...h })
|
|
73
|
+
})] }, f))
|
|
73
74
|
});
|
|
74
|
-
return /* @__PURE__ */ a(
|
|
75
|
+
return /* @__PURE__ */ a(i, {
|
|
75
76
|
"data-testid": "transaction-list-card",
|
|
76
77
|
sx: {
|
|
77
|
-
...
|
|
78
|
+
...o ? {
|
|
78
79
|
background: n,
|
|
79
80
|
p: 16
|
|
80
81
|
} : {
|
|
81
82
|
pt: 8,
|
|
82
83
|
px: 16
|
|
83
84
|
},
|
|
85
|
+
...o && c ? { position: "relative" } : {},
|
|
84
86
|
width: "100%",
|
|
85
|
-
...
|
|
87
|
+
...v
|
|
86
88
|
},
|
|
87
|
-
children: [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}), /* @__PURE__ */ a(t, {
|
|
95
|
-
sx: {
|
|
96
|
-
...i ? { bgcolor: "background.paper" } : {
|
|
97
|
-
border: "1px solid",
|
|
98
|
-
borderColor: e.borderColor
|
|
89
|
+
children: [
|
|
90
|
+
o && c && /* @__PURE__ */ r(g, {
|
|
91
|
+
sx: {
|
|
92
|
+
left: 16,
|
|
93
|
+
position: "absolute",
|
|
94
|
+
top: 12,
|
|
95
|
+
zIndex: 1
|
|
99
96
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
children: c
|
|
98
|
+
}),
|
|
99
|
+
!s && p && /* @__PURE__ */ r(i, {
|
|
100
|
+
sx: {
|
|
101
|
+
borderTopLeftRadius: t,
|
|
102
|
+
borderTopRightRadius: t,
|
|
103
|
+
overflow: "hidden"
|
|
104
|
+
},
|
|
105
|
+
children: p
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ a(i, {
|
|
108
|
+
sx: {
|
|
109
|
+
...o ? {
|
|
110
|
+
bgcolor: "background.paper",
|
|
111
|
+
...B && {
|
|
112
|
+
backgroundImage: (h) => I(h, 1),
|
|
113
|
+
boxShadow: k[1]
|
|
114
|
+
}
|
|
115
|
+
} : {
|
|
116
|
+
border: "1px solid",
|
|
117
|
+
borderColor: e.borderColor
|
|
118
|
+
},
|
|
119
|
+
borderBottomLeftRadius: t,
|
|
120
|
+
borderBottomRightRadius: t,
|
|
121
|
+
borderTopLeftRadius: s || !d ? t : 0,
|
|
122
|
+
borderTopRightRadius: s || !d ? t : 0,
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
width: "100%"
|
|
125
|
+
},
|
|
126
|
+
children: [
|
|
127
|
+
s && /* @__PURE__ */ a(b, { children: [p, /* @__PURE__ */ r(u, {})] }),
|
|
128
|
+
w,
|
|
129
|
+
C
|
|
130
|
+
]
|
|
131
|
+
})
|
|
132
|
+
]
|
|
113
133
|
});
|
|
114
134
|
};
|
|
115
135
|
export {
|
|
116
|
-
|
|
136
|
+
V as default
|
|
117
137
|
};
|
|
118
138
|
|
|
119
139
|
//# sourceMappingURL=TransactionListCard.es.js.map
|