@mx-cartographer/experiences 9.7.51 → 9.7.53
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 +10 -0
- package/dist/common/utils/PostMessage.d.ts +14 -0
- package/dist/common/utils/PostMessage.es.js +33 -24
- package/dist/common/utils/PostMessage.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/InsightsInstanceSlotData.d.ts +10 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +9 -9
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.d.ts +6 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +74 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +32 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +57 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/AmountPill.es.js +9 -8
- package/dist/insights-v2/components/AmountPill.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +97 -90
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/MerchantHighlightCard.es.js +4 -4
- package/dist/insights-v2/components/celebrationGradients.d.ts +3 -0
- package/dist/insights-v2/components/celebrationGradients.es.js +5 -4
- package/dist/insights-v2/components/celebrationGradients.es.js.map +1 -1
- package/dist/insights-v2/components/statusTokens.d.ts +5 -0
- package/dist/insights-v2/components/statusTokens.es.js +5 -0
- package/dist/insights-v2/components/statusTokens.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +88 -86
- package/dist/insights-v2/mappings/blocks.es.js +78 -76
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.ts"],"sourcesContent":["import {\n ERROR_WASH_GRADIENT,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport { STATUS_ERROR_TOKENS, STATUS_SUCCESS_TOKENS } from '../../../components/statusTokens'\n\n/**\n * Design branches of the Merchant component block (architecture doc, Merchant row): one\n * highlighted merchant (`single_*`, `MerchantHighlightCard`) or a row of merchant tiles\n * (`multiple_*`, `LogoClusterCard`), each plain, celebrated (`success`) or flagged (`error`).\n */\nexport const merchantBlockVariant = {\n SingleStandard: 'single_standard',\n SingleLarge: 'single_large',\n SingleSuccess: 'single_success',\n SingleError: 'single_error',\n MultipleStandard: 'multiple_standard',\n MultipleSuccess: 'multiple_success',\n MultipleError: 'multiple_error',\n} as const\n\nexport type MerchantBlockVariant = (typeof merchantBlockVariant)[keyof typeof merchantBlockVariant]\n\nexport type MerchantStatus = 'success' | 'error'\n\nexport interface MerchantBlockLayoutConfig {\n kind: 'single' | 'multiple'\n /** Single: the amount as a dark pill or plain text. */\n amountVariant?: 'pill' | 'text'\n /** A wash layered over the card. */\n background?: string\n /** Draws `status_text` in a pill of this tone: beside the single name, under the multiple row. */\n status?: MerchantStatus\n}\n\nexport const STATUS_PILL_TOKENS: Record<\n MerchantStatus,\n { bgcolor: string; borderColor: string; textColor: string; icon: string }\n> = {\n success: { ...STATUS_SUCCESS_TOKENS, icon: 'check_circle' },\n error: { ...STATUS_ERROR_TOKENS, icon: 'error' },\n}\n\nconst SINGLE_LARGE: MerchantBlockLayoutConfig = { kind: 'single', amountVariant: 'pill' }\n\nexport const MERCHANT_LAYOUT: Record<MerchantBlockVariant, MerchantBlockLayoutConfig> = {\n single_standard: { kind: 'single', amountVariant: 'text' },\n single_large: SINGLE_LARGE,\n single_success: { ...SINGLE_LARGE, background: WARM_LIME_ACCENT_GRADIENT, status: 'success' },\n single_error: { ...SINGLE_LARGE, background: ERROR_WASH_GRADIENT, status: 'error' },\n multiple_standard: { kind: 'multiple' },\n multiple_success: { kind: 'multiple', background: WARM_LIME_ACCENT_GRADIENT, status: 'success' },\n multiple_error: { kind: 'multiple', background: ERROR_WASH_GRADIENT, status: 'error' },\n}\n"],"mappings":";;AAWA,IAAa,IAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,eAAe;AACjB,GAgBa,IAGT;AAAA,EACF,SAAS;AAAA,IAAE,GAAG;AAAA,IAAuB,MAAM;AAAA,EAAe;AAAA,EAC1D,OAAO;AAAA,IAAE,GAAG;AAAA,IAAqB,MAAM;AAAA,EAAQ;AACjD,GAEM,IAA0C;AAAA,EAAE,MAAM;AAAA,EAAU,eAAe;AAAO,GAE3E,IAA2E;AAAA,EACtF,iBAAiB;AAAA,IAAE,MAAM;AAAA,IAAU,eAAe;AAAA,EAAO;AAAA,EACzD,cAAc;AAAA,EACd,gBAAgB;AAAA,IAAE,GAAG;AAAA,IAAc,YAAY;AAAA,IAA2B,QAAQ;AAAA,EAAU;AAAA,EAC5F,cAAc;AAAA,IAAE,GAAG;AAAA,IAAc,YAAY;AAAA,IAAqB,QAAQ;AAAA,EAAQ;AAAA,EAClF,mBAAmB,EAAE,MAAM,WAAW;AAAA,EACtC,kBAAkB;AAAA,IAAE,MAAM;AAAA,IAAY,YAAY;AAAA,IAA2B,QAAQ;AAAA,EAAU;AAAA,EAC/F,gBAAgB;AAAA,IAAE,MAAM;AAAA,IAAY,YAAY;AAAA,IAAqB,QAAQ;AAAA,EAAQ;AACvF"}
|
|
@@ -4,6 +4,7 @@ export * from './BudgetBlock';
|
|
|
4
4
|
export * from './DebtsBlock';
|
|
5
5
|
export * from './DetailedAccountBlock';
|
|
6
6
|
export * from './GoalsBlock';
|
|
7
|
+
export * from './MerchantBlock';
|
|
7
8
|
export * from './NoSpendDaysBlock';
|
|
8
9
|
export * from './RepeatingTransactionBlock';
|
|
9
10
|
export * from './SaveExtraBlock';
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { jsx as
|
|
1
|
+
import { Text as e } from "@mxenabled/mxui";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import i from "@mui/material/Box";
|
|
4
|
-
var
|
|
4
|
+
var p = ({ children: r, px: a = 16, sx: o }) => /* @__PURE__ */ t(i, {
|
|
5
|
+
"data-testid": "amount-pill",
|
|
5
6
|
sx: {
|
|
6
7
|
alignItems: "center",
|
|
7
8
|
alignSelf: "flex-start",
|
|
8
9
|
bgcolor: "text.primary",
|
|
9
10
|
borderRadius: 999,
|
|
10
11
|
display: "flex",
|
|
11
|
-
px:
|
|
12
|
+
px: a,
|
|
12
13
|
py: 2,
|
|
13
|
-
...
|
|
14
|
+
...o
|
|
14
15
|
},
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ t(e, {
|
|
16
17
|
color: "primary.contrastText",
|
|
17
18
|
variant: "subtitle2",
|
|
18
|
-
children:
|
|
19
|
+
children: r
|
|
19
20
|
})
|
|
20
21
|
});
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
+
p as default
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
//# sourceMappingURL=AmountPill.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountPill.es.js","names":[],"sources":["../../../src/insights-v2/components/AmountPill.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\ninterface AmountPillProps {\n /** Pill content (amount / price string). */\n children: ReactNode\n /** Horizontal padding in px (Figma varies: 16 inline, 10 in the hero). */\n px?: number\n sx?: SxProps\n}\n\n/**\n * A dark rounded amount/price pill: `text.primary` surface with\n * `primary.contrastText` `subtitle2` text. Shared by MerchantHighlightCard and\n * SubscriptionHeroCard.\n */\nconst AmountPill = ({ children, px = 16, sx }: AmountPillProps) => (\n <Box\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor: 'text.primary',\n borderRadius: 999,\n display: 'flex',\n px,\n py: 2,\n ...sx,\n }}\n >\n <Text color=\"primary.contrastText\" variant=\"subtitle2\">\n {children}\n </Text>\n </Box>\n)\n\nexport default AmountPill\n"],"mappings":";;;AAoBA,IAAM,IAAA,CAAc,EAAE,UAAA,GAAU,IAAA,IAAK,IAAI,IAAA,EAAA,MACvC,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,IACT,cAAc;AAAA,IACd,SAAS;AAAA,IACT,IAAA;AAAA,IACA,IAAI;AAAA,IACJ,GAAG;AAAA,EACL;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAuB,SAAQ;AAAA,IACxC,UAAA;AAAA,EACG,CAAA;AACH,CAAA"}
|
|
1
|
+
{"version":3,"file":"AmountPill.es.js","names":[],"sources":["../../../src/insights-v2/components/AmountPill.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\ninterface AmountPillProps {\n /** Pill content (amount / price string). */\n children: ReactNode\n /** Horizontal padding in px (Figma varies: 16 inline, 10 in the hero). */\n px?: number\n sx?: SxProps\n}\n\n/**\n * A dark rounded amount/price pill: `text.primary` surface with\n * `primary.contrastText` `subtitle2` text. Shared by MerchantHighlightCard and\n * SubscriptionHeroCard.\n */\nconst AmountPill = ({ children, px = 16, sx }: AmountPillProps) => (\n <Box\n data-testid=\"amount-pill\"\n sx={{\n alignItems: 'center',\n alignSelf: 'flex-start',\n bgcolor: 'text.primary',\n borderRadius: 999,\n display: 'flex',\n px,\n py: 2,\n ...sx,\n }}\n >\n <Text color=\"primary.contrastText\" variant=\"subtitle2\">\n {children}\n </Text>\n </Box>\n)\n\nexport default AmountPill\n"],"mappings":";;;AAoBA,IAAM,IAAA,CAAc,EAAE,UAAA,GAAU,IAAA,IAAK,IAAI,IAAA,EAAA,MACvC,gBAAA,EAAC,GAAD;AAAA,EACE,eAAY;AAAA,EACZ,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,IACT,cAAc;AAAA,IACd,SAAS;AAAA,IACT,IAAA;AAAA,IACA,IAAI;AAAA,IACJ,GAAG;AAAA,EACL;AAAA,EAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAuB,SAAQ;AAAA,IACxC,UAAA;AAAA,EACG,CAAA;AACH,CAAA"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
1
|
+
import { useAppConfig as z, useGlobalCopyStore as K, useGlobalStore as W, useInsightsV2Store as X } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { sendClientConfiguredCta as Y } from "../../common/utils/PostMessage.es.js";
|
|
3
|
+
import { BeatActionsProvider as $ } from "../beatActions.es.js";
|
|
4
|
+
import { isContactSupportCtaDisabled as q } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
5
|
+
import { reportCtaClick as J } from "../ctaActions/runCtaAction.es.js";
|
|
6
|
+
import { useBeatCtaActions as Q } from "../ctaActions/useCtaAction.es.js";
|
|
7
|
+
import { actionBlocksKey as Z } from "../mappings/actionBlocksKey.es.js";
|
|
8
|
+
import { logoFromRef as oo } from "./shared/EntityLogo.es.js";
|
|
9
|
+
import eo from "./FeedbackDialog.es.js";
|
|
10
|
+
import { ErrorCard as io } from "./ErrorCard.es.js";
|
|
11
|
+
import { blocks as to } from "../mappings/blocks.es.js";
|
|
12
|
+
import { ActionBlockLayer as ro } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
13
|
+
import no from "./Footer.es.js";
|
|
14
|
+
import so from "./Header.es.js";
|
|
15
|
+
import { FeedbackBar as ao } from "./FeedbackBar.es.js";
|
|
16
|
+
import { DismissInsightDialog as lo } from "./DismissInsightDialog.es.js";
|
|
17
|
+
import { HiddenConfirmationCard as co } from "./HiddenConfirmationCard.es.js";
|
|
18
|
+
import { LoadingCard as mo } from "./LoadingCard.es.js";
|
|
19
|
+
import { ObsolesceBanner as po } from "./ObsolesceBanner.es.js";
|
|
20
|
+
import { useBeatFeedbackFlow as uo } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
21
|
+
import { useMemo as fo } from "react";
|
|
22
|
+
import { observer as Co } from "mobx-react-lite";
|
|
23
|
+
import y from "@mui/material/Stack";
|
|
24
|
+
import { P as bo } from "@mxenabled/mxui";
|
|
25
|
+
import d from "@mui/material/Button";
|
|
25
26
|
import { ChevronRight as T } from "@mxenabled/mx-icons";
|
|
26
|
-
import { Fragment as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
var
|
|
27
|
+
import { Fragment as go, jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
28
|
+
import ho from "@mui/material/Box";
|
|
29
|
+
import yo from "@mui/material/Card";
|
|
30
|
+
var _o = {}, ko = {
|
|
30
31
|
position: "absolute",
|
|
31
32
|
top: 0,
|
|
32
33
|
left: 0,
|
|
@@ -35,7 +36,7 @@ var ho = {}, yo = {
|
|
|
35
36
|
backgroundColor: "background.default",
|
|
36
37
|
opacity: 0.7,
|
|
37
38
|
zIndex: 3
|
|
38
|
-
},
|
|
39
|
+
}, vo = {
|
|
39
40
|
alignItems: "center",
|
|
40
41
|
alignSelf: "flex-start",
|
|
41
42
|
display: "flex",
|
|
@@ -43,44 +44,51 @@ var ho = {}, yo = {
|
|
|
43
44
|
height: 44,
|
|
44
45
|
px: 2,
|
|
45
46
|
textTransform: "none"
|
|
46
|
-
},
|
|
47
|
-
const
|
|
47
|
+
}, Qo = Co(({ beat: i, beatActions: s = _o, obsolete: f, isLoading: O = !1, isError: I = !1 }) => {
|
|
48
|
+
const A = K(), F = X(), { config: E } = z(), o = uo(i, s), _ = W(), { runCta: M, primary: k, secondary: v } = Q(i, s, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), p = i.insights_payload?.widget_type === "mini", N = fo(() => ({
|
|
48
49
|
...o.wrappedActions,
|
|
49
50
|
beat: i
|
|
50
51
|
}), [o.wrappedActions, i]);
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
const { instance_slot:
|
|
55
|
-
logo:
|
|
56
|
-
text:
|
|
57
|
-
} : void 0),
|
|
58
|
-
if (!
|
|
59
|
-
if (
|
|
60
|
-
|
|
52
|
+
if (I) return /* @__PURE__ */ e(io, {});
|
|
53
|
+
const t = i.insights_payload;
|
|
54
|
+
if (!t || o.cardState === "dismissed") return null;
|
|
55
|
+
const { instance_slot: R, primary_cta: r, secondary_cta: a, sub_title: G, title: H, guid: x, dismissed_at: P } = t, { block: V } = R, U = G ?? (t.subtitle ? {
|
|
56
|
+
logo: oo(t.logo),
|
|
57
|
+
text: t.subtitle
|
|
58
|
+
} : void 0), u = (n) => q(n, E, s.onContactSupport), S = async (n, c) => {
|
|
59
|
+
if (!u(c.block)) {
|
|
60
|
+
if (c.block === Z.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
61
|
+
J({
|
|
61
62
|
beat: i,
|
|
62
|
-
stores:
|
|
63
|
+
stores: _,
|
|
63
64
|
hostActions: s,
|
|
64
|
-
slot:
|
|
65
|
+
slot: n
|
|
65
66
|
}), s.onContactSupport?.();
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
await
|
|
69
|
+
await M(n, c);
|
|
69
70
|
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
}, w = to[V], l = t.in_description_cta, C = !p && l?.label && l.block ? l : void 0, b = r?.label || (C ? void 0 : l?.label) || void 0, B = !p && !!r?.label, D = i.in_description_cta || i.html_in_description_cta, j = () => {
|
|
72
|
+
const { is_mobile_webview: n, clientConfig: c } = _.appDataStore.appConfig;
|
|
73
|
+
Y(i.template, {
|
|
74
|
+
isMobileWebview: n,
|
|
75
|
+
webviewScheme: c?.master?.ui_message_webview_url_scheme,
|
|
76
|
+
userGuid: t.user_guid ?? i.user_guid
|
|
77
|
+
});
|
|
78
|
+
}, L = !p && !!a?.label, g = A.insights_feed?.general, h = f?.state === "not_refreshable" && !P && !!g;
|
|
79
|
+
return /* @__PURE__ */ e($, {
|
|
80
|
+
value: N,
|
|
81
|
+
children: /* @__PURE__ */ m(y, {
|
|
74
82
|
sx: { mb: 16 },
|
|
75
83
|
children: [
|
|
76
|
-
o.cardState === "confirming" ? /* @__PURE__ */
|
|
84
|
+
o.cardState === "confirming" ? /* @__PURE__ */ e(co, {
|
|
77
85
|
onClose: o.collapseConfirmation,
|
|
78
86
|
onLeaveFeedback: o.openHideSurvey,
|
|
79
87
|
onUndo: o.undoDismiss
|
|
80
|
-
}) : /* @__PURE__ */
|
|
88
|
+
}) : /* @__PURE__ */ m(go, { children: [f && g && /* @__PURE__ */ e(po, {
|
|
81
89
|
...f,
|
|
82
|
-
copy:
|
|
83
|
-
}), /* @__PURE__ */
|
|
90
|
+
copy: g
|
|
91
|
+
}), /* @__PURE__ */ m(yo, {
|
|
84
92
|
inert: h,
|
|
85
93
|
sx: { ...h && {
|
|
86
94
|
position: "relative",
|
|
@@ -88,17 +96,17 @@ var ho = {}, yo = {
|
|
|
88
96
|
pointerEvents: "none"
|
|
89
97
|
} },
|
|
90
98
|
children: [
|
|
91
|
-
h && /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
isMini:
|
|
94
|
-
subtitle:
|
|
99
|
+
h && /* @__PURE__ */ e(ho, { sx: ko }),
|
|
100
|
+
/* @__PURE__ */ e(so, {
|
|
101
|
+
isMini: p,
|
|
102
|
+
subtitle: U,
|
|
95
103
|
title: H ?? ""
|
|
96
104
|
}),
|
|
97
|
-
|
|
98
|
-
beatGuid:
|
|
99
|
-
payload:
|
|
105
|
+
O ? /* @__PURE__ */ e(mo, {}) : w && /* @__PURE__ */ e(w, {
|
|
106
|
+
beatGuid: x,
|
|
107
|
+
payload: t
|
|
100
108
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ m(y, {
|
|
102
110
|
sx: {
|
|
103
111
|
gap: 6,
|
|
104
112
|
pb: 16,
|
|
@@ -106,14 +114,14 @@ var ho = {}, yo = {
|
|
|
106
114
|
px: 16
|
|
107
115
|
},
|
|
108
116
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
dangerouslySetInnerHTML: { __html:
|
|
117
|
+
/* @__PURE__ */ e(bo, {
|
|
118
|
+
dangerouslySetInnerHTML: { __html: t.description.html_text },
|
|
111
119
|
variant: "subtitle2"
|
|
112
120
|
}),
|
|
113
|
-
|
|
114
|
-
endIcon: /* @__PURE__ */
|
|
115
|
-
onClick: () =>
|
|
116
|
-
guid:
|
|
121
|
+
C && /* @__PURE__ */ e(d, {
|
|
122
|
+
endIcon: /* @__PURE__ */ e(T, {}),
|
|
123
|
+
onClick: () => F.openActionDrawer({
|
|
124
|
+
guid: x,
|
|
117
125
|
trigger: "inDescriptionCta"
|
|
118
126
|
}),
|
|
119
127
|
sx: {
|
|
@@ -121,63 +129,62 @@ var ho = {}, yo = {
|
|
|
121
129
|
p: 4,
|
|
122
130
|
width: "max-content"
|
|
123
131
|
},
|
|
124
|
-
children:
|
|
132
|
+
children: C.label
|
|
125
133
|
}),
|
|
126
|
-
!
|
|
127
|
-
endIcon: /* @__PURE__ */
|
|
128
|
-
onClick:
|
|
129
|
-
},
|
|
134
|
+
!l?.label && D && /* @__PURE__ */ e(d, {
|
|
135
|
+
endIcon: /* @__PURE__ */ e(T, {}),
|
|
136
|
+
onClick: j,
|
|
130
137
|
sx: {
|
|
131
138
|
height: 24,
|
|
132
139
|
p: 4,
|
|
133
140
|
width: "max-content"
|
|
134
141
|
},
|
|
135
|
-
children:
|
|
142
|
+
children: D
|
|
136
143
|
})
|
|
137
144
|
]
|
|
138
145
|
}),
|
|
139
|
-
(b ||
|
|
146
|
+
(b || L) && /* @__PURE__ */ m(y, {
|
|
140
147
|
sx: {
|
|
141
148
|
gap: 8,
|
|
142
149
|
pb: 16,
|
|
143
150
|
px: 16
|
|
144
151
|
},
|
|
145
152
|
children: [
|
|
146
|
-
b && !B && /* @__PURE__ */
|
|
147
|
-
sx:
|
|
153
|
+
b && !B && /* @__PURE__ */ e(d, {
|
|
154
|
+
sx: vo,
|
|
148
155
|
variant: "text",
|
|
149
156
|
children: b
|
|
150
157
|
}),
|
|
151
|
-
B && r && /* @__PURE__ */
|
|
152
|
-
"aria-disabled":
|
|
158
|
+
B && r && /* @__PURE__ */ e(d, {
|
|
159
|
+
"aria-disabled": u(r.block) || k.disabled,
|
|
153
160
|
disabled: k.disabled,
|
|
154
|
-
onClick: () =>
|
|
155
|
-
sx: { ...
|
|
161
|
+
onClick: () => S("primary", r),
|
|
162
|
+
sx: { ...u(r.block) && { color: "text.disabled" } },
|
|
156
163
|
variant: "outlined",
|
|
157
164
|
children: r.label
|
|
158
165
|
}),
|
|
159
|
-
|
|
160
|
-
"aria-disabled":
|
|
166
|
+
L && a && /* @__PURE__ */ e(d, {
|
|
167
|
+
"aria-disabled": u(a.block) || v.disabled,
|
|
161
168
|
color: "secondary",
|
|
162
|
-
disabled:
|
|
163
|
-
onClick: () =>
|
|
164
|
-
children:
|
|
169
|
+
disabled: v.disabled,
|
|
170
|
+
onClick: () => S("secondary", a),
|
|
171
|
+
children: a.label
|
|
165
172
|
})
|
|
166
173
|
]
|
|
167
174
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ e(ao, {
|
|
169
176
|
onTellUsMore: o.openRatingSurvey,
|
|
170
177
|
show: o.isFeedbackBarShown
|
|
171
178
|
})
|
|
172
179
|
]
|
|
173
180
|
})] }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ e(ro, { beat: i }),
|
|
182
|
+
/* @__PURE__ */ e(lo, {
|
|
176
183
|
isOpen: o.isDismissOpen,
|
|
177
184
|
onClose: o.closeDismissDialog,
|
|
178
185
|
onDismiss: o.confirmDismiss
|
|
179
186
|
}),
|
|
180
|
-
o.isSurveyOpen && /* @__PURE__ */
|
|
187
|
+
o.isSurveyOpen && /* @__PURE__ */ e(eo, {
|
|
181
188
|
characterLimitLabel: o.survey.characterLimitLabel,
|
|
182
189
|
closeAriaLabel: o.survey.closeAriaLabel,
|
|
183
190
|
isOpen: !0,
|
|
@@ -190,13 +197,13 @@ var ho = {}, yo = {
|
|
|
190
197
|
secondaryText: o.survey.backText,
|
|
191
198
|
title: o.survey.title
|
|
192
199
|
}),
|
|
193
|
-
o.cardState === "visible" &&
|
|
200
|
+
o.cardState === "visible" && t.footer && /* @__PURE__ */ e(no, { footer: t.footer })
|
|
194
201
|
]
|
|
195
202
|
})
|
|
196
203
|
});
|
|
197
204
|
});
|
|
198
205
|
export {
|
|
199
|
-
|
|
206
|
+
Qo as default
|
|
200
207
|
};
|
|
201
208
|
|
|
202
209
|
//# sourceMappingURL=BaseLayout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* V1: the legacy field, shown for beats that do not send the envelope link. */}\n {!inDescriptionCta?.label && beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QA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UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,IACT,EACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAAK,kBAAkB,aACzB,GAGM,IAAS,EAAK,kBAAkB,gBAAgB,QAIhD,IAAmB,GAAA,OAChB;AAAA,IAAE,GAAG,EAAK;AAAA,IAAgB,MAAA;AAAA,EAAK,IACtC,CAAC,EAAK,gBAAgB,CAAI,CAC5B;AAGA,MAAI,EAAS,QAAO,gBAAA,EAAC,IAAD,CAAY,CAAA;AAEhC,QAAM,IAAmB,EAAK;AA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;AAAA,kBAE1D,OAAM;AAAA,kBACN,UAAU,EAAkB;AAAA,kBAC5B,SAAA,MAAe,EAAW,aAAa,CAAa;AAAA,kBAEnD,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import v from "./
|
|
2
|
-
import w from "./
|
|
1
|
+
import v from "./LogoTile.es.js";
|
|
2
|
+
import w from "./AmountPill.es.js";
|
|
3
3
|
import i from "@mui/material/Stack";
|
|
4
4
|
import { Text as l } from "@mxenabled/mxui";
|
|
5
5
|
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
var A = ({ amount: t, amountVariant: o = "text", background: n, bgcolor: h = "grey.200", borderColor: d, eyebrow: a, logo: p, logoShadow: s = !0, name: x, nameVariant: m, trailing: u, sx: f }) => {
|
|
7
7
|
const g = m ?? (o === "pill" ? "h2" : "h3");
|
|
8
8
|
let e = u;
|
|
9
|
-
return e == null && t != null && (e = o === "pill" ? /* @__PURE__ */ r(
|
|
9
|
+
return e == null && t != null && (e = o === "pill" ? /* @__PURE__ */ r(w, { children: t }) : /* @__PURE__ */ r(l, {
|
|
10
10
|
color: "text.secondary",
|
|
11
11
|
variant: "body1",
|
|
12
12
|
children: t
|
|
@@ -30,7 +30,7 @@ var A = ({ amount: t, amountVariant: o = "text", background: n, bgcolor: h = "gr
|
|
|
30
30
|
p: 16,
|
|
31
31
|
width: "100%"
|
|
32
32
|
},
|
|
33
|
-
children: [/* @__PURE__ */ r(
|
|
33
|
+
children: [/* @__PURE__ */ r(v, {
|
|
34
34
|
shadow: s,
|
|
35
35
|
children: p
|
|
36
36
|
}), /* @__PURE__ */ c(i, {
|
|
@@ -7,6 +7,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
7
7
|
* - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.
|
|
8
8
|
* - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.
|
|
9
9
|
* - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).
|
|
10
|
+
* - ERROR_WASH_GRADIENT: an account or merchant needing attention (Low Account Balance, off-track status).
|
|
10
11
|
* - getPrimaryWashGradient(theme): pending connect / detected subscription, from the palette.
|
|
11
12
|
*/
|
|
12
13
|
/**
|
|
@@ -30,6 +31,8 @@ export declare const ACCOUNT_CONNECTED_GRADIENT = "linear-gradient(257deg, rgba(
|
|
|
30
31
|
* stays a literal like the other washes here rather than being derived from `palette.warning`.
|
|
31
32
|
*/
|
|
32
33
|
export declare const WARNING_WASH_GRADIENT = "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)";
|
|
34
|
+
/** Red wash at 20% opacity behind a low balance, an off-track status or a flagged merchant. */
|
|
35
|
+
export declare const ERROR_WASH_GRADIENT = "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)";
|
|
33
36
|
/**
|
|
34
37
|
* Blue slot wash behind a pending connect / detected-subscription row: `primary.light` →
|
|
35
38
|
* `primary.main` at 75% over paper, built from the live palette so it follows the theme.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { alpha as a } from "@mui/material/styles";
|
|
2
|
-
var
|
|
2
|
+
var e = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)", i = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)", n = "linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)", d = "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)", A = "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)", E = ({ palette: r }) => `linear-gradient(173deg, ${a(r.primary.light, 0.75)} 46.41%, ${a(r.primary.main, 0.75)} 78.14%)`;
|
|
3
3
|
export {
|
|
4
4
|
n as ACCOUNT_CONNECTED_GRADIENT,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
i as CELEBRATION_GRADIENT,
|
|
6
|
+
A as ERROR_WASH_GRADIENT,
|
|
7
|
+
e as WARM_LIME_ACCENT_GRADIENT,
|
|
7
8
|
d as WARNING_WASH_GRADIENT,
|
|
8
|
-
|
|
9
|
+
E as getPrimaryWashGradient
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=celebrationGradients.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` is opaque and stands alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - getPrimaryWashGradient(theme): pending connect / detected subscription, from the palette.\n */\n\n/**\n * Warm → lime accent wash at 20% opacity. Used as a tinted background behind\n * merchant categorization highlights and deposit celebration callouts.\n */\nexport const WARM_LIME_ACCENT_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)'\n\n/** Warm → pink wash behind balance/savings milestones. */\nexport const CELEBRATION_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)'\n\n/** Peach → pink gradient for Discovered Accounts success state. */\nexport const DISCOVERED_ACCOUNTS_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 224, 153, 1) 1.86%, rgba(255, 129, 230, 1) 101.54%)'\n\n/**\n * Warm → pink wash at 20% opacity for the account-connected success state.\n * Layer over `background.paper` (the Figma spec's `#FFF` base), not the\n * `background` shorthand — a 20% gradient over transparency renders wrong.\n */\nexport const ACCOUNT_CONNECTED_GRADIENT =\n 'linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)'\n\n/**\n * Orange → red-orange wash at 25% opacity behind a flagged charge (Unexpected Subscription\n * Payment). Figma \"Warning Gradient 1\": a bespoke two-stop blend with no palette token, so it\n * stays a literal like the other washes here rather than being derived from `palette.warning`.\n */\nexport const WARNING_WASH_GRADIENT =\n 'linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)'\n\n/**\n * Blue slot wash behind a pending connect / detected-subscription row: `primary.light` →\n * `primary.main` at 75% over paper, built from the live palette so it follows the theme.\n */\nexport const getPrimaryWashGradient = ({ palette }: Theme) =>\n `linear-gradient(173deg, ${alpha(palette.primary.light, 0.75)} 46.41%, ${alpha(palette.primary.main, 0.75)} 78.14%)`\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"celebrationGradients.es.js","names":[],"sources":["../../../src/insights-v2/components/celebrationGradients.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\n/**\n * Decorative slot washes shared by the block layouts and the presentational components, so\n * one source holds each gradient. The 20%–25% washes layer over `background.paper` via\n * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` is opaque and stands alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: an account or merchant needing attention (Low Account Balance, off-track status).\n * - getPrimaryWashGradient(theme): pending connect / detected subscription, from the palette.\n */\n\n/**\n * Warm → lime accent wash at 20% opacity. Used as a tinted background behind\n * merchant categorization highlights and deposit celebration callouts.\n */\nexport const WARM_LIME_ACCENT_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)'\n\n/** Warm → pink wash behind balance/savings milestones. */\nexport const CELEBRATION_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)'\n\n/** Peach → pink gradient for Discovered Accounts success state. */\nexport const DISCOVERED_ACCOUNTS_GRADIENT =\n 'linear-gradient(200.73deg, rgba(255, 224, 153, 1) 1.86%, rgba(255, 129, 230, 1) 101.54%)'\n\n/**\n * Warm → pink wash at 20% opacity for the account-connected success state.\n * Layer over `background.paper` (the Figma spec's `#FFF` base), not the\n * `background` shorthand — a 20% gradient over transparency renders wrong.\n */\nexport const ACCOUNT_CONNECTED_GRADIENT =\n 'linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)'\n\n/**\n * Orange → red-orange wash at 25% opacity behind a flagged charge (Unexpected Subscription\n * Payment). Figma \"Warning Gradient 1\": a bespoke two-stop blend with no palette token, so it\n * stays a literal like the other washes here rather than being derived from `palette.warning`.\n */\nexport const WARNING_WASH_GRADIENT =\n 'linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)'\n\n/** Red wash at 20% opacity behind a low balance, an off-track status or a flagged merchant. */\nexport const ERROR_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)'\n\n/**\n * Blue slot wash behind a pending connect / detected-subscription row: `primary.light` →\n * `primary.main` at 75% over paper, built from the live palette so it follows the theme.\n */\nexport const getPrimaryWashGradient = ({ palette }: Theme) =>\n `linear-gradient(173deg, ${alpha(palette.primary.light, 0.75)} 46.41%, ${alpha(palette.primary.main, 0.75)} 78.14%)`\n"],"mappings":";AAkBA,IAAa,IACX,+FAGW,IACX,gGAWW,IACX,6FAOW,IACX,0FAGW,IACX,2FAMW,IAAA,CAA0B,EAAE,SAAA,EAAA,MACvC,2BAA2B,EAAM,EAAQ,QAAQ,OAAO,IAAI,CAAA,YAAa,EAAM,EAAQ,QAAQ,MAAM,IAAI,CAAA"}
|
|
@@ -10,3 +10,8 @@ export declare const STATUS_SUCCESS_TOKENS: {
|
|
|
10
10
|
readonly borderColor: "success.main";
|
|
11
11
|
readonly textColor: "success.darker";
|
|
12
12
|
};
|
|
13
|
+
export declare const STATUS_ERROR_TOKENS: {
|
|
14
|
+
readonly bgcolor: "error.lighter";
|
|
15
|
+
readonly borderColor: "error.main";
|
|
16
|
+
readonly textColor: "error.darker";
|
|
17
|
+
};
|
|
@@ -2,8 +2,13 @@ var r = {
|
|
|
2
2
|
bgcolor: "success.100",
|
|
3
3
|
borderColor: "success.main",
|
|
4
4
|
textColor: "success.darker"
|
|
5
|
+
}, o = {
|
|
6
|
+
bgcolor: "error.lighter",
|
|
7
|
+
borderColor: "error.main",
|
|
8
|
+
textColor: "error.darker"
|
|
5
9
|
};
|
|
6
10
|
export {
|
|
11
|
+
o as STATUS_ERROR_TOKENS,
|
|
7
12
|
r as STATUS_SUCCESS_TOKENS
|
|
8
13
|
};
|
|
9
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusTokens.es.js","names":[],"sources":["../../../src/insights-v2/components/statusTokens.ts"],"sourcesContent":["/**\n * Shared success/status color tokens for the insights-v2 status surfaces\n * (`StatusPill`, `StatusMessageCard`). Both render a check-icon + text on a\n * green tinted, bordered surface and differ only in geometry (pill vs\n * full-width card), so they share these defaults rather than each hardcoding\n * the same `success.*` tokens.\n */\nexport const STATUS_SUCCESS_TOKENS = {\n bgcolor: 'success.100',\n borderColor: 'success.main',\n textColor: 'success.darker',\n} as const\n"],"mappings":"AAOA,IAAa,IAAwB;AAAA,EACnC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb"}
|
|
1
|
+
{"version":3,"file":"statusTokens.es.js","names":[],"sources":["../../../src/insights-v2/components/statusTokens.ts"],"sourcesContent":["/**\n * Shared success/status color tokens for the insights-v2 status surfaces\n * (`StatusPill`, `StatusMessageCard`). Both render a check-icon + text on a\n * green tinted, bordered surface and differ only in geometry (pill vs\n * full-width card), so they share these defaults rather than each hardcoding\n * the same `success.*` tokens.\n */\nexport const STATUS_SUCCESS_TOKENS = {\n bgcolor: 'success.100',\n borderColor: 'success.main',\n textColor: 'success.darker',\n} as const\n\nexport const STATUS_ERROR_TOKENS = {\n bgcolor: 'error.lighter',\n borderColor: 'error.main',\n textColor: 'error.darker',\n} as const\n"],"mappings":"AAOA,IAAa,IAAwB;AAAA,EACnC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb,GAEa,IAAsB;AAAA,EACjC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb"}
|